mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
Misc style fixes. NFC.
This fixes a few cases of: * Wrong variable name style. * Lines longer than 80 columns. * Repeated names in comments. * clang-format of the above. This make the next patch a lot easier to read. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221615 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -36,44 +36,39 @@ public:
|
||||
XCoreDisassembler(const MCSubtargetInfo &STI, MCContext &Ctx) :
|
||||
MCDisassembler(STI, Ctx) {}
|
||||
|
||||
/// \brief See MCDisassembler.
|
||||
DecodeStatus getInstruction(MCInst &instr, uint64_t &size,
|
||||
const MemoryObject ®ion, uint64_t address,
|
||||
raw_ostream &vStream,
|
||||
raw_ostream &cStream) const override;
|
||||
DecodeStatus getInstruction(MCInst &Instr, uint64_t &Size,
|
||||
const MemoryObject &Region, uint64_t Address,
|
||||
raw_ostream &VStream,
|
||||
raw_ostream &CStream) const override;
|
||||
};
|
||||
}
|
||||
|
||||
static bool readInstruction16(const MemoryObject ®ion,
|
||||
uint64_t address,
|
||||
uint64_t &size,
|
||||
uint16_t &insn) {
|
||||
static bool readInstruction16(const MemoryObject &Region, uint64_t Address,
|
||||
uint64_t &Size, uint16_t &Insn) {
|
||||
uint8_t Bytes[4];
|
||||
|
||||
// We want to read exactly 2 Bytes of data.
|
||||
if (region.readBytes(address, 2, Bytes) == -1) {
|
||||
size = 0;
|
||||
if (Region.readBytes(Address, 2, Bytes) == -1) {
|
||||
Size = 0;
|
||||
return false;
|
||||
}
|
||||
// Encoded as a little-endian 16-bit word in the stream.
|
||||
insn = (Bytes[0] << 0) | (Bytes[1] << 8);
|
||||
Insn = (Bytes[0] << 0) | (Bytes[1] << 8);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool readInstruction32(const MemoryObject ®ion,
|
||||
uint64_t address,
|
||||
uint64_t &size,
|
||||
uint32_t &insn) {
|
||||
static bool readInstruction32(const MemoryObject &Region, uint64_t Address,
|
||||
uint64_t &Size, uint32_t &Insn) {
|
||||
uint8_t Bytes[4];
|
||||
|
||||
// We want to read exactly 4 Bytes of data.
|
||||
if (region.readBytes(address, 4, Bytes) == -1) {
|
||||
size = 0;
|
||||
if (Region.readBytes(Address, 4, Bytes) == -1) {
|
||||
Size = 0;
|
||||
return false;
|
||||
}
|
||||
// Encoded as a little-endian 32-bit word in the stream.
|
||||
insn = (Bytes[0] << 0) | (Bytes[1] << 8) | (Bytes[2] << 16) |
|
||||
(Bytes[3] << 24);
|
||||
Insn =
|
||||
(Bytes[0] << 0) | (Bytes[1] << 8) | (Bytes[2] << 16) | (Bytes[3] << 24);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -745,13 +740,9 @@ DecodeL4RSrcDstSrcDstInstruction(MCInst &Inst, unsigned Insn, uint64_t Address,
|
||||
return S;
|
||||
}
|
||||
|
||||
MCDisassembler::DecodeStatus
|
||||
XCoreDisassembler::getInstruction(MCInst &instr,
|
||||
uint64_t &Size,
|
||||
const MemoryObject &Region,
|
||||
uint64_t Address,
|
||||
raw_ostream &vStream,
|
||||
raw_ostream &cStream) const {
|
||||
MCDisassembler::DecodeStatus XCoreDisassembler::getInstruction(
|
||||
MCInst &instr, uint64_t &Size, const MemoryObject &Region, uint64_t Address,
|
||||
raw_ostream &vStream, raw_ostream &cStream) const {
|
||||
uint16_t insn16;
|
||||
|
||||
if (!readInstruction16(Region, Address, Size, insn16)) {
|
||||
|
||||
Reference in New Issue
Block a user