diff options
| author | Cong Hou <congh@google.com> | 2015-07-16 23:23:35 +0000 |
|---|---|---|
| committer | Cong Hou <congh@google.com> | 2015-07-16 23:23:35 +0000 |
| commit | 9b4f6b2650fb7db7c09755dcb731a6d68e4ffe11 (patch) | |
| tree | 81ae3342d8eda7710c366f38cc2ab9c4b9dadac2 /llvm/lib/Analysis/LoopInfo.cpp | |
| parent | d8b775a16609141654e8cd62044bfdb991e19961 (diff) | |
| download | bcm5719-llvm-9b4f6b2650fb7db7c09755dcb731a6d68e4ffe11.tar.gz bcm5719-llvm-9b4f6b2650fb7db7c09755dcb731a6d68e4ffe11.zip | |
Add new constructors for LoopInfo/DominatorTree/BFI/BPI
Those new constructors make it more natural to construct an object for a function. For example, previously to build a LoopInfo for a function, we need four statements:
DominatorTree DT;
LoopInfo LI;
DT.recalculate(F);
LI.analyze(DT);
Now we only need one statement:
LoopInfo LI(DominatorTree(F));
http://reviews.llvm.org/D11274
llvm-svn: 242486
Diffstat (limited to 'llvm/lib/Analysis/LoopInfo.cpp')
| -rw-r--r-- | llvm/lib/Analysis/LoopInfo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp index 7ca811067d4..bd0686075a9 100644 --- a/llvm/lib/Analysis/LoopInfo.cpp +++ b/llvm/lib/Analysis/LoopInfo.cpp @@ -602,6 +602,10 @@ Loop *UnloopUpdater::getNearestLoop(BasicBlock *BB, Loop *BBLoop) { return NearLoop; } +LoopInfo::LoopInfo(const DominatorTreeBase<BasicBlock> &DomTree) { + analyze(DomTree); +} + /// updateUnloop - The last backedge has been removed from a loop--now the /// "unloop". Find a new parent for the blocks contained within unloop and /// update the loop tree. We don't necessarily have valid dominators at this |

