forked from OSchip/llvm-project
parent
22c7a79a1d
commit
0544fe7287
|
@ -103,7 +103,7 @@ protected:
|
|||
/// Max. memset / memcpy size that is turned into rep/movs, rep/stos ops.
|
||||
///
|
||||
unsigned MaxInlineSizeThreshold;
|
||||
|
||||
|
||||
/// TargetTriple - What processor and OS we're targeting.
|
||||
Triple TargetTriple;
|
||||
|
||||
|
@ -166,23 +166,23 @@ public:
|
|||
bool hasVectorUAMem() const { return HasVectorUAMem; }
|
||||
|
||||
bool isTargetDarwin() const { return TargetTriple.getOS() == Triple::Darwin; }
|
||||
|
||||
|
||||
// ELF is a reasonably sane default and the only other X86 targets we
|
||||
// support are Darwin and Windows. Just use "not those".
|
||||
bool isTargetELF() const {
|
||||
bool isTargetELF() const {
|
||||
return !isTargetDarwin() && !isTargetWindows() && !isTargetCygMing();
|
||||
}
|
||||
bool isTargetLinux() const { return TargetTriple.getOS() == Triple::Linux; }
|
||||
|
||||
bool isTargetWindows() const { return TargetTriple.getOS() == Triple::Win32; }
|
||||
bool isTargetMingw() const {
|
||||
bool isTargetMingw() const {
|
||||
return TargetTriple.getOS() == Triple::MinGW32 ||
|
||||
TargetTriple.getOS() == Triple::MinGW64; }
|
||||
bool isTargetCygwin() const { return TargetTriple.getOS() == Triple::Cygwin; }
|
||||
bool isTargetCygMing() const {
|
||||
return isTargetMingw() || isTargetCygwin();
|
||||
}
|
||||
|
||||
|
||||
/// isTargetCOFF - Return true if this is any COFF/Windows target variant.
|
||||
bool isTargetCOFF() const {
|
||||
return isTargetMingw() || isTargetCygwin() || isTargetWindows();
|
||||
|
|
|
@ -65,7 +65,7 @@ static MCStreamer *createMCStreamer(const Target &T, const std::string &TT,
|
|||
}
|
||||
}
|
||||
|
||||
extern "C" void LLVMInitializeX86Target() {
|
||||
extern "C" void LLVMInitializeX86Target() {
|
||||
// Register the target.
|
||||
RegisterTargetMachine<X86_32TargetMachine> X(TheX86_32Target);
|
||||
RegisterTargetMachine<X86_64TargetMachine> Y(TheX86_64Target);
|
||||
|
@ -122,7 +122,7 @@ X86_64TargetMachine::X86_64TargetMachine(const Target &T, const std::string &TT,
|
|||
|
||||
/// X86TargetMachine ctor - Create an X86 target.
|
||||
///
|
||||
X86TargetMachine::X86TargetMachine(const Target &T, const std::string &TT,
|
||||
X86TargetMachine::X86TargetMachine(const Target &T, const std::string &TT,
|
||||
const std::string &FS, bool is64Bit)
|
||||
: LLVMTargetMachine(T, TT),
|
||||
Subtarget(TT, FS, is64Bit),
|
||||
|
@ -234,12 +234,12 @@ bool X86TargetMachine::addCodeEmitter(PassManagerBase &PM,
|
|||
JITCodeEmitter &JCE) {
|
||||
// FIXME: Move this to TargetJITInfo!
|
||||
// On Darwin, do not override 64-bit setting made in X86TargetMachine().
|
||||
if (DefRelocModel == Reloc::Default &&
|
||||
if (DefRelocModel == Reloc::Default &&
|
||||
(!Subtarget.isTargetDarwin() || !Subtarget.is64Bit())) {
|
||||
setRelocationModel(Reloc::Static);
|
||||
Subtarget.setPICStyle(PICStyles::None);
|
||||
}
|
||||
|
||||
|
||||
|
||||
PM.add(createX86JITCodeEmitterPass(*this, JCE));
|
||||
|
||||
|
|
Loading…
Reference in New Issue