diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-06-10 01:18:31 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-06-10 01:18:31 -0400 |
| commit | 0a95b0f1ffeb8ae5ee317b02626890adebe5ec63 (patch) | |
| tree | b81af85f0e9ba611aa24ae8b1c855095f5c8f9e8 /src/ir.cpp | |
| parent | 77678b2cbc7ac9ba2d5d4725241f6a9f7ac64fa4 (diff) | |
| download | zig-0a95b0f1ffeb8ae5ee317b02626890adebe5ec63.tar.gz zig-0a95b0f1ffeb8ae5ee317b02626890adebe5ec63.zip | |
std.zig: update syntax for orelse keyword
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 96eb5f7434..38f4dc90e7 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -14842,22 +14842,6 @@ static TypeTableEntry *ir_analyze_instruction_unwrap_maybe(IrAnalyze *ira, TypeTableEntry *type_entry = ptr_type->data.pointer.child_type; if (type_is_invalid(type_entry)) { return ira->codegen->builtin_types.entry_invalid; - } else if (type_entry->id == TypeTableEntryIdMetaType) { - // surprise! actually this is just ??T not an unwrap maybe instruction - ConstExprValue *ptr_val = const_ptr_pointee(ira->codegen, &value->value); - assert(ptr_val->type->id == TypeTableEntryIdMetaType); - TypeTableEntry *child_type = ptr_val->data.x_type; - - type_ensure_zero_bits_known(ira->codegen, child_type); - TypeTableEntry *layer1 = get_maybe_type(ira->codegen, child_type); - TypeTableEntry *layer2 = get_maybe_type(ira->codegen, layer1); - - IrInstruction *const_instr = ir_build_const_type(&ira->new_irb, unwrap_maybe_instruction->base.scope, - unwrap_maybe_instruction->base.source_node, layer2); - IrInstruction *result_instr = ir_get_ref(ira, &unwrap_maybe_instruction->base, const_instr, - ptr_type->data.pointer.is_const, ptr_type->data.pointer.is_volatile); - ir_link_new_instruction(result_instr, &unwrap_maybe_instruction->base); - return result_instr->value.type; } else if (type_entry->id != TypeTableEntryIdOptional) { ir_add_error_node(ira, unwrap_maybe_instruction->value->source_node, buf_sprintf("expected optional type, found '%s'", buf_ptr(&type_entry->name))); |
