From 2b074dfb480ad8424b89bea356eec627cf7969c2 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Sat, 15 Aug 2026 06:24:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(llvmlite):=20Struct=20name=20=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=BB=98=E8=AE=A4=20None=EF=BC=9B=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=20GEP=20=E9=99=8D=E7=BA=A7=20printf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Struct() 的 name 参数改为可选(默认 None),简化无名字段结构体构造;IRBuilder 的 GEP 遇非指针 base 直接返回 None,不再打印降级日志(噪音)。 --- includes/llvmlite/__builder.vp | 1 - includes/llvmlite/__types.vp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/includes/llvmlite/__builder.vp b/includes/llvmlite/__builder.vp index b694501..1b3737d 100644 --- a/includes/llvmlite/__builder.vp +++ b/includes/llvmlite/__builder.vp @@ -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() diff --git a/includes/llvmlite/__types.vp b/includes/llvmlite/__types.vp index a3be5a9..d3afb58 100644 --- a/includes/llvmlite/__types.vp +++ b/includes/llvmlite/__types.vp @@ -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: