aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/X86TargetMachine.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-02-22 20:19:42 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-02-22 20:19:42 +0000
commit4c1aa866578f7a358407a22fe55b454f52a24325 (patch)
treef5c6f24b1fedfb42a7024b7ba4c0aa5f21280c8b /lib/Target/X86/X86TargetMachine.cpp
parent0420f2aaf9551a10e2060d076de2fcdd7b316370 (diff)
downloadexternal_llvm-4c1aa866578f7a358407a22fe55b454f52a24325.zip
external_llvm-4c1aa866578f7a358407a22fe55b454f52a24325.tar.gz
external_llvm-4c1aa866578f7a358407a22fe55b454f52a24325.tar.bz2
- Added option -relocation-model to set relocation model. Valid values include static, pic,
dynamic-no-pic, and default. PPC and x86 default is dynamic-no-pic for Darwin, pic for others. - Removed options -enable-pic and -ppc-static. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26315 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r--lib/Target/X86/X86TargetMachine.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp
index f24e1b0..8adce31 100644
--- a/lib/Target/X86/X86TargetMachine.cpp
+++ b/lib/Target/X86/X86TargetMachine.cpp
@@ -76,6 +76,11 @@ X86TargetMachine::X86TargetMachine(const Module &M,
FrameInfo(TargetFrameInfo::StackGrowsDown,
Subtarget.getStackAlignment(), -4),
JITInfo(*this) {
+ if (getRelocationModel() == Reloc::Default)
+ if (Subtarget.isTargetDarwin())
+ setRelocationModel(Reloc::DynamicNoPIC);
+ else
+ setRelocationModel(Reloc::PIC);
}
@@ -149,8 +154,8 @@ bool X86TargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &Out,
/// not supported for this target.
///
void X86JITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
- // The JIT does not support or need PIC.
- PICEnabled = false;
+ // The JIT should use static relocation model.
+ TM.setRelocationModel(Reloc::Static);
// FIXME: Implement efficient support for garbage collection intrinsics.
PM.add(createLowerGCPass());