@@ -391,7 +391,7 @@ shouldImplicityImportSwiftOnoneSupportModule(CompilerInvocation &Invocation) {
391
391
}
392
392
393
393
void CompilerInstance::performSema () {
394
- SharedTimer timer ( " performSema " );
394
+ FrontendStatsTracer tracer (Context-> Stats , " perform-sema " );
395
395
Context->LoadedModules [MainModule->getName ()] = getMainModule ();
396
396
397
397
if (Invocation.getInputKind () == InputFileKind::IFK_SIL) {
@@ -439,7 +439,7 @@ CompilerInstance::ImplicitImports::ImplicitImports(CompilerInstance &compiler) {
439
439
}
440
440
441
441
bool CompilerInstance::loadStdlib () {
442
- SharedTimer timer ( " performSema-loadStdlib " );
442
+ FrontendStatsTracer tracer (Context-> Stats , " load-stdlib " );
443
443
ModuleDecl *M = Context->getStdlibModule (true );
444
444
445
445
if (!M) {
@@ -458,7 +458,7 @@ bool CompilerInstance::loadStdlib() {
458
458
}
459
459
460
460
ModuleDecl *CompilerInstance::importUnderlyingModule () {
461
- SharedTimer timer ( " performSema-importUnderlyingModule " );
461
+ FrontendStatsTracer tracer (Context-> Stats , " import-underlying-module " );
462
462
ModuleDecl *objCModuleUnderlyingMixedFramework =
463
463
static_cast <ClangImporter *>(Context->getClangModuleLoader ())
464
464
->loadModule (SourceLoc (),
@@ -471,7 +471,7 @@ ModuleDecl *CompilerInstance::importUnderlyingModule() {
471
471
}
472
472
473
473
ModuleDecl *CompilerInstance::importBridgingHeader () {
474
- SharedTimer timer ( " performSema-importBridgingHeader " );
474
+ FrontendStatsTracer tracer (Context-> Stats , " import-bridging-header " );
475
475
const StringRef implicitHeaderPath =
476
476
Invocation.getFrontendOptions ().ImplicitObjCHeaderPath ;
477
477
auto clangImporter =
@@ -486,7 +486,7 @@ ModuleDecl *CompilerInstance::importBridgingHeader() {
486
486
487
487
void CompilerInstance::getImplicitlyImportedModules (
488
488
SmallVectorImpl<ModuleDecl *> &importModules) {
489
- SharedTimer timer ( " performSema-getImplicitlyImportedModules " );
489
+ FrontendStatsTracer tracer (Context-> Stats , " get-implicitly-imported-modules " );
490
490
for (auto &ImplicitImportModuleName :
491
491
Invocation.getFrontendOptions ().ImplicitImportModuleNames ) {
492
492
if (Lexer::isIdentifier (ImplicitImportModuleName)) {
@@ -542,7 +542,7 @@ void CompilerInstance::addMainFileToModule(
542
542
543
543
void CompilerInstance::parseAndCheckTypes (
544
544
const ImplicitImports &implicitImports) {
545
- SharedTimer timer ( " performSema-parseAndCheckTypes " );
545
+ FrontendStatsTracer tracer (Context-> Stats , " parse-and-check-types " );
546
546
// Delayed parsing callback for the primary file, or all files
547
547
// in non-WMO mode.
548
548
std::unique_ptr<DelayedParsingCallbacks> PrimaryDelayedCB{
@@ -606,7 +606,7 @@ void CompilerInstance::parseLibraryFile(
606
606
PersistentParserState &PersistentState,
607
607
DelayedParsingCallbacks *PrimaryDelayedCB,
608
608
DelayedParsingCallbacks *SecondaryDelayedCB) {
609
- SharedTimer timer ( " performSema-parseLibraryFile " );
609
+ FrontendStatsTracer tracer (Context-> Stats , " parse-library-file " );
610
610
611
611
auto *NextInput = createSourceFileForMainModule (
612
612
SourceFileKind::Library, implicitImports.kind , BufferID);
@@ -660,7 +660,8 @@ bool CompilerInstance::parsePartialModulesAndLibraryFiles(
660
660
PersistentParserState &PersistentState,
661
661
DelayedParsingCallbacks *PrimaryDelayedCB,
662
662
DelayedParsingCallbacks *SecondaryDelayedCB) {
663
- SharedTimer timer (" performSema-parsePartialModulesAndLibraryFiles" );
663
+ FrontendStatsTracer tracer (Context->Stats ,
664
+ " parse-partial-modules-and-library-files" );
664
665
bool hadLoadError = false ;
665
666
// Parse all the partial modules first.
666
667
for (auto &PM : PartialModules) {
@@ -684,8 +685,8 @@ void CompilerInstance::parseAndTypeCheckMainFile(
684
685
PersistentParserState &PersistentState,
685
686
DelayedParsingCallbacks *DelayedParseCB,
686
687
OptionSet<TypeCheckingFlags> TypeCheckOptions) {
687
- SharedTimer timer (
688
- " performSema-checkTypesWhileParsingMain-parseAndTypeCheckMainFile " );
688
+ FrontendStatsTracer tracer (Context-> Stats ,
689
+ " parse-and-typecheck-main-file " );
689
690
bool mainIsPrimary =
690
691
(isWholeModuleCompilation () || isPrimaryInput (MainBufferID));
691
692
0 commit comments