From: Chris Lattner Date: Sun, 18 Apr 2004 06:54:48 +0000 (+0000) Subject: Implement method X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3048bd1d3e2e77d6d6a74254ab83a0e4a93c9525;p=oota-llvm.git Implement method git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13036 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp index 38b9c669999..012c3dac736 100644 --- a/lib/Analysis/LoopInfo.cpp +++ b/lib/Analysis/LoopInfo.cpp @@ -326,6 +326,18 @@ Loop *LoopInfo::removeLoop(iterator I) { return L; } +/// removeBlock - This method completely removes BB from all data structures, +/// including all of the Loop objects it is nested in and our mapping from +/// BasicBlocks to loops. +void LoopInfo::removeBlock(BasicBlock *BB) { + std::map::iterator I = BBMap.find(BB); + if (I != BBMap.end()) { + for (Loop *L = I->second; L; L = L->getParentLoop()) + L->removeBlockFromLoop(BB); + + BBMap.erase(I); + } +} //===----------------------------------------------------------------------===//