-//===-- PPC32/Printer.cpp - Convert X86 LLVM code to Intel assembly ---------===//
+//===-- Printer.cpp - Convert LLVM code to PowerPC assembly ---------------===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
//
-// This file contains a printer that converts from our internal
-// representation of machine-dependent LLVM code to Intel-format
-// assembly language. This printer is the output mechanism used
-// by `llc' and `lli -print-machineinstrs' on X86.
+// This file contains a printer that converts from our internal representation
+// of machine-dependent LLVM code to PowerPC assembly language. This printer is
+// the output mechanism used by `llc' and `lli -print-machineinstrs'.
//
-// Documentation at
-// http://developer.apple.com/documentation/DeveloperTools/
-// Reference/Assembler/ASMIntroduction/chapter_1_section_1.html
+// Documentation at http://developer.apple.com/documentation/DeveloperTools/
+// Reference/Assembler/ASMIntroduction/chapter_1_section_1.html
//
//===----------------------------------------------------------------------===//
}
// FALLTHROUGH
case MachineOperand::MO_MachineRegister:
+ case MachineOperand::MO_CCRegister:
O << LowercaseString(RI.get(MO.getReg()).Name);
return;
case MachineOperand::MO_UnextendedImmed:
O << (int)MO.getImmedValue();
return;
+
+ case MachineOperand::MO_PCRelativeDisp:
+ std::cerr << "Shouldn't use addPCDisp() when building PPC MachineInstrs";
+ abort();
+ return;
+
case MachineOperand::MO_MachineBasicBlock: {
MachineBasicBlock *MBBOp = MO.getMachineBasicBlock();
O << ".LBB" << Mang->getValueName(MBBOp->getParent()->getFunction())
<< MBBOp->getBasicBlock()->getName();
return;
}
- case MachineOperand::MO_PCRelativeDisp:
- std::cerr << "Shouldn't use addPCDisp() when building PPC MachineInstrs";
- abort();
+
+ case MachineOperand::MO_ConstantPoolIndex:
+ O << ".CPI" << CurrentFnName << "_" << MO.getConstantPoolIndex();
return;
+
+ case MachineOperand::MO_ExternalSymbol:
+ O << MO.getSymbolName();
+ return;
+
case MachineOperand::MO_GlobalAddress:
if (!elideOffsetKeyword) {
// Dynamically-resolved functions need a stub for the function
}
}
return;
- case MachineOperand::MO_ExternalSymbol:
- O << MO.getSymbolName();
- return;
+
default:
- O << "<unknown operand type>";
+ O << "<unknown operand type: " << MO.getType() << ">";
return;
}
}
-//===-- PPC32/Printer.cpp - Convert X86 LLVM code to Intel assembly ---------===//
+//===-- Printer.cpp - Convert LLVM code to PowerPC assembly ---------------===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
//
-// This file contains a printer that converts from our internal
-// representation of machine-dependent LLVM code to Intel-format
-// assembly language. This printer is the output mechanism used
-// by `llc' and `lli -print-machineinstrs' on X86.
+// This file contains a printer that converts from our internal representation
+// of machine-dependent LLVM code to PowerPC assembly language. This printer is
+// the output mechanism used by `llc' and `lli -print-machineinstrs'.
//
-// Documentation at
-// http://developer.apple.com/documentation/DeveloperTools/
-// Reference/Assembler/ASMIntroduction/chapter_1_section_1.html
+// Documentation at http://developer.apple.com/documentation/DeveloperTools/
+// Reference/Assembler/ASMIntroduction/chapter_1_section_1.html
//
//===----------------------------------------------------------------------===//
}
// FALLTHROUGH
case MachineOperand::MO_MachineRegister:
+ case MachineOperand::MO_CCRegister:
O << LowercaseString(RI.get(MO.getReg()).Name);
return;
case MachineOperand::MO_UnextendedImmed:
O << (int)MO.getImmedValue();
return;
+
+ case MachineOperand::MO_PCRelativeDisp:
+ std::cerr << "Shouldn't use addPCDisp() when building PPC MachineInstrs";
+ abort();
+ return;
+
case MachineOperand::MO_MachineBasicBlock: {
MachineBasicBlock *MBBOp = MO.getMachineBasicBlock();
O << ".LBB" << Mang->getValueName(MBBOp->getParent()->getFunction())
<< MBBOp->getBasicBlock()->getName();
return;
}
- case MachineOperand::MO_PCRelativeDisp:
- std::cerr << "Shouldn't use addPCDisp() when building PPC MachineInstrs";
- abort();
+
+ case MachineOperand::MO_ConstantPoolIndex:
+ O << ".CPI" << CurrentFnName << "_" << MO.getConstantPoolIndex();
return;
+
+ case MachineOperand::MO_ExternalSymbol:
+ O << MO.getSymbolName();
+ return;
+
case MachineOperand::MO_GlobalAddress:
if (!elideOffsetKeyword) {
// Dynamically-resolved functions need a stub for the function
}
}
return;
- case MachineOperand::MO_ExternalSymbol:
- O << MO.getSymbolName();
- return;
+
default:
- O << "<unknown operand type>";
+ O << "<unknown operand type: " << MO.getType() << ">";
return;
}
}
-//===-- PPC32/Printer.cpp - Convert X86 LLVM code to Intel assembly ---------===//
+//===-- Printer.cpp - Convert LLVM code to PowerPC assembly ---------------===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
//
-// This file contains a printer that converts from our internal
-// representation of machine-dependent LLVM code to Intel-format
-// assembly language. This printer is the output mechanism used
-// by `llc' and `lli -print-machineinstrs' on X86.
+// This file contains a printer that converts from our internal representation
+// of machine-dependent LLVM code to PowerPC assembly language. This printer is
+// the output mechanism used by `llc' and `lli -print-machineinstrs'.
//
-// Documentation at
-// http://developer.apple.com/documentation/DeveloperTools/
-// Reference/Assembler/ASMIntroduction/chapter_1_section_1.html
+// Documentation at http://developer.apple.com/documentation/DeveloperTools/
+// Reference/Assembler/ASMIntroduction/chapter_1_section_1.html
//
//===----------------------------------------------------------------------===//
}
// FALLTHROUGH
case MachineOperand::MO_MachineRegister:
+ case MachineOperand::MO_CCRegister:
O << LowercaseString(RI.get(MO.getReg()).Name);
return;
case MachineOperand::MO_UnextendedImmed:
O << (int)MO.getImmedValue();
return;
+
+ case MachineOperand::MO_PCRelativeDisp:
+ std::cerr << "Shouldn't use addPCDisp() when building PPC MachineInstrs";
+ abort();
+ return;
+
case MachineOperand::MO_MachineBasicBlock: {
MachineBasicBlock *MBBOp = MO.getMachineBasicBlock();
O << ".LBB" << Mang->getValueName(MBBOp->getParent()->getFunction())
<< MBBOp->getBasicBlock()->getName();
return;
}
- case MachineOperand::MO_PCRelativeDisp:
- std::cerr << "Shouldn't use addPCDisp() when building PPC MachineInstrs";
- abort();
+
+ case MachineOperand::MO_ConstantPoolIndex:
+ O << ".CPI" << CurrentFnName << "_" << MO.getConstantPoolIndex();
return;
+
+ case MachineOperand::MO_ExternalSymbol:
+ O << MO.getSymbolName();
+ return;
+
case MachineOperand::MO_GlobalAddress:
if (!elideOffsetKeyword) {
// Dynamically-resolved functions need a stub for the function
}
}
return;
- case MachineOperand::MO_ExternalSymbol:
- O << MO.getSymbolName();
- return;
+
default:
- O << "<unknown operand type>";
+ O << "<unknown operand type: " << MO.getType() << ">";
return;
}
}