isl_basic_map_plain_is_empty doesn't look at the constraints but only
at the ISL_BASIC_MAP_EMPTY flag. We therefore need to make sure the
flag is set on the output of isl_basic_map_insert if it was set on the
input.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
bmap->n_div, bmap->n_eq, bmap->n_ineq);
if (isl_basic_map_is_rational(bmap))
res = isl_basic_map_set_rational(res);
+ if (isl_basic_map_plain_is_empty(bmap)) {
+ isl_basic_map_free(bmap);
+ return isl_basic_map_set_to_empty(res);
+ }
res = isl_basic_map_add_constraints_dim_map(res, bmap, dim_map);
return isl_basic_map_finalize(res);
}