summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2012-08-23 22:52:55 +0000
committerEric Christopher <echristo@apple.com>2012-08-23 22:52:55 +0000
commitacb7115bdea96ac79583aeb3684aa1c06dc627dd (patch)
tree31b2c445ae8f00907621255ee7f1807efdad25a0 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
parentf062343889eff82bb66f7b68165891cb1d91e8e5 (diff)
downloadbcm5719-llvm-acb7115bdea96ac79583aeb3684aa1c06dc627dd.tar.gz
bcm5719-llvm-acb7115bdea96ac79583aeb3684aa1c06dc627dd.zip
Remove the DW_AT_MIPS_linkage name attribute when we don't need it
output (we're emitting a specification already and the information isn't changing) and we're not in old gdb compat mode. Saves 1% on the debug information for a build of llvm. Fixes rdar://11043421 llvm-svn: 162493
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index d30e5bbd8e5..7a3eb329007 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -1028,8 +1028,10 @@ DIE *CompileUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
// AT_specification code in order to work around a bug in older
// gdbs that requires the linkage name to resolve multiple template
// functions.
+ // TODO: Remove this set of code when we get rid of the old gdb
+ // compatibility.
StringRef LinkageName = SP.getLinkageName();
- if (!LinkageName.empty())
+ if (!LinkageName.empty() && DD->useDarwinGDBCompat())
addString(SPDie, dwarf::DW_AT_MIPS_linkage_name,
getRealLinkageName(LinkageName));
@@ -1043,6 +1045,11 @@ DIE *CompileUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
return SPDie;
}
+ // Add the linkage name if we have one.
+ if (!LinkageName.empty() && !DD->useDarwinGDBCompat())
+ 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());
OpenPOWER on IntegriCloud