diff options
author | Tobias Grosser <tobias@grosser.es> | 2018-04-28 21:06:14 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2018-04-28 21:06:14 +0000 |
commit | 0ba8c4a868133157e402a172d7c615600a4ef639 (patch) | |
tree | cee7e7e8cb757eb76e582b4d60cca1e20f88aa88 | |
parent | 77e871aaf509a50ad5208ece52054f3b793b9be9 (diff) | |
download | bcm5719-llvm-0ba8c4a868133157e402a172d7c615600a4ef639.tar.gz bcm5719-llvm-0ba8c4a868133157e402a172d7c615600a4ef639.zip |
[islpp] Remove use of isl::give from unittests
We do this mostly by just moving directly to pure C++ code.
llvm-svn: 331119
-rw-r--r-- | polly/unittests/DeLICM/DeLICMTest.cpp | 47 | ||||
-rw-r--r-- | polly/unittests/Flatten/FlattenTest.cpp | 4 | ||||
-rw-r--r-- | polly/unittests/Isl/IslTest.cpp | 4 |
3 files changed, 24 insertions, 31 deletions
diff --git a/polly/unittests/DeLICM/DeLICMTest.cpp b/polly/unittests/DeLICM/DeLICMTest.cpp index 5bfff532a87..5584f592750 100644 --- a/polly/unittests/DeLICM/DeLICMTest.cpp +++ b/polly/unittests/DeLICM/DeLICMTest.cpp @@ -23,11 +23,11 @@ namespace { /// Get the universes of all spaces in @p USet. isl::union_set unionSpace(const isl::union_set &USet) { - auto Result = give(isl_union_set_empty(isl_union_set_get_space(USet.keep()))); + auto Result = isl::union_set::empty(USet.get_space()); USet.foreach_set([=, &Result](isl::set Set) -> isl::stat { - 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())); + auto Space = Set.get_space(); + auto Universe = isl::set::universe(Space); + Result = Result.add_set(Universe); return isl::stat::ok; }); return Result; @@ -36,11 +36,11 @@ isl::union_set unionSpace(const isl::union_set &USet) { void completeLifetime(isl::union_set Universe, isl::union_map OccupiedAndKnown, isl::union_set &Occupied, isl::union_map &Known, isl::union_set &Undef) { - auto ParamSpace = give(isl_union_set_get_space(Universe.keep())); + auto ParamSpace = Universe.get_space(); if (Undef && !Occupied) { assert(!Occupied); - Occupied = give(isl_union_set_subtract(Universe.copy(), Undef.copy())); + Occupied = Universe.subtract(Undef); } if (OccupiedAndKnown) { @@ -54,14 +54,14 @@ void completeLifetime(isl::union_set Universe, isl::union_map OccupiedAndKnown, OccupiedAndKnown.foreach_map([&Known](isl::map Map) -> isl::stat { if (isl_map_has_tuple_name(Map.keep(), isl_dim_out) != isl_bool_true) return isl::stat::ok; - Known = give(isl_union_map_add_map(Known.take(), Map.take())); + Known = Known.add_map(Map); return isl::stat::ok; }); } if (!Undef) { assert(Occupied); - Undef = give(isl_union_set_subtract(Universe.copy(), Occupied.copy())); + Undef = Universe.subtract(Occupied); } if (!Known) { // By default, nothing is known. @@ -98,38 +98,31 @@ bool checkIsConflictingNonsymmetricCommon( isl::union_map ProposedOccupiedAndKnown, isl::union_set ProposedUnused, isl::union_map ProposedWritten) { // Determine universe (set of all possible domains). - auto Universe = give(isl_union_set_empty(isl_space_params_alloc(Ctx, 0))); + auto Universe = isl::union_set::empty(isl::space::params_alloc(Ctx, 0)); if (ExistingOccupiedAndKnown) - Universe = give(isl_union_set_union( - Universe.take(), ExistingOccupiedAndKnown.domain().take())); + Universe = Universe.unite(ExistingOccupiedAndKnown.domain()); if (ExistingUnused) - Universe = - give(isl_union_set_union(Universe.take(), ExistingUnused.copy())); + Universe = Universe.unite(ExistingUnused); if (ExistingWritten) - Universe = give( - isl_union_set_union(Universe.take(), ExistingWritten.domain().take())); + Universe = Universe.unite(ExistingWritten.domain()); if (ProposedOccupiedAndKnown) - Universe = give(isl_union_set_union( - Universe.take(), ProposedOccupiedAndKnown.domain().take())); + Universe = Universe.unite(ProposedOccupiedAndKnown.domain()); if (ProposedUnused) - Universe = - give(isl_union_set_union(Universe.take(), ProposedUnused.copy())); + Universe = Universe.unite(ProposedUnused); if (ProposedWritten) - Universe = give( - isl_union_set_union(Universe.take(), ProposedWritten.domain().take())); + Universe = Universe.unite(ProposedWritten.domain()); Universe = unionSpace(Universe); // Add a space the universe that does not occur anywhere else to ensure // robustness. Use &NewId to ensure that this Id is unique. - isl::id NewId = give(isl_id_alloc(Ctx, "Unrelated", &NewId)); + isl::id NewId = isl::id::alloc(Ctx, "Unrelated", &NewId); // The space must contains at least one dimension to allow order // modifications. - auto NewSpace = give(isl_space_set_alloc(Ctx, 0, 1)); - NewSpace = - give(isl_space_set_tuple_id(NewSpace.take(), isl_dim_set, NewId.copy())); - auto NewSet = give(isl_set_universe(NewSpace.take())); - Universe = give(isl_union_set_add_set(Universe.take(), NewSet.take())); + auto NewSpace = isl::space(Ctx, 0, 1); + NewSpace = NewSpace.set_tuple_id(isl::dim::set, NewId); + auto NewSet = isl::set::universe(NewSpace); + Universe = Universe.add_set(NewSet); // Using the universe, fill missing data. isl::union_set ExistingOccupied; diff --git a/polly/unittests/Flatten/FlattenTest.cpp b/polly/unittests/Flatten/FlattenTest.cpp index e8e960d98c1..1f59a3ebe2e 100644 --- a/polly/unittests/Flatten/FlattenTest.cpp +++ b/polly/unittests/Flatten/FlattenTest.cpp @@ -28,8 +28,8 @@ bool checkFlatten(const char *ScheduleStr, const char *ExpectedStr) { isl_bool Success; { - auto Schedule = give(isl_union_map_read_from_str(Ctx, ScheduleStr)); - auto Expected = give(isl_union_map_read_from_str(Ctx, ExpectedStr)); + auto Schedule = isl::union_map(Ctx, ScheduleStr); + auto Expected = isl::union_map(Ctx, ExpectedStr); auto Result = flattenSchedule(std::move(Schedule)); Success = isl_union_map_is_equal(Result.keep(), Expected.keep()); diff --git a/polly/unittests/Isl/IslTest.cpp b/polly/unittests/Isl/IslTest.cpp index 9b6dac11c54..2fbf3364f1e 100644 --- a/polly/unittests/Isl/IslTest.cpp +++ b/polly/unittests/Isl/IslTest.cpp @@ -23,9 +23,9 @@ static isl::space parseSpace(isl_ctx *Ctx, const char *Str) { isl::space Result; if (Obj.type == isl_obj_set) - Result = give(isl_set_get_space(static_cast<isl_set *>(Obj.v))); + Result = isl::manage(isl_set_get_space(static_cast<isl_set *>(Obj.v))); else if (Obj.type == isl_obj_map) - Result = give(isl_map_get_space(static_cast<isl_map *>(Obj.v))); + Result = isl::manage(isl_map_get_space(static_cast<isl_map *>(Obj.v))); isl_stream_free(Stream); if (Obj.type) |