aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-07-27 15:10:49 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-07-27 15:10:49 -0700
commit1eeafc39675a349c912910da2a1b70097a934d57 (patch)
treea7fdbc64cd051046d86d3614d90f62ea3eef5af8 /src/Compilation.zig
parenta8e964eadd3496330043985cacaaee7db92886c6 (diff)
downloadzig-1eeafc39675a349c912910da2a1b70097a934d57.tar.gz
zig-1eeafc39675a349c912910da2a1b70097a934d57.zip
stage2: move call to populateTestFunctions() outside performAllTheWork()
Before calling populateTestFunctions() we want to check totalErrorCount() but that will read from some tables that might get populated by the thread pool for C compilation tasks. So we wait until all those tasks are finished before proceeding.
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 00cdba85a4..8672a346c3 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1737,6 +1737,13 @@ pub fn update(self: *Compilation) !void {
if (!use_stage1) {
if (self.bin_file.options.module) |module| {
+ if (self.bin_file.options.is_test and self.totalErrorCount() == 0) {
+ // The `test_functions` decl has been intentionally postponed until now,
+ // at which point we must populate it with the list of test functions that
+ // have been discovered and not filtered out.
+ try module.populateTestFunctions();
+ }
+
// Process the deletion set. We use a while loop here because the
// deletion set may grow as we call `clearDecl` within this loop,
// and more unreferenced Decls are revealed.
@@ -2384,14 +2391,6 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor
};
},
};
-
- if (self.bin_file.options.is_test and self.totalErrorCount() == 0) {
- // The `test_functions` decl has been intentionally postponed until now,
- // at which point we must populate it with the list of test functions that
- // have been discovered and not filtered out.
- const mod = self.bin_file.options.module.?;
- try mod.populateTestFunctions();
- }
}
const AstGenSrc = union(enum) {