diff options
author | Manman Ren <mren@apple.com> | 2013-02-26 20:48:29 +0000 |
---|---|---|
committer | Manman Ren <mren@apple.com> | 2013-02-26 20:48:29 +0000 |
commit | 6fe26103d71263124e3cc56c0a349cb1391208a1 (patch) | |
tree | 37a9e048aa3248bb94802773a8a777b3280f1f89 /lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
parent | 0908bcbf4483d1245f2156624268cf0922e874c9 (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.cpp | 5 |
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())) { |