Adapt to llvm NamedRegionTimer changes

We have to specify a name and description for the timers and groups now.

llvm-svn: 287371
This commit is contained in:
Matthias Braun 2016-11-18 19:43:25 +00:00
parent db39fd6c53
commit ae032b6cf5
4 changed files with 13 additions and 8 deletions

View File

@ -102,7 +102,7 @@ public:
const clang::TargetOptions &TOpts,
const LangOptions &LOpts, Module *M)
: Diags(_Diags), CodeGenOpts(CGOpts), TargetOpts(TOpts), LangOpts(LOpts),
TheModule(M), CodeGenerationTime("Code Generation Time") {}
TheModule(M), CodeGenerationTime("codegen", "Code Generation Time") {}
~EmitAssemblyHelper() {
if (CodeGenOpts.DisableFree)

View File

@ -75,7 +75,7 @@ namespace clang {
: Diags(Diags), Action(Action), CodeGenOpts(CodeGenOpts),
TargetOpts(TargetOpts), LangOpts(LangOpts),
AsmOutStream(std::move(OS)), Context(nullptr),
LLVMIRGeneration("LLVM IR Generation Time"),
LLVMIRGeneration("irgen", "LLVM IR Generation Time"),
LLVMIRGenerationRefCount(0),
Gen(CreateLLVMCodeGen(Diags, InFile, HeaderSearchOpts, PPOpts,
CodeGenOpts, C, CoverageInfo)) {

View File

@ -522,9 +522,11 @@ void CompilerInstance::createCodeCompletionConsumer() {
}
void CompilerInstance::createFrontendTimer() {
FrontendTimerGroup.reset(new llvm::TimerGroup("Clang front-end time report"));
FrontendTimerGroup.reset(
new llvm::TimerGroup("frontend", "Clang front-end time report"));
FrontendTimer.reset(
new llvm::Timer("Clang front-end timer", *FrontendTimerGroup));
new llvm::Timer("frontend", "Clang front-end timer",
*FrontendTimerGroup));
}
CodeCompleteConsumer *
@ -1324,7 +1326,8 @@ void CompilerInstance::createModuleManager() {
const PreprocessorOptions &PPOpts = getPreprocessorOpts();
std::unique_ptr<llvm::Timer> ReadTimer;
if (FrontendTimerGroup)
ReadTimer = llvm::make_unique<llvm::Timer>("Reading modules",
ReadTimer = llvm::make_unique<llvm::Timer>("reading_modules",
"Reading modules",
*FrontendTimerGroup);
ModuleManager = new ASTReader(
getPreprocessor(), getASTContext(), getPCHContainerReader(),
@ -1357,7 +1360,8 @@ void CompilerInstance::createModuleManager() {
bool CompilerInstance::loadModuleFile(StringRef FileName) {
llvm::Timer Timer;
if (FrontendTimerGroup)
Timer.init("Preloading " + FileName.str(), *FrontendTimerGroup);
Timer.init("preloading." + FileName.str(), "Preloading " + FileName.str(),
*FrontendTimerGroup);
llvm::TimeRegion TimeLoading(FrontendTimerGroup ? &Timer : nullptr);
// Helper to recursively read the module names for all modules we're adding.
@ -1509,7 +1513,8 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
llvm::Timer Timer;
if (FrontendTimerGroup)
Timer.init("Loading " + ModuleFileName, *FrontendTimerGroup);
Timer.init("loading." + ModuleFileName, "Loading " + ModuleFileName,
*FrontendTimerGroup);
llvm::TimeRegion TimeLoading(FrontendTimerGroup ? &Timer : nullptr);
// Try to load the module file. If we are trying to load from the prebuilt

View File

@ -201,7 +201,7 @@ public:
DigestAnalyzerOptions();
if (Opts->PrintStats) {
llvm::EnableStatistics(false);
TUTotalTimer = new llvm::Timer("Analyzer Total Time");
TUTotalTimer = new llvm::Timer("time", "Analyzer Total Time");
}
}