aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-12-19 16:45:15 -0500
committerAndrew Kelley <superjoe30@gmail.com>2016-12-19 16:45:15 -0500
commit09d50e35a4555d9af2c794390a4375c7fc0e48f7 (patch)
tree14c3b6abf1c13eb763c31a0743a41b826e864e20 /src/codegen.cpp
parent14422e0312b3df271bfb60e8a6233afb128354fc (diff)
downloadzig-09d50e35a4555d9af2c794390a4375c7fc0e48f7.tar.gz
zig-09d50e35a4555d9af2c794390a4375c7fc0e48f7.zip
IR: support error defers
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index d275bea386..638050bbdf 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -2001,11 +2001,9 @@ static LLVMValueRef ir_render_overflow_op(CodeGen *g, IrExecutable *executable,
}
static LLVMValueRef ir_render_test_err(CodeGen *g, IrExecutable *executable, IrInstructionTestErr *instruction) {
- TypeTableEntry *ptr_type = get_underlying_type(instruction->value->type_entry);
- TypeTableEntry *err_union_type = get_underlying_type(ptr_type->data.pointer.child_type);
+ TypeTableEntry *err_union_type = get_underlying_type(instruction->value->type_entry);
TypeTableEntry *child_type = get_underlying_type(err_union_type->data.error.child_type);
- LLVMValueRef err_union_ptr = ir_llvm_value(g, instruction->value);
- LLVMValueRef err_union_handle = get_handle_value(g, err_union_ptr, err_union_type);
+ LLVMValueRef err_union_handle = ir_llvm_value(g, instruction->value);
LLVMValueRef err_val;
if (type_has_bits(child_type)) {