Signed-off-by: Sven Verdoolaege <sk...@kotnet.org>
---
doc/cloog.texi | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/doc/cloog.texi b/doc/cloog.texi
index fc2b68b..44fdd40 100644
--- a/doc/cloog.texi
+++ b/doc/cloog.texi
@@ -1524,6 +1524,30 @@ the same time, but an object created within the state of a one
@code{CloogState} structure is not allowed to interact with an object
created within the state of an other @code{CloogState} structure.
+@menu
+* CloogState/isl::
+@end menu
+
+@node CloogState/isl
+@subsubsection isl
+
+@example
+#include <cloog/isl/cloog.h>
+CloogState *cloog_isl_state_malloc(isl_ctx *ctx);
+@end example
+
+@noindent
+When using the isl backend, CLooG will internally create many isl objects.
+If the user creates any CLooG objects from isl objects (e.g.,
+through @code{cloog_domain_from_isl_set} below), then the user needs
+to make sure that these isl objects live in the same @code{isl_ctx}
+as those created by CLooG internally. The best way to ensure this
+property is to pass the @code{isl_ctx} created by the user to CLooG
+by calling @code{cloog_isl_state_malloc} to create a @code{CloogState}.
+Note that this makes the created @code{CloogState} a user of the
+given @code{isl_ctx}, meaning that the @code{CloogState} needs to
+be freed before the @code{isl_ctx} is freed.
+
@node CloogMatrix
@subsection CloogMatrix
--
1.7.8.rc2
Signed-off-by: Sven Verdoolaege <sk...@kotnet.org>
---
doc/cloog.texi | 18 +++++++++---------
include/cloog/isl/domain.h | 4 ++--
source/isl/domain.c | 4 ++--
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/doc/cloog.texi b/doc/cloog.texi
index 44fdd40..0ec4e02 100644
--- a/doc/cloog.texi
+++ b/doc/cloog.texi
@@ -1672,13 +1672,13 @@ in the domain. The input data structure if neither modified nor freed.
@example
#include <cloog/isl/cloog.h>
-CloogDomain *cloog_domain_from_isl_set(struct isl_set *set);
+CloogDomain *cloog_domain_from_isl_set(__isl_take isl_set *set);
__isl_give isl_set *isl_set_from_cloog_domain(CloogDomain *domain);
@end example
@noindent
-The function @code{cloog_domain_from_isl_set} takes a
-@code{struct isl_set} as input and returns a pointer to a @code{CloogDomain}.
-The function consumes a reference to the given @code{struct isl_set}.
+The function @code{cloog_domain_from_isl_set} takes an
+@code{isl_set} as input and returns a pointer to a @code{CloogDomain}.
+The function consumes a reference to the given @code{isl_set}.
Similarly, @code{isl_set_from_cloog_domain} consumes a reference
to a @code{CloogDomain} and returns an @code{isl_set}.
@@ -1736,15 +1736,15 @@ in the domain. The input data structure if neither modified nor freed.
@example
#include <cloog/isl/cloog.h>
-CloogScattering *cloog_scattering_from_isl_map(struct isl_map *map);
+CloogScattering *cloog_scattering_from_isl_map(__isl_take isl_map *map);
@end example
@noindent
-The function @code{cloog_scattering_from_isl_map} takes a
-@code{struct isl_map} as input and returns a pointer to a @code{CloogScattering}.
-The output dimensions of the @code{struct isl_map} correspond to the
+The function @code{cloog_scattering_from_isl_map} takes an
+@code{isl_map} as input and returns a pointer to a @code{CloogScattering}.
+The output dimensions of the @code{isl_map} correspond to the
scattering dimensions, while the input dimensions correspond to the
domain dimensions.
-The function consumes a reference to the given @code{struct isl_map}.
+The function consumes a reference to the given @code{isl_map}.
@node CloogUnionDomain
diff --git a/include/cloog/isl/domain.h b/include/cloog/isl/domain.h
index 427d847..35b47f2 100644
--- a/include/cloog/isl/domain.h
+++ b/include/cloog/isl/domain.h
@@ -20,8 +20,8 @@ struct cloogscattering {
int dummy; /* Solaris cc doesn't like zero-sized structs */
};
-CloogDomain *cloog_domain_from_isl_set(struct isl_set *set);
-CloogScattering *cloog_scattering_from_isl_map(struct isl_map *map);
+CloogDomain *cloog_domain_from_isl_set(__isl_take isl_set *set);
+CloogScattering *cloog_scattering_from_isl_map(__isl_take isl_map *map);
CloogUnionDomain *cloog_union_domain_from_isl_union_map(
__isl_take isl_union_map *umap);
CloogUnionDomain *cloog_union_domain_from_isl_set(
diff --git a/source/isl/domain.c b/source/isl/domain.c
index 172c179..d11da7b 100644
--- a/source/isl/domain.c
+++ b/source/isl/domain.c
@@ -14,7 +14,7 @@
#include <osl/relation.h>
#endif
-CloogDomain *cloog_domain_from_isl_set(struct isl_set *set)
+CloogDomain *cloog_domain_from_isl_set(__isl_take isl_set *set)
{
if (isl_set_is_params(set))
set = isl_set_from_params(set);
@@ -28,7 +28,7 @@ __isl_give isl_set *isl_set_from_cloog_domain(CloogDomain *domain)
return (isl_set *)domain;
}
-CloogScattering *cloog_scattering_from_isl_map(struct isl_map *map)
+CloogScattering *cloog_scattering_from_isl_map(__isl_take isl_map *map)
{
return (CloogScattering *)map;
}
--
1.7.8.rc2
Pushed.
Tobi