mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00:00
Fix up indentation of outputted decode function for readability.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162082 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -914,7 +914,7 @@ emitDecoderFunction(formatted_raw_ostream &OS, DecoderSet &Decoders,
|
|||||||
for (DecoderSet::const_iterator I = Decoders.begin(), E = Decoders.end();
|
for (DecoderSet::const_iterator I = Decoders.begin(), E = Decoders.end();
|
||||||
I != E; ++I, ++Index) {
|
I != E; ++I, ++Index) {
|
||||||
OS.indent(Indentation) << "case " << Index << ":\n";
|
OS.indent(Indentation) << "case " << Index << ":\n";
|
||||||
OS << *I << "\n";
|
OS << *I;
|
||||||
OS.indent(Indentation+2) << "return S;\n";
|
OS.indent(Indentation+2) << "return S;\n";
|
||||||
}
|
}
|
||||||
OS.indent(Indentation) << "}\n";
|
OS.indent(Indentation) << "}\n";
|
||||||
@@ -1070,25 +1070,25 @@ void FilterChooser::emitBinaryParser(raw_ostream &o, unsigned &Indentation,
|
|||||||
|
|
||||||
if (OpInfo.numFields() == 1) {
|
if (OpInfo.numFields() == 1) {
|
||||||
OperandInfo::const_iterator OI = OpInfo.begin();
|
OperandInfo::const_iterator OI = OpInfo.begin();
|
||||||
o.indent(Indentation) << " tmp = fieldFromInstruction"
|
o.indent(Indentation) << "tmp = fieldFromInstruction"
|
||||||
<< "(insn, " << OI->Base << ", " << OI->Width
|
<< "(insn, " << OI->Base << ", " << OI->Width
|
||||||
<< ");\n";
|
<< ");\n";
|
||||||
} else {
|
} else {
|
||||||
o.indent(Indentation) << " tmp = 0;\n";
|
o.indent(Indentation) << "tmp = 0;\n";
|
||||||
for (OperandInfo::const_iterator OI = OpInfo.begin(), OE = OpInfo.end();
|
for (OperandInfo::const_iterator OI = OpInfo.begin(), OE = OpInfo.end();
|
||||||
OI != OE; ++OI) {
|
OI != OE; ++OI) {
|
||||||
o.indent(Indentation) << " tmp |= (fieldFromInstruction"
|
o.indent(Indentation) << "tmp |= (fieldFromInstruction"
|
||||||
<< "(insn, " << OI->Base << ", " << OI->Width
|
<< "(insn, " << OI->Base << ", " << OI->Width
|
||||||
<< ") << " << OI->Offset << ");\n";
|
<< ") << " << OI->Offset << ");\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Decoder != "")
|
if (Decoder != "")
|
||||||
o.indent(Indentation) << " " << Emitter->GuardPrefix << Decoder
|
o.indent(Indentation) << Emitter->GuardPrefix << Decoder
|
||||||
<< "(MI, tmp, Address, Decoder)"
|
<< "(MI, tmp, Address, Decoder)"
|
||||||
<< Emitter->GuardPostfix << "\n";
|
<< Emitter->GuardPostfix << "\n";
|
||||||
else
|
else
|
||||||
o.indent(Indentation) << " MI.addOperand(MCOperand::CreateImm(tmp));\n";
|
o.indent(Indentation) << "MI.addOperand(MCOperand::CreateImm(tmp));\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1101,7 +1101,7 @@ void FilterChooser::emitDecoder(raw_ostream &OS, unsigned Indentation,
|
|||||||
I = InsnOperands.begin(), E = InsnOperands.end(); I != E; ++I) {
|
I = InsnOperands.begin(), E = InsnOperands.end(); I != E; ++I) {
|
||||||
// If a custom instruction decoder was specified, use that.
|
// If a custom instruction decoder was specified, use that.
|
||||||
if (I->numFields() == 0 && I->Decoder.size()) {
|
if (I->numFields() == 0 && I->Decoder.size()) {
|
||||||
OS.indent(Indentation) << " " << Emitter->GuardPrefix << I->Decoder
|
OS.indent(Indentation) << Emitter->GuardPrefix << I->Decoder
|
||||||
<< "(MI, insn, Address, Decoder)"
|
<< "(MI, insn, Address, Decoder)"
|
||||||
<< Emitter->GuardPostfix << "\n";
|
<< Emitter->GuardPostfix << "\n";
|
||||||
break;
|
break;
|
||||||
@@ -1118,7 +1118,7 @@ unsigned FilterChooser::getDecoderIndex(DecoderSet &Decoders,
|
|||||||
// FIXME: emitDecoder() function can take a buffer directly rather than
|
// FIXME: emitDecoder() function can take a buffer directly rather than
|
||||||
// a stream.
|
// a stream.
|
||||||
raw_svector_ostream S(Decoder);
|
raw_svector_ostream S(Decoder);
|
||||||
unsigned I = 0;
|
unsigned I = 4;
|
||||||
emitDecoder(S, I, Opc);
|
emitDecoder(S, I, Opc);
|
||||||
S.flush();
|
S.flush();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user