fix parameter access of sret functions

This commit is contained in:
Andrew Kelley
2016-01-24 19:27:12 -07:00
parent 419652ee8f
commit f5cc7f65a3
5 changed files with 24 additions and 27 deletions

View File

@@ -2319,6 +2319,10 @@ static void do_code_gen(CodeGen *g) {
if (param_type->id == TypeTableEntryIdPointer && param_type->data.pointer.is_const) {
LLVMAddAttribute(argument_val, LLVMReadOnlyAttribute);
}
if (param_type->id == TypeTableEntryIdPointer) {
// when https://github.com/andrewrk/zig/issues/82 is fixed, add
// non null attribute here
}
if (param_node->data.param_decl.is_byval) {
LLVMAddAttribute(argument_val, LLVMByValAttribute);
}