aboutsummaryrefslogtreecommitdiffstats
path: root/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
commitcbbd5b1d86e0d06c804f4cdd61e0676b2d2f5c85 (patch)
tree5be67dacf95f7a160172e806d09a08a13299ab52 /lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
parent20f47ab7688ba1e5e4c6af4be47c2f07ee4e9ab6 (diff)
downloadexternal_llvm-cbbd5b1d86e0d06c804f4cdd61e0676b2d2f5c85.tar.gz
external_llvm-cbbd5b1d86e0d06c804f4cdd61e0676b2d2f5c85.tar.bz2
external_llvm-cbbd5b1d86e0d06c804f4cdd61e0676b2d2f5c85.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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162493 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index d30e5bbd8e..7a3eb32900 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/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());