diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-07-14 18:27:51 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-07-14 18:27:51 -0400 |
| commit | 4d920cee6e8be2f2ae2cfd9067358c65b977568a (patch) | |
| tree | 2c04de6151b7448dec9958d0a91234ea0ba9a15d /src/codegen.cpp | |
| parent | da3acacc14331a6be33445c3bfd204e2cccabddd (diff) | |
| parent | 28c3d4809bc6d497ac81892bc7eb03b95d8c2b32 (diff) | |
| download | zig-4d920cee6e8be2f2ae2cfd9067358c65b977568a.tar.gz zig-4d920cee6e8be2f2ae2cfd9067358c65b977568a.zip | |
Merge remote-tracking branch 'origin/master' into llvm7
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index 1d51629002..9712388783 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -2212,10 +2212,8 @@ static LLVMValueRef ir_render_bin_op(CodeGen *g, IrExecutable *executable, return LLVMBuildICmp(g->builder, pred, op1_value, op2_value, ""); } else if (type_entry->id == TypeTableEntryIdEnum || type_entry->id == TypeTableEntryIdErrorSet || - type_entry->id == TypeTableEntryIdPointer || type_entry->id == TypeTableEntryIdBool || - type_entry->id == TypeTableEntryIdPromise || - type_entry->id == TypeTableEntryIdFn) + get_codegen_ptr_type(type_entry) != nullptr) { LLVMIntPredicate pred = cmp_op_to_int_predicate(op_id, false); return LLVMBuildICmp(g->builder, pred, op1_value, op2_value, ""); @@ -3103,6 +3101,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; } |
