diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2023-05-21 04:29:34 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-06-10 20:47:54 -0700 |
| commit | a6fcf469fc8982d36597586ac0dbba94027b2429 (patch) | |
| tree | 728ea43b19c84f34aaa8d1b4b52573b469dd24b7 /src/value.zig | |
| parent | 84099e50fc0af3719f3819c6c2d37dedba1aaae4 (diff) | |
| download | zig-a6fcf469fc8982d36597586ac0dbba94027b2429.tar.gz zig-a6fcf469fc8982d36597586ac0dbba94027b2429.zip | |
Value: remove legacy type values
Diffstat (limited to 'src/value.zig')
| -rw-r--r-- | src/value.zig | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/value.zig b/src/value.zig index 0277f0bdb2..b1c94d46b5 100644 --- a/src/value.zig +++ b/src/value.zig @@ -39,7 +39,6 @@ pub const Value = struct { empty_array, // See last_no_payload_tag below. // After this, the tag requires a payload. - ty, function, extern_fn, /// A comptime-known pointer can point to the address of a global @@ -141,7 +140,6 @@ pub const Value = struct { .str_lit => Payload.StrLit, .slice => Payload.Slice, - .ty, .lazy_align, .lazy_size, => Payload.Ty, @@ -255,7 +253,7 @@ pub const Value = struct { .empty_array, => unreachable, - .ty, .lazy_align, .lazy_size => { + .lazy_align, .lazy_size => { const payload = self.cast(Payload.Ty).?; const new_payload = try arena.create(Payload.Ty); new_payload.* = .{ @@ -472,7 +470,6 @@ pub const Value = struct { return out_stream.writeAll("(union value)"); }, .the_only_possible_value => return out_stream.writeAll("(the only possible value)"), - .ty => return val.castTag(.ty).?.data.dump("", options, out_stream), .lazy_align => { try out_stream.writeAll("@alignOf("); try val.castTag(.lazy_align).?.data.dump("", options, out_stream); @@ -695,12 +692,7 @@ pub const Value = struct { /// Asserts that the value is representable as a type. pub fn toType(self: Value) Type { - if (self.ip_index != .none) return self.ip_index.toType(); - return switch (self.tag()) { - .ty => self.castTag(.ty).?.data, - - else => unreachable, - }; + return self.ip_index.toType(); } pub fn enumToInt(val: Value, ty: Type, mod: *Module) Allocator.Error!Value { |
