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.

llvm-svn: 210844

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

index 7bbc71b..f3c83c6 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 0693e3e..033b7e3 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 4e04dfa..ed82a63 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();
 }