mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
Use support::endian. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234359 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
#include "llvm/ADT/SmallVector.h"
|
#include "llvm/ADT/SmallVector.h"
|
||||||
#include "llvm/Support/Compiler.h"
|
#include "llvm/Support/Compiler.h"
|
||||||
#include "llvm/Support/DataTypes.h"
|
#include "llvm/Support/DataTypes.h"
|
||||||
|
#include "llvm/Support/EndianStream.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
@@ -120,33 +121,27 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WriteLE16(uint16_t Value) {
|
void WriteLE16(uint16_t Value) {
|
||||||
Write8(uint8_t(Value >> 0));
|
support::endian::Writer<support::little>(OS).write(Value);
|
||||||
Write8(uint8_t(Value >> 8));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteLE32(uint32_t Value) {
|
void WriteLE32(uint32_t Value) {
|
||||||
WriteLE16(uint16_t(Value >> 0));
|
support::endian::Writer<support::little>(OS).write(Value);
|
||||||
WriteLE16(uint16_t(Value >> 16));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteLE64(uint64_t Value) {
|
void WriteLE64(uint64_t Value) {
|
||||||
WriteLE32(uint32_t(Value >> 0));
|
support::endian::Writer<support::little>(OS).write(Value);
|
||||||
WriteLE32(uint32_t(Value >> 32));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteBE16(uint16_t Value) {
|
void WriteBE16(uint16_t Value) {
|
||||||
Write8(uint8_t(Value >> 8));
|
support::endian::Writer<support::big>(OS).write(Value);
|
||||||
Write8(uint8_t(Value >> 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteBE32(uint32_t Value) {
|
void WriteBE32(uint32_t Value) {
|
||||||
WriteBE16(uint16_t(Value >> 16));
|
support::endian::Writer<support::big>(OS).write(Value);
|
||||||
WriteBE16(uint16_t(Value >> 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteBE64(uint64_t Value) {
|
void WriteBE64(uint64_t Value) {
|
||||||
WriteBE32(uint32_t(Value >> 32));
|
support::endian::Writer<support::big>(OS).write(Value);
|
||||||
WriteBE32(uint32_t(Value >> 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write16(uint16_t Value) {
|
void Write16(uint16_t Value) {
|
||||||
|
Reference in New Issue
Block a user