aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2023-04-05 09:16:33 +0200
committerJakub Konka <kubkon@jakubkonka.com>2023-04-13 11:47:51 +0200
commit382de7bf1de8314e97eb67426b693b966f2c4e1b (patch)
tree5c50e9cad16c132cdb632e12d5b6d4f1034d498e /src/codegen.zig
parent5154ece8b9fd64f276fb6cb6f88fdfda1fc0f935 (diff)
downloadzig-382de7bf1de8314e97eb67426b693b966f2c4e1b.tar.gz
zig-382de7bf1de8314e97eb67426b693b966f2c4e1b.zip
codegen: use non-debug Type/Value formatting
Diffstat (limited to 'src/codegen.zig')
-rw-r--r--src/codegen.zig15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/codegen.zig b/src/codegen.zig
index b322d336cd..4156dd853b 100644
--- a/src/codegen.zig
+++ b/src/codegen.zig
@@ -493,7 +493,7 @@ pub fn generateSymbol(
bin_file.allocator,
src_loc,
"TODO implement generateSymbol for big int enums ('{}')",
- .{typed_value.ty.fmtDebug()},
+ .{typed_value.ty.fmt(mod)},
),
};
}
@@ -957,13 +957,13 @@ fn genDeclRef(
tv: TypedValue,
decl_index: Module.Decl.Index,
) CodeGenError!GenResult {
- log.debug("genDeclRef: ty = {}, val = {}", .{ tv.ty.fmtDebug(), tv.val.fmtDebug() });
+ const module = bin_file.options.module.?;
+ log.debug("genDeclRef: ty = {}, val = {}", .{ tv.ty.fmt(module), tv.val.fmtValue(tv.ty, module) });
const target = bin_file.options.target;
const ptr_bits = target.cpu.arch.ptrBitWidth();
const ptr_bytes: u64 = @divExact(ptr_bits, 8);
- const module = bin_file.options.module.?;
const decl = module.declPtr(decl_index);
if (!decl.ty.isFnOrHasRuntimeBitsIgnoreComptime()) {
@@ -1025,7 +1025,8 @@ fn genUnnamedConst(
tv: TypedValue,
owner_decl_index: Module.Decl.Index,
) CodeGenError!GenResult {
- log.debug("genUnnamedConst: ty = {}, val = {}", .{ tv.ty.fmtDebug(), tv.val.fmtDebug() });
+ const mod = bin_file.options.module.?;
+ log.debug("genUnnamedConst: ty = {}, val = {}", .{ tv.ty.fmt(mod), tv.val.fmtValue(tv.ty, mod) });
const target = bin_file.options.target;
const local_sym_index = bin_file.lowerUnnamedConst(tv, owner_decl_index) catch |err| {
@@ -1065,7 +1066,11 @@ pub fn genTypedValue(
typed_value.val = rt.data;
}
- log.debug("genTypedValue: ty = {}, val = {}", .{ typed_value.ty.fmtDebug(), typed_value.val.fmtDebug() });
+ const mod = bin_file.options.module.?;
+ log.debug("genTypedValue: ty = {}, val = {}", .{
+ typed_value.ty.fmt(mod),
+ typed_value.val.fmtValue(typed_value.ty, mod),
+ });
if (typed_value.val.isUndef())
return GenResult.mcv(.undef);