Remove the use of TargetMachine from PPCJITInfo and replace with
authorEric Christopher <echristo@gmail.com>
Thu, 12 Jun 2014 22:19:51 +0000 (22:19 +0000)
committerEric Christopher <echristo@gmail.com>
Thu, 12 Jun 2014 22:19:51 +0000 (22:19 +0000)
the subtarget. Also remove unnecessary argument to the constructor
at the same time, we already have access via the subtarget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210844 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCJITInfo.cpp
lib/Target/PowerPC/PPCJITInfo.h
lib/Target/PowerPC/PPCTargetMachine.cpp

index 7bbc71bd1fa91e91ec2e9817c76d3cc4333211c2..f3c83c6a56677ab1049a25a7bd856bda41047c4d 100644 (file)
@@ -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)
index 0693e3e86cd53d3d3ad89685f7fa02e80950efe4..033b7e322263730890caf183d91fb185a2a1cd30 100644 (file)
 #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;
index 4e04dfa2a372399aaebfc2b4e454ec0097789fd6..ed82a63393052354db4bdc7823ea358b985af35c 100644 (file)
@@ -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();
 }