mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231880 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user