From 874f1a7cf2a5f0d4093fa59825a7cd6684efa9b6 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 24 Nov 2015 15:12:06 +0100 Subject: [PATCH] add isl_ctx_alloc_with_pet_options The isl_ctx created by isl_ctx_alloc does not reference the pet options and can therefore not be used in any pet operations. Instead, the user needs to construct an isl_ctx using isl_ctx_alloc_with_options with an option hierarchy that includes the pet options. The isl_ctx_alloc_with_pet_options function simplifies this process in the case no extra options are required. In particular, this will be useful for the upcoming python interface to pet. Signed-off-by: Sven Verdoolaege --- include/pet.h | 3 +++ options.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/pet.h b/include/pet.h index 0a74612..af7177e 100644 --- a/include/pet.h +++ b/include/pet.h @@ -19,6 +19,9 @@ extern "C" { struct pet_options; ISL_ARG_DECL(pet_options, struct pet_options, pet_options_args) +/* Create an isl_ctx that references the pet options. */ +isl_ctx *isl_ctx_alloc_with_pet_options(); + /* If autodetect is set, any valid scop is extracted. * Otherwise, the scop needs to be delimited by pragmas. */ diff --git a/options.c b/options.c index 4b4ad5c..39525ad 100644 --- a/options.c +++ b/options.c @@ -83,3 +83,13 @@ ISL_CTX_SET_CHOICE_DEF(pet_options, struct pet_options, pet_options_args, signed_overflow) ISL_CTX_GET_CHOICE_DEF(pet_options, struct pet_options, pet_options_args, signed_overflow) + +/* Create an isl_ctx that references the pet options. + */ +isl_ctx *isl_ctx_alloc_with_pet_options() +{ + struct pet_options *options; + + options = pet_options_new_with_defaults(); + return isl_ctx_alloc_with_options(&pet_options_args, options); +} -- 2.11.4.GIT