diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-04-22 16:31:51 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-04-22 16:31:51 -0700 |
| commit | 7c453b91b85bab6800d24feb57c4f35b8ce48d57 (patch) | |
| tree | cf091f9555b03f3a28eba96b1774fb6e62d78e99 /src/value.zig | |
| parent | 3d637e6dd257d617867e12ac949d966d2c2ef48a (diff) | |
| download | zig-7c453b91b85bab6800d24feb57c4f35b8ce48d57.tar.gz zig-7c453b91b85bab6800d24feb57c4f35b8ce48d57.zip | |
AstGen: implement `@extern` builtin
Diffstat (limited to 'src/value.zig')
| -rw-r--r-- | src/value.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/value.zig b/src/value.zig index 4776cb5a76..e1ca79332c 100644 --- a/src/value.zig +++ b/src/value.zig @@ -73,6 +73,7 @@ pub const Value = extern union { reduce_op_type, call_options_type, export_options_type, + extern_options_type, undef, zero, @@ -187,6 +188,7 @@ pub const Value = extern union { .reduce_op_type, .call_options_type, .export_options_type, + .extern_options_type, => @compileError("Value Tag " ++ @tagName(t) ++ " has no payload"), .int_big_positive, @@ -354,6 +356,7 @@ pub const Value = extern union { .reduce_op_type, .call_options_type, .export_options_type, + .extern_options_type, => unreachable, .ty => { @@ -510,6 +513,7 @@ pub const Value = extern union { .reduce_op_type => return out_stream.writeAll("std.builtin.ReduceOp"), .call_options_type => return out_stream.writeAll("std.builtin.CallOptions"), .export_options_type => return out_stream.writeAll("std.builtin.ExportOptions"), + .extern_options_type => return out_stream.writeAll("std.builtin.ExternOptions"), .abi_align_default => return out_stream.writeAll("(default ABI alignment)"), .empty_struct_value => return out_stream.writeAll("struct {}{}"), @@ -640,6 +644,7 @@ pub const Value = extern union { .reduce_op_type => Type.initTag(.reduce_op), .call_options_type => Type.initTag(.call_options), .export_options_type => Type.initTag(.export_options), + .extern_options_type => Type.initTag(.extern_options), .int_type => { const payload = self.castTag(.int_type).?.data; @@ -1187,6 +1192,7 @@ pub const Value = extern union { .reduce_op_type, .call_options_type, .export_options_type, + .extern_options_type, => @panic("TODO this hash function looks pretty broken. audit it"), } return hasher.final(); @@ -1343,6 +1349,7 @@ pub const Value = extern union { .reduce_op_type, .call_options_type, .export_options_type, + .extern_options_type, => true, .zero, |
