mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user