summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PIC16
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-04 04:47:45 +0000
committerChris Lattner <sabre@nondot.org>2010-04-04 04:47:45 +0000
commit76c564b1bb732a92bbb4a9685fe3dc6a2d65fbdd (patch)
tree484ca3fcb8c0b98cd2217b010476de27f7bb3924 /llvm/lib/Target/PIC16
parentcc2ab0cdc97a72fd5efe0ada69d8094eabddf1be (diff)
downloadbcm5719-llvm-76c564b1bb732a92bbb4a9685fe3dc6a2d65fbdd.tar.gz
bcm5719-llvm-76c564b1bb732a92bbb4a9685fe3dc6a2d65fbdd.zip
change a ton of code to not implicitly use the "O" raw_ostream
member of AsmPrinter. Instead, pass it in explicitly. llvm-svn: 100306
Diffstat (limited to 'llvm/lib/Target/PIC16')
-rw-r--r--llvm/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp10
-rw-r--r--llvm/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.h6
2 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp b/llvm/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp
index 1001d29fd8a..457dd7f9176 100644
--- a/llvm/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp
+++ b/llvm/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp
@@ -44,7 +44,7 @@ PIC16AsmPrinter::PIC16AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
}
void PIC16AsmPrinter::EmitInstruction(const MachineInstr *MI) {
- printInstruction(MI);
+ printInstruction(MI, O);
OutStreamer.AddBlankLine();
}
@@ -156,7 +156,8 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// printOperand - print operand of insn.
-void PIC16AsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
+void PIC16AsmPrinter::printOperand(const MachineInstr *MI, int opNum,
+ raw_ostream &O) {
const MachineOperand &MO = MI->getOperand(opNum);
const Function *F = MI->getParent()->getParent()->getFunction();
@@ -167,9 +168,7 @@ void PIC16AsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
std::string RegName = getRegisterName(MO.getReg());
if ((MI->getOpcode() == PIC16::load_indirect) ||
(MI->getOpcode() == PIC16::store_indirect))
- {
RegName.replace (0, 3, "INDF");
- }
O << RegName;
}
return;
@@ -216,7 +215,8 @@ void PIC16AsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
/// printCCOperand - Print the cond code operand.
///
-void PIC16AsmPrinter::printCCOperand(const MachineInstr *MI, int opNum) {
+void PIC16AsmPrinter::printCCOperand(const MachineInstr *MI, int opNum,
+ raw_ostream &O) {
int CC = (int)MI->getOperand(opNum).getImm();
O << PIC16CondCodeToString((PIC16CC::CondCodes)CC);
}
diff --git a/llvm/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.h b/llvm/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.h
index 8063fcc6fc9..312c54e56fb 100644
--- a/llvm/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.h
+++ b/llvm/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.h
@@ -43,9 +43,9 @@ namespace llvm {
}
bool runOnMachineFunction(MachineFunction &F);
- void printOperand(const MachineInstr *MI, int opNum);
- void printCCOperand(const MachineInstr *MI, int opNum);
- void printInstruction(const MachineInstr *MI); // definition autogenerated.
+ void printOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
+ void printCCOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
+ void printInstruction(const MachineInstr *MI, raw_ostream &O);
static const char *getRegisterName(unsigned RegNo);
void EmitInstruction(const MachineInstr *MI);
OpenPOWER on IntegriCloud