isl_map_range: correctly handle maps with 0D domains
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 4 May 2011 13:03:27 +0000 (15:03 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 5 May 2011 10:18:10 +0000 (12:18 +0200)
Internally, sets are represented as maps with unnamed, unstructured
0D domains.  isl_map_range takes advantage of this fact, but only
checked for 0D domains.  This was correct when isl_map_range was added,
but it should have been updated when named and structured spaces were
introduced.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_map.c

index fbf95f7..334f383 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -3926,7 +3926,8 @@ struct isl_set *isl_map_range(struct isl_map *map)
 
        if (!map)
                goto error;
-       if (isl_map_dim(map, isl_dim_in) == 0)
+       if (isl_map_dim(map, isl_dim_in) == 0 &&
+           !isl_dim_is_named_or_nested(map->dim, isl_dim_in))
                return (isl_set *)map;
 
        map = isl_map_cow(map);