authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-04-05 09:16:33+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-04-13 11:47:51+02:00
log382de7bf1de8314e97eb67426b693b966f2c4e1b
tree5c50e9cad16c132cdb632e12d5b6d4f1034d498e
parent5154ece8b9fd64f276fb6cb6f88fdfda1fc0f935

codegen: use non-debug Type/Value formatting


1 files changed, 10 insertions(+), 5 deletions(-)

src/codegen.zig+10-5
......@@ -493,7 +493,7 @@ pub fn generateSymbol(
493493 bin_file.allocator,
494494 src_loc,
495495 "TODO implement generateSymbol for big int enums ('{}')",
496 .{typed_value.ty.fmtDebug()},
496 .{typed_value.ty.fmt(mod)},
497497 ),
498498 };
499499 }
......@@ -957,13 +957,13 @@ fn genDeclRef(
957957 tv: TypedValue,
958958 decl_index: Module.Decl.Index,
959959) CodeGenError!GenResult {
960 log.debug("genDeclRef: ty = {}, val = {}", .{ tv.ty.fmtDebug(), tv.val.fmtDebug() });
960 const module = bin_file.options.module.?;
961 log.debug("genDeclRef: ty = {}, val = {}", .{ tv.ty.fmt(module), tv.val.fmtValue(tv.ty, module) });
961962
962963 const target = bin_file.options.target;
963964 const ptr_bits = target.cpu.arch.ptrBitWidth();
964965 const ptr_bytes: u64 = @divExact(ptr_bits, 8);
965966
966 const module = bin_file.options.module.?;
967967 const decl = module.declPtr(decl_index);
968968
969969 if (!decl.ty.isFnOrHasRuntimeBitsIgnoreComptime()) {
......@@ -1025,7 +1025,8 @@ fn genUnnamedConst(
10251025 tv: TypedValue,
10261026 owner_decl_index: Module.Decl.Index,
10271027) CodeGenError!GenResult {
1028 log.debug("genUnnamedConst: ty = {}, val = {}", .{ tv.ty.fmtDebug(), tv.val.fmtDebug() });
1028 const mod = bin_file.options.module.?;
1029 log.debug("genUnnamedConst: ty = {}, val = {}", .{ tv.ty.fmt(mod), tv.val.fmtValue(tv.ty, mod) });
10291030
10301031 const target = bin_file.options.target;
10311032 const local_sym_index = bin_file.lowerUnnamedConst(tv, owner_decl_index) catch |err| {
......@@ -1065,7 +1066,11 @@ pub fn genTypedValue(
10651066 typed_value.val = rt.data;
10661067 }
10671068
1068 log.debug("genTypedValue: ty = {}, val = {}", .{ typed_value.ty.fmtDebug(), typed_value.val.fmtDebug() });
1069 const mod = bin_file.options.module.?;
1070 log.debug("genTypedValue: ty = {}, val = {}", .{
1071 typed_value.ty.fmt(mod),
1072 typed_value.val.fmtValue(typed_value.ty, mod),
1073 });
10691074
10701075 if (typed_value.val.isUndef())
10711076 return GenResult.mcv(.undef);