Grang, Mandeep Singh via llvm-dev
2018-Apr-13 20:24 UTC
[llvm-dev] 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180413/f521f2e5/attachment.html>
Tim Northover via llvm-dev
2018-Apr-13 21:37 UTC
[llvm-dev] [cfe-dev] llvm::sort - A new wrapper to std::sort
On 13 April 2018 at 21:24, Grang, Mandeep Singh via cfe-dev <cfe-dev at lists.llvm.org> wrote:> 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?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.
Grang, Mandeep Singh via llvm-dev
2018-Apr-15 01:18 UTC
[llvm-dev] [cfe-dev] llvm::sort - A new wrapper to std::sort
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 On 4/13/2018 2:37 PM, Tim Northover wrote:> On 13 April 2018 at 21:24, Grang, Mandeep Singh via cfe-dev > <cfe-dev at lists.llvm.org> wrote: >> 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? > 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.