On 10/16/14 09:16, Zamyatin, Igor wrote:


c-family/Changelog:

2014-10-03  Igor Zamyatin  <igor.zamya...@intel.com>

        PR c/63307
        * cilk.c: Include vec.h.
        (struct cilk_decls): New structure.
        (wrapper_parm_cb): Split this function to...
        (fill_decls_vec): ...this...
        (create_parm_list): ...and this.
        (compare_decls): New function.
        (for_local_cb): Remove.
        (wrapper_local_cb): Ditto.
        (build_wrapper_type): For now first traverse and fill vector of
        declarations then sort it and then deal with sorted vector.
        (cilk_outline): Ditto.
        (declare_one_free_variable): Ditto.
OK for the trunk.  No sure if Jakub wants to backport to 4.9 or not.
That'd be his call.

Sure, I have also a patch for 4.9.


+
+static int
+compare_decls (const void *a, const void *b) {
+  const struct cilk_decls* t1 = (const struct cilk_decls*) a;
+  const struct cilk_decls* t2 = (const struct cilk_decls*) b;
+
+  return DECL_UID (t1->key) > DECL_UID (t2->key);
We really prefer fully specified sorts.   For a qsort callback, this
doesn't look fully specified.


With that fixed, this should be OK.

jeff

Thanks for the review. Here is the updated version.
Is it ok?
Yes, this is good for the trunk.

Thanks,
Jeff

Reply via email to