1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

add a version of array_pod_sort that takes a custom comparator function.

llvm-svn: 88861
This commit is contained in:
Chris Lattner 2009-11-15 19:52:43 +00:00
parent b73208f294
commit 89c83b159c

View File

@ -270,6 +270,14 @@ static inline void array_pod_sort(IteratorTy Start, IteratorTy End) {
get_array_pad_sort_comparator(*Start));
}
template<class IteratorTy>
static inline void array_pod_sort(IteratorTy Start, IteratorTy End,
int (*Compare)(const void*, const void*)) {
// Don't dereference start iterator of empty sequence.
if (Start == End) return;
qsort(&*Start, End-Start, sizeof(*Start), Compare);
}
} // End llvm namespace
#endif