isl_stream_read_map: accept 'true' and 'false' constraints
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 16 Feb 2011 15:07:11 +0000 (16:07 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 17 Feb 2011 18:50:22 +0000 (19:50 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
include/isl/stream.h
isl_input.c
isl_stream.c

index 1fad576..33d0ffe 100644 (file)
@@ -28,6 +28,7 @@ enum isl_token_type { ISL_TOKEN_ERROR = -1,
                        ISL_TOKEN_OR, ISL_TOKEN_EXISTS, ISL_TOKEN_NOT,
                        ISL_TOKEN_DEF, ISL_TOKEN_INFTY, ISL_TOKEN_NAN,
                        ISL_TOKEN_MAX, ISL_TOKEN_RAT,
+                       ISL_TOKEN_TRUE, ISL_TOKEN_FALSE,
                        ISL_TOKEN_STRING,
                        ISL_TOKEN_LAST };
 
index 6d5a5f6..ed21140 100644 (file)
@@ -990,6 +990,15 @@ static __isl_give isl_map *read_conjunct(struct isl_stream *s,
 
        if (isl_stream_eat_if_available(s, ISL_TOKEN_EXISTS))
                return read_exists(s, v, bmap);
+
+       if (isl_stream_eat_if_available(s, ISL_TOKEN_TRUE))
+               return isl_map_from_basic_map(bmap);
+
+       if (isl_stream_eat_if_available(s, ISL_TOKEN_FALSE)) {
+               isl_dim *dim = isl_basic_map_get_dim(bmap);
+               isl_basic_map_free(bmap);
+               return isl_map_empty(dim);
+       }
                
        return read_constraint(s, v, bmap);
 error:
index ce50657..de8855a 100644 (file)
@@ -235,6 +235,10 @@ static enum isl_token_type check_keywords(struct isl_stream *s)
                return ISL_TOKEN_MAX;
        if (!strcasecmp(s->buffer, "rat"))
                return ISL_TOKEN_RAT;
+       if (!strcasecmp(s->buffer, "true"))
+               return ISL_TOKEN_TRUE;
+       if (!strcasecmp(s->buffer, "false"))
+               return ISL_TOKEN_FALSE;
 
        if (!s->keywords)
                return ISL_TOKEN_IDENT;