projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use std::is_sorted and std::none_of instead of manual loops. NFC
[oota-llvm.git]
/
lib
/
Analysis
/
MemoryDependenceAnalysis.cpp
diff --git
a/lib/Analysis/MemoryDependenceAnalysis.cpp
b/lib/Analysis/MemoryDependenceAnalysis.cpp
index
3e80bfe
..
d1484be
100644
(file)
--- a/
lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/
lib/Analysis/MemoryDependenceAnalysis.cpp
@@
-792,10
+792,8
@@
MemDepResult MemoryDependenceAnalysis::getDependency(Instruction *QueryInst) {
static void AssertSorted(MemoryDependenceAnalysis::NonLocalDepInfo &Cache,
int Count = -1) {
if (Count == -1) Count = Cache.size();
static void AssertSorted(MemoryDependenceAnalysis::NonLocalDepInfo &Cache,
int Count = -1) {
if (Count == -1) Count = Cache.size();
- if (Count == 0) return;
-
- for (unsigned i = 1; i != unsigned(Count); ++i)
- assert(!(Cache[i] < Cache[i-1]) && "Cache isn't sorted!");
+ assert(std::is_sorted(Cache.begin(), Cache.begin() + Count) &&
+ "Cache isn't sorted!");
}
#endif
}
#endif