diff options
Diffstat (limited to 'lib/Target/Sparc/SparcAsmPrinter.cpp')
-rw-r--r-- | lib/Target/Sparc/SparcAsmPrinter.cpp | 40 |
1 files changed, 2 insertions, 38 deletions
diff --git a/lib/Target/Sparc/SparcAsmPrinter.cpp b/lib/Target/Sparc/SparcAsmPrinter.cpp index c983d5f894..a21f499358 100644 --- a/lib/Target/Sparc/SparcAsmPrinter.cpp +++ b/lib/Target/Sparc/SparcAsmPrinter.cpp @@ -70,7 +70,6 @@ namespace { void emitGlobalConstant(const Constant *CV); void printConstantPool(MachineConstantPool *MCP); void printOperand(const MachineInstr *MI, int opNum); - void printMachineInstruction(const MachineInstr *MI); bool printInstruction(const MachineInstr *MI); // autogenerated. bool runOnMachineFunction(MachineFunction &F); bool doInitialization(Module &M); @@ -357,7 +356,8 @@ bool SparcV8AsmPrinter::runOnMachineFunction(MachineFunction &MF) { for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end(); II != E; ++II) { // Print the assembly for the instruction. - printMachineInstruction(II); + O << "\t"; + printInstruction(II); } } @@ -421,42 +421,6 @@ void SparcV8AsmPrinter::printOperand(const MachineInstr *MI, int opNum) { if (CloseParen) O << ")"; } -/// printMachineInstruction -- Print out a single SparcV8 LLVM instruction -/// MI in GAS syntax to the current output stream. -/// -void SparcV8AsmPrinter::printMachineInstruction(const MachineInstr *MI) { - O << "\t"; - if (printInstruction(MI)) return; - - unsigned Opcode = MI->getOpcode(); - const TargetInstrInfo &TII = *TM.getInstrInfo(); - const TargetInstrDescriptor &Desc = TII.get(Opcode); - - O << Desc.Name << " "; - - // print non-immediate, non-register-def operands - // then print immediate operands - // then print register-def operands. - std::vector<int> print_order; - for (unsigned i = 0; i < MI->getNumOperands (); ++i) - if (!(MI->getOperand (i).isImmediate () - || (MI->getOperand (i).isRegister () - && MI->getOperand (i).isDef ()))) - print_order.push_back (i); - for (unsigned i = 0; i < MI->getNumOperands (); ++i) - if (MI->getOperand (i).isImmediate ()) - print_order.push_back (i); - for (unsigned i = 0; i < MI->getNumOperands (); ++i) - if (MI->getOperand (i).isRegister () && MI->getOperand (i).isDef ()) - print_order.push_back (i); - for (unsigned i = 0, e = print_order.size (); i != e; ++i) { - printOperand (MI, print_order[i]); - if (i != (print_order.size () - 1)) - O << ", "; - } - O << "\n"; -} - bool SparcV8AsmPrinter::doInitialization(Module &M) { Mang = new Mangler(M); return false; // success |