| ... | ... | @@ -6431,13 +6431,27 @@ pub fn processExports(mod: *Module) !void { |
| 6431 | 6431 | } |
| 6432 | 6432 | } |
| 6433 | 6433 | |
| 6434 | | pub fn populateTestFunctions(mod: *Module) !void { |
| 6434 | pub fn populateTestFunctions( |
| 6435 | mod: *Module, |
| 6436 | main_progress_node: *std.Progress.Node, |
| 6437 | ) !void { |
| 6435 | 6438 | const gpa = mod.gpa; |
| 6436 | 6439 | const builtin_pkg = mod.main_pkg.table.get("builtin").?; |
| 6437 | 6440 | const builtin_file = (mod.importPkg(builtin_pkg) catch unreachable).file; |
| 6438 | 6441 | const root_decl = mod.declPtr(builtin_file.root_decl.unwrap().?); |
| 6439 | 6442 | const builtin_namespace = root_decl.src_namespace; |
| 6440 | 6443 | const decl_index = builtin_namespace.decls.getKeyAdapted(@as([]const u8, "test_functions"), DeclAdapter{ .mod = mod }).?; |
| 6444 | { |
| 6445 | // We have to call `ensureDeclAnalyzed` here in case `builtin.test_functions` |
| 6446 | // was not referenced by start code. |
| 6447 | mod.sema_prog_node = main_progress_node.start("Semantic Analysis", 0); |
| 6448 | mod.sema_prog_node.activate(); |
| 6449 | defer { |
| 6450 | mod.sema_prog_node.end(); |
| 6451 | mod.sema_prog_node = undefined; |
| 6452 | } |
| 6453 | try mod.ensureDeclAnalyzed(decl_index); |
| 6454 | } |
| 6441 | 6455 | const decl = mod.declPtr(decl_index); |
| 6442 | 6456 | var buf: Type.SlicePtrFieldTypeBuffer = undefined; |
| 6443 | 6457 | const tmp_test_fn_ty = decl.ty.slicePtrFieldType(&buf).elemType(); |