[flang-commits] [flang] [flang][OpenMP] Add semantic checks for two DECLARE VARIANT restrictions (PR #209528)
Abid Qadeer via flang-commits
flang-commits at lists.llvm.org
Tue Jul 21 01:23:21 PDT 2026
================
@@ -878,6 +878,33 @@ static bool CheckVariantAccessibility(SemanticsContext &context,
return false;
}
+// Collect the construct selector set of `sel` into `constructs` as an ordered
+// list of leaf construct directives. Combined and composite constructs are
+// decomposed into their leaves (e.g. `target teams` -> target, teams), so two
+// match selectors have the same construct selector set iff the collected lists
+// are equal. An absent construct selector yields an empty list.
+static void CollectConstructSelectorSet(
----------------
abidh wrote:
Yes, structural equality is intended. I went with comparing the normalized selector text (rather than semantically evaluating each property) deliberately, for two reasons:
Simplicity: It avoids per-property logic(e.g. no constant-folding of simdlen expressions, no special-casing inbranch/notinbranch, etc).
Future-proofing: Any construct-selector property added by a future OpenMP version participates in the comparison automatically, with no changes to this check.
https://github.com/llvm/llvm-project/pull/209528
More information about the flang-commits
mailing list