File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
include/clang/Serialization Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -526,6 +526,9 @@ class ASTReader
526526 // / A timer used to track the time spent deserializing.
527527 std::unique_ptr<llvm::Timer> ReadTimer;
528528
529+ // A TimeRegion used to start and stop ReadTimer via RAII.
530+ std::optional<llvm::TimeRegion> ReadTimeRegion;
531+
529532 // / The location where the module file will be considered as
530533 // / imported from. For non-module AST types it should be invalid.
531534 SourceLocation CurrentImportLoc;
Original file line number Diff line number Diff line change @@ -11004,8 +11004,8 @@ void ASTReader::diagnoseOdrViolations() {
1100411004
1100511005void ASTReader::StartedDeserializing () {
1100611006 if (llvm::Timer *T = ReadTimer.get ();
11007- ++NumCurrentElementsDeserializing == 1 && T && !T-> isRunning () )
11008- T-> startTimer ( );
11007+ ++NumCurrentElementsDeserializing == 1 && T)
11008+ ReadTimeRegion. emplace (T );
1100911009}
1101011010
1101111011void ASTReader::FinishedDeserializing () {
@@ -11063,8 +11063,7 @@ void ASTReader::FinishedDeserializing() {
1106311063 (void )UndeducedFD->getMostRecentDecl ();
1106411064 }
1106511065
11066- if (ReadTimer)
11067- ReadTimer->stopTimer ();
11066+ ReadTimeRegion.reset ();
1106811067
1106911068 diagnoseOdrViolations ();
1107011069 }
You can’t perform that action at this time.
0 commit comments