aboutsummaryrefslogtreecommitdiff
path: root/gcc/vec.h
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-10-11 15:08:28 +0000
committerNathan Froyd <froydnj@codesourcery.com>2010-10-11 15:08:28 +0000
commit9db286c05836c65ca6b894cfa2cf9a184c569228 (patch)
tree9d05eb59338986451cac8fc5dec9e34fe0c18b48 /gcc/vec.h
parente87a831bdffce64c3180eef435feb40f8155340f (diff)
gcc/
* vec.h (VEC_qsort): Define. * dbxout.c (output_used_types): Use it. * df-scan.c (df_sort_and_compress_refs): Likewise. (df_sort_and_compress_mws): Likewise. * genautomata.c (uniq_sort_alt_states): Likewise. (evaluate_equiv_classes): Likewise. (output_trans_table): Likewise. (output_state): Likewise. * gimplify.c (compare_case_labels): Likewise. * graphite-sese-to-poly.c (graphite_sort_dominated_info): Likewise. * ipa.c (build_cdtor_fns): Likewise. * lto.c (lto_wpa_write_files): Likewise. * sel-sched.c (fill_vec_av_set): Likewise. * tree-predcom.c (determine_roots_comp): Likewise. * tree-sra.c (sort_and_spliace_var_accesses): Likewise. (splice_param_accesses): Likewise. * tree-ssa-live.c (dump_enumerated_decls): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. (reassociate_bb): Likewise. * tree-ssa-sccvn.c (sort_scc): Likewise. * tree-ssa-structalias.c (sort_fieldstack): Likewise. gcc/ada/ * gcc-interface/utils2.c (gnat_build_constructor): Use VEC_qsort. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@165314 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/vec.h')
-rw-r--r--gcc/vec.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/vec.h b/gcc/vec.h
index 1d2f067d8d5..bc55592a2be 100644
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -442,6 +442,12 @@ along with GCC; see the file COPYING3. If not see
#define VEC_address(T,V) (VEC_OP(T,base,address)(VEC_BASE(V)))
+/* Conveniently sort the contents of the vector with qsort.
+ void VEC_qsort (VEC(T) *v, int (*cmp_func)(const void *, const void *)) */
+
+#define VEC_qsort(T,V,CMP) qsort(VEC_address (T,V), VEC_length(T,V), \
+ sizeof (T), CMP)
+
/* Find the first index in the vector not less than the object.
unsigned VEC_T_lower_bound (VEC(T) *v, const T val,
bool (*lessthan) (const T, const T)); // Integer