From 8d101c31d293bcb8ece8fecdb3325cd0728bed08 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 15 Mar 2012 08:19:33 +0000 Subject: Revert the removal of DW_AT_MIPS_linkage_name when we aren't putting out the DW_AT_name. Older gdbs unfortunately still use it to disambiguate member functions in templated classes (gdb.cp/templates.exp). rdar://11043421 (which is now deferred for a bit) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152782 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/CodeGen') diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 63194948f4..389ae46b64 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -1007,6 +1007,14 @@ DIE *CompileUnit::getOrCreateSubprogramDIE(DISubprogram SP) { // Add function template parameters. addTemplateParams(*SPDie, SP.getTemplateParams()); + // Unfortunately this code needs to stay here to work around + // a bug in older gdbs that requires the linkage name to resolve + // multiple template functions. + StringRef LinkageName = SP.getLinkageName(); + if (!LinkageName.empty()) + addString(SPDie, dwarf::DW_AT_MIPS_linkage_name, + getRealLinkageName(LinkageName)); + // If this DIE is going to refer declaration info using AT_specification // then there is no need to add other attributes. if (DeclDie) { @@ -1017,11 +1025,6 @@ DIE *CompileUnit::getOrCreateSubprogramDIE(DISubprogram SP) { return SPDie; } - StringRef LinkageName = SP.getLinkageName(); - if (!LinkageName.empty()) - addString(SPDie, dwarf::DW_AT_MIPS_linkage_name, - getRealLinkageName(LinkageName)); - // Constructors and operators for anonymous aggregates do not have names. if (!SP.getName().empty()) addString(SPDie, dwarf::DW_AT_name, SP.getName()); -- cgit v1.2.3-70-g09d2