aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-02-05 01:57:49 -0500
committerAndrew Kelley <superjoe30@gmail.com>2017-02-05 01:57:49 -0500
commitd2f1f57fa410b781f17ab7b04311af50ff775070 (patch)
tree8c2bd88bbd0f1930259948d2cbde776df57d8aeb
parent74d41ce44ba964bea171e964a1e4a1bab8edc8c0 (diff)
downloadzig-d2f1f57fa410b781f17ab7b04311af50ff775070.tar.gz
zig-d2f1f57fa410b781f17ab7b04311af50ff775070.zip
even external functions which provide definitions get nounwind
-rw-r--r--src/codegen.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 3328bc3de4..f19f6bb8bf 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -268,7 +268,7 @@ static LLVMValueRef fn_llvm_value(CodeGen *g, FnTableEntry *fn_table_entry) {
LLVMAddFunctionAttr(fn_table_entry->llvm_value, LLVMNoReturnAttribute);
}
LLVMSetFunctionCallConv(fn_table_entry->llvm_value, fn_type->data.fn.calling_convention);
- if (!fn_type->data.fn.fn_type_id.is_extern) {
+ if (!fn_type->data.fn.fn_type_id.is_extern || fn_table_entry->fn_def_node != nullptr) {
LLVMAddFunctionAttr(fn_table_entry->llvm_value, LLVMNoUnwindAttribute);
}
if (!g->is_release_build && fn_table_entry->fn_inline != FnInlineAlways) {