Author: Chen Zheng Date: 2021-04-22T21:30:22-04:00 New Revision: 681d9ecd727bf5835098a4e5d5a49f823670a6b5
URL: https://github.com/llvm/llvm-project/commit/681d9ecd727bf5835098a4e5d5a49f823670a6b5 DIFF: https://github.com/llvm/llvm-project/commit/681d9ecd727bf5835098a4e5d5a49f823670a6b5.diff LOG: [Debug-Info] change return type to void for attribute adding functions. Added: Modified: llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h Removed: ################################################################################ diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 7a28bcb08ba42..40d290ebe47fa 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -286,11 +286,9 @@ void DwarfUnit::addString(DIE &Die, dwarf::Attribute Attribute, DIEString(StringPoolEntry)); } -DIEValueList::value_iterator DwarfUnit::addLabel(DIEValueList &Die, - dwarf::Attribute Attribute, - dwarf::Form Form, - const MCSymbol *Label) { - return Die.addValue(DIEValueAllocator, Attribute, Form, DIELabel(Label)); +void DwarfUnit::addLabel(DIEValueList &Die, dwarf::Attribute Attribute, + dwarf::Form Form, const MCSymbol *Label) { + Die.addValue(DIEValueAllocator, Attribute, Form, DIELabel(Label)); } void DwarfUnit::addLabel(DIELoc &Die, dwarf::Form Form, const MCSymbol *Label) { @@ -1746,20 +1744,18 @@ void DwarfTypeUnit::emitHeader(bool UseOffsets) { Asm->emitDwarfLengthOrOffset(Ty ? Ty->getOffset() : 0); } -DIE::value_iterator -DwarfUnit::addSectionDelta(DIE &Die, dwarf::Attribute Attribute, - const MCSymbol *Hi, const MCSymbol *Lo) { - return Die.addValue(DIEValueAllocator, Attribute, - DD->getDwarfSectionOffsetForm(), - new (DIEValueAllocator) DIEDelta(Hi, Lo)); +void DwarfUnit::addSectionDelta(DIE &Die, dwarf::Attribute Attribute, + const MCSymbol *Hi, const MCSymbol *Lo) { + Die.addValue(DIEValueAllocator, Attribute, DD->getDwarfSectionOffsetForm(), + new (DIEValueAllocator) DIEDelta(Hi, Lo)); } -DIE::value_iterator -DwarfUnit::addSectionLabel(DIE &Die, dwarf::Attribute Attribute, - const MCSymbol *Label, const MCSymbol *Sec) { +void DwarfUnit::addSectionLabel(DIE &Die, dwarf::Attribute Attribute, + const MCSymbol *Label, const MCSymbol *Sec) { if (Asm->MAI->doesDwarfUseRelocationsAcrossSections()) - return addLabel(Die, Attribute, DD->getDwarfSectionOffsetForm(), Label); - return addSectionDelta(Die, Attribute, Label, Sec); + addLabel(Die, Attribute, DD->getDwarfSectionOffsetForm(), Label); + else + addSectionDelta(Die, Attribute, Label, Sec); } bool DwarfTypeUnit::isDwoUnit() const { diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h index a1d6008251796..10fd725cb8ae7 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h @@ -147,10 +147,8 @@ class DwarfUnit : public DIEUnit { void addString(DIE &Die, dwarf::Attribute Attribute, StringRef Str); /// Add a Dwarf label attribute data and value. - DIEValueList::value_iterator addLabel(DIEValueList &Die, - dwarf::Attribute Attribute, - dwarf::Form Form, - const MCSymbol *Label); + void addLabel(DIEValueList &Die, dwarf::Attribute Attribute, dwarf::Form Form, + const MCSymbol *Label); void addLabel(DIELoc &Die, dwarf::Form Form, const MCSymbol *Label); @@ -272,13 +270,12 @@ class DwarfUnit : public DIEUnit { void constructTypeDIE(DIE &Buffer, const DICompositeType *CTy); /// addSectionDelta - Add a label delta attribute data and value. - DIE::value_iterator addSectionDelta(DIE &Die, dwarf::Attribute Attribute, - const MCSymbol *Hi, const MCSymbol *Lo); + void addSectionDelta(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, + const MCSymbol *Lo); /// Add a Dwarf section label attribute data and value. - DIE::value_iterator addSectionLabel(DIE &Die, dwarf::Attribute Attribute, - const MCSymbol *Label, - const MCSymbol *Sec); + void addSectionLabel(DIE &Die, dwarf::Attribute Attribute, + const MCSymbol *Label, const MCSymbol *Sec); /// Get context owner's DIE. DIE *createTypeDIE(const DICompositeType *Ty); _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits