change a ton of code to not implicitly use the "O" raw_ostream
[oota-llvm.git] / lib / Target / Blackfin / AsmPrinter / BlackfinAsmPrinter.cpp
index a6b48423a52931bc7b34a76c1e5e235185ffca02..b206c183b1e16fca7245e5e2c2a24521fe2640dd 100644 (file)
@@ -47,13 +47,13 @@ namespace {
       return "Blackfin Assembly Printer";
     }
 
-    void printOperand(const MachineInstr *MI, int opNum);
-    void printMemoryOperand(const MachineInstr *MI, int opNum);
-    void printInstruction(const MachineInstr *MI);  // autogenerated.
+    void printOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
+    void printMemoryOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
+    void printInstruction(const MachineInstr *MI, raw_ostream &O);// autogen'd.
     static const char *getRegisterName(unsigned RegNo);
 
     void EmitInstruction(const MachineInstr *MI) {
-      printInstruction(MI);
+      printInstruction(MI, O);
       OutStreamer.AddBlankLine();
     }
     bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
@@ -69,8 +69,9 @@ extern "C" void LLVMInitializeBlackfinAsmPrinter() {
   RegisterAsmPrinter<BlackfinAsmPrinter> X(TheBlackfinTarget);
 }
 
-void BlackfinAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
-  const MachineOperand &MO = MI->getOperand (opNum);
+void BlackfinAsmPrinter::printOperand(const MachineInstr *MI, int opNum,
+                                      raw_ostream &O) {
+  const MachineOperand &MO = MI->getOperand(opNum);
   switch (MO.getType()) {
   case MachineOperand::MO_Register:
     assert(TargetRegisterInfo::isPhysicalRegister(MO.getReg()) &&
@@ -105,14 +106,15 @@ void BlackfinAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
   }
 }
 
-void BlackfinAsmPrinter::printMemoryOperand(const MachineInstr *MI, int opNum) {
-  printOperand(MI, opNum);
+void BlackfinAsmPrinter::printMemoryOperand(const MachineInstr *MI, int opNum,
+                                            raw_ostream &O) {
+  printOperand(MI, opNum, O);
 
   if (MI->getOperand(opNum+1).isImm() && MI->getOperand(opNum+1).getImm() == 0)
     return;
 
   O << " + ";
-  printOperand(MI, opNum+1);
+  printOperand(MI, opNum+1, O);
 }
 
 /// PrintAsmOperand - Print out an operand for an inline asm expression.
@@ -131,7 +133,7 @@ bool BlackfinAsmPrinter::PrintAsmOperand(const MachineInstr *MI,
     }
   }
 
-  printOperand(MI, OpNo);
+  printOperand(MI, OpNo, O);
 
   return false;
 }
@@ -144,7 +146,7 @@ bool BlackfinAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
     return true;  // Unknown modifier
 
   O << '[';
-  printOperand(MI, OpNo);
+  printOperand(MI, OpNo, O);
   O << ']';
 
   return false;