declare isl_*_list together with isl_*
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 27 Mar 2013 11:09:23 +0000 (12:09 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 22 Apr 2013 07:38:20 +0000 (09:38 +0200)
Some of the isl_*_list types were declared together in isl/list.h.
It seems cleaner to declare them together with the corresponding isl_* instead.
Similarly, these types were defined together in isl_list_private.h and
are now defined together with the corresponding isl_*.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
24 files changed:
Makefile.am
include/isl/aff_type.h
include/isl/band.h
include/isl/constraint.h
include/isl/id.h
include/isl/list.h
include/isl/map_type.h
isl_aff.c
isl_aff_private.h
isl_ast.c
isl_band.c
isl_band_private.h
isl_constraint.c
isl_constraint_private.h
isl_id.c
isl_id_private.h
isl_list.c [deleted file]
isl_list_private.h [deleted file]
isl_list_templ.h
isl_map.c
isl_map_private.h
isl_mat.c
isl_schedule.c
isl_set_list.c [new file with mode: 0644]

index 7218498..055cbc5 100644 (file)
@@ -83,8 +83,6 @@ libisl_la_SOURCES = \
        isl_hmap_map_basic_set.h \
        isl_ilp.c \
        isl_input.c \
-       isl_list.c \
-       isl_list_private.h \
        isl_local_space_private.h \
        isl_local_space.c \
        isl_lp.c \
@@ -122,6 +120,7 @@ libisl_la_SOURCES = \
        isl_scan.h \
        isl_schedule.c \
        isl_schedule_private.h \
+       isl_set_list.c \
        isl_sort.c \
        isl_sort.h \
        isl_space.c \
index e5308c7..ce19f1d 100644 (file)
@@ -1,12 +1,22 @@
 #ifndef ISL_AFF_TYPE_H
 #define ISL_AFF_TYPE_H
 
+#include <isl/list.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 struct isl_aff;
 typedef struct isl_aff isl_aff;
 
+ISL_DECLARE_LIST(aff)
+
 struct isl_pw_aff;
 typedef struct isl_pw_aff isl_pw_aff;
 
+ISL_DECLARE_LIST(pw_aff)
+
 struct isl_multi_aff;
 typedef struct isl_multi_aff isl_multi_aff;
 
@@ -19,4 +29,8 @@ typedef struct isl_union_pw_multi_aff isl_union_pw_multi_aff;
 struct isl_multi_pw_aff;
 typedef struct isl_multi_pw_aff isl_multi_pw_aff;
 
+#if defined(__cplusplus)
+}
+#endif
+
 #endif
