isl_constraint: drop constraint iteration
authorSven Verdoolaege <skimo@kotnet.org>
Mon, 27 Jun 2011 08:25:52 +0000 (10:25 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 23 Jul 2011 13:19:01 +0000 (15:19 +0200)
isl_constraint used to have two meanings, one as an iterator for
the constraints in a set or relation and one as an independent constraint.
We want to get rid of the first meaning because it allows the user
to change one object through another object.
In particular, we remove here the ability to iterate over the constraints
of a basic map through an isl_constraint object.

These function were never documented, but they were used by CLooG.
Now that CLooG has been updated not to use them, we can remove them.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
include/isl/constraint.h
isl_constraint.c

index 6f2e8c7..8c655bb 100644 (file)
@@ -31,11 +31,6 @@ struct isl_constraint *isl_constraint_cow(struct isl_constraint *c);
 struct isl_constraint *isl_constraint_copy(struct isl_constraint *c);
 void isl_constraint_free(struct isl_constraint *c);
 
-__isl_give isl_constraint *isl_basic_map_first_constraint(
-       __isl_take isl_basic_map *bmap);
-__isl_give isl_constraint *isl_basic_set_first_constraint(
-       __isl_take isl_basic_set *bset);
-struct isl_constraint *isl_constraint_next(struct isl_constraint *c);
 int isl_basic_map_foreach_constraint(__isl_keep isl_basic_map *bmap,
        int (*fn)(__isl_take isl_constraint *c, void *user), void *user);
 int isl_basic_set_foreach_constraint(__isl_keep isl_basic_set *bset,
index 7c4b778..8179d4b 100644 (file)
@@ -171,44 +171,6 @@ void isl_constraint_free(struct isl_constraint *c)
        free(c);
 }
 
-__isl_give isl_constraint *isl_basic_map_first_constraint(
-       __isl_take isl_basic_map *bmap)
-{
-       if (!bmap)
-               return NULL;
-
-       if (bmap->n_eq > 0)
-               return isl_basic_map_constraint(bmap, &bmap->eq[0]);
-
-       if (bmap->n_ineq > 0)
-               return isl_basic_map_constraint(bmap, &bmap->ineq[0]);
-
-       isl_basic_map_free(bmap);
-       return NULL;
-}
-
-__isl_give isl_constraint *isl_basic_set_first_constraint(
-       __isl_take isl_basic_set *bset)
-{
-       return isl_basic_map_first_constraint((struct isl_basic_map *)bset);
-}
-
-struct isl_constraint *isl_constraint_next(struct isl_constraint *c)
-{
-       c = isl_constraint_cow(c);
-       if (c->line >= c->bmap->eq) {
-               c->line++;
-               if (c->line < c->bmap->eq + c->bmap->n_eq)
-                       return c;
-               c->line = c->bmap->ineq;
-       } else
-               c->line++;
-       if (c->line < c->bmap->ineq + c->bmap->n_ineq)
-               return c;
-       isl_constraint_free(c);
-       return NULL;
-}
-
 int isl_basic_map_foreach_constraint(__isl_keep isl_basic_map *bmap,
        int (*fn)(__isl_take isl_constraint *c, void *user), void *user)
 {