summaryrefslogtreecommitdiff
path: root/gcc/graphite-clast-to-gimple.c
diff options
context:
space:
mode:
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-11 20:30:34 +0000
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-11 20:30:34 +0000
commit2e6bc1c7d059dfa944bffddfeb92ed6d224cfc71 (patch)
treec6a0121bfdeac2cfa03dfa292211e51e123d86d4 /gcc/graphite-clast-to-gimple.c
parentebd32a89f66db594684ba8f81e68996852fd6b81 (diff)
downloadgcc-2e6bc1c7d059dfa944bffddfeb92ed6d224cfc71.tar.gz
Adapt to new CLAST structure within upstream CLooG version and retain compatibility to CLooG Legacy.
2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de> * graphite-clast-to-gimple.c (clast_name_to_gcc): Parameter type of NAME now depends on used CLooG version. (clast_to_gcc_expression): Replace expr_* with clast_expr_*. (gcc_type_for_clast_expr): Same. (print_clast_stmt): Replace pprint with clast_pprint. * graphite-cloog-compat.h: Provide compatibility macros for CLooG Legacy. (clast_name_p): New. (clast_expr_term): New. (clast_expr_red): New. (clast_expr_bin): New. (clast_pprint): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163163 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite-clast-to-gimple.c')
-rw-r--r--gcc/graphite-clast-to-gimple.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index a611ca782e5..29c8ffb5169 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -97,12 +97,18 @@ new_clast_name_index (const char *name, int index)
SCATTERING_DIMENSIONS vector. */
static inline int
-clast_name_to_index (const char *name, htab_t index_table)
+clast_name_to_index (clast_name_p name, htab_t index_table)
{
struct clast_name_index tmp;
PTR *slot;
+#ifdef CLOOG_ORG
+ gcc_assert (name->type == clast_expr_name);
+ tmp.name = ((const struct clast_name*) name)->name;
+#else
tmp.name = name;
+#endif
+
slot = htab_find_slot (index_table, &tmp, NO_INSERT);
if (slot && *slot)
@@ -165,7 +171,7 @@ newivs_to_depth_to_newiv (VEC (tree, heap) *newivs, int depth)
Cloog representation. */
static tree
-clast_name_to_gcc (const char *name, sese region, VEC (tree, heap) *newivs,
+clast_name_to_gcc (clast_name_p name, sese region, VEC (tree, heap) *newivs,
htab_t newivs_index, htab_t params_index)
{
int index;
@@ -267,7 +273,7 @@ clast_to_gcc_expression (tree type, struct clast_expr *e,
{
switch (e->type)
{
- case expr_term:
+ case clast_expr_term:
{
struct clast_term *t = (struct clast_term *) e;
@@ -319,7 +325,7 @@ clast_to_gcc_expression (tree type, struct clast_expr *e,
return gmp_cst_to_tree (type, t->val);
}
- case expr_red:
+ case clast_expr_red:
{
struct clast_reduction *r = (struct clast_reduction *) e;
@@ -346,7 +352,7 @@ clast_to_gcc_expression (tree type, struct clast_expr *e,
break;
}
- case expr_bin:
+ case clast_expr_bin:
{
struct clast_binary *b = (struct clast_binary *) e;
struct clast_expr *lhs = (struct clast_expr *) b->LHS;
@@ -485,7 +491,7 @@ gcc_type_for_clast_term (struct clast_term *t,
sese region, VEC (tree, heap) *newivs,
htab_t newivs_index, htab_t params_index)
{
- gcc_assert (t->expr.type == expr_term);
+ gcc_assert (t->expr.type == clast_expr_term);
if (!t->var)
return gcc_type_for_value (t->val);
@@ -557,15 +563,15 @@ gcc_type_for_clast_expr (struct clast_expr *e,
{
switch (e->type)
{
- case expr_term:
+ case clast_expr_term:
return gcc_type_for_clast_term ((struct clast_term *) e, region,
newivs, newivs_index, params_index);
- case expr_red:
+ case clast_expr_red:
return gcc_type_for_clast_red ((struct clast_reduction *) e, region,
newivs, newivs_index, params_index);
- case expr_bin:
+ case clast_expr_bin:
return gcc_type_for_clast_bin ((struct clast_binary *) e, region,
newivs, newivs_index, params_index);
@@ -1359,7 +1365,7 @@ print_clast_stmt (FILE *file, struct clast_stmt *stmt)
{
CloogOptions *options = set_cloog_options ();
- pprint (file, stmt, 0, options);
+ clast_pprint (file, stmt, 0, options);
cloog_options_free (options);
}
@@ -1404,7 +1410,7 @@ print_generated_program (FILE *file, scop_p scop)
fprintf (file, " )\n");
fprintf (file, " (clast: \n");
- pprint (file, pc.stmt, 0, options);
+ clast_pprint (file, pc.stmt, 0, options);
fprintf (file, " )\n");
cloog_options_free (options);