OSDN Git Service

2012-03-27 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / graphite-cloog-compat.h
index 6608318..011377d 100644 (file)
@@ -1,6 +1,6 @@
 /* Compatibility layer for using upstream CLooG versions with
    CLooG legacy code.
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
    Contributed by Andreas Simbuerger <simbuerg@fim.uni-passau.de>.
 
 This file is part of GCC.
@@ -23,15 +23,58 @@ along with GCC; see the file COPYING3.  If not see
 #define GRAPHITE_CLOOG_COMPAT_H
 
 /* Restore compatibility to CLooG Legacy.  */
+#ifdef CLOOG_ORG
+typedef const struct clast_expr *clast_name_p;
+#else
+typedef const char *clast_name_p;
+#endif
+
+#ifdef CLOOG_ORG
+#define cloog_initialize()
+#define cloog_finalize()
+#endif
+
 #ifndef CLOOG_ORG
 
 /* CloogOptions compatibility.  */
-#define build_cloog_prog(SCOP, PROG, OPT) build_cloog_prog (SCOP, PROG)
+#define build_cloog_prog(SCOP, PROG, OPT)\
+  build_cloog_prog (SCOP, PROG)
 #define cloog_program_extract_scalars(PROG, SCATT, OPT)\
   cloog_program_extract_scalars (PROG, SCATT)
 #define cloog_program_scatter(PROG, SCATT, OPT)\
   cloog_program_scatter (PROG, SCATT)
 
+/* CLAST compatibility.  */
+#define clast_expr_term expr_term
+#define clast_expr_red expr_red
+#define clast_expr_bin expr_bin
+#define clast_pprint pprint
+
+/* CloogState compatibility.  */
+#define CloogState void
+#define cloog_state_malloc() NULL
+#define cloog_state_free(STATE)
+#define cloog_loop_malloc(STATE) cloog_loop_malloc ()
+#define cloog_options_malloc(STATE) cloog_options_malloc ()
+#define cloog_statement_alloc(STATE, INDEX) cloog_statement_alloc (INDEX)
+#define new_Cloog_Domain_from_ppl_Pointset_Powerset(PSPS, NB, STATE)\
+  new_Cloog_Domain_from_ppl_Pointset_Powerset (PSPS)
+#define new_Cloog_Domain_from_ppl_Polyhedron(POLY, NB, STATE)\
+  new_Cloog_Domain_from_ppl_Polyhedron (POLY)
+#define cloog_domain_from_cloog_matrix(STATE, MAT, NB)\
+  cloog_domain_matrix2domain (MAT)
+
+/* CloogScatteringList compatibility.  */
+#define CloogScatteringList CloogDomainList
+#define CloogScattering CloogDomain
+#define cloog_set_next_scattering cloog_set_next_domain
+#define cloog_set_scattering cloog_set_domain
+#define cloog_scattering cloog_domain
+#define cloog_next_scattering cloog_next_domain
+#define cloog_scattering_free cloog_domain_free
+#define cloog_program_dump_cloog(DUMPFILE, PROGRAM, SCATTERINGLIST)\
+  cloog_program_dump_cloog (DUMPFILE, PROGRAM)
+
 #endif
 
 /* Adapt CLooG accessors from CLooG legacy to
@@ -45,28 +88,28 @@ cloog_statement_usr (CloogStatement *cs)
   return cs->usr;
 }
 
-static inline CloogDomain *
-cloog_domain (CloogDomainList *dl)
+static inline CloogScattering *
+cloog_scattering (CloogScatteringList *sl)
 {
-  return dl->domain;
+  return sl->scatt;
 }
 
 static inline void
-cloog_set_domain (CloogDomainList *dl, CloogDomain *domain)
+cloog_set_scattering (CloogScatteringList *sl, CloogScattering *scatt)
 {
-  dl->domain = domain;
+  sl->scatt = scatt;
 }
 
-static inline CloogDomainList *
-cloog_next_domain (CloogDomainList *dl)
+static inline CloogScatteringList *
+cloog_next_scattering (CloogScatteringList *sl)
 {
-  return dl->next;
+  return sl->next;
 }
 
 static inline void
-cloog_set_next_domain (CloogDomainList *dl, CloogDomainList *next)
+cloog_set_next_scattering (CloogScatteringList *sl, CloogScatteringList *next)
 {
-  dl->next = next;
+  sl->next = next;
 }
 
 static inline int
@@ -218,5 +261,15 @@ cloog_block_list_set_block (CloogBlockList *bl, CloogBlock *block)
 {
   bl->block = block;
 }
+
+static inline int cloog_matrix_ncolumns (CloogMatrix * m)
+{
+  return m->NbColumns;
+}
+
+static inline int cloog_matrix_nrows (CloogMatrix * m)
+{
+   return m->NbRows;
+}
 #endif /* CLOOG_ORG  */
 #endif /* GRAPHITE_CLOOG_COMPAT_H  */