aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-05-21 20:04:50 +0000
committerChris Lattner <sabre@nondot.org>2002-05-21 20:04:50 +0000
commit76ae3445f81164aaff9f95123426109c119f27c0 (patch)
treeafc0553f492bf1b19f2a2f5269ecdc1223907a63 /lib/Transforms/Utils/Local.cpp
parentb8bcb086f7d4a74c40661c5c18134533a3f69fc9 (diff)
downloadexternal_llvm-76ae3445f81164aaff9f95123426109c119f27c0.zip
external_llvm-76ae3445f81164aaff9f95123426109c119f27c0.tar.gz
external_llvm-76ae3445f81164aaff9f95123426109c119f27c0.tar.bz2
Simplify interface to ConstantFoldTerminator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/Local.cpp')
-rw-r--r--lib/Transforms/Utils/Local.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp
index 3662264..eb06a5b 100644
--- a/lib/Transforms/Utils/Local.cpp
+++ b/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