diff options
author | jk7744.park <jk7744.park@samsung.com> | 2015-09-09 02:18:21 +0900 |
---|---|---|
committer | jk7744.park <jk7744.park@samsung.com> | 2015-09-09 02:18:21 +0900 |
commit | 40ef93558be42b604f5eb912414f767972a70b8c (patch) | |
tree | dd3a18995e2d72f452f3804d87b8a205f0f0a936 /cloog-core/source/isl/backend.c | |
parent | eea72ec0021ec2c1c84631af37435123c063eaf1 (diff) | |
download | cloog-tizen_2.3.1.tar.gz cloog-tizen_2.3.1.tar.bz2 cloog-tizen_2.3.1.zip |
tizen 2.3.1 releasetizen_2.3.1_releasesubmit/tizen_2.3.1/20150915.095034tizen_2.3.1
Diffstat (limited to 'cloog-core/source/isl/backend.c')
-rw-r--r-- | cloog-core/source/isl/backend.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/cloog-core/source/isl/backend.c b/cloog-core/source/isl/backend.c new file mode 100644 index 0000000..6ddb9f9 --- /dev/null +++ b/cloog-core/source/isl/backend.c @@ -0,0 +1,37 @@ +#include <cloog/isl/cloog.h> + +/** + * Allocate and initialize full state. + */ +CloogState *cloog_state_malloc(void) +{ + return cloog_isl_state_malloc(NULL); +} + +/** + * Allocate and initialize full state for isl backend. + */ +CloogState *cloog_isl_state_malloc(struct isl_ctx *ctx) +{ + CloogState *state; + int allocated = !ctx; + + state = cloog_core_state_malloc(); + if (!ctx) + ctx = isl_ctx_alloc(); + state->backend = isl_alloc_type(ctx, CloogBackend); + state->backend->ctx = ctx; + state->backend->ctx_allocated = allocated; + return state; +} + +/** + * Free state and backend independent parts. + */ +void cloog_state_free(CloogState *state) +{ + if (state->backend->ctx_allocated) + isl_ctx_free(state->backend->ctx); + free(state->backend); + cloog_core_state_free(state); +} |