make -ftime-trace also print template arguments

Without this, I get e.g. 'PerformPendingInstantiations' -> 'std::fill',
now I get 'std::fill<unsigned long *, int>'.

Differential Revision: https://reviews.llvm.org/D61822

llvm-svn: 360539
This commit is contained in:
Lubos Lunak 2019-05-12 10:39:21 +00:00
parent debad6460b
commit ab8cde446b
3 changed files with 17 additions and 4 deletions

View File

@ -2695,8 +2695,13 @@ void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD, llvm::GlobalValue *GV) {
if (!shouldEmitFunction(GD))
return;
llvm::TimeTraceScope TimeScope(
"CodeGen Function", [&]() { return FD->getQualifiedNameAsString(); });
llvm::TimeTraceScope TimeScope("CodeGen Function", [&]() {
std::string Name;
llvm::raw_string_ostream OS(Name);
FD->getNameForDiagnostic(OS, getContext().getPrintingPolicy(),
/*Qualified=*/true);
return Name;
});
if (const auto *Method = dyn_cast<CXXMethodDecl>(D)) {
// Make sure to emit the definition(s) before we emit the thunks.

View File

@ -2014,7 +2014,11 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation,
return true;
llvm::TimeTraceScope TimeScope("InstantiateClass", [&]() {
return Instantiation->getQualifiedNameAsString();
std::string Name;
llvm::raw_string_ostream OS(Name);
Instantiation->getNameForDiagnostic(OS, getPrintingPolicy(),
/*Qualified=*/true);
return Name;
});
Pattern = PatternDef;

View File

@ -4156,7 +4156,11 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
}
llvm::TimeTraceScope TimeScope("InstantiateFunction", [&]() {
return Function->getQualifiedNameAsString();
std::string Name;
llvm::raw_string_ostream OS(Name);
Function->getNameForDiagnostic(OS, getPrintingPolicy(),
/*Qualified=*/true);
return Name;
});
// If we're performing recursive template instantiation, create our own