mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 23:32:27 +00:00
Tidy up function argument formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161032 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a31359a529
commit
e08789f5e2
@ -170,9 +170,7 @@ static inline const char* stringForOperandEncoding(OperandEncoding encoding) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisassemblerTables::emitOneID(raw_ostream &o,
|
void DisassemblerTables::emitOneID(raw_ostream &o, uint32_t &i, InstrUID id,
|
||||||
uint32_t &i,
|
|
||||||
InstrUID id,
|
|
||||||
bool addComma) const {
|
bool addComma) const {
|
||||||
if (id)
|
if (id)
|
||||||
o.indent(i * 2) << format("0x%hx", id);
|
o.indent(i * 2) << format("0x%hx", id);
|
||||||
@ -197,8 +195,7 @@ void DisassemblerTables::emitOneID(raw_ostream &o,
|
|||||||
///
|
///
|
||||||
/// @param o - The output stream on which to emit the table.
|
/// @param o - The output stream on which to emit the table.
|
||||||
/// @param i - The indentation level for that output stream.
|
/// @param i - The indentation level for that output stream.
|
||||||
static void emitEmptyTable(raw_ostream &o, uint32_t &i)
|
static void emitEmptyTable(raw_ostream &o, uint32_t &i) {
|
||||||
{
|
|
||||||
o.indent(i * 2) << "0x0, /* EmptyTable */\n";
|
o.indent(i * 2) << "0x0, /* EmptyTable */\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,8 +204,7 @@ static void emitEmptyTable(raw_ostream &o, uint32_t &i)
|
|||||||
///
|
///
|
||||||
/// @param decision - The decision to be compacted.
|
/// @param decision - The decision to be compacted.
|
||||||
/// @return - The compactest available representation for the decision.
|
/// @return - The compactest available representation for the decision.
|
||||||
static ModRMDecisionType getDecisionType(ModRMDecision &decision)
|
static ModRMDecisionType getDecisionType(ModRMDecision &decision) {
|
||||||
{
|
|
||||||
bool satisfiesOneEntry = true;
|
bool satisfiesOneEntry = true;
|
||||||
bool satisfiesSplitRM = true;
|
bool satisfiesSplitRM = true;
|
||||||
bool satisfiesSplitReg = true;
|
bool satisfiesSplitReg = true;
|
||||||
@ -254,8 +250,7 @@ static ModRMDecisionType getDecisionType(ModRMDecision &decision)
|
|||||||
/// @param dt - The decision type.
|
/// @param dt - The decision type.
|
||||||
/// @return - A pointer to the statically-allocated string (e.g.,
|
/// @return - A pointer to the statically-allocated string (e.g.,
|
||||||
/// "MODRM_ONEENTRY" for MODRM_ONEENTRY).
|
/// "MODRM_ONEENTRY" for MODRM_ONEENTRY).
|
||||||
static const char* stringForDecisionType(ModRMDecisionType dt)
|
static const char* stringForDecisionType(ModRMDecisionType dt) {
|
||||||
{
|
|
||||||
#define ENUM_ENTRY(n) case n: return #n;
|
#define ENUM_ENTRY(n) case n: return #n;
|
||||||
switch (dt) {
|
switch (dt) {
|
||||||
default:
|
default:
|
||||||
@ -271,8 +266,7 @@ static const char* stringForDecisionType(ModRMDecisionType dt)
|
|||||||
/// @param mt - The modifier type.
|
/// @param mt - The modifier type.
|
||||||
/// @return - A pointer to the statically-allocated string (e.g.,
|
/// @return - A pointer to the statically-allocated string (e.g.,
|
||||||
/// "MODIFIER_NONE" for MODIFIER_NONE).
|
/// "MODIFIER_NONE" for MODIFIER_NONE).
|
||||||
static const char* stringForModifierType(ModifierType mt)
|
static const char* stringForModifierType(ModifierType mt) {
|
||||||
{
|
|
||||||
#define ENUM_ENTRY(n) case n: return #n;
|
#define ENUM_ENTRY(n) case n: return #n;
|
||||||
switch(mt) {
|
switch(mt) {
|
||||||
default:
|
default:
|
||||||
@ -300,12 +294,9 @@ DisassemblerTables::~DisassemblerTables() {
|
|||||||
delete Tables[i];
|
delete Tables[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisassemblerTables::emitModRMDecision(raw_ostream &o1,
|
void DisassemblerTables::emitModRMDecision(raw_ostream &o1, raw_ostream &o2,
|
||||||
raw_ostream &o2,
|
uint32_t &i1, uint32_t &i2,
|
||||||
uint32_t &i1,
|
ModRMDecision &decision) const {
|
||||||
uint32_t &i2,
|
|
||||||
ModRMDecision &decision)
|
|
||||||
const {
|
|
||||||
static uint64_t sTableNumber = 0;
|
static uint64_t sTableNumber = 0;
|
||||||
static uint64_t sEntryNumber = 1;
|
static uint64_t sEntryNumber = 1;
|
||||||
ModRMDecisionType dt = getDecisionType(decision);
|
ModRMDecisionType dt = getDecisionType(decision);
|
||||||
@ -380,12 +371,9 @@ void DisassemblerTables::emitModRMDecision(raw_ostream &o1,
|
|||||||
++sTableNumber;
|
++sTableNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisassemblerTables::emitOpcodeDecision(
|
void DisassemblerTables::emitOpcodeDecision(raw_ostream &o1, raw_ostream &o2,
|
||||||
raw_ostream &o1,
|
uint32_t &i1, uint32_t &i2,
|
||||||
raw_ostream &o2,
|
OpcodeDecision &decision) const {
|
||||||
uint32_t &i1,
|
|
||||||
uint32_t &i2,
|
|
||||||
OpcodeDecision &decision) const {
|
|
||||||
uint16_t index;
|
uint16_t index;
|
||||||
|
|
||||||
o2.indent(i2) << "{ /* struct OpcodeDecision */" << "\n";
|
o2.indent(i2) << "{ /* struct OpcodeDecision */" << "\n";
|
||||||
@ -412,13 +400,10 @@ void DisassemblerTables::emitOpcodeDecision(
|
|||||||
o2.indent(i2) << "}" << "\n";
|
o2.indent(i2) << "}" << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisassemblerTables::emitContextDecision(
|
void DisassemblerTables::emitContextDecision(raw_ostream &o1, raw_ostream &o2,
|
||||||
raw_ostream &o1,
|
uint32_t &i1, uint32_t &i2,
|
||||||
raw_ostream &o2,
|
ContextDecision &decision,
|
||||||
uint32_t &i1,
|
const char* name) const {
|
||||||
uint32_t &i2,
|
|
||||||
ContextDecision &decision,
|
|
||||||
const char* name) const {
|
|
||||||
o2.indent(i2) << "static const struct ContextDecision " << name << " = {\n";
|
o2.indent(i2) << "static const struct ContextDecision " << name << " = {\n";
|
||||||
i2++;
|
i2++;
|
||||||
o2.indent(i2) << "{ /* opcodeDecisions */" << "\n";
|
o2.indent(i2) << "{ /* opcodeDecisions */" << "\n";
|
||||||
@ -593,11 +578,8 @@ void DisassemblerTables::emitContextTable(raw_ostream &o, uint32_t &i) const {
|
|||||||
o.indent(i * 2) << "};" << "\n";
|
o.indent(i * 2) << "};" << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisassemblerTables::emitContextDecisions(raw_ostream &o1,
|
void DisassemblerTables::emitContextDecisions(raw_ostream &o1, raw_ostream &o2,
|
||||||
raw_ostream &o2,
|
uint32_t &i1, uint32_t &i2) const {
|
||||||
uint32_t &i1,
|
|
||||||
uint32_t &i2)
|
|
||||||
const {
|
|
||||||
emitContextDecision(o1, o2, i1, i2, *Tables[0], ONEBYTE_STR);
|
emitContextDecision(o1, o2, i1, i2, *Tables[0], ONEBYTE_STR);
|
||||||
emitContextDecision(o1, o2, i1, i2, *Tables[1], TWOBYTE_STR);
|
emitContextDecision(o1, o2, i1, i2, *Tables[1], TWOBYTE_STR);
|
||||||
emitContextDecision(o1, o2, i1, i2, *Tables[2], THREEBYTE38_STR);
|
emitContextDecision(o1, o2, i1, i2, *Tables[2], THREEBYTE38_STR);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user