chore(diag): CTOR-DIAG 打印构造类型与目标类型的真实 LLVM 文本 - 定位 CAM 全局值本位
This commit is contained in:
1 parent
23236c88ea
commit
59c032f135
1 file changed
+16
-5
@@ -1151,16 +1151,27 @@ novirtual class AssignGenMixin:
|
||||
# 目标位置是地址(`&T(...)`、指针目标、指针槽)才交出本帧地址 ⇒ LIFE_FRAME。
|
||||
if target_ty is not None and self.Gen.ExprGenBase.is_ptr_type(target_ty) == 0:
|
||||
return GenTypes.LIFE_VALUE
|
||||
# [TEMP-DIAG] 裸构造仍判帧生命期时的输入快照(定位完删除)
|
||||
# [TEMP-DIAG] 打印构造类型与目标类型的**真实 LLVM 文本**(定位完删除):
|
||||
# ct_ty 是 `T(...)` 自身的类型(`%"..T"` = 值本体 / `ptr` = 已被解析成指针)
|
||||
# tgt 是目标位置(模块级全局/值槽)的类型文本
|
||||
ctb: str = "?"
|
||||
bt1: str = trans.Pool.alloc_tagged(512, memhub.DETSITE_ASSIGNGEN_578)
|
||||
if bt1 is not None:
|
||||
mlirlite.TypePrint(bt1, 512, ct_ty, trans.Pool)
|
||||
ctb = bt1
|
||||
ttb: str = "(none)"
|
||||
if target_ty is not None:
|
||||
bt2: str = trans.Pool.alloc_tagged(512, memhub.DETSITE_ASSIGNGEN_579)
|
||||
if bt2 is not None:
|
||||
mlirlite.TypePrint(bt2, 512, target_ty, trans.Pool)
|
||||
ttb = bt2
|
||||
hv: int = -1
|
||||
if ct_en is not None: hv = ct_en.HasNew
|
||||
tptr: int = -1
|
||||
if target_ty is not None: tptr = self.Gen.ExprGenBase.is_ptr_type(target_ty)
|
||||
fn_c: str = None
|
||||
if trans._cur_func is not None: fn_c = mlirlite.function_get_name(trans._cur_func)
|
||||
if fn_c is None: fn_c = "?"
|
||||
stdio.printf("[CTOR-DIAG] fn=%s ctor=%s hasnew=%d tptr=%d tgt_none=%d\n",
|
||||
fn_c, ctor_nm, hv, tptr, 1 if target_ty is None else 0)
|
||||
stdio.printf("[CTOR-DIAG] fn=%s ctor=%s hasnew=%d ct_ty=%s tgt=%s\n",
|
||||
fn_c, ctor_nm, hv, ctb, ttb)
|
||||
return GenTypes.LIFE_FRAME
|
||||
return GenTypes.LIFE_UNKNOWN
|
||||
if k == ast.ASTKind.New:
|
||||
|
||||
Reference in new issue
Block a user