From 8130dbe98eae620bb2d2e23e30425cae8d6f0ec6 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 16 Feb 2011 16:07:11 +0100 Subject: [PATCH] isl_stream_read_map: accept 'true' and 'false' constraints Signed-off-by: Sven Verdoolaege --- include/isl/stream.h | 1 + isl_input.c | 9 +++++++++ isl_stream.c | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/include/isl/stream.h b/include/isl/stream.h index 1fad576..33d0ffe 100644 --- a/include/isl/stream.h +++ b/include/isl/stream.h @@ -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 }; diff --git a/isl_input.c b/isl_input.c index 6d5a5f6..ed21140 100644 --- a/isl_input.c +++ b/isl_input.c @@ -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: diff --git a/isl_stream.c b/isl_stream.c index ce50657..de8855a 100644 --- a/isl_stream.c +++ b/isl_stream.c @@ -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; -- 2.7.4