| ... | ... | @@ -4274,11 +4274,14 @@ pub fn ensureFuncBodyAnalyzed(mod: *Module, func: *Fn) SemaError!void { |
| 4274 | 4274 | |
| 4275 | 4275 | const comp = mod.comp; |
| 4276 | 4276 | |
| 4277 | | if (comp.bin_file.options.emit == null and |
| 4277 | const no_bin_file = (comp.bin_file.options.emit == null and |
| 4278 | 4278 | comp.emit_asm == null and |
| 4279 | 4279 | comp.emit_llvm_ir == null and |
| 4280 | | comp.emit_llvm_bc == null) |
| 4281 | | { |
| 4280 | comp.emit_llvm_bc == null); |
| 4281 | |
| 4282 | const dump_air = builtin.mode == .Debug and comp.verbose_air; |
| 4283 | |
| 4284 | if (no_bin_file and !dump_air) { |
| 4282 | 4285 | return; |
| 4283 | 4286 | } |
| 4284 | 4287 | |
| ... | ... | @@ -4286,7 +4289,7 @@ pub fn ensureFuncBodyAnalyzed(mod: *Module, func: *Fn) SemaError!void { |
| 4286 | 4289 | var liveness = try Liveness.analyze(gpa, air); |
| 4287 | 4290 | defer liveness.deinit(gpa); |
| 4288 | 4291 | |
| 4289 | | if (builtin.mode == .Debug and comp.verbose_air) { |
| 4292 | if (dump_air) { |
| 4290 | 4293 | const fqn = try decl.getFullyQualifiedName(mod); |
| 4291 | 4294 | defer mod.gpa.free(fqn); |
| 4292 | 4295 | |
| ... | ... | @@ -4295,6 +4298,10 @@ pub fn ensureFuncBodyAnalyzed(mod: *Module, func: *Fn) SemaError!void { |
| 4295 | 4298 | std.debug.print("# End Function AIR: {s}\n\n", .{fqn}); |
| 4296 | 4299 | } |
| 4297 | 4300 | |
| 4301 | if (no_bin_file) { |
| 4302 | return; |
| 4303 | } |
| 4304 | |
| 4298 | 4305 | comp.bin_file.updateFunc(mod, func, air, liveness) catch |err| switch (err) { |
| 4299 | 4306 | error.OutOfMemory => return error.OutOfMemory, |
| 4300 | 4307 | error.AnalysisFail => { |