summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit522219583145da5695836c7832430405aba9cb38 (patch)
tree8d99b5c708e8ed30c6980fa4f497c8c43fca9175 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
parent31a9bbcd4a183b3062943570fd38be11dd601d41 (diff)
downloadbcm5719-llvm-522219583145da5695836c7832430405aba9cb38.tar.gz
bcm5719-llvm-522219583145da5695836c7832430405aba9cb38.zip
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 llvm-svn: 176120
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 93b00fb5229..c023afdf33c 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/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())) {
OpenPOWER on IntegriCloud