summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLubos Lunak <l.lunak@centrum.cz>2019-05-12 10:39:21 +0000
committerLubos Lunak <l.lunak@centrum.cz>2019-05-12 10:39:21 +0000
commitab8cde446b51cd7dbe9f8aa0c0a392180f6a6e2a (patch)
treee9873640ec4241f2c091783f8c49a8fb9874535a
parentdebad6460b63ff2269cca859751a053a9e29d6d4 (diff)
downloadbcm5719-llvm-ab8cde446b51cd7dbe9f8aa0c0a392180f6a6e2a.tar.gz
bcm5719-llvm-ab8cde446b51cd7dbe9f8aa0c0a392180f6a6e2a.zip
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
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp9
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiate.cpp6
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp6
3 files changed, 17 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 2878f9c6771..3a84bdf94c8 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -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.
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index af56ff06ac4..edc281cad6e 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -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;
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 1c7341d3cf8..6c5847ddfcd 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -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
OpenPOWER on IntegriCloud