summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-01-08 23:25:06 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-01-08 23:25:06 +0000
commit9bbba276e9e0515012826ce968b383dd89c65320 (patch)
treed6ecbb54659d691826605a064b8e6b46494d4e8c /lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
parent0ad1b71fe37af3f3230b40e03e3a511c78152bad (diff)
downloadbcm5719-llvm-9bbba276e9e0515012826ce968b383dd89c65320.tar.gz
bcm5719-llvm-9bbba276e9e0515012826ce968b383dd89c65320.zip
Change std::sort to llvm::sort to detect non-determinism.
LLVM added wrappers to std::sort (r327219) that randomly shuffle the container before sorting. The goal is to uncover non-determinism due to undefined sorting order of objects having the same key. This can be enabled with -DLLVM_ENABLE_EXPENSIVE_CHECKS=ON. llvm-svn: 350679
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp')
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
index f03c7147569..59d7fe01c24 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
@@ -1653,10 +1653,10 @@ static bool ImportOffsetMap(llvm::DenseMap<const D *, O> &destination_map,
std::vector<PairType> sorted_items;
sorted_items.reserve(source_map.size());
sorted_items.assign(source_map.begin(), source_map.end());
- std::sort(sorted_items.begin(), sorted_items.end(),
- [](const PairType &lhs, const PairType &rhs) {
- return lhs.second < rhs.second;
- });
+ llvm::sort(sorted_items.begin(), sorted_items.end(),
+ [](const PairType &lhs, const PairType &rhs) {
+ return lhs.second < rhs.second;
+ });
for (const auto &item : sorted_items) {
DeclFromUser<D> user_decl(const_cast<D *>(item.first));
OpenPOWER on IntegriCloud