From d03c47bf85b17f7727d2f1fe5bd497b311c9eba7 Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Wed, 26 Oct 2022 00:30:17 +0300 Subject: Sema: use `runtime_value` instead of creating allocs --- src/codegen.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/codegen.zig') 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(); -- cgit v1.2.3