#include "ARMSubtarget.h"
#include "ARMGenSubtarget.inc"
-#include "llvm/Module.h"
-#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Support/CommandLine.h"
using namespace llvm;
ReserveR9("arm-reserve-r9", cl::Hidden,
cl::desc("Reserve R9, making it unavailable as GPR"));
-ARMSubtarget::ARMSubtarget(const Module &M, const std::string &FS,
+ARMSubtarget::ARMSubtarget(const std::string &TT, const std::string &FS,
bool isThumb)
: ARMArchVersion(V4T)
, ARMFPUType(None)
// Set the boolean corresponding to the current target triple, or the default
// if one cannot be determined, to true.
- const std::string& TT = M.getTargetTriple();
unsigned Len = TT.length();
unsigned Idx = 0;
#include <string>
namespace llvm {
-class Module;
class ARMSubtarget : public TargetSubtarget {
protected:
} TargetABI;
/// This constructor initializes the data members to match that
- /// of the specified module.
+ /// of the specified triple.
///
- ARMSubtarget(const Module &M, const std::string &FS, bool isThumb);
+ ARMSubtarget(const std::string &TT, const std::string &FS, bool isThumb);
/// getMaxInlineSizeThreshold - Returns the maximum memset / memcpy size
/// that still makes it profitable to inline the call.
const std::string &FS,
bool isThumb)
: LLVMTargetMachine(T),
- Subtarget(M, FS, isThumb),
+ Subtarget(M.getTargetTriple(), FS, isThumb),
FrameInfo(Subtarget),
JITInfo(),
InstrItins(Subtarget.getInstrItineraryData()) {
#include "AlphaGenSubtarget.inc"
using namespace llvm;
-AlphaSubtarget::AlphaSubtarget(const Module &M, const std::string &FS)
+AlphaSubtarget::AlphaSubtarget(const std::string &TT, const std::string &FS)
: HasCT(false) {
std::string CPU = "generic";
#include <string>
namespace llvm {
-class Module;
class AlphaSubtarget : public TargetSubtarget {
protected:
public:
/// This constructor initializes the data members to match that
- /// of the specified module.
+ /// of the specified triple.
///
- AlphaSubtarget(const Module &M, const std::string &FS);
+ AlphaSubtarget(const std::string &TT, const std::string &FS);
/// ParseSubtargetFeatures - Parses features string setting specified
/// subtarget options. Definition of function is auto generated by tblgen.
DataLayout("e-f128:128:128"),
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
JITInfo(*this),
- Subtarget(M, FS),
+ Subtarget(M.getTargetTriple(), FS),
TLInfo(*this) {
setRelocationModel(Reloc::PIC_);
}
using namespace llvm;
-BlackfinSubtarget::BlackfinSubtarget(const TargetMachine &TM,
- const Module &M,
+BlackfinSubtarget::BlackfinSubtarget(const std::string &TT,
const std::string &FS)
: sdram(false),
icplb(false),
namespace llvm {
- class TargetMachine;
- class Module;
-
class BlackfinSubtarget : public TargetSubtarget {
bool sdram;
bool icplb;
bool wa_killed_mmr;
bool wa_rets;
public:
- BlackfinSubtarget(const TargetMachine &TM, const Module &M,
- const std::string &FS);
+ BlackfinSubtarget(const std::string &TT, const std::string &FS);
/// ParseSubtargetFeatures - Parses features string setting specified
/// subtarget options. Definition of function is auto generated by tblgen.
const std::string &FS)
: LLVMTargetMachine(T),
DataLayout("e-p:32:32-i64:32-f64:32"),
- Subtarget(*this, M, FS),
+ Subtarget(M.getTargetTriple(), FS),
TLInfo(*this),
InstrInfo(Subtarget),
FrameInfo(TargetFrameInfo::StackGrowsDown, 4, 0) {
#include "SPUSubtarget.h"
#include "SPU.h"
-#include "llvm/Module.h"
-#include "llvm/Target/TargetMachine.h"
#include "SPUGenSubtarget.inc"
using namespace llvm;
-SPUSubtarget::SPUSubtarget(const TargetMachine &tm, const Module &M,
- const std::string &FS) :
- TM(tm),
+SPUSubtarget::SPUSubtarget(const std::string &TT, const std::string &FS) :
StackAlignment(16),
ProcDirective(SPU::DEFAULT_PROC),
UseLargeMem(false)
#include <string>
namespace llvm {
- class Module;
class GlobalValue;
- class TargetMachine;
namespace SPU {
enum {
class SPUSubtarget : public TargetSubtarget {
protected:
- const TargetMachine &TM;
-
/// stackAlignment - The minimum alignment known to hold of the stack frame
/// on entry to the function and which must be maintained by every function.
unsigned StackAlignment;
public:
/// This constructor initializes the data members to match that
- /// of the specified module.
+ /// of the specified triple.
///
- SPUSubtarget(const TargetMachine &TM, const Module &M,
- const std::string &FS);
+ SPUSubtarget(const std::string &TT, const std::string &FS);
/// ParseSubtargetFeatures - Parses features string setting specified
/// subtarget options. Definition of function is auto generated by tblgen.
SPUTargetMachine::SPUTargetMachine(const Target &T, const Module &M,
const std::string &FS)
: LLVMTargetMachine(T),
- Subtarget(*this, M, FS),
+ Subtarget(M.getTargetTriple(), FS),
DataLayout(Subtarget.getTargetDataString()),
InstrInfo(*this),
FrameInfo(*this),
#include "MSP430Subtarget.h"
#include "MSP430.h"
#include "MSP430GenSubtarget.inc"
-#include "llvm/Target/TargetMachine.h"
using namespace llvm;
-MSP430Subtarget::MSP430Subtarget(const TargetMachine &TM, const Module &M,
- const std::string &FS) {
+MSP430Subtarget::MSP430Subtarget(const std::string &TT, const std::string &FS) {
std::string CPU = "generic";
// Parse features string.
#include <string>
namespace llvm {
-class Module;
-class TargetMachine;
class MSP430Subtarget : public TargetSubtarget {
bool ExtendedInsts;
public:
/// This constructor initializes the data members to match that
- /// of the specified module.
+ /// of the specified triple.
///
- MSP430Subtarget(const TargetMachine &TM, const Module &M,
- const std::string &FS);
+ MSP430Subtarget(const std::string &TT, const std::string &FS);
/// ParseSubtargetFeatures - Parses features string setting specified
/// subtarget options. Definition of function is auto generated by tblgen.
const Module &M,
const std::string &FS) :
LLVMTargetMachine(T),
- Subtarget(*this, M, FS),
+ Subtarget(M.getTargetTriple(), FS),
// FIXME: Check TargetData string.
DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"),
InstrInfo(*this), TLInfo(*this),
#include "MipsSubtarget.h"
#include "Mips.h"
#include "MipsGenSubtarget.inc"
-#include "llvm/Module.h"
#include "llvm/Support/CommandLine.h"
using namespace llvm;
AbsoluteCall("enable-mips-absolute-call", cl::Hidden,
cl::desc("Enable absolute call within abicall"));
-MipsSubtarget::MipsSubtarget(const TargetMachine &TM, const Module &M,
+MipsSubtarget::MipsSubtarget(const TargetMachine &TM, const std::string &TT,
const std::string &FS, bool little) :
MipsArchVersion(Mips1), MipsABI(O32), IsLittle(little), IsSingleFloat(false),
IsFP64bit(false), IsGP64bit(false), HasVFPU(false), HasABICall(true),
// Parse features string.
ParseSubtargetFeatures(FS, CPU);
- const std::string& TT = M.getTargetTriple();
// Is the target system Linux ?
if (TT.find("linux") == std::string::npos)
#include <string>
namespace llvm {
-class Module;
class MipsSubtarget : public TargetSubtarget {
unsigned getTargetABI() const { return MipsABI; }
/// This constructor initializes the data members to match that
- /// of the specified module.
- MipsSubtarget(const TargetMachine &TM, const Module &M,
+ /// of the specified triple.
+ MipsSubtarget(const TargetMachine &TM, const std::string &TT,
const std::string &FS, bool little);
/// ParseSubtargetFeatures - Parses features string setting specified
MipsTargetMachine(const Target &T, const Module &M, const std::string &FS,
bool isLittle=false):
LLVMTargetMachine(T),
- Subtarget(*this, M, FS, isLittle),
+ Subtarget(*this, M.getTargetTriple(), 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")),
InstrInfo(*this),
using namespace llvm;
-PIC16Subtarget::PIC16Subtarget(const Module &M, const std::string &FS,
+PIC16Subtarget::PIC16Subtarget(const std::string &TT, const std::string &FS,
bool Cooper)
:IsCooper(Cooper)
{
#include <string>
namespace llvm {
-class Module;
class PIC16Subtarget : public TargetSubtarget {
public:
/// This constructor initializes the data members to match that
- /// of the specified module.
+ /// of the specified triple.
///
- PIC16Subtarget(const Module &M, const std::string &FS, bool Cooper);
+ PIC16Subtarget(const std::string &TT, const std::string &FS, bool Cooper);
/// isCooper - Returns true if the target ISA is Cooper.
bool isCooper() const { return IsCooper; }
PIC16TargetMachine::PIC16TargetMachine(const Target &T, const Module &M,
const std::string &FS, bool Cooper)
: LLVMTargetMachine(T),
- Subtarget(M, FS, Cooper),
+ Subtarget(M.getTargetTriple(), 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) { }
Lo = DAG.getNode(ISD::ADD, dl, PtrVT, Hi, Lo);
- if (!TM.getSubtarget<PPCSubtarget>().hasLazyResolverStub(GV))
+ if (!TM.getSubtarget<PPCSubtarget>().hasLazyResolverStub(GV, TM))
return Lo;
// If the global is weak or external, we have to go through the lazy
#include "PPCSubtarget.h"
#include "PPC.h"
-#include "llvm/Module.h"
+#include "llvm/GlobalValue.h"
#include "llvm/Target/TargetMachine.h"
#include "PPCGenSubtarget.inc"
#include <cstdlib>
#endif
-PPCSubtarget::PPCSubtarget(const TargetMachine &tm, const Module &M,
- const std::string &FS, bool is64Bit)
- : TM(tm)
- , StackAlignment(16)
+PPCSubtarget::PPCSubtarget(const std::string &TT, const std::string &FS,
+ bool is64Bit)
+ : StackAlignment(16)
, DarwinDirective(PPC::DIR_NONE)
, IsGigaProcessor(false)
, Has64BitSupport(false)
// Set the boolean corresponding to the current target triple, or the default
// if one cannot be determined, to true.
- const std::string &TT = M.getTargetTriple();
if (TT.length() > 7) {
// Determine which version of darwin this is.
size_t DarwinPos = TT.find("-darwin");
/// hasLazyResolverStub - Return true if accesses to the specified global have
/// to go through a dyld lazy resolution stub. This means that an extra load
/// is required to get the address of the global.
-bool PPCSubtarget::hasLazyResolverStub(const GlobalValue *GV) const {
+bool PPCSubtarget::hasLazyResolverStub(const GlobalValue *GV,
+ const TargetMachine &TM) const {
// We never hae stubs if HasLazyResolverStubs=false or if in static mode.
if (!HasLazyResolverStubs || TM.getRelocationModel() == Reloc::Static)
return false;
};
}
-class Module;
class GlobalValue;
class TargetMachine;
OldMnemonic, NewMnemonic, Unset
};
protected:
- const TargetMachine &TM;
-
/// stackAlignment - The minimum alignment known to hold of the stack frame on
/// entry to the function and which must be maintained by every function.
unsigned StackAlignment;
unsigned char DarwinVers; // Is any darwin-ppc platform.
public:
/// This constructor initializes the data members to match that
- /// of the specified module.
+ /// of the specified triple.
///
- PPCSubtarget(const TargetMachine &TM, const Module &M,
- const std::string &FS, bool is64Bit);
+ PPCSubtarget(const std::string &TT, const std::string &FS, bool is64Bit);
/// ParseSubtargetFeatures - Parses features string setting specified
/// subtarget options. Definition of function is auto generated by tblgen.
/// hasLazyResolverStub - Return true if accesses to the specified global have
/// to go through a dyld lazy resolution stub. This means that an extra load
/// is required to get the address of the global.
- bool hasLazyResolverStub(const GlobalValue *GV) const;
+ bool hasLazyResolverStub(const GlobalValue *GV,
+ const TargetMachine &TM) const;
// Specific obvious features.
bool hasFSQRT() const { return HasFSQRT; }
PPCTargetMachine::PPCTargetMachine(const Target&T, const Module &M,
const std::string &FS, bool is64Bit)
: LLVMTargetMachine(T),
- Subtarget(*this, M, FS, is64Bit),
+ Subtarget(M.getTargetTriple(), FS, is64Bit),
DataLayout(Subtarget.getTargetDataString()), InstrInfo(*this),
FrameInfo(*this, is64Bit), JITInfo(*this, is64Bit), TLInfo(*this),
InstrItins(Subtarget.getInstrItineraryData()), MachOWriterInfo(*this) {
cl::desc("Enable V9 instructions in the V8 target"));
}
-SparcSubtarget::SparcSubtarget(const Module &M, const std::string &FS) {
+SparcSubtarget::SparcSubtarget(const std::string &TT, const std::string &FS) {
// Set the default features.
IsV9 = false;
V8DeprecatedInsts = false;
#include <string>
namespace llvm {
- class Module;
-
+
class SparcSubtarget : public TargetSubtarget {
bool IsV9;
bool V8DeprecatedInsts;
bool IsVIS;
public:
- SparcSubtarget(const Module &M, const std::string &FS);
+ SparcSubtarget(const std::string &TT, const std::string &FS);
bool isV9() const { return IsV9; }
bool isVIS() const { return IsVIS; }
const std::string &FS)
: LLVMTargetMachine(T),
DataLayout("E-p:32:32-f128:128:128"),
- Subtarget(M, FS), TLInfo(*this), InstrInfo(Subtarget),
+ Subtarget(M.getTargetTriple(), FS), TLInfo(*this), InstrInfo(Subtarget),
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) {
}
using namespace llvm;
-SystemZSubtarget::SystemZSubtarget(const TargetMachine &TM, const Module &M,
+SystemZSubtarget::SystemZSubtarget(const std::string &TT,
const std::string &FS):
HasZ10Insts(false) {
std::string CPU = "z9";
#include <string>
namespace llvm {
-class Module;
-class TargetMachine;
class GlobalValue;
+class TargetMachine;
class SystemZSubtarget : public TargetSubtarget {
bool HasZ10Insts;
public:
/// This constructor initializes the data members to match that
- /// of the specified module.
+ /// of the specified triple.
///
- SystemZSubtarget(const TargetMachine &TM, const Module &M,
- const std::string &FS);
+ SystemZSubtarget(const std::string &TT, const std::string &FS);
/// ParseSubtargetFeatures - Parses features string setting specified
/// subtarget options. Definition of function is auto generated by tblgen.
const Module &M,
const std::string &FS)
: LLVMTargetMachine(T),
- Subtarget(*this, M, FS),
+ Subtarget(M.getTargetTriple(), FS),
DataLayout("E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
"-f64:64:64-f128:128:128-a0:16:16"),
InstrInfo(*this), TLInfo(*this),
#include "X86Subtarget.h"
#include "X86InstrInfo.h"
#include "X86GenSubtarget.inc"
-#include "llvm/Module.h"
+#include "llvm/GlobalValue.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Target/TargetMachine.h"
}
}
-X86Subtarget::X86Subtarget(const Module &M, const std::string &FS, bool is64Bit)
+X86Subtarget::X86Subtarget(const std::string &TT, const std::string &FS,
+ bool is64Bit)
: AsmFlavor(AsmWriterFlavor)
, PICStyle(PICStyles::None)
, X86SSELevel(NoMMXSSE)
// Set the boolean corresponding to the current target triple, or the default
// if one cannot be determined, to true.
- const std::string& TT = M.getTargetTriple();
if (TT.length() > 5) {
size_t Pos;
if ((Pos = TT.find("-darwin")) != std::string::npos) {
#include <string>
namespace llvm {
-class Module;
class GlobalValue;
class TargetMachine;
unsigned MaxInlineSizeThreshold;
private:
- /// Is64Bit - True if the processor supports 64-bit instructions and module
+ /// Is64Bit - True if the processor supports 64-bit instructions and
/// pointer size is 64 bit.
bool Is64Bit;
} TargetType;
/// This constructor initializes the data members to match that
- /// of the specified module.
+ /// of the specified triple.
///
- X86Subtarget(const Module &M, const std::string &FS, bool is64Bit);
+ X86Subtarget(const std::string &TT, const std::string &FS, bool is64Bit);
/// getStackAlignment - Returns the minimum alignment known to hold of the
/// stack frame on entry to the function and which must be maintained by every
X86TargetMachine::X86TargetMachine(const Target &T, const Module &M,
const std::string &FS, bool is64Bit)
: LLVMTargetMachine(T),
- Subtarget(M, FS, is64Bit),
+ Subtarget(M.getTargetTriple(), FS, is64Bit),
DataLayout(Subtarget.getDataLayout()),
FrameInfo(TargetFrameInfo::StackGrowsDown,
Subtarget.getStackAlignment(), Subtarget.is64Bit() ? -8 : -4),
#include "XCoreGenSubtarget.inc"
using namespace llvm;
-XCoreSubtarget::XCoreSubtarget(const TargetMachine &TM, const Module &M,
- const std::string &FS)
+XCoreSubtarget::XCoreSubtarget(const std::string &TT, const std::string &FS)
: IsXS1A(false),
IsXS1B(false)
{
#include <string>
namespace llvm {
-class Module;
class XCoreSubtarget : public TargetSubtarget {
bool IsXS1A;
public:
/// This constructor initializes the data members to match that
- /// of the specified module.
+ /// of the specified triple.
///
- XCoreSubtarget(const TargetMachine &TM, const Module &M,
- const std::string &FS);
+ XCoreSubtarget(const std::string &TT, const std::string &FS);
bool isXS1A() const { return IsXS1A; }
bool isXS1B() const { return IsXS1B; }
XCoreTargetMachine::XCoreTargetMachine(const Target &T, const Module &M,
const std::string &FS)
: LLVMTargetMachine(T),
- Subtarget(*this, M, FS),
+ Subtarget(M.getTargetTriple(), 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(),