[llvm] r210844 - Remove the use of TargetMachine from PPCJITInfo and replace with

Eric Christopher echristo at gmail.com
Thu Jun 12 15:19:51 PDT 2014


Author: echristo
Date: Thu Jun 12 17:19:51 2014
New Revision: 210844

URL: http://llvm.org/viewvc/llvm-project?rev=210844&view=rev
Log:
Remove the use of TargetMachine from PPCJITInfo and replace with
the subtarget. Also remove unnecessary argument to the constructor
at the same time, we already have access via the subtarget.

Modified:
    llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp
    llvm/trunk/lib/Target/PowerPC/PPCJITInfo.h
    llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp

Modified: llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp?rev=210844&r1=210843&r2=210844&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp Thu Jun 12 17:19:51 2014
@@ -393,7 +393,7 @@ void *PPCJITInfo::emitFunctionStub(const
     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)

Modified: llvm/trunk/lib/Target/PowerPC/PPCJITInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCJITInfo.h?rev=210844&r1=210843&r2=210844&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCJITInfo.h (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCJITInfo.h Thu Jun 12 17:19:51 2014
@@ -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;

Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=210844&r1=210843&r2=210844&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Thu Jun 12 17:19:51 2014
@@ -42,7 +42,7 @@ PPCTargetMachine::PPCTargetMachine(const
                                    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();
 }





More information about the llvm-commits mailing list