Index: polly/trunk/include/polly/DeLICM.h =================================================================== --- polly/trunk/include/polly/DeLICM.h +++ polly/trunk/include/polly/DeLICM.h @@ -32,12 +32,10 @@ /// Determine whether two lifetimes are conflicting. /// /// Used by unittesting. -bool isConflicting(IslPtr ExistingOccupied, - IslPtr ExistingUnused, - IslPtr ExistingWrites, - IslPtr ProposedOccupied, - IslPtr ProposedUnused, - IslPtr ProposedWrites, +bool isConflicting(isl::union_set ExistingOccupied, + isl::union_set ExistingUnused, isl::union_set ExistingWrites, + isl::union_set ProposedOccupied, + isl::union_set ProposedUnused, isl::union_set ProposedWrites, llvm::raw_ostream *OS = nullptr, unsigned Indent = 0); } // namespace polly Index: polly/trunk/include/polly/FlattenAlgo.h =================================================================== --- polly/trunk/include/polly/FlattenAlgo.h +++ polly/trunk/include/polly/FlattenAlgo.h @@ -32,7 +32,7 @@ /// @param Schedule The input schedule. /// /// @return The flattened schedule. -IslPtr flattenSchedule(IslPtr Schedule); +isl::union_map flattenSchedule(isl::union_map Schedule); } // namespace polly #endif /* POLLY_FLATTENALGO_H */ Index: polly/trunk/include/polly/Support/GICHelper.h =================================================================== --- polly/trunk/include/polly/Support/GICHelper.h +++ polly/trunk/include/polly/Support/GICHelper.h @@ -24,6 +24,9 @@ #include "isl/set.h" #include "isl/union_map.h" #include "isl/union_set.h" + +#include "isl-noexceptions.h" + #include #include @@ -176,151 +179,15 @@ const std::string &Middle, const std::string &Suffix); -/// IslObjTraits is a static class to invoke common functions that all -/// ISL objects have: isl_*_copy, isl_*_free, isl_*_get_ctx and isl_*_to_str. -/// These functions follow a common naming scheme, but not a base class -/// hierarchy (as ISL is written in C). As such, the functions are accessible -/// only by constructing the function name using the preprocessor. This class -/// serves to make these names accessible to a C++ template scheme. -/// -/// There is an isl_obj polymorphism layer, but its implementation is -/// incomplete. -template class IslObjTraits; - -#define DECLARE_TRAITS(TYPE) \ - template <> class IslObjTraits { \ - public: \ - static __isl_give isl_##TYPE *copy(__isl_keep isl_##TYPE *Obj) { \ - return isl_##TYPE##_copy(Obj); \ - } \ - static void free(__isl_take isl_##TYPE *Obj) { isl_##TYPE##_free(Obj); } \ - static isl_ctx *get_ctx(__isl_keep isl_##TYPE *Obj) { \ - return isl_##TYPE##_get_ctx(Obj); \ - } \ - static std::string to_str(__isl_keep isl_##TYPE *Obj) { \ - if (!Obj) \ - return "null"; \ - char *cstr = isl_##TYPE##_to_str(Obj); \ - if (!cstr) \ - return "null"; \ - std::string Result{cstr}; \ - ::free(cstr); \ - return Result; \ - } \ - }; - -DECLARE_TRAITS(id) -DECLARE_TRAITS(val) -DECLARE_TRAITS(space) -DECLARE_TRAITS(basic_map) -DECLARE_TRAITS(map) -DECLARE_TRAITS(union_map) -DECLARE_TRAITS(basic_set) -DECLARE_TRAITS(set) -DECLARE_TRAITS(union_set) -DECLARE_TRAITS(aff) -DECLARE_TRAITS(multi_aff) -DECLARE_TRAITS(pw_aff) -DECLARE_TRAITS(pw_multi_aff) -DECLARE_TRAITS(multi_pw_aff) -DECLARE_TRAITS(union_pw_aff) -DECLARE_TRAITS(multi_union_pw_aff) -DECLARE_TRAITS(union_pw_multi_aff) - -/// Smart pointer to an ISL object. -/// -/// An object of this class owns an reference of an ISL object, meaning if will -/// free it when destroyed. Most ISL objects are reference counted such that we -/// gain an automatic memory management. -/// -/// Function parameters in the ISL API are annotated using either __isl_keep -/// __isl_take. Return values that are objects are annotated using __is_give, -/// meaning the caller is responsible for releasing the object. When annotated -/// with __isl_keep, use the keep() function to pass a plain pointer to the ISL -/// object. For __isl_take-annotated parameters, use either copy() to increase -/// the reference counter by one, or take() to pass the ownership to the called -/// function. When IslPtr loses ownership, it cannot be used anymore and won't -/// free the object when destroyed. Use the give() function to wrap the -/// ownership of a returned isl_* object into an IstPtr. -/// -/// There is purposefully no implicit conversion from/to plain isl_* pointers to -/// avoid difficult to find bugs because keep/copy/take would have been -/// required. -template class IslPtr { - typedef IslPtr ThisTy; - typedef IslObjTraits Traits; - -private: - T *Obj; - - explicit IslPtr(__isl_take T *Obj) : Obj(Obj) {} - -public: - IslPtr() : Obj(nullptr) {} - /* implicit */ IslPtr(std::nullptr_t That) : IslPtr() {} - - /* implicit */ IslPtr(const ThisTy &That) - : IslPtr(IslObjTraits::copy(That.Obj)) {} - /* implicit */ IslPtr(ThisTy &&That) : IslPtr(That.Obj) { - That.Obj = nullptr; - } - ~IslPtr() { - if (Obj) - Traits::free(Obj); - } - - ThisTy &operator=(const ThisTy &That) { - if (Obj) - Traits::free(Obj); - this->Obj = Traits::copy(That.Obj); - return *this; - } - ThisTy &operator=(ThisTy &&That) { - swap(*this, That); - return *this; - } - - explicit operator bool() const { return Obj; } - - static void swap(ThisTy &LHS, ThisTy &RHS) { std::swap(LHS.Obj, RHS.Obj); } - - static ThisTy give(__isl_take T *Obj) { return ThisTy(Obj); } - T *keep() const { return Obj; } - __isl_give T *take() { - auto *Result = Obj; - Obj = nullptr; - return Result; - } - __isl_give T *copy() const { return Traits::copy(Obj); } - - isl_ctx *getCtx() const { return Traits::get_ctx(Obj); } - std::string toStr() const { return Traits::to_str(Obj); } - - /// Print a string representation of this ISL object to stderr. - /// - /// This function is meant to be called from a debugger and therefore must - /// not be declared inline: The debugger needs a valid function pointer to - /// call, even if the method is not used. - /// - /// Note that the string representation of isl_*_dump is different than the - /// one for isl_printer/isl_*_to_str(). - void dump() const; -}; - -template static IslPtr give(__isl_take T *Obj) { - return IslPtr::give(Obj); -} - -template -llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const IslPtr &Obj) { - OS << IslObjTraits::to_str(Obj.keep()); - return OS; -} - -template -llvm::DiagnosticInfoOptimizationBase & -operator<<(llvm::DiagnosticInfoOptimizationBase &OS, const IslPtr &Obj) { - OS << IslObjTraits::to_str(Obj.keep()); +// Make isl::give available in polly namespace. We do this as there was +// previously a function polly::give() which did the very same thing and we +// did not want yet to introduce the isl:: prefix to each call of give. +using isl::give; + +inline llvm::DiagnosticInfoOptimizationBase & +operator<<(llvm::DiagnosticInfoOptimizationBase &OS, + const isl::union_map &Obj) { + OS << Obj.to_str(); return OS; } @@ -328,36 +195,36 @@ /// /// This basically wraps isl_map_foreach_basic_map() and allows to call back /// C++11 closures. -void foreachElt(const IslPtr &Map, - const std::function)> &F); +void foreachElt(const isl::map &Map, + const std::function &F); /// Enumerate all isl_basic_sets of an isl_set. /// /// This basically wraps isl_set_foreach_basic_set() and allows to call back /// C++11 closures. -void foreachElt(const IslPtr &Set, - const std::function)> &F); +void foreachElt(const isl::set &Set, + const std::function &F); /// Enumerate all isl_maps of an isl_union_map. /// /// This basically wraps isl_union_map_foreach_map() and allows to call back /// C++11 closures. -void foreachElt(const IslPtr &UMap, - const std::function Map)> &F); +void foreachElt(const isl::union_map &UMap, + const std::function &F); /// Enumerate all isl_sets of an isl_union_set. /// /// This basically wraps isl_union_set_foreach_set() and allows to call back /// C++11 closures. -void foreachElt(const IslPtr &USet, - const std::function Set)> &F); +void foreachElt(const isl::union_set &USet, + const std::function &F); /// Enumerate all isl_pw_aff of an isl_union_pw_aff. /// /// This basically wraps isl_union_pw_aff(), but also allows to call back C++11 /// closures. -void foreachElt(const IslPtr &UPwAff, - const std::function)> &F); +void foreachElt(const isl::union_pw_aff &UPwAff, + const std::function &F); /// Enumerate all polyhedra of an isl_map. /// @@ -371,9 +238,8 @@ /// /// @return The isl_stat returned by the last callback invocation; isl_stat_ok /// if the collection was empty. -isl_stat -foreachEltWithBreak(const IslPtr &Map, - const std::function)> &F); +isl_stat foreachEltWithBreak(const isl::map &Map, + const std::function &F); /// Enumerate all isl_maps of an isl_union_map. /// @@ -388,9 +254,8 @@ /// /// @return The isl_stat returned by the last callback invocation; isl_stat_ok /// if the collection was initially empty. -isl_stat -foreachEltWithBreak(const IslPtr &UMap, - const std::function Map)> &F); +isl_stat foreachEltWithBreak(const isl::union_map &UMap, + const std::function &F); /// Enumerate all pieces of an isl_pw_aff. /// @@ -404,9 +269,9 @@ /// /// @return The isl_stat returned by the last callback invocation; isl_stat_ok /// if the collection was initially empty. -isl_stat foreachPieceWithBreak( - const IslPtr &PwAff, - const std::function, IslPtr)> &F); +isl_stat +foreachPieceWithBreak(const isl::pw_aff &PwAff, + const std::function &F); /// Scoped limit of ISL operations. /// Index: polly/trunk/include/polly/Support/ISLTools.h =================================================================== --- polly/trunk/include/polly/Support/ISLTools.h +++ polly/trunk/include/polly/Support/ISLTools.h @@ -28,10 +28,10 @@ /// @return { Space[] -> Scatter[] } /// A map to all timepoints that happen before the timepoints the input /// mapped to. -IslPtr beforeScatter(IslPtr Map, bool Strict); +isl::map beforeScatter(isl::map Map, bool Strict); -/// Piecewise beforeScatter(IslPtr,bool). -IslPtr beforeScatter(IslPtr UMap, bool Strict); +/// Piecewise beforeScatter(isl::map,bool). +isl::union_map beforeScatter(isl::union_map UMap, bool Strict); /// Return the range elements that are lexicographically larger. /// @@ -42,11 +42,10 @@ /// @return { Space[] -> Scatter[] } /// A map to all timepoints that happen after the timepoints the input /// map originally mapped to. -IslPtr afterScatter(IslPtr Map, bool Strict); +isl::map afterScatter(isl::map Map, bool Strict); -/// Piecewise afterScatter(IslPtr,bool). -IslPtr afterScatter(const IslPtr &UMap, - bool Strict); +/// Piecewise afterScatter(isl::map,bool). +isl::union_map afterScatter(const isl::union_map &UMap, bool Strict); /// Construct a range of timepoints between two timepoints. /// @@ -74,13 +73,11 @@ /// A map for each domain element of timepoints between two extreme /// points, or nullptr if @p From or @p To is nullptr, or the isl max /// operations is exceeded. -IslPtr betweenScatter(IslPtr From, IslPtr To, - bool InclFrom, bool InclTo); +isl::map betweenScatter(isl::map From, isl::map To, bool InclFrom, bool InclTo); -/// Piecewise betweenScatter(IslPtr,IslPtr,bool,bool). -IslPtr betweenScatter(IslPtr From, - IslPtr To, bool InclFrom, - bool InclTo); +/// Piecewise betweenScatter(isl::map,isl::map,bool,bool). +isl::union_map betweenScatter(isl::union_map From, isl::union_map To, + bool InclFrom, bool InclTo); /// If by construction a union map is known to contain only a single map, return /// it. @@ -91,8 +88,7 @@ /// isl_union_map_extract_map() on the other hand does not check whether there /// is (at most) one isl_map in the union, i.e. how it has been constructed is /// probably wrong. -IslPtr singleton(IslPtr UMap, - IslPtr ExpectedSpace); +isl::map singleton(isl::union_map UMap, isl::space ExpectedSpace); /// If by construction an isl_union_set is known to contain only a single /// isl_set, return it. @@ -103,8 +99,7 @@ /// isl_union_set_extract_set() on the other hand does not check whether there /// is (at most) one isl_set in the union, i.e. how it has been constructed is /// probably wrong. -IslPtr singleton(IslPtr USet, - IslPtr ExpectedSpace); +isl::set singleton(isl::union_set USet, isl::space ExpectedSpace); /// Determine how many dimensions the scatter space of @p Schedule has. /// @@ -114,13 +109,13 @@ /// The implementation currently returns the maximum number of dimensions it /// encounters, if different, and 0 if none is encountered. However, most other /// code will most likely fail if one of these happen. -unsigned getNumScatterDims(const IslPtr &Schedule); +unsigned getNumScatterDims(const isl::union_map &Schedule); /// Return the scatter space of a @p Schedule. /// /// This is basically the range space of the schedule map, but harder to /// determine because it is an isl_union_map. -IslPtr getScatterSpace(const IslPtr &Schedule); +isl::space getScatterSpace(const isl::union_map &Schedule); /// Construct an identity map for the given domain values. /// @@ -136,18 +131,17 @@ /// /// @return { Space[] -> Space[] } /// A map that maps each value of @p USet to itself. -IslPtr makeIdentityMap(const IslPtr &USet, - bool RestrictDomain); +isl::union_map makeIdentityMap(const isl::union_set &USet, bool RestrictDomain); /// Reverse the nested map tuple in @p Map's domain. /// /// @param Map { [Space1[] -> Space2[]] -> Space3[] } /// /// @return { [Space2[] -> Space1[]] -> Space3[] } -IslPtr reverseDomain(IslPtr Map); +isl::map reverseDomain(isl::map Map); -/// Piecewise reverseDomain(IslPtr). -IslPtr reverseDomain(const IslPtr &UMap); +/// Piecewise reverseDomain(isl::map). +isl::union_map reverseDomain(const isl::union_map &UMap); /// Add a constant to one dimension of a set. /// @@ -158,22 +152,22 @@ /// @param Amount The offset to add to the specified dimension. /// /// @return The modified set. -IslPtr shiftDim(IslPtr Set, int Pos, int Amount); +isl::set shiftDim(isl::set Set, int Pos, int Amount); -/// Piecewise shiftDim(IslPtr,int,int). -IslPtr shiftDim(IslPtr USet, int Pos, int Amount); +/// Piecewise shiftDim(isl::set,int,int). +isl::union_set shiftDim(isl::union_set USet, int Pos, int Amount); /// Simplify a set inplace. -void simplify(IslPtr &Set); +void simplify(isl::set &Set); /// Simplify a union set inplace. -void simplify(IslPtr &USet); +void simplify(isl::union_set &USet); /// Simplify a map inplace. -void simplify(IslPtr &Map); +void simplify(isl::map &Map); /// Simplify a union map inplace. -void simplify(IslPtr &UMap); +void simplify(isl::union_map &UMap); /// Compute the reaching definition statement or the next overwrite for each /// definition of an array element. @@ -228,10 +222,9 @@ /// The reaching definitions or future overwrite as described above, or /// nullptr if either @p Schedule or @p Writes is nullptr, or the isl /// max operations count has exceeded. -IslPtr computeReachingWrite(IslPtr Schedule, - IslPtr Writes, - bool Reverse, bool InclPrevDef, - bool InclNextDef); +isl::union_map computeReachingWrite(isl::union_map Schedule, + isl::union_map Writes, bool Reverse, + bool InclPrevDef, bool InclNextDef); /// Compute the timepoints where the contents of an array element are not used. /// @@ -293,11 +286,10 @@ /// The unused timepoints as defined above, or nullptr if either @p /// Schedule, @p Writes are @p Reads is nullptr, or the ISL max /// operations count is exceeded. -IslPtr computeArrayUnused(IslPtr Schedule, - IslPtr Writes, - IslPtr Reads, - bool ReadEltInSameInst, - bool InclLastRead, bool InclWrite); +isl::union_map computeArrayUnused(isl::union_map Schedule, + isl::union_map Writes, isl::union_map Reads, + bool ReadEltInSameInst, bool InclLastRead, + bool InclWrite); /// Convert a zone (range between timepoints) to timepoints. /// @@ -344,8 +336,8 @@ /// @param InclEnd Include timepoints adjacent to the ending of a zone. /// /// @return { Scatter[] } -IslPtr convertZoneToTimepoints(IslPtr Zone, - bool InclStart, bool InclEnd); +isl::union_set convertZoneToTimepoints(isl::union_set Zone, bool InclStart, + bool InclEnd); } // namespace polly #endif /* POLLY_ISLTOOLS_H */ Index: polly/trunk/lib/External/isl/include/isl-noexceptions.h =================================================================== --- polly/trunk/lib/External/isl/include/isl-noexceptions.h +++ polly/trunk/lib/External/isl/include/isl-noexceptions.h @@ -0,0 +1,3137 @@ +/// These are automatically generated C++ bindings for isl. +/// +/// +/// isl is a library for computing with integer sets and maps described by +/// Presburger formula. On top of this, isl provides various tools for +/// Polyhedral compilation ranging from dependence analysis over scheduling +/// to AST generation. +/// +/// +/// WARNING: Even though these bindings have been throughly tested and the +/// design has been reviewed by various members of the isl community, +/// we do not yet provide any stability guarantees for this interface. +/// We do not expect any larger changes to the interface, but want to +/// reserve the freedom to improve the bindings based on insights that +/// only become visible after shipping these bindings with isl itself. + +#ifndef ISL_CPP_NOEXCEPTIONS +#define ISL_CPP_NOEXCEPTIONS + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace isl { + +inline namespace noexceptions { + +// forward declarations +class aff; +class ast_build; +class ast_expr; +class ast_node; +class basic_map; +class basic_set; +class id; +class local_space; +class map; +class multi_aff; +class multi_pw_aff; +class multi_union_pw_aff; +class multi_val; +class point; +class pw_aff; +class pw_multi_aff; +class schedule; +class schedule_constraints; +class schedule_node; +class set; +class space; +class union_access_info; +class union_flow; +class union_map; +class union_pw_aff; +class union_pw_multi_aff; +class union_set; +class val; + +class ctx { + isl_ctx *ptr; + +public: + ctx(isl_ctx *ctx) + : ptr(ctx) {} + isl_ctx *release() { + auto tmp = ptr; + ptr = nullptr; + return tmp; + } + isl_ctx *get() { + return ptr; + } +}; + +// declarations for isl::aff +inline aff manage(__isl_take isl_aff *ptr); + +inline aff give(__isl_take isl_aff *ptr); + +class aff { + friend inline aff manage(__isl_take isl_aff *ptr); + + isl_aff *ptr = nullptr; + + inline explicit aff(__isl_take isl_aff *ptr); + +public: + inline /* implicit */ aff(); + inline /* implicit */ aff(const aff &obj); + inline /* implicit */ aff(std::nullptr_t); + inline aff &operator=(aff obj); + inline ~aff(); + inline __isl_give isl_aff *copy() const &; + inline __isl_give isl_aff *copy() && = delete; + inline __isl_keep isl_aff *get() const; + inline __isl_give isl_aff *release(); + inline __isl_keep isl_aff *keep() const; + inline __isl_give isl_aff *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::ast_build +inline ast_build manage(__isl_take isl_ast_build *ptr); + +inline ast_build give(__isl_take isl_ast_build *ptr); + +class ast_build { + friend inline ast_build manage(__isl_take isl_ast_build *ptr); + + isl_ast_build *ptr = nullptr; + + inline explicit ast_build(__isl_take isl_ast_build *ptr); + +public: + inline /* implicit */ ast_build(); + inline /* implicit */ ast_build(const ast_build &obj); + inline /* implicit */ ast_build(std::nullptr_t); + inline ast_build &operator=(ast_build obj); + inline ~ast_build(); + inline __isl_give isl_ast_build *copy() const &; + inline __isl_give isl_ast_build *copy() && = delete; + inline __isl_keep isl_ast_build *get() const; + inline __isl_give isl_ast_build *release(); + inline __isl_keep isl_ast_build *keep() const; + inline __isl_give isl_ast_build *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; +}; + +// declarations for isl::ast_expr +inline ast_expr manage(__isl_take isl_ast_expr *ptr); + +inline ast_expr give(__isl_take isl_ast_expr *ptr); + +class ast_expr { + friend inline ast_expr manage(__isl_take isl_ast_expr *ptr); + + isl_ast_expr *ptr = nullptr; + + inline explicit ast_expr(__isl_take isl_ast_expr *ptr); + +public: + inline /* implicit */ ast_expr(); + inline /* implicit */ ast_expr(const ast_expr &obj); + inline /* implicit */ ast_expr(std::nullptr_t); + inline ast_expr &operator=(ast_expr obj); + inline ~ast_expr(); + inline __isl_give isl_ast_expr *copy() const &; + inline __isl_give isl_ast_expr *copy() && = delete; + inline __isl_keep isl_ast_expr *get() const; + inline __isl_give isl_ast_expr *release(); + inline __isl_keep isl_ast_expr *keep() const; + inline __isl_give isl_ast_expr *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::ast_node +inline ast_node manage(__isl_take isl_ast_node *ptr); + +inline ast_node give(__isl_take isl_ast_node *ptr); + +class ast_node { + friend inline ast_node manage(__isl_take isl_ast_node *ptr); + + isl_ast_node *ptr = nullptr; + + inline explicit ast_node(__isl_take isl_ast_node *ptr); + +public: + inline /* implicit */ ast_node(); + inline /* implicit */ ast_node(const ast_node &obj); + inline /* implicit */ ast_node(std::nullptr_t); + inline ast_node &operator=(ast_node obj); + inline ~ast_node(); + inline __isl_give isl_ast_node *copy() const &; + inline __isl_give isl_ast_node *copy() && = delete; + inline __isl_keep isl_ast_node *get() const; + inline __isl_give isl_ast_node *release(); + inline __isl_keep isl_ast_node *keep() const; + inline __isl_give isl_ast_node *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::basic_map +inline basic_map manage(__isl_take isl_basic_map *ptr); + +inline basic_map give(__isl_take isl_basic_map *ptr); + +class basic_map { + friend inline basic_map manage(__isl_take isl_basic_map *ptr); + + isl_basic_map *ptr = nullptr; + + inline explicit basic_map(__isl_take isl_basic_map *ptr); + +public: + inline /* implicit */ basic_map(); + inline /* implicit */ basic_map(const basic_map &obj); + inline /* implicit */ basic_map(std::nullptr_t); + inline basic_map &operator=(basic_map obj); + inline ~basic_map(); + inline __isl_give isl_basic_map *copy() const &; + inline __isl_give isl_basic_map *copy() && = delete; + inline __isl_keep isl_basic_map *get() const; + inline __isl_give isl_basic_map *release(); + inline __isl_keep isl_basic_map *keep() const; + inline __isl_give isl_basic_map *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::basic_set +inline basic_set manage(__isl_take isl_basic_set *ptr); + +inline basic_set give(__isl_take isl_basic_set *ptr); + +class basic_set { + friend inline basic_set manage(__isl_take isl_basic_set *ptr); + + isl_basic_set *ptr = nullptr; + + inline explicit basic_set(__isl_take isl_basic_set *ptr); + +public: + inline /* implicit */ basic_set(); + inline /* implicit */ basic_set(const basic_set &obj); + inline /* implicit */ basic_set(std::nullptr_t); + inline basic_set &operator=(basic_set obj); + inline ~basic_set(); + inline __isl_give isl_basic_set *copy() const &; + inline __isl_give isl_basic_set *copy() && = delete; + inline __isl_keep isl_basic_set *get() const; + inline __isl_give isl_basic_set *release(); + inline __isl_keep isl_basic_set *keep() const; + inline __isl_give isl_basic_set *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::id +inline id manage(__isl_take isl_id *ptr); + +inline id give(__isl_take isl_id *ptr); + +class id { + friend inline id manage(__isl_take isl_id *ptr); + + isl_id *ptr = nullptr; + + inline explicit id(__isl_take isl_id *ptr); + +public: + inline /* implicit */ id(); + inline /* implicit */ id(const id &obj); + inline /* implicit */ id(std::nullptr_t); + inline id &operator=(id obj); + inline ~id(); + inline __isl_give isl_id *copy() const &; + inline __isl_give isl_id *copy() && = delete; + inline __isl_keep isl_id *get() const; + inline __isl_give isl_id *release(); + inline __isl_keep isl_id *keep() const; + inline __isl_give isl_id *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::local_space +inline local_space manage(__isl_take isl_local_space *ptr); + +inline local_space give(__isl_take isl_local_space *ptr); + +class local_space { + friend inline local_space manage(__isl_take isl_local_space *ptr); + + isl_local_space *ptr = nullptr; + + inline explicit local_space(__isl_take isl_local_space *ptr); + +public: + inline /* implicit */ local_space(); + inline /* implicit */ local_space(const local_space &obj); + inline /* implicit */ local_space(std::nullptr_t); + inline local_space &operator=(local_space obj); + inline ~local_space(); + inline __isl_give isl_local_space *copy() const &; + inline __isl_give isl_local_space *copy() && = delete; + inline __isl_keep isl_local_space *get() const; + inline __isl_give isl_local_space *release(); + inline __isl_keep isl_local_space *keep() const; + inline __isl_give isl_local_space *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; +}; + +// declarations for isl::map +inline map manage(__isl_take isl_map *ptr); + +inline map give(__isl_take isl_map *ptr); + +class map { + friend inline map manage(__isl_take isl_map *ptr); + + isl_map *ptr = nullptr; + + inline explicit map(__isl_take isl_map *ptr); + +public: + inline /* implicit */ map(); + inline /* implicit */ map(const map &obj); + inline /* implicit */ map(std::nullptr_t); + inline map &operator=(map obj); + inline ~map(); + inline __isl_give isl_map *copy() const &; + inline __isl_give isl_map *copy() && = delete; + inline __isl_keep isl_map *get() const; + inline __isl_give isl_map *release(); + inline __isl_keep isl_map *keep() const; + inline __isl_give isl_map *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::multi_aff +inline multi_aff manage(__isl_take isl_multi_aff *ptr); + +inline multi_aff give(__isl_take isl_multi_aff *ptr); + +class multi_aff { + friend inline multi_aff manage(__isl_take isl_multi_aff *ptr); + + isl_multi_aff *ptr = nullptr; + + inline explicit multi_aff(__isl_take isl_multi_aff *ptr); + +public: + inline /* implicit */ multi_aff(); + inline /* implicit */ multi_aff(const multi_aff &obj); + inline /* implicit */ multi_aff(std::nullptr_t); + inline multi_aff &operator=(multi_aff obj); + inline ~multi_aff(); + inline __isl_give isl_multi_aff *copy() const &; + inline __isl_give isl_multi_aff *copy() && = delete; + inline __isl_keep isl_multi_aff *get() const; + inline __isl_give isl_multi_aff *release(); + inline __isl_keep isl_multi_aff *keep() const; + inline __isl_give isl_multi_aff *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::multi_pw_aff +inline multi_pw_aff manage(__isl_take isl_multi_pw_aff *ptr); + +inline multi_pw_aff give(__isl_take isl_multi_pw_aff *ptr); + +class multi_pw_aff { + friend inline multi_pw_aff manage(__isl_take isl_multi_pw_aff *ptr); + + isl_multi_pw_aff *ptr = nullptr; + + inline explicit multi_pw_aff(__isl_take isl_multi_pw_aff *ptr); + +public: + inline /* implicit */ multi_pw_aff(); + inline /* implicit */ multi_pw_aff(const multi_pw_aff &obj); + inline /* implicit */ multi_pw_aff(std::nullptr_t); + inline multi_pw_aff &operator=(multi_pw_aff obj); + inline ~multi_pw_aff(); + inline __isl_give isl_multi_pw_aff *copy() const &; + inline __isl_give isl_multi_pw_aff *copy() && = delete; + inline __isl_keep isl_multi_pw_aff *get() const; + inline __isl_give isl_multi_pw_aff *release(); + inline __isl_keep isl_multi_pw_aff *keep() const; + inline __isl_give isl_multi_pw_aff *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::multi_union_pw_aff +inline multi_union_pw_aff manage(__isl_take isl_multi_union_pw_aff *ptr); + +inline multi_union_pw_aff give(__isl_take isl_multi_union_pw_aff *ptr); + +class multi_union_pw_aff { + friend inline multi_union_pw_aff manage(__isl_take isl_multi_union_pw_aff *ptr); + + isl_multi_union_pw_aff *ptr = nullptr; + + inline explicit multi_union_pw_aff(__isl_take isl_multi_union_pw_aff *ptr); + +public: + inline /* implicit */ multi_union_pw_aff(); + inline /* implicit */ multi_union_pw_aff(const multi_union_pw_aff &obj); + inline /* implicit */ multi_union_pw_aff(std::nullptr_t); + inline multi_union_pw_aff &operator=(multi_union_pw_aff obj); + inline ~multi_union_pw_aff(); + inline __isl_give isl_multi_union_pw_aff *copy() const &; + inline __isl_give isl_multi_union_pw_aff *copy() && = delete; + inline __isl_keep isl_multi_union_pw_aff *get() const; + inline __isl_give isl_multi_union_pw_aff *release(); + inline __isl_keep isl_multi_union_pw_aff *keep() const; + inline __isl_give isl_multi_union_pw_aff *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::multi_val +inline multi_val manage(__isl_take isl_multi_val *ptr); + +inline multi_val give(__isl_take isl_multi_val *ptr); + +class multi_val { + friend inline multi_val manage(__isl_take isl_multi_val *ptr); + + isl_multi_val *ptr = nullptr; + + inline explicit multi_val(__isl_take isl_multi_val *ptr); + +public: + inline /* implicit */ multi_val(); + inline /* implicit */ multi_val(const multi_val &obj); + inline /* implicit */ multi_val(std::nullptr_t); + inline multi_val &operator=(multi_val obj); + inline ~multi_val(); + inline __isl_give isl_multi_val *copy() const &; + inline __isl_give isl_multi_val *copy() && = delete; + inline __isl_keep isl_multi_val *get() const; + inline __isl_give isl_multi_val *release(); + inline __isl_keep isl_multi_val *keep() const; + inline __isl_give isl_multi_val *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::point +inline point manage(__isl_take isl_point *ptr); + +inline point give(__isl_take isl_point *ptr); + +class point { + friend inline point manage(__isl_take isl_point *ptr); + + isl_point *ptr = nullptr; + + inline explicit point(__isl_take isl_point *ptr); + +public: + inline /* implicit */ point(); + inline /* implicit */ point(const point &obj); + inline /* implicit */ point(std::nullptr_t); + inline point &operator=(point obj); + inline ~point(); + inline __isl_give isl_point *copy() const &; + inline __isl_give isl_point *copy() && = delete; + inline __isl_keep isl_point *get() const; + inline __isl_give isl_point *release(); + inline __isl_keep isl_point *keep() const; + inline __isl_give isl_point *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::pw_aff +inline pw_aff manage(__isl_take isl_pw_aff *ptr); + +inline pw_aff give(__isl_take isl_pw_aff *ptr); + +class pw_aff { + friend inline pw_aff manage(__isl_take isl_pw_aff *ptr); + + isl_pw_aff *ptr = nullptr; + + inline explicit pw_aff(__isl_take isl_pw_aff *ptr); + +public: + inline /* implicit */ pw_aff(); + inline /* implicit */ pw_aff(const pw_aff &obj); + inline /* implicit */ pw_aff(std::nullptr_t); + inline pw_aff &operator=(pw_aff obj); + inline ~pw_aff(); + inline __isl_give isl_pw_aff *copy() const &; + inline __isl_give isl_pw_aff *copy() && = delete; + inline __isl_keep isl_pw_aff *get() const; + inline __isl_give isl_pw_aff *release(); + inline __isl_keep isl_pw_aff *keep() const; + inline __isl_give isl_pw_aff *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::pw_multi_aff +inline pw_multi_aff manage(__isl_take isl_pw_multi_aff *ptr); + +inline pw_multi_aff give(__isl_take isl_pw_multi_aff *ptr); + +class pw_multi_aff { + friend inline pw_multi_aff manage(__isl_take isl_pw_multi_aff *ptr); + + isl_pw_multi_aff *ptr = nullptr; + + inline explicit pw_multi_aff(__isl_take isl_pw_multi_aff *ptr); + +public: + inline /* implicit */ pw_multi_aff(); + inline /* implicit */ pw_multi_aff(const pw_multi_aff &obj); + inline /* implicit */ pw_multi_aff(std::nullptr_t); + inline pw_multi_aff &operator=(pw_multi_aff obj); + inline ~pw_multi_aff(); + inline __isl_give isl_pw_multi_aff *copy() const &; + inline __isl_give isl_pw_multi_aff *copy() && = delete; + inline __isl_keep isl_pw_multi_aff *get() const; + inline __isl_give isl_pw_multi_aff *release(); + inline __isl_keep isl_pw_multi_aff *keep() const; + inline __isl_give isl_pw_multi_aff *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::schedule +inline schedule manage(__isl_take isl_schedule *ptr); + +inline schedule give(__isl_take isl_schedule *ptr); + +class schedule { + friend inline schedule manage(__isl_take isl_schedule *ptr); + + isl_schedule *ptr = nullptr; + + inline explicit schedule(__isl_take isl_schedule *ptr); + +public: + inline /* implicit */ schedule(); + inline /* implicit */ schedule(const schedule &obj); + inline /* implicit */ schedule(std::nullptr_t); + inline schedule &operator=(schedule obj); + inline ~schedule(); + inline __isl_give isl_schedule *copy() const &; + inline __isl_give isl_schedule *copy() && = delete; + inline __isl_keep isl_schedule *get() const; + inline __isl_give isl_schedule *release(); + inline __isl_keep isl_schedule *keep() const; + inline __isl_give isl_schedule *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::schedule_constraints +inline schedule_constraints manage(__isl_take isl_schedule_constraints *ptr); + +inline schedule_constraints give(__isl_take isl_schedule_constraints *ptr); + +class schedule_constraints { + friend inline schedule_constraints manage(__isl_take isl_schedule_constraints *ptr); + + isl_schedule_constraints *ptr = nullptr; + + inline explicit schedule_constraints(__isl_take isl_schedule_constraints *ptr); + +public: + inline /* implicit */ schedule_constraints(); + inline /* implicit */ schedule_constraints(const schedule_constraints &obj); + inline /* implicit */ schedule_constraints(std::nullptr_t); + inline schedule_constraints &operator=(schedule_constraints obj); + inline ~schedule_constraints(); + inline __isl_give isl_schedule_constraints *copy() const &; + inline __isl_give isl_schedule_constraints *copy() && = delete; + inline __isl_keep isl_schedule_constraints *get() const; + inline __isl_give isl_schedule_constraints *release(); + inline __isl_keep isl_schedule_constraints *keep() const; + inline __isl_give isl_schedule_constraints *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::schedule_node +inline schedule_node manage(__isl_take isl_schedule_node *ptr); + +inline schedule_node give(__isl_take isl_schedule_node *ptr); + +class schedule_node { + friend inline schedule_node manage(__isl_take isl_schedule_node *ptr); + + isl_schedule_node *ptr = nullptr; + + inline explicit schedule_node(__isl_take isl_schedule_node *ptr); + +public: + inline /* implicit */ schedule_node(); + inline /* implicit */ schedule_node(const schedule_node &obj); + inline /* implicit */ schedule_node(std::nullptr_t); + inline schedule_node &operator=(schedule_node obj); + inline ~schedule_node(); + inline __isl_give isl_schedule_node *copy() const &; + inline __isl_give isl_schedule_node *copy() && = delete; + inline __isl_keep isl_schedule_node *get() const; + inline __isl_give isl_schedule_node *release(); + inline __isl_keep isl_schedule_node *keep() const; + inline __isl_give isl_schedule_node *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::set +inline set manage(__isl_take isl_set *ptr); + +inline set give(__isl_take isl_set *ptr); + +class set { + friend inline set manage(__isl_take isl_set *ptr); + + isl_set *ptr = nullptr; + + inline explicit set(__isl_take isl_set *ptr); + +public: + inline /* implicit */ set(); + inline /* implicit */ set(const set &obj); + inline /* implicit */ set(std::nullptr_t); + inline set &operator=(set obj); + inline ~set(); + inline __isl_give isl_set *copy() const &; + inline __isl_give isl_set *copy() && = delete; + inline __isl_keep isl_set *get() const; + inline __isl_give isl_set *release(); + inline __isl_keep isl_set *keep() const; + inline __isl_give isl_set *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::space +inline space manage(__isl_take isl_space *ptr); + +inline space give(__isl_take isl_space *ptr); + +class space { + friend inline space manage(__isl_take isl_space *ptr); + + isl_space *ptr = nullptr; + + inline explicit space(__isl_take isl_space *ptr); + +public: + inline /* implicit */ space(); + inline /* implicit */ space(const space &obj); + inline /* implicit */ space(std::nullptr_t); + inline space &operator=(space obj); + inline ~space(); + inline __isl_give isl_space *copy() const &; + inline __isl_give isl_space *copy() && = delete; + inline __isl_keep isl_space *get() const; + inline __isl_give isl_space *release(); + inline __isl_keep isl_space *keep() const; + inline __isl_give isl_space *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::union_access_info +inline union_access_info manage(__isl_take isl_union_access_info *ptr); + +inline union_access_info give(__isl_take isl_union_access_info *ptr); + +class union_access_info { + friend inline union_access_info manage(__isl_take isl_union_access_info *ptr); + + isl_union_access_info *ptr = nullptr; + + inline explicit union_access_info(__isl_take isl_union_access_info *ptr); + +public: + inline /* implicit */ union_access_info(); + inline /* implicit */ union_access_info(const union_access_info &obj); + inline /* implicit */ union_access_info(std::nullptr_t); + inline union_access_info &operator=(union_access_info obj); + inline ~union_access_info(); + inline __isl_give isl_union_access_info *copy() const &; + inline __isl_give isl_union_access_info *copy() && = delete; + inline __isl_keep isl_union_access_info *get() const; + inline __isl_give isl_union_access_info *release(); + inline __isl_keep isl_union_access_info *keep() const; + inline __isl_give isl_union_access_info *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::union_flow +inline union_flow manage(__isl_take isl_union_flow *ptr); + +inline union_flow give(__isl_take isl_union_flow *ptr); + +class union_flow { + friend inline union_flow manage(__isl_take isl_union_flow *ptr); + + isl_union_flow *ptr = nullptr; + + inline explicit union_flow(__isl_take isl_union_flow *ptr); + +public: + inline /* implicit */ union_flow(); + inline /* implicit */ union_flow(const union_flow &obj); + inline /* implicit */ union_flow(std::nullptr_t); + inline union_flow &operator=(union_flow obj); + inline ~union_flow(); + inline __isl_give isl_union_flow *copy() const &; + inline __isl_give isl_union_flow *copy() && = delete; + inline __isl_keep isl_union_flow *get() const; + inline __isl_give isl_union_flow *release(); + inline __isl_keep isl_union_flow *keep() const; + inline __isl_give isl_union_flow *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::union_map +inline union_map manage(__isl_take isl_union_map *ptr); + +inline union_map give(__isl_take isl_union_map *ptr); + +class union_map { + friend inline union_map manage(__isl_take isl_union_map *ptr); + + isl_union_map *ptr = nullptr; + + inline explicit union_map(__isl_take isl_union_map *ptr); + +public: + inline /* implicit */ union_map(); + inline /* implicit */ union_map(const union_map &obj); + inline /* implicit */ union_map(std::nullptr_t); + inline union_map &operator=(union_map obj); + inline ~union_map(); + inline __isl_give isl_union_map *copy() const &; + inline __isl_give isl_union_map *copy() && = delete; + inline __isl_keep isl_union_map *get() const; + inline __isl_give isl_union_map *release(); + inline __isl_keep isl_union_map *keep() const; + inline __isl_give isl_union_map *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::union_pw_aff +inline union_pw_aff manage(__isl_take isl_union_pw_aff *ptr); + +inline union_pw_aff give(__isl_take isl_union_pw_aff *ptr); + +class union_pw_aff { + friend inline union_pw_aff manage(__isl_take isl_union_pw_aff *ptr); + + isl_union_pw_aff *ptr = nullptr; + + inline explicit union_pw_aff(__isl_take isl_union_pw_aff *ptr); + +public: + inline /* implicit */ union_pw_aff(); + inline /* implicit */ union_pw_aff(const union_pw_aff &obj); + inline /* implicit */ union_pw_aff(std::nullptr_t); + inline union_pw_aff &operator=(union_pw_aff obj); + inline ~union_pw_aff(); + inline __isl_give isl_union_pw_aff *copy() const &; + inline __isl_give isl_union_pw_aff *copy() && = delete; + inline __isl_keep isl_union_pw_aff *get() const; + inline __isl_give isl_union_pw_aff *release(); + inline __isl_keep isl_union_pw_aff *keep() const; + inline __isl_give isl_union_pw_aff *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::union_pw_multi_aff +inline union_pw_multi_aff manage(__isl_take isl_union_pw_multi_aff *ptr); + +inline union_pw_multi_aff give(__isl_take isl_union_pw_multi_aff *ptr); + +class union_pw_multi_aff { + friend inline union_pw_multi_aff manage(__isl_take isl_union_pw_multi_aff *ptr); + + isl_union_pw_multi_aff *ptr = nullptr; + + inline explicit union_pw_multi_aff(__isl_take isl_union_pw_multi_aff *ptr); + +public: + inline /* implicit */ union_pw_multi_aff(); + inline /* implicit */ union_pw_multi_aff(const union_pw_multi_aff &obj); + inline /* implicit */ union_pw_multi_aff(std::nullptr_t); + inline union_pw_multi_aff &operator=(union_pw_multi_aff obj); + inline ~union_pw_multi_aff(); + inline __isl_give isl_union_pw_multi_aff *copy() const &; + inline __isl_give isl_union_pw_multi_aff *copy() && = delete; + inline __isl_keep isl_union_pw_multi_aff *get() const; + inline __isl_give isl_union_pw_multi_aff *release(); + inline __isl_keep isl_union_pw_multi_aff *keep() const; + inline __isl_give isl_union_pw_multi_aff *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::union_set +inline union_set manage(__isl_take isl_union_set *ptr); + +inline union_set give(__isl_take isl_union_set *ptr); + +class union_set { + friend inline union_set manage(__isl_take isl_union_set *ptr); + + isl_union_set *ptr = nullptr; + + inline explicit union_set(__isl_take isl_union_set *ptr); + +public: + inline /* implicit */ union_set(); + inline /* implicit */ union_set(const union_set &obj); + inline /* implicit */ union_set(std::nullptr_t); + inline union_set &operator=(union_set obj); + inline ~union_set(); + inline __isl_give isl_union_set *copy() const &; + inline __isl_give isl_union_set *copy() && = delete; + inline __isl_keep isl_union_set *get() const; + inline __isl_give isl_union_set *release(); + inline __isl_keep isl_union_set *keep() const; + inline __isl_give isl_union_set *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// declarations for isl::val +inline val manage(__isl_take isl_val *ptr); + +inline val give(__isl_take isl_val *ptr); + +class val { + friend inline val manage(__isl_take isl_val *ptr); + + isl_val *ptr = nullptr; + + inline explicit val(__isl_take isl_val *ptr); + +public: + inline /* implicit */ val(); + inline /* implicit */ val(const val &obj); + inline /* implicit */ val(std::nullptr_t); + inline val &operator=(val obj); + inline ~val(); + inline __isl_give isl_val *copy() const &; + inline __isl_give isl_val *copy() && = delete; + inline __isl_keep isl_val *get() const; + inline __isl_give isl_val *release(); + inline __isl_keep isl_val *keep() const; + inline __isl_give isl_val *take(); + inline explicit operator bool() const; + inline ctx get_ctx() const; + inline bool is_null() const; + inline std::string to_str() const; +}; + +// implementations for isl::aff +aff manage(__isl_take isl_aff *ptr) { + return aff(ptr); +} + +aff give(__isl_take isl_aff *ptr) { + return manage(ptr); +} + +aff::aff() + : ptr(nullptr) {} + +aff::aff(const aff &obj) + : ptr(obj.copy()) {} + +aff::aff(std::nullptr_t) + : ptr(nullptr) {} + +aff::aff(__isl_take isl_aff *ptr) + : ptr(ptr) {} + +aff &aff::operator=(aff obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +aff::~aff() { + if (ptr) + isl_aff_free(ptr); +} + +__isl_give isl_aff *aff::copy() const & { + return isl_aff_copy(ptr); +} + +__isl_keep isl_aff *aff::get() const { + return ptr; +} + +__isl_give isl_aff *aff::release() { + isl_aff *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_aff *aff::keep() const { + return get(); +} + +__isl_give isl_aff *aff::take() { + return release(); +} + +aff::operator bool() const { + return !is_null(); +} + +ctx aff::get_ctx() const { + return ctx(isl_aff_get_ctx(ptr)); +} + +bool aff::is_null() const { + return ptr == nullptr; +} + +std::string aff::to_str() const { + char *Tmp = isl_aff_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const aff &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::ast_build +ast_build manage(__isl_take isl_ast_build *ptr) { + return ast_build(ptr); +} + +ast_build give(__isl_take isl_ast_build *ptr) { + return manage(ptr); +} + +ast_build::ast_build() + : ptr(nullptr) {} + +ast_build::ast_build(const ast_build &obj) + : ptr(obj.copy()) {} + +ast_build::ast_build(std::nullptr_t) + : ptr(nullptr) {} + +ast_build::ast_build(__isl_take isl_ast_build *ptr) + : ptr(ptr) {} + +ast_build &ast_build::operator=(ast_build obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +ast_build::~ast_build() { + if (ptr) + isl_ast_build_free(ptr); +} + +__isl_give isl_ast_build *ast_build::copy() const & { + return isl_ast_build_copy(ptr); +} + +__isl_keep isl_ast_build *ast_build::get() const { + return ptr; +} + +__isl_give isl_ast_build *ast_build::release() { + isl_ast_build *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_ast_build *ast_build::keep() const { + return get(); +} + +__isl_give isl_ast_build *ast_build::take() { + return release(); +} + +ast_build::operator bool() const { + return !is_null(); +} + +ctx ast_build::get_ctx() const { + return ctx(isl_ast_build_get_ctx(ptr)); +} + +bool ast_build::is_null() const { + return ptr == nullptr; +} + +// implementations for isl::ast_expr +ast_expr manage(__isl_take isl_ast_expr *ptr) { + return ast_expr(ptr); +} + +ast_expr give(__isl_take isl_ast_expr *ptr) { + return manage(ptr); +} + +ast_expr::ast_expr() + : ptr(nullptr) {} + +ast_expr::ast_expr(const ast_expr &obj) + : ptr(obj.copy()) {} + +ast_expr::ast_expr(std::nullptr_t) + : ptr(nullptr) {} + +ast_expr::ast_expr(__isl_take isl_ast_expr *ptr) + : ptr(ptr) {} + +ast_expr &ast_expr::operator=(ast_expr obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +ast_expr::~ast_expr() { + if (ptr) + isl_ast_expr_free(ptr); +} + +__isl_give isl_ast_expr *ast_expr::copy() const & { + return isl_ast_expr_copy(ptr); +} + +__isl_keep isl_ast_expr *ast_expr::get() const { + return ptr; +} + +__isl_give isl_ast_expr *ast_expr::release() { + isl_ast_expr *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_ast_expr *ast_expr::keep() const { + return get(); +} + +__isl_give isl_ast_expr *ast_expr::take() { + return release(); +} + +ast_expr::operator bool() const { + return !is_null(); +} + +ctx ast_expr::get_ctx() const { + return ctx(isl_ast_expr_get_ctx(ptr)); +} + +bool ast_expr::is_null() const { + return ptr == nullptr; +} + +std::string ast_expr::to_str() const { + char *Tmp = isl_ast_expr_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const ast_expr &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::ast_node +ast_node manage(__isl_take isl_ast_node *ptr) { + return ast_node(ptr); +} + +ast_node give(__isl_take isl_ast_node *ptr) { + return manage(ptr); +} + +ast_node::ast_node() + : ptr(nullptr) {} + +ast_node::ast_node(const ast_node &obj) + : ptr(obj.copy()) {} + +ast_node::ast_node(std::nullptr_t) + : ptr(nullptr) {} + +ast_node::ast_node(__isl_take isl_ast_node *ptr) + : ptr(ptr) {} + +ast_node &ast_node::operator=(ast_node obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +ast_node::~ast_node() { + if (ptr) + isl_ast_node_free(ptr); +} + +__isl_give isl_ast_node *ast_node::copy() const & { + return isl_ast_node_copy(ptr); +} + +__isl_keep isl_ast_node *ast_node::get() const { + return ptr; +} + +__isl_give isl_ast_node *ast_node::release() { + isl_ast_node *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_ast_node *ast_node::keep() const { + return get(); +} + +__isl_give isl_ast_node *ast_node::take() { + return release(); +} + +ast_node::operator bool() const { + return !is_null(); +} + +ctx ast_node::get_ctx() const { + return ctx(isl_ast_node_get_ctx(ptr)); +} + +bool ast_node::is_null() const { + return ptr == nullptr; +} + +std::string ast_node::to_str() const { + char *Tmp = isl_ast_node_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const ast_node &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::basic_map +basic_map manage(__isl_take isl_basic_map *ptr) { + return basic_map(ptr); +} + +basic_map give(__isl_take isl_basic_map *ptr) { + return manage(ptr); +} + +basic_map::basic_map() + : ptr(nullptr) {} + +basic_map::basic_map(const basic_map &obj) + : ptr(obj.copy()) {} + +basic_map::basic_map(std::nullptr_t) + : ptr(nullptr) {} + +basic_map::basic_map(__isl_take isl_basic_map *ptr) + : ptr(ptr) {} + +basic_map &basic_map::operator=(basic_map obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +basic_map::~basic_map() { + if (ptr) + isl_basic_map_free(ptr); +} + +__isl_give isl_basic_map *basic_map::copy() const & { + return isl_basic_map_copy(ptr); +} + +__isl_keep isl_basic_map *basic_map::get() const { + return ptr; +} + +__isl_give isl_basic_map *basic_map::release() { + isl_basic_map *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_basic_map *basic_map::keep() const { + return get(); +} + +__isl_give isl_basic_map *basic_map::take() { + return release(); +} + +basic_map::operator bool() const { + return !is_null(); +} + +ctx basic_map::get_ctx() const { + return ctx(isl_basic_map_get_ctx(ptr)); +} + +bool basic_map::is_null() const { + return ptr == nullptr; +} + +std::string basic_map::to_str() const { + char *Tmp = isl_basic_map_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const basic_map &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::basic_set +basic_set manage(__isl_take isl_basic_set *ptr) { + return basic_set(ptr); +} + +basic_set give(__isl_take isl_basic_set *ptr) { + return manage(ptr); +} + +basic_set::basic_set() + : ptr(nullptr) {} + +basic_set::basic_set(const basic_set &obj) + : ptr(obj.copy()) {} + +basic_set::basic_set(std::nullptr_t) + : ptr(nullptr) {} + +basic_set::basic_set(__isl_take isl_basic_set *ptr) + : ptr(ptr) {} + +basic_set &basic_set::operator=(basic_set obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +basic_set::~basic_set() { + if (ptr) + isl_basic_set_free(ptr); +} + +__isl_give isl_basic_set *basic_set::copy() const & { + return isl_basic_set_copy(ptr); +} + +__isl_keep isl_basic_set *basic_set::get() const { + return ptr; +} + +__isl_give isl_basic_set *basic_set::release() { + isl_basic_set *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_basic_set *basic_set::keep() const { + return get(); +} + +__isl_give isl_basic_set *basic_set::take() { + return release(); +} + +basic_set::operator bool() const { + return !is_null(); +} + +ctx basic_set::get_ctx() const { + return ctx(isl_basic_set_get_ctx(ptr)); +} + +bool basic_set::is_null() const { + return ptr == nullptr; +} + +std::string basic_set::to_str() const { + char *Tmp = isl_basic_set_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const basic_set &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::id +id manage(__isl_take isl_id *ptr) { + return id(ptr); +} + +id give(__isl_take isl_id *ptr) { + return manage(ptr); +} + +id::id() + : ptr(nullptr) {} + +id::id(const id &obj) + : ptr(obj.copy()) {} + +id::id(std::nullptr_t) + : ptr(nullptr) {} + +id::id(__isl_take isl_id *ptr) + : ptr(ptr) {} + +id &id::operator=(id obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +id::~id() { + if (ptr) + isl_id_free(ptr); +} + +__isl_give isl_id *id::copy() const & { + return isl_id_copy(ptr); +} + +__isl_keep isl_id *id::get() const { + return ptr; +} + +__isl_give isl_id *id::release() { + isl_id *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_id *id::keep() const { + return get(); +} + +__isl_give isl_id *id::take() { + return release(); +} + +id::operator bool() const { + return !is_null(); +} + +ctx id::get_ctx() const { + return ctx(isl_id_get_ctx(ptr)); +} + +bool id::is_null() const { + return ptr == nullptr; +} + +std::string id::to_str() const { + char *Tmp = isl_id_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const id &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::local_space +local_space manage(__isl_take isl_local_space *ptr) { + return local_space(ptr); +} + +local_space give(__isl_take isl_local_space *ptr) { + return manage(ptr); +} + +local_space::local_space() + : ptr(nullptr) {} + +local_space::local_space(const local_space &obj) + : ptr(obj.copy()) {} + +local_space::local_space(std::nullptr_t) + : ptr(nullptr) {} + +local_space::local_space(__isl_take isl_local_space *ptr) + : ptr(ptr) {} + +local_space &local_space::operator=(local_space obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +local_space::~local_space() { + if (ptr) + isl_local_space_free(ptr); +} + +__isl_give isl_local_space *local_space::copy() const & { + return isl_local_space_copy(ptr); +} + +__isl_keep isl_local_space *local_space::get() const { + return ptr; +} + +__isl_give isl_local_space *local_space::release() { + isl_local_space *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_local_space *local_space::keep() const { + return get(); +} + +__isl_give isl_local_space *local_space::take() { + return release(); +} + +local_space::operator bool() const { + return !is_null(); +} + +ctx local_space::get_ctx() const { + return ctx(isl_local_space_get_ctx(ptr)); +} + +bool local_space::is_null() const { + return ptr == nullptr; +} + +// implementations for isl::map +map manage(__isl_take isl_map *ptr) { + return map(ptr); +} + +map give(__isl_take isl_map *ptr) { + return manage(ptr); +} + +map::map() + : ptr(nullptr) {} + +map::map(const map &obj) + : ptr(obj.copy()) {} + +map::map(std::nullptr_t) + : ptr(nullptr) {} + +map::map(__isl_take isl_map *ptr) + : ptr(ptr) {} + +map &map::operator=(map obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +map::~map() { + if (ptr) + isl_map_free(ptr); +} + +__isl_give isl_map *map::copy() const & { + return isl_map_copy(ptr); +} + +__isl_keep isl_map *map::get() const { + return ptr; +} + +__isl_give isl_map *map::release() { + isl_map *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_map *map::keep() const { + return get(); +} + +__isl_give isl_map *map::take() { + return release(); +} + +map::operator bool() const { + return !is_null(); +} + +ctx map::get_ctx() const { + return ctx(isl_map_get_ctx(ptr)); +} + +bool map::is_null() const { + return ptr == nullptr; +} + +std::string map::to_str() const { + char *Tmp = isl_map_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const map &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::multi_aff +multi_aff manage(__isl_take isl_multi_aff *ptr) { + return multi_aff(ptr); +} + +multi_aff give(__isl_take isl_multi_aff *ptr) { + return manage(ptr); +} + +multi_aff::multi_aff() + : ptr(nullptr) {} + +multi_aff::multi_aff(const multi_aff &obj) + : ptr(obj.copy()) {} + +multi_aff::multi_aff(std::nullptr_t) + : ptr(nullptr) {} + +multi_aff::multi_aff(__isl_take isl_multi_aff *ptr) + : ptr(ptr) {} + +multi_aff &multi_aff::operator=(multi_aff obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +multi_aff::~multi_aff() { + if (ptr) + isl_multi_aff_free(ptr); +} + +__isl_give isl_multi_aff *multi_aff::copy() const & { + return isl_multi_aff_copy(ptr); +} + +__isl_keep isl_multi_aff *multi_aff::get() const { + return ptr; +} + +__isl_give isl_multi_aff *multi_aff::release() { + isl_multi_aff *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_multi_aff *multi_aff::keep() const { + return get(); +} + +__isl_give isl_multi_aff *multi_aff::take() { + return release(); +} + +multi_aff::operator bool() const { + return !is_null(); +} + +ctx multi_aff::get_ctx() const { + return ctx(isl_multi_aff_get_ctx(ptr)); +} + +bool multi_aff::is_null() const { + return ptr == nullptr; +} + +std::string multi_aff::to_str() const { + char *Tmp = isl_multi_aff_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const multi_aff &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::multi_pw_aff +multi_pw_aff manage(__isl_take isl_multi_pw_aff *ptr) { + return multi_pw_aff(ptr); +} + +multi_pw_aff give(__isl_take isl_multi_pw_aff *ptr) { + return manage(ptr); +} + +multi_pw_aff::multi_pw_aff() + : ptr(nullptr) {} + +multi_pw_aff::multi_pw_aff(const multi_pw_aff &obj) + : ptr(obj.copy()) {} + +multi_pw_aff::multi_pw_aff(std::nullptr_t) + : ptr(nullptr) {} + +multi_pw_aff::multi_pw_aff(__isl_take isl_multi_pw_aff *ptr) + : ptr(ptr) {} + +multi_pw_aff &multi_pw_aff::operator=(multi_pw_aff obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +multi_pw_aff::~multi_pw_aff() { + if (ptr) + isl_multi_pw_aff_free(ptr); +} + +__isl_give isl_multi_pw_aff *multi_pw_aff::copy() const & { + return isl_multi_pw_aff_copy(ptr); +} + +__isl_keep isl_multi_pw_aff *multi_pw_aff::get() const { + return ptr; +} + +__isl_give isl_multi_pw_aff *multi_pw_aff::release() { + isl_multi_pw_aff *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_multi_pw_aff *multi_pw_aff::keep() const { + return get(); +} + +__isl_give isl_multi_pw_aff *multi_pw_aff::take() { + return release(); +} + +multi_pw_aff::operator bool() const { + return !is_null(); +} + +ctx multi_pw_aff::get_ctx() const { + return ctx(isl_multi_pw_aff_get_ctx(ptr)); +} + +bool multi_pw_aff::is_null() const { + return ptr == nullptr; +} + +std::string multi_pw_aff::to_str() const { + char *Tmp = isl_multi_pw_aff_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const multi_pw_aff &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::multi_union_pw_aff +multi_union_pw_aff manage(__isl_take isl_multi_union_pw_aff *ptr) { + return multi_union_pw_aff(ptr); +} + +multi_union_pw_aff give(__isl_take isl_multi_union_pw_aff *ptr) { + return manage(ptr); +} + +multi_union_pw_aff::multi_union_pw_aff() + : ptr(nullptr) {} + +multi_union_pw_aff::multi_union_pw_aff(const multi_union_pw_aff &obj) + : ptr(obj.copy()) {} + +multi_union_pw_aff::multi_union_pw_aff(std::nullptr_t) + : ptr(nullptr) {} + +multi_union_pw_aff::multi_union_pw_aff(__isl_take isl_multi_union_pw_aff *ptr) + : ptr(ptr) {} + +multi_union_pw_aff &multi_union_pw_aff::operator=(multi_union_pw_aff obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +multi_union_pw_aff::~multi_union_pw_aff() { + if (ptr) + isl_multi_union_pw_aff_free(ptr); +} + +__isl_give isl_multi_union_pw_aff *multi_union_pw_aff::copy() const & { + return isl_multi_union_pw_aff_copy(ptr); +} + +__isl_keep isl_multi_union_pw_aff *multi_union_pw_aff::get() const { + return ptr; +} + +__isl_give isl_multi_union_pw_aff *multi_union_pw_aff::release() { + isl_multi_union_pw_aff *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_multi_union_pw_aff *multi_union_pw_aff::keep() const { + return get(); +} + +__isl_give isl_multi_union_pw_aff *multi_union_pw_aff::take() { + return release(); +} + +multi_union_pw_aff::operator bool() const { + return !is_null(); +} + +ctx multi_union_pw_aff::get_ctx() const { + return ctx(isl_multi_union_pw_aff_get_ctx(ptr)); +} + +bool multi_union_pw_aff::is_null() const { + return ptr == nullptr; +} + +std::string multi_union_pw_aff::to_str() const { + char *Tmp = isl_multi_union_pw_aff_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const multi_union_pw_aff &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::multi_val +multi_val manage(__isl_take isl_multi_val *ptr) { + return multi_val(ptr); +} + +multi_val give(__isl_take isl_multi_val *ptr) { + return manage(ptr); +} + +multi_val::multi_val() + : ptr(nullptr) {} + +multi_val::multi_val(const multi_val &obj) + : ptr(obj.copy()) {} + +multi_val::multi_val(std::nullptr_t) + : ptr(nullptr) {} + +multi_val::multi_val(__isl_take isl_multi_val *ptr) + : ptr(ptr) {} + +multi_val &multi_val::operator=(multi_val obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +multi_val::~multi_val() { + if (ptr) + isl_multi_val_free(ptr); +} + +__isl_give isl_multi_val *multi_val::copy() const & { + return isl_multi_val_copy(ptr); +} + +__isl_keep isl_multi_val *multi_val::get() const { + return ptr; +} + +__isl_give isl_multi_val *multi_val::release() { + isl_multi_val *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_multi_val *multi_val::keep() const { + return get(); +} + +__isl_give isl_multi_val *multi_val::take() { + return release(); +} + +multi_val::operator bool() const { + return !is_null(); +} + +ctx multi_val::get_ctx() const { + return ctx(isl_multi_val_get_ctx(ptr)); +} + +bool multi_val::is_null() const { + return ptr == nullptr; +} + +std::string multi_val::to_str() const { + char *Tmp = isl_multi_val_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const multi_val &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::point +point manage(__isl_take isl_point *ptr) { + return point(ptr); +} + +point give(__isl_take isl_point *ptr) { + return manage(ptr); +} + +point::point() + : ptr(nullptr) {} + +point::point(const point &obj) + : ptr(obj.copy()) {} + +point::point(std::nullptr_t) + : ptr(nullptr) {} + +point::point(__isl_take isl_point *ptr) + : ptr(ptr) {} + +point &point::operator=(point obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +point::~point() { + if (ptr) + isl_point_free(ptr); +} + +__isl_give isl_point *point::copy() const & { + return isl_point_copy(ptr); +} + +__isl_keep isl_point *point::get() const { + return ptr; +} + +__isl_give isl_point *point::release() { + isl_point *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_point *point::keep() const { + return get(); +} + +__isl_give isl_point *point::take() { + return release(); +} + +point::operator bool() const { + return !is_null(); +} + +ctx point::get_ctx() const { + return ctx(isl_point_get_ctx(ptr)); +} + +bool point::is_null() const { + return ptr == nullptr; +} + +std::string point::to_str() const { + char *Tmp = isl_point_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const point &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::pw_aff +pw_aff manage(__isl_take isl_pw_aff *ptr) { + return pw_aff(ptr); +} + +pw_aff give(__isl_take isl_pw_aff *ptr) { + return manage(ptr); +} + +pw_aff::pw_aff() + : ptr(nullptr) {} + +pw_aff::pw_aff(const pw_aff &obj) + : ptr(obj.copy()) {} + +pw_aff::pw_aff(std::nullptr_t) + : ptr(nullptr) {} + +pw_aff::pw_aff(__isl_take isl_pw_aff *ptr) + : ptr(ptr) {} + +pw_aff &pw_aff::operator=(pw_aff obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +pw_aff::~pw_aff() { + if (ptr) + isl_pw_aff_free(ptr); +} + +__isl_give isl_pw_aff *pw_aff::copy() const & { + return isl_pw_aff_copy(ptr); +} + +__isl_keep isl_pw_aff *pw_aff::get() const { + return ptr; +} + +__isl_give isl_pw_aff *pw_aff::release() { + isl_pw_aff *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_pw_aff *pw_aff::keep() const { + return get(); +} + +__isl_give isl_pw_aff *pw_aff::take() { + return release(); +} + +pw_aff::operator bool() const { + return !is_null(); +} + +ctx pw_aff::get_ctx() const { + return ctx(isl_pw_aff_get_ctx(ptr)); +} + +bool pw_aff::is_null() const { + return ptr == nullptr; +} + +std::string pw_aff::to_str() const { + char *Tmp = isl_pw_aff_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const pw_aff &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::pw_multi_aff +pw_multi_aff manage(__isl_take isl_pw_multi_aff *ptr) { + return pw_multi_aff(ptr); +} + +pw_multi_aff give(__isl_take isl_pw_multi_aff *ptr) { + return manage(ptr); +} + +pw_multi_aff::pw_multi_aff() + : ptr(nullptr) {} + +pw_multi_aff::pw_multi_aff(const pw_multi_aff &obj) + : ptr(obj.copy()) {} + +pw_multi_aff::pw_multi_aff(std::nullptr_t) + : ptr(nullptr) {} + +pw_multi_aff::pw_multi_aff(__isl_take isl_pw_multi_aff *ptr) + : ptr(ptr) {} + +pw_multi_aff &pw_multi_aff::operator=(pw_multi_aff obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +pw_multi_aff::~pw_multi_aff() { + if (ptr) + isl_pw_multi_aff_free(ptr); +} + +__isl_give isl_pw_multi_aff *pw_multi_aff::copy() const & { + return isl_pw_multi_aff_copy(ptr); +} + +__isl_keep isl_pw_multi_aff *pw_multi_aff::get() const { + return ptr; +} + +__isl_give isl_pw_multi_aff *pw_multi_aff::release() { + isl_pw_multi_aff *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_pw_multi_aff *pw_multi_aff::keep() const { + return get(); +} + +__isl_give isl_pw_multi_aff *pw_multi_aff::take() { + return release(); +} + +pw_multi_aff::operator bool() const { + return !is_null(); +} + +ctx pw_multi_aff::get_ctx() const { + return ctx(isl_pw_multi_aff_get_ctx(ptr)); +} + +bool pw_multi_aff::is_null() const { + return ptr == nullptr; +} + +std::string pw_multi_aff::to_str() const { + char *Tmp = isl_pw_multi_aff_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const pw_multi_aff &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::schedule +schedule manage(__isl_take isl_schedule *ptr) { + return schedule(ptr); +} + +schedule give(__isl_take isl_schedule *ptr) { + return manage(ptr); +} + +schedule::schedule() + : ptr(nullptr) {} + +schedule::schedule(const schedule &obj) + : ptr(obj.copy()) {} + +schedule::schedule(std::nullptr_t) + : ptr(nullptr) {} + +schedule::schedule(__isl_take isl_schedule *ptr) + : ptr(ptr) {} + +schedule &schedule::operator=(schedule obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +schedule::~schedule() { + if (ptr) + isl_schedule_free(ptr); +} + +__isl_give isl_schedule *schedule::copy() const & { + return isl_schedule_copy(ptr); +} + +__isl_keep isl_schedule *schedule::get() const { + return ptr; +} + +__isl_give isl_schedule *schedule::release() { + isl_schedule *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_schedule *schedule::keep() const { + return get(); +} + +__isl_give isl_schedule *schedule::take() { + return release(); +} + +schedule::operator bool() const { + return !is_null(); +} + +ctx schedule::get_ctx() const { + return ctx(isl_schedule_get_ctx(ptr)); +} + +bool schedule::is_null() const { + return ptr == nullptr; +} + +std::string schedule::to_str() const { + char *Tmp = isl_schedule_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const schedule &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::schedule_constraints +schedule_constraints manage(__isl_take isl_schedule_constraints *ptr) { + return schedule_constraints(ptr); +} + +schedule_constraints give(__isl_take isl_schedule_constraints *ptr) { + return manage(ptr); +} + +schedule_constraints::schedule_constraints() + : ptr(nullptr) {} + +schedule_constraints::schedule_constraints(const schedule_constraints &obj) + : ptr(obj.copy()) {} + +schedule_constraints::schedule_constraints(std::nullptr_t) + : ptr(nullptr) {} + +schedule_constraints::schedule_constraints(__isl_take isl_schedule_constraints *ptr) + : ptr(ptr) {} + +schedule_constraints &schedule_constraints::operator=(schedule_constraints obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +schedule_constraints::~schedule_constraints() { + if (ptr) + isl_schedule_constraints_free(ptr); +} + +__isl_give isl_schedule_constraints *schedule_constraints::copy() const & { + return isl_schedule_constraints_copy(ptr); +} + +__isl_keep isl_schedule_constraints *schedule_constraints::get() const { + return ptr; +} + +__isl_give isl_schedule_constraints *schedule_constraints::release() { + isl_schedule_constraints *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_schedule_constraints *schedule_constraints::keep() const { + return get(); +} + +__isl_give isl_schedule_constraints *schedule_constraints::take() { + return release(); +} + +schedule_constraints::operator bool() const { + return !is_null(); +} + +ctx schedule_constraints::get_ctx() const { + return ctx(isl_schedule_constraints_get_ctx(ptr)); +} + +bool schedule_constraints::is_null() const { + return ptr == nullptr; +} + +std::string schedule_constraints::to_str() const { + char *Tmp = isl_schedule_constraints_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const schedule_constraints &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::schedule_node +schedule_node manage(__isl_take isl_schedule_node *ptr) { + return schedule_node(ptr); +} + +schedule_node give(__isl_take isl_schedule_node *ptr) { + return manage(ptr); +} + +schedule_node::schedule_node() + : ptr(nullptr) {} + +schedule_node::schedule_node(const schedule_node &obj) + : ptr(obj.copy()) {} + +schedule_node::schedule_node(std::nullptr_t) + : ptr(nullptr) {} + +schedule_node::schedule_node(__isl_take isl_schedule_node *ptr) + : ptr(ptr) {} + +schedule_node &schedule_node::operator=(schedule_node obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +schedule_node::~schedule_node() { + if (ptr) + isl_schedule_node_free(ptr); +} + +__isl_give isl_schedule_node *schedule_node::copy() const & { + return isl_schedule_node_copy(ptr); +} + +__isl_keep isl_schedule_node *schedule_node::get() const { + return ptr; +} + +__isl_give isl_schedule_node *schedule_node::release() { + isl_schedule_node *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_schedule_node *schedule_node::keep() const { + return get(); +} + +__isl_give isl_schedule_node *schedule_node::take() { + return release(); +} + +schedule_node::operator bool() const { + return !is_null(); +} + +ctx schedule_node::get_ctx() const { + return ctx(isl_schedule_node_get_ctx(ptr)); +} + +bool schedule_node::is_null() const { + return ptr == nullptr; +} + +std::string schedule_node::to_str() const { + char *Tmp = isl_schedule_node_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const schedule_node &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::set +set manage(__isl_take isl_set *ptr) { + return set(ptr); +} + +set give(__isl_take isl_set *ptr) { + return manage(ptr); +} + +set::set() + : ptr(nullptr) {} + +set::set(const set &obj) + : ptr(obj.copy()) {} + +set::set(std::nullptr_t) + : ptr(nullptr) {} + +set::set(__isl_take isl_set *ptr) + : ptr(ptr) {} + +set &set::operator=(set obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +set::~set() { + if (ptr) + isl_set_free(ptr); +} + +__isl_give isl_set *set::copy() const & { + return isl_set_copy(ptr); +} + +__isl_keep isl_set *set::get() const { + return ptr; +} + +__isl_give isl_set *set::release() { + isl_set *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_set *set::keep() const { + return get(); +} + +__isl_give isl_set *set::take() { + return release(); +} + +set::operator bool() const { + return !is_null(); +} + +ctx set::get_ctx() const { + return ctx(isl_set_get_ctx(ptr)); +} + +bool set::is_null() const { + return ptr == nullptr; +} + +std::string set::to_str() const { + char *Tmp = isl_set_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const set &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::space +space manage(__isl_take isl_space *ptr) { + return space(ptr); +} + +space give(__isl_take isl_space *ptr) { + return manage(ptr); +} + +space::space() + : ptr(nullptr) {} + +space::space(const space &obj) + : ptr(obj.copy()) {} + +space::space(std::nullptr_t) + : ptr(nullptr) {} + +space::space(__isl_take isl_space *ptr) + : ptr(ptr) {} + +space &space::operator=(space obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +space::~space() { + if (ptr) + isl_space_free(ptr); +} + +__isl_give isl_space *space::copy() const & { + return isl_space_copy(ptr); +} + +__isl_keep isl_space *space::get() const { + return ptr; +} + +__isl_give isl_space *space::release() { + isl_space *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_space *space::keep() const { + return get(); +} + +__isl_give isl_space *space::take() { + return release(); +} + +space::operator bool() const { + return !is_null(); +} + +ctx space::get_ctx() const { + return ctx(isl_space_get_ctx(ptr)); +} + +bool space::is_null() const { + return ptr == nullptr; +} + +std::string space::to_str() const { + char *Tmp = isl_space_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const space &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::union_access_info +union_access_info manage(__isl_take isl_union_access_info *ptr) { + return union_access_info(ptr); +} + +union_access_info give(__isl_take isl_union_access_info *ptr) { + return manage(ptr); +} + +union_access_info::union_access_info() + : ptr(nullptr) {} + +union_access_info::union_access_info(const union_access_info &obj) + : ptr(obj.copy()) {} + +union_access_info::union_access_info(std::nullptr_t) + : ptr(nullptr) {} + +union_access_info::union_access_info(__isl_take isl_union_access_info *ptr) + : ptr(ptr) {} + +union_access_info &union_access_info::operator=(union_access_info obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +union_access_info::~union_access_info() { + if (ptr) + isl_union_access_info_free(ptr); +} + +__isl_give isl_union_access_info *union_access_info::copy() const & { + return isl_union_access_info_copy(ptr); +} + +__isl_keep isl_union_access_info *union_access_info::get() const { + return ptr; +} + +__isl_give isl_union_access_info *union_access_info::release() { + isl_union_access_info *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_union_access_info *union_access_info::keep() const { + return get(); +} + +__isl_give isl_union_access_info *union_access_info::take() { + return release(); +} + +union_access_info::operator bool() const { + return !is_null(); +} + +ctx union_access_info::get_ctx() const { + return ctx(isl_union_access_info_get_ctx(ptr)); +} + +bool union_access_info::is_null() const { + return ptr == nullptr; +} + +std::string union_access_info::to_str() const { + char *Tmp = isl_union_access_info_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const union_access_info &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::union_flow +union_flow manage(__isl_take isl_union_flow *ptr) { + return union_flow(ptr); +} + +union_flow give(__isl_take isl_union_flow *ptr) { + return manage(ptr); +} + +union_flow::union_flow() + : ptr(nullptr) {} + +union_flow::union_flow(const union_flow &obj) + : ptr(obj.copy()) {} + +union_flow::union_flow(std::nullptr_t) + : ptr(nullptr) {} + +union_flow::union_flow(__isl_take isl_union_flow *ptr) + : ptr(ptr) {} + +union_flow &union_flow::operator=(union_flow obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +union_flow::~union_flow() { + if (ptr) + isl_union_flow_free(ptr); +} + +__isl_give isl_union_flow *union_flow::copy() const & { + return isl_union_flow_copy(ptr); +} + +__isl_keep isl_union_flow *union_flow::get() const { + return ptr; +} + +__isl_give isl_union_flow *union_flow::release() { + isl_union_flow *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_union_flow *union_flow::keep() const { + return get(); +} + +__isl_give isl_union_flow *union_flow::take() { + return release(); +} + +union_flow::operator bool() const { + return !is_null(); +} + +ctx union_flow::get_ctx() const { + return ctx(isl_union_flow_get_ctx(ptr)); +} + +bool union_flow::is_null() const { + return ptr == nullptr; +} + +std::string union_flow::to_str() const { + char *Tmp = isl_union_flow_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const union_flow &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::union_map +union_map manage(__isl_take isl_union_map *ptr) { + return union_map(ptr); +} + +union_map give(__isl_take isl_union_map *ptr) { + return manage(ptr); +} + +union_map::union_map() + : ptr(nullptr) {} + +union_map::union_map(const union_map &obj) + : ptr(obj.copy()) {} + +union_map::union_map(std::nullptr_t) + : ptr(nullptr) {} + +union_map::union_map(__isl_take isl_union_map *ptr) + : ptr(ptr) {} + +union_map &union_map::operator=(union_map obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +union_map::~union_map() { + if (ptr) + isl_union_map_free(ptr); +} + +__isl_give isl_union_map *union_map::copy() const & { + return isl_union_map_copy(ptr); +} + +__isl_keep isl_union_map *union_map::get() const { + return ptr; +} + +__isl_give isl_union_map *union_map::release() { + isl_union_map *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_union_map *union_map::keep() const { + return get(); +} + +__isl_give isl_union_map *union_map::take() { + return release(); +} + +union_map::operator bool() const { + return !is_null(); +} + +ctx union_map::get_ctx() const { + return ctx(isl_union_map_get_ctx(ptr)); +} + +bool union_map::is_null() const { + return ptr == nullptr; +} + +std::string union_map::to_str() const { + char *Tmp = isl_union_map_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const union_map &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::union_pw_aff +union_pw_aff manage(__isl_take isl_union_pw_aff *ptr) { + return union_pw_aff(ptr); +} + +union_pw_aff give(__isl_take isl_union_pw_aff *ptr) { + return manage(ptr); +} + +union_pw_aff::union_pw_aff() + : ptr(nullptr) {} + +union_pw_aff::union_pw_aff(const union_pw_aff &obj) + : ptr(obj.copy()) {} + +union_pw_aff::union_pw_aff(std::nullptr_t) + : ptr(nullptr) {} + +union_pw_aff::union_pw_aff(__isl_take isl_union_pw_aff *ptr) + : ptr(ptr) {} + +union_pw_aff &union_pw_aff::operator=(union_pw_aff obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +union_pw_aff::~union_pw_aff() { + if (ptr) + isl_union_pw_aff_free(ptr); +} + +__isl_give isl_union_pw_aff *union_pw_aff::copy() const & { + return isl_union_pw_aff_copy(ptr); +} + +__isl_keep isl_union_pw_aff *union_pw_aff::get() const { + return ptr; +} + +__isl_give isl_union_pw_aff *union_pw_aff::release() { + isl_union_pw_aff *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_union_pw_aff *union_pw_aff::keep() const { + return get(); +} + +__isl_give isl_union_pw_aff *union_pw_aff::take() { + return release(); +} + +union_pw_aff::operator bool() const { + return !is_null(); +} + +ctx union_pw_aff::get_ctx() const { + return ctx(isl_union_pw_aff_get_ctx(ptr)); +} + +bool union_pw_aff::is_null() const { + return ptr == nullptr; +} + +std::string union_pw_aff::to_str() const { + char *Tmp = isl_union_pw_aff_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const union_pw_aff &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::union_pw_multi_aff +union_pw_multi_aff manage(__isl_take isl_union_pw_multi_aff *ptr) { + return union_pw_multi_aff(ptr); +} + +union_pw_multi_aff give(__isl_take isl_union_pw_multi_aff *ptr) { + return manage(ptr); +} + +union_pw_multi_aff::union_pw_multi_aff() + : ptr(nullptr) {} + +union_pw_multi_aff::union_pw_multi_aff(const union_pw_multi_aff &obj) + : ptr(obj.copy()) {} + +union_pw_multi_aff::union_pw_multi_aff(std::nullptr_t) + : ptr(nullptr) {} + +union_pw_multi_aff::union_pw_multi_aff(__isl_take isl_union_pw_multi_aff *ptr) + : ptr(ptr) {} + +union_pw_multi_aff &union_pw_multi_aff::operator=(union_pw_multi_aff obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +union_pw_multi_aff::~union_pw_multi_aff() { + if (ptr) + isl_union_pw_multi_aff_free(ptr); +} + +__isl_give isl_union_pw_multi_aff *union_pw_multi_aff::copy() const & { + return isl_union_pw_multi_aff_copy(ptr); +} + +__isl_keep isl_union_pw_multi_aff *union_pw_multi_aff::get() const { + return ptr; +} + +__isl_give isl_union_pw_multi_aff *union_pw_multi_aff::release() { + isl_union_pw_multi_aff *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_union_pw_multi_aff *union_pw_multi_aff::keep() const { + return get(); +} + +__isl_give isl_union_pw_multi_aff *union_pw_multi_aff::take() { + return release(); +} + +union_pw_multi_aff::operator bool() const { + return !is_null(); +} + +ctx union_pw_multi_aff::get_ctx() const { + return ctx(isl_union_pw_multi_aff_get_ctx(ptr)); +} + +bool union_pw_multi_aff::is_null() const { + return ptr == nullptr; +} + +std::string union_pw_multi_aff::to_str() const { + char *Tmp = isl_union_pw_multi_aff_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const union_pw_multi_aff &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::union_set +union_set manage(__isl_take isl_union_set *ptr) { + return union_set(ptr); +} + +union_set give(__isl_take isl_union_set *ptr) { + return manage(ptr); +} + +union_set::union_set() + : ptr(nullptr) {} + +union_set::union_set(const union_set &obj) + : ptr(obj.copy()) {} + +union_set::union_set(std::nullptr_t) + : ptr(nullptr) {} + +union_set::union_set(__isl_take isl_union_set *ptr) + : ptr(ptr) {} + +union_set &union_set::operator=(union_set obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +union_set::~union_set() { + if (ptr) + isl_union_set_free(ptr); +} + +__isl_give isl_union_set *union_set::copy() const & { + return isl_union_set_copy(ptr); +} + +__isl_keep isl_union_set *union_set::get() const { + return ptr; +} + +__isl_give isl_union_set *union_set::release() { + isl_union_set *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_union_set *union_set::keep() const { + return get(); +} + +__isl_give isl_union_set *union_set::take() { + return release(); +} + +union_set::operator bool() const { + return !is_null(); +} + +ctx union_set::get_ctx() const { + return ctx(isl_union_set_get_ctx(ptr)); +} + +bool union_set::is_null() const { + return ptr == nullptr; +} + +std::string union_set::to_str() const { + char *Tmp = isl_union_set_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const union_set &Obj) { + OS << Obj.to_str(); + return OS; +} + +// implementations for isl::val +val manage(__isl_take isl_val *ptr) { + return val(ptr); +} + +val give(__isl_take isl_val *ptr) { + return manage(ptr); +} + +val::val() + : ptr(nullptr) {} + +val::val(const val &obj) + : ptr(obj.copy()) {} + +val::val(std::nullptr_t) + : ptr(nullptr) {} + +val::val(__isl_take isl_val *ptr) + : ptr(ptr) {} + +val &val::operator=(val obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +val::~val() { + if (ptr) + isl_val_free(ptr); +} + +__isl_give isl_val *val::copy() const & { + return isl_val_copy(ptr); +} + +__isl_keep isl_val *val::get() const { + return ptr; +} + +__isl_give isl_val *val::release() { + isl_val *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_val *val::keep() const { + return get(); +} + +__isl_give isl_val *val::take() { + return release(); +} + +val::operator bool() const { + return !is_null(); +} + +ctx val::get_ctx() const { + return ctx(isl_val_get_ctx(ptr)); +} + +bool val::is_null() const { + return ptr == nullptr; +} + +std::string val::to_str() const { + char *Tmp = isl_val_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const val &Obj) { + OS << Obj.to_str(); + return OS; +} + +} // namespace noexceptions +} // namespace isl + +#endif /* ISL_CPP_NOEXCEPTIONS */ Index: polly/trunk/lib/Support/GICHelper.cpp =================================================================== --- polly/trunk/lib/Support/GICHelper.cpp +++ polly/trunk/lib/Support/GICHelper.cpp @@ -204,133 +204,104 @@ return getIslCompatibleName(Prefix, ValStr, Suffix); } -#define DEFINE_ISLPTR(TYPE) \ - template <> void IslPtr::dump() const { isl_##TYPE##_dump(Obj); } - -namespace polly { -DEFINE_ISLPTR(id) -DEFINE_ISLPTR(val) -DEFINE_ISLPTR(space) -DEFINE_ISLPTR(basic_map) -DEFINE_ISLPTR(map) -DEFINE_ISLPTR(union_map) -DEFINE_ISLPTR(basic_set) -DEFINE_ISLPTR(set) -DEFINE_ISLPTR(union_set) -DEFINE_ISLPTR(aff) -DEFINE_ISLPTR(multi_aff) -DEFINE_ISLPTR(pw_aff) -DEFINE_ISLPTR(pw_multi_aff) -DEFINE_ISLPTR(multi_pw_aff) -DEFINE_ISLPTR(union_pw_aff) -DEFINE_ISLPTR(multi_union_pw_aff) -DEFINE_ISLPTR(union_pw_multi_aff) -} // namespace polly - -void polly::foreachElt(const IslPtr &Map, - const std::function)> &F) { +void polly::foreachElt(const isl::map &Map, + const std::function &F) { isl_map_foreach_basic_map( Map.keep(), [](__isl_take isl_basic_map *BMap, void *User) -> isl_stat { auto &F = - *static_cast)> *>( - User); + *static_cast *>(User); F(give(BMap)); return isl_stat_ok; }, const_cast(static_cast(&F))); } -void polly::foreachElt(const IslPtr &Set, - const std::function)> &F) { +void polly::foreachElt(const isl::set &Set, + const std::function &F) { isl_set_foreach_basic_set( Set.keep(), [](__isl_take isl_basic_set *BSet, void *User) -> isl_stat { auto &F = - *static_cast)> *>( - User); + *static_cast *>(User); F(give(BSet)); return isl_stat_ok; }, const_cast(static_cast(&F))); } -void polly::foreachElt(const IslPtr &UMap, - const std::function Map)> &F) { +void polly::foreachElt(const isl::union_map &UMap, + const std::function &F) { isl_union_map_foreach_map( UMap.keep(), [](__isl_take isl_map *Map, void *User) -> isl_stat { - auto &F = - *static_cast)> *>(User); + auto &F = *static_cast *>(User); F(give(Map)); return isl_stat_ok; }, const_cast(static_cast(&F))); } -void polly::foreachElt(const IslPtr &USet, - const std::function Set)> &F) { +void polly::foreachElt(const isl::union_set &USet, + const std::function &F) { isl_union_set_foreach_set( USet.keep(), [](__isl_take isl_set *Set, void *User) -> isl_stat { - auto &F = - *static_cast)> *>(User); + auto &F = *static_cast *>(User); F(give(Set)); return isl_stat_ok; }, const_cast(static_cast(&F))); } -void polly::foreachElt(const IslPtr &UPwAff, - const std::function)> &F) { +void polly::foreachElt(const isl::union_pw_aff &UPwAff, + const std::function &F) { isl_union_pw_aff_foreach_pw_aff( UPwAff.keep(), [](__isl_take isl_pw_aff *PwAff, void *User) -> isl_stat { - auto &F = - *static_cast)> *>(User); + auto &F = *static_cast *>(User); F(give(PwAff)); return isl_stat_ok; }, const_cast(static_cast(&F))); } -isl_stat polly::foreachEltWithBreak( - const IslPtr &Map, - const std::function)> &F) { +isl_stat +polly::foreachEltWithBreak(const isl::map &Map, + const std::function &F) { return isl_map_foreach_basic_map( Map.keep(), [](__isl_take isl_basic_map *BMap, void *User) -> isl_stat { - auto &F = *static_cast< - const std::function)> *>(User); + auto &F = + *static_cast *>(User); return F(give(BMap)); }, const_cast(static_cast(&F))); } -isl_stat polly::foreachEltWithBreak( - const IslPtr &UMap, - const std::function Map)> &F) { +isl_stat +polly::foreachEltWithBreak(const isl::union_map &UMap, + const std::function &F) { return isl_union_map_foreach_map( UMap.keep(), [](__isl_take isl_map *Map, void *User) -> isl_stat { auto &F = - *static_cast Map)> *>( - User); + *static_cast *>(User); return F(give(Map)); }, const_cast(static_cast(&F))); } isl_stat polly::foreachPieceWithBreak( - const IslPtr &PwAff, - const std::function, IslPtr)> &F) { + const isl::pw_aff &PwAff, + const std::function &F) { return isl_pw_aff_foreach_piece( PwAff.keep(), [](__isl_take isl_set *Domain, __isl_take isl_aff *Aff, void *User) -> isl_stat { - auto &F = *static_cast< - const std::function, IslPtr)> *>( - User); + auto &F = + *static_cast *>( + User); return F(give(Domain), give(Aff)); }, const_cast(static_cast(&F))); Index: polly/trunk/lib/Support/ISLTools.cpp =================================================================== --- polly/trunk/lib/Support/ISLTools.cpp +++ polly/trunk/lib/Support/ISLTools.cpp @@ -29,8 +29,7 @@ /// @param Amount Value added to the shifted dimension. /// /// @return An isl_multi_aff for the map with this shifted dimension. -IslPtr makeShiftDimAff(IslPtr Space, int Pos, - int Amount) { +isl::multi_aff makeShiftDimAff(isl::space Space, int Pos, int Amount) { auto Identity = give(isl_multi_aff_identity(Space.take())); if (Amount == 0) return Identity; @@ -45,8 +44,8 @@ /// @param FromSpace2 { Space2[] } /// /// @return { [Space1[] -> Space2[]] -> [Space2[] -> Space1[]] } -IslPtr makeTupleSwapBasicMap(IslPtr FromSpace1, - IslPtr FromSpace2) { +isl::basic_map makeTupleSwapBasicMap(isl::space FromSpace1, + isl::space FromSpace2) { assert(isl_space_is_set(FromSpace1.keep()) != isl_bool_false); assert(isl_space_is_set(FromSpace2.keep()) != isl_bool_false); @@ -72,69 +71,64 @@ return Result; } -/// Like makeTupleSwapBasicMap(IslPtr,IslPtr), but returns +/// Like makeTupleSwapBasicMap(isl::space,isl::space), but returns /// an isl_map. -IslPtr makeTupleSwapMap(IslPtr FromSpace1, - IslPtr FromSpace2) { +isl::map makeTupleSwapMap(isl::space FromSpace1, isl::space FromSpace2) { auto BMapResult = makeTupleSwapBasicMap(std::move(FromSpace1), std::move(FromSpace2)); return give(isl_map_from_basic_map(BMapResult.take())); } } // anonymous namespace -IslPtr polly::beforeScatter(IslPtr Map, bool Strict) { +isl::map polly::beforeScatter(isl::map Map, bool Strict) { auto RangeSpace = give(isl_space_range(isl_map_get_space(Map.keep()))); auto ScatterRel = give(Strict ? isl_map_lex_gt(RangeSpace.take()) : isl_map_lex_ge(RangeSpace.take())); return give(isl_map_apply_range(Map.take(), ScatterRel.take())); } -IslPtr polly::beforeScatter(IslPtr UMap, - bool Strict) { +isl::union_map polly::beforeScatter(isl::union_map UMap, bool Strict) { auto Result = give(isl_union_map_empty(isl_union_map_get_space(UMap.keep()))); - foreachElt(UMap, [=, &Result](IslPtr Map) { + foreachElt(UMap, [=, &Result](isl::map Map) { auto After = beforeScatter(Map, Strict); Result = give(isl_union_map_add_map(Result.take(), After.take())); }); return Result; } -IslPtr polly::afterScatter(IslPtr Map, bool Strict) { +isl::map polly::afterScatter(isl::map Map, bool Strict) { auto RangeSpace = give(isl_space_range(isl_map_get_space(Map.keep()))); auto ScatterRel = give(Strict ? isl_map_lex_lt(RangeSpace.take()) : isl_map_lex_le(RangeSpace.take())); return give(isl_map_apply_range(Map.take(), ScatterRel.take())); } -IslPtr polly::afterScatter(const IslPtr &UMap, - bool Strict) { +isl::union_map polly::afterScatter(const isl::union_map &UMap, bool Strict) { auto Result = give(isl_union_map_empty(isl_union_map_get_space(UMap.keep()))); - foreachElt(UMap, [=, &Result](IslPtr Map) { + foreachElt(UMap, [=, &Result](isl::map Map) { auto After = afterScatter(Map, Strict); Result = give(isl_union_map_add_map(Result.take(), After.take())); }); return Result; } -IslPtr polly::betweenScatter(IslPtr From, IslPtr To, - bool InclFrom, bool InclTo) { +isl::map polly::betweenScatter(isl::map From, isl::map To, bool InclFrom, + bool InclTo) { auto AfterFrom = afterScatter(From, !InclFrom); auto BeforeTo = beforeScatter(To, !InclTo); return give(isl_map_intersect(AfterFrom.take(), BeforeTo.take())); } -IslPtr polly::betweenScatter(IslPtr From, - IslPtr To, - bool InclFrom, bool InclTo) { +isl::union_map polly::betweenScatter(isl::union_map From, isl::union_map To, + bool InclFrom, bool InclTo) { auto AfterFrom = afterScatter(From, !InclFrom); auto BeforeTo = beforeScatter(To, !InclTo); return give(isl_union_map_intersect(AfterFrom.take(), BeforeTo.take())); } -IslPtr polly::singleton(IslPtr UMap, - IslPtr ExpectedSpace) { +isl::map polly::singleton(isl::union_map UMap, isl::space ExpectedSpace) { if (!UMap) return nullptr; @@ -148,8 +142,7 @@ return Result; } -IslPtr polly::singleton(IslPtr USet, - IslPtr ExpectedSpace) { +isl::set polly::singleton(isl::union_set USet, isl::space ExpectedSpace) { if (!USet) return nullptr; @@ -163,16 +156,15 @@ return Result; } -unsigned polly::getNumScatterDims(const IslPtr &Schedule) { +unsigned polly::getNumScatterDims(const isl::union_map &Schedule) { unsigned Dims = 0; - foreachElt(Schedule, [&Dims](IslPtr Map) { + foreachElt(Schedule, [&Dims](isl::map Map) { Dims = std::max(Dims, isl_map_dim(Map.keep(), isl_dim_out)); }); return Dims; } -IslPtr -polly::getScatterSpace(const IslPtr &Schedule) { +isl::space polly::getScatterSpace(const isl::union_map &Schedule) { if (!Schedule) return nullptr; auto Dims = getNumScatterDims(Schedule); @@ -181,10 +173,10 @@ return give(isl_space_add_dims(ScatterSpace.take(), isl_dim_set, Dims)); } -IslPtr polly::makeIdentityMap(const IslPtr &USet, - bool RestrictDomain) { +isl::union_map polly::makeIdentityMap(const isl::union_set &USet, + bool RestrictDomain) { auto Result = give(isl_union_map_empty(isl_union_set_get_space(USet.keep()))); - foreachElt(USet, [=, &Result](IslPtr Set) { + foreachElt(USet, [=, &Result](isl::set Set) { auto IdentityMap = give(isl_map_identity( isl_space_map_from_set(isl_set_get_space(Set.keep())))); if (RestrictDomain) @@ -195,7 +187,7 @@ return Result; } -IslPtr polly::reverseDomain(IslPtr Map) { +isl::map polly::reverseDomain(isl::map Map) { auto DomSpace = give(isl_space_unwrap(isl_space_domain(isl_map_get_space(Map.keep())))); auto Space1 = give(isl_space_domain(DomSpace.copy())); @@ -204,16 +196,16 @@ return give(isl_map_apply_domain(Map.take(), Swap.take())); } -IslPtr polly::reverseDomain(const IslPtr &UMap) { +isl::union_map polly::reverseDomain(const isl::union_map &UMap) { auto Result = give(isl_union_map_empty(isl_union_map_get_space(UMap.keep()))); - foreachElt(UMap, [=, &Result](IslPtr Map) { + foreachElt(UMap, [=, &Result](isl::map Map) { auto Reversed = reverseDomain(std::move(Map)); Result = give(isl_union_map_add_map(Result.take(), Reversed.take())); }); return Result; } -IslPtr polly::shiftDim(IslPtr Set, int Pos, int Amount) { +isl::set polly::shiftDim(isl::set Set, int Pos, int Amount) { int NumDims = isl_set_dim(Set.keep(), isl_dim_set); if (Pos < 0) Pos = NumDims + Pos; @@ -225,50 +217,48 @@ return give(isl_set_apply(Set.take(), TranslatorMap.take())); } -IslPtr polly::shiftDim(IslPtr USet, int Pos, - int Amount) { +isl::union_set polly::shiftDim(isl::union_set USet, int Pos, int Amount) { auto Result = give(isl_union_set_empty(isl_union_set_get_space(USet.keep()))); - foreachElt(USet, [=, &Result](IslPtr Set) { + foreachElt(USet, [=, &Result](isl::set Set) { auto Shifted = shiftDim(Set, Pos, Amount); Result = give(isl_union_set_add_set(Result.take(), Shifted.take())); }); return Result; } -void polly::simplify(IslPtr &Set) { +void polly::simplify(isl::set &Set) { Set = give(isl_set_compute_divs(Set.take())); Set = give(isl_set_detect_equalities(Set.take())); Set = give(isl_set_coalesce(Set.take())); } -void polly::simplify(IslPtr &USet) { +void polly::simplify(isl::union_set &USet) { USet = give(isl_union_set_compute_divs(USet.take())); USet = give(isl_union_set_detect_equalities(USet.take())); USet = give(isl_union_set_coalesce(USet.take())); } -void polly::simplify(IslPtr &Map) { +void polly::simplify(isl::map &Map) { Map = give(isl_map_compute_divs(Map.take())); Map = give(isl_map_detect_equalities(Map.take())); Map = give(isl_map_coalesce(Map.take())); } -void polly::simplify(IslPtr &UMap) { +void polly::simplify(isl::union_map &UMap) { UMap = give(isl_union_map_compute_divs(UMap.take())); UMap = give(isl_union_map_detect_equalities(UMap.take())); UMap = give(isl_union_map_coalesce(UMap.take())); } -IslPtr -polly::computeReachingWrite(IslPtr Schedule, - IslPtr Writes, bool Reverse, - bool InclPrevDef, bool InclNextDef) { +isl::union_map polly::computeReachingWrite(isl::union_map Schedule, + isl::union_map Writes, bool Reverse, + bool InclPrevDef, bool InclNextDef) { // { Scatter[] } auto ScatterSpace = getScatterSpace(Schedule); // { ScatterRead[] -> ScatterWrite[] } - IslPtr Relation; + isl::map Relation; if (Reverse) Relation = give(InclPrevDef ? isl_map_lex_lt(ScatterSpace.take()) : isl_map_lex_le(ScatterSpace.take())); @@ -319,12 +309,10 @@ return ReachableWriteDomain; } -IslPtr polly::computeArrayUnused(IslPtr Schedule, - IslPtr Writes, - IslPtr Reads, - bool ReadEltInSameInst, - bool IncludeLastRead, - bool IncludeWrite) { +isl::union_map +polly::computeArrayUnused(isl::union_map Schedule, isl::union_map Writes, + isl::union_map Reads, bool ReadEltInSameInst, + bool IncludeLastRead, bool IncludeWrite) { // { Element[] -> Scatter[] } auto ReadActions = give(isl_union_map_apply_domain(Schedule.copy(), Reads.take())); @@ -366,9 +354,8 @@ isl_union_map_domain_factor_domain(BetweenLastReadOverwrite.take()))); } -IslPtr polly::convertZoneToTimepoints(IslPtr Zone, - bool InclStart, - bool InclEnd) { +isl::union_set polly::convertZoneToTimepoints(isl::union_set Zone, + bool InclStart, bool InclEnd) { if (!InclStart && InclEnd) return Zone; Index: polly/trunk/lib/Transform/DeLICM.cpp =================================================================== --- polly/trunk/lib/Transform/DeLICM.cpp +++ polly/trunk/lib/Transform/DeLICM.cpp @@ -254,16 +254,16 @@ } }; -IslPtr computeReachingDefinition(IslPtr Schedule, - IslPtr Writes, - bool InclDef, bool InclRedef) { +isl::union_map computeReachingDefinition(isl::union_map Schedule, + isl::union_map Writes, bool InclDef, + bool InclRedef) { return computeReachingWrite(Schedule, Writes, false, InclDef, InclRedef); } -IslPtr computeReachingOverwrite(IslPtr Schedule, - IslPtr Writes, - bool InclPrevWrite, - bool InclOverwrite) { +isl::union_map computeReachingOverwrite(isl::union_map Schedule, + isl::union_map Writes, + bool InclPrevWrite, + bool InclOverwrite) { return computeReachingWrite(Schedule, Writes, true, InclPrevWrite, InclOverwrite); } @@ -281,10 +281,10 @@ /// of the overwrite itself. /// /// @return { Scatter[] -> DomainDef[] } -IslPtr -computeScalarReachingOverwrite(IslPtr Schedule, - IslPtr Writes, bool InclPrevWrite, - bool InclOverwrite) { +isl::union_map computeScalarReachingOverwrite(isl::union_map Schedule, + isl::union_set Writes, + bool InclPrevWrite, + bool InclOverwrite) { // { DomainWrite[] } auto WritesMap = give(isl_union_map_from_domain(Writes.take())); @@ -305,10 +305,9 @@ /// @param InclOverwrite Include the overwrite to the result. /// /// @return { Scatter[] -> DomainWrite[] } -IslPtr computeScalarReachingOverwrite(IslPtr Schedule, - IslPtr Writes, - bool InclPrevWrite, - bool InclOverwrite) { +isl::map computeScalarReachingOverwrite(isl::union_map Schedule, + isl::set Writes, bool InclPrevWrite, + bool InclOverwrite) { auto ScatterSpace = getScatterSpace(Schedule); auto DomSpace = give(isl_set_get_space(Writes.keep())); @@ -333,10 +332,9 @@ /// @param InclRedef Include the timepoint of the overwrite into the result. /// /// @return { Scatter[] -> DomainWrite[] } -IslPtr -computeScalarReachingDefinition(IslPtr Schedule, - IslPtr Writes, bool InclDef, - bool InclRedef) { +isl::union_map computeScalarReachingDefinition(isl::union_map Schedule, + isl::union_set Writes, + bool InclDef, bool InclRedef) { // { DomainWrite[] -> Element[] } auto Defs = give(isl_union_map_from_domain(Writes.take())); @@ -361,9 +359,8 @@ /// @param InclRedef Include the timepoint of the overwrite into the result. /// /// @return { Scatter[] -> DomainWrite[] } -IslPtr computeScalarReachingDefinition( // { Domain[] -> Zone[] } - IslPtr Schedule, IslPtr Writes, bool InclDef, - bool InclRedef) { +isl::map computeScalarReachingDefinition( // { Domain[] -> Zone[] } + isl::union_map Schedule, isl::set Writes, bool InclDef, bool InclRedef) { auto DomainSpace = give(isl_set_get_space(Writes.keep())); auto ScatterSpace = getScatterSpace(Schedule); @@ -403,8 +400,7 @@ /// @return A map with that associates the domain elements of @p Relevant to the /// same elements and in addition the elements of @p Universe to some /// undefined elements. The function prefers to return simple maps. -IslPtr expandMapping(IslPtr Relevant, - IslPtr Universe) { +isl::union_map expandMapping(isl::union_map Relevant, isl::union_set Universe) { Relevant = give(isl_union_map_coalesce(Relevant.take())); auto RelevantDomain = give(isl_union_map_domain(Relevant.copy())); auto Simplified = @@ -465,18 +461,18 @@ /// interval and can be converted to sets of timepoints when needed (e.g., in /// isConflicting when comparing to the write sets). /// @see convertZoneToTimepoints and this file's comment for more details. - IslPtr Occupied; + isl::union_set Occupied; /// { [Element[] -> Zone[]] } /// Set of array elements when they are not alive, i.e. their memory can be /// used for other purposed. Can contain a nullptr; in this case the set is /// implicitly defined as the complement of #Occupied. - IslPtr Unused; + isl::union_set Unused; /// { [Element[] -> Scatter[]] } /// The write actions currently in the scop or that would be added when /// mapping a scalar. - IslPtr Written; + isl::union_set Written; /// Check whether this Knowledge object is well-formed. void checkConsistency() const { @@ -506,16 +502,15 @@ Knowledge() {} /// Create a new object with the given members. - Knowledge(IslPtr Occupied, IslPtr Unused, - IslPtr Written) + Knowledge(isl::union_set Occupied, isl::union_set Unused, + isl::union_set Written) : Occupied(std::move(Occupied)), Unused(std::move(Unused)), Written(std::move(Written)) { checkConsistency(); } /// Alternative constructor taking isl_sets instead isl_union_sets. - Knowledge(IslPtr Occupied, IslPtr Unused, - IslPtr Written) + Knowledge(isl::set Occupied, isl::set Unused, isl::set Written) : Knowledge(give(isl_union_set_from_set(Occupied.take())), give(isl_union_set_from_set(Unused.take())), give(isl_union_set_from_set(Written.take()))) {} @@ -692,35 +687,35 @@ /// Cached reaching definitions for each ScopStmt. /// /// Use getScalarReachingDefinition() to get its contents. - DenseMap> ScalarReachDefZone; + DenseMap ScalarReachDefZone; /// The analyzed Scop. Scop *S; /// Parameter space that does not need realignment. - IslPtr ParamSpace; + isl::space ParamSpace; /// Space the schedule maps to. - IslPtr ScatterSpace; + isl::space ScatterSpace; /// Cached version of the schedule and domains. - IslPtr Schedule; + isl::union_map Schedule; /// Set of all referenced elements. /// { Element[] -> Element[] } - IslPtr AllElements; + isl::union_set AllElements; /// Combined access relations of all MemoryKind::Array READ accesses. /// { DomainRead[] -> Element[] } - IslPtr AllReads; + isl::union_map AllReads; /// Combined access relations of all MemoryKind::Array, MAY_WRITE accesses. /// { DomainMayWrite[] -> Element[] } - IslPtr AllMayWrites; + isl::union_map AllMayWrites; /// Combined access relations of all MemoryKind::Array, MUST_WRITE accesses. /// { DomainMustWrite[] -> Element[] } - IslPtr AllMustWrites; + isl::union_map AllMustWrites; /// Prepare the object before computing the zones of @p S. ZoneAlgorithm(Scop *S) @@ -840,11 +835,11 @@ } protected: - IslPtr makeEmptyUnionSet() { + isl::union_set makeEmptyUnionSet() { return give(isl_union_set_empty(ParamSpace.copy())); } - IslPtr makeEmptyUnionMap() { + isl::union_map makeEmptyUnionMap() { return give(isl_union_map_empty(ParamSpace.copy())); } @@ -860,24 +855,24 @@ /// Get the schedule for @p Stmt. /// /// The domain of the result is as narrow as possible. - IslPtr getScatterFor(ScopStmt *Stmt) const { + isl::map getScatterFor(ScopStmt *Stmt) const { auto ResultSpace = give(isl_space_map_from_domain_and_range( Stmt->getDomainSpace(), ScatterSpace.copy())); return give(isl_union_map_extract_map(Schedule.keep(), ResultSpace.take())); } /// Get the schedule of @p MA's parent statement. - IslPtr getScatterFor(MemoryAccess *MA) const { + isl::map getScatterFor(MemoryAccess *MA) const { return getScatterFor(MA->getStatement()); } /// Get the schedule for the statement instances of @p Domain. - IslPtr getScatterFor(IslPtr Domain) const { + isl::union_map getScatterFor(isl::union_set Domain) const { return give(isl_union_map_intersect_domain(Schedule.copy(), Domain.take())); } /// Get the schedule for the statement instances of @p Domain. - IslPtr getScatterFor(IslPtr Domain) const { + isl::map getScatterFor(isl::set Domain) const { auto ResultSpace = give(isl_space_map_from_domain_and_range( isl_set_get_space(Domain.keep()), ScatterSpace.copy())); auto UDomain = give(isl_union_set_from_set(Domain.copy())); @@ -889,19 +884,19 @@ } /// Get the domain of @p Stmt. - IslPtr getDomainFor(ScopStmt *Stmt) const { + isl::set getDomainFor(ScopStmt *Stmt) const { return give(Stmt->getDomain()); } /// Get the domain @p MA's parent statement. - IslPtr getDomainFor(MemoryAccess *MA) const { + isl::set getDomainFor(MemoryAccess *MA) const { return getDomainFor(MA->getStatement()); } /// Get the access relation of @p MA. /// /// The domain of the result is as narrow as possible. - IslPtr getAccessRelationFor(MemoryAccess *MA) const { + isl::map getAccessRelationFor(MemoryAccess *MA) const { auto Domain = getDomainFor(MA); auto AccRel = give(MA->getLatestAccessRelation()); return give(isl_map_intersect_domain(AccRel.take(), Domain.take())); @@ -915,7 +910,7 @@ /// @param Stmt The statement in which a scalar is defined. /// /// @return { Scatter[] -> DomainDef[] } - IslPtr getScalarReachingDefinition(ScopStmt *Stmt) { + isl::map getScalarReachingDefinition(ScopStmt *Stmt) { auto &Result = ScalarReachDefZone[Stmt]; if (Result) return Result; @@ -953,7 +948,7 @@ // { Element[] } AllElements = makeEmptyUnionSet(); - foreachElt(AllWrites, [this](IslPtr Write) { + foreachElt(AllWrites, [this](isl::map Write) { auto Space = give(isl_map_get_space(Write.keep())); auto EltSpace = give(isl_space_range(Space.take())); auto EltUniv = give(isl_set_universe(EltSpace.take())); @@ -1075,7 +1070,7 @@ /// @return { DomainDef[] -> DomainUse[] }, { DomainDef[] -> Zone[] } /// First element is the set of uses for each definition. /// The second is the lifetime of each definition. - std::tuple, IslPtr> + std::tuple computeValueUses(const ScopArrayInfo *SAI) { assert(SAI->isValueKind()); @@ -1132,7 +1127,7 @@ /// @param SAI The ScopArrayInfo representing the PHI's storage. /// /// @return { DomainPHIRead[] -> DomainPHIWrite[] } - IslPtr computePerPHI(const ScopArrayInfo *SAI) { + isl::union_map computePerPHI(const ScopArrayInfo *SAI) { assert(SAI->isPHIKind()); // { DomainPHIWrite[] -> Scatter[] } @@ -1176,7 +1171,7 @@ /// Suggestion where to map a scalar to when at a timepoint. /// /// @return true if the scalar was successfully mapped. - bool tryMapValue(const ScopArrayInfo *SAI, IslPtr TargetElt) { + bool tryMapValue(const ScopArrayInfo *SAI, isl::map TargetElt) { assert(SAI->isValueKind()); auto *DefMA = DefUse.getValueDef(SAI); @@ -1206,10 +1201,10 @@ } // { DomainDef[] -> Zone[] } - IslPtr Lifetime; + isl::map Lifetime; // { DomainDef[] -> DomainUse[] } - IslPtr DefUses; + isl::union_map DefUses; std::tie(DefUses, Lifetime) = computeValueUses(SAI); DEBUG(dbgs() << " Lifetime: " << Lifetime << '\n'); @@ -1257,8 +1252,8 @@ /// The lifetime of each llvm::Value definition for /// reporting. /// @param Proposed Mapping constraints for reporting. - void mapValue(const ScopArrayInfo *SAI, IslPtr DefTarget, - IslPtr UseTarget, IslPtr Lifetime, + void mapValue(const ScopArrayInfo *SAI, isl::map DefTarget, + isl::union_map UseTarget, isl::map Lifetime, Knowledge Proposed) { // Redirect the read accesses. for (auto *MA : DefUse.getValueUses(SAI)) { @@ -1290,7 +1285,7 @@ /// timepoint. /// /// @return true if the PHI scalar has been mapped. - bool tryMapPHI(const ScopArrayInfo *SAI, IslPtr TargetElt) { + bool tryMapPHI(const ScopArrayInfo *SAI, isl::map TargetElt) { auto *PHIRead = DefUse.getPHIRead(SAI); assert(PHIRead->isPHIKind()); assert(PHIRead->isRead()); @@ -1403,8 +1398,8 @@ /// @param Lifetime { DomainRead[] -> Zone[] } /// The lifetime of each PHI for reporting. /// @param Proposed Mapping constraints for reporting. - void mapPHI(const ScopArrayInfo *SAI, IslPtr ReadTarget, - IslPtr WriteTarget, IslPtr Lifetime, + void mapPHI(const ScopArrayInfo *SAI, isl::map ReadTarget, + isl::union_map WriteTarget, isl::map Lifetime, Knowledge Proposed) { // Redirect the PHI incoming writes. for (auto *MA : DefUse.getPHIIncomings(SAI)) { @@ -1550,7 +1545,7 @@ /// Compute when an array element is unused. /// /// @return { [Element[] -> Zone[]] } - IslPtr computeLifetime() const { + isl::union_set computeLifetime() const { // { Element[] -> Zone[] } auto ArrayUnused = computeArrayUnused(Schedule, AllMustWrites, AllReads, false, false, true); @@ -1564,7 +1559,7 @@ /// Determine when an array element is written to. /// /// @return { [Element[] -> Scatter[]] } - IslPtr computeWritten() const { + isl::union_set computeWritten() const { // { WriteDomain[] -> Element[] } auto AllWrites = give(isl_union_map_union(AllMustWrites.copy(), AllMayWrites.copy())); @@ -1626,7 +1621,7 @@ } DefUse.compute(S); - IslPtr EltUnused, EltWritten; + isl::union_set EltUnused, EltWritten; { IslMaxOperationsGuard MaxOpGuard(IslCtx.get(), DelicmMaxOps); @@ -1798,13 +1793,13 @@ INITIALIZE_PASS_END(DeLICM, "polly-delicm", "Polly - DeLICM/DePRE", false, false) -bool polly::isConflicting(IslPtr ExistingOccupied, - IslPtr ExistingUnused, - IslPtr ExistingWrites, - IslPtr ProposedOccupied, - IslPtr ProposedUnused, - IslPtr ProposedWrites, - llvm::raw_ostream *OS, unsigned Indent) { +bool polly::isConflicting(isl::union_set ExistingOccupied, + isl::union_set ExistingUnused, + isl::union_set ExistingWrites, + isl::union_set ProposedOccupied, + isl::union_set ProposedUnused, + isl::union_set ProposedWrites, llvm::raw_ostream *OS, + unsigned Indent) { Knowledge Existing(std::move(ExistingOccupied), std::move(ExistingUnused), std::move(ExistingWrites)); Knowledge Proposed(std::move(ProposedOccupied), std::move(ProposedUnused), Index: polly/trunk/lib/Transform/FlattenAlgo.cpp =================================================================== --- polly/trunk/lib/Transform/FlattenAlgo.cpp +++ polly/trunk/lib/Transform/FlattenAlgo.cpp @@ -24,7 +24,7 @@ /// Whether a dimension of a set is bounded (lower and upper) by a constant, /// i.e. there are two constants Min and Max, such that every value x of the /// chosen dimensions is Min <= x <= Max. -bool isDimBoundedByConstant(IslPtr Set, unsigned dim) { +bool isDimBoundedByConstant(isl::set Set, unsigned dim) { auto ParamDims = isl_set_dim(Set.keep(), isl_dim_param); Set = give(isl_set_project_out(Set.take(), isl_dim_param, 0, ParamDims)); Set = give(isl_set_project_out(Set.take(), isl_dim_set, 0, dim)); @@ -37,7 +37,7 @@ /// parameters, i.e. there are two expressions Min_p and Max_p of the parameters /// p, such that every value x of the chosen dimensions is /// Min_p <= x <= Max_p. -bool isDimBoundedByParameter(IslPtr Set, unsigned dim) { +bool isDimBoundedByParameter(isl::set Set, unsigned dim) { Set = give(isl_set_project_out(Set.take(), isl_dim_set, 0, dim)); auto SetDims = isl_set_dim(Set.keep(), isl_dim_set); Set = give(isl_set_project_out(Set.take(), isl_dim_set, 1, SetDims - 1)); @@ -45,15 +45,15 @@ } /// Whether BMap's first out-dimension is not a constant. -bool isVariableDim(const IslPtr &BMap) { +bool isVariableDim(const isl::basic_map &BMap) { auto FixedVal = give(isl_basic_map_plain_get_val_if_fixed(BMap.keep(), isl_dim_out, 0)); return !FixedVal || isl_val_is_nan(FixedVal.keep()); } /// Whether Map's first out dimension is no constant nor piecewise constant. -bool isVariableDim(const IslPtr &Map) { - return foreachEltWithBreak(Map, [](IslPtr BMap) -> isl_stat { +bool isVariableDim(const isl::map &Map) { + return foreachEltWithBreak(Map, [](isl::basic_map BMap) -> isl_stat { if (isVariableDim(BMap)) return isl_stat_error; return isl_stat_ok; @@ -61,8 +61,8 @@ } /// Whether UMap's first out dimension is no (piecewise) constant. -bool isVariableDim(const IslPtr &UMap) { - return foreachEltWithBreak(UMap, [](IslPtr Map) -> isl_stat { +bool isVariableDim(const isl::union_map &UMap) { + return foreachEltWithBreak(UMap, [](isl::map Map) -> isl_stat { if (isVariableDim(Map)) return isl_stat_error; return isl_stat_ok; @@ -72,56 +72,54 @@ /// If @p PwAff maps to a constant, return said constant. If @p Max/@p Min, it /// can also be a piecewise constant and it would return the minimum/maximum /// value. Otherwise, return NaN. -IslPtr getConstant(IslPtr PwAff, bool Max, bool Min) { +isl::val getConstant(isl::pw_aff PwAff, bool Max, bool Min) { assert(!Max || !Min); - IslPtr Result; - foreachPieceWithBreak( - PwAff, [=, &Result](IslPtr Set, IslPtr Aff) { - if (Result && isl_val_is_nan(Result.keep())) - return isl_stat_ok; - - // TODO: If Min/Max, we can also determine a minimum/maximum value if - // Set is constant-bounded. - if (!isl_aff_is_cst(Aff.keep())) { - Result = give(isl_val_nan(Aff.getCtx())); - return isl_stat_error; - } - - auto ThisVal = give(isl_aff_get_constant_val(Aff.keep())); - if (!Result) { - Result = ThisVal; - return isl_stat_ok; - } - - if (isl_val_eq(Result.keep(), ThisVal.keep())) - return isl_stat_ok; - - if (Max && isl_val_gt(ThisVal.keep(), Result.keep())) { - Result = ThisVal; - return isl_stat_ok; - } - - if (Min && isl_val_lt(ThisVal.keep(), Result.keep())) { - Result = ThisVal; - return isl_stat_ok; - } - - // Not compatible - Result = give(isl_val_nan(Aff.getCtx())); - return isl_stat_error; - }); + isl::val Result; + foreachPieceWithBreak(PwAff, [=, &Result](isl::set Set, isl::aff Aff) { + if (Result && isl_val_is_nan(Result.keep())) + return isl_stat_ok; + + // TODO: If Min/Max, we can also determine a minimum/maximum value if + // Set is constant-bounded. + if (!isl_aff_is_cst(Aff.keep())) { + Result = give(isl_val_nan(Aff.get_ctx().get())); + return isl_stat_error; + } + + auto ThisVal = give(isl_aff_get_constant_val(Aff.keep())); + if (!Result) { + Result = ThisVal; + return isl_stat_ok; + } + + if (isl_val_eq(Result.keep(), ThisVal.keep())) + return isl_stat_ok; + + if (Max && isl_val_gt(ThisVal.keep(), Result.keep())) { + Result = ThisVal; + return isl_stat_ok; + } + + if (Min && isl_val_lt(ThisVal.keep(), Result.keep())) { + Result = ThisVal; + return isl_stat_ok; + } + + // Not compatible + Result = give(isl_val_nan(Aff.get_ctx().get())); + return isl_stat_error; + }); return Result; } /// Compute @p UPwAff - @p Val. -IslPtr subtract(IslPtr UPwAff, - IslPtr Val) { +isl::union_pw_aff subtract(isl::union_pw_aff UPwAff, isl::val Val) { if (isl_val_is_zero(Val.keep())) return UPwAff; auto Result = give(isl_union_pw_aff_empty(isl_union_pw_aff_get_space(UPwAff.keep()))); - foreachElt(UPwAff, [=, &Result](IslPtr PwAff) { + foreachElt(UPwAff, [=, &Result](isl::pw_aff PwAff) { auto ValAff = give(isl_pw_aff_val_on_domain( isl_set_universe(isl_space_domain(isl_pw_aff_get_space(PwAff.keep()))), Val.copy())); @@ -133,14 +131,13 @@ } /// Compute @UPwAff * @p Val. -IslPtr multiply(IslPtr UPwAff, - IslPtr Val) { +isl::union_pw_aff multiply(isl::union_pw_aff UPwAff, isl::val Val) { if (isl_val_is_one(Val.keep())) return UPwAff; auto Result = give(isl_union_pw_aff_empty(isl_union_pw_aff_get_space(UPwAff.keep()))); - foreachElt(UPwAff, [=, &Result](IslPtr PwAff) { + foreachElt(UPwAff, [=, &Result](isl::pw_aff PwAff) { auto ValAff = give(isl_pw_aff_val_on_domain( isl_set_universe(isl_space_domain(isl_pw_aff_get_space(PwAff.keep()))), Val.copy())); @@ -155,14 +152,14 @@ /// /// It is assumed that all maps in the maps have at least the necessary number /// of out dimensions. -IslPtr scheduleProjectOut(const IslPtr &UMap, - unsigned first, unsigned n) { +isl::union_map scheduleProjectOut(const isl::union_map &UMap, unsigned first, + unsigned n) { if (n == 0) return UMap; /* isl_map_project_out would also reset the tuple, which should have no effect on schedule ranges */ auto Result = give(isl_union_map_empty(isl_union_map_get_space(UMap.keep()))); - foreachElt(UMap, [=, &Result](IslPtr Map) { + foreachElt(UMap, [=, &Result](isl::map Map) { auto Outprojected = give(isl_map_project_out(Map.take(), isl_dim_out, first, n)); Result = give(isl_union_map_add_map(Result.take(), Outprojected.take())); @@ -175,20 +172,19 @@ /// Because this function takes an isl_union_map, the out dimensions could be /// different. We return the maximum number in this case. However, a different /// number of dimensions is not supported by the other code in this file. -size_t scheduleScatterDims(const IslPtr &Schedule) { +size_t scheduleScatterDims(const isl::union_map &Schedule) { unsigned Dims = 0; - foreachElt(Schedule, [&Dims](IslPtr Map) { + foreachElt(Schedule, [&Dims](isl::map Map) { Dims = std::max(Dims, isl_map_dim(Map.keep(), isl_dim_out)); }); return Dims; } /// Return the @p pos' range dimension, converted to an isl_union_pw_aff. -IslPtr scheduleExtractDimAff(IslPtr UMap, - unsigned pos) { +isl::union_pw_aff scheduleExtractDimAff(isl::union_map UMap, unsigned pos) { auto SingleUMap = give(isl_union_map_empty(isl_union_map_get_space(UMap.keep()))); - foreachElt(UMap, [=, &SingleUMap](IslPtr Map) { + foreachElt(UMap, [=, &SingleUMap](isl::map Map) { auto MapDims = isl_map_dim(Map.keep(), isl_dim_out); auto SingleMap = give(isl_map_project_out(Map.take(), isl_dim_out, 0, pos)); SingleMap = give(isl_map_project_out(SingleMap.take(), isl_dim_out, 1, @@ -222,8 +218,8 @@ /// left. /// The example schedule would be transformed to: /// { Stmt_X[] -> [X - l_X, ...]; Stmt_B -> [l_X - u_X + 1 + Y - l_Y, ...] } -IslPtr tryFlattenSequence(IslPtr Schedule) { - auto IslCtx = Schedule.getCtx(); +isl::union_map tryFlattenSequence(isl::union_map Schedule) { + auto IslCtx = Schedule.get_ctx(); auto ScatterSet = give(isl_set_from_union_set(isl_union_map_range(Schedule.copy()))); @@ -286,7 +282,7 @@ auto PartMax = give(isl_map_dim_max(FirstSubScatterMap.take(), 0)); auto One = give(isl_pw_aff_val_on_domain( isl_set_universe(isl_space_set_from_params(ParamSpace.copy())), - isl_val_one(IslCtx))); + isl_val_one(IslCtx.get()))); auto PartLen = give(isl_pw_aff_add( isl_pw_aff_add(PartMax.take(), isl_pw_aff_neg(PartMin.copy())), One.take())); @@ -324,7 +320,7 @@ /// actual value of i. Let l_X() the smallest possible value of X and u_X() its /// largest value. Then, construct a new schedule /// { Stmt[i] -> [i * (u_X() - l_X() + 1), ...] } -IslPtr tryFlattenLoop(IslPtr Schedule) { +isl::union_map tryFlattenLoop(isl::union_map Schedule) { assert(scheduleScatterDims(Schedule) >= 2); auto Remaining = scheduleProjectOut(Schedule, 0, 1); @@ -379,7 +375,7 @@ } } // anonymous namespace -IslPtr polly::flattenSchedule(IslPtr Schedule) { +isl::union_map polly::flattenSchedule(isl::union_map Schedule) { auto Dims = scheduleScatterDims(Schedule); DEBUG(dbgs() << "Recursive schedule to process:\n " << Schedule << "\n"); Index: polly/trunk/lib/Transform/FlattenSchedule.cpp =================================================================== --- polly/trunk/lib/Transform/FlattenSchedule.cpp +++ polly/trunk/lib/Transform/FlattenSchedule.cpp @@ -27,11 +27,10 @@ /// Print a schedule to @p OS. /// /// Prints the schedule for each statements on a new line. -void printSchedule(raw_ostream &OS, const IslPtr &Schedule, +void printSchedule(raw_ostream &OS, const isl::union_map &Schedule, int indent) { - foreachElt(Schedule, [&OS, indent](IslPtr Map) { - OS.indent(indent) << Map << "\n"; - }); + foreachElt(Schedule, + [&OS, indent](isl::map Map) { OS.indent(indent) << Map << "\n"; }); } /// Flatten the schedule stored in an polly::Scop. @@ -41,7 +40,7 @@ const FlattenSchedule &operator=(const FlattenSchedule &) = delete; std::shared_ptr IslCtx; - IslPtr OldSchedule; + isl::union_map OldSchedule; public: static char ID; Index: polly/trunk/unittests/DeLICM/DeLICMTest.cpp =================================================================== --- polly/trunk/unittests/DeLICM/DeLICMTest.cpp +++ polly/trunk/unittests/DeLICM/DeLICMTest.cpp @@ -22,9 +22,9 @@ namespace { /// Get the universes of all spaces in @p USet. -IslPtr unionSpace(const IslPtr &USet) { +isl::union_set unionSpace(const isl::union_set &USet) { auto Result = give(isl_union_set_empty(isl_union_set_get_space(USet.keep()))); - foreachElt(USet, [=, &Result](IslPtr Set) { + foreachElt(USet, [=, &Result](isl::set Set) { auto Space = give(isl_set_get_space(Set.keep())); auto Universe = give(isl_set_universe(Space.take())); Result = give(isl_union_set_add_set(Result.take(), Universe.take())); @@ -32,9 +32,8 @@ return Result; } -void completeLifetime(IslPtr Universe, - IslPtr &Unknown, - IslPtr &Undef) { +void completeLifetime(isl::union_set Universe, isl::union_set &Unknown, + isl::union_set &Undef) { if (!Unknown) { assert(Undef); Unknown = give(isl_union_set_subtract(Universe.copy(), Undef.copy())); @@ -104,7 +103,7 @@ // Add a space the universe that does not occur anywhere else to ensure // robustness. Use &NewId to ensure that this Id is unique. - IslPtr NewId = give(isl_id_alloc(Ctx.get(), "Unrelated", &NewId)); + isl::id NewId = give(isl_id_alloc(Ctx.get(), "Unrelated", &NewId)); // The space must contains at least one dimension to allow order // modifications. auto NewSpace = give(isl_space_set_alloc(Ctx.get(), 0, 1)); Index: polly/trunk/unittests/Isl/IslTest.cpp =================================================================== --- polly/trunk/unittests/Isl/IslTest.cpp +++ polly/trunk/unittests/Isl/IslTest.cpp @@ -16,11 +16,11 @@ using namespace llvm; using namespace polly; -static IslPtr parseSpace(isl_ctx *Ctx, const char *Str) { +static isl::space parseSpace(isl_ctx *Ctx, const char *Str) { isl_stream *Stream = isl_stream_new_str(Ctx, Str); auto Obj = isl_stream_read_obj(Stream); - IslPtr Result; + isl::space Result; if (Obj.type == isl_obj_set) Result = give(isl_set_get_space(static_cast(Obj.v))); else if (Obj.type == isl_obj_map) @@ -40,38 +40,40 @@ #define USET(Str) give(isl_union_set_read_from_str(Ctx.get(), Str)) #define UMAP(Str) give(isl_union_map_read_from_str(Ctx.get(), Str)) -static bool operator==(const IslPtr &LHS, - const IslPtr &RHS) { +namespace isl { +inline namespace noexceptions { + +static bool operator==(const isl::space &LHS, const isl::space &RHS) { auto IsEqual = isl_space_is_equal(LHS.keep(), RHS.keep()); EXPECT_NE(isl_bool_error, IsEqual); return IsEqual; } -static bool operator==(const IslPtr &LHS, const IslPtr &RHS) { +static bool operator==(const isl::set &LHS, const isl::set &RHS) { auto IsEqual = isl_set_is_equal(LHS.keep(), RHS.keep()); EXPECT_NE(isl_bool_error, IsEqual); return IsEqual; } -static bool operator==(const IslPtr &LHS, const IslPtr &RHS) { +static bool operator==(const isl::map &LHS, const isl::map &RHS) { auto IsEqual = isl_map_is_equal(LHS.keep(), RHS.keep()); EXPECT_NE(isl_bool_error, IsEqual); return IsEqual; } -static bool operator==(const IslPtr &LHS, - const IslPtr &RHS) { +static bool operator==(const isl::union_set &LHS, const isl::union_set &RHS) { auto IsEqual = isl_union_set_is_equal(LHS.keep(), RHS.keep()); EXPECT_NE(isl_bool_error, IsEqual); return IsEqual; } -static bool operator==(const IslPtr &LHS, - const IslPtr &RHS) { +static bool operator==(const isl::union_map &LHS, const isl::union_map &RHS) { auto IsEqual = isl_union_map_is_equal(LHS.keep(), RHS.keep()); EXPECT_NE(isl_bool_error, IsEqual); return IsEqual; } +} // namespace noexceptions +} // namespace isl namespace { @@ -310,7 +312,7 @@ { auto NumBMaps = 0; - foreachElt(TestMap, [&](IslPtr BMap) { + foreachElt(TestMap, [&](isl::basic_map BMap) { EXPECT_EQ(isl_bool_true, isl_basic_map_is_equal(BMap.keep(), TestBMap.keep())); NumBMaps++; @@ -320,7 +322,7 @@ { auto NumBSets = 0; - foreachElt(TestSet, [&](IslPtr BSet) { + foreachElt(TestSet, [&](isl::basic_set BSet) { EXPECT_EQ(isl_bool_true, isl_basic_set_is_equal(BSet.keep(), TestBSet.keep())); NumBSets++; @@ -330,7 +332,7 @@ { auto NumMaps = 0; - foreachElt(TestUMap, [&](IslPtr Map) { + foreachElt(TestUMap, [&](isl::map Map) { EXPECT_EQ(isl_bool_true, isl_map_is_equal(Map.keep(), TestMap.keep())); NumMaps++; }); @@ -339,7 +341,7 @@ { auto NumSets = 0; - foreachElt(TestUSet, [&](IslPtr Set) { + foreachElt(TestUSet, [&](isl::set Set) { EXPECT_EQ(isl_bool_true, isl_set_is_equal(Set.keep(), TestSet.keep())); NumSets++; }); @@ -350,7 +352,7 @@ auto UPwAff = give(isl_union_pw_aff_val_on_domain(TestUSet.copy(), isl_val_zero(Ctx.get()))); auto NumPwAffs = 0; - foreachElt(UPwAff, [&](IslPtr PwAff) { + foreachElt(UPwAff, [&](isl::pw_aff PwAff) { EXPECT_EQ(isl_bool_true, isl_pw_aff_is_cst(PwAff.keep())); NumPwAffs++; }); @@ -359,27 +361,26 @@ { auto NumBMaps = 0; - EXPECT_EQ(isl_stat_error, - foreachEltWithBreak( - TestMap, [&](IslPtr BMap) -> isl_stat { - EXPECT_EQ(isl_bool_true, isl_basic_map_is_equal( - BMap.keep(), TestBMap.keep())); - NumBMaps++; - return isl_stat_error; - })); - EXPECT_EQ(1, NumBMaps); - } - - { - auto NumMaps = 0; EXPECT_EQ( isl_stat_error, - foreachEltWithBreak(TestUMap, [&](IslPtr Map) -> isl_stat { + foreachEltWithBreak(TestMap, [&](isl::basic_map BMap) -> isl_stat { EXPECT_EQ(isl_bool_true, - isl_map_is_equal(Map.keep(), TestMap.keep())); - NumMaps++; + isl_basic_map_is_equal(BMap.keep(), TestBMap.keep())); + NumBMaps++; return isl_stat_error; })); + EXPECT_EQ(1, NumBMaps); + } + + { + auto NumMaps = 0; + EXPECT_EQ(isl_stat_error, + foreachEltWithBreak(TestUMap, [&](isl::map Map) -> isl_stat { + EXPECT_EQ(isl_bool_true, + isl_map_is_equal(Map.keep(), TestMap.keep())); + NumMaps++; + return isl_stat_error; + })); EXPECT_EQ(1, NumMaps); } @@ -388,8 +389,7 @@ give(isl_pw_aff_val_on_domain(TestSet.copy(), isl_val_zero(Ctx.get()))); auto NumPieces = 0; foreachPieceWithBreak( - TestPwAff, - [&](IslPtr Domain, IslPtr Aff) -> isl_stat { + TestPwAff, [&](isl::set Domain, isl::aff Aff) -> isl_stat { EXPECT_EQ(isl_bool_true, isl_set_is_equal(Domain.keep(), TestSet.keep())); EXPECT_EQ(isl_bool_true, isl_aff_is_cst(Aff.keep()));