From cfe117def7b0714e5d724c80839e68f40fba4f47 Mon Sep 17 00:00:00 2001 From: patacca Date: Tue, 15 Jun 2021 14:21:40 +0200 Subject: [PATCH] [Polly][Isl] Replacing isl method `to_str()` with `stringFromIslObj()`. NFC. This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface. Changes made: - Removing method `to_str()` from all the classes in the isl C++ bindings. - Overload method `stringFromIslObj()` so it accepts isl C++ objects. - To keep backward compatibility `stringFromIslObj()` now accepts a value that is returned if the isl C object is `null` or doesn't have a string representation (by default it's an empty string). In some cases it's better to have the string "null" instead of an empty string. - isl-noexceptions.h has been generated by this https://github.com/patacca/isl/commit/d33ec3a3bbaf971b254a853e6d8200ff9f5a1385 Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D104211 --- polly/include/polly/Support/GICHelper.h | 66 ++- polly/include/polly/Support/ISLOStream.h | 3 +- polly/lib/Analysis/PolyhedralInfo.cpp | 6 +- polly/lib/Analysis/ScopBuilder.cpp | 7 +- polly/lib/Analysis/ScopInfo.cpp | 25 +- polly/lib/CodeGen/IslAst.cpp | 5 +- .../isl/include/isl/isl-noexceptions.h | 490 ------------------ polly/lib/Support/GICHelper.cpp | 91 ++-- polly/lib/Support/ISLTools.cpp | 5 +- 9 files changed, 102 insertions(+), 596 deletions(-) diff --git a/polly/include/polly/Support/GICHelper.h b/polly/include/polly/Support/GICHelper.h index ca8abe413fe1..59f1f891c948 100644 --- a/polly/include/polly/Support/GICHelper.h +++ b/polly/include/polly/Support/GICHelper.h @@ -150,71 +150,93 @@ inline llvm::APInt APIntFromVal(isl::val V) { /// Get c++ string from Isl objects. //@{ -std::string stringFromIslObj(__isl_keep isl_map *map); -std::string stringFromIslObj(__isl_keep isl_union_map *umap); -std::string stringFromIslObj(__isl_keep isl_set *set); -std::string stringFromIslObj(__isl_keep isl_union_set *uset); -std::string stringFromIslObj(__isl_keep isl_schedule *schedule); -std::string stringFromIslObj(__isl_keep isl_multi_aff *maff); -std::string stringFromIslObj(__isl_keep isl_pw_multi_aff *pma); -std::string stringFromIslObj(__isl_keep isl_multi_pw_aff *mpa); -std::string stringFromIslObj(__isl_keep isl_union_pw_multi_aff *upma); -std::string stringFromIslObj(__isl_keep isl_aff *aff); -std::string stringFromIslObj(__isl_keep isl_pw_aff *pwaff); -std::string stringFromIslObj(__isl_keep isl_space *space); +#define ISL_CPP_OBJECT_TO_STRING(name) \ + inline std::string stringFromIslObj(const name &Obj, \ + std::string DefaultValue = "") { \ + return stringFromIslObj(Obj.get(), DefaultValue); \ + } + +#define ISL_OBJECT_TO_STRING(name) \ + std::string stringFromIslObj(__isl_keep isl_##name *Obj, \ + std::string DefaultValue = ""); \ + ISL_CPP_OBJECT_TO_STRING(isl::name) + +ISL_OBJECT_TO_STRING(aff) +ISL_OBJECT_TO_STRING(ast_expr) +ISL_OBJECT_TO_STRING(ast_node) +ISL_OBJECT_TO_STRING(basic_map) +ISL_OBJECT_TO_STRING(basic_set) +ISL_OBJECT_TO_STRING(map) +ISL_OBJECT_TO_STRING(set) +ISL_OBJECT_TO_STRING(id) +ISL_OBJECT_TO_STRING(multi_aff) +ISL_OBJECT_TO_STRING(multi_pw_aff) +ISL_OBJECT_TO_STRING(multi_union_pw_aff) +ISL_OBJECT_TO_STRING(point) +ISL_OBJECT_TO_STRING(pw_aff) +ISL_OBJECT_TO_STRING(pw_multi_aff) +ISL_OBJECT_TO_STRING(schedule) +ISL_OBJECT_TO_STRING(schedule_node) +ISL_OBJECT_TO_STRING(space) +ISL_OBJECT_TO_STRING(union_access_info) +ISL_OBJECT_TO_STRING(union_flow) +ISL_OBJECT_TO_STRING(union_set) +ISL_OBJECT_TO_STRING(union_map) +ISL_OBJECT_TO_STRING(union_pw_aff) +ISL_OBJECT_TO_STRING(union_pw_multi_aff) //@} inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, __isl_keep isl_union_map *Map) { - OS << polly::stringFromIslObj(Map); + OS << polly::stringFromIslObj(Map, "null"); return OS; } inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, __isl_keep isl_map *Map) { - OS << polly::stringFromIslObj(Map); + OS << polly::stringFromIslObj(Map, "null"); return OS; } inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, __isl_keep isl_set *Set) { - OS << polly::stringFromIslObj(Set); + OS << polly::stringFromIslObj(Set, "null"); return OS; } inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, __isl_keep isl_pw_aff *Map) { - OS << polly::stringFromIslObj(Map); + OS << polly::stringFromIslObj(Map, "null"); return OS; } inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, __isl_keep isl_pw_multi_aff *PMA) { - OS << polly::stringFromIslObj(PMA); + OS << polly::stringFromIslObj(PMA, "null"); return OS; } inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, __isl_keep isl_multi_aff *MA) { - OS << polly::stringFromIslObj(MA); + OS << polly::stringFromIslObj(MA, "null"); return OS; } inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, __isl_keep isl_union_pw_multi_aff *UPMA) { - OS << polly::stringFromIslObj(UPMA); + OS << polly::stringFromIslObj(UPMA, "null"); return OS; } inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, __isl_keep isl_schedule *Schedule) { - OS << polly::stringFromIslObj(Schedule); + OS << polly::stringFromIslObj(Schedule, "null"); return OS; } inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, __isl_keep isl_space *Space) { - OS << polly::stringFromIslObj(Space); + OS << polly::stringFromIslObj(Space, "null"); return OS; } @@ -263,7 +285,7 @@ std::string getIslCompatibleName(const std::string &Prefix, inline llvm::DiagnosticInfoOptimizationBase & operator<<(llvm::DiagnosticInfoOptimizationBase &OS, const isl::union_map &Obj) { - OS << Obj.to_str(); + OS << stringFromIslObj(Obj); return OS; } diff --git a/polly/include/polly/Support/ISLOStream.h b/polly/include/polly/Support/ISLOStream.h index 08853a24aa0a..5f058507c60b 100644 --- a/polly/include/polly/Support/ISLOStream.h +++ b/polly/include/polly/Support/ISLOStream.h @@ -10,6 +10,7 @@ // //===----------------------------------------------------------------------===// +#include "polly/Support/GICHelper.h" #include "llvm/Support/raw_ostream.h" #include "isl/isl-noexceptions.h" namespace polly { @@ -17,7 +18,7 @@ namespace polly { #define ADD_OSTREAM_PRINTER(name) \ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, \ const name &Obj) { \ - OS << Obj.to_str(); \ + OS << stringFromIslObj(Obj); \ return OS; \ } diff --git a/polly/lib/Analysis/PolyhedralInfo.cpp b/polly/lib/Analysis/PolyhedralInfo.cpp index f4094f3ece28..d5c258bb5266 100644 --- a/polly/lib/Analysis/PolyhedralInfo.cpp +++ b/polly/lib/Analysis/PolyhedralInfo.cpp @@ -86,10 +86,12 @@ bool PolyhedralInfo::checkParallel(Loop *L, isl_pw_aff **MinDepDistPtr) const { Dependences::TYPE_WAR | Dependences::TYPE_RED) .release(); - LLVM_DEBUG(dbgs() << "Dependences :\t" << stringFromIslObj(Deps) << "\n"); + LLVM_DEBUG(dbgs() << "Dependences :\t" << stringFromIslObj(Deps, "null") + << "\n"); isl_union_map *Schedule = getScheduleForLoop(S, L); - LLVM_DEBUG(dbgs() << "Schedule: \t" << stringFromIslObj(Schedule) << "\n"); + LLVM_DEBUG(dbgs() << "Schedule: \t" << stringFromIslObj(Schedule, "null") + << "\n"); IsParallel = D.isParallel(Schedule, Deps, MinDepDistPtr); isl_union_map_free(Schedule); diff --git a/polly/lib/Analysis/ScopBuilder.cpp b/polly/lib/Analysis/ScopBuilder.cpp index 61e6e123a7ac..c3fb92c508cf 100644 --- a/polly/lib/Analysis/ScopBuilder.cpp +++ b/polly/lib/Analysis/ScopBuilder.cpp @@ -1615,7 +1615,8 @@ void ScopBuilder::addUserAssumptions( } } ORE.emit(OptimizationRemarkAnalysis(DEBUG_TYPE, "UserAssumption", CI) - << "Use user assumption: " << stringFromIslObj(AssumptionCtx)); + << "Use user assumption: " + << stringFromIslObj(AssumptionCtx, "null")); isl::set newContext = scop->getContext().intersect(isl::manage(AssumptionCtx)); scop->setContext(newContext); @@ -2869,7 +2870,7 @@ void ScopBuilder::addUserContext() { isl::set UserContext = isl::set(scop->getIslCtx(), UserContextStr.c_str()); isl::space Space = scop->getParamSpace(); if (Space.dim(isl::dim::param) != UserContext.dim(isl::dim::param)) { - std::string SpaceStr = Space.to_str(); + std::string SpaceStr = stringFromIslObj(Space, "null"); errs() << "Error: the context provided in -polly-context has not the same " << "number of dimensions than the computed context. Due to this " << "mismatch, the -polly-context option is ignored. Please provide " @@ -2883,7 +2884,7 @@ void ScopBuilder::addUserContext() { std::string NameUserContext = UserContext.get_dim_name(isl::dim::param, i); if (NameContext != NameUserContext) { - std::string SpaceStr = Space.to_str(); + std::string SpaceStr = stringFromIslObj(Space, "null"); errs() << "Error: the name of dimension " << i << " provided in -polly-context " << "is '" << NameUserContext << "', but the name in the computed " diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 917136226b39..2925cfd38e5b 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -618,7 +618,7 @@ isl::map MemoryAccess::getOriginalAccessRelation() const { } std::string MemoryAccess::getOriginalAccessRelationStr() const { - return AccessRelation.to_str(); + return stringFromIslObj(AccessRelation); } isl::space MemoryAccess::getOriginalAccessRelationSpace() const { @@ -630,11 +630,11 @@ isl::map MemoryAccess::getNewAccessRelation() const { } std::string MemoryAccess::getNewAccessRelationStr() const { - return NewAccessRelation.to_str(); + return stringFromIslObj(NewAccessRelation); } std::string MemoryAccess::getAccessRelationStr() const { - return getAccessRelation().to_str(); + return stringFromIslObj(getAccessRelation()); } isl::basic_map MemoryAccess::createBasicAccessMap(ScopStmt *Statement) { @@ -1233,15 +1233,10 @@ ScopStmt::ScopStmt(Scop &parent, isl::map SourceRel, isl::map TargetRel, ScopStmt::~ScopStmt() = default; -std::string ScopStmt::getDomainStr() const { return Domain.to_str(); } +std::string ScopStmt::getDomainStr() const { return stringFromIslObj(Domain); } std::string ScopStmt::getScheduleStr() const { - auto *S = getSchedule().release(); - if (!S) - return {}; - auto Str = stringFromIslObj(S); - isl_map_free(S); - return Str; + return stringFromIslObj(getSchedule()); } void ScopStmt::setInvalidDomain(isl::set ID) { InvalidDomain = ID; } @@ -1892,15 +1887,17 @@ ScopArrayInfo *Scop::getScopArrayInfo(Value *BasePtr, MemoryKind Kind) { return SAI; } -std::string Scop::getContextStr() const { return getContext().to_str(); } +std::string Scop::getContextStr() const { + return stringFromIslObj(getContext()); +} std::string Scop::getAssumedContextStr() const { assert(!AssumedContext.is_null() && "Assumed context not yet built"); - return AssumedContext.to_str(); + return stringFromIslObj(AssumedContext); } std::string Scop::getInvalidContextStr() const { - return InvalidContext.to_str(); + return stringFromIslObj(InvalidContext); } std::string Scop::getNameStr() const { @@ -2103,7 +2100,7 @@ bool Scop::trackAssumption(AssumptionKind Kind, isl::set Set, DebugLoc Loc, } auto Suffix = Sign == AS_ASSUMPTION ? " assumption:\t" : " restriction:\t"; - std::string Msg = toString(Kind) + Suffix + Set.to_str(); + std::string Msg = toString(Kind) + Suffix + stringFromIslObj(Set); if (BB) ORE.emit(OptimizationRemarkAnalysis(DEBUG_TYPE, "AssumpRestrict", Loc, BB) << Msg); diff --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp index e09b781c59bf..50a59092c475 100644 --- a/polly/lib/CodeGen/IslAst.cpp +++ b/polly/lib/CodeGen/IslAst.cpp @@ -766,11 +766,9 @@ void IslAstInfo::print(raw_ostream &OS) { P = isl_ast_node_print(RootNode.get(), P, Options); AstStr = isl_printer_get_str(P); - auto *Schedule = S.getScheduleTree().release(); - LLVM_DEBUG({ dbgs() << S.getContextStr() << "\n"; - dbgs() << stringFromIslObj(Schedule); + dbgs() << stringFromIslObj(S.getScheduleTree(), "null"); }); OS << "\nif (" << RtCStr << ")\n\n"; OS << AstStr << "\n"; @@ -780,7 +778,6 @@ void IslAstInfo::print(raw_ostream &OS) { free(RtCStr); free(AstStr); - isl_schedule_free(Schedule); isl_printer_free(P); } diff --git a/polly/lib/External/isl/include/isl/isl-noexceptions.h b/polly/lib/External/isl/include/isl/isl-noexceptions.h index 8fc3983bc5e2..c653ceadb299 100644 --- a/polly/lib/External/isl/include/isl/isl-noexceptions.h +++ b/polly/lib/External/isl/include/isl/isl-noexceptions.h @@ -247,7 +247,6 @@ public: inline __isl_give isl_aff *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline aff add(aff aff2) const; @@ -349,7 +348,6 @@ public: inline __isl_give isl_aff_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline aff_list add(aff el) const; @@ -432,7 +430,6 @@ public: inline __isl_give isl_ast_expr *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline ast_expr access(ast_expr_list indices) const; @@ -489,7 +486,6 @@ public: inline __isl_give isl_ast_expr_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline ast_expr_list add(ast_expr el) const; @@ -532,7 +528,6 @@ public: inline __isl_give isl_ast_node *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; static inline ast_node alloc_user(ast_expr expr); @@ -581,7 +576,6 @@ public: inline __isl_give isl_ast_node_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline ast_node_list add(ast_node el) const; @@ -625,7 +619,6 @@ public: inline __isl_give isl_basic_map *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline basic_map add_constraint(constraint constraint) const; @@ -757,7 +750,6 @@ public: inline __isl_give isl_basic_map_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline basic_map_list add(basic_map el) const; @@ -802,7 +794,6 @@ public: inline __isl_give isl_basic_set *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline basic_set affine_hull() const; @@ -905,7 +896,6 @@ public: inline __isl_give isl_basic_set_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline basic_set_list add(basic_set el) const; @@ -996,7 +986,6 @@ public: inline __isl_give isl_constraint_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline constraint_list add(constraint el) const; @@ -1039,7 +1028,6 @@ public: inline __isl_give isl_fixed_box *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline multi_aff get_offset() const; @@ -1072,7 +1060,6 @@ public: inline __isl_give isl_id *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; static inline id alloc(ctx ctx, const std::string &name, void * user); @@ -1104,7 +1091,6 @@ public: inline __isl_give isl_id_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline id_list add(id el) const; @@ -1234,7 +1220,6 @@ public: inline __isl_give isl_map *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline map add_constraint(constraint constraint) const; @@ -1447,7 +1432,6 @@ public: inline __isl_give isl_map_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline map_list add(map el) const; @@ -1560,7 +1544,6 @@ public: inline __isl_give isl_multi_aff *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline multi_aff add(multi_aff multi2) const; @@ -1665,7 +1648,6 @@ public: inline __isl_give isl_multi_id *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline multi_id align_params(space model) const; @@ -1719,7 +1701,6 @@ public: inline __isl_give isl_multi_pw_aff *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline multi_pw_aff add(multi_pw_aff multi2) const; @@ -1835,7 +1816,6 @@ public: inline __isl_give isl_multi_union_pw_aff *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline multi_union_pw_aff add(multi_union_pw_aff multi2) const; @@ -1930,7 +1910,6 @@ public: inline __isl_give isl_multi_val *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline multi_val add(multi_val multi2) const; @@ -2012,7 +1991,6 @@ public: inline __isl_give isl_point *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline point add_ui(isl::dim type, int pos, unsigned int val) const; @@ -2050,7 +2028,6 @@ public: inline __isl_give isl_pw_aff *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline pw_aff add(pw_aff pwaff2) const; @@ -2170,7 +2147,6 @@ public: inline __isl_give isl_pw_aff_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline pw_aff_list add(pw_aff el) const; @@ -2224,7 +2200,6 @@ public: inline __isl_give isl_pw_multi_aff *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline pw_multi_aff add(pw_multi_aff pma2) const; @@ -2329,7 +2304,6 @@ public: inline __isl_give isl_pw_multi_aff_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline pw_multi_aff_list add(pw_multi_aff el) const; @@ -2373,7 +2347,6 @@ public: inline __isl_give isl_pw_qpolynomial *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline pw_qpolynomial add(pw_qpolynomial pwqp2) const; @@ -2451,7 +2424,6 @@ public: inline __isl_give isl_pw_qpolynomial_fold_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; }; @@ -2479,7 +2451,6 @@ public: inline __isl_give isl_pw_qpolynomial_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline pw_qpolynomial_list add(pw_qpolynomial el) const; @@ -2589,7 +2560,6 @@ public: inline __isl_give isl_qpolynomial_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline qpolynomial_list add(qpolynomial el) const; @@ -2633,7 +2603,6 @@ public: inline __isl_give isl_schedule *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline schedule align_params(space space) const; @@ -2677,7 +2646,6 @@ public: inline __isl_give isl_schedule_constraints *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline schedule_constraints apply(union_map umap) const; @@ -2720,7 +2688,6 @@ public: inline __isl_give isl_schedule_node *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline schedule_node align_params(space space) const; @@ -2812,7 +2779,6 @@ public: inline __isl_give isl_set *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline set add_constraint(constraint constraint) const; @@ -2993,7 +2959,6 @@ public: inline __isl_give isl_set_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline set_list add(set el) const; @@ -3039,7 +3004,6 @@ public: inline __isl_give isl_space *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline space add_dims(isl::dim type, unsigned int n) const; @@ -3172,7 +3136,6 @@ public: inline __isl_give isl_union_access_info *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline union_flow compute_flow() const; inline union_access_info set_kill(union_map kill) const; @@ -3205,7 +3168,6 @@ public: inline __isl_give isl_union_flow *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline union_map get_full_may_dependence() const; inline union_map get_full_must_dependence() const; @@ -3242,7 +3204,6 @@ public: inline __isl_give isl_union_map *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline union_map add_map(map map) const; @@ -3381,7 +3342,6 @@ public: inline __isl_give isl_union_map_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline union_map_list add(union_map el) const; @@ -3428,7 +3388,6 @@ public: inline __isl_give isl_union_pw_aff *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline union_pw_aff add(union_pw_aff upa2) const; @@ -3499,7 +3458,6 @@ public: inline __isl_give isl_union_pw_aff_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline union_pw_aff_list add(union_pw_aff el) const; @@ -3550,7 +3508,6 @@ public: inline __isl_give isl_union_pw_multi_aff *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline union_pw_multi_aff add(union_pw_multi_aff upma2) const; @@ -3626,7 +3583,6 @@ public: inline __isl_give isl_union_pw_multi_aff_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline union_pw_multi_aff_list add(union_pw_multi_aff el) const; @@ -3670,7 +3626,6 @@ public: inline __isl_give isl_union_pw_qpolynomial *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline union_pw_qpolynomial add(union_pw_qpolynomial upwqp2) const; inline union_pw_qpolynomial add_pw_qpolynomial(pw_qpolynomial pwqp) const; @@ -3739,7 +3694,6 @@ public: inline __isl_give isl_union_set *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline union_set add_set(set set) const; @@ -3828,7 +3782,6 @@ public: inline __isl_give isl_union_set_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline union_set_list add(union_set el) const; @@ -3874,7 +3827,6 @@ public: inline __isl_give isl_val *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline val abs() const; @@ -3956,7 +3908,6 @@ public: inline __isl_give isl_val_list *release(); inline bool is_null() const; inline ctx get_ctx() const; - inline std::string to_str() const; inline void dump() const; inline val_list add(val el) const; @@ -4097,15 +4048,6 @@ bool aff::is_null() const { ctx aff::get_ctx() const { return ctx(isl_aff_get_ctx(ptr)); } -std::string aff::to_str() const { - char *Tmp = isl_aff_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void aff::dump() const { isl_aff_dump(get()); @@ -4612,15 +4554,6 @@ bool aff_list::is_null() const { ctx aff_list::get_ctx() const { return ctx(isl_aff_list_get_ctx(ptr)); } -std::string aff_list::to_str() const { - char *Tmp = isl_aff_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void aff_list::dump() const { isl_aff_list_dump(get()); @@ -4920,15 +4853,6 @@ bool ast_expr::is_null() const { ctx ast_expr::get_ctx() const { return ctx(isl_ast_expr_get_ctx(ptr)); } -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; -} - void ast_expr::dump() const { isl_ast_expr_dump(get()); @@ -5166,15 +5090,6 @@ bool ast_expr_list::is_null() const { ctx ast_expr_list::get_ctx() const { return ctx(isl_ast_expr_list_get_ctx(ptr)); } -std::string ast_expr_list::to_str() const { - char *Tmp = isl_ast_expr_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void ast_expr_list::dump() const { isl_ast_expr_list_dump(get()); @@ -5334,15 +5249,6 @@ bool ast_node::is_null() const { ctx ast_node::get_ctx() const { return ctx(isl_ast_node_get_ctx(ptr)); } -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; -} - void ast_node::dump() const { isl_ast_node_dump(get()); @@ -5532,15 +5438,6 @@ bool ast_node_list::is_null() const { ctx ast_node_list::get_ctx() const { return ctx(isl_ast_node_list_get_ctx(ptr)); } -std::string ast_node_list::to_str() const { - char *Tmp = isl_ast_node_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void ast_node_list::dump() const { isl_ast_node_list_dump(get()); @@ -5705,15 +5602,6 @@ bool basic_map::is_null() const { ctx basic_map::get_ctx() const { return ctx(isl_basic_map_get_ctx(ptr)); } -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; -} - void basic_map::dump() const { isl_basic_map_dump(get()); @@ -6409,15 +6297,6 @@ bool basic_map_list::is_null() const { ctx basic_map_list::get_ctx() const { return ctx(isl_basic_map_list_get_ctx(ptr)); } -std::string basic_map_list::to_str() const { - char *Tmp = isl_basic_map_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void basic_map_list::dump() const { isl_basic_map_list_dump(get()); @@ -6587,15 +6466,6 @@ bool basic_set::is_null() const { ctx basic_set::get_ctx() const { return ctx(isl_basic_set_get_ctx(ptr)); } -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; -} - void basic_set::dump() const { isl_basic_set_dump(get()); @@ -7125,15 +6995,6 @@ bool basic_set_list::is_null() const { ctx basic_set_list::get_ctx() const { return ctx(isl_basic_set_list_get_ctx(ptr)); } -std::string basic_set_list::to_str() const { - char *Tmp = isl_basic_set_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void basic_set_list::dump() const { isl_basic_set_list_dump(get()); @@ -7481,15 +7342,6 @@ bool constraint_list::is_null() const { ctx constraint_list::get_ctx() const { return ctx(isl_constraint_list_get_ctx(ptr)); } -std::string constraint_list::to_str() const { - char *Tmp = isl_constraint_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void constraint_list::dump() const { isl_constraint_list_dump(get()); @@ -7649,15 +7501,6 @@ bool fixed_box::is_null() const { ctx fixed_box::get_ctx() const { return ctx(isl_fixed_box_get_ctx(ptr)); } -std::string fixed_box::to_str() const { - char *Tmp = isl_fixed_box_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void fixed_box::dump() const { isl_fixed_box_dump(get()); @@ -7748,15 +7591,6 @@ bool id::is_null() const { ctx id::get_ctx() const { return ctx(isl_id_get_ctx(ptr)); } -std::string id::to_str() const { - char *Tmp = isl_id_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void id::dump() const { isl_id_dump(get()); @@ -7843,15 +7677,6 @@ bool id_list::is_null() const { ctx id_list::get_ctx() const { return ctx(isl_id_list_get_ctx(ptr)); } -std::string id_list::to_str() const { - char *Tmp = isl_id_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void id_list::dump() const { isl_id_list_dump(get()); @@ -8337,15 +8162,6 @@ bool map::is_null() const { ctx map::get_ctx() const { return ctx(isl_map_get_ctx(ptr)); } -std::string map::to_str() const { - char *Tmp = isl_map_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void map::dump() const { isl_map_dump(get()); @@ -9527,15 +9343,6 @@ bool map_list::is_null() const { ctx map_list::get_ctx() const { return ctx(isl_map_list_get_ctx(ptr)); } -std::string map_list::to_str() const { - char *Tmp = isl_map_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void map_list::dump() const { isl_map_list_dump(get()); @@ -10011,15 +9818,6 @@ bool multi_aff::is_null() const { ctx multi_aff::get_ctx() const { return ctx(isl_multi_aff_get_ctx(ptr)); } -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; -} - void multi_aff::dump() const { isl_multi_aff_dump(get()); @@ -10542,15 +10340,6 @@ bool multi_id::is_null() const { ctx multi_id::get_ctx() const { return ctx(isl_multi_id_get_ctx(ptr)); } -std::string multi_id::to_str() const { - char *Tmp = isl_multi_id_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void multi_id::dump() const { isl_multi_id_dump(get()); @@ -10762,15 +10551,6 @@ bool multi_pw_aff::is_null() const { ctx multi_pw_aff::get_ctx() const { return ctx(isl_multi_pw_aff_get_ctx(ptr)); } -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; -} - void multi_pw_aff::dump() const { isl_multi_pw_aff_dump(get()); @@ -11356,15 +11136,6 @@ bool multi_union_pw_aff::is_null() const { ctx multi_union_pw_aff::get_ctx() const { return ctx(isl_multi_union_pw_aff_get_ctx(ptr)); } -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; -} - void multi_union_pw_aff::dump() const { isl_multi_union_pw_aff_dump(get()); @@ -11827,15 +11598,6 @@ bool multi_val::is_null() const { ctx multi_val::get_ctx() const { return ctx(isl_multi_val_get_ctx(ptr)); } -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; -} - void multi_val::dump() const { isl_multi_val_dump(get()); @@ -12221,15 +11983,6 @@ bool point::is_null() const { ctx point::get_ctx() const { return ctx(isl_point_get_ctx(ptr)); } -std::string point::to_str() const { - char *Tmp = isl_point_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void point::dump() const { isl_point_dump(get()); @@ -12347,15 +12100,6 @@ bool pw_aff::is_null() const { ctx pw_aff::get_ctx() const { return ctx(isl_pw_aff_get_ctx(ptr)); } -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; -} - void pw_aff::dump() const { isl_pw_aff_dump(get()); @@ -12978,15 +12722,6 @@ bool pw_aff_list::is_null() const { ctx pw_aff_list::get_ctx() const { return ctx(isl_pw_aff_list_get_ctx(ptr)); } -std::string pw_aff_list::to_str() const { - char *Tmp = isl_pw_aff_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void pw_aff_list::dump() const { isl_pw_aff_list_dump(get()); @@ -13209,15 +12944,6 @@ bool pw_multi_aff::is_null() const { ctx pw_multi_aff::get_ctx() const { return ctx(isl_pw_multi_aff_get_ctx(ptr)); } -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; -} - void pw_multi_aff::dump() const { isl_pw_multi_aff_dump(get()); @@ -13751,15 +13477,6 @@ bool pw_multi_aff_list::is_null() const { ctx pw_multi_aff_list::get_ctx() const { return ctx(isl_pw_multi_aff_list_get_ctx(ptr)); } -std::string pw_multi_aff_list::to_str() const { - char *Tmp = isl_pw_multi_aff_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void pw_multi_aff_list::dump() const { isl_pw_multi_aff_list_dump(get()); @@ -13924,15 +13641,6 @@ bool pw_qpolynomial::is_null() const { ctx pw_qpolynomial::get_ctx() const { return ctx(isl_pw_qpolynomial_get_ctx(ptr)); } -std::string pw_qpolynomial::to_str() const { - char *Tmp = isl_pw_qpolynomial_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void pw_qpolynomial::dump() const { isl_pw_qpolynomial_dump(get()); @@ -14302,15 +14010,6 @@ bool pw_qpolynomial_fold_list::is_null() const { ctx pw_qpolynomial_fold_list::get_ctx() const { return ctx(isl_pw_qpolynomial_fold_list_get_ctx(ptr)); } -std::string pw_qpolynomial_fold_list::to_str() const { - char *Tmp = isl_pw_qpolynomial_fold_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void pw_qpolynomial_fold_list::dump() const { isl_pw_qpolynomial_fold_list_dump(get()); @@ -14373,15 +14072,6 @@ bool pw_qpolynomial_list::is_null() const { ctx pw_qpolynomial_list::get_ctx() const { return ctx(isl_pw_qpolynomial_list_get_ctx(ptr)); } -std::string pw_qpolynomial_list::to_str() const { - char *Tmp = isl_pw_qpolynomial_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void pw_qpolynomial_list::dump() const { isl_pw_qpolynomial_list_dump(get()); @@ -14858,15 +14548,6 @@ bool qpolynomial_list::is_null() const { ctx qpolynomial_list::get_ctx() const { return ctx(isl_qpolynomial_list_get_ctx(ptr)); } -std::string qpolynomial_list::to_str() const { - char *Tmp = isl_qpolynomial_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void qpolynomial_list::dump() const { isl_qpolynomial_list_dump(get()); @@ -15031,15 +14712,6 @@ bool schedule::is_null() const { ctx schedule::get_ctx() const { return ctx(isl_schedule_get_ctx(ptr)); } -std::string schedule::to_str() const { - char *Tmp = isl_schedule_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void schedule::dump() const { isl_schedule_dump(get()); @@ -15196,15 +14868,6 @@ bool schedule_constraints::is_null() const { ctx schedule_constraints::get_ctx() const { return ctx(isl_schedule_constraints_get_ctx(ptr)); } -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; -} - void schedule_constraints::dump() const { isl_schedule_constraints_dump(get()); @@ -15356,15 +15019,6 @@ bool schedule_node::is_null() const { ctx schedule_node::get_ctx() const { return ctx(isl_schedule_node_get_ctx(ptr)); } -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; -} - void schedule_node::dump() const { isl_schedule_node_dump(get()); @@ -15814,15 +15468,6 @@ bool set::is_null() const { ctx set::get_ctx() const { return ctx(isl_set_get_ctx(ptr)); } -std::string set::to_str() const { - char *Tmp = isl_set_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void set::dump() const { isl_set_dump(get()); @@ -16820,15 +16465,6 @@ bool set_list::is_null() const { ctx set_list::get_ctx() const { return ctx(isl_set_list_get_ctx(ptr)); } -std::string set_list::to_str() const { - char *Tmp = isl_set_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void set_list::dump() const { isl_set_list_dump(get()); @@ -17004,15 +16640,6 @@ bool space::is_null() const { ctx space::get_ctx() const { return ctx(isl_space_get_ctx(ptr)); } -std::string space::to_str() const { - char *Tmp = isl_space_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void space::dump() const { isl_space_dump(get()); @@ -17606,15 +17233,6 @@ bool union_access_info::is_null() const { ctx union_access_info::get_ctx() const { return ctx(isl_union_access_info_get_ctx(ptr)); } -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; -} - union_flow union_access_info::compute_flow() const @@ -17708,15 +17326,6 @@ bool union_flow::is_null() const { ctx union_flow::get_ctx() const { return ctx(isl_union_flow_get_ctx(ptr)); } -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; -} - union_map union_flow::get_full_may_dependence() const @@ -17830,15 +17439,6 @@ bool union_map::is_null() const { ctx union_map::get_ctx() const { return ctx(isl_union_map_get_ctx(ptr)); } -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; -} - void union_map::dump() const { isl_union_map_dump(get()); @@ -18574,15 +18174,6 @@ bool union_map_list::is_null() const { ctx union_map_list::get_ctx() const { return ctx(isl_union_map_list_get_ctx(ptr)); } -std::string union_map_list::to_str() const { - char *Tmp = isl_union_map_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void union_map_list::dump() const { isl_union_map_list_dump(get()); @@ -18762,15 +18353,6 @@ bool union_pw_aff::is_null() const { ctx union_pw_aff::get_ctx() const { return ctx(isl_union_pw_aff_get_ctx(ptr)); } -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; -} - void union_pw_aff::dump() const { isl_union_pw_aff_dump(get()); @@ -19098,15 +18680,6 @@ bool union_pw_aff_list::is_null() const { ctx union_pw_aff_list::get_ctx() const { return ctx(isl_union_pw_aff_list_get_ctx(ptr)); } -std::string union_pw_aff_list::to_str() const { - char *Tmp = isl_union_pw_aff_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void union_pw_aff_list::dump() const { isl_union_pw_aff_list_dump(get()); @@ -19306,15 +18879,6 @@ bool union_pw_multi_aff::is_null() const { ctx union_pw_multi_aff::get_ctx() const { return ctx(isl_union_pw_multi_aff_get_ctx(ptr)); } -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; -} - void union_pw_multi_aff::dump() const { isl_union_pw_multi_aff_dump(get()); @@ -19672,15 +19236,6 @@ bool union_pw_multi_aff_list::is_null() const { ctx union_pw_multi_aff_list::get_ctx() const { return ctx(isl_union_pw_multi_aff_list_get_ctx(ptr)); } -std::string union_pw_multi_aff_list::to_str() const { - char *Tmp = isl_union_pw_multi_aff_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void union_pw_multi_aff_list::dump() const { isl_union_pw_multi_aff_list_dump(get()); @@ -19845,15 +19400,6 @@ bool union_pw_qpolynomial::is_null() const { ctx union_pw_qpolynomial::get_ctx() const { return ctx(isl_union_pw_qpolynomial_get_ctx(ptr)); } -std::string union_pw_qpolynomial::to_str() const { - char *Tmp = isl_union_pw_qpolynomial_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - union_pw_qpolynomial union_pw_qpolynomial::add(union_pw_qpolynomial upwqp2) const @@ -20167,15 +19713,6 @@ bool union_set::is_null() const { ctx union_set::get_ctx() const { return ctx(isl_union_set_get_ctx(ptr)); } -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; -} - void union_set::dump() const { isl_union_set_dump(get()); @@ -20619,15 +20156,6 @@ bool union_set_list::is_null() const { ctx union_set_list::get_ctx() const { return ctx(isl_union_set_list_get_ctx(ptr)); } -std::string union_set_list::to_str() const { - char *Tmp = isl_union_set_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void union_set_list::dump() const { isl_union_set_list_dump(get()); @@ -20803,15 +20331,6 @@ bool val::is_null() const { ctx val::get_ctx() const { return ctx(isl_val_get_ctx(ptr)); } -std::string val::to_str() const { - char *Tmp = isl_val_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void val::dump() const { isl_val_dump(get()); @@ -21197,15 +20716,6 @@ bool val_list::is_null() const { ctx val_list::get_ctx() const { return ctx(isl_val_list_get_ctx(ptr)); } -std::string val_list::to_str() const { - char *Tmp = isl_val_list_to_str(get()); - if (!Tmp) - return ""; - std::string S(Tmp); - free(Tmp); - return S; -} - void val_list::dump() const { isl_val_list_dump(get()); diff --git a/polly/lib/Support/GICHelper.cpp b/polly/lib/Support/GICHelper.cpp index 1230b4827a25..d1da965d1b03 100644 --- a/polly/lib/Support/GICHelper.cpp +++ b/polly/lib/Support/GICHelper.cpp @@ -85,9 +85,10 @@ APInt polly::APIntFromVal(__isl_take isl_val *Val) { template static inline std::string stringFromIslObjInternal(__isl_keep ISLTy *isl_obj, ISL_CTX_GETTER ctx_getter_fn, - ISL_PRINTER printer_fn) { + ISL_PRINTER printer_fn, + std::string DefaultValue) { if (!isl_obj) - return "null"; + return DefaultValue; isl_ctx *ctx = ctx_getter_fn(isl_obj); isl_printer *p = isl_printer_to_str(ctx); p = printer_fn(p, isl_obj); @@ -96,68 +97,42 @@ static inline std::string stringFromIslObjInternal(__isl_keep ISLTy *isl_obj, if (char_str) string = char_str; else - string = "null"; + string = DefaultValue; free(char_str); isl_printer_free(p); return string; } -std::string polly::stringFromIslObj(__isl_keep isl_map *map) { - return stringFromIslObjInternal(map, isl_map_get_ctx, isl_printer_print_map); -} +#define ISL_C_OBJECT_TO_STRING(name) \ + std::string polly::stringFromIslObj(__isl_keep isl_##name *Obj, \ + std::string DefaultValue) { \ + return stringFromIslObjInternal(Obj, isl_##name##_get_ctx, \ + isl_printer_print_##name, DefaultValue); \ + } -std::string polly::stringFromIslObj(__isl_keep isl_set *set) { - return stringFromIslObjInternal(set, isl_set_get_ctx, isl_printer_print_set); -} - -std::string polly::stringFromIslObj(__isl_keep isl_union_map *umap) { - return stringFromIslObjInternal(umap, isl_union_map_get_ctx, - isl_printer_print_union_map); -} - -std::string polly::stringFromIslObj(__isl_keep isl_union_set *uset) { - return stringFromIslObjInternal(uset, isl_union_set_get_ctx, - isl_printer_print_union_set); -} - -std::string polly::stringFromIslObj(__isl_keep isl_schedule *schedule) { - return stringFromIslObjInternal(schedule, isl_schedule_get_ctx, - isl_printer_print_schedule); -} - -std::string polly::stringFromIslObj(__isl_keep isl_multi_aff *maff) { - return stringFromIslObjInternal(maff, isl_multi_aff_get_ctx, - isl_printer_print_multi_aff); -} - -std::string polly::stringFromIslObj(__isl_keep isl_pw_multi_aff *pma) { - return stringFromIslObjInternal(pma, isl_pw_multi_aff_get_ctx, - isl_printer_print_pw_multi_aff); -} - -std::string polly::stringFromIslObj(__isl_keep isl_multi_pw_aff *mpa) { - return stringFromIslObjInternal(mpa, isl_multi_pw_aff_get_ctx, - isl_printer_print_multi_pw_aff); -} - -std::string polly::stringFromIslObj(__isl_keep isl_union_pw_multi_aff *upma) { - return stringFromIslObjInternal(upma, isl_union_pw_multi_aff_get_ctx, - isl_printer_print_union_pw_multi_aff); -} - -std::string polly::stringFromIslObj(__isl_keep isl_aff *aff) { - return stringFromIslObjInternal(aff, isl_aff_get_ctx, isl_printer_print_aff); -} - -std::string polly::stringFromIslObj(__isl_keep isl_pw_aff *pwaff) { - return stringFromIslObjInternal(pwaff, isl_pw_aff_get_ctx, - isl_printer_print_pw_aff); -} - -std::string polly::stringFromIslObj(__isl_keep isl_space *space) { - return stringFromIslObjInternal(space, isl_space_get_ctx, - isl_printer_print_space); -} +ISL_C_OBJECT_TO_STRING(aff) +ISL_C_OBJECT_TO_STRING(ast_expr) +ISL_C_OBJECT_TO_STRING(ast_node) +ISL_C_OBJECT_TO_STRING(basic_map) +ISL_C_OBJECT_TO_STRING(basic_set) +ISL_C_OBJECT_TO_STRING(map) +ISL_C_OBJECT_TO_STRING(set) +ISL_C_OBJECT_TO_STRING(id) +ISL_C_OBJECT_TO_STRING(multi_aff) +ISL_C_OBJECT_TO_STRING(multi_pw_aff) +ISL_C_OBJECT_TO_STRING(multi_union_pw_aff) +ISL_C_OBJECT_TO_STRING(point) +ISL_C_OBJECT_TO_STRING(pw_aff) +ISL_C_OBJECT_TO_STRING(pw_multi_aff) +ISL_C_OBJECT_TO_STRING(schedule) +ISL_C_OBJECT_TO_STRING(schedule_node) +ISL_C_OBJECT_TO_STRING(space) +ISL_C_OBJECT_TO_STRING(union_access_info) +ISL_C_OBJECT_TO_STRING(union_flow) +ISL_C_OBJECT_TO_STRING(union_set) +ISL_C_OBJECT_TO_STRING(union_map) +ISL_C_OBJECT_TO_STRING(union_pw_aff) +ISL_C_OBJECT_TO_STRING(union_pw_multi_aff) static void replace(std::string &str, const std::string &find, const std::string &replace) { diff --git a/polly/lib/Support/ISLTools.cpp b/polly/lib/Support/ISLTools.cpp index 954944c7682f..bc4fda91ff4b 100644 --- a/polly/lib/Support/ISLTools.cpp +++ b/polly/lib/Support/ISLTools.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "polly/Support/ISLTools.h" +#include "polly/Support/GICHelper.h" #include "llvm/Support/raw_ostream.h" #include #include @@ -760,9 +761,9 @@ static void printSortedPolyhedra(isl::union_set USet, llvm::raw_ostream &OS, for (const isl::basic_set &BSet : BSets) { std::string Str; if (IsMap) - Str = isl::map(BSet.unwrap()).to_str(); + Str = stringFromIslObj(isl::map(BSet.unwrap())); else - Str = isl::set(BSet).to_str(); + Str = stringFromIslObj(isl::set(BSet)); size_t OpenPos = Str.find_first_of('{'); assert(OpenPos != std::string::npos); size_t ClosePos = Str.find_last_of('}');