dblaikie created this revision. dblaikie added a reviewer: rsmith. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Repository: rC Clang https://reviews.llvm.org/D63031 Files: lib/AST/TypePrinter.cpp lib/CodeGen/CGDebugInfo.cpp test/CodeGenCXX/debug-info-template-explicit-specialization.cpp Index: test/CodeGenCXX/debug-info-template-explicit-specialization.cpp =================================================================== --- test/CodeGenCXX/debug-info-template-explicit-specialization.cpp +++ test/CodeGenCXX/debug-info-template-explicit-specialization.cpp @@ -105,7 +105,12 @@ }; extern template class j<int>; j<int> jj; +template <typename T> +struct j_wrap { +}; +j_wrap<j<int>> j_wrap_j; // CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j<int, int>" +// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j_wrap<j<int, int> >" template <typename T> struct k { Index: lib/CodeGen/CGDebugInfo.cpp =================================================================== --- lib/CodeGen/CGDebugInfo.cpp +++ lib/CodeGen/CGDebugInfo.cpp @@ -313,7 +313,9 @@ 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. Index: lib/AST/TypePrinter.cpp =================================================================== --- lib/AST/TypePrinter.cpp +++ lib/AST/TypePrinter.cpp @@ -1204,7 +1204,8 @@ // 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();
Index: test/CodeGenCXX/debug-info-template-explicit-specialization.cpp =================================================================== --- test/CodeGenCXX/debug-info-template-explicit-specialization.cpp +++ test/CodeGenCXX/debug-info-template-explicit-specialization.cpp @@ -105,7 +105,12 @@ }; extern template class j<int>; j<int> jj; +template <typename T> +struct j_wrap { +}; +j_wrap<j<int>> j_wrap_j; // CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j<int, int>" +// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j_wrap<j<int, int> >" template <typename T> struct k { Index: lib/CodeGen/CGDebugInfo.cpp =================================================================== --- lib/CodeGen/CGDebugInfo.cpp +++ lib/CodeGen/CGDebugInfo.cpp @@ -313,7 +313,9 @@ 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. Index: lib/AST/TypePrinter.cpp =================================================================== --- lib/AST/TypePrinter.cpp +++ lib/AST/TypePrinter.cpp @@ -1204,7 +1204,8 @@ // 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();
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits