PowerPC 32-/64-bit split: Part I, PPC32* bit files, adapted from former PowerPC*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15850 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 798a908..9a591a1 100644
--- a/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -18,8 +18,7 @@
 
 #define DEBUG_TYPE "asmprinter"
 #include "PowerPC.h"
-#include "PowerPCInstrInfo.h"
-#include "PowerPCTargetMachine.h"
+#include "PPC32TargetMachine.h"
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Module.h"
@@ -29,7 +28,6 @@
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/Target/TargetMachine.h"
 #include "llvm/Support/Mangler.h"
 #include "Support/CommandLine.h"
 #include "Support/Debug.h"
@@ -41,11 +39,11 @@
 namespace {
   Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
 
-  struct PowerPCAsmPrinter : public AsmPrinter {
+  struct PPC32AsmPrinter : public AsmPrinter {
     std::set<std::string> FnStubs, GVStubs, LinkOnceStubs;
     std::set<std::string> Strings;
 
-    PowerPCAsmPrinter(std::ostream &O, TargetMachine &TM)
+    PPC32AsmPrinter(std::ostream &O, TargetMachine &TM)
       : AsmPrinter(O, TM), LabelNumber(0) {
       UsesUnderscorePrefix = 1;
     }
@@ -55,11 +53,11 @@
     unsigned LabelNumber;
   
     virtual const char *getPassName() const {
-      return "PowerPC Assembly Printer";
+      return "PPC32 Assembly Printer";
     }
 
-    PowerPCTargetMachine &getTM() {
-      return static_cast<PowerPCTargetMachine&>(TM);
+    PPC32TargetMachine &getTM() {
+      return static_cast<PPC32TargetMachine&>(TM);
     }
 
     /// printInstruction - This method is automatically generated by tablegen
@@ -101,8 +99,8 @@
 /// using the given target machine description.  This should work
 /// regardless of whether the function is in SSA form or not.
 ///
-FunctionPass *llvm::createPPCAsmPrinter(std::ostream &o,TargetMachine &tm) {
-  return new PowerPCAsmPrinter(o, tm);
+FunctionPass *llvm::createPPC32AsmPrinter(std::ostream &o, TargetMachine &tm) {
+  return new PPC32AsmPrinter(o, tm);
 }
 
 // Include the auto-generated portion of the assembly writer
@@ -151,7 +149,7 @@
 
 // Print a constant value or values, with the appropriate storage class as a
 // prefix.
-void PowerPCAsmPrinter::emitGlobalConstant(const Constant *CV) {  
+void PPC32AsmPrinter::emitGlobalConstant(const Constant *CV) {  
   const TargetData &TD = TM.getTargetData();
 
   if (CV->isNullValue()) {
@@ -275,7 +273,7 @@
 /// used to print out constants which have been "spilled to memory" by
 /// the code generator.
 ///
-void PowerPCAsmPrinter::printConstantPool(MachineConstantPool *MCP) {
+void PPC32AsmPrinter::printConstantPool(MachineConstantPool *MCP) {
   const std::vector<Constant*> &CP = MCP->getConstants();
   const TargetData &TD = TM.getTargetData();
  
@@ -294,7 +292,7 @@
 /// runOnMachineFunction - This uses the printMachineInstruction()
 /// method to print assembly for each instruction.
 ///
-bool PowerPCAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+bool PPC32AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   setupMachineFunction(MF);
   O << "\n\n";
 
@@ -326,8 +324,8 @@
   return false;
 }
 
-void PowerPCAsmPrinter::printOp(const MachineOperand &MO,
-                      bool LoadAddrOp /* = false */) {
+void PPC32AsmPrinter::printOp(const MachineOperand &MO,
+                              bool LoadAddrOp /* = false */) {
   const MRegisterInfo &RI = *TM.getRegisterInfo();
   int new_symbol;
   
@@ -408,7 +406,7 @@
   }
 }
 
-void PowerPCAsmPrinter::printImmOp(const MachineOperand &MO, unsigned ArgType) {
+void PPC32AsmPrinter::printImmOp(const MachineOperand &MO, unsigned ArgType) {
   int Imm = MO.getImmedValue();
   if (ArgType == PPCII::Simm16 || ArgType == PPCII::Disimm16) {
     O << (short)Imm;
@@ -420,7 +418,7 @@
 /// printMachineInstruction -- Print out a single PowerPC MI in Darwin syntax to
 /// the current output stream.
 ///
-void PowerPCAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
+void PPC32AsmPrinter::printMachineInstruction(const MachineInstr *MI) {
   ++EmittedInsts;
   if (printInstruction(MI))
     return; // Printer was automatically generated
@@ -550,7 +548,7 @@
   }
 }
 
-bool PowerPCAsmPrinter::doFinalization(Module &M) {
+bool PPC32AsmPrinter::doFinalization(Module &M) {
   const TargetData &TD = TM.getTargetData();
   std::string CurSection;