aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/SimplifyCFG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-04-11 23:24:57 +0000
committerChris Lattner <sabre@nondot.org>2011-04-11 23:24:57 +0000
commitc8fbc34869fc1737adea00f775de5b8dd829f7a1 (patch)
treecd144d252a89a75404cd2f0cc052c832759f04c5 /lib/Transforms/Utils/SimplifyCFG.cpp
parentbd2907356dbe40a1f19b217eb14853b6b0b017d2 (diff)
comment cleanup, use moveBefore instead of removeFromParent+insertBefore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129319 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index cfc897cad3..2184b4606b 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -1401,10 +1401,9 @@ static bool SimplifyCondBranchToTwoReturns(BranchInst *BI) {
return true;
}
-/// FoldBranchToCommonDest - If this basic block is ONLY a setcc and a branch,
-/// and if a predecessor branches to us and one of our successors, fold the
-/// setcc into the predecessor and use logical operations to pick the right
-/// destination.
+/// FoldBranchToCommonDest - If this basic block is simple enough, and if a
+/// predecessor branches to us and one of our successors, fold the block into
+/// the predecessor and use logical operations to pick the right destination.
bool llvm::FoldBranchToCommonDest(BranchInst *BI) {
BasicBlock *BB = BI->getParent();
Instruction *Cond = dyn_cast<Instruction>(BI->getCondition());
@@ -1588,11 +1587,8 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI) {
// Move dbg value intrinsics in PredBlock.
for (SmallVector<DbgInfoIntrinsic *, 8>::iterator DBI = DbgValues.begin(),
- DBE = DbgValues.end(); DBI != DBE; ++DBI) {
- DbgInfoIntrinsic *DB = *DBI;
- DB->removeFromParent();
- DB->insertBefore(PBI);
- }
+ DBE = DbgValues.end(); DBI != DBE; ++DBI)
+ (*DBI)->moveBefore(PBI);
return true;
}
return false;