diff options
| author | Jimmi Holst Christensen <jhc@dismail.de> | 2022-01-07 18:58:40 +0100 |
|---|---|---|
| committer | Jimmi Holst Christensen <jhc@dismail.de> | 2022-01-07 22:10:36 +0100 |
| commit | 9d6bef49a5fc2a5387734fa8d8cc698f0da8d5fa (patch) | |
| tree | 86304781ddc0b37b2b7881b54f72fb789660c7eb /src/type.zig | |
| parent | d5093b6c1395d4a60a923e1911321784ce368bda (diff) | |
| download | zig-9d6bef49a5fc2a5387734fa8d8cc698f0da8d5fa.tar.gz zig-9d6bef49a5fc2a5387734fa8d8cc698f0da8d5fa.zip | |
Add two more resolution status' to Struct and Union
resolveTypeForCodegen is called when we needed to resolve a type fully,
even through pointer. This commit fully implements this, even through
pointer fields on structs and unions.
The function has now also been renamed to resolveTypeFully
Diffstat (limited to 'src/type.zig')
| -rw-r--r-- | src/type.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/type.zig b/src/type.zig index 4ad15f2399..f4561769e2 100644 --- a/src/type.zig +++ b/src/type.zig @@ -1916,7 +1916,7 @@ pub const Type = extern union { const fields = self.structFields(); const is_packed = if (self.castTag(.@"struct")) |payload| p: { const struct_obj = payload.data; - assert(struct_obj.status == .have_layout); + assert(struct_obj.haveLayout()); break :p struct_obj.layout == .Packed; } else false; @@ -2220,7 +2220,7 @@ pub const Type = extern union { if (field_count == 0) return 0; const struct_obj = ty.castTag(.@"struct").?.data; - assert(struct_obj.status == .have_layout); + assert(struct_obj.haveLayout()); var total: u64 = 0; for (struct_obj.fields.values()) |field| { @@ -3771,7 +3771,7 @@ pub const Type = extern union { switch (ty.tag()) { .@"struct" => { const struct_obj = ty.castTag(.@"struct").?.data; - assert(struct_obj.status == .have_layout); + assert(struct_obj.haveLayout()); const is_packed = struct_obj.layout == .Packed; if (!is_packed) { var offset: u64 = 0; |
