add isl_stream_read_set
authorSven Verdoolaege <skimo@kotnet.org>
Mon, 14 Jun 2010 12:33:59 +0000 (14:33 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 14 Jun 2010 12:33:59 +0000 (14:33 +0200)
include/isl_stream.h
isl_input.c

index efedee1..fbe753d 100644 (file)
@@ -85,6 +85,7 @@ enum isl_token_type isl_stream_register_keyword(struct isl_stream *s,
 
 struct isl_obj isl_stream_read_obj(struct isl_stream *s);
 __isl_give isl_map *isl_stream_read_map(struct isl_stream *s, int nparam);
+__isl_give isl_set *isl_stream_read_set(struct isl_stream *s, int nparam);
 __isl_give isl_pw_qpolynomial *isl_stream_read_pw_qpolynomial(
        struct isl_stream *s);
 
index e2a7ebf..c9c4258 100644 (file)
@@ -1398,6 +1398,21 @@ error:
        return NULL;
 }
 
+__isl_give isl_set *isl_stream_read_set(struct isl_stream *s, int nparam)
+{
+       struct isl_obj obj;
+       struct isl_set *set;
+
+       obj = obj_read(s, nparam);
+       if (obj.v)
+               isl_assert(s->ctx, obj.type == isl_obj_set, goto error);
+
+       return obj.v;
+error:
+       obj.type->free(obj.v);
+       return NULL;
+}
+
 static struct isl_basic_map *basic_map_read(struct isl_stream *s, int nparam)
 {
        struct isl_obj obj;