重置上传,新增了多个标准库,开始 TransPyV 自举实验

This commit is contained in:
2026-07-19 11:38:15 +08:00
parent 796222a300
commit 4e66207ba1
1041 changed files with 6597 additions and 27814 deletions

View File

@@ -22,7 +22,11 @@ from .__function import Function, BasicBlock, block_append_text, function_move_b
# builder.build_store(ConstInt(42), a)
# r = builder.build_load(i32_ty, a)
# builder.build_ret(r)
#
# 注意: 加 @t.NoVTable 以与硬编码 BUILDER_SIZE=32 保持一致
# (所有方法均为顶层函数,无需 vtable
# ============================================================
@t.NoVTable
class IRBuilder:
Pool: memhub.MemBuddy | t.CPtr # 内存池
Func: Function | t.CPtr # 所属函数
@@ -897,7 +901,10 @@ def build_gep_struct(builder: IRBuilder | t.CPtr, struct_ty: LLVMType | t.CPtr,
# ============================================================
# PhiIncoming: phi 节点的入边 (value, block) 对
# 继承 GSListNode[PhiIncoming] 获取强类型 Next
#
# 注意: 必须加 @t.NoVTable理由见 __function.py 的 Line 注释)。
# ============================================================
@t.NoVTable
class PhiIncoming(GSListNode[PhiIncoming]):
Val: Value | t.CPtr
Block: BasicBlock | t.CPtr
@@ -965,7 +972,10 @@ def build_phi(builder: IRBuilder | t.CPtr, ty: LLVMType | t.CPtr,
# ============================================================
# SwitchCase: switch 指令的 case 分支
#
# 注意: 必须加 @t.NoVTable理由见 __function.py 的 Line 注释)。
# ============================================================
@t.NoVTable
class SwitchCase(GSListNode[SwitchCase]):
CaseVal: Value | t.CPtr
Block: BasicBlock | t.CPtr