summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
diff options
context:
space:
mode:
authorManman Ren <mren@apple.com>2013-02-27 00:02:32 +0000
committerManman Ren <mren@apple.com>2013-02-27 00:02:32 +0000
commit5ae44d2b759f7a7304d84f892e3eb3c2d0b87a50 (patch)
tree5cad54d18f1bf7e9e08f2551807b8e3bfcd52df5 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
parent08037045f85bb6875a15b6db9a80b3c3476278a4 (diff)
downloadbcm5719-llvm-5ae44d2b759f7a7304d84f892e3eb3c2d0b87a50.tar.gz
bcm5719-llvm-5ae44d2b759f7a7304d84f892e3eb3c2d0b87a50.zip
Debug Info: for static member variables, add AT_MIPS_linkage_name to the
definition DIE, to make old GDB happy. We have a regression for old GDB when Clang uses DW_TAG_member to declare static members inside a class, instead of DW_TAG_variable. This patch will fix this regression. rdar://problem/13291234 llvm-svn: 176143
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 93b00fb5229..59e433b70b1 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -1348,9 +1348,15 @@ void CompileUnit::createGlobalVariableDIE(const MDNode *N) {
}
// Add linkage name.
StringRef LinkageName = GV.getLinkageName();
- if (!LinkageName.empty() && isGlobalVariable)
+ if (!LinkageName.empty() && isGlobalVariable) {
addString(VariableDIE, dwarf::DW_AT_MIPS_linkage_name,
getRealLinkageName(LinkageName));
+ // To make old GDB happy, for static member variables, we add
+ // AT_MIPS_linkage_name to the definition DIE as well.
+ if (IsStaticMember && VariableSpecDIE)
+ addString(VariableSpecDIE, dwarf::DW_AT_MIPS_linkage_name,
+ getRealLinkageName(LinkageName));
+ }
} else if (const ConstantInt *CI =
dyn_cast_or_null<ConstantInt>(GV.getConstant())) {
// AT_const_value was added when the static memeber was created. To avoid
OpenPOWER on IntegriCloud