Author: dpatel Date: Tue Aug 14 11:53:24 2007 New Revision: 41074 URL: http://llvm.org/viewvc/llvm-project?rev=41074&view=rev Log: No need to use iterator to erase basic block.
Modified: llvm/trunk/include/llvm/Analysis/Dominators.h Modified: llvm/trunk/include/llvm/Analysis/Dominators.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Dominators.h?rev=41074&r1=41073&r2=41074&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/Dominators.h (original) +++ llvm/trunk/include/llvm/Analysis/Dominators.h Tue Aug 14 11:53:24 2007 @@ -253,7 +253,7 @@ 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 @@ /// 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) { _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits