add isl_div_copy
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 23 Oct 2010 12:41:59 +0000 (14:41 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 26 Oct 2010 15:02:58 +0000 (17:02 +0200)
include/isl_div.h
isl_div.c

index 8d21510..f9b590f 100644 (file)
@@ -29,6 +29,7 @@ typedef struct isl_div isl_div;
 struct isl_div *isl_div_alloc(struct isl_dim *dim);
 struct isl_div *isl_basic_map_div(struct isl_basic_map *bmap, int pos);
 struct isl_div *isl_basic_set_div(struct isl_basic_set *bset, int pos);
+__isl_give isl_div *isl_div_copy(__isl_keep isl_div *div);
 void isl_div_free(struct isl_div *c);
 
 void isl_div_get_constant(__isl_keep isl_div *div, isl_int *v);
index 5c402db..3db5ad2 100644 (file)
--- a/isl_div.c
+++ b/isl_div.c
@@ -88,6 +88,15 @@ struct isl_div *isl_div_alloc(struct isl_dim *dim)
        return isl_basic_map_div(bmap, 0);
 }
 
+__isl_give isl_div *isl_div_copy(__isl_keep isl_div *div)
+{
+       if (!div)
+               return NULL;
+
+       div->ref++;
+       return div;
+}
+
 void isl_div_free(struct isl_div *c)
 {
        if (!c)