diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2024-03-26 00:05:08 +0000 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2024-03-26 13:48:06 +0000 |
| commit | 884d957b6c291961536c10401f60264da26cba30 (patch) | |
| tree | 4138aabd75ae3a13bf0efbb4fe89ec1bb7fd82cb /src/codegen/c.zig | |
| parent | 5ec6e3036b2772e6efc08726b22c560dedd556bc (diff) | |
| download | zig-884d957b6c291961536c10401f60264da26cba30.tar.gz zig-884d957b6c291961536c10401f60264da26cba30.zip | |
compiler: eliminate legacy Value representation
Good riddance!
Most of these changes are trivial. There's a fix for a minor bug this
exposed in `Value.readFromPackedMemory`, but aside from that, it's all
just things like changing `intern` calls to `toIntern`.
Diffstat (limited to 'src/codegen/c.zig')
| -rw-r--r-- | src/codegen/c.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig index 32ad38cd4d..d1575feaba 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -2657,7 +2657,7 @@ fn genExports(o: *Object) !void { .anon, .flush => return, }; const decl = mod.declPtr(decl_index); - const tv: TypedValue = .{ .ty = decl.typeOf(mod), .val = Value.fromInterned((try decl.internValue(mod))) }; + const tv: TypedValue = .{ .ty = decl.typeOf(mod), .val = decl.val }; const fwd = o.dg.fwdDeclWriter(); const exports = mod.decl_exports.get(decl_index) orelse return; @@ -2894,7 +2894,7 @@ pub fn genDecl(o: *Object) !void { const mod = o.dg.module; const decl_index = o.dg.pass.decl; const decl = mod.declPtr(decl_index); - const tv: TypedValue = .{ .ty = decl.typeOf(mod), .val = Value.fromInterned((try decl.internValue(mod))) }; + const tv: TypedValue = .{ .ty = decl.typeOf(mod), .val = decl.val }; if (!tv.ty.isFnOrHasRuntimeBitsIgnoreComptime(mod)) return; if (tv.val.getExternFunc(mod)) |_| { |
