aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-10-26 00:30:17 +0300
committerAndrew Kelley <andrew@ziglang.org>2022-10-27 21:08:25 -0400
commitd03c47bf85b17f7727d2f1fe5bd497b311c9eba7 (patch)
treefc2008e0adbee552fd72215614eefe7e111dbf5d /src/codegen.zig
parent398a3aae40bc03f6b7c6cd86d78a4cde125f2811 (diff)
downloadzig-d03c47bf85b17f7727d2f1fe5bd497b311c9eba7.tar.gz
zig-d03c47bf85b17f7727d2f1fe5bd497b311c9eba7.zip
Sema: use `runtime_value` instead of creating allocs
Diffstat (limited to 'src/codegen.zig')
-rw-r--r--src/codegen.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/codegen.zig b/src/codegen.zig
index e7f927a2d6..757bd23b38 100644
--- a/src/codegen.zig
+++ b/src/codegen.zig
@@ -149,7 +149,7 @@ fn writeFloat(comptime F: type, f: F, target: Target, endian: std.builtin.Endian
pub fn generateSymbol(
bin_file: *link.File,
src_loc: Module.SrcLoc,
- typed_value: TypedValue,
+ arg_tv: TypedValue,
code: *std.ArrayList(u8),
debug_output: DebugInfoOutput,
reloc_info: RelocInfo,
@@ -157,6 +157,11 @@ pub fn generateSymbol(
const tracy = trace(@src());
defer tracy.end();
+ var typed_value = arg_tv;
+ if (arg_tv.val.castTag(.runtime_value)) |rt| {
+ typed_value.val = rt.data;
+ }
+
const target = bin_file.options.target;
const endian = target.cpu.arch.endian();