Remove unused class variables and update all callers/uses from
authorEric Christopher <echristo@gmail.com>
Mon, 2 Feb 2015 22:28:44 +0000 (22:28 +0000)
committerEric Christopher <echristo@gmail.com>
Mon, 2 Feb 2015 22:28:44 +0000 (22:28 +0000)
the HexagonSplitTFRCondSet pass. Use the subtarget off the machine
function at the same time.

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

lib/Target/Hexagon/Hexagon.h
lib/Target/Hexagon/HexagonSplitTFRCondSets.cpp
lib/Target/Hexagon/HexagonTargetMachine.cpp

index ad40e461b8e3c01b7421df7e4de621b105819d81..1c81f4d60a1130822f6b07b635b340cf80e62184 100644 (file)
@@ -36,7 +36,7 @@ namespace llvm {
   FunctionPass *createHexagonRemoveExtendArgs(const HexagonTargetMachine &TM);
   FunctionPass *createHexagonCFGOptimizer();
 
-  FunctionPass *createHexagonSplitTFRCondSets(const HexagonTargetMachine &TM);
+  FunctionPass *createHexagonSplitTFRCondSets();
   FunctionPass *createHexagonSplitConst32AndConst64();
   FunctionPass *createHexagonExpandPredSpillCode();
   FunctionPass *createHexagonHardwareLoops();
index 9770c58cbad6d1a44425d1c18b4cdbfb6db0dbdb..8873bb9cf46fcdc752ec964b07426f3845454321 100644 (file)
@@ -58,13 +58,9 @@ namespace llvm {
 namespace {
 
 class HexagonSplitTFRCondSets : public MachineFunctionPass {
-    const HexagonTargetMachine &QTM;
-    const HexagonSubtarget &QST;
-
  public:
     static char ID;
-    HexagonSplitTFRCondSets(const HexagonTargetMachine& TM) :
-      MachineFunctionPass(ID), QTM(TM), QST(*TM.getSubtargetImpl()) {
+    HexagonSplitTFRCondSets() : MachineFunctionPass(ID) {
       initializeHexagonSplitTFRCondSetsPass(*PassRegistry::getPassRegistry());
     }
 
@@ -80,7 +76,7 @@ char HexagonSplitTFRCondSets::ID = 0;
 
 bool HexagonSplitTFRCondSets::runOnMachineFunction(MachineFunction &Fn) {
 
-  const TargetInstrInfo *TII = QTM.getSubtargetImpl()->getInstrInfo();
+  const TargetInstrInfo *TII = Fn.getSubtarget().getInstrInfo();
 
   // Loop over all of the basic blocks.
   for (MachineFunction::iterator MBBb = Fn.begin(), MBBe = Fn.end();
@@ -171,7 +167,6 @@ void llvm::initializeHexagonSplitTFRCondSetsPass(PassRegistry &Registry) {
   CALL_ONCE_INITIALIZATION(initializePassOnce)
 }
 
-FunctionPass*
-llvm::createHexagonSplitTFRCondSets(const HexagonTargetMachine &TM) {
-  return new HexagonSplitTFRCondSets(TM);
+FunctionPass *llvm::createHexagonSplitTFRCondSets() {
+  return new HexagonSplitTFRCondSets();
 }
index 7245ce6c801ba4846eba9fd2f748cf02780d6ed5..860a46c57ef787d3f98c60eed3771fddb7dcd940 100644 (file)
@@ -151,7 +151,6 @@ void HexagonPassConfig::addPreSched2() {
 }
 
 void HexagonPassConfig::addPreEmitPass() {
-  const HexagonTargetMachine &TM = getHexagonTargetMachine();
   bool NoOpt = (getOptLevel() == CodeGenOpt::None);
 
   if (!NoOpt)
@@ -161,7 +160,7 @@ void HexagonPassConfig::addPreEmitPass() {
   addPass(createHexagonExpandPredSpillCode(), false);
 
   // Split up TFRcondsets into conditional transfers.
-  addPass(createHexagonSplitTFRCondSets(TM), false);
+  addPass(createHexagonSplitTFRCondSets(), false);
 
   // Create Packets.
   if (!NoOpt) {