diff options
author | Mandeep Singh Grang <mgrang@codeaurora.org> | 2018-03-27 16:50:00 +0000 |
---|---|---|
committer | Mandeep Singh Grang <mgrang@codeaurora.org> | 2018-03-27 16:50:00 +0000 |
commit | c205d8cc8dcce3d9f47f9d78c03eed7820d265e9 (patch) | |
tree | 3e4c2781e80d071551b7ad85dbcbd7fa2fbd6b72 /clang/lib/Tooling/Core | |
parent | 52396bb9c55044063c25bc19e8f22e32d4df11e3 (diff) | |
download | bcm5719-llvm-c205d8cc8dcce3d9f47f9d78c03eed7820d265e9.tar.gz bcm5719-llvm-c205d8cc8dcce3d9f47f9d78c03eed7820d265e9.zip |
[clang] Change std::sort to llvm::sort in response to r327219
r327219 added wrappers to std::sort which randomly shuffle the container before
sorting. This will help in uncovering non-determinism caused due to undefined
sorting order of objects having the same key.
To make use of that infrastructure we need to invoke llvm::sort instead of
std::sort.
llvm-svn: 328636
Diffstat (limited to 'clang/lib/Tooling/Core')
-rw-r--r-- | clang/lib/Tooling/Core/Replacement.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Tooling/Core/Replacement.cpp b/clang/lib/Tooling/Core/Replacement.cpp index 54b7ca8fafe..d13a2765fd7 100644 --- a/clang/lib/Tooling/Core/Replacement.cpp +++ b/clang/lib/Tooling/Core/Replacement.cpp @@ -483,11 +483,11 @@ Replacements Replacements::merge(const Replacements &ReplacesToMerge) const { // Returns a set of non-overlapping and sorted ranges that is equivalent to // \p Ranges. static std::vector<Range> combineAndSortRanges(std::vector<Range> Ranges) { - std::sort(Ranges.begin(), Ranges.end(), - [](const Range &LHS, const Range &RHS) { - if (LHS.getOffset() != RHS.getOffset()) - return LHS.getOffset() < RHS.getOffset(); - return LHS.getLength() < RHS.getLength(); + llvm::sort(Ranges.begin(), Ranges.end(), + [](const Range &LHS, const Range &RHS) { + if (LHS.getOffset() != RHS.getOffset()) + return LHS.getOffset() < RHS.getOffset(); + return LHS.getLength() < RHS.getLength(); }); std::vector<Range> Result; for (const auto &R : Ranges) { |