aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-08-26 03:06:34 +0000
committerAndrew Trick <atrick@apple.com>2011-08-26 03:06:34 +0000
commit5434c1e73b6e56756719d2aebb952ac7bb3829e0 (patch)
treeac6be0bd94234dd667f1f6f448e3c09bc02fd8fc /include
parent069e2ed794a90cb5108a35627ee148866795f140 (diff)
downloadexternal_llvm-5434c1e73b6e56756719d2aebb952ac7bb3829e0.zip
external_llvm-5434c1e73b6e56756719d2aebb952ac7bb3829e0.tar.gz
external_llvm-5434c1e73b6e56756719d2aebb952ac7bb3829e0.tar.bz2
LoopInfo::updateUnloop fix, and verify Block->Loop maps.
Fixes an oversight, and adds verification to catch it in the unloop.ll tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138622 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/LoopInfo.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h
index 7c89744..12cb6c5 100644
--- a/include/llvm/Analysis/LoopInfo.h
+++ b/include/llvm/Analysis/LoopInfo.h
@@ -33,6 +33,7 @@
#include "llvm/Pass.h"
#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/SmallVector.h"
@@ -484,12 +485,13 @@ public:
}
/// verifyLoop - Verify loop structure of this loop and all nested loops.
- void verifyLoopNest() const {
+ void verifyLoopNest(DenseSet<const LoopT*> *Loops) const {
+ Loops->insert(static_cast<const LoopT *>(this));
// Verify this loop.
verifyLoop();
// Verify the subloops.
for (iterator I = begin(), E = end(); I != E; ++I)
- (*I)->verifyLoopNest();
+ (*I)->verifyLoopNest(Loops);
}
void print(raw_ostream &OS, unsigned Depth = 0) const {
@@ -640,6 +642,7 @@ class LoopInfoBase {
DenseMap<BlockT *, LoopT *> BBMap;
std::vector<LoopT *> TopLevelLoops;
friend class LoopBase<BlockT, LoopT>;
+ friend class LoopInfo;
void operator=(const LoopInfoBase &); // do not implement
LoopInfoBase(const LoopInfo &); // do not implement