diff options
author | Chris Lattner <sabre@nondot.org> | 2002-06-25 16:13:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-06-25 16:13:24 +0000 |
commit | 7e70829632f82de15db187845666aaca6e04b792 (patch) | |
tree | 48dd2d804e7ebec9a3cbd8bf229cb2a2aa20dce5 /lib/Transforms/Scalar/PiNodeInsertion.cpp | |
parent | 0b12b5f50ec77a8bd01b92d287c52d748619bb4b (diff) |
MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/PiNodeInsertion.cpp')
-rw-r--r-- | lib/Transforms/Scalar/PiNodeInsertion.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/PiNodeInsertion.cpp b/lib/Transforms/Scalar/PiNodeInsertion.cpp index 2e9c32800b..2c16049684 100644 --- a/lib/Transforms/Scalar/PiNodeInsertion.cpp +++ b/lib/Transforms/Scalar/PiNodeInsertion.cpp @@ -42,7 +42,7 @@ namespace { struct PiNodeInserter : public FunctionPass { const char *getPassName() const { return "Pi Node Insertion"; } - virtual bool runOnFunction(Function *F); + virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.preservesCFG(); @@ -61,11 +61,10 @@ namespace { Pass *createPiNodeInsertionPass() { return new PiNodeInserter(); } -bool PiNodeInserter::runOnFunction(Function *F) { +bool PiNodeInserter::runOnFunction(Function &F) { bool Changed = false; - for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) { - BasicBlock *BB = *I; - TerminatorInst *TI = BB->getTerminator(); + for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) { + TerminatorInst *TI = I->getTerminator(); // FIXME: Insert PI nodes for switch statements too @@ -112,8 +111,7 @@ bool PiNodeInserter::runOnFunction(Function *F) { } -// alreadyHasPiNodeFor - Return true if there is already a Pi node in BB for -// V. +// alreadyHasPiNodeFor - Return true if there is already a Pi node in BB for V. static bool alreadyHasPiNodeFor(Value *V, BasicBlock *BB) { for (Value::use_iterator I = V->use_begin(), E = V->use_end(); I != E; ++I) if (PHINode *PN = dyn_cast<PHINode>(*I)) |