aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-06-16 18:50:48 +0000
committerChris Lattner <sabre@nondot.org>2006-06-16 18:50:48 +0000
commitaf89fa609bce1004c9ea9737d9fdb32f4224ef1c (patch)
treea7e1d57530712f4f34717abcb53dd425a4d5b0e9
parentfb9d0dce976452f878e5bfd768f1ba35b182c33d (diff)
downloadexternal_llvm-af89fa609bce1004c9ea9737d9fdb32f4224ef1c.zip
external_llvm-af89fa609bce1004c9ea9737d9fdb32f4224ef1c.tar.gz
external_llvm-af89fa609bce1004c9ea9737d9fdb32f4224ef1c.tar.bz2
Remove the -darwin and -aix llc options, inferring darwinism and aixism from
the target triple & subtarget info. woo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28835 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/PowerPC/PPC.h7
-rw-r--r--lib/Target/PowerPC/PPCRegisterInfo.td4
-rw-r--r--lib/Target/PowerPC/PPCSubtarget.cpp18
-rw-r--r--lib/Target/PowerPC/PPCTargetMachine.cpp13
4 files changed, 7 insertions, 35 deletions
diff --git a/lib/Target/PowerPC/PPC.h b/lib/Target/PowerPC/PPC.h
index 88fc87e..fb64a93 100644
--- a/lib/Target/PowerPC/PPC.h
+++ b/lib/Target/PowerPC/PPC.h
@@ -21,17 +21,10 @@ namespace llvm {
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
diff --git a/lib/Target/PowerPC/PPCRegisterInfo.td b/lib/Target/PowerPC/PPCRegisterInfo.td
index 9cd2145..5c6ac24 100644
--- a/lib/Target/PowerPC/PPCRegisterInfo.td
+++ b/lib/Target/PowerPC/PPCRegisterInfo.td
@@ -215,7 +215,7 @@ def GPRC : RegisterClass<"PPC", [i32], 32,
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 @@ def G8RC : RegisterClass<"PPC", [i64], 64,
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 {
diff --git a/lib/Target/PowerPC/PPCSubtarget.cpp b/lib/Target/PowerPC/PPCSubtarget.cpp
index f7a9560..b909b5b 100644
--- a/lib/Target/PowerPC/PPCSubtarget.cpp
+++ b/lib/Target/PowerPC/PPCSubtarget.cpp
@@ -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 @@ PPCSubtarget::PPCSubtarget(const Module &M, const std::string &FS, bool is64Bit)
// 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;
diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
index 78ea481..e5ee33b 100644
--- a/lib/Target/PowerPC/PPCTargetMachine.cpp
+++ b/lib/Target/PowerPC/PPCTargetMachine.cpp
@@ -91,10 +91,6 @@ PPCTargetMachine::PPCTargetMachine(const Module &M, const std::string &FS,
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 @@ bool PPCTargetMachine::addPassesToEmitFile(PassManager &PM,
// 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;