revert(transpyv): 回滚跨模块链表 Next 改访问器(改由编译器沿继承链解析字段名)
回滚 13080f6 的 110 处访问器调用,恢复裸字段访问 `x.Next`。
理由:该批访问器是把访问移到定义模块内执行,**绕开**了"继承字段名解析",
属于规避而非修复;缺陷本体在 TPC 侧(导入侧继承展平把泛型基类的继承字段
记成 __inherited_N 占位名,名字丢失)。TPC 已按语义修正:
· e6451a07 继承展平沿继承链取真实字段名(泛型特化回退模板名),
展平表直接落 `[("Next", <槽位类型>), ...]`,属性访问是普通表命中;
· 3ca46c01 顺带修掉 _get_or_create_struct 里"同名枚举成员遮蔽类定义"的 i32 出口。
因此源码侧恢复为唯一写法(裸字段访问),由编译器负责解析。
注:本 commit 只回滚访问器;13080f6 里夹带的 CallGenProp.vp 续行合并(非访问器改动)
已在工作区保留(未提交)。
This commit is contained in:
1 parent
13080f646f
commit
aa52cf157d
24 files changed
+114
-118
No files matched your search
@@ -87,11 +87,11 @@ novirtual class ExprGenFstr(ExprGenBase.ExprGenBase):
|
||||
cast_val: llvmlite.Value* = self._fstr_cast_value(builder, pool, val, c_fmt, fv.value, trans)
|
||||
if cast_val is None:
|
||||
cast_val = val
|
||||
llvmlite.value_set_next(cast_val, None)
|
||||
cast_val.Next = None
|
||||
if arg_head is None:
|
||||
arg_head = cast_val
|
||||
else:
|
||||
llvmlite.value_set_next(arg_tail, cast_val)
|
||||
arg_tail.Next = cast_val
|
||||
arg_tail = cast_val
|
||||
arg_count += 1
|
||||
|
||||
@@ -132,7 +132,7 @@ novirtual class ExprGenFstr(ExprGenBase.ExprGenBase):
|
||||
cast_val: llvmlite.Value* = self._fstr_cast_value(builder, pool, val, c_fmt, fv.value, trans)
|
||||
if cast_val is None:
|
||||
cast_val = val
|
||||
llvmlite.value_set_next(cast_val, None)
|
||||
cast_val.Next = None
|
||||
arg_head = cast_val
|
||||
arg_tail = cast_val
|
||||
arg_count = 1
|
||||
@@ -175,11 +175,11 @@ novirtual class ExprGenFstr(ExprGenBase.ExprGenBase):
|
||||
if buf_ptr is None: return None
|
||||
# snprintf(buf, FSTR_BUF_SIZE, fmt, args...)
|
||||
size_val: llvmlite.Value* = llvmlite.const_int64(pool, FSTR_BUF_SIZE)
|
||||
llvmlite.value_set_next(buf_ptr, size_val)
|
||||
llvmlite.value_set_next(size_val, fmt_ptr)
|
||||
llvmlite.value_set_next(fmt_ptr, arg_head)
|
||||
buf_ptr.Next = size_val
|
||||
size_val.Next = fmt_ptr
|
||||
fmt_ptr.Next = arg_head
|
||||
if arg_tail is not None:
|
||||
llvmlite.value_set_next(arg_tail, None)
|
||||
arg_tail.Next = None
|
||||
llvmlite.build_call(builder, "snprintf", buf_ptr, 3 + arg_count, i32_ty, 1)
|
||||
return buf_ptr
|
||||
def _fstr_append_literal(self, fmt_buf: str,
|
||||
|
||||
Reference in new issue
Block a user