From 6f95023a7f27075011a6eb7b84e03732b00a785b Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sun, 28 Nov 2010 23:08:47 +0000 Subject: Move EmitValue to MCObjectStreamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120269 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/WinCOFFStreamer.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'lib/MC/WinCOFFStreamer.cpp') diff --git a/lib/MC/WinCOFFStreamer.cpp b/lib/MC/WinCOFFStreamer.cpp index b85fe91db7..a13b632db6 100644 --- a/lib/MC/WinCOFFStreamer.cpp +++ b/lib/MC/WinCOFFStreamer.cpp @@ -68,8 +68,6 @@ public: virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment); virtual void EmitBytes(StringRef Data, unsigned AddrSpace); - virtual void EmitValue(const MCExpr *Value, unsigned Size, - unsigned AddrSpace); virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value, unsigned ValueSize, unsigned MaxBytesToEmit); virtual void EmitCodeAlignment(unsigned ByteAlignment, @@ -328,28 +326,6 @@ void WinCOFFStreamer::EmitBytes(StringRef Data, unsigned AddrSpace) { getOrCreateDataFragment()->getContents().append(Data.begin(), Data.end()); } -void WinCOFFStreamer::EmitValue(const MCExpr *Value, unsigned Size, - unsigned AddrSpace) { - assert(AddrSpace == 0 && "Address space must be 0!"); - - // TODO: This is copied exactly from the MachOStreamer. Consider merging into - // MCObjectStreamer? - MCDataFragment *DF = getOrCreateDataFragment(); - - // Avoid fixups when possible. - int64_t AbsValue; - if (AddValueSymbols(Value)->EvaluateAsAbsolute(AbsValue)) { - // FIXME: Endianness assumption. - for (unsigned i = 0; i != Size; ++i) - DF->getContents().push_back(uint8_t(AbsValue >> (i * 8))); - } else { - DF->addFixup(MCFixup::Create(DF->getContents().size(), - AddValueSymbols(Value), - MCFixup::getKindForSize(Size, false))); - DF->getContents().resize(DF->getContents().size() + Size, 0); - } -} - void WinCOFFStreamer::EmitValueToAlignment(unsigned ByteAlignment, int64_t Value, unsigned ValueSize, -- cgit v1.2.3-18-g5258