mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-12 07:37:34 +00:00
Provide TargetMachine implementations with reference to Target they were created
from. - This commit is almost entirely propogating the reference through the TargetMachine subclasses' constructor calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75778 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c3493cca4c
commit
03f4bc5d6c
include/llvm/Target
lib/Target
@ -19,6 +19,7 @@
|
||||
|
||||
namespace llvm {
|
||||
|
||||
class Target;
|
||||
class TargetAsmInfo;
|
||||
class TargetData;
|
||||
class TargetSubtarget;
|
||||
@ -99,11 +100,14 @@ class TargetMachine {
|
||||
TargetMachine(const TargetMachine &); // DO NOT IMPLEMENT
|
||||
void operator=(const TargetMachine &); // DO NOT IMPLEMENT
|
||||
protected: // Can only create subclasses.
|
||||
TargetMachine();
|
||||
TargetMachine(const Target &);
|
||||
|
||||
/// getSubtargetImpl - virtual method implemented by subclasses that returns
|
||||
/// a reference to that target's TargetSubtarget-derived member variable.
|
||||
virtual const TargetSubtarget *getSubtargetImpl() const { return 0; }
|
||||
|
||||
/// TheTarget - The Target that this machine was created for.
|
||||
const Target &TheTarget;
|
||||
|
||||
/// AsmInfo - Contains target specific asm information.
|
||||
///
|
||||
@ -129,6 +133,8 @@ public:
|
||||
/// will not be used unless an explicit -march option is used.
|
||||
static unsigned getJITMatchQuality() { return 0; }
|
||||
|
||||
const Target &getTarget() const { return TheTarget; }
|
||||
|
||||
// Interfaces to the major aspects of target machine information:
|
||||
// -- Instruction opcode and operand information
|
||||
// -- Pipelines and scheduling information
|
||||
@ -308,7 +314,7 @@ public:
|
||||
///
|
||||
class LLVMTargetMachine : public TargetMachine {
|
||||
protected: // Can only create subclasses.
|
||||
LLVMTargetMachine() { }
|
||||
LLVMTargetMachine(const Target &T) : TargetMachine(T) { }
|
||||
|
||||
/// addCommonCodeGenPasses - Add standard LLVM codegen passes used for
|
||||
/// both emitting to assembly files or machine code output.
|
||||
|
@ -73,8 +73,9 @@ namespace llvm {
|
||||
TargetMachineRegistry::entry Entry;
|
||||
TargetMachineRegistry::node Node;
|
||||
|
||||
static TargetMachine *Allocator(const Module &M, const std::string &FS) {
|
||||
return new TargetMachineImpl(M, FS);
|
||||
static TargetMachine *Allocator(const Target &T, const Module &M,
|
||||
const std::string &FS) {
|
||||
return new TargetMachineImpl(T, M, FS);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -42,7 +42,8 @@ namespace llvm {
|
||||
typedef unsigned (*ModuleMatchQualityFnTy)(const Module &M);
|
||||
typedef unsigned (*JITMatchQualityFnTy)();
|
||||
|
||||
typedef TargetMachine *(*TargetMachineCtorTy)(const Module &,
|
||||
typedef TargetMachine *(*TargetMachineCtorTy)(const Target &,
|
||||
const Module &,
|
||||
const std::string &);
|
||||
typedef FunctionPass *(*AsmPrinterCtorTy)(formatted_raw_ostream &,
|
||||
TargetMachine &,
|
||||
@ -96,7 +97,7 @@ namespace llvm {
|
||||
const std::string &Features) const {
|
||||
if (!TargetMachineCtorFn)
|
||||
return 0;
|
||||
return TargetMachineCtorFn(M, Features);
|
||||
return TargetMachineCtorFn(*this, M, Features);
|
||||
}
|
||||
|
||||
/// createAsmPrinter - Create a target specific assembly printer pass.
|
||||
|
@ -79,26 +79,30 @@ unsigned ThumbTargetMachine::getModuleMatchQuality(const Module &M) {
|
||||
|
||||
/// TargetMachine ctor - Create an ARM architecture model.
|
||||
///
|
||||
ARMBaseTargetMachine::ARMBaseTargetMachine(const Module &M,
|
||||
ARMBaseTargetMachine::ARMBaseTargetMachine(const Target &T,
|
||||
const Module &M,
|
||||
const std::string &FS,
|
||||
bool isThumb)
|
||||
: Subtarget(M, FS, isThumb),
|
||||
: LLVMTargetMachine(T),
|
||||
Subtarget(M, FS, isThumb),
|
||||
FrameInfo(Subtarget),
|
||||
JITInfo(),
|
||||
InstrItins(Subtarget.getInstrItineraryData()) {
|
||||
DefRelocModel = getRelocationModel();
|
||||
}
|
||||
|
||||
ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS)
|
||||
: ARMBaseTargetMachine(M, FS, false), InstrInfo(Subtarget),
|
||||
ARMTargetMachine::ARMTargetMachine(const Target &T, const Module &M,
|
||||
const std::string &FS)
|
||||
: ARMBaseTargetMachine(T, M, FS, false), InstrInfo(Subtarget),
|
||||
DataLayout(Subtarget.isAPCS_ABI() ?
|
||||
std::string("e-p:32:32-f64:32:32-i64:32:32") :
|
||||
std::string("e-p:32:32-f64:64:64-i64:64:64")),
|
||||
TLInfo(*this) {
|
||||
}
|
||||
|
||||
ThumbTargetMachine::ThumbTargetMachine(const Module &M, const std::string &FS)
|
||||
: ARMBaseTargetMachine(M, FS, true),
|
||||
ThumbTargetMachine::ThumbTargetMachine(const Target &T, const Module &M,
|
||||
const std::string &FS)
|
||||
: ARMBaseTargetMachine(T, M, FS, true),
|
||||
DataLayout(Subtarget.isAPCS_ABI() ?
|
||||
std::string("e-p:32:32-f64:32:32-i64:32:32-"
|
||||
"i16:16:32-i8:8:32-i1:8:32-a:0:32") :
|
||||
|
@ -47,7 +47,8 @@ protected:
|
||||
static AsmPrinterCtorFn AsmPrinterCtor;
|
||||
|
||||
public:
|
||||
ARMBaseTargetMachine(const Module &M, const std::string &FS, bool isThumb);
|
||||
ARMBaseTargetMachine(const Target &T, const Module &M, const std::string &FS,
|
||||
bool isThumb);
|
||||
|
||||
virtual const ARMFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
||||
virtual ARMJITInfo *getJITInfo() { return &JITInfo; }
|
||||
@ -99,7 +100,7 @@ class ARMTargetMachine : public ARMBaseTargetMachine {
|
||||
const TargetData DataLayout; // Calculates type size & alignment
|
||||
ARMTargetLowering TLInfo;
|
||||
public:
|
||||
ARMTargetMachine(const Module &M, const std::string &FS);
|
||||
ARMTargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
virtual const ARMRegisterInfo *getRegisterInfo() const {
|
||||
return &InstrInfo.getRegisterInfo();
|
||||
@ -125,7 +126,7 @@ class ThumbTargetMachine : public ARMBaseTargetMachine {
|
||||
const TargetData DataLayout; // Calculates type size & alignment
|
||||
ARMTargetLowering TLInfo;
|
||||
public:
|
||||
ThumbTargetMachine(const Module &M, const std::string &FS);
|
||||
ThumbTargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
/// returns either Thumb1RegisterInfo of Thumb2RegisterInfo
|
||||
virtual const ARMBaseRegisterInfo *getRegisterInfo() const {
|
||||
|
@ -63,8 +63,10 @@ unsigned AlphaTargetMachine::getJITMatchQuality() {
|
||||
#endif
|
||||
}
|
||||
|
||||
AlphaTargetMachine::AlphaTargetMachine(const Module &M, const std::string &FS)
|
||||
: DataLayout("e-f128:128:128"),
|
||||
AlphaTargetMachine::AlphaTargetMachine(const Target &T, const Module &M,
|
||||
const std::string &FS)
|
||||
: LLVMTargetMachine(T),
|
||||
DataLayout("e-f128:128:128"),
|
||||
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
|
||||
JITInfo(*this),
|
||||
Subtarget(M, FS),
|
||||
|
@ -45,7 +45,7 @@ protected:
|
||||
static AsmPrinterCtorFn AsmPrinterCtor;
|
||||
|
||||
public:
|
||||
AlphaTargetMachine(const Module &M, const std::string &FS);
|
||||
AlphaTargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
||||
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
||||
|
@ -22,8 +22,8 @@ namespace llvm {
|
||||
struct CTargetMachine : public TargetMachine {
|
||||
const TargetData DataLayout; // Calculates type size & alignment
|
||||
|
||||
CTargetMachine(const Module &M, const std::string &FS)
|
||||
: DataLayout(&M) {}
|
||||
CTargetMachine(const Target &T, const Module &M, const std::string &FS)
|
||||
: TargetMachine(T), DataLayout(&M) {}
|
||||
|
||||
virtual bool WantsWholeFile() const { return true; }
|
||||
virtual bool addPassesToEmitWholeFile(PassManager &PM,
|
||||
|
@ -62,8 +62,10 @@ SPUTargetMachine::getModuleMatchQuality(const Module &M)
|
||||
return 0; // No match at all...
|
||||
}
|
||||
|
||||
SPUTargetMachine::SPUTargetMachine(const Module &M, const std::string &FS)
|
||||
: Subtarget(*this, M, FS),
|
||||
SPUTargetMachine::SPUTargetMachine(const Target &T, const Module &M,
|
||||
const std::string &FS)
|
||||
: LLVMTargetMachine(T),
|
||||
Subtarget(*this, M, FS),
|
||||
DataLayout(Subtarget.getTargetDataString()),
|
||||
InstrInfo(*this),
|
||||
FrameInfo(*this),
|
||||
|
@ -47,7 +47,7 @@ protected:
|
||||
static AsmPrinterCtorFn AsmPrinterCtor;
|
||||
|
||||
public:
|
||||
SPUTargetMachine(const Module &M, const std::string &FS);
|
||||
SPUTargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
/// Return the subtarget implementation object
|
||||
virtual const SPUSubtarget *getSubtargetImpl() const {
|
||||
|
@ -24,8 +24,8 @@ class formatted_raw_ostream;
|
||||
struct CPPTargetMachine : public TargetMachine {
|
||||
const TargetData DataLayout; // Calculates type size & alignment
|
||||
|
||||
CPPTargetMachine(const Module &M, const std::string &FS)
|
||||
: DataLayout(&M) {}
|
||||
CPPTargetMachine(const Target &T, const Module &M, const std::string &FS)
|
||||
: TargetMachine(T), DataLayout(&M) {}
|
||||
|
||||
virtual bool WantsWholeFile() const { return true; }
|
||||
virtual bool addPassesToEmitWholeFile(PassManager &PM,
|
||||
|
@ -62,8 +62,10 @@ unsigned IA64TargetMachine::getModuleMatchQuality(const Module &M) {
|
||||
|
||||
/// IA64TargetMachine ctor - Create an LP64 architecture model
|
||||
///
|
||||
IA64TargetMachine::IA64TargetMachine(const Module &M, const std::string &FS)
|
||||
: DataLayout("e-f80:128:128"),
|
||||
IA64TargetMachine::IA64TargetMachine(const Target &T, const Module &M,
|
||||
const std::string &FS)
|
||||
: LLVMTargetMachine(T),
|
||||
DataLayout("e-f80:128:128"),
|
||||
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
|
||||
TLInfo(*this) { // FIXME? check this stuff
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ protected:
|
||||
static AsmPrinterCtorFn AsmPrinterCtor;
|
||||
|
||||
public:
|
||||
IA64TargetMachine(const Module &M, const std::string &FS);
|
||||
IA64TargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
virtual const IA64InstrInfo *getInstrInfo() const { return &InstrInfo; }
|
||||
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
||||
|
@ -31,8 +31,8 @@ namespace {
|
||||
struct VISIBILITY_HIDDEN MSILTarget : public TargetMachine {
|
||||
const TargetData DataLayout; // Calculates type size & alignment
|
||||
|
||||
MSILTarget(const Module &M, const std::string &FS)
|
||||
: DataLayout(&M) {}
|
||||
MSILTarget(const Target &T, const Module &M, const std::string &FS)
|
||||
: TargetMachine(T), DataLayout(&M) {}
|
||||
|
||||
virtual bool WantsWholeFile() const { return true; }
|
||||
virtual bool addPassesToEmitWholeFile(PassManager &PM,
|
||||
|
@ -39,8 +39,10 @@ X(TheMSP430Target, "msp430", "MSP430 [experimental]");
|
||||
// Force static initialization.
|
||||
extern "C" void LLVMInitializeMSP430Target() { }
|
||||
|
||||
MSP430TargetMachine::MSP430TargetMachine(const Module &M,
|
||||
MSP430TargetMachine::MSP430TargetMachine(const Target &T,
|
||||
const Module &M,
|
||||
const std::string &FS) :
|
||||
LLVMTargetMachine(T),
|
||||
Subtarget(*this, M, FS),
|
||||
// FIXME: Check TargetData string.
|
||||
DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"),
|
||||
|
@ -41,7 +41,7 @@ protected:
|
||||
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
||||
|
||||
public:
|
||||
MSP430TargetMachine(const Module &M, const std::string &FS);
|
||||
MSP430TargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
||||
virtual const MSP430InstrInfo *getInstrInfo() const { return &InstrInfo; }
|
||||
|
@ -55,7 +55,9 @@ createTargetAsmInfo() const
|
||||
// an easier handling.
|
||||
// Using CodeModel::Large enables different CALL behavior.
|
||||
MipsTargetMachine::
|
||||
MipsTargetMachine(const Module &M, const std::string &FS, bool isLittle=false):
|
||||
MipsTargetMachine(const Target &T, const Module &M, const std::string &FS,
|
||||
bool isLittle=false):
|
||||
LLVMTargetMachine(T),
|
||||
Subtarget(*this, M, FS, isLittle),
|
||||
DataLayout(isLittle ? std::string("e-p:32:32:32-i8:8:32-i16:16:32") :
|
||||
std::string("E-p:32:32:32-i8:8:32-i16:16:32")),
|
||||
@ -74,8 +76,8 @@ MipsTargetMachine(const Module &M, const std::string &FS, bool isLittle=false):
|
||||
}
|
||||
|
||||
MipselTargetMachine::
|
||||
MipselTargetMachine(const Module &M, const std::string &FS) :
|
||||
MipsTargetMachine(M, FS, true) {}
|
||||
MipselTargetMachine(const Target &T, const Module &M, const std::string &FS) :
|
||||
MipsTargetMachine(T, M, FS, true) {}
|
||||
|
||||
// return 0 and must specify -march to gen MIPS code.
|
||||
unsigned MipsTargetMachine::
|
||||
|
@ -43,7 +43,8 @@ namespace llvm {
|
||||
static AsmPrinterCtorFn AsmPrinterCtor;
|
||||
|
||||
public:
|
||||
MipsTargetMachine(const Module &M, const std::string &FS, bool isLittle);
|
||||
MipsTargetMachine(const Target &T, const Module &M, const std::string &FS,
|
||||
bool isLittle);
|
||||
|
||||
static void registerAsmPrinter(AsmPrinterCtorFn F) {
|
||||
AsmPrinterCtor = F;
|
||||
@ -82,7 +83,7 @@ namespace llvm {
|
||||
///
|
||||
class MipselTargetMachine : public MipsTargetMachine {
|
||||
public:
|
||||
MipselTargetMachine(const Module &M, const std::string &FS);
|
||||
MipselTargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
static unsigned getModuleMatchQuality(const Module &M);
|
||||
};
|
||||
|
@ -44,17 +44,19 @@ Y(TheCooperTarget, "cooper", "PIC16 Cooper [experimental].");
|
||||
extern "C" void LLVMInitializePIC16Target() { }
|
||||
|
||||
// PIC16TargetMachine - Traditional PIC16 Machine.
|
||||
PIC16TargetMachine::PIC16TargetMachine(const Module &M, const std::string &FS,
|
||||
bool Cooper)
|
||||
: Subtarget(M, FS, Cooper),
|
||||
PIC16TargetMachine::PIC16TargetMachine(const Target &T, const Module &M,
|
||||
const std::string &FS, bool Cooper)
|
||||
: LLVMTargetMachine(T),
|
||||
Subtarget(M, FS, Cooper),
|
||||
DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"),
|
||||
InstrInfo(*this), TLInfo(*this),
|
||||
FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0) { }
|
||||
|
||||
// CooperTargetMachine - Uses the same PIC16TargetMachine, but makes IsCooper
|
||||
// as true.
|
||||
CooperTargetMachine::CooperTargetMachine(const Module &M, const std::string &FS)
|
||||
: PIC16TargetMachine(M, FS, true) {}
|
||||
CooperTargetMachine::CooperTargetMachine(const Target &T, const Module &M,
|
||||
const std::string &FS)
|
||||
: PIC16TargetMachine(T, M, FS, true) {}
|
||||
|
||||
|
||||
const TargetAsmInfo *PIC16TargetMachine::createTargetAsmInfo() const {
|
||||
|
@ -41,7 +41,7 @@ protected:
|
||||
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
||||
|
||||
public:
|
||||
PIC16TargetMachine(const Module &M, const std::string &FS,
|
||||
PIC16TargetMachine(const Target &T, const Module &M, const std::string &FS,
|
||||
bool Cooper = false);
|
||||
|
||||
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
||||
@ -68,7 +68,7 @@ public:
|
||||
/// CooperTargetMachine
|
||||
class CooperTargetMachine : public PIC16TargetMachine {
|
||||
public:
|
||||
CooperTargetMachine(const Module &M, const std::string &FS);
|
||||
CooperTargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
}; // CooperTargetMachine.
|
||||
|
||||
} // end namespace llvm
|
||||
|
@ -102,9 +102,10 @@ unsigned PPC64TargetMachine::getModuleMatchQuality(const Module &M) {
|
||||
}
|
||||
|
||||
|
||||
PPCTargetMachine::PPCTargetMachine(const Module &M, const std::string &FS,
|
||||
bool is64Bit)
|
||||
: Subtarget(*this, M, FS, is64Bit),
|
||||
PPCTargetMachine::PPCTargetMachine(const Target&T, const Module &M,
|
||||
const std::string &FS, bool is64Bit)
|
||||
: LLVMTargetMachine(T),
|
||||
Subtarget(*this, M, FS, is64Bit),
|
||||
DataLayout(Subtarget.getTargetDataString()), InstrInfo(*this),
|
||||
FrameInfo(*this, is64Bit), JITInfo(*this, is64Bit), TLInfo(*this),
|
||||
InstrItins(Subtarget.getInstrItineraryData()), MachOWriterInfo(*this) {
|
||||
@ -121,13 +122,15 @@ PPCTargetMachine::PPCTargetMachine(const Module &M, const std::string &FS,
|
||||
/// groups, which typically degrades performance.
|
||||
bool PPCTargetMachine::getEnableTailMergeDefault() const { return false; }
|
||||
|
||||
PPC32TargetMachine::PPC32TargetMachine(const Module &M, const std::string &FS)
|
||||
: PPCTargetMachine(M, FS, false) {
|
||||
PPC32TargetMachine::PPC32TargetMachine(const Target &T, const Module &M,
|
||||
const std::string &FS)
|
||||
: PPCTargetMachine(T, M, FS, false) {
|
||||
}
|
||||
|
||||
|
||||
PPC64TargetMachine::PPC64TargetMachine(const Module &M, const std::string &FS)
|
||||
: PPCTargetMachine(M, FS, true) {
|
||||
PPC64TargetMachine::PPC64TargetMachine(const Target &T, const Module &M,
|
||||
const std::string &FS)
|
||||
: PPCTargetMachine(T, M, FS, true) {
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,7 +50,8 @@ protected:
|
||||
static AsmPrinterCtorFn AsmPrinterCtor;
|
||||
|
||||
public:
|
||||
PPCTargetMachine(const Module &M, const std::string &FS, bool is64Bit);
|
||||
PPCTargetMachine(const Target &T, const Module &M, const std::string &FS,
|
||||
bool is64Bit);
|
||||
|
||||
virtual const PPCInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
||||
virtual const PPCFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
||||
@ -103,7 +104,7 @@ public:
|
||||
///
|
||||
class PPC32TargetMachine : public PPCTargetMachine {
|
||||
public:
|
||||
PPC32TargetMachine(const Module &M, const std::string &FS);
|
||||
PPC32TargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
static unsigned getJITMatchQuality();
|
||||
static unsigned getModuleMatchQuality(const Module &M);
|
||||
@ -113,7 +114,7 @@ public:
|
||||
///
|
||||
class PPC64TargetMachine : public PPCTargetMachine {
|
||||
public:
|
||||
PPC64TargetMachine(const Module &M, const std::string &FS);
|
||||
PPC64TargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
static unsigned getJITMatchQuality();
|
||||
static unsigned getModuleMatchQuality(const Module &M);
|
||||
|
@ -36,8 +36,10 @@ const TargetAsmInfo *SparcTargetMachine::createTargetAsmInfo() const {
|
||||
|
||||
/// SparcTargetMachine ctor - Create an ILP32 architecture model
|
||||
///
|
||||
SparcTargetMachine::SparcTargetMachine(const Module &M, const std::string &FS)
|
||||
: DataLayout("E-p:32:32-f128:128:128"),
|
||||
SparcTargetMachine::SparcTargetMachine(const Target &T, const Module &M,
|
||||
const std::string &FS)
|
||||
: LLVMTargetMachine(T),
|
||||
DataLayout("E-p:32:32-f128:128:128"),
|
||||
Subtarget(M, FS), TLInfo(*this), InstrInfo(Subtarget),
|
||||
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) {
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ protected:
|
||||
static AsmPrinterCtorFn AsmPrinterCtor;
|
||||
|
||||
public:
|
||||
SparcTargetMachine(const Module &M, const std::string &FS);
|
||||
SparcTargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
||||
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
||||
|
@ -176,8 +176,8 @@ EnableStrongPHIElim(cl::Hidden, "strong-phi-elim",
|
||||
// TargetMachine Class
|
||||
//
|
||||
|
||||
TargetMachine::TargetMachine()
|
||||
: AsmInfo(0) {
|
||||
TargetMachine::TargetMachine(const Target &T)
|
||||
: TheTarget(T), AsmInfo(0) {
|
||||
// Typically it will be subtargets that will adjust FloatABIType from Default
|
||||
// to Soft or Hard.
|
||||
if (UseSoftFloat)
|
||||
|
@ -124,20 +124,23 @@ unsigned X86_64TargetMachine::getModuleMatchQuality(const Module &M) {
|
||||
return getJITMatchQuality()/2;
|
||||
}
|
||||
|
||||
X86_32TargetMachine::X86_32TargetMachine(const Module &M, const std::string &FS)
|
||||
: X86TargetMachine(M, FS, false) {
|
||||
X86_32TargetMachine::X86_32TargetMachine(const Target &T, const Module &M,
|
||||
const std::string &FS)
|
||||
: X86TargetMachine(T, M, FS, false) {
|
||||
}
|
||||
|
||||
|
||||
X86_64TargetMachine::X86_64TargetMachine(const Module &M, const std::string &FS)
|
||||
: X86TargetMachine(M, FS, true) {
|
||||
X86_64TargetMachine::X86_64TargetMachine(const Target &T, const Module &M,
|
||||
const std::string &FS)
|
||||
: X86TargetMachine(T, M, FS, true) {
|
||||
}
|
||||
|
||||
/// X86TargetMachine ctor - Create an X86 target.
|
||||
///
|
||||
X86TargetMachine::X86TargetMachine(const Module &M, const std::string &FS,
|
||||
bool is64Bit)
|
||||
: Subtarget(M, FS, is64Bit),
|
||||
X86TargetMachine::X86TargetMachine(const Target &T, const Module &M,
|
||||
const std::string &FS, bool is64Bit)
|
||||
: LLVMTargetMachine(T),
|
||||
Subtarget(M, FS, is64Bit),
|
||||
DataLayout(Subtarget.getDataLayout()),
|
||||
FrameInfo(TargetFrameInfo::StackGrowsDown,
|
||||
Subtarget.getStackAlignment(), Subtarget.is64Bit() ? -8 : -4),
|
||||
|
@ -49,7 +49,8 @@ protected:
|
||||
static AsmPrinterCtorFn AsmPrinterCtor;
|
||||
|
||||
public:
|
||||
X86TargetMachine(const Module &M, const std::string &FS, bool is64Bit);
|
||||
X86TargetMachine(const Target &T, const Module &M, const std::string &FS,
|
||||
bool is64Bit);
|
||||
|
||||
virtual const X86InstrInfo *getInstrInfo() const { return &InstrInfo; }
|
||||
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
||||
@ -101,7 +102,7 @@ public:
|
||||
///
|
||||
class X86_32TargetMachine : public X86TargetMachine {
|
||||
public:
|
||||
X86_32TargetMachine(const Module &M, const std::string &FS);
|
||||
X86_32TargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
static unsigned getJITMatchQuality();
|
||||
static unsigned getModuleMatchQuality(const Module &M);
|
||||
@ -111,7 +112,7 @@ public:
|
||||
///
|
||||
class X86_64TargetMachine : public X86TargetMachine {
|
||||
public:
|
||||
X86_64TargetMachine(const Module &M, const std::string &FS);
|
||||
X86_64TargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
static unsigned getJITMatchQuality();
|
||||
static unsigned getModuleMatchQuality(const Module &M);
|
||||
|
@ -41,8 +41,10 @@ const TargetAsmInfo *XCoreTargetMachine::createTargetAsmInfo() const {
|
||||
|
||||
/// XCoreTargetMachine ctor - Create an ILP32 architecture model
|
||||
///
|
||||
XCoreTargetMachine::XCoreTargetMachine(const Module &M, const std::string &FS)
|
||||
: Subtarget(*this, M, FS),
|
||||
XCoreTargetMachine::XCoreTargetMachine(const Target &T, const Module &M,
|
||||
const std::string &FS)
|
||||
: LLVMTargetMachine(T),
|
||||
Subtarget(*this, M, FS),
|
||||
DataLayout("e-p:32:32:32-a0:0:32-f32:32:32-f64:32:32-i1:8:32-i8:8:32-"
|
||||
"i16:16:32-i32:32:32-i64:32:32"),
|
||||
InstrInfo(),
|
||||
|
@ -36,7 +36,7 @@ protected:
|
||||
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
||||
|
||||
public:
|
||||
XCoreTargetMachine(const Module &M, const std::string &FS);
|
||||
XCoreTargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
virtual const XCoreInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
||||
virtual const XCoreFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user