diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-04-02 12:09:38 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-04-02 12:09:38 -0700 |
| commit | a0e89c9b46fc91d9b1dfebd02eaae233802e3cbc (patch) | |
| tree | 6a1ee37f130b4cb69204158ff915ecc2c6bb002b /src/type/Union.zig | |
| parent | 94383d14df77fa638dac14f4b2bda5a2e3f21c5c (diff) | |
| parent | 228a1ce3e8d112a7710fa47c6b9486cf320b5d6f (diff) | |
| download | zig-a0e89c9b46fc91d9b1dfebd02eaae233802e3cbc.tar.gz zig-a0e89c9b46fc91d9b1dfebd02eaae233802e3cbc.zip | |
Merge remote-tracking branch 'origin/master' into llvm12
Diffstat (limited to 'src/type/Union.zig')
| -rw-r--r-- | src/type/Union.zig | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/src/type/Union.zig b/src/type/Union.zig deleted file mode 100644 index 5c7acf7d36..0000000000 --- a/src/type/Union.zig +++ /dev/null @@ -1,56 +0,0 @@ -const std = @import("std"); -const zir = @import("../zir.zig"); -const Value = @import("../value.zig").Value; -const Type = @import("../type.zig").Type; -const Module = @import("../Module.zig"); -const Scope = Module.Scope; -const Union = @This(); - -base: Type.Payload = .{ .tag = .@"struct" }, - -analysis: union(enum) { - queued: Zir, - zero_bits_in_progress, - zero_bits: Zero, - in_progress, - // alignment: Align, - resolved: Size, - failed, -}, -scope: Scope.Container, - -pub const Field = struct { - value: Value, -}; - -pub const Zir = struct { - body: zir.Body, - inst: *zir.Inst, -}; - -pub const Zero = struct { - is_zero_bits: bool, - fields: std.StringArrayHashMapUnmanaged(Field), -}; - -pub const Size = struct { - is_zero_bits: bool, - alignment: u32, - size: u32, - fields: std.StringArrayHashMapUnmanaged(Field), -}; - -pub fn resolveZeroBits(self: *Union, mod: *Module, scope: *Scope) !void { - const zir = switch (self.analysis) { - .failed => return error.AnalysisFail, - .zero_bits_in_progress => { - return mod.fail(scope, src, "union '{}' depends on itself", .{}); - }, - .queued => |zir| zir, - else => return, - }; - - self.analysis = .zero_bits_in_progress; - - // TODO -} |
