diff --git a/lib/Target/PowerPC/PPCJITInfo.cpp b/lib/Target/PowerPC/PPCJITInfo.cpp index 7bbc71bd1fa..f3c83c6a566 100644 --- a/lib/Target/PowerPC/PPCJITInfo.cpp +++ b/lib/Target/PowerPC/PPCJITInfo.cpp @@ -393,7 +393,7 @@ void *PPCJITInfo::emitFunctionStub(const Function* F, void *Fn, JCE.emitWordBE(0xf821ffb1); // stdu r1,-80(r1) JCE.emitWordBE(0x7d6802a6); // mflr r11 JCE.emitWordBE(0xf9610060); // std r11, 96(r1) - } else if (TM.getSubtargetImpl()->isDarwinABI()){ + } else if (Subtarget.isDarwinABI()){ JCE.emitWordBE(0x9421ffe0); // stwu r1,-32(r1) JCE.emitWordBE(0x7d6802a6); // mflr r11 JCE.emitWordBE(0x91610028); // stw r11, 40(r1) diff --git a/lib/Target/PowerPC/PPCJITInfo.h b/lib/Target/PowerPC/PPCJITInfo.h index 0693e3e86cd..033b7e32226 100644 --- a/lib/Target/PowerPC/PPCJITInfo.h +++ b/lib/Target/PowerPC/PPCJITInfo.h @@ -14,20 +14,20 @@ #ifndef POWERPC_JITINFO_H #define POWERPC_JITINFO_H +#include "PPCSubtarget.h" #include "llvm/CodeGen/JITCodeEmitter.h" #include "llvm/Target/TargetJITInfo.h" namespace llvm { - class PPCTargetMachine; class PPCJITInfo : public TargetJITInfo { protected: - PPCTargetMachine &TM; + PPCSubtarget &Subtarget; bool is64Bit; public: - PPCJITInfo(PPCTargetMachine &tm, bool tmIs64Bit) : TM(tm) { + PPCJITInfo(PPCSubtarget &STI) + : Subtarget(STI), is64Bit(STI.isPPC64()) { useGOT = 0; - is64Bit = tmIs64Bit; } StubLayout getStubLayout() override; diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp index 4e04dfa2a37..ed82a633930 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -42,7 +42,7 @@ PPCTargetMachine::PPCTargetMachine(const Target &T, StringRef TT, StringRef CPU, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL, bool is64Bit) : LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL), - Subtarget(TT, CPU, FS, is64Bit, OL), JITInfo(*this, is64Bit), + Subtarget(TT, CPU, FS, is64Bit, OL), JITInfo(Subtarget), TLInfo(*this), TSInfo(*this) { initAsmInfo(); }