mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 06:24:57 +00:00
Print X86 PHI nodes in a sane manner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5003 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -167,6 +167,22 @@ void X86InstrInfo::print(const MachineInstr *MI, std::ostream &O,
|
|||||||
unsigned Opcode = MI->getOpcode();
|
unsigned Opcode = MI->getOpcode();
|
||||||
const MachineInstrDescriptor &Desc = get(Opcode);
|
const MachineInstrDescriptor &Desc = get(Opcode);
|
||||||
|
|
||||||
|
if (Opcode == X86::PHI) {
|
||||||
|
printOp(O, MI->getOperand(0), RI);
|
||||||
|
O << " = phi ";
|
||||||
|
for (unsigned i = 1, e = MI->getNumOperands(); i != e; i+=2) {
|
||||||
|
if (i != 1) O << ", ";
|
||||||
|
O << "[";
|
||||||
|
printOp(O, MI->getOperand(i), RI);
|
||||||
|
O << ", ";
|
||||||
|
printOp(O, MI->getOperand(i+1), RI);
|
||||||
|
O << "]";
|
||||||
|
}
|
||||||
|
O << "\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
switch (Desc.TSFlags & X86II::FormMask) {
|
switch (Desc.TSFlags & X86II::FormMask) {
|
||||||
case X86II::RawFrm:
|
case X86II::RawFrm:
|
||||||
// The accepted forms of Raw instructions are:
|
// The accepted forms of Raw instructions are:
|
||||||
|
@ -167,6 +167,22 @@ void X86InstrInfo::print(const MachineInstr *MI, std::ostream &O,
|
|||||||
unsigned Opcode = MI->getOpcode();
|
unsigned Opcode = MI->getOpcode();
|
||||||
const MachineInstrDescriptor &Desc = get(Opcode);
|
const MachineInstrDescriptor &Desc = get(Opcode);
|
||||||
|
|
||||||
|
if (Opcode == X86::PHI) {
|
||||||
|
printOp(O, MI->getOperand(0), RI);
|
||||||
|
O << " = phi ";
|
||||||
|
for (unsigned i = 1, e = MI->getNumOperands(); i != e; i+=2) {
|
||||||
|
if (i != 1) O << ", ";
|
||||||
|
O << "[";
|
||||||
|
printOp(O, MI->getOperand(i), RI);
|
||||||
|
O << ", ";
|
||||||
|
printOp(O, MI->getOperand(i+1), RI);
|
||||||
|
O << "]";
|
||||||
|
}
|
||||||
|
O << "\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
switch (Desc.TSFlags & X86II::FormMask) {
|
switch (Desc.TSFlags & X86II::FormMask) {
|
||||||
case X86II::RawFrm:
|
case X86II::RawFrm:
|
||||||
// The accepted forms of Raw instructions are:
|
// The accepted forms of Raw instructions are:
|
||||||
|
Reference in New Issue
Block a user