diff options
author | Chris Lattner <sabre@nondot.org> | 2004-04-18 06:54:48 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-04-18 06:54:48 +0000 |
commit | 3048bd1d3e2e77d6d6a74254ab83a0e4a93c9525 (patch) | |
tree | 9154c26f367469279fd054a31963cb37350fbcf2 /lib/Analysis/LoopInfo.cpp | |
parent | 9afb24bf0847b9f2ff0bf3f7f7405dcbe42fa38b (diff) |
Implement method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13036 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopInfo.cpp')
-rw-r--r-- | lib/Analysis/LoopInfo.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp index 38b9c66999..012c3dac73 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<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); + } +} //===----------------------------------------------------------------------===// |