X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=isl_flow.c;h=8dca5c44e8729641a47bf1e530ebb12406c760af;hb=de51a9bc4da5dd3f1f9f57c2362da6f9752c44e0;hp=6367a2611cdec1172f75bfb99b03e7bb816a229c;hpb=b522fa3e230ed4049a2f88b54288f71f6256ca5e;p=platform%2Fupstream%2Fisl.git diff --git a/isl_flow.c b/isl_flow.c index 6367a26..8dca5c4 100644 --- a/isl_flow.c +++ b/isl_flow.c @@ -4,7 +4,7 @@ * Copyright 2010 INRIA Saclay * Copyright 2012 Universiteit Leiden * - * Use of this software is governed by the GNU LGPLv2.1 license + * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, Leiden Institute of Advanced Computer Science, * Universiteit Leiden, Niels Bohrweg 1, 2333 CA Leiden, The Netherlands @@ -17,7 +17,7 @@ #include #include #include -#include +#include enum isl_restriction_type { isl_restriction_type_empty, @@ -227,17 +227,18 @@ error: /* Free the given isl_access_info structure. */ -void isl_access_info_free(__isl_take isl_access_info *acc) +void *isl_access_info_free(__isl_take isl_access_info *acc) { int i; if (!acc) - return; + return NULL; isl_map_free(acc->domain_map); isl_map_free(acc->sink.map); for (i = 0; i < acc->n_must + acc->n_may; ++i) isl_map_free(acc->source[i].map); free(acc); + return NULL; } isl_ctx *isl_access_info_get_ctx(__isl_keep isl_access_info *acc) @@ -268,7 +269,7 @@ __isl_give isl_access_info *isl_access_info_add_source( isl_ctx *ctx; if (!acc) - return NULL; + goto error; ctx = isl_map_get_ctx(acc->sink.map); isl_assert(ctx, acc->n_must + acc->n_may < acc->max_source, goto error); @@ -339,8 +340,9 @@ static __isl_give isl_access_info *isl_access_info_sort_sources( if (acc->n_must <= 1) return acc; - isl_quicksort(acc->source, acc->n_must, sizeof(struct isl_labeled_map), - access_sort_cmp, acc); + if (isl_sort(acc->source, acc->n_must, sizeof(struct isl_labeled_map), + access_sort_cmp, acc) < 0) + return isl_access_info_free(acc); return acc; }