summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
diff options
context:
space:
mode:
authorPaul Robinson <paul_robinson@playstation.sony.com>2015-03-10 22:44:45 +0000
committerPaul Robinson <paul_robinson@playstation.sony.com>2015-03-10 22:44:45 +0000
commit857b4434df18a6ebcf26eebbb5daaace54b237a2 (patch)
tree0687c51d5a81efc75858179bf9489308198427dd /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
parent1c292271448644886527879ce69354503b3233d7 (diff)
downloadbcm5719-llvm-857b4434df18a6ebcf26eebbb5daaace54b237a2.tar.gz
bcm5719-llvm-857b4434df18a6ebcf26eebbb5daaace54b237a2.zip
Emit correct linkage-name attribute based on DWARF version.
There are still 4 tests that check for DW_AT_MIPS_linkage_name, because they specify DWARF 2 or 3 in the module metadata. So, I didn't create an explicit version-based test for the attribute. Differential Revision: http://reviews.llvm.org/D8227 llvm-svn: 231880
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 85a6f117caa..029804c158a 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -174,16 +174,7 @@ DIE *DwarfCompileUnit::getOrCreateGlobalVariableDIE(DIGlobalVariable GV) {
}
addBlock(*VariableDIE, dwarf::DW_AT_location, Loc);
- // Add the linkage name.
- StringRef LinkageName = GV.getLinkageName();
- if (!LinkageName.empty())
- // From DWARF4: DIEs to which DW_AT_linkage_name may apply include:
- // TAG_common_block, TAG_constant, TAG_entry_point, TAG_subprogram and
- // TAG_variable.
- addString(*VariableDIE,
- DD->getDwarfVersion() >= 4 ? dwarf::DW_AT_linkage_name
- : dwarf::DW_AT_MIPS_linkage_name,
- GlobalValue::getRealLinkageName(LinkageName));
+ addLinkageName(*VariableDIE, GV.getLinkageName());
} else if (const ConstantInt *CI =
dyn_cast_or_null<ConstantInt>(GV.getConstant())) {
addConstantValue(*VariableDIE, CI, GTy);
OpenPOWER on IntegriCloud