llvm.org GIT mirror llvm / 9806f83
add a version of array_pod_sort that takes a custom comparator function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88861 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
1 changed file(s) with 8 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
269269 get_array_pad_sort_comparator(*Start));
270270 }
271271
272 template
273 static inline void array_pod_sort(IteratorTy Start, IteratorTy End,
274 int (*Compare)(const void*, const void*)) {
275 // Don't dereference start iterator of empty sequence.
276 if (Start == End) return;
277 qsort(&*Start, End-Start, sizeof(*Start), Compare);
278 }
279
272280 } // End llvm namespace
273281
274282 #endif