mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 23:24:34 +00:00
Hoist some grossly duplicated code from the COFF/ELF/MachO streamers into MCObjectStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165225 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -232,6 +232,31 @@ void MCObjectStreamer::EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
|
||||
new MCDwarfCallFrameFragment(*AddrDelta, getCurrentSectionData());
|
||||
}
|
||||
|
||||
void MCObjectStreamer::EmitBytes(StringRef Data, unsigned AddrSpace) {
|
||||
assert(AddrSpace == 0 && "Address space must be 0!");
|
||||
getOrCreateDataFragment()->getContents().append(Data.begin(), Data.end());
|
||||
}
|
||||
|
||||
void MCObjectStreamer::EmitValueToAlignment(unsigned ByteAlignment,
|
||||
int64_t Value,
|
||||
unsigned ValueSize,
|
||||
unsigned MaxBytesToEmit) {
|
||||
if (MaxBytesToEmit == 0)
|
||||
MaxBytesToEmit = ByteAlignment;
|
||||
new MCAlignFragment(ByteAlignment, Value, ValueSize, MaxBytesToEmit,
|
||||
getCurrentSectionData());
|
||||
|
||||
// Update the maximum alignment on the current section if necessary.
|
||||
if (ByteAlignment > getCurrentSectionData()->getAlignment())
|
||||
getCurrentSectionData()->setAlignment(ByteAlignment);
|
||||
}
|
||||
|
||||
void MCObjectStreamer::EmitCodeAlignment(unsigned ByteAlignment,
|
||||
unsigned MaxBytesToEmit) {
|
||||
EmitValueToAlignment(ByteAlignment, 0, 1, MaxBytesToEmit);
|
||||
cast<MCAlignFragment>(getCurrentFragment())->setEmitNops(true);
|
||||
}
|
||||
|
||||
bool MCObjectStreamer::EmitValueToOffset(const MCExpr *Offset,
|
||||
unsigned char Value) {
|
||||
int64_t Res;
|
||||
|
Reference in New Issue
Block a user