summaryrefslogtreecommitdiff
path: root/isl_div.c
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@kotnet.org>2008-12-29 15:41:37 +0100
committerSven Verdoolaege <skimo@kotnet.org>2009-01-06 19:10:49 +0100
commit3fcebd4b1de0df05ca17add7f92c70fbafda0b64 (patch)
tree0ea1b1092c9a0c47758dca808a27f76973c9476e /isl_div.c
parent98398e41f595bfa12cf1dc7cf4d83ae96f222c0d (diff)
downloadisl-3fcebd4b1de0df05ca17add7f92c70fbafda0b64.tar.gz
isl-3fcebd4b1de0df05ca17add7f92c70fbafda0b64.tar.bz2
isl-3fcebd4b1de0df05ca17add7f92c70fbafda0b64.zip
isl_constraint: add limited support for adding divs
Diffstat (limited to 'isl_div.c')
-rw-r--r--isl_div.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/isl_div.c b/isl_div.c
index 6cfaeccb..141bec92 100644
--- a/isl_div.c
+++ b/isl_div.c
@@ -1,5 +1,6 @@
#include <isl_div.h>
#include <isl_map.h>
+#include "isl_map_private.h"
static unsigned n(struct isl_div *d, enum isl_dim_type type)
{
@@ -46,6 +47,22 @@ error:
return NULL;
}
+struct isl_div *isl_div_alloc(struct isl_dim *dim)
+{
+ struct isl_basic_map *bmap;
+
+ if (!dim)
+ return NULL;
+
+ bmap = isl_basic_map_alloc_dim(dim, 1, 0, 0);
+ if (!bmap)
+ return NULL;
+
+ isl_basic_map_alloc_div(bmap);
+ isl_seq_clr(bmap->div[0], 1 + 1 + isl_basic_map_total_dim(bmap));
+ return isl_basic_map_div(bmap, &bmap->div[0]);
+}
+
struct isl_div *isl_div_free(struct isl_div *c)
{
if (!c)