aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-03-26 05:51:34 +0000
committermlugg <mlugg@mlugg.co.uk>2024-03-26 13:48:07 +0000
commit2a245e3b78890e5d1b65492e51d9fe509ec35b3c (patch)
tree00e839ff9a0ae4a871d282b4e86fbd9baeab701a /src/codegen.zig
parenta61def10c66abc871f92c84d9cef85b6b7752cbf (diff)
downloadzig-2a245e3b78890e5d1b65492e51d9fe509ec35b3c.tar.gz
zig-2a245e3b78890e5d1b65492e51d9fe509ec35b3c.zip
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`.
Diffstat (limited to 'src/codegen.zig')
-rw-r--r--src/codegen.zig10
1 files changed, 4 insertions, 6 deletions
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);