diff options
Diffstat (limited to 'llvm/lib/Target/ARM/ARMCodeEmitter.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMCodeEmitter.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/llvm/lib/Target/ARM/ARMCodeEmitter.cpp b/llvm/lib/Target/ARM/ARMCodeEmitter.cpp index 5fb6ebfeaae..714497c1bd8 100644 --- a/llvm/lib/Target/ARM/ARMCodeEmitter.cpp +++ b/llvm/lib/Target/ARM/ARMCodeEmitter.cpp @@ -67,11 +67,11 @@ namespace { static char ID; public: ARMCodeEmitter(TargetMachine &tm, JITCodeEmitter &mce) - : MachineFunctionPass(ID), JTI(nullptr), - II((const ARMBaseInstrInfo *)tm.getInstrInfo()), - TD(tm.getDataLayout()), TM(tm), - MCE(mce), MCPEs(nullptr), MJTEs(nullptr), - IsPIC(TM.getRelocationModel() == Reloc::PIC_), IsThumb(false) {} + : MachineFunctionPass(ID), JTI(nullptr), + II((const ARMBaseInstrInfo *)tm.getSubtargetImpl()->getInstrInfo()), + TD(tm.getSubtargetImpl()->getDataLayout()), TM(tm), MCE(mce), + MCPEs(nullptr), MJTEs(nullptr), + IsPIC(TM.getRelocationModel() == Reloc::PIC_), IsThumb(false) {} /// getBinaryCodeForInstr - This function, generated by the /// CodeEmitterGenerator using TableGen, produces the binary encoding for @@ -368,12 +368,13 @@ bool ARMCodeEmitter::runOnMachineFunction(MachineFunction &MF) { assert((Target.getRelocationModel() != Reloc::Default || Target.getRelocationModel() != Reloc::Static) && "JIT relocation model must be set to static or default!"); - - JTI = static_cast<ARMJITInfo*>(Target.getJITInfo()); - II = static_cast<const ARMBaseInstrInfo*>(Target.getInstrInfo()); - TD = Target.getDataLayout(); - + // Initialize the subtarget first so we can grab all of the + // subtarget dependent variables from there. Subtarget = &TM.getSubtarget<ARMSubtarget>(); + JTI = static_cast<ARMJITInfo *>(Target.getSubtargetImpl()->getJITInfo()); + II = static_cast<const ARMBaseInstrInfo *>(Subtarget->getInstrInfo()); + TD = Target.getSubtargetImpl()->getDataLayout(); + MCPEs = &MF.getConstantPool()->getConstants(); MJTEs = nullptr; if (MF.getJumpTableInfo()) MJTEs = &MF.getJumpTableInfo()->getJumpTables(); |