From 5d121f716612e017a630c28e4ab82fa4c1629d71 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Wed, 26 Aug 2026 22:07:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(funcattrs):=20stackrealign=20=E6=98=AF=20LL?= =?UTF-8?q?VM=20=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=B1=9E=E6=80=A7=E9=9C=80?= =?UTF-8?q?=E5=B8=A6=E5=BC=95=E5=8F=B7=EF=BC=8C=E5=90=A6=E5=88=99=20llc=20?= =?UTF-8?q?=E6=8A=A5=20expected=20'{'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/lib/core/Gen/FuncGenBase.vp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/App/lib/core/Gen/FuncGenBase.vp b/App/lib/core/Gen/FuncGenBase.vp index 02ad7c1..2791c4d 100644 --- a/App/lib/core/Gen/FuncGenBase.vp +++ b/App/lib/core/Gen/FuncGenBase.vp @@ -200,7 +200,10 @@ class FuncGenBase(CallGenBase.CallGenBase): # jmp 进入(rsp≡0 mod 16),而 llc 按 call 约定假设入口 rsp≡8 → 帧整体 # 偏 8 → 所有调用 rsp≡8 → 变参函数保存 xmm 的 movaps #GP。stackrealign # 使序言动态对齐,与入口约定无关(sched started 后 movaps #GP 根因)。 - llvm_name = "stackrealign" + # 注意:stackrealign 是 LLVM 字符串属性,必须带引号("stackrealign"), + # 与 noinline/nounwind 等枚举属性(无引号)区分,否则 llc 报 + # "expected '{' in function body"。 + llvm_name = '"stackrealign"' elif string.strcmp(attr_name, "willreturn") == 0: llvm_name = "willreturn" elif string.strcmp(attr_name, "mustprogress") == 0: