From dad819fd2da446f7cf7916bc54663e96bad0e7ce Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 26 Sep 2013 11:51:10 +0200 Subject: [PATCH] add isl_ast_build_alloc This allows the user to create an isl_ast_build without first having to create a context set. This will be especially useful when we will allow AST generation from a schedule tree with context nodes. Since the context nodes are embedded inside the schedule tree, there will typically be no need to specify an additional initial context. Signed-off-by: Sven Verdoolaege --- doc/user.pod | 4 ++++ include/isl/ast_build.h | 1 + isl_ast_build.c | 13 +++++++++++++ 3 files changed, 18 insertions(+) diff --git a/doc/user.pod b/doc/user.pod index c8259a70..a5a21f6e 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -8329,6 +8329,8 @@ simply specifies the constraints on the parameters (if any) and can be created, inspected, copied and freed using the following functions. #include + __isl_give isl_ast_build *isl_ast_build_alloc( + isl_ctx *ctx); __isl_give isl_ast_build *isl_ast_build_from_context( __isl_take isl_set *set); __isl_give isl_ast_build *isl_ast_build_copy( @@ -8337,6 +8339,8 @@ and can be created, inspected, copied and freed using the following functions. __isl_take isl_ast_build *build); The C argument is usually a parameter set with zero or more parameters. +An C created using C does not +specify any parameter constraints. More C functions are described in L and L. Finally, the AST itself can be constructed using the following diff --git a/include/isl/ast_build.h b/include/isl/ast_build.h index 2a75963a..04b42640 100644 --- a/include/isl/ast_build.h +++ b/include/isl/ast_build.h @@ -41,6 +41,7 @@ int isl_options_get_ast_build_allow_or(isl_ctx *ctx); isl_ctx *isl_ast_build_get_ctx(__isl_keep isl_ast_build *build); +__isl_give isl_ast_build *isl_ast_build_alloc(isl_ctx *ctx); __isl_give isl_ast_build *isl_ast_build_from_context(__isl_take isl_set *set); __isl_give isl_space *isl_ast_build_get_schedule_space( diff --git a/isl_ast_build.c b/isl_ast_build.c index 64e2ee7d..ee019635 100644 --- a/isl_ast_build.c +++ b/isl_ast_build.c @@ -146,6 +146,19 @@ error: return NULL; } +/* Create an isl_ast_build with a universe (parametric) context. + */ +__isl_give isl_ast_build *isl_ast_build_alloc(isl_ctx *ctx) +{ + isl_space *space; + isl_set *context; + + space = isl_space_params_alloc(ctx, 0); + context = isl_set_universe(space); + + return isl_ast_build_from_context(context); +} + __isl_give isl_ast_build *isl_ast_build_copy(__isl_keep isl_ast_build *build) { if (!build) -- 2.11.4.GIT