index a94937b..882393e 100644 (file)
@@ -13,6 +13,8 @@ extern "C" {
 struct isl_band;
 typedef struct isl_band isl_band;
 
+ISL_DECLARE_LIST(band)
+
 __isl_give isl_band *isl_band_copy(__isl_keep isl_band *band);
 void *isl_band_free(__isl_take isl_band *band);
 
index 224e44d..131db2f 100644 (file)
@@ -14,6 +14,7 @@
 #include <isl/space.h>
 #include <isl/aff_type.h>
 #include <isl/set_type.h>
+#include <isl/list.h>
 #include <isl/printer.h>
 
 #if defined(__cplusplus)
@@ -23,6 +24,8 @@ extern "C" {
 struct isl_constraint;
 typedef struct isl_constraint isl_constraint;
 
+ISL_DECLARE_LIST(constraint)
+
 isl_ctx *isl_constraint_get_ctx(__isl_keep isl_constraint *c);
 
 __isl_give isl_constraint *isl_equality_alloc(__isl_take isl_local_space *ls);
index d237b23..4c457fb 100644 (file)
@@ -2,6 +2,7 @@
 #define ISL_ID_H
 
 #include <isl/ctx.h>
+#include <isl/list.h>
 #include <isl/printer.h>
 
 #if defined(__cplusplus)
@@ -11,6 +12,8 @@ extern "C" {
 struct isl_id;
 typedef struct isl_id isl_id;
 
+ISL_DECLARE_LIST(id)
+
 isl_ctx *isl_id_get_ctx(__isl_keep isl_id *id);
 
 __isl_give isl_id *isl_id_alloc(isl_ctx *ctx,
index 3e953af..0a77241 100644 (file)
 extern "C" {
 #endif
 
-#define ISL_DECLARE_LIST(EL)                                           \
+#define ISL_DECLARE_LIST_TYPE(EL)                                      \
 struct isl_##EL;                                                       \
 struct isl_##EL##_list;                                                        \
-typedef struct isl_##EL##_list isl_##EL##_list;                                \
+typedef struct isl_##EL##_list isl_##EL##_list;
+#define ISL_DECLARE_LIST_FN(EL)                                                \
 isl_ctx *isl_##EL##_list_get_ctx(__isl_keep isl_##EL##_list *list);    \
 __isl_give isl_##EL##_list *isl_##EL##_list_from_##EL(                 \
        __isl_take struct isl_##EL *el);                                \
@@ -63,13 +64,9 @@ __isl_give isl_printer *isl_printer_print_##EL##_list(                       \
        __isl_take isl_printer *p, __isl_keep isl_##EL##_list *list);   \
 void isl_##EL##_list_dump(__isl_keep isl_##EL##_list *list);
 
-ISL_DECLARE_LIST(id)
-ISL_DECLARE_LIST(constraint)
-ISL_DECLARE_LIST(basic_set)
-ISL_DECLARE_LIST(set)
-ISL_DECLARE_LIST(aff)
-ISL_DECLARE_LIST(pw_aff)
-ISL_DECLARE_LIST(band)
+#define ISL_DECLARE_LIST(EL)                                           \
+       ISL_DECLARE_LIST_TYPE(EL)                                       \
+       ISL_DECLARE_LIST_FN(EL)
 
 #if defined(__cplusplus)
 }
index 67057e7..148dc0d 100644 (file)
@@ -2,6 +2,7 @@
 #define ISL_MAP_TYPE_H
 
 #include <isl/ctx.h>
+#include <isl/list.h>
 
 #if defined(__cplusplus)
 extern "C" {
@@ -15,12 +16,18 @@ typedef struct isl_map isl_map;
 #ifndef isl_basic_set
 struct __isl_subclass(isl_set) isl_basic_set;
 typedef struct isl_basic_set isl_basic_set;
+ISL_DECLARE_LIST_TYPE(basic_set)
 #endif
+
 #ifndef isl_set
 struct __isl_subclass(isl_union_set) isl_set;
 typedef struct isl_set isl_set;
+ISL_DECLARE_LIST_TYPE(set)
 #endif
 
+ISL_DECLARE_LIST_FN(basic_set)
+ISL_DECLARE_LIST_FN(set)
+
 #if defined(__cplusplus)
 }
 #endif
index b0a7f33..de1a0ca 100644 (file)
--- a/isl_aff.c
+++ b/isl_aff.c
 #include <isl_space_private.h>
 #include <isl_local_space_private.h>
 #include <isl_mat_private.h>
-#include <isl_list_private.h>
 #include <isl/constraint.h>
 #include <isl/seq.h>
 #include <isl/set.h>
 #include <isl_config.h>
 
+#undef BASE
+#define BASE aff
+
+#include <isl_list_templ.c>
+
+#undef BASE
+#define BASE pw_aff
+
+#include <isl_list_templ.c>
+
 __isl_give isl_aff *isl_aff_alloc_vec(__isl_take isl_local_space *ls,
        __isl_take isl_vec *v)
 {
index 0dca8f5..2fb245a 100644 (file)
@@ -16,6 +16,11 @@ struct isl_aff {
        isl_vec         *v;
 };
 
+#undef EL
+#define EL isl_aff
+
+#include <isl_list_templ.h>
+
 struct isl_pw_aff_piece {
        struct isl_set *set;
        struct isl_aff *aff;
@@ -32,6 +37,11 @@ struct isl_pw_aff {
        struct isl_pw_aff_piece p[1];
 };
 
+#undef EL
+#define EL isl_pw_aff
+
+#include <isl_list_templ.h>
+
 struct isl_pw_multi_aff_piece {
        isl_set *set;
        isl_multi_aff *maff;
index 05a79a4..6859e7f 100644 (file)
--- a/isl_ast.c
+++ b/isl_ast.c
@@ -1,5 +1,4 @@
 #include <isl_ast_private.h>
-#include <isl_list_private.h>
 
 #undef BASE
 #define BASE ast_expr
index 18572d0..43e9f01 100644 (file)
 
 #include <isl_band_private.h>
 #include <isl_schedule_private.h>
-#include <isl_list_private.h>
+
+#undef BASE
+#define BASE band
+
+#include <isl_list_templ.c>
 
 isl_ctx *isl_band_get_ctx(__isl_keep isl_band *band)
 {
index 8f201f6..ef0e0ed 100644 (file)
@@ -33,6 +33,11 @@ struct isl_band {
        isl_band_list *children;
 };
 
+#undef EL
+#define EL isl_band
+
+#include <isl_list_templ.h>
+
 __isl_give isl_band *isl_band_alloc(isl_ctx *ctx);
 
 __isl_give isl_union_map *isl_band_list_get_suffix_schedule(
index 7f19658..483e26c 100644 (file)
 #include <isl_aff_private.h>
 #include <isl_local_space_private.h>
 
+#undef BASE
+#define BASE constraint
+
+#include <isl_list_templ.c>
+
 isl_ctx *isl_constraint_get_ctx(__isl_keep isl_constraint *c)
 {
        return c ? isl_local_space_get_ctx(c->ls) : NULL;
index 8314325..1a3b44e 100644 (file)
@@ -12,6 +12,11 @@ struct isl_constraint {
        isl_vec         *v;
 };
 
+#undef EL
+#define EL isl_constraint
+
+#include <isl_list_templ.h>
+
 struct isl_constraint *isl_basic_set_constraint(struct isl_basic_set *bset,
        isl_int **line);
 
index 26f19c6..410218d 100644 (file)
--- a/isl_id.c
+++ b/isl_id.c
 #include <isl_ctx_private.h>
 #include <isl_id_private.h>
 
+#undef BASE
+#define BASE id
+
+#include <isl_list_templ.c>
+
 /* A special, static isl_id to use as domains (and ranges)
  * of sets and parameters domains.
  * The user should never get a hold on this isl_id.
index c583b31..6266b47 100644 (file)
@@ -28,6 +28,11 @@ struct isl_id {
        __isl_give void (*free_user)(void *user);
 };
 
+#undef EL
+#define EL isl_id
+
+#include <isl_list_templ.h>
+
 uint32_t isl_hash_id(uint32_t hash, __isl_keep isl_id *id);
 
 extern isl_id isl_id_none;
diff --git a/isl_list.c b/isl_list.c
deleted file mode 100644 (file)
index bb926b7..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2008-2009 Katholieke Universiteit Leuven
- *
- * Use of this software is governed by the MIT license
- *
- * Written by Sven Verdoolaege, K.U.Leuven, Departement
- * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
- */
-
-#include <isl_list_private.h>
-#include <isl/constraint.h>
-#include <isl/set.h>
-#include <isl/aff.h>
-#include <isl/band.h>
-
-#undef BASE
-#define BASE constraint
-
-#include <isl_list_templ.c>
-
-#undef BASE
-#define BASE basic_set
-
-#include <isl_list_templ.c>
-
-#undef BASE
-#define BASE set
-
-#include <isl_list_templ.c>
-
-#undef BASE
-#define BASE aff
-
-#include <isl_list_templ.c>
-
-#undef BASE
-#define BASE pw_aff
-
-#include <isl_list_templ.c>
-
-#undef BASE
-#define BASE band
-
-#include <isl_list_templ.c>
-
-#undef BASE
-#define BASE id
-
-#include <isl_list_templ.c>
diff --git a/isl_list_private.h b/isl_list_private.h
deleted file mode 100644 (file)
index 26d5641..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef ISL_LIST_PRIVATE_H
-#define ISL_LIST_PRIVATE_H
-
-#include <isl/list.h>
-
-#undef EL
-#define EL isl_constraint
-
-#include <isl_list_templ.h>
-
-#undef EL
-#define EL isl_basic_set
-
-#include <isl_list_templ.h>
-
-#undef EL
-#define EL isl_set
-
-#include <isl_list_templ.h>
-
-#undef EL
-#define EL isl_aff
-
-#include <isl_list_templ.h>
-
-#undef EL
-#define EL isl_pw_aff
-
-#include <isl_list_templ.h>
-
-#undef EL
-#define EL isl_band
-
-#include <isl_list_templ.h>
-
-#undef EL
-#define EL isl_id
-
-#include <isl_list_templ.h>
-
-#endif
index 9c60f5a..893f9d9 100644 (file)
@@ -13,12 +13,4 @@ struct LIST(EL) {
        struct EL *p[1];
 };
 
-#define ISL_DECLARE_LIST_PRIVATE(EL)                                   \
-__isl_give isl_##EL##_list *isl_##EL##_list_dup(                       \
-       __isl_keep isl_##EL##_list *list);
-
-ISL_DECLARE_LIST_PRIVATE(basic_set)
-ISL_DECLARE_LIST_PRIVATE(set)
-ISL_DECLARE_LIST_PRIVATE(aff)
-ISL_DECLARE_LIST_PRIVATE(pw_aff)
-ISL_DECLARE_LIST_PRIVATE(band)
+__isl_give LIST(EL) *FN(LIST(EL),dup)(__isl_keep LIST(EL) *list);
index 06adfda..9052c19 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -18,7 +18,6 @@
 #include <isl/blk.h>
 #include "isl_space_private.h"
 #include "isl_equalities.h"
-#include <isl_list_private.h>
 #include <isl/lp.h>
 #include <isl/seq.h>
 #include <isl/set.h>
index 5da97be..93010df 100644 (file)
 #define isl_basic_set  isl_basic_map
 #define isl_set                isl_map
 #define isl_basic_set_list     isl_basic_map_list
+#define isl_set_list   isl_map_list
+#include <isl/list.h>
+ISL_DECLARE_LIST(basic_map)
+ISL_DECLARE_LIST(map)
 #include <isl/set.h>
 #include <isl/map.h>
 #include <isl_reordering.h>
@@ -70,6 +74,11 @@ struct isl_basic_map {
        struct isl_blk block2;
 };
 
+#undef EL
+#define EL isl_basic_set
+
+#include <isl_list_templ.h>
+
 /* A "map" is a (possibly disjoint) union of basic maps.
  * A "set" is a (possibly disjoint) union of basic sets.
  *
@@ -95,6 +104,11 @@ struct isl_map {
        struct isl_basic_map *p[1];
 };
 
+#undef EL
+#define EL isl_set
+
+#include <isl_list_templ.h>
+
 __isl_give isl_map *isl_map_realign(__isl_take isl_map *map,
        __isl_take isl_reordering *r);
 __isl_give isl_set *isl_set_realign(__isl_take isl_set *set,
index 5290dea..6b54849 100644 (file)
--- a/isl_mat.c
+++ b/isl_mat.c
@@ -8,10 +8,10 @@
  */
 
 #include <isl_ctx_private.h>
+#include <isl_map_private.h>
 #include <isl/space.h>
 #include <isl/seq.h>
 #include <isl_mat_private.h>
-#include "isl_map_private.h"
 #include <isl_space_private.h>
 
 isl_ctx *isl_mat_get_ctx(__isl_keep isl_mat *mat)
index 032b637..e58dd57 100644 (file)
@@ -26,7 +26,6 @@
 #include <isl_sort.h>
 #include <isl_schedule_private.h>
 #include <isl_band_private.h>
-#include <isl_list_private.h>
 #include <isl_options_private.h>
 #include <isl_tarjan.h>
 
diff --git a/isl_set_list.c b/isl_set_list.c
new file mode 100644 (file)
index 0000000..b279827
--- /dev/null
@@ -0,0 +1,21 @@
+#include <isl/set.h>
+
+#undef EL
+#define EL isl_basic_set
+
+#include <isl_list_templ.h>
+
+#undef EL
+#define EL isl_set
+
+#include <isl_list_templ.h>
+
+#undef BASE
+#define BASE basic_set
+
+#include <isl_list_templ.c>
+
+#undef BASE
+#define BASE set
+
+#include <isl_list_templ.c>