sort.cc: introduce gcc_sort_r
authorAlexander Monakov <amonakov@ispras.ru>
Thu, 1 Aug 2019 17:14:53 +0000 (20:14 +0300)
committerAlexander Monakov <amonakov@gcc.gnu.org>
Thu, 1 Aug 2019 17:14:53 +0000 (20:14 +0300)
commitce0454d9419dbcd73e65dae2a3eba15eeddbe338
tree77afb8b4e0b9aa4081ff1695ebd5ff725a38b365
parentf339eb66071559a02a0c05b3ee89fc8352969bc9
sort.cc: introduce gcc_sort_r

* sort.cc (sort_r_ctx): New struct.
(reorder23): Make templated on context type.
(reorder45): Ditto.
(cmp1): Ditto.  Adjust signature.
(netsort): Ditto.
(mergesort): Ditto.
[CHECKING_P] (cmp2to3): New static function.  Use it...
(gcc_qsort) [CHECKING_P]: ...here.
(gcc_sort_r): New function.
* system.h (sort_r_cmp_fn): New function typedef.
(qsort_chk): Adjust signature.
(gcc_sort_r): Declare.
* vec.c (qsort_chk_error): Adjust.
(qsort_chk): Adjust.

From-SVN: r273977
gcc/ChangeLog
gcc/sort.cc
gcc/system.h
gcc/vec.c