From a287fe7fa0723933eb754475f8c23bc7a0b3ba35 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 27 May 2015 13:30:50 +0000 Subject: [PATCH] Remove uses of MCSectionData from ELFObjectWriter. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238317 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/ELFObjectWriter.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index 18070864317..b51ba758f4b 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -231,7 +231,7 @@ class ELFObjectWriter : public MCObjectWriter { const SectionIndexMapTy &SectionIndexMap, const SectionOffsetsTy &SectionOffsets); - void writeSectionData(const MCAssembler &Asm, const MCSectionData &SD, + void writeSectionData(const MCAssembler &Asm, MCSection &Sec, const MCAsmLayout &Layout); void WriteSecHdrEntry(uint32_t Name, uint32_t Type, uint64_t Flags, @@ -1139,10 +1139,9 @@ prependCompressionHeader(uint64_t Size, return true; } -void ELFObjectWriter::writeSectionData(const MCAssembler &Asm, - const MCSectionData &SD, +void ELFObjectWriter::writeSectionData(const MCAssembler &Asm, MCSection &Sec, const MCAsmLayout &Layout) { - MCSectionELF &Section = static_cast(SD.getSection()); + MCSectionELF &Section = static_cast(Sec); StringRef SectionName = Section.getSectionName(); // Compressing debug_frame requires handling alignment fragments which is @@ -1155,7 +1154,7 @@ void ELFObjectWriter::writeSectionData(const MCAssembler &Asm, } // Gather the uncompressed data from all the fragments. - const MCSectionData::FragmentListType &Fragments = SD.getFragmentList(); + const MCSectionData::FragmentListType &Fragments = Section.getFragmentList(); SmallVector UncompressedData = getUncompressedData(Layout, Fragments); @@ -1343,9 +1342,8 @@ void ELFObjectWriter::WriteObject(MCAssembler &Asm, SectionOffsetsTy SectionOffsets; std::vector Groups; std::vector Relocations; - for (const MCSection &Sec : Asm) { - const MCSectionELF &Section = static_cast(Sec); - const MCSectionData &SD = Section.getSectionData(); + for (MCSection &Sec : Asm) { + MCSectionELF &Section = static_cast(Sec); uint64_t Padding = OffsetToAlignment(OS.tell(), Section.getAlignment()); WriteZeros(Padding); @@ -1354,7 +1352,7 @@ void ELFObjectWriter::WriteObject(MCAssembler &Asm, uint64_t SecStart = OS.tell(); const MCSymbol *SignatureSymbol = Section.getGroup(); - writeSectionData(Asm, SD, Layout); + writeSectionData(Asm, Section, Layout); uint64_t SecEnd = OS.tell(); SectionOffsets[&Section] = std::make_pair(SecStart, SecEnd); -- 2.34.1