| ... | ... | @@ -66,6 +66,7 @@ root_mod: *Package.Module, |
| 66 | 66 | main_mod: *Package.Module, |
| 67 | 67 | std_mod: *Package.Module, |
| 68 | 68 | sema_prog_node: std.Progress.Node = undefined, |
| 69 | codegen_prog_node: std.Progress.Node = undefined, |
| 69 | 70 | |
| 70 | 71 | /// Used by AstGen worker to load and store ZIR cache. |
| 71 | 72 | global_zir_cache: Compilation.Directory, |
| ... | ... | @@ -3009,7 +3010,7 @@ pub fn ensureDeclAnalyzed(mod: *Module, decl_index: Decl.Index) SemaError!void { |
| 3009 | 3010 | }; |
| 3010 | 3011 | } |
| 3011 | 3012 | |
| 3012 | | const decl_prog_node = mod.sema_prog_node.start(decl.name.toSlice(ip), 0); |
| 3013 | const decl_prog_node = mod.sema_prog_node.start((try decl.fullyQualifiedName(mod)).toSlice(ip), 0); |
| 3013 | 3014 | defer decl_prog_node.end(); |
| 3014 | 3015 | |
| 3015 | 3016 | break :blk mod.semaDecl(decl_index) catch |err| switch (err) { |
| ... | ... | @@ -3215,6 +3216,9 @@ pub fn ensureFuncBodyAnalyzed(zcu: *Zcu, maybe_coerced_func_index: InternPool.In |
| 3215 | 3216 | }; |
| 3216 | 3217 | } |
| 3217 | 3218 | |
| 3219 | const codegen_prog_node = zcu.codegen_prog_node.start((try decl.fullyQualifiedName(zcu)).toSlice(ip), 0); |
| 3220 | defer codegen_prog_node.end(); |
| 3221 | |
| 3218 | 3222 | if (comp.bin_file) |lf| { |
| 3219 | 3223 | lf.updateFunc(zcu, func_index, air, liveness) catch |err| switch (err) { |
| 3220 | 3224 | error.OutOfMemory => return error.OutOfMemory, |
| ... | ... | @@ -4500,6 +4504,9 @@ pub fn analyzeFnBody(mod: *Module, func_index: InternPool.Index, arena: Allocato |
| 4500 | 4504 | log.debug("finish func name '{}'", .{(decl.fullyQualifiedName(mod) catch break :blk).fmt(ip)}); |
| 4501 | 4505 | } |
| 4502 | 4506 | |
| 4507 | const decl_prog_node = mod.sema_prog_ndoe.start((try decl.fullyQualifiedName(mod)).toSlice(ip), 0); |
| 4508 | defer decl_prog_node.end(); |
| 4509 | |
| 4503 | 4510 | mod.intern_pool.removeDependenciesForDepender(gpa, InternPool.Depender.wrap(.{ .func = func_index })); |
| 4504 | 4511 | |
| 4505 | 4512 | var comptime_err_ret_trace = std.ArrayList(SrcLoc).init(gpa); |
| ... | ... | @@ -5333,9 +5340,12 @@ pub fn populateTestFunctions( |
| 5333 | 5340 | // We have to call `ensureDeclAnalyzed` here in case `builtin.test_functions` |
| 5334 | 5341 | // was not referenced by start code. |
| 5335 | 5342 | mod.sema_prog_node = main_progress_node.start("Semantic Analysis", 0); |
| 5343 | mod.codegen_prog_node = main_progress_node.start("Code Generation", 0); |
| 5336 | 5344 | defer { |
| 5337 | 5345 | mod.sema_prog_node.end(); |
| 5338 | 5346 | mod.sema_prog_node = undefined; |
| 5347 | mod.codegen_prog_node.end(); |
| 5348 | mod.codegen_prog_node = undefined; |
| 5339 | 5349 | } |
| 5340 | 5350 | try mod.ensureDeclAnalyzed(decl_index); |
| 5341 | 5351 | } |
| ... | ... | @@ -5445,15 +5455,18 @@ pub fn populateTestFunctions( |
| 5445 | 5455 | pub fn linkerUpdateDecl(zcu: *Zcu, decl_index: Decl.Index) !void { |
| 5446 | 5456 | const comp = zcu.comp; |
| 5447 | 5457 | |
| 5458 | const decl = zcu.declPtr(decl_index); |
| 5459 | |
| 5460 | const codegen_prog_node = zcu.codegen_prog_node.start((try decl.fullyQualifiedName(zcu)).toSlice(&zcu.intern_pool), 0); |
| 5461 | defer codegen_prog_node.end(); |
| 5462 | |
| 5448 | 5463 | if (comp.bin_file) |lf| { |
| 5449 | 5464 | lf.updateDecl(zcu, decl_index) catch |err| switch (err) { |
| 5450 | 5465 | error.OutOfMemory => return error.OutOfMemory, |
| 5451 | 5466 | error.AnalysisFail => { |
| 5452 | | const decl = zcu.declPtr(decl_index); |
| 5453 | 5467 | decl.analysis = .codegen_failure; |
| 5454 | 5468 | }, |
| 5455 | 5469 | else => { |
| 5456 | | const decl = zcu.declPtr(decl_index); |
| 5457 | 5470 | const gpa = zcu.gpa; |
| 5458 | 5471 | try zcu.failed_decls.ensureUnusedCapacity(gpa, 1); |
| 5459 | 5472 | zcu.failed_decls.putAssumeCapacityNoClobber(decl_index, try ErrorMsg.create( |
| ... | ... | @@ -5471,7 +5484,6 @@ pub fn linkerUpdateDecl(zcu: *Zcu, decl_index: Decl.Index) !void { |
| 5471 | 5484 | llvm_object.updateDecl(zcu, decl_index) catch |err| switch (err) { |
| 5472 | 5485 | error.OutOfMemory => return error.OutOfMemory, |
| 5473 | 5486 | error.AnalysisFail => { |
| 5474 | | const decl = zcu.declPtr(decl_index); |
| 5475 | 5487 | decl.analysis = .codegen_failure; |
| 5476 | 5488 | }, |
| 5477 | 5489 | }; |