aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
diff options
context:
space:
mode:
authorManman Ren <mren@apple.com>2013-02-26 20:48:29 +0000
committerManman Ren <mren@apple.com>2013-02-26 20:48:29 +0000
commit6fe26103d71263124e3cc56c0a349cb1391208a1 (patch)
tree37a9e048aa3248bb94802773a8a777b3280f1f89 /lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
parent0908bcbf4483d1245f2156624268cf0922e874c9 (diff)
Debug Info: for static member variables, move AT_MIPS_linkage_name from
TAG_member inside a class to the specification DIE. Having AT_MIPS_linkage_name on TAG_member caused old gdb (GNU 6.3.50) to error out. Also gcc 4.7 has AT_MIPS_linkage_name on the specification DIE. rdar://problem/13291234 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176120 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 93b00fb522..c023afdf33 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -1349,7 +1349,10 @@ void CompileUnit::createGlobalVariableDIE(const MDNode *N) {
// Add linkage name.
StringRef LinkageName = GV.getLinkageName();
if (!LinkageName.empty() && isGlobalVariable)
- addString(VariableDIE, dwarf::DW_AT_MIPS_linkage_name,
+ // For static member variables, AT_MIPS_linkage_name should be on
+ // specification DIE to make old gdb work.
+ addString(IsStaticMember && VariableSpecDIE ?
+ VariableSpecDIE : VariableDIE, dwarf::DW_AT_MIPS_linkage_name,
getRealLinkageName(LinkageName));
} else if (const ConstantInt *CI =
dyn_cast_or_null<ConstantInt>(GV.getConstant())) {