diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-05-21 20:04:50 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-05-21 20:04:50 +0000 |
| commit | 4b009adc770ccadb5f249f9ece6d994a267ceb14 (patch) | |
| tree | 2f15bf5271c3944517ad9b7904a8820f832f2c80 /llvm/lib | |
| parent | c18f65fdae68692c3a02e3d7b2d8f70c01ccfa69 (diff) | |
| download | bcm5719-llvm-4b009adc770ccadb5f249f9ece6d994a267ceb14.tar.gz bcm5719-llvm-4b009adc770ccadb5f249f9ece6d994a267ceb14.zip | |
Simplify interface to ConstantFoldTerminator
llvm-svn: 2697
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 36622642bfa..eb06a5b1f92 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -34,8 +34,9 @@ bool doConstantPropogation(BasicBlock *BB, BasicBlock::iterator &II) { // constant value, convert it into an unconditional branch to the constant // destination. // -bool ConstantFoldTerminator(BasicBlock *BB, BasicBlock::iterator &II, - TerminatorInst *T) { +bool ConstantFoldTerminator(BasicBlock *BB) { + TerminatorInst *T = BB->getTerminator(); + // Branch - See if we are conditional jumping on constant if (BranchInst *BI = dyn_cast<BranchInst>(T)) { if (BI->isUnconditional()) return false; // Can't optimize uncond branch @@ -60,7 +61,6 @@ bool ConstantFoldTerminator(BasicBlock *BB, BasicBlock::iterator &II, // Set the unconditional destination, and change the insn to be an // unconditional branch. BI->setUnconditionalDest(Destination); - II = BB->end()-1; // Update instruction iterator! return true; } #if 0 |

