From 54fbe7560ec0f3a9d5016f2058b07463767bf6e1 Mon Sep 17 00:00:00 2001 From: realazthat Date: Fri, 5 Feb 2016 16:29:26 -0500 Subject: Added code for generating nonnull attributes --- src/codegen.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index f4defb8405..2965c8e593 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -2905,6 +2905,10 @@ static void do_code_gen(CodeGen *g) { if (param_type->id == TypeTableEntryIdPointer) { // when https://github.com/andrewrk/zig/issues/82 is fixed, add // non null attribute here + + ///`i` is arg index + 1 + ///I think that 0 is the return index, but it has a named LLVM constant variable + LLVMZigAddNonNullAttr(fn_table_entry->fn_value, param_decl_i + 1); } if (is_byval) { // TODO -- cgit v1.2.3