diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-01-08 23:25:06 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-01-08 23:25:06 +0000 |
commit | 9bbba276e9e0515012826ce968b383dd89c65320 (patch) | |
tree | d6ecbb54659d691826605a064b8e6b46494d4e8c /lldb/source/Symbol/Symtab.cpp | |
parent | 0ad1b71fe37af3f3230b40e03e3a511c78152bad (diff) | |
download | bcm5719-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/Symbol/Symtab.cpp')
-rw-r--r-- | lldb/source/Symbol/Symtab.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp index 8131cd5f5b1..2472580a41d 100644 --- a/lldb/source/Symbol/Symtab.cpp +++ b/lldb/source/Symbol/Symtab.cpp @@ -610,10 +610,9 @@ void Symtab::SortSymbolIndexesByValue(std::vector<uint32_t> &indexes, return; // Sort the indexes in place using std::stable_sort. - // NOTE: The use of std::stable_sort instead of std::sort here is strictly for - // performance, - // not correctness. The indexes vector tends to be "close" to sorted, which - // the stable sort handles better. + // NOTE: The use of std::stable_sort instead of llvm::sort here is strictly + // for performance, not correctness. The indexes vector tends to be "close" + // to sorted, which the stable sort handles better. std::vector<lldb::addr_t> addr_cache(m_symbols.size(), LLDB_INVALID_ADDRESS); @@ -1132,7 +1131,7 @@ size_t Symtab::FindFunctionSymbols(const ConstString &name, } if (!symbol_indexes.empty()) { - std::sort(symbol_indexes.begin(), symbol_indexes.end()); + llvm::sort(symbol_indexes.begin(), symbol_indexes.end()); symbol_indexes.erase( std::unique(symbol_indexes.begin(), symbol_indexes.end()), symbol_indexes.end()); |