aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorHiroki Noda <kubo39@gmail.com>2020-06-24 22:35:50 +0900
committerAndrew Kelley <andrew@ziglang.org>2020-07-21 21:03:02 +0000
commit68e0632aa531b33669bfdda374675aa26e91b40f (patch)
tree889476a8a6d414389590259c11a448743c43e3b2 /src/codegen.cpp
parent8ee629aa4c7fb0127c71aec0b2c81353c4291ebb (diff)
downloadzig-68e0632aa531b33669bfdda374675aa26e91b40f.tar.gz
zig-68e0632aa531b33669bfdda374675aa26e91b40f.zip
Use function attribute "frame-pointer"
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 3473a2b0ac..3f3d80d51d 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -2301,9 +2301,8 @@ static LLVMValueRef get_merge_err_ret_traces_fn_val(CodeGen *g) {
addLLVMArgAttr(fn_val, (unsigned)1, "noalias");
addLLVMArgAttr(fn_val, (unsigned)1, "readonly");
- if (g->build_mode == BuildModeDebug) {
- ZigLLVMAddFunctionAttr(fn_val, "no-frame-pointer-elim", "true");
- ZigLLVMAddFunctionAttr(fn_val, "no-frame-pointer-elim-non-leaf", nullptr);
+ if (codegen_have_frame_pointer(g)) {
+ ZigLLVMAddFunctionAttr(fn_val, "frame-pointer", "all");
}
// this is above the ZigLLVMClearCurrentDebugLocation