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:
Rafael Espindola
2014-11-10 18:11:10 +00:00
parent 2d268749a5
commit d342c4c748
11 changed files with 274 additions and 352 deletions

View File

@ -27,23 +27,17 @@ typedef MCDisassembler::DecodeStatus DecodeStatus;
namespace {
/// SparcDisassembler - a disassembler class for Sparc.
/// A disassembler class for Sparc.
class SparcDisassembler : public MCDisassembler {
public:
/// Constructor - Initializes the disassembler.
///
SparcDisassembler(const MCSubtargetInfo &STI, MCContext &Ctx) :
MCDisassembler(STI, Ctx)
{}
SparcDisassembler(const MCSubtargetInfo &STI, MCContext &Ctx)
: MCDisassembler(STI, Ctx) {}
virtual ~SparcDisassembler() {}
/// getInstruction - See MCDisassembler.
DecodeStatus getInstruction(MCInst &instr,
uint64_t &size,
const MemoryObject &region,
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;
};
}
@ -213,37 +207,30 @@ static DecodeStatus DecodeSWAP(MCInst &Inst, unsigned insn, uint64_t Address,
#include "SparcGenDisassemblerTables.inc"
/// readInstruction - read four bytes from the MemoryObject
/// and return 32 bit word.
static DecodeStatus readInstruction32(const MemoryObject &region,
uint64_t address,
uint64_t &size,
uint32_t &insn) {
/// Read four bytes from the MemoryObject and return 32 bit word.
static DecodeStatus 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 MCDisassembler::Fail;
}
// Encoded as a big-endian 32-bit word in the stream.
insn = (Bytes[3] << 0) |
(Bytes[2] << 8) |
(Bytes[1] << 16) |
(Bytes[0] << 24);
Insn =
(Bytes[3] << 0) | (Bytes[2] << 8) | (Bytes[1] << 16) | (Bytes[0] << 24);
return MCDisassembler::Success;
}
DecodeStatus
SparcDisassembler::getInstruction(MCInst &instr,
uint64_t &Size,
const MemoryObject &Region,
uint64_t Address,
raw_ostream &vStream,
raw_ostream &cStream) const {
DecodeStatus SparcDisassembler::getInstruction(MCInst &Instr, uint64_t &Size,
const MemoryObject &Region,
uint64_t Address,
raw_ostream &VStream,
raw_ostream &CStream) const {
uint32_t Insn;
DecodeStatus Result = readInstruction32(Region, Address, Size, Insn);
@ -252,8 +239,8 @@ SparcDisassembler::getInstruction(MCInst &instr,
// Calling the auto-generated decoder function.
Result = decodeInstruction(DecoderTableSparc32, instr, Insn, Address,
this, STI);
Result =
decodeInstruction(DecoderTableSparc32, Instr, Insn, Address, this, STI);
if (Result != MCDisassembler::Fail) {
Size = 4;