From ae032b6cf553bc9a274bcc2f30a68323a3296b98 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Fri, 18 Nov 2016 19:43:25 +0000 Subject: [PATCH] Adapt to llvm NamedRegionTimer changes We have to specify a name and description for the timers and groups now. llvm-svn: 287371 --- clang/lib/CodeGen/BackendUtil.cpp | 2 +- clang/lib/CodeGen/CodeGenAction.cpp | 2 +- clang/lib/Frontend/CompilerInstance.cpp | 15 ++++++++++----- clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index 62dc95e..ec790e4 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -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) diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index 5d8252bc..6961f01 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -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)) { diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 6fb880f..d314f6d 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -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 ReadTimer; if (FrontendTimerGroup) - ReadTimer = llvm::make_unique("Reading modules", + ReadTimer = llvm::make_unique("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 diff --git a/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp index 8bd0e12..b3e287e 100644 --- a/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ b/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp @@ -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"); } } -- 2.7.4