aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-07-14 11:33:13 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-07-14 11:33:13 -0400
commited3181f029809f8cd608f2c20b60d1b7c6e353e3 (patch)
treef0a9143d8c6a682e974768f0b095a159e8db9415 /src
parent2a719ee6c598b7096060168a0e7c93ae3e244008 (diff)
parentf78d4ed30c1bd92fc5ecc26c2d5f11751b406255 (diff)
downloadzig-ed3181f029809f8cd608f2c20b60d1b7c6e353e3.tar.gz
zig-ed3181f029809f8cd608f2c20b60d1b7c6e353e3.zip
Merge branch 'eduardosm-extern-return-small-struct'
Diffstat (limited to 'src')
-rw-r--r--src/codegen.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 3f54c120b4..0bcc211164 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -3166,6 +3166,10 @@ static LLVMValueRef ir_render_call(CodeGen *g, IrExecutable *executable, IrInstr
return nullptr;
} else if (first_arg_ret) {
return instruction->tmp_ptr;
+ } else if (handle_is_ptr(src_return_type)) {
+ auto store_instr = LLVMBuildStore(g->builder, result, instruction->tmp_ptr);
+ LLVMSetAlignment(store_instr, LLVMGetAlignment(instruction->tmp_ptr));
+ return instruction->tmp_ptr;
} else {
return result;
}