aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis
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
commit4d29ddfa06c111dbea5d27339c1c06191922c0fd (patch)
tree872f6ab37bcf2dc732b61ce13039f81d76112197 /include/llvm/Analysis
parentb350b76a320642b60f03b2675106d2fa1e392494 (diff)
downloadexternal_llvm-4d29ddfa06c111dbea5d27339c1c06191922c0fd.zip
external_llvm-4d29ddfa06c111dbea5d27339c1c06191922c0fd.tar.gz
external_llvm-4d29ddfa06c111dbea5d27339c1c06191922c0fd.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
Diffstat (limited to 'include/llvm/Analysis')
-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) {