mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 19:26:06 +00:00
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
This commit is contained in:
parent
937241b0d9
commit
9fdd09a4cc
@ -1204,7 +1204,8 @@ void TypePrinter::printTag(TagDecl *D, raw_ostream &OS) {
|
|||||||
// arguments.
|
// arguments.
|
||||||
if (const auto *Spec = dyn_cast<ClassTemplateSpecializationDecl>(D)) {
|
if (const auto *Spec = dyn_cast<ClassTemplateSpecializationDecl>(D)) {
|
||||||
ArrayRef<TemplateArgument> Args;
|
ArrayRef<TemplateArgument> Args;
|
||||||
if (TypeSourceInfo *TAW = Spec->getTypeAsWritten()) {
|
TypeSourceInfo *TAW = Spec->getTypeAsWritten();
|
||||||
|
if (!Policy.PrintCanonicalTypes && TAW) {
|
||||||
const TemplateSpecializationType *TST =
|
const TemplateSpecializationType *TST =
|
||||||
cast<TemplateSpecializationType>(TAW->getType());
|
cast<TemplateSpecializationType>(TAW->getType());
|
||||||
Args = TST->template_arguments();
|
Args = TST->template_arguments();
|
||||||
|
@ -314,7 +314,9 @@ StringRef CGDebugInfo::getClassName(const RecordDecl *RD) {
|
|||||||
if (isa<ClassTemplateSpecializationDecl>(RD)) {
|
if (isa<ClassTemplateSpecializationDecl>(RD)) {
|
||||||
SmallString<128> Name;
|
SmallString<128> Name;
|
||||||
llvm::raw_svector_ostream OS(Name);
|
llvm::raw_svector_ostream OS(Name);
|
||||||
RD->getNameForDiagnostic(OS, getPrintingPolicy(),
|
PrintingPolicy PP = getPrintingPolicy();
|
||||||
|
PP.PrintCanonicalTypes = true;
|
||||||
|
RD->getNameForDiagnostic(OS, PP,
|
||||||
/*Qualified*/ false);
|
/*Qualified*/ false);
|
||||||
|
|
||||||
// Copy this name on the side and use its reference.
|
// Copy this name on the side and use its reference.
|
||||||
|
@ -105,7 +105,12 @@ struct j {
|
|||||||
};
|
};
|
||||||
extern template class j<int>;
|
extern template class j<int>;
|
||||||
j<int> jj;
|
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<int, int>"
|
||||||
|
// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j_wrap<j<int, int> >"
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct k {
|
struct k {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user