diff options
author | Craig Topper <craig.topper@gmail.com> | 2016-01-03 19:43:40 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2016-01-03 19:43:40 +0000 |
commit | e30b8ca149076601ee593d93a35e39f7e7e219eb (patch) | |
tree | a6273f17560d62d30d1871600620232b43cfbdb6 /llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | |
parent | 1f26d5b1e0a3ff4b1adfe5fc81acaecbc5e4a5c0 (diff) | |
download | llvm-e30b8ca149076601ee593d93a35e39f7e7e219eb.zip llvm-e30b8ca149076601ee593d93a35e39f7e7e219eb.tar.gz llvm-e30b8ca149076601ee593d93a35e39f7e7e219eb.tar.bz2 |
Use std::is_sorted and std::none_of instead of manual loops. NFC
llvm-svn: 256719
Diffstat (limited to 'llvm/lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp index 3e80bfe..d1484be 100644 --- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/llvm/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(); - 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 |