From 8703e3838068156b2e0ff80b218bf854a7eba84e Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Mon, 4 Sep 2017 10:05:29 +0000 Subject: [PATCH] [ISLTools]: Move singleton to isl++ llvm-svn: 312476 --- polly/lib/Support/ISLTools.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/polly/lib/Support/ISLTools.cpp b/polly/lib/Support/ISLTools.cpp index a138e62ce1f4..226c3ac9a547 100644 --- a/polly/lib/Support/ISLTools.cpp +++ b/polly/lib/Support/ISLTools.cpp @@ -135,12 +135,11 @@ isl::map polly::singleton(isl::union_map UMap, isl::space ExpectedSpace) { return nullptr; if (isl_union_map_n_map(UMap.keep()) == 0) - return give(isl_map_empty(ExpectedSpace.take())); + return isl::map::empty(ExpectedSpace); + + isl::map Result = isl::map::from_union_map(UMap); + assert(!Result || Result.get_space().has_equal_tuples(ExpectedSpace)); - auto Result = give(isl_map_from_union_map(UMap.take())); - assert(!Result || isl_space_has_equal_tuples( - give(isl_map_get_space(Result.keep())).keep(), - ExpectedSpace.keep()) == isl_bool_true); return Result; } @@ -149,12 +148,11 @@ isl::set polly::singleton(isl::union_set USet, isl::space ExpectedSpace) { return nullptr; if (isl_union_set_n_set(USet.keep()) == 0) - return give(isl_set_empty(ExpectedSpace.copy())); + return isl::set::empty(ExpectedSpace); + + isl::set Result(USet); + assert(!Result || Result.get_space().has_equal_tuples(ExpectedSpace)); - auto Result = give(isl_set_from_union_set(USet.take())); - assert(!Result || isl_space_has_equal_tuples( - give(isl_set_get_space(Result.keep())).keep(), - ExpectedSpace.keep()) == isl_bool_true); return Result; } @@ -537,4 +535,4 @@ isl::union_map polly::applyDomainRange(isl::union_map UMap, isl::map polly::intersectRange(isl::map Map, isl::union_set Range) { isl::set RangeSet = Range.extract_set(Map.get_space().range()); return Map.intersect_range(RangeSet); -} \ No newline at end of file +}