From 3048bd1d3e2e77d6d6a74254ab83a0e4a93c9525 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 18 Apr 2004 06:54:48 +0000 Subject: [PATCH] Implement method git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13036 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/LoopInfo.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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); + } +} //===----------------------------------------------------------------------===// -- 2.34.1