summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2004-06-25 19:24:52 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2004-06-25 19:24:52 +0000
commit26e36e5758d889f0d340a3188c539588dbb734d3 (patch)
treeb41ec0076ea0b576d5bd6aede2f8fa3d7c6cc823 /llvm/lib/Target
parentc22fd9a6a5d65f0356ebe9fa20864e3e22897dd5 (diff)
downloadbcm5719-llvm-26e36e5758d889f0d340a3188c539588dbb734d3.tar.gz
bcm5719-llvm-26e36e5758d889f0d340a3188c539588dbb734d3.zip
Combine several if stmts with returns into an if-then-elseif-else chain.
llvm-svn: 14414
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/PowerPC/PPC32AsmPrinter.cpp16
-rw-r--r--llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp16
2 files changed, 8 insertions, 24 deletions
diff --git a/llvm/lib/Target/PowerPC/PPC32AsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPC32AsmPrinter.cpp
index a200ce714ef..d778550b572 100644
--- a/llvm/lib/Target/PowerPC/PPC32AsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPC32AsmPrinter.cpp
@@ -490,7 +490,7 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
const TargetInstrInfo &TII = *TM.getInstrInfo();
const TargetInstrDescriptor &Desc = TII.get(Opcode);
unsigned int i;
-
+
unsigned int ArgCount = Desc.TSFlags & PPC32II::ArgCountMask;
unsigned int ArgType[] = {
(Desc.TSFlags >> PPC32II::Arg0TypeShift) & PPC32II::ArgTypeMask,
@@ -508,7 +508,7 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
if (Opcode == PPC32::MovePCtoLR) {
O << "mflr r0\n";
- O << "bcl 20,31,L" << CurrentFnName << "$pb\n";
+ O << "\tbcl 20,31,L" << CurrentFnName << "$pb\n";
O << "L" << CurrentFnName << "$pb:\n";
return;
}
@@ -524,20 +524,14 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
O << ", lo16(";
printOp(MI->getOperand(2));
O << "-L" << CurrentFnName << "$pb)\n";
- return;
- }
-
- if (Opcode == PPC32::LOADHiAddr) {
+ } else if (Opcode == PPC32::LOADHiAddr) {
printOp(MI->getOperand(0));
O << ", ";
printOp(MI->getOperand(1));
O << ", ha16(" ;
printOp(MI->getOperand(2));
O << "-L" << CurrentFnName << "$pb)\n";
- return;
- }
-
- if (ArgCount == 3 && ArgType[1] == PPC32II::Disimm16) {
+ } else if (ArgCount == 3 && ArgType[1] == PPC32II::Disimm16) {
printOp(MI->getOperand(0));
O << ", ";
printOp(MI->getOperand(1));
@@ -562,8 +556,6 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
O << ", ";
}
}
-
- return;
}
bool Printer::doInitialization(Module &M) {
diff --git a/llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp
index a200ce714ef..d778550b572 100644
--- a/llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp
@@ -490,7 +490,7 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
const TargetInstrInfo &TII = *TM.getInstrInfo();
const TargetInstrDescriptor &Desc = TII.get(Opcode);
unsigned int i;
-
+
unsigned int ArgCount = Desc.TSFlags & PPC32II::ArgCountMask;
unsigned int ArgType[] = {
(Desc.TSFlags >> PPC32II::Arg0TypeShift) & PPC32II::ArgTypeMask,
@@ -508,7 +508,7 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
if (Opcode == PPC32::MovePCtoLR) {
O << "mflr r0\n";
- O << "bcl 20,31,L" << CurrentFnName << "$pb\n";
+ O << "\tbcl 20,31,L" << CurrentFnName << "$pb\n";
O << "L" << CurrentFnName << "$pb:\n";
return;
}
@@ -524,20 +524,14 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
O << ", lo16(";
printOp(MI->getOperand(2));
O << "-L" << CurrentFnName << "$pb)\n";
- return;
- }
-
- if (Opcode == PPC32::LOADHiAddr) {
+ } else if (Opcode == PPC32::LOADHiAddr) {
printOp(MI->getOperand(0));
O << ", ";
printOp(MI->getOperand(1));
O << ", ha16(" ;
printOp(MI->getOperand(2));
O << "-L" << CurrentFnName << "$pb)\n";
- return;
- }
-
- if (ArgCount == 3 && ArgType[1] == PPC32II::Disimm16) {
+ } else if (ArgCount == 3 && ArgType[1] == PPC32II::Disimm16) {
printOp(MI->getOperand(0));
O << ", ";
printOp(MI->getOperand(1));
@@ -562,8 +556,6 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
O << ", ";
}
}
-
- return;
}
bool Printer::doInitialization(Module &M) {
OpenPOWER on IntegriCloud