diff options
author | Chris Lattner <sabre@nondot.org> | 2004-04-18 05:37:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-04-18 05:37:42 +0000 |
commit | 4e55b7d2c62de7efa0147e0579980de8b1df9123 (patch) | |
tree | 9af6a103a7874a6acd78878f8e5d3dd68b573d5b /include/llvm/Analysis/LoopInfo.h | |
parent | 93d82020efd104c764663d8b526b7d4a543cbb2f (diff) | |
download | external_llvm-4e55b7d2c62de7efa0147e0579980de8b1df9123.zip external_llvm-4e55b7d2c62de7efa0147e0579980de8b1df9123.tar.gz external_llvm-4e55b7d2c62de7efa0147e0579980de8b1df9123.tar.bz2 |
Allow clients to delete loops, add a new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13031 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/LoopInfo.h')
-rw-r--r-- | include/llvm/Analysis/LoopInfo.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index ff49f45..7daabe5 100644 --- a/include/llvm/Analysis/LoopInfo.h +++ b/include/llvm/Analysis/LoopInfo.h @@ -53,6 +53,10 @@ public: /// Loop ctor - This creates an empty loop. Loop() : ParentLoop(0), LoopDepth(0) { } + ~Loop() { + for (unsigned i = 0, e = SubLoops.size(); i != e; ++i) + delete SubLoops[i]; + } unsigned getLoopDepth() const { return LoopDepth; } BasicBlock *getHeader() const { return Blocks.front(); } @@ -192,11 +196,6 @@ private: Loop(BasicBlock *BB) : ParentLoop(0) { Blocks.push_back(BB); LoopDepth = 0; } - ~Loop() { - for (unsigned i = 0, e = SubLoops.size(); i != e; ++i) - delete SubLoops[i]; - } - void setLoopDepth(unsigned Level) { LoopDepth = Level; for (unsigned i = 0, e = SubLoops.size(); i != e; ++i) @@ -262,6 +261,11 @@ public: /// virtual void getAnalysisUsage(AnalysisUsage &AU) const; + /// removeLoop - This removes the specified top-level loop from this loop info + /// object. The loop is not deleted, as it will presumably be inserted into + /// another loop. + Loop *removeLoop(iterator I); + /// changeLoopFor - Change the top-level loop that contains BB to the /// specified loop. This should be used by transformations that restructure /// the loop hierarchy tree. |