diff --git a/App/lib/core/BuildPipeline.vp b/App/lib/core/BuildPipeline.vp index 0229506..21eefef 100644 --- a/App/lib/core/BuildPipeline.vp +++ b/App/lib/core/BuildPipeline.vp @@ -539,22 +539,13 @@ def _run_cmd_wait(cmd: str) -> int: sa.bInheritHandle = 1 si.cb = win32process.STARTUPINFOA.__sizeof__() # create_flags=0:子进程继承父控制台(输出直接显示,同 system 语义) - #region debug-point LLC4 - stdio.printf("[LLC-DBG] cp: 调用 CreateProcessA\n") - #endregion ok: int = win32process.CreateProcessA( t.CPtr(0), cmd_line, t.CPtr(0), t.CPtr(0), 1, 0, t.CPtr(0), t.CPtr(0), t.CPtr(c.Addr(si)), t.CPtr(c.Addr(pi))) stdlib.free(cmd_line) - #region debug-point LLC5 - stdio.printf("[LLC-DBG] cp: CreateProcessA 返回 ok=%d pid=%d\n", ok, pi.dwProcessId) - #endregion if ok == 0: return -1 win32sync.WaitForSingleObject(pi.hProcess, w32.win32base.INFINITE) - #region debug-point LLC6 - stdio.printf("[LLC-DBG] cp: 等待完成\n") - #endregion exit_code: t.CUInt32T = 0 win32process.GetExitCodeProcess(pi.hProcess, t.CPtr(c.Addr(exit_code))) w32.win32base.CloseHandle(pi.hProcess) @@ -568,24 +559,12 @@ def _llc_task_worker(arg: t.CPtr) -> t.CPtr: task: LlcTask | t.CPtr = (LlcTask | t.CPtr)(arg) if task is None: return t.CPtr(0) - #region debug-point LLC0 - stdio.printf("[LLC-DBG] worker 开始 sha1=%s cmd=%s\n", - (task.ModuleSha1 if task.ModuleSha1 is not None else "?"), - (task.LlcCmd if task.LlcCmd is not None else "?")) - #endregion if task.OptCmd is not None: opt_rc: int = _run_cmd_wait(task.OptCmd) - #region debug-point LLC1 - stdio.printf("[LLC-DBG] opt rc=%d\n", opt_rc) - #endregion if opt_rc != 0: task.Result = 1 return t.CPtr(0) llc_rc: int = _run_cmd_wait(task.LlcCmd) - #region debug-point LLC2 - stdio.printf("[LLC-DBG] llc rc=%d sha1=%s\n", llc_rc, - (task.ModuleSha1 if task.ModuleSha1 is not None else "?")) - #endregion if llc_rc != 0: task.Result = 1 else: @@ -612,12 +591,6 @@ def run_llc_parallel(tasks: bytes, task_count: int, max_threads: int) -> int: if handles is None: VLogger.error("run_llc_parallel: 线程句柄数组分配失败", "PhaseB") return 1 - #region debug-point LLC11 - stdio.printf("[LLC-DBG2] handles=%llx pool=%llx count=%d cap=%d elem=%d data=%llx\n", - t.CUInt64T(handles), t.CUInt64T(handles.__pool__), - handles.__count__, handles.__capacity__, handles.__elem_size__, - t.CUInt64T(handles.__data__)) - #endregion slot_size: t.CSizeT = LlcTask.__sizeof__() ret: int = 0 batch_start: int = 0 @@ -639,13 +612,7 @@ def run_llc_parallel(tasks: bytes, task_count: int, max_threads: int) -> int: j = 0 while j < batch_n: h_j: t.CPtr = t.CPtr(handles.get(batch_start + j)) - #region debug-point LLC7 - stdio.printf("[LLC-DBG] join 前 %d handle=%llx\n", j, t.CUInt64T(h_j)) - #endregion wr: t.CUInt32T = win32sync.WaitForSingleObject(h_j, 600000) - #region debug-point LLC8 - stdio.printf("[LLC-DBG] join 后 %d wait=%u\n", j, wr) - #endregion if wr != 0: VLogger.error("llc 线程 join 超时/失败(600 秒未完成)", "PhaseB") w32.win32base.CloseHandle(h_j) @@ -656,10 +623,6 @@ def run_llc_parallel(tasks: bytes, task_count: int, max_threads: int) -> int: tsk2: LlcTask | t.CPtr = (LlcTask | t.CPtr)(t.CVoid( t.CUInt64T(tasks) + t.CSizeT(batch_start + j) * slot_size, t.CPtr)) if tsk2 is not None and tsk2.Result != 0: - #region debug-point LLC3 - stdio.printf("[LLC-DBG] 失败槽 Result=%d sha1=%s\n", tsk2.Result, - (tsk2.ModuleSha1 if tsk2.ModuleSha1 is not None else "?")) - #endregion fb: str = VLogger.fmt_buf() if fb is not None: viperlib.snprintf(fb, 1024, "llc 编译失败: %s (cmd=%s)", diff --git a/App/lib/core/Gen/TypeGenResolve.vp b/App/lib/core/Gen/TypeGenResolve.vp index 1c846bd..bcffb5f 100644 --- a/App/lib/core/Gen/TypeGenResolve.vp +++ b/App/lib/core/Gen/TypeGenResolve.vp @@ -5,7 +5,6 @@ import llvmlite import memhub import string import viperlib -import stdio import stdlib import lib.core.VLogger as VLogger import lib.core.Handles.HandlesBase as HandlesBase @@ -1016,12 +1015,6 @@ class TypeGenResolve(TypeGenBase.TypeGenBase): # 本模块未定义时回退按裸名全局查找(import 来的类走此路径)。 if trans is not None and trans.ModuleSha1 is not None: own_entry: HandlesStruct.StructEntry | t.CPtr = HandlesStruct.find_struct_by_module(nm.id, trans.ModuleSha1) - #region debug-point ANNOT - stdio.printf("[DBG-ANNOT] resolve Name=%s modsha=%s own=%d vis=%d\n", - nm.id, trans.ModuleSha1, - (1 if own_entry is not None else 0), - (1 if HandlesStruct.is_struct_visible(nm.id) != 0 else 0)) - #endregion if own_entry is not None and own_entry.Ty is not None: # 有 __new__ 的类(堆对象)注解 → Ptr(struct)(引用语义,对齐 TPC)。 # 否则无 __new__ 的类(栈对象,如 Point)保持 struct 值语义: