diff --git a/lib/core/Handles/HandlesImports.py b/lib/core/Handles/HandlesImports.py index 61386d5..c84ec3b 100644 --- a/lib/core/Handles/HandlesImports.py +++ b/lib/core/Handles/HandlesImports.py @@ -1314,7 +1314,7 @@ class ImportHandle(BaseHandle): gv = ir.GlobalVariable(Gen.module, var_type, name=VarName) # 外部全局变量声明:只声明不定义(external linkage),避免多重定义 gv.linkage = 'external' - elif isinstance(node, ast.Assign) and Node.targets and isinstance(Node.targets[0], ast.Name): + elif isinstance(Node, ast.Assign) and Node.targets and isinstance(Node.targets[0], ast.Name): VarName = Node.targets[0].id if VarName.startswith('_'): return diff --git a/lib/core/LLVMCG/StructGen.py b/lib/core/LLVMCG/StructGen.py index ac5c88b..82bca9a 100644 --- a/lib/core/LLVMCG/StructGen.py +++ b/lib/core/LLVMCG/StructGen.py @@ -5,6 +5,7 @@ import vast as ast import llvmlite.ir as ir from llvmlite.ir.values import _Undefined from lib.includes import t as _t +from lib.core.VLogger import get_logger as _vlog # vtable 槽类型 `i8*` 的共享实例:llvmlite 的类型是不可变值语义(`_TypedPointerType` # 的 `__eq__` 按结构比较、打印结果只取决于结构),同一实例可在任意多少量复用。