Implement method
authorChris Lattner <sabre@nondot.org>
Sun, 18 Apr 2004 06:54:48 +0000 (06:54 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 18 Apr 2004 06:54:48 +0000 (06:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13036 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/LoopInfo.cpp

index 38b9c6699992e7c1f61823ef819d94cee0b037a4..012c3dac73646471ce35d204b0eb519b8a20737a 100644 (file)
@@ -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<BasicBlock *, Loop*>::iterator I = BBMap.find(BB);
+  if (I != BBMap.end()) {
+    for (Loop *L = I->second; L; L = L->getParentLoop())
+      L->removeBlockFromLoop(BB);
+    
+    BBMap.erase(I);
+  }
+}
 
 
 //===----------------------------------------------------------------------===//