mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-30 04:18:16 +00:00
Replace custom fixed endian to raw_ostream emission with EndianStream.
Less code, clearer and more efficient. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239040 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -86,16 +86,10 @@ void SparcMCCodeEmitter::encodeInstruction(const MCInst &MI, raw_ostream &OS,
|
||||
|
||||
if (Ctx.getAsmInfo()->isLittleEndian()) {
|
||||
// Output the bits in little-endian byte order.
|
||||
for (unsigned i = 0; i != 4; ++i) {
|
||||
OS << (char)Bits;
|
||||
Bits >>= 8;
|
||||
}
|
||||
support::endian::Writer<support::little>(OS).write<uint32_t>(Bits);
|
||||
} else {
|
||||
// Output the bits in big-endian byte order.
|
||||
for (unsigned i = 0; i != 4; ++i) {
|
||||
OS << (char)(Bits >> 24);
|
||||
Bits <<= 8;
|
||||
}
|
||||
support::endian::Writer<support::big>(OS).write<uint32_t>(Bits);
|
||||
}
|
||||
unsigned tlsOpNo = 0;
|
||||
switch (MI.getOpcode()) {
|
||||
|
||||
Reference in New Issue
Block a user