move isl_ctx from CloogOptions to CloogState
commita87eeda6e77ca981fdb4637d792771b25ec7cac5
authorSven Verdoolaege <skimo@kotnet.org>
Mon, 25 May 2009 21:46:22 +0000 (25 23:46 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 31 May 2009 18:37:35 +0000 (31 20:37 +0200)
treec9f7570b99158d95bf713378ad3e6cae17b8098c
parent8d77293f077bdd0cdc272a4a7f89e12e37f0aa99
move isl_ctx from CloogOptions to CloogState

All isl structures are created within an isl_ctx.  This means that whenever
CLooG need to allocate an isl structure, it needs to have a pointer to
an isl_ctx structure.  Furthermore, if CLooG creates an isl_ctx structure
for itself, then it needs to destroy this structure and this destruction
needs to be performed after all the isl objects created within this state
have been destroyed.

Before this patch, the isl_ctx pointer was stored in the CloogOptions
object, but this means that the CloogOptions object can only be
destroyed after all processing by CLooG.  This was perceived to be
error prone, especially since the example in the current documentation
destroys the CloogOptions object before it destroys the CloogPogram
object.

This patch introduces a new CloogState structure to contain
the isl_ctx pointer.  The CloogState object should be created
before anything else and should be destroyed after anything else.
Functions that create new cloog objects are passed a pointer
to this CloogState unless they are already implicitly passed
a pointer to this object through some other object.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
26 files changed:
Makefile.am
doc/cloog.texi
examples/example/example.c
include/cloog/cloog.h
include/cloog/domain.h
include/cloog/isl/backend.h
include/cloog/isl/cloog.h
include/cloog/isl/options.h [deleted file]
include/cloog/loop.h
include/cloog/options.h.in
include/cloog/polylib/backend.h.in
include/cloog/polylib/domain.h
include/cloog/polylib/options.h [deleted file]
include/cloog/state.h [new file with mode: 0644]
source/cloog.c
source/isl/backend.c [new file with mode: 0644]
source/isl/backend_options.c [deleted file]
source/isl/domain.c
source/loop.c
source/options.c
source/polylib/backend.c [new file with mode: 0644]
source/polylib/backend_options.c [deleted file]
source/polylib/domain.c
source/program.c
source/state.c [new file with mode: 0644]
test/generate_test.c