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
This commit is contained in:
Chris Lattner
2010-04-04 04:47:45 +00:00
parent 20adc9dc46
commit 35c33bd772
25 changed files with 759 additions and 591 deletions

View File

@@ -62,13 +62,13 @@ namespace {
return "XCore Assembly Printer";
}
void printMemOperand(const MachineInstr *MI, int opNum);
void printInlineJT(const MachineInstr *MI, int opNum,
void printMemOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
void printInlineJT(const MachineInstr *MI, int opNum, raw_ostream &O,
const std::string &directive = ".jmptable");
void printInlineJT32(const MachineInstr *MI, int opNum) {
printInlineJT(MI, opNum, ".jmptable32");
void printInlineJT32(const MachineInstr *MI, int opNum, raw_ostream &O) {
printInlineJT(MI, opNum, O, ".jmptable32");
}
void printOperand(const MachineInstr *MI, int opNum);
void printOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
unsigned AsmVariant, const char *ExtraCode);
@@ -79,7 +79,7 @@ namespace {
void emitFunctionStart(MachineFunction &MF);
void printInstruction(const MachineInstr *MI); // autogenerated.
void printInstruction(const MachineInstr *MI, raw_ostream &O); // autogen'd.
static const char *getRegisterName(unsigned RegNo);
bool runOnMachineFunction(MachineFunction &MF);
@@ -251,21 +251,21 @@ bool XCoreAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
return false;
}
void XCoreAsmPrinter::printMemOperand(const MachineInstr *MI, int opNum)
{
printOperand(MI, opNum);
void XCoreAsmPrinter::printMemOperand(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);
}
void XCoreAsmPrinter::
printInlineJT(const MachineInstr *MI, int opNum, const std::string &directive)
{
printInlineJT(const MachineInstr *MI, int opNum, raw_ostream &O,
const std::string &directive) {
unsigned JTI = MI->getOperand(opNum).getIndex();
const MachineFunction *MF = MI->getParent()->getParent();
const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
@@ -280,7 +280,8 @@ printInlineJT(const MachineInstr *MI, int opNum, const std::string &directive)
}
}
void XCoreAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
void XCoreAsmPrinter::printOperand(const MachineInstr *MI, int opNum,
raw_ostream &O) {
const MachineOperand &MO = MI->getOperand(opNum);
switch (MO.getType()) {
case MachineOperand::MO_Register:
@@ -319,7 +320,7 @@ void XCoreAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
bool XCoreAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
unsigned AsmVariant,
const char *ExtraCode) {
printOperand(MI, OpNo);
printOperand(MI, OpNo, O);
return false;
}
@@ -332,7 +333,7 @@ void XCoreAsmPrinter::EmitInstruction(const MachineInstr *MI) {
OutStreamer.AddBlankLine();
return;
}
printInstruction(MI);
printInstruction(MI, O);
OutStreamer.AddBlankLine();
}