aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-02-05 14:49:01 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-02-05 14:49:01 -0700
commitdb3b517639db2f4abd3b06a249e95a5e18599126 (patch)
treead0ca7cf585ebadc106bd31b21e543b4d43c981e /src/codegen.cpp
parentff5673ae1b74b8ad59ee23921e0bb4e25349d10f (diff)
parent2ee80858b42796c931fb2fe0b45e0ebb6f8ffb30 (diff)
downloadzig-db3b517639db2f4abd3b06a249e95a5e18599126.tar.gz
zig-db3b517639db2f4abd3b06a249e95a5e18599126.zip
Merge branch 'realazthat-nonnull-branch'
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index f4defb8405..d002c716ef 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -2876,6 +2876,7 @@ static void do_code_gen(CodeGen *g) {
if (handle_is_ptr(fn_type->data.fn.fn_type_id.return_type)) {
LLVMValueRef first_arg = LLVMGetParam(fn_table_entry->fn_value, 0);
LLVMAddAttribute(first_arg, LLVMStructRetAttribute);
+ LLVMZigAddNonNullAttr(fn_table_entry->fn_value, 1);
}
// set parameter attributes
@@ -2903,8 +2904,7 @@ static void do_code_gen(CodeGen *g) {
LLVMAddAttribute(argument_val, LLVMReadOnlyAttribute);
}
if (param_type->id == TypeTableEntryIdPointer) {
- // when https://github.com/andrewrk/zig/issues/82 is fixed, add
- // non null attribute here
+ LLVMZigAddNonNullAttr(fn_table_entry->fn_value, gen_index + 1);
}
if (is_byval) {
// TODO