summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--polly/unittests/DeLICM/DeLICMTest.cpp34
1 files changed, 13 insertions, 21 deletions
diff --git a/polly/unittests/DeLICM/DeLICMTest.cpp b/polly/unittests/DeLICM/DeLICMTest.cpp
index 2486ab65eb8..f44e342f469 100644
--- a/polly/unittests/DeLICM/DeLICMTest.cpp
+++ b/polly/unittests/DeLICM/DeLICMTest.cpp
@@ -51,32 +51,24 @@ typedef struct {
const char *WrittenStr;
} Knowledge;
+isl::union_set parseSetOrNull(isl_ctx *Ctx, const char *Str) {
+ if (!Str)
+ return nullptr;
+ return isl::union_set(Ctx, Str);
+}
+
bool checkIsConflictingNonsymmetric(Knowledge Existing, Knowledge Proposed) {
std::unique_ptr<isl_ctx, decltype(&isl_ctx_free)> Ctx(isl_ctx_alloc(),
&isl_ctx_free);
// Parse knowledge.
- auto ExistingOccupied =
- Existing.OccupiedStr
- ? give(isl_union_set_read_from_str(Ctx.get(), Existing.OccupiedStr))
- : nullptr;
- auto ExistingUnused =
- Existing.UndefStr
- ? give(isl_union_set_read_from_str(Ctx.get(), Existing.UndefStr))
- : nullptr;
- auto ExistingWritten =
- give(isl_union_set_read_from_str(Ctx.get(), Existing.WrittenStr));
-
- auto ProposedOccupied =
- Proposed.OccupiedStr
- ? give(isl_union_set_read_from_str(Ctx.get(), Proposed.OccupiedStr))
- : nullptr;
- auto ProposedUnused =
- Proposed.UndefStr
- ? give(isl_union_set_read_from_str(Ctx.get(), Proposed.UndefStr))
- : nullptr;
- auto ProposedWritten =
- give(isl_union_set_read_from_str(Ctx.get(), Proposed.WrittenStr));
+ auto ExistingOccupied = parseSetOrNull(Ctx.get(), Existing.OccupiedStr);
+ auto ExistingUnused = parseSetOrNull(Ctx.get(), Existing.UndefStr);
+ auto ExistingWritten = parseSetOrNull(Ctx.get(), Existing.WrittenStr);
+
+ auto ProposedOccupied = parseSetOrNull(Ctx.get(), Proposed.OccupiedStr);
+ auto ProposedUnused = parseSetOrNull(Ctx.get(), Proposed.UndefStr);
+ auto ProposedWritten = parseSetOrNull(Ctx.get(), Proposed.WrittenStr);
// Determine universe (set of all possible domains).
auto Universe =
OpenPOWER on IntegriCloud