refactor(tpc): 退役 t/c 模块并将定宽类型升级为内建
删除 lib/includes/t.py、c.py,类型模型迁入 lib/core/TypeSystem.py;移除 IsTModule/_T_MODULE_NAMES 等名称判据,语法糖与内部标记统一为裸名;builtins 的 sizet/intN/uintN/fast/least/uchar/short/long 等改为编译器内建短名。
This commit is contained in:
1 parent
8d27747c7c
commit
f19d25782f
66 files changed
+2445
-3638
No files matched your search
@@ -27,11 +27,11 @@ class AugAssignHandle(BaseHandle):
|
||||
"""解析 global 变量的 LLVM 类型:优先用模块级 AnnAssign 的注解类型。
|
||||
|
||||
问题场景:函数内 `_g_alloc_count += 1`(global 声明),模块级注解为
|
||||
`_g_alloc_count: t.CSizeT`(i64)。若不查模块级注解类型,此处会用 RHS 字面量
|
||||
`_g_alloc_count: CSizeT`(i64)。若不查模块级注解类型,此处会用 RHS 字面量
|
||||
类型(i32)自动建 i32 全局,与模块内其他读取/写入(i64)类型不匹配,
|
||||
产生 "Operands must be the same type, got (i64, i32)" 类错误。
|
||||
模块级 AnnAssign 已通过 _EmitGlobalAnnAssignLlvm 创建 LLVM 全局,
|
||||
但注解无初始值(如 `_g_alloc_max: t.CSizeT = 0`)时 initializer 为空、
|
||||
但注解无初始值(如 `_g_alloc_max: CSizeT = 0`)时 initializer 为空、
|
||||
Gen.module.globals 中无该符号,故需在此兜底解析注解类型。
|
||||
"""
|
||||
module_ann: dict = getattr(Gen, '_module_ann_types', None)
|
||||
|
||||
Reference in new issue
Block a user