forked from OSchip/llvm-project
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:
parent
db39fd6c53
commit
ae032b6cf5
|
@ -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)
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue