aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-08-14 16:53:24 +0000
committerDevang Patel <dpatel@apple.com>2007-08-14 16:53:24 +0000
commitb5387f0632ebbf5c1c4c86d9f8797ad729126a8b (patch)
tree872f6ab37bcf2dc732b61ce13039f81d76112197
parent7c2a3d1be46ea5b104775c8538c67c0b72cf0827 (diff)
downloadexternal_llvm-b5387f0632ebbf5c1c4c86d9f8797ad729126a8b.zip
external_llvm-b5387f0632ebbf5c1c4c86d9f8797ad729126a8b.tar.gz
external_llvm-b5387f0632ebbf5c1c4c86d9f8797ad729126a8b.tar.bz2
No need to use iterator to erase basic block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41074 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Analysis/Dominators.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h
index 4107458..41e6938 100644
--- a/include/llvm/Analysis/Dominators.h
+++ b/include/llvm/Analysis/Dominators.h
@@ -253,7 +253,7 @@ public:
changeImmediateDominator(getNode(BB), getNode(NewBB));
}
- /// eraseNode - Removes a node from the domiantor tree. Block must not
+ /// eraseNode - Removes a node from the dominator tree. Block must not
/// domiante any other blocks. Removes node from its immediate dominator's
/// children list. Deletes dominator node associated with basic block BB.
void eraseNode(BasicBlock *BB);
@@ -378,8 +378,10 @@ public:
/// removeBlock - Remove basic block BB's frontier.
void removeBlock(BasicBlock *BB) {
assert(find(BB) != end() && "Block is not in DominanceFrontier!");
- iterator BBDF = Frontiers.find(BB);
- Frontiers.erase(BBDF);
+ for (iterator I = begin(), E = end(); I != E; ++I)
+ if (I->second.count(BB))
+ I->second.erase(BB);
+ Frontiers.erase(BB);
}
void addToFrontier(iterator I, BasicBlock *Node) {