diff options
author | Dale Johannesen <dalej@apple.com> | 2008-08-12 21:02:08 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-08-12 21:02:08 +0000 |
commit | 5f777192a0de98e636bc560c3187fbdac3614000 (patch) | |
tree | 60a6cf201c0689a00ad3634e85c81571b49f1f42 /lib/Target/X86/X86TargetMachine.cpp | |
parent | fe24bd3a89c44f9a16e3cbcf60c119dac88fad40 (diff) | |
download | external_llvm-5f777192a0de98e636bc560c3187fbdac3614000.zip external_llvm-5f777192a0de98e636bc560c3187fbdac3614000.tar.gz external_llvm-5f777192a0de98e636bc560c3187fbdac3614000.tar.bz2 |
Make x86-64 JIT changes Darwin-specific.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54700 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r-- | lib/Target/X86/X86TargetMachine.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index 8e10ee9..fdf9bdf 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -194,14 +194,20 @@ bool X86TargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, bool X86TargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE) { // FIXME: Move this to TargetJITInfo! - // Do not override 64-bit setting made in X86TargetMachine(). - if (DefRelocModel == Reloc::Default && !Subtarget.is64Bit()) + // On Darwin, do not override 64-bit setting made in X86TargetMachine(). + if (DefRelocModel == Reloc::Default && + (!Subtarget.isTargetDarwin() || !Subtarget.is64Bit())) setRelocationModel(Reloc::Static); // 64-bit JIT places everything in the same buffer except external functions. - // Use small code model but hack the call instruction for externals. - if (Subtarget.is64Bit()) - setCodeModel(CodeModel::Small); + // On Darwin, use small code model but hack the call instruction for + // externals. Elsewhere, do not assume globals are in the lower 4G. + if (Subtarget.is64Bit()) { + if (Subtarget.isTargetDarwin()) + setCodeModel(CodeModel::Small); + else + setCodeModel(CodeModel::Large); + } PM.add(createX86CodeEmitterPass(*this, MCE)); if (DumpAsm) |