| ... | @@ -992,11 +992,16 @@ fn analyzeBodyInner( | ... | @@ -992,11 +992,16 @@ fn analyzeBodyInner( |
| 992 | while (true) { | 992 | while (true) { |
| 993 | crash_info.setBodyIndex(i); | 993 | crash_info.setBodyIndex(i); |
| 994 | const inst = body[i]; | 994 | const inst = body[i]; |
| 995 | std.log.scoped(.sema_zir).debug("sema ZIR {s} %{d}", .{ sub_file_path: { | 995 | |
| 996 | const path_digest = block.src_base_inst.resolveFull(&mod.intern_pool).path_digest; | 996 | // The hashmap lookup in here is a little expensive, and LLVM fails to optimize it away. |
| 997 | const index = mod.path_digest_map.getIndex(path_digest).?; | 997 | if (build_options.enable_logging) { |
| 998 | break :sub_file_path mod.import_table.values()[index].sub_file_path; | 998 | std.log.scoped(.sema_zir).debug("sema ZIR {s} %{d}", .{ sub_file_path: { |
| 999 | }, inst }); | 999 | const path_digest = block.src_base_inst.resolveFull(&mod.intern_pool).path_digest; |
| | 1000 | const index = mod.path_digest_map.getIndex(path_digest).?; |
| | 1001 | break :sub_file_path mod.import_table.values()[index].sub_file_path; |
| | 1002 | }, inst }); |
| | 1003 | } |
| | 1004 | |
| 1000 | const air_inst: Air.Inst.Ref = switch (tags[@intFromEnum(inst)]) { | 1005 | const air_inst: Air.Inst.Ref = switch (tags[@intFromEnum(inst)]) { |
| 1001 | // zig fmt: off | 1006 | // zig fmt: off |
| 1002 | .alloc => try sema.zirAlloc(block, inst), | 1007 | .alloc => try sema.zirAlloc(block, inst), |