From 59c032f1352a13efd31d2dbb49c3ad6b54ed2bb4 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Thu, 15 Oct 2026 22:53:23 +0800 Subject: [PATCH] =?UTF-8?q?chore(diag):=20CTOR-DIAG=20=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E6=9E=84=E9=80=A0=E7=B1=BB=E5=9E=8B=E4=B8=8E=E7=9B=AE=E6=A0=87?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E7=9C=9F=E5=AE=9E=20LLVM=20?= =?UTF-8?q?=E6=96=87=E6=9C=AC=20-=20=E5=AE=9A=E4=BD=8D=20CAM=20=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E5=80=BC=E6=9C=AC=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/lib/core/Gen/AssignGenMixin.vp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/App/lib/core/Gen/AssignGenMixin.vp b/App/lib/core/Gen/AssignGenMixin.vp index 142b0a0..00dad54 100644 --- a/App/lib/core/Gen/AssignGenMixin.vp +++ b/App/lib/core/Gen/AssignGenMixin.vp @@ -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: