llvm::sort - A new wrapper to std::sort

r327219 added a new wrapper function called llvm::sort. If EXPENSIVE_CHECKS is enabled, llvm::sort will randomly shuffle the container before invoking std::sort. This will help uncover non-deterministic ordering of objects having the same key.

All occurrences of std::sort have been changed to llvm::sort in llvm/clang/polly repos.

Going forward please make sure to avoid use of std::sort and instead use llvm::sort. Maybe we should add a note on the usage of llvm::sort to the LLVM Coding Standards?

Thanks,
Mandeep

Very definitely. I quite like the idea, but banning a standard library
function on this scale is a big step and needs to be justified.
Generally we try to move in the other direction.

Really, this announcement should have linked to the original discussion.

Cheers.

Tim.

Thanks Tim. I will add a note about llvm::sort to the coding guidelines.

Really, this announcement should have linked to the original discussion.

The bulk of the discussion is on the comments of the patch https://reviews.llvm.org/D39245.
And here is the email which details the failures uncovered by the patch http://lists.llvm.org/pipermail/llvm-dev/2017-October/118639.html

--Mandeep