feat(gen): willFree 覆盖关键字实参、方法调用与取地址三条路径

关键字/混合实参:CallGenMixin._MarkWillFreeKwargs 按形参序(位置实参占前 can 个形参,其余按关键字名匹配)标记。方法调用:CallGenCall._translate_method_call 的 kwargs 与位置两条循环,实参链含 self 故用户第 ai 个实参对应 bit (ai+1);新增 GenApi/StructGenMixin.get_param_willfree_method(查 Class.method 并沿 MRO 回退)。取地址:ExprGenOps 的 AddrOf 分支对已失效变量 fail-fast。
This commit is contained in:
TermiNexus committed 2026-10-08 21:39:53 +08:00
1 parent d921dcd9e7
commit b60ce06335
5 files changed
+97 -1

No files matched your search

+6
View File
@@ -418,6 +418,12 @@ def get_param_willfree(name: str) -> int:
return 0
def get_param_willfree_method(pool: memhub.MemBuddy*, class_name: str, method_name: str) -> int:
"""方法 willFree 掩码:查 "Class.method" 并沿 MRO 回退;无记录返回 0"""
if _g_gen is not None: return _g_gen.StructGen.get_param_willfree_method(pool, class_name, method_name)
return 0
# ---------------- find_struct_by_type (delegates to StructGenMixin.find_struct_by_type) ----------------
def find_struct_by_type(struct_ty: mlirlite.LLVMType*) -> GenTypes.StructEntry*:
"""Delegate to gen.find_struct_by_type"""