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
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 {
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 {
#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>
// 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;
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);
// 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;