chore: 清理调试打印与失效 import

CallGenCall.vp: 前次清理 DBG 打印后 import stdio 已无使用者,删除(该文件全文无 stdio. 调用,亦无经本模块的外部访问)

Test/App/nested_match_test.vp: 删除 _init_mbuddy 与 test_single_match 中的 8 处 [DBG] 进度打印;该测试的判定只看 --- Test N --- / OK / FAIL 行,test_main.vp 亦只取返回码,无断言引用这些文本

未改动任何逻辑(保留 FAIL: malloc for arena failed 等错误分支的真实输出)
This commit is contained in:
TermiNexus committed 2026-09-16 10:32:40 +08:00
1 parent 429de97083
commit b28f20cce7
2 files changed
+1 -10

No files matched your search

+1 -2
View File
@@ -4,7 +4,6 @@ import ast
import llvmlite
import memhub
import string
import stdio
import stdlib
import viperlib
import lib.core.Gen.Translator as HT
@@ -656,7 +655,7 @@ class CallGenCall(CallGenBase.CallGenBase):
# a83d183 的三处调用点:_translate_method_call / _translate_call_with_kwargs
# / CallGenDispatch 特化分支)。本路径此前直接用调用点实参类型建
# declare:泛型特化构造 `list[T](pool, 8)` 的 elem_size 字面量 i32 会把
# 定义侧 t.CSizeT(i64) 固化窄,且池实参(MemBuddy*/i8*)与定义侧
# 定义侧 sizet(i64) 固化窄,且池实参(MemBuddy*/i8*)与定义侧
# MemManager* 口径不一致 → 跨模块 declare/define 不一致并经 .stub.ll
# 传播到未调用该函数的消费方模块。泛型特化名({sha}.list[str].__new__)
# 的定义侧注解在模板类上,由 _coerce_args_to_def_params 的模板退查解析。
-8
View File
@@ -26,24 +26,17 @@ _NMATCH_POOL_SIZE: t.CDefine = 65536
def _init_mbuddy() -> int:
"""初始化内存池,返回 0=成功, 1=失败"""
global _mbuddy
stdio.printf("[DBG] _init_mbuddy: start\n")
arena: bytes = stdlib.malloc(_NMATCH_POOL_SIZE)
stdio.printf("[DBG] _init_mbuddy: malloc arena=%d\n", arena is None)
if arena is None:
stdio.printf("FAIL: malloc for arena failed\n")
return 1
mb: rowptr[memhub.MemBuddy] = stdlib.malloc(memhub.MemBuddy.__sizeof__())
stdio.printf("[DBG] _init_mbuddy: malloc mb=%d\n", mb is None)
if mb is None:
stdio.printf("FAIL: MemBuddy init failed\n")
return 1
stdio.printf("[DBG] _init_mbuddy: before_init\n")
mb.__before_init__()
stdio.printf("[DBG] _init_mbuddy: init\n")
mb.__init__(arena, sizet(_NMATCH_POOL_SIZE))
stdio.printf("[DBG] _init_mbuddy: store\n")
_mbuddy = mb
stdio.printf("[DBG] _init_mbuddy: done\n")
return 0
@@ -52,7 +45,6 @@ def test_single_match() -> int:
stdio.printf("--- Test 1: 单层 match LLVMType ---\n")
ty: llvmlite.LLVMType | t.CPtr = llvmlite.Int32(_mbuddy)
stdio.printf("[DBG] Int32 done: %d\n", ty is None)
if ty is None:
stdio.printf("FAIL: Int32 returned None\n")
return 1