diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-04 04:47:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-04 04:47:45 +0000 |
commit | 35c33bd772b3cfb34fdc6b5c9171f955454d0043 (patch) | |
tree | 763442764850298ab7321ad5b68be659d9fb60cf /lib/Target/Alpha | |
parent | 20adc9dc4650313f017b27d9818eb2176238113d (diff) | |
download | external_llvm-35c33bd772b3cfb34fdc6b5c9171f955454d0043.zip external_llvm-35c33bd772b3cfb34fdc6b5c9171f955454d0043.tar.gz external_llvm-35c33bd772b3cfb34fdc6b5c9171f955454d0043.tar.bz2 |
change a ton of code to not implicitly use the "O" raw_ostream
member of AsmPrinter. Instead, pass it in explicitly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100306 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Alpha')
-rw-r--r-- | lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp index 093cf05..6fc9bc1 100644 --- a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp +++ b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp @@ -44,16 +44,17 @@ namespace { virtual const char *getPassName() const { return "Alpha Assembly Printer"; } - void printInstruction(const MachineInstr *MI); + void printInstruction(const MachineInstr *MI, raw_ostream &O); void EmitInstruction(const MachineInstr *MI) { - printInstruction(MI); + printInstruction(MI, O); OutStreamer.AddBlankLine(); } static const char *getRegisterName(unsigned RegNo); - void printOp(const MachineOperand &MO, bool IsCallOp = false); - void printOperand(const MachineInstr *MI, int opNum); - void printBaseOffsetPair(const MachineInstr *MI, int i, bool brackets=true); + void printOp(const MachineOperand &MO, raw_ostream &O); + void printOperand(const MachineInstr *MI, int opNum, raw_ostream &O); + void printBaseOffsetPair(const MachineInstr *MI, int i, raw_ostream &O, + bool brackets=true); virtual void EmitFunctionBodyStart(); virtual void EmitFunctionBodyEnd(); void EmitStartOfAsmFile(Module &M); @@ -69,8 +70,8 @@ namespace { #include "AlphaGenAsmWriter.inc" -void AlphaAsmPrinter::printOperand(const MachineInstr *MI, int opNum) -{ +void AlphaAsmPrinter::printOperand(const MachineInstr *MI, int opNum, + raw_ostream &O) { const MachineOperand &MO = MI->getOperand(opNum); if (MO.getType() == MachineOperand::MO_Register) { assert(TargetRegisterInfo::isPhysicalRegister(MO.getReg()) && @@ -80,12 +81,12 @@ void AlphaAsmPrinter::printOperand(const MachineInstr *MI, int opNum) O << MO.getImm(); assert(MO.getImm() < (1 << 30)); } else { - printOp(MO); + printOp(MO, O); } } -void AlphaAsmPrinter::printOp(const MachineOperand &MO, bool IsCallOp) { +void AlphaAsmPrinter::printOp(const MachineOperand &MO, raw_ostream &O) { switch (MO.getType()) { case MachineOperand::MO_Register: O << getRegisterName(MO.getReg()); @@ -148,7 +149,7 @@ void AlphaAsmPrinter::EmitStartOfAsmFile(Module &M) { bool AlphaAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode) { - printOperand(MI, OpNo); + printOperand(MI, OpNo, O); return false; } @@ -159,7 +160,7 @@ bool AlphaAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, if (ExtraCode && ExtraCode[0]) return true; // Unknown modifier. O << "0("; - printOperand(MI, OpNo); + printOperand(MI, OpNo, O); O << ")"; return false; } |