aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2024-06-14 11:37:44 -0400
committerAndrew Kelley <andrew@ziglang.org>2024-06-16 23:30:57 -0400
commitd208e59496a289c4a75ef417b025eb009ff2f66d (patch)
treeee0dabe5ec5ad4a57e095b2c540723c3d444ebfc /src/codegen
parent6220c754cf3387aebbcba270789ec67e652398cb (diff)
downloadzig-d208e59496a289c4a75ef417b025eb009ff2f66d.tar.gz
zig-d208e59496a289c4a75ef417b025eb009ff2f66d.zip
llvm: avoid debug info for naked function arguments
This is not supported by llvm.
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/llvm.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 2f2625948c..4f366052f2 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -1732,6 +1732,7 @@ pub const Object = struct {
.liveness = liveness,
.dg = &dg,
.wip = wip,
+ .is_naked = fn_info.cc == .Naked,
.ret_ptr = ret_ptr,
.args = args.items,
.arg_index = 0,
@@ -4801,6 +4802,7 @@ pub const FuncGen = struct {
air: Air,
liveness: Liveness,
wip: Builder.WipFunction,
+ is_naked: bool,
file: Builder.Metadata,
scope: Builder.Metadata,
@@ -8846,7 +8848,8 @@ pub const FuncGen = struct {
const arg_val = self.args[self.arg_index];
self.arg_index += 1;
- if (self.wip.strip) return arg_val;
+ // llvm does not support debug info for naked function arguments
+ if (self.wip.strip or self.is_naked) return arg_val;
const inst_ty = self.typeOfIndex(inst);
if (needDbgVarWorkaround(o)) return arg_val;