return DenseBlockSet;
}
+ /// Return a direct, immutable handle to the blocks set.
+ const SmallPtrSetImpl<const BlockT *> &getBlocksSet() const {
+ assert(!isInvalid() && "Loop not in a valid state!");
+ return DenseBlockSet;
+ }
+
/// Return true if this loop is no longer valid. The only valid use of this
/// helper is "assert(L.isInvalid())" or equivalent, since IsInvalid is set to
/// true by the destructor. In other words, if this accessor returns true,
std::vector<BlockT *> OtherBBs = OtherL->getBlocks();
assert(compareVectors(BBs, OtherBBs) &&
"Mismatched basic blocks in the loops!");
+
+ const SmallPtrSetImpl<const BlockT *> &BlocksSet = L->getBlocksSet();
+ const SmallPtrSetImpl<const BlockT *> &OtherBlocksSet = L->getBlocksSet();
+ assert(BlocksSet.size() == OtherBlocksSet.size() &&
+ std::all_of(BlocksSet.begin(), BlocksSet.end(),
+ [&OtherBlocksSet](const BlockT *BB) {
+ return OtherBlocksSet.count(BB);
+ }) &&
+ "Mismatched basic blocks in BlocksSets!");
}
#endif
LoopT *L = Entry.second;
assert(Loops.count(L) && "orphaned loop");
assert(L->contains(BB) && "orphaned block");
+ for (LoopT *ChildLoop : *L)
+ assert(!ChildLoop->contains(BB) &&
+ "BBMap should point to the innermost loop containing BB");
}
// Recompute LoopInfo to verify loops structure.