@@ -369,7 +369,7 @@ shouldImplicityImportSwiftOnoneSupportModule(CompilerInvocation &Invocation) {
369
369
}
370
370
371
371
void CompilerInstance::performSema () {
372
- SharedTimer timer ( " performSema " );
372
+ FrontendStatsTracer tracer (Context-> Stats , " perform-sema " );
373
373
Context->LoadedModules [MainModule->getName ()] = getMainModule ();
374
374
375
375
if (Invocation.getInputKind () == InputFileKind::IFK_SIL) {
@@ -417,7 +417,7 @@ CompilerInstance::ImplicitImports::ImplicitImports(CompilerInstance &compiler) {
417
417
}
418
418
419
419
bool CompilerInstance::loadStdlib () {
420
- SharedTimer timer ( " performSema-loadStdlib " );
420
+ FrontendStatsTracer tracer (Context-> Stats , " load-stdlib " );
421
421
ModuleDecl *M = Context->getStdlibModule (true );
422
422
423
423
if (!M) {
@@ -436,7 +436,7 @@ bool CompilerInstance::loadStdlib() {
436
436
}
437
437
438
438
ModuleDecl *CompilerInstance::importUnderlyingModule () {
439
- SharedTimer timer ( " performSema-importUnderlyingModule " );
439
+ FrontendStatsTracer tracer (Context-> Stats , " import-underlying-module " );
440
440
ModuleDecl *objCModuleUnderlyingMixedFramework =
441
441
static_cast <ClangImporter *>(Context->getClangModuleLoader ())
442
442
->loadModule (SourceLoc (),
@@ -449,7 +449,7 @@ ModuleDecl *CompilerInstance::importUnderlyingModule() {
449
449
}
450
450
451
451
ModuleDecl *CompilerInstance::importBridgingHeader () {
452
- SharedTimer timer ( " performSema-importBridgingHeader " );
452
+ FrontendStatsTracer tracer (Context-> Stats , " import-bridging-header " );
453
453
const StringRef implicitHeaderPath =
454
454
Invocation.getFrontendOptions ().ImplicitObjCHeaderPath ;
455
455
auto clangImporter =
@@ -464,7 +464,7 @@ ModuleDecl *CompilerInstance::importBridgingHeader() {
464
464
465
465
void CompilerInstance::getImplicitlyImportedModules (
466
466
SmallVectorImpl<ModuleDecl *> &importModules) {
467
- SharedTimer timer ( " performSema-getImplicitlyImportedModules " );
467
+ FrontendStatsTracer tracer (Context-> Stats , " get-implicitly-imported-modules " );
468
468
for (auto &ImplicitImportModuleName :
469
469
Invocation.getFrontendOptions ().ImplicitImportModuleNames ) {
470
470
if (Lexer::isIdentifier (ImplicitImportModuleName)) {
@@ -520,7 +520,7 @@ void CompilerInstance::addMainFileToModule(
520
520
521
521
void CompilerInstance::parseAndCheckTypes (
522
522
const ImplicitImports &implicitImports) {
523
- SharedTimer timer ( " performSema-parseAndCheckTypes " );
523
+ FrontendStatsTracer tracer (Context-> Stats , " parse-and-check-types " );
524
524
// Delayed parsing callback for the primary file, or all files
525
525
// in non-WMO mode.
526
526
std::unique_ptr<DelayedParsingCallbacks> PrimaryDelayedCB{
@@ -584,7 +584,7 @@ void CompilerInstance::parseLibraryFile(
584
584
PersistentParserState &PersistentState,
585
585
DelayedParsingCallbacks *PrimaryDelayedCB,
586
586
DelayedParsingCallbacks *SecondaryDelayedCB) {
587
- SharedTimer timer ( " performSema-parseLibraryFile " );
587
+ FrontendStatsTracer tracer (Context-> Stats , " parse-library-file " );
588
588
589
589
auto *NextInput = createSourceFileForMainModule (
590
590
SourceFileKind::Library, implicitImports.kind , BufferID);
@@ -638,7 +638,8 @@ bool CompilerInstance::parsePartialModulesAndLibraryFiles(
638
638
PersistentParserState &PersistentState,
639
639
DelayedParsingCallbacks *PrimaryDelayedCB,
640
640
DelayedParsingCallbacks *SecondaryDelayedCB) {
641
- SharedTimer timer (" performSema-parsePartialModulesAndLibraryFiles" );
641
+ FrontendStatsTracer tracer (Context->Stats ,
642
+ " parse-partial-modules-and-library-files" );
642
643
bool hadLoadError = false ;
643
644
// Parse all the partial modules first.
644
645
for (auto &PM : PartialModules) {
@@ -662,8 +663,8 @@ void CompilerInstance::parseAndTypeCheckMainFile(
662
663
PersistentParserState &PersistentState,
663
664
DelayedParsingCallbacks *DelayedParseCB,
664
665
OptionSet<TypeCheckingFlags> TypeCheckOptions) {
665
- SharedTimer timer (
666
- " performSema-checkTypesWhileParsingMain-parseAndTypeCheckMainFile " );
666
+ FrontendStatsTracer tracer (Context-> Stats ,
667
+ " parse-and-typecheck-main-file " );
667
668
bool mainIsPrimary =
668
669
(isWholeModuleCompilation () || isPrimaryInput (MainBufferID));
669
670
0 commit comments