authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-04-27 18:40:17-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-04-27 18:40:17-04:00
log1691074b4b1f080b3a1f7ca7dc7426c6ef4c242a
treec993c2845c477c9f94c1e4d4ed0e9d42ce493515
parent7e11ef79d67d000675e90ddf93fdb78d71cc695d

add no-elim-base-pointer to __zig_fail function

fixes missing frame for unwrapping an error closes #345

2 files changed, 6 insertions(+), 1 deletions(-)

README.md+1-1
......@@ -75,7 +75,7 @@ the Zig compiler itself:
7575#### Library Dependencies
7676
7777These libraries must be installed on your system, with the development files
78available. The Zig compiler dynamically links against them.
78available. The Zig compiler links against them.
7979
8080 * LLVM, Clang, and LLD libraries == 4.x
8181
src/codegen.cpp+5
......@@ -720,6 +720,11 @@ static LLVMValueRef get_safety_crash_err_fn(CodeGen *g) {
720720 addLLVMFnAttr(fn_val, "cold");
721721 LLVMSetLinkage(fn_val, LLVMInternalLinkage);
722722 LLVMSetFunctionCallConv(fn_val, LLVMFastCallConv);
723 addLLVMFnAttr(fn_val, "nounwind");
724 if (!g->is_release_build) {
725 ZigLLVMAddFunctionAttr(fn_val, "no-frame-pointer-elim", "true");
726 ZigLLVMAddFunctionAttr(fn_val, "no-frame-pointer-elim-non-leaf", nullptr);
727 }
723728
724729 LLVMBasicBlockRef entry_block = LLVMAppendBasicBlock(fn_val, "Entry");
725730 LLVMBasicBlockRef prev_block = LLVMGetInsertBlock(g->builder);