FrameLowering depends only upon the Subtarget, so only take a subtarget
authorEric Christopher <echristo@gmail.com>
Fri, 18 Jul 2014 23:33:47 +0000 (23:33 +0000)
committerEric Christopher <echristo@gmail.com>
Fri, 18 Jul 2014 23:33:47 +0000 (23:33 +0000)
during initialization.

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

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

index 8ba35fa02b82cce9e67075adbdc7d51fc8edd8b5..61afe179df5753bcdf2923fbb96884c61805f93f 100644 (file)
@@ -82,9 +82,8 @@ using namespace llvm;
 //
 //===----------------------------------------------------------------------===//
 
 //
 //===----------------------------------------------------------------------===//
 
-const MipsFrameLowering *MipsFrameLowering::create(MipsTargetMachine &TM,
-                                                   const MipsSubtarget &ST) {
-  if (TM.getSubtargetImpl()->inMips16Mode())
+const MipsFrameLowering *MipsFrameLowering::create(const MipsSubtarget &ST) {
+  if (ST.inMips16Mode())
     return llvm::createMips16FrameLowering(ST);
 
   return llvm::createMipsSEFrameLowering(ST);
     return llvm::createMips16FrameLowering(ST);
 
   return llvm::createMipsSEFrameLowering(ST);
index 8e9196c30fad451e59f086a6467c9a1352b79a4f..9d593091e018d7c6198dbcc8a5d565e49cad0b89 100644 (file)
@@ -28,8 +28,7 @@ public:
   explicit MipsFrameLowering(const MipsSubtarget &sti, unsigned Alignment)
     : TargetFrameLowering(StackGrowsDown, Alignment, 0, Alignment), STI(sti) {}
 
   explicit MipsFrameLowering(const MipsSubtarget &sti, unsigned Alignment)
     : TargetFrameLowering(StackGrowsDown, Alignment, 0, Alignment), STI(sti) {}
 
-  static const MipsFrameLowering *create(MipsTargetMachine &TM,
-                                         const MipsSubtarget &ST);
+  static const MipsFrameLowering *create(const MipsSubtarget &ST);
 
   bool hasFP(const MachineFunction &MF) const override;
 
 
   bool hasFP(const MachineFunction &MF) const override;
 
index f801dcd9e945b569c53b43294330f1a8e7473405..1fa28dc97d9afa25f9d4e31ec2e7a97ba5439412 100644 (file)
@@ -116,7 +116,7 @@ MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &CPU,
       HasMSA(false), OverrideMode(NoOverride), TM(_TM), TargetTriple(TT),
       DL(computeDataLayout(initializeSubtargetDependencies(CPU, FS, TM))),
       TSInfo(DL), JITInfo(), InstrInfo(MipsInstrInfo::create(*this)),
       HasMSA(false), OverrideMode(NoOverride), TM(_TM), TargetTriple(TT),
       DL(computeDataLayout(initializeSubtargetDependencies(CPU, FS, TM))),
       TSInfo(DL), JITInfo(), InstrInfo(MipsInstrInfo::create(*this)),
-      FrameLowering(MipsFrameLowering::create(*TM, *this)),
+      FrameLowering(MipsFrameLowering::create(*this)),
       TLInfo(MipsTargetLowering::create(*TM, *this)) {
 
   PreviousInMips16Mode = InMips16Mode;
       TLInfo(MipsTargetLowering::create(*TM, *this)) {
 
   PreviousInMips16Mode = InMips16Mode;
@@ -255,7 +255,7 @@ void MipsSubtarget::setHelperClassesMips16() {
   TLInfoSE.swap(TLInfo);
   if (!InstrInfo16) {
     InstrInfo.reset(MipsInstrInfo::create(*this));
   TLInfoSE.swap(TLInfo);
   if (!InstrInfo16) {
     InstrInfo.reset(MipsInstrInfo::create(*this));
-    FrameLowering.reset(MipsFrameLowering::create(*TM, *this));
+    FrameLowering.reset(MipsFrameLowering::create(*this));
     TLInfo.reset(MipsTargetLowering::create(*TM, *this));
   } else {
     InstrInfo16.swap(InstrInfo);
     TLInfo.reset(MipsTargetLowering::create(*TM, *this));
   } else {
     InstrInfo16.swap(InstrInfo);
@@ -273,7 +273,7 @@ void MipsSubtarget::setHelperClassesMipsSE() {
   TLInfo16.swap(TLInfo);
   if (!InstrInfoSE) {
     InstrInfo.reset(MipsInstrInfo::create(*this));
   TLInfo16.swap(TLInfo);
   if (!InstrInfoSE) {
     InstrInfo.reset(MipsInstrInfo::create(*this));
-    FrameLowering.reset(MipsFrameLowering::create(*TM, *this));
+    FrameLowering.reset(MipsFrameLowering::create(*this));
     TLInfo.reset(MipsTargetLowering::create(*TM, *this));
   } else {
     InstrInfoSE.swap(InstrInfo);
     TLInfo.reset(MipsTargetLowering::create(*TM, *this));
   } else {
     InstrInfoSE.swap(InstrInfo);