ARM JIT should observe -relocation-model command line option.

llvm-svn: 58433
This commit is contained in:
Evan Cheng 2008-10-30 16:10:54 +00:00
parent d26da8cf82
commit 66cff408ff
2 changed files with 6 additions and 2 deletions

View File

@ -85,7 +85,9 @@ ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS,
InstrInfo(Subtarget),
FrameInfo(Subtarget),
JITInfo(*this),
TLInfo(*this) {}
TLInfo(*this) {
DefRelocModel = getRelocationModel();
}
unsigned ARMTargetMachine::getJITMatchQuality() {
#if defined(__arm__)
@ -157,6 +159,7 @@ bool ARMTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
bool ARMTargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast,
bool DumpAsm, MachineCodeEmitter &MCE) {
// FIXME: Move this to TargetJITInfo!
if (DefRelocModel == Reloc::Default)
setRelocationModel(Reloc::Static);
// Machine code emitter pass for ARM.

View File

@ -34,6 +34,7 @@ class ARMTargetMachine : public LLVMTargetMachine {
ARMFrameInfo FrameInfo;
ARMJITInfo JITInfo;
ARMTargetLowering TLInfo;
Reloc::Model DefRelocModel; // Reloc model before it's overridden.
protected:
// To avoid having target depend on the asmprinter stuff libraries, asmprinter