Move MipsJITInfo to the subtarget rather than the target machine.
authorEric Christopher <echristo@gmail.com>
Wed, 2 Jul 2014 00:54:12 +0000 (00:54 +0000)
committerEric Christopher <echristo@gmail.com>
Wed, 2 Jul 2014 00:54:12 +0000 (00:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212151 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/MipsSubtarget.cpp
lib/Target/Mips/MipsSubtarget.h
lib/Target/Mips/MipsTargetMachine.cpp
lib/Target/Mips/MipsTargetMachine.h

index 74ec06479c4e6fed1290a06f47402f3cd86aec73..721c4f26da743d2c49b08695a75f3b78be399c89 100644 (file)
@@ -85,7 +85,7 @@ MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &CPU,
       InMips16Mode(false), InMips16HardFloat(Mips16HardFloat),
       InMicroMipsMode(false), HasDSP(false), HasDSPR2(false),
       AllowMixed16_32(Mixed16_32 | Mips_Os16), Os16(Mips_Os16), HasMSA(false),
       InMips16Mode(false), InMips16HardFloat(Mips16HardFloat),
       InMicroMipsMode(false), HasDSP(false), HasDSPR2(false),
       AllowMixed16_32(Mixed16_32 | Mips_Os16), Os16(Mips_Os16), HasMSA(false),
-      RM(_RM), OverrideMode(NoOverride), TM(_TM), TargetTriple(TT) {
+      RM(_RM), OverrideMode(NoOverride), TM(_TM), TargetTriple(TT), JITInfo() {
   std::string CPUName = CPU;
   CPUName = selectMipsCPU(TT, CPUName);
 
   std::string CPUName = CPU;
   CPUName = selectMipsCPU(TT, CPUName);
 
index bff656ff12577a382ea66d631682cb5fcf29d2e1..ef8e27a5e1a7903f692aded5ebcb7cb12bc5428d 100644 (file)
@@ -14,6 +14,7 @@
 #ifndef MIPSSUBTARGET_H
 #define MIPSSUBTARGET_H
 
 #ifndef MIPSSUBTARGET_H
 #define MIPSSUBTARGET_H
 
+#include "MipsJITInfo.h"
 #include "llvm/MC/MCInstrItineraries.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Target/TargetSubtargetInfo.h"
 #include "llvm/MC/MCInstrItineraries.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Target/TargetSubtargetInfo.h"
@@ -132,6 +133,8 @@ protected:
   MipsTargetMachine *TM;
 
   Triple TargetTriple;
   MipsTargetMachine *TM;
 
   Triple TargetTriple;
+
+  MipsJITInfo JITInfo;
 public:
   bool enablePostRAScheduler(CodeGenOpt::Level OptLevel,
                              AntiDepBreakMode& Mode,
 public:
   bool enablePostRAScheduler(CodeGenOpt::Level OptLevel,
                              AntiDepBreakMode& Mode,
@@ -248,6 +251,8 @@ public:
   /// specify which component of the system provides it. Hardware, software, and
   /// hybrid implementations are all valid.
   bool systemSupportsUnalignedAccess() const { return hasMips32r6(); }
   /// specify which component of the system provides it. Hardware, software, and
   /// hybrid implementations are all valid.
   bool systemSupportsUnalignedAccess() const { return hasMips32r6(); }
+
+  MipsJITInfo *getJITInfo() { return &JITInfo; }
 };
 } // End llvm namespace
 
 };
 } // End llvm namespace
 
index 25234b902332051940398f2435eaa3f65a2941fc..e6b077ec008495d32188a6c7c184bb8174287575 100644 (file)
@@ -89,7 +89,7 @@ MipsTargetMachine::MipsTargetMachine(const Target &T, StringRef TT,
       Subtarget(TT, CPU, FS, isLittle, RM, this),
       DL(computeDataLayout(Subtarget)), InstrInfo(MipsInstrInfo::create(*this)),
       FrameLowering(MipsFrameLowering::create(*this, Subtarget)),
       Subtarget(TT, CPU, FS, isLittle, RM, this),
       DL(computeDataLayout(Subtarget)), InstrInfo(MipsInstrInfo::create(*this)),
       FrameLowering(MipsFrameLowering::create(*this, Subtarget)),
-      TLInfo(MipsTargetLowering::create(*this)), TSInfo(DL), JITInfo() {
+      TLInfo(MipsTargetLowering::create(*this)), TSInfo(DL) {
   initAsmInfo();
 }
 
   initAsmInfo();
 }
 
index fee8410d31677d0dc611247e572b8e2b547dbc0c..79e7e1d3c7280fe5470021c9c6438bb6ba96c665 100644 (file)
@@ -17,7 +17,6 @@
 #include "MipsFrameLowering.h"
 #include "MipsISelLowering.h"
 #include "MipsInstrInfo.h"
 #include "MipsFrameLowering.h"
 #include "MipsISelLowering.h"
 #include "MipsInstrInfo.h"
-#include "MipsJITInfo.h"
 #include "MipsSelectionDAGInfo.h"
 #include "MipsSubtarget.h"
 #include "llvm/CodeGen/Passes.h"
 #include "MipsSelectionDAGInfo.h"
 #include "MipsSubtarget.h"
 #include "llvm/CodeGen/Passes.h"
@@ -43,7 +42,6 @@ class MipsTargetMachine : public LLVMTargetMachine {
   std::unique_ptr<const MipsFrameLowering> FrameLoweringSE;
   std::unique_ptr<const MipsTargetLowering> TLInfoSE;
   MipsSelectionDAGInfo TSInfo;
   std::unique_ptr<const MipsFrameLowering> FrameLoweringSE;
   std::unique_ptr<const MipsTargetLowering> TLInfoSE;
   MipsSelectionDAGInfo TSInfo;
-  MipsJITInfo JITInfo;
 
 public:
   MipsTargetMachine(const Target &T, StringRef TT,
 
 public:
   MipsTargetMachine(const Target &T, StringRef TT,
@@ -71,7 +69,9 @@ public:
                : &getSubtargetImpl()->getInstrItineraryData();
   }
 
                : &getSubtargetImpl()->getInstrItineraryData();
   }
 
-  MipsJITInfo *getJITInfo() override { return &JITInfo; }
+  MipsJITInfo *getJITInfo() override {
+    return Subtarget.getJITInfo();
+  }
 
   const MipsRegisterInfo *getRegisterInfo()  const override {
     return &InstrInfo->getRegisterInfo();
 
   const MipsRegisterInfo *getRegisterInfo()  const override {
     return &InstrInfo->getRegisterInfo();