DebugInfo: Include inline namespaces in template specialization parameter names

This ensures these types have distinct names if they are distinct types
(eg: if one is an instantiation with a type in one inline namespace, and
another from a type with the same simple name, but in a different inline
namespace).
This commit is contained in:
David Blaikie 2021-04-08 17:36:41 -07:00
parent 8294019633
commit eb8a28e2cf
2 changed files with 9 additions and 0 deletions

View File

@ -305,6 +305,7 @@ StringRef CGDebugInfo::getClassName(const RecordDecl *RD) {
llvm::raw_svector_ostream OS(Name);
PrintingPolicy PP = getPrintingPolicy();
PP.PrintCanonicalTypes = true;
PP.SuppressInlineNamespace = false;
RD->getNameForDiagnostic(OS, PP,
/*Qualified*/ false);

View File

@ -179,3 +179,11 @@ ClassTemplateArgRefTemplate<ClassTemplateArgObj.Arg> ClassTemplateArgRefObj;
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ClassTemplateArgRefTemplate<<template param ClassTemplateArg{1, 2.000000e+00}> >", {{.*}}, templateParams: ![[CLASS_TEMP_REF_ARGS:[0-9]*]],
// CHECK: ![[CLASS_TEMP_REF_ARGS]] = !{![[CLASS_TEMP_REF_ARG:[0-9]*]]}
// CHECK: ![[CLASS_TEMP_REF_ARG]] = !DITemplateValueParameter(type: ![[CLASS_TEMP_ARG_CONST_REF_TYPE]], value: %{{.*}}* @_ZTAXtl16ClassTemplateArgLi1ELf40000000EEE)
inline namespace inl {
struct t1 { };
}
template<typename T> struct ClassTemplateInlineNamespaceArg {
};
ClassTemplateInlineNamespaceArg<inl::t1> ClassTemplateInlineNamespaceArgObj;
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ClassTemplateInlineNamespaceArg<inl::t1>",