fix(llvmlite): Struct name 参数默认 None;移除 GEP 降级 printf
Struct() 的 name 参数改为可选(默认 None),简化无名字段结构体构造;IRBuilder 的 GEP 遇非指针 base 直接返回 None,不再打印降级日志(噪音)。
This commit is contained in:
1 parent
46b7cbc4ba
commit
2b074dfb48
2 files changed
+1
-2
No files matched your search
@@ -798,7 +798,6 @@ class IRBuilder:
|
||||
# 当 translate_value 返回非指针值(如 i32 常量 0)时,
|
||||
# 直接 GEP 会导致 llc 编译失败
|
||||
if _is_ptr_type(ptr.Ty) == 0:
|
||||
stdio.printf("[GEP-ERR] base not pointer, skip GEP\n")
|
||||
return None
|
||||
pool: memhub.MemBuddy | t.CPtr = self.Pool
|
||||
name: t.CChar | t.CPtr = self._alloc_ssa_name()
|
||||
|
||||
@@ -329,7 +329,7 @@ class LLVMTypeCore:
|
||||
return Array(self.Pool, elem_ty, count)
|
||||
|
||||
def Struct(self, fields: ParamNode | t.CPtr, fcount: t.CInt,
|
||||
name: t.CChar | t.CPtr) -> LLVMType | t.CPtr:
|
||||
name: t.CChar | t.CPtr = None) -> LLVMType | t.CPtr:
|
||||
return Struct(self.Pool, fields, fcount, name)
|
||||
|
||||
def Void(self) -> LLVMType | t.CPtr:
|
||||
|
||||
Reference in new issue
Block a user