diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-02-22 20:19:42 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-02-22 20:19:42 +0000 |
commit | 73136dfecceeadfd549d5ac2c00ed1df023e5b20 (patch) | |
tree | a6aab29afc7200b4253a7c278ee6c1c03fe69264 /llvm/lib/Target/PowerPC/PPCTargetMachine.cpp | |
parent | 2fa33a989dfd4bf53e282b73858f235651bc77a9 (diff) | |
download | bcm5719-llvm-73136dfecceeadfd549d5ac2c00ed1df023e5b20.tar.gz bcm5719-llvm-73136dfecceeadfd549d5ac2c00ed1df023e5b20.zip |
- 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.
llvm-svn: 26315
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCTargetMachine.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp index a58926ff7e8..9b5701b65e9 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -67,6 +67,11 @@ PPCTargetMachine::PPCTargetMachine(const Module &M, IntrinsicLowering *IL, if (Subtarget.isAIX()) PPCTarget = TargetAIX; if (Subtarget.isDarwin()) PPCTarget = TargetDarwin; } + if (getRelocationModel() == Reloc::Default) + if (Subtarget.isDarwin()) + setRelocationModel(Reloc::DynamicNoPIC); + else + setRelocationModel(Reloc::PIC); } /// addPassesToEmitFile - Add passes to the specified pass manager to implement @@ -129,8 +134,8 @@ bool PPCTargetMachine::addPassesToEmitFile(PassManager &PM, } void PPCJITInfo::addPassesToJITCompile(FunctionPassManager &PM) { - // The JIT does not support or need PIC. - PICEnabled = false; + // The JIT should use static relocation model. + TM.setRelocationModel(Reloc::Static); // Run loop strength reduction before anything else. PM.add(createLoopStrengthReducePass()); |