Sema: use runtime_value instead of creating allocs

This commit is contained in:
Veikka Tuominen
2022-10-26 00:30:17 +03:00
committed by Andrew Kelley
parent 398a3aae40
commit d03c47bf85
12 changed files with 126 additions and 52 deletions

View File

@@ -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();