add isl_space_get_tuple_hash
[isl.git] / interface / isl.h.top
blob37749c295969cba0bbbe03ca231dea4f4dd8ab4f
1 /// These are automatically generated C++ bindings for isl.
2 ///
3 /// isl is a library for computing with integer sets and maps described by
4 /// Presburger formulas. On top of this, isl provides various tools for
5 /// polyhedral compilation, ranging from dependence analysis over scheduling
6 /// to AST generation.
8 #ifndef ISL_CPP_NOEXCEPTIONS
9 #define ISL_CPP_NOEXCEPTIONS
11 #include <isl/aff.h>
12 #include <isl/ast_build.h>
13 #include <isl/flow.h>
14 #include <isl/ilp.h>
15 #include <isl/map.h>
16 #include <isl/schedule.h>
17 #include <isl/schedule_node.h>
18 #include <isl/set.h>
19 #include <isl/union_map.h>
20 #include <isl/union_set.h>
21 #include <isl/val.h>
23 #include <functional>
24 #include <string>
26 namespace isl {
27 inline namespace noexceptions {
29 #define ISLPP_STRINGIZE_(X) #X
30 #define ISLPP_STRINGIZE(X) ISLPP_STRINGIZE_(X)
32 #define ISLPP_ASSERT(test, message)                          \
33   do {                                                       \
34     if (test)                                                \
35       break;                                                 \
36     fputs("Assertion \"" #test "\" failed at " __FILE__      \
37       ":" ISLPP_STRINGIZE(__LINE__) "\n  " message "\n",     \
38       stderr);                                               \
39   } while (0)
41 class boolean {
42 private:
43   isl_bool val;
45   friend isl::boolean manage(isl_bool val);
46   boolean(isl_bool val): val(val) {}
47 public:
48   boolean()
49       : val(isl_bool_error) {}
51   /* implicit */ boolean(bool val)
52       : val(val ? isl_bool_true : isl_bool_false) {}
54   bool is_error() const { return val == isl_bool_error; }
55   bool is_false() const { return val == isl_bool_false; }
56   bool is_true() const { return val == isl_bool_true; }
58   explicit operator bool() const {
59     ISLPP_ASSERT(!is_error(), "IMPLEMENTATION ERROR: Unhandled error state");
60     return is_true();
61   }
63   boolean operator!() const {
64     if (is_error())
65       return *this;
66     return !is_true();
67   }
70 inline isl::boolean manage(isl_bool val) {
71   return isl::boolean(val);
74 class ctx {
75   isl_ctx *ptr;
76 public:
77   /* implicit */ ctx(isl_ctx *ctx)
78       : ptr(ctx) {}
79   isl_ctx *release() {
80     auto tmp = ptr;
81     ptr = nullptr;
82     return tmp;
83   }
84   isl_ctx *get() {
85     return ptr;
86   }
89 enum class stat {
90   ok = isl_stat_ok,
91   error = isl_stat_error
95 } // namespace isl