diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-05-29 16:32:16 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-05-29 16:32:16 -0400 |
| commit | 7017388e9ea9a5b144780c0a5c090bb7a221c9b6 (patch) | |
| tree | 7e4f95bffdf56633dcb47b98866b0f8804e134b1 /src/ir.cpp | |
| parent | f9ada1cfba5140ef01baa138813241c6b93a1ea9 (diff) | |
| parent | 1ccbd1fb67898c0691c74e65a7b9786fb5698619 (diff) | |
| download | zig-7017388e9ea9a5b144780c0a5c090bb7a221c9b6.tar.gz zig-7017388e9ea9a5b144780c0a5c090bb7a221c9b6.zip | |
Merge branch 'LemonBoy-use-struct-pt2'
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 5d3cf5303c..fa60751ca5 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -10266,12 +10266,6 @@ static IrInstruction *ir_resolve_ptr_of_array_to_slice(IrAnalyze *ira, IrInstruc return result; } -static bool is_container(ZigType *type) { - return type->id == ZigTypeIdStruct || - type->id == ZigTypeIdEnum || - type->id == ZigTypeIdUnion; -} - static IrBasicBlock *ir_get_new_bb(IrAnalyze *ira, IrBasicBlock *old_bb, IrInstruction *ref_old_instruction) { assert(old_bb); @@ -16179,7 +16173,7 @@ static IrInstruction *ir_analyze_instruction_field_ptr(IrAnalyze *ira, IrInstruc if (type_is_invalid(container_type)) { return ira->codegen->invalid_instruction; - } else if (is_container_ref(container_type)) { + } else if (is_slice(container_type) || is_container_ref(container_type)) { assert(container_ptr->value.type->id == ZigTypeIdPointer); if (container_type->id == ZigTypeIdPointer) { ZigType *bare_type = container_ref_type(container_type); @@ -16249,7 +16243,7 @@ static IrInstruction *ir_analyze_instruction_field_ptr(IrAnalyze *ira, IrInstruc if (type_is_invalid(child_type)) { return ira->codegen->invalid_instruction; - } else if (is_container(child_type) && !is_slice(child_type)) { + } else if (is_container(child_type)) { if (child_type->id == ZigTypeIdEnum) { if ((err = ensure_complete_type(ira->codegen, child_type))) return ira->codegen->invalid_instruction; |
