[LCSSA] Use llvm::any_of instead of std::size_of.

The API is simpler. Suggested by David Blaikie!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269800 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Davide Italiano
2016-05-17 19:01:02 +00:00
parent 4e35fa54a6
commit 809c94de33

View File

@@ -53,8 +53,7 @@ STATISTIC(NumLCSSA, "Number of live out of a loop variables");
/// Return true if the specified block is in the list.
static bool isExitBlock(BasicBlock *BB,
const SmallVectorImpl<BasicBlock *> &ExitBlocks) {
return std::any_of(ExitBlocks.begin(), ExitBlocks.end(),
[&](BasicBlock *EB) { return EB == BB; });
return llvm::any_of(ExitBlocks, [&](BasicBlock *EB) { return EB == BB; });
}
/// Given an instruction in the loop, check to see if it has any uses that are
@@ -208,7 +207,7 @@ blockDominatesAnExit(BasicBlock *BB,
DominatorTree &DT,
const SmallVectorImpl<BasicBlock *> &ExitBlocks) {
DomTreeNode *DomNode = DT.getNode(BB);
return std::any_of(ExitBlocks.begin(), ExitBlocks.end(), [&](BasicBlock *EB) {
return llvm::any_of(ExitBlocks, [&](BasicBlock * EB) {
return DT.dominates(DomNode, DT.getNode(EB));
});
}