diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp | 1 |
3 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 32b6657c2fd..a4d699496b4 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -249,7 +249,8 @@ DIE *DwarfCompileUnit::getOrCreateGlobalVariableDIE( // If the linkage name is different than the name, go ahead and output // that as well into the name table. - if (GV->getLinkageName() != "" && GV->getName() != GV->getLinkageName()) + if (GV->getLinkageName() != "" && GV->getName() != GV->getLinkageName() && + DD->useAllLinkageNames()) DD->addAccelName(GV->getLinkageName(), *VariableDIE); } diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 19aeb60630c..7dd76b38608 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -393,9 +393,11 @@ void DwarfDebug::addSubprogramNames(const DISubprogram *SP, DIE &Die) { if (SP->getName() != "") addAccelName(SP->getName(), Die); - // If the linkage name is different than the name, go ahead and output - // that as well into the name table. - if (SP->getLinkageName() != "" && SP->getName() != SP->getLinkageName()) + // If the linkage name is different than the name, go ahead and output that as + // well into the name table. Only do that if we are going to actually emit + // that name. + if (SP->getLinkageName() != "" && SP->getName() != SP->getLinkageName() && + (useAllLinkageNames() || InfoHolder.getAbstractSPDies().lookup(SP))) addAccelName(SP->getLinkageName(), Die); // If this is an Objective-C selector name add it to the ObjC accelerator diff --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp index ba7aef37eac..b3b8d7d9146 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp @@ -1122,6 +1122,7 @@ DWARFVerifier::verifyNameIndexEntries(const DWARFDebugNames::NameIndex &NI, "of DIE @ {2:x}: index - {3}; debug_info - {4}.\n", NI.getUnitOffset(), EntryID, DIEOffset, Str, make_range(EntryNames.begin(), EntryNames.end())); + ++NumErrors; } } handleAllErrors(EntryOr.takeError(), |