diff options
| author | David Blaikie <dblaikie@gmail.com> | 2019-10-18 23:58:34 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2019-10-18 23:58:34 +0000 |
| commit | 9fdd09a4ccd01feb8e00be22b17e944e46807746 (patch) | |
| tree | 4267a76ff85757c6e8a99fb8c359347edd94191c /clang/lib | |
| parent | 937241b0d9e8f896d4387292f01abf18ba9f9fcb (diff) | |
| download | bcm5719-llvm-9fdd09a4ccd01feb8e00be22b17e944e46807746.tar.gz bcm5719-llvm-9fdd09a4ccd01feb8e00be22b17e944e46807746.zip | |
DebugInfo: Render the canonical name of a class template specialization, even when nested in another class template specialization
Differential Revision: https://reviews.llvm.org/D63031
llvm-svn: 375304
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/TypePrinter.cpp | 3 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp index d7b7103faaa..dacbf9a96d8 100644 --- a/clang/lib/AST/TypePrinter.cpp +++ b/clang/lib/AST/TypePrinter.cpp @@ -1204,7 +1204,8 @@ void TypePrinter::printTag(TagDecl *D, raw_ostream &OS) { // arguments. if (const auto *Spec = dyn_cast<ClassTemplateSpecializationDecl>(D)) { ArrayRef<TemplateArgument> Args; - if (TypeSourceInfo *TAW = Spec->getTypeAsWritten()) { + TypeSourceInfo *TAW = Spec->getTypeAsWritten(); + if (!Policy.PrintCanonicalTypes && TAW) { const TemplateSpecializationType *TST = cast<TemplateSpecializationType>(TAW->getType()); Args = TST->template_arguments(); diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 7962ae002b2..294d54e3788 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -314,7 +314,9 @@ StringRef CGDebugInfo::getClassName(const RecordDecl *RD) { if (isa<ClassTemplateSpecializationDecl>(RD)) { SmallString<128> Name; llvm::raw_svector_ostream OS(Name); - RD->getNameForDiagnostic(OS, getPrintingPolicy(), + PrintingPolicy PP = getPrintingPolicy(); + PP.PrintCanonicalTypes = true; + RD->getNameForDiagnostic(OS, PP, /*Qualified*/ false); // Copy this name on the side and use its reference. |

