[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC.h PPCRegisterInfo.td PPCSubtarget.cpp PPCTargetMachine.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Jun 16 11:51:00 PDT 2006



Changes in directory llvm/lib/Target/PowerPC:

PPC.h updated: 1.28 -> 1.29
PPCRegisterInfo.td updated: 1.36 -> 1.37
PPCSubtarget.cpp updated: 1.22 -> 1.23
PPCTargetMachine.cpp updated: 1.93 -> 1.94
---
Log message:

Remove the -darwin and -aix llc options, inferring darwinism and aixism from
the target triple & subtarget info.  woo.



---
Diffs of the changes:  (+7 -35)

 PPC.h                |    7 -------
 PPCRegisterInfo.td   |    4 ++--
 PPCSubtarget.cpp     |   18 +++---------------
 PPCTargetMachine.cpp |   13 ++-----------
 4 files changed, 7 insertions(+), 35 deletions(-)


Index: llvm/lib/Target/PowerPC/PPC.h
diff -u llvm/lib/Target/PowerPC/PPC.h:1.28 llvm/lib/Target/PowerPC/PPC.h:1.29
--- llvm/lib/Target/PowerPC/PPC.h:1.28	Mon Mar 13 17:20:37 2006
+++ llvm/lib/Target/PowerPC/PPC.h	Fri Jun 16 13:50:48 2006
@@ -21,17 +21,10 @@
 
 class FunctionPass;
 class PPCTargetMachine;
-
-enum PPCTargetEnum {
-  TargetDefault, TargetAIX, TargetDarwin
-};
-
 FunctionPass *createPPCBranchSelectionPass();
 FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
 FunctionPass *createDarwinAsmPrinter(std::ostream &OS, PPCTargetMachine &TM);
 FunctionPass *createAIXAsmPrinter(std::ostream &OS, PPCTargetMachine &TM);
-
-extern PPCTargetEnum PPCTarget;
 } // end namespace llvm;
 
 // GCC #defines PPC on Linux but we use it as our namespace name


Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.td
diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.36 llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.37
--- llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.36	Thu May  4 11:56:45 2006
+++ llvm/lib/Target/PowerPC/PPCRegisterInfo.td	Fri Jun 16 13:50:48 2006
@@ -215,7 +215,7 @@
   let MethodBodies = [{
     GPRCClass::iterator
     GPRCClass::allocation_order_begin(MachineFunction &MF) const {
-      return begin() + ((TargetAIX == PPCTarget) ? 1 : 0);
+      return begin();
     }
     GPRCClass::iterator
     GPRCClass::allocation_order_end(MachineFunction &MF) const {
@@ -238,7 +238,7 @@
   let MethodBodies = [{
     G8RCClass::iterator
     G8RCClass::allocation_order_begin(MachineFunction &MF) const {
-      return begin() + ((TargetAIX == PPCTarget) ? 1 : 0);
+      return begin();
     }
     G8RCClass::iterator
     G8RCClass::allocation_order_end(MachineFunction &MF) const {


Index: llvm/lib/Target/PowerPC/PPCSubtarget.cpp
diff -u llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.22 llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.23
--- llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.22	Fri Jun 16 12:50:12 2006
+++ llvm/lib/Target/PowerPC/PPCSubtarget.cpp	Fri Jun 16 13:50:48 2006
@@ -14,24 +14,10 @@
 #include "PPCSubtarget.h"
 #include "PPC.h"
 #include "llvm/Module.h"
-#include "llvm/Support/CommandLine.h"
 #include "PPCGenSubtarget.inc"
 #include <iostream>
-
 using namespace llvm;
-PPCTargetEnum llvm::PPCTarget = TargetDefault;
 
-namespace llvm {
-  cl::opt<PPCTargetEnum, true>
-  PPCTargetArg(cl::desc("Force generation of code for a specific PPC target:"),
-               cl::values(
-                          clEnumValN(TargetAIX,  "aix", "  Enable AIX codegen"),
-                          clEnumValN(TargetDarwin,"darwin",
-                                     "  Enable Darwin codegen"),
-                          clEnumValEnd),
-               cl::location(PPCTarget), cl::init(TargetDefault));  
-} 
- 
 #if defined(__APPLE__)
 #include <mach/mach.h>
 #include <mach/mach_host.h>
@@ -115,7 +101,9 @@
   // if one cannot be determined, to true.
   const std::string& TT = M.getTargetTriple();
   if (TT.length() > 5) {
-    IsDarwin = TT.find("darwin") != std::string::npos;
+    IsDarwin = TT.find("-darwin") != std::string::npos;
+    if (!IsDarwin)
+      IsAIX = TT.find("-aix") != std::string::npos;
   } else if (TT.empty()) {
 #if defined(_POWER)
     IsAIX = true;


Index: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.93 llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.94
--- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.93	Fri Jun 16 13:22:52 2006
+++ llvm/lib/Target/PowerPC/PPCTargetMachine.cpp	Fri Jun 16 13:50:48 2006
@@ -91,10 +91,6 @@
     FrameInfo(*this, false), JITInfo(*this), TLInfo(*this),
     InstrItins(Subtarget.getInstrItineraryData()) {
 
-  if (TargetDefault == PPCTarget) {
-    if (Subtarget.isAIX()) PPCTarget = TargetAIX;
-    if (Subtarget.isDarwin()) PPCTarget = TargetDarwin;
-  }
   if (getRelocationModel() == Reloc::Default)
     if (Subtarget.isDarwin())
       setRelocationModel(Reloc::DynamicNoPIC);
@@ -153,15 +149,10 @@
 
   // Decide which asm printer to use.  If the user has not specified one on
   // the command line, choose whichever one matches the default (current host).
-  switch (PPCTarget) {
-  case TargetAIX:
+  if (Subtarget.isAIX())
     PM.add(createAIXAsmPrinter(Out, *this));
-    break;
-  case TargetDefault:
-  case TargetDarwin:
+  else
     PM.add(createDarwinAsmPrinter(Out, *this));
-    break;
-  }
 
   PM.add(createMachineCodeDeleter());
   return false;






More information about the llvm-commits mailing list