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 =