aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineSink.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-10-19 14:52:05 +0000
committerDan Gohman <gohman@apple.com>2009-10-19 14:52:05 +0000
commit4e9785ed8ad34f01ccb459796d85a56600ed592b (patch)
tree561ed74f2a7146e936fdb41f50ebc892aca0846b /lib/CodeGen/MachineSink.cpp
parente02a698acff176dfac6f4f39d4526ff69acc5432 (diff)
Change a few instance variables to be local variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84503 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineSink.cpp')
-rw-r--r--lib/CodeGen/MachineSink.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/CodeGen/MachineSink.cpp b/lib/CodeGen/MachineSink.cpp
index 0f3b33f54d..2122172ee2 100644
--- a/lib/CodeGen/MachineSink.cpp
+++ b/lib/CodeGen/MachineSink.cpp
@@ -34,10 +34,8 @@ STATISTIC(NumSunk, "Number of machine instructions sunk");
namespace {
class VISIBILITY_HIDDEN MachineSinking : public MachineFunctionPass {
- const TargetMachine *TM;
const TargetInstrInfo *TII;
const TargetRegisterInfo *TRI;
- MachineFunction *CurMF; // Current MachineFunction
MachineRegisterInfo *RegInfo; // Machine register information
MachineDominatorTree *DT; // Machine dominator tree
AliasAnalysis *AA;
@@ -92,19 +90,16 @@ bool MachineSinking::AllUsesDominatedByBlock(unsigned Reg,
return true;
}
-
-
bool MachineSinking::runOnMachineFunction(MachineFunction &MF) {
DEBUG(errs() << "******** Machine Sinking ********\n");
- CurMF = &MF;
- TM = &CurMF->getTarget();
- TII = TM->getInstrInfo();
- TRI = TM->getRegisterInfo();
- RegInfo = &CurMF->getRegInfo();
+ const TargetMachine &TM = MF.getTarget();
+ TII = TM.getInstrInfo();
+ TRI = TM.getRegisterInfo();
+ RegInfo = &MF.getRegInfo();
DT = &getAnalysis<MachineDominatorTree>();
AA = &getAnalysis<AliasAnalysis>();
- AllocatableSet = TRI->getAllocatableSet(*CurMF);
+ AllocatableSet = TRI->getAllocatableSet(MF);
bool EverMadeChange = false;
@@ -112,7 +107,7 @@ bool MachineSinking::runOnMachineFunction(MachineFunction &MF) {
bool MadeChange = false;
// Process all basic blocks.
- for (MachineFunction::iterator I = CurMF->begin(), E = CurMF->end();
+ for (MachineFunction::iterator I = MF.begin(), E = MF.end();
I != E; ++I)
MadeChange |= ProcessBlock(*I);