[PATCH] D35473: [ELF] compareByFilePosition requires stable_sort

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 17 10:54:02 PDT 2017


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM



================
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);
----------------
I think you don't have to write this comment here, as we use std::stable_sort everywhere for reproducibility.


https://reviews.llvm.org/D35473





More information about the llvm-commits mailing list