Stop using SharedTimer except to implement FrontendStatsTracer

Name binding can trigger swiftinterface compilation, which creates
a new ASTContext and runs a compilation job. If the compiler was
run with -stats-output-dir, this could trigger an assertion because
SharedTimer is not re-entrant.

Fix this by replacing all direct uses of SharedTimer in the frontend
with FrontendStatsTracer. SharedTimer is still used to _implement_
FrontendStatsTracer, however we can collapse some of the layers in
the implementation later. Many of the usages should also become
redundant over time once more code is converted over to requests.
This commit is contained in:
Slava Pestov
2019-11-15 14:45:50 -05:00
parent 4f9877233d
commit 86f6570662
10 changed files with 40 additions and 21 deletions

View File

@@ -0,0 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: mkdir %t/stats
// RUN: mkdir %t/cache
// RUN: %target-swift-frontend -typecheck %s -I %S/Inputs -stats-output-dir %t/stats -module-cache-path %t/cache
import empty