mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 03:24:09 +00:00
Forgot the MCPureStreamer::EmitValue in the previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120270 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -42,7 +42,6 @@ public:
|
|||||||
virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
|
virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
|
||||||
unsigned Size = 0, unsigned ByteAlignment = 0);
|
unsigned Size = 0, unsigned ByteAlignment = 0);
|
||||||
virtual void EmitBytes(StringRef Data, unsigned AddrSpace);
|
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 = 0,
|
virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
|
||||||
unsigned ValueSize = 1,
|
unsigned ValueSize = 1,
|
||||||
unsigned MaxBytesToEmit = 0);
|
unsigned MaxBytesToEmit = 0);
|
||||||
@ -155,26 +154,6 @@ void MCPureStreamer::EmitBytes(StringRef Data, unsigned AddrSpace) {
|
|||||||
getOrCreateDataFragment()->getContents().append(Data.begin(), Data.end());
|
getOrCreateDataFragment()->getContents().append(Data.begin(), Data.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCPureStreamer::EmitValue(const MCExpr *Value, unsigned Size,
|
|
||||||
unsigned AddrSpace) {
|
|
||||||
// TODO: This is exactly the same as WinCOFFStreamer. 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 MCPureStreamer::EmitValueToAlignment(unsigned ByteAlignment,
|
void MCPureStreamer::EmitValueToAlignment(unsigned ByteAlignment,
|
||||||
int64_t Value, unsigned ValueSize,
|
int64_t Value, unsigned ValueSize,
|
||||||
unsigned MaxBytesToEmit) {
|
unsigned MaxBytesToEmit) {
|
||||||
|
Reference in New Issue
Block a user