From 4e544870c4c3f81b150e4c3b38a18d629d706b74 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 12 May 2010 22:51:38 +0000 Subject: [PATCH] MC: Eliminate MCZeroFillFragment, it is no longer needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103664 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCAssembler.h | 28 +--------------------------- lib/MC/MCAssembler.cpp | 24 +----------------------- lib/MC/MCMachOStreamer.cpp | 2 +- 3 files changed, 3 insertions(+), 51 deletions(-) diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h index 22b8ff4671a..bfec73f5eb6 100644 --- a/include/llvm/MC/MCAssembler.h +++ b/include/llvm/MC/MCAssembler.h @@ -69,8 +69,7 @@ public: FT_Data, FT_Fill, FT_Inst, - FT_Org, - FT_ZeroFill + FT_Org }; private: @@ -357,31 +356,6 @@ public: virtual void dump(); }; -/// MCZeroFillFragment - Represent data which has a fixed size and alignment, -/// but requires no physical space in the object file. -class MCZeroFillFragment : public MCFragment { - /// Size - The size of this fragment. - uint64_t Size; - -public: - MCZeroFillFragment(uint64_t _Size, MCSectionData *SD = 0) - : MCFragment(FT_ZeroFill, SD), Size(_Size) {} - - /// @name Accessors - /// @{ - - uint64_t getSize() const { return Size; } - - /// @} - - static bool classof(const MCFragment *F) { - return F->getKind() == MCFragment::FT_ZeroFill; - } - static bool classof(const MCZeroFillFragment *) { return true; } - - virtual void dump(); -}; - // FIXME: Should this be a separate class, or just merged into MCSection? Since // we anticipate the fast path being through an MCAssembler, the only reason to // keep it out is for API abstraction. diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp index b8b60af8fb7..d5ff94996fb 100644 --- a/lib/MC/MCAssembler.cpp +++ b/lib/MC/MCAssembler.cpp @@ -394,8 +394,7 @@ void MCAssembler::LayoutFragment(MCAsmLayout &Layout, MCFragment &F) { break; case MCFragment::FT_Fill: { - MCFillFragment &FF = cast(F); - EffectiveSize = FF.getSize(); + EffectiveSize = cast(F).getSize(); break; } @@ -419,11 +418,6 @@ void MCAssembler::LayoutFragment(MCAsmLayout &Layout, MCFragment &F) { EffectiveSize = Offset; break; } - - case MCFragment::FT_ZeroFill: { - EffectiveSize = cast(F).getSize(); - break; - } } Layout.setFragmentEffectiveSize(&F, EffectiveSize); @@ -562,11 +556,6 @@ static void WriteFragmentData(const MCAssembler &Asm, const MCAsmLayout &Layout, break; } - - case MCFragment::FT_ZeroFill: { - assert(0 && "Invalid zero fill fragment in concrete section!"); - break; - } } assert(OW->getStream().tell() - Start == FragmentSize); @@ -596,8 +585,6 @@ void MCAssembler::WriteSectionData(const MCSectionData *SD, assert(!cast(it)->getValueSize() && "Invalid fill in virtual section!"); break; - case MCFragment::FT_ZeroFill: - break; } } @@ -922,15 +909,6 @@ void MCOrgFragment::dump() { OS << " Offset:" << getOffset() << " Value:" << getValue() << ">"; } -void MCZeroFillFragment::dump() { - raw_ostream &OS = llvm::errs(); - - OS << "MCFragment::dump(); - OS << "\n "; - OS << " Size:" << getSize() << ">"; -} - void MCSectionData::dump() { raw_ostream &OS = llvm::errs(); diff --git a/lib/MC/MCMachOStreamer.cpp b/lib/MC/MCMachOStreamer.cpp index eb49a40707d..fe701a7c280 100644 --- a/lib/MC/MCMachOStreamer.cpp +++ b/lib/MC/MCMachOStreamer.cpp @@ -326,7 +326,7 @@ void MCMachOStreamer::EmitZerofill(const MCSection *Section, MCSymbol *Symbol, new MCAlignFragment(ByteAlignment, 0, 0, ByteAlignment, /*EmitNops=*/false, &SectData); - MCFragment *F = new MCZeroFillFragment(Size, &SectData); + MCFragment *F = new MCFillFragment(0, 0, Size, &SectData); SD.setFragment(F); if (Assembler.isSymbolLinkerVisible(&SD)) F->setAtom(&SD); -- 2.34.1