Remove uses and caches of the target machine and subtarget from
authorEric Christopher <echristo@gmail.com>
Fri, 27 Jun 2014 01:14:50 +0000 (01:14 +0000)
committerEric Christopher <echristo@gmail.com>
Fri, 27 Jun 2014 01:14:50 +0000 (01:14 +0000)
both MSP430InstrInfo and MSP430RegisterInfo. Remove unused member
variable StackAlign from MSP430RegisterInfo. Update constructors
accordingly.

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

lib/Target/MSP430/MSP430InstrInfo.cpp
lib/Target/MSP430/MSP430InstrInfo.h
lib/Target/MSP430/MSP430RegisterInfo.cpp
lib/Target/MSP430/MSP430RegisterInfo.h
lib/Target/MSP430/MSP430TargetMachine.cpp

index 0c04ddbb110ba821640dc9f68b2f2f064f6a0379..ccb6c09e3f41b9ed4c8dcb04ad1b7ec9a14fdc40 100644 (file)
@@ -30,9 +30,9 @@ using namespace llvm;
 // Pin the vtable to this file.
 void MSP430InstrInfo::anchor() {}
 
 // Pin the vtable to this file.
 void MSP430InstrInfo::anchor() {}
 
-MSP430InstrInfo::MSP430InstrInfo(MSP430TargetMachine &tm)
+MSP430InstrInfo::MSP430InstrInfo(MSP430Subtarget &STI)
   : MSP430GenInstrInfo(MSP430::ADJCALLSTACKDOWN, MSP430::ADJCALLSTACKUP),
   : MSP430GenInstrInfo(MSP430::ADJCALLSTACKDOWN, MSP430::ADJCALLSTACKUP),
-    RI(tm) {}
+    RI() {}
 
 void MSP430InstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
                                           MachineBasicBlock::iterator MI,
 
 void MSP430InstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
                                           MachineBasicBlock::iterator MI,
index 1ffcebb0154303edff63d9a73d643f36490b8391..e6baaefe484222b1a914ebce358148a72c786635 100644 (file)
@@ -22,7 +22,7 @@
 
 namespace llvm {
 
 
 namespace llvm {
 
-class MSP430TargetMachine;
+class MSP430Subtarget;
 
 /// MSP430II - This namespace holds all of the target specific flags that
 /// instruction info tracks.
 
 /// MSP430II - This namespace holds all of the target specific flags that
 /// instruction info tracks.
@@ -44,7 +44,7 @@ class MSP430InstrInfo : public MSP430GenInstrInfo {
   const MSP430RegisterInfo RI;
   virtual void anchor();
 public:
   const MSP430RegisterInfo RI;
   virtual void anchor();
 public:
-  explicit MSP430InstrInfo(MSP430TargetMachine &TM);
+  explicit MSP430InstrInfo(MSP430Subtarget &STI);
 
   /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info.  As
   /// such, whenever a client has an instance of instruction info, it should
 
   /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info.  As
   /// such, whenever a client has an instance of instruction info, it should
index 341fb64b8fcbb14254446e3474dccbfb498defe7..691bceef0de0426583906f72767c70b9de99faee 100644 (file)
@@ -32,10 +32,8 @@ using namespace llvm;
 #include "MSP430GenRegisterInfo.inc"
 
 // FIXME: Provide proper call frame setup / destroy opcodes.
 #include "MSP430GenRegisterInfo.inc"
 
 // FIXME: Provide proper call frame setup / destroy opcodes.
-MSP430RegisterInfo::MSP430RegisterInfo(MSP430TargetMachine &tm)
-  : MSP430GenRegisterInfo(MSP430::PCW), TM(tm) {
-  StackAlign = TM.getFrameLowering()->getStackAlignment();
-}
+MSP430RegisterInfo::MSP430RegisterInfo()
+  : MSP430GenRegisterInfo(MSP430::PCW) {}
 
 const MCPhysReg*
 MSP430RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
 
 const MCPhysReg*
 MSP430RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
index a607528fd118a37e5c972ecd50a0d0174d590bb2..cb0196134a8dae1fed9c4edd197eb1a7cdb064cc 100644 (file)
 
 namespace llvm {
 
 
 namespace llvm {
 
-class TargetInstrInfo;
-class MSP430TargetMachine;
-
 struct MSP430RegisterInfo : public MSP430GenRegisterInfo {
 struct MSP430RegisterInfo : public MSP430GenRegisterInfo {
-private:
-  MSP430TargetMachine &TM;
-
-  /// StackAlign - Default stack alignment.
-  ///
-  unsigned StackAlign;
 public:
 public:
-  MSP430RegisterInfo(MSP430TargetMachine &tm);
+  MSP430RegisterInfo();
 
   /// Code Generation virtual methods...
   const MCPhysReg *
 
   /// Code Generation virtual methods...
   const MCPhysReg *
index 04f8f08cc5dcc31d5cb4f0fe053871e059f095cd..ab7284e830d21c23288941d95376dc1f7625e2f4 100644 (file)
@@ -35,7 +35,7 @@ MSP430TargetMachine::MSP430TargetMachine(const Target &T,
     Subtarget(TT, CPU, FS),
     // FIXME: Check DataLayout string.
     DL("e-m:e-p:16:16-i32:16:32-n8:16"),
     Subtarget(TT, CPU, FS),
     // FIXME: Check DataLayout string.
     DL("e-m:e-p:16:16-i32:16:32-n8:16"),
-    InstrInfo(*this), TLInfo(*this), TSInfo(DL),
+    InstrInfo(Subtarget), TLInfo(*this), TSInfo(DL),
     FrameLowering() {
   initAsmInfo();
 }
     FrameLowering() {
   initAsmInfo();
 }