aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-06-18 17:07:27 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-06-18 17:07:27 -0400
commite27da17ff2cc45c93ab95defd937fd8038751b51 (patch)
treec2363e347fa05a3ca70170edefa073731319fc0f /src/codegen.cpp
parent77e0c53613335a007fb4437c8de99868786313eb (diff)
downloadzig-e27da17ff2cc45c93ab95defd937fd8038751b51.tar.gz
zig-e27da17ff2cc45c93ab95defd937fd8038751b51.zip
back to many behavioral tests passing
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 547840514a..dc2a4f55df 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -2017,11 +2017,9 @@ static LLVMValueRef ir_llvm_value(CodeGen *g, IrInstruction *instruction) {
render_const_val_global(g, &instruction->value, "");
ZigType *ptr_type = get_pointer_to_type(g, instruction->value.type, true);
instruction->llvm_value = LLVMBuildBitCast(g->builder, instruction->value.global_refs->llvm_global, get_llvm_type(g, ptr_type), "");
- } else if (get_codegen_ptr_type(instruction->value.type) != nullptr) {
+ } else {
instruction->llvm_value = LLVMBuildBitCast(g->builder, instruction->value.global_refs->llvm_value,
get_llvm_type(g, instruction->value.type), "");
- } else {
- instruction->llvm_value = instruction->value.global_refs->llvm_value;
}
assert(instruction->llvm_value);
}