aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index fbfc305..b00a4ac 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -722,11 +722,8 @@ void CompilerInstance::createCodeCompletionConsumer() {
}
void CompilerInstance::createFrontendTimer() {
- FrontendTimerGroup.reset(
- new llvm::TimerGroup("frontend", "Clang front-end time report"));
- FrontendTimer.reset(
- new llvm::Timer("frontend", "Clang front-end timer",
- *FrontendTimerGroup));
+ timerGroup.reset(new llvm::TimerGroup("clang", "Clang time report"));
+ FrontendTimer.reset(new llvm::Timer("frontend", "Front end", *timerGroup));
}
CodeCompleteConsumer *
@@ -1726,10 +1723,9 @@ void CompilerInstance::createASTReader() {
const FrontendOptions &FEOpts = getFrontendOpts();
std::unique_ptr<llvm::Timer> ReadTimer;
- if (FrontendTimerGroup)
+ if (timerGroup)
ReadTimer = std::make_unique<llvm::Timer>("reading_modules",
- "Reading modules",
- *FrontendTimerGroup);
+ "Reading modules", *timerGroup);
TheASTReader = new ASTReader(
getPreprocessor(), getModuleCache(), &getASTContext(),
getPCHContainerReader(), getFrontendOpts().ModuleFileExtensions,
@@ -1758,10 +1754,10 @@ void CompilerInstance::createASTReader() {
bool CompilerInstance::loadModuleFile(
StringRef FileName, serialization::ModuleFile *&LoadedModuleFile) {
llvm::Timer Timer;
- if (FrontendTimerGroup)
+ if (timerGroup)
Timer.init("preloading." + FileName.str(), "Preloading " + FileName.str(),
- *FrontendTimerGroup);
- llvm::TimeRegion TimeLoading(FrontendTimerGroup ? &Timer : nullptr);
+ *timerGroup);
+ llvm::TimeRegion TimeLoading(timerGroup ? &Timer : nullptr);
// If we don't already have an ASTReader, create one now.
if (!TheASTReader)
@@ -1892,10 +1888,10 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST(
// Time how long it takes to load the module.
llvm::Timer Timer;
- if (FrontendTimerGroup)
+ if (timerGroup)
Timer.init("loading." + ModuleFilename, "Loading " + ModuleFilename,
- *FrontendTimerGroup);
- llvm::TimeRegion TimeLoading(FrontendTimerGroup ? &Timer : nullptr);
+ *timerGroup);
+ llvm::TimeRegion TimeLoading(timerGroup ? &Timer : nullptr);
llvm::TimeTraceScope TimeScope("Module Load", ModuleName);
// Try to load the module file. If we are not trying to load from the