[PATCH] D35473: [ELF] compareByFilePosition requires stable_sort
Shoaib Meenai via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 17 12:40:38 PDT 2017
smeenai added inline comments.
================
Comment at: ELF/LinkerScript.cpp:1087
if ((Sec->Flags & SHF_LINK_ORDER)) {
- std::sort(Sections.begin(), Sections.end(), compareByFilePosition);
+ // compareByFilePosition requires stable_sort (see comment in it).
+ std::stable_sort(Sections.begin(), Sections.end(), compareByFilePosition);
----------------
ruiu wrote:
> I think you don't have to write this comment here, as we use std::stable_sort everywhere for reproducibility.
I'll remove it before committing.
https://reviews.llvm.org/D35473
More information about the llvm-commits
mailing list