[ADT/STLExtras.h] - Add llvm::is_sorted wrapper and update callers.

It can be used to avoid passing the begin and end of a range.
This makes the code shorter and it is consistent with another
wrappers we already have.

Differential revision: https://reviews.llvm.org/D78016
This commit is contained in:
Georgii Rymar
2020-04-13 14:46:41 +03:00
parent 58516718fc
commit 1647ff6e27
35 changed files with 129 additions and 144 deletions

View File

@@ -231,9 +231,9 @@ static void predictValueUseListOrderImpl(const Value *V, const Function *F,
return LU->getOperandNo() > RU->getOperandNo();
});
if (std::is_sorted(
List.begin(), List.end(),
[](const Entry &L, const Entry &R) { return L.second < R.second; }))
if (llvm::is_sorted(List, [](const Entry &L, const Entry &R) {
return L.second < R.second;
}))
// Order is already correct.
return;