mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 12:59:04 +00:00
llvm: Don't emit extra debug instructions for dbg_var_val in naked functions.
This commit is contained in:
parent
acad2fae44
commit
7a8e86e46c
@ -6743,7 +6743,10 @@ pub const FuncGen = struct {
|
||||
},
|
||||
"",
|
||||
);
|
||||
} else if (owner_mod.optimize_mode == .Debug) {
|
||||
} else if (owner_mod.optimize_mode == .Debug and !self.is_naked) {
|
||||
// We avoid taking this path for naked functions because there's no guarantee that such
|
||||
// functions even have a valid stack pointer, making the `alloca` + `store` unsafe.
|
||||
|
||||
const alignment = operand_ty.abiAlignment(pt).toLlvm();
|
||||
const alloca = try self.buildAlloca(operand.typeOfWip(&self.wip), alignment);
|
||||
_ = try self.wip.store(.normal, operand, alloca, alignment);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user