From 2a245e3b78890e5d1b65492e51d9fe509ec35b3c Mon Sep 17 00:00:00 2001 From: mlugg Date: Tue, 26 Mar 2024 05:51:34 +0000 Subject: compiler: eliminate TypedValue The only logic which remained in this file was the Value printing logic. This has been moved into a new `print_value.zig`. --- src/codegen.zig | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/codegen.zig') diff --git a/src/codegen.zig b/src/codegen.zig index 049b10b308..c5da0ebcb7 100644 --- a/src/codegen.zig +++ b/src/codegen.zig @@ -185,9 +185,7 @@ pub fn generateSymbol( const target = mod.getTarget(); const endian = target.cpu.arch.endian(); - log.debug("generateSymbol: val = {}", .{ - val.fmtValue(ty, mod), - }); + log.debug("generateSymbol: val = {}", .{val.fmtValue(mod)}); if (val.isUndefDeep(mod)) { const abi_size = math.cast(usize, ty.abiSize(mod)) orelse return error.Overflow; @@ -862,7 +860,7 @@ fn genDeclRef( ) CodeGenError!GenResult { const zcu = lf.comp.module.?; const ty = val.typeOf(zcu); - log.debug("genDeclRef: val = {}", .{val.fmtValue(ty, zcu)}); + log.debug("genDeclRef: val = {}", .{val.fmtValue(zcu)}); const ptr_decl = zcu.declPtr(ptr_decl_index); const namespace = zcu.namespacePtr(ptr_decl.src_namespace); @@ -976,7 +974,7 @@ fn genUnnamedConst( ) CodeGenError!GenResult { const zcu = lf.comp.module.?; const gpa = lf.comp.gpa; - log.debug("genUnnamedConst: val = {}", .{val.fmtValue(val.typeOf(zcu), zcu)}); + log.debug("genUnnamedConst: val = {}", .{val.fmtValue(zcu)}); const local_sym_index = lf.lowerUnnamedConst(val, owner_decl_index) catch |err| { return GenResult.fail(gpa, src_loc, "lowering unnamed constant failed: {s}", .{@errorName(err)}); @@ -1016,7 +1014,7 @@ pub fn genTypedValue( const zcu = lf.comp.module.?; const ty = val.typeOf(zcu); - log.debug("genTypedValue: val = {}", .{val.fmtValue(ty, zcu)}); + log.debug("genTypedValue: val = {}", .{val.fmtValue(zcu)}); if (val.isUndef(zcu)) return GenResult.mcv(.undef); -- cgit v1.2.3