diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -163,11 +163,6 @@ void addLabelAddress(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label); - /// addLocalLabelAddress - Add a dwarf label attribute data and value using - /// DW_FORM_addr only. - void addLocalLabelAddress(DIE &Die, dwarf::Attribute Attribute, - const MCSymbol *Label); - DwarfCompileUnit &getCU() override { return *this; } unsigned getOrCreateSourceID(const DIFile *File) override; diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -71,8 +71,14 @@ DD->addArangeLabel(SymbolCU(this, Label)); // Don't use the address pool in non-fission or in the skeleton unit itself. - if ((!DD->useSplitDwarf() || !Skeleton) && DD->getDwarfVersion() < 5) - return addLocalLabelAddress(Die, Attribute, Label); + if ((!DD->useSplitDwarf() || !Skeleton) && DD->getDwarfVersion() < 5) { + if (Label) + addAttribute(Die, Attribute, dwarf::DW_FORM_addr, DIELabel(Label)); + else + addAttribute(Die, Attribute, dwarf::DW_FORM_addr, DIEInteger(0)); + + return; + } bool UseAddrOffsetFormOrExpressions = DD->useAddrOffsetForm() || DD->useAddrOffsetExpressions(); @@ -105,15 +111,6 @@ DD->getAddressPool().getIndex(Base), Label, Base)); } -void DwarfCompileUnit::addLocalLabelAddress(DIE &Die, - dwarf::Attribute Attribute, - const MCSymbol *Label) { - if (Label) - addAttribute(Die, Attribute, dwarf::DW_FORM_addr, DIELabel(Label)); - else - addAttribute(Die, Attribute, dwarf::DW_FORM_addr, DIEInteger(0)); -} - unsigned DwarfCompileUnit::getOrCreateSourceID(const DIFile *File) { // If we print assembly, we can't separate .file entries according to // compile units. Thus all files will belong to the default compile unit.