diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-05-10 20:34:18 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-05-10 20:34:18 -0700 |
| commit | 9e72f317354de029f7e77600901c8cabcaf48c3e (patch) | |
| tree | 024ada96335d51c32e32a7a1e21b7eb3bd53b0a2 /src/stage1/ir.cpp | |
| parent | 6361d7a92824ff2b883625d133fec4fccfb3eef7 (diff) | |
| download | zig-9e72f317354de029f7e77600901c8cabcaf48c3e.tar.gz zig-9e72f317354de029f7e77600901c8cabcaf48c3e.zip | |
stage1: ignore enum ContainerLayout for comptime memory purposes
See #2115. The concept of `packed enum` and `extern enum` is
getting removed from the language.
Diffstat (limited to 'src/stage1/ir.cpp')
| -rw-r--r-- | src/stage1/ir.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/stage1/ir.cpp b/src/stage1/ir.cpp index 2f345a8411..323874ad2b 100644 --- a/src/stage1/ir.cpp +++ b/src/stage1/ir.cpp @@ -30550,22 +30550,13 @@ static Error buf_read_value_bytes(IrAnalyze *ira, CodeGen *codegen, AstNode *sou case ZigTypeIdVector: return buf_read_value_bytes_array(ira, codegen, source_node, buf, val, val->type->data.vector.elem_type, val->type->data.vector.len); - case ZigTypeIdEnum: - switch (val->type->data.enumeration.layout) { - case ContainerLayoutAuto: - zig_panic("TODO buf_read_value_bytes enum auto"); - case ContainerLayoutPacked: - zig_panic("TODO buf_read_value_bytes enum packed"); - case ContainerLayoutExtern: { - ZigType *tag_int_type = val->type->data.enumeration.tag_int_type; - src_assert(tag_int_type->id == ZigTypeIdInt, source_node); - bigint_read_twos_complement(&val->data.x_enum_tag, buf, tag_int_type->data.integral.bit_count, - codegen->is_big_endian, tag_int_type->data.integral.is_signed); - return ErrorNone; - } - } - zig_unreachable(); - case ZigTypeIdStruct: + case ZigTypeIdEnum: { + ZigType *tag_int_type = val->type->data.enumeration.tag_int_type; + src_assert(tag_int_type->id == ZigTypeIdInt, source_node); + bigint_read_twos_complement(&val->data.x_enum_tag, buf, tag_int_type->data.integral.bit_count, + codegen->is_big_endian, tag_int_type->data.integral.is_signed); + return ErrorNone; + } case ZigTypeIdStruct: switch (val->type->data.structure.layout) { case ContainerLayoutAuto: { switch(val->type->data.structure.special){ |
