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/Breakpoint/BreakpointResolver.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/Breakpoint/BreakpointResolver.cpp')
-rw-r--r-- | lldb/source/Breakpoint/BreakpointResolver.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lldb/source/Breakpoint/BreakpointResolver.cpp b/lldb/source/Breakpoint/BreakpointResolver.cpp index a2a655fe4b5..0a1eeed2895 100644 --- a/lldb/source/Breakpoint/BreakpointResolver.cpp +++ b/lldb/source/Breakpoint/BreakpointResolver.cpp @@ -238,10 +238,10 @@ void BreakpointResolver::SetSCMatchesByLine(SearchFilter &filter, worklist_begin, worklist_end, [&](const SymbolContext &sc) { return SourceLoc(sc) < requested; }); // Sort the remaining entries by (line, column). - std::sort(worklist_begin, worklist_end, - [](const SymbolContext &a, const SymbolContext &b) { - return SourceLoc(a) < SourceLoc(b); - }); + llvm::sort(worklist_begin, worklist_end, + [](const SymbolContext &a, const SymbolContext &b) { + return SourceLoc(a) < SourceLoc(b); + }); // Filter out all locations with a source location after the closest match. if (worklist_begin != worklist_end) @@ -261,11 +261,11 @@ void BreakpointResolver::SetSCMatchesByLine(SearchFilter &filter, } // Sort by file address. - std::sort(worklist_begin, worklist_end, - [](const SymbolContext &a, const SymbolContext &b) { - return a.line_entry.range.GetBaseAddress().GetFileAddress() < - b.line_entry.range.GetBaseAddress().GetFileAddress(); - }); + llvm::sort(worklist_begin, worklist_end, + [](const SymbolContext &a, const SymbolContext &b) { + return a.line_entry.range.GetBaseAddress().GetFileAddress() < + b.line_entry.range.GetBaseAddress().GetFileAddress(); + }); // Go through and see if there are line table entries that are // contiguous, and if so keep only the first of the contiguous range. |