[flang-commits] [flang] [flang][OpenMP] Parsing context selectors for METADIRECTIVE (PR #121815)
Michael Klemm via flang-commits
flang-commits at lists.llvm.org
Fri Jan 10 09:49:31 PST 2025
================
@@ -3474,6 +3477,138 @@ WRAPPER_CLASS(OmpObjectList, std::list<OmpObject>);
#define MODIFIERS() std::optional<std::list<Modifier>>
+inline namespace traits {
+// trait-property-name ->
+// identifier | string-literal
+struct OmpTraitPropertyName {
+ CharBlock source;
+ WRAPPER_CLASS_BOILERPLATE(OmpTraitPropertyName, std::string);
+};
+
+// trait-score ->
+// SCORE(non-negative-const-integer-expression)
+struct OmpTraitScore {
+ CharBlock source;
+ WRAPPER_CLASS_BOILERPLATE(OmpTraitScore, ScalarIntExpr);
+};
+
+// trait-property-extension ->
+// trait-property-name (trait-property-value, ...)
+// trait-property-value ->
+// trait-property-name |
+// scalar-integer-expression |
+// trait-property-extension
+//
+// The grammar in OpenMP 5.2+ spec is ambiguous, the above is a different
+// version (but equivalent) that doesn't have ambiguities.
----------------
mjklemm wrote:
The grammar that is printed in the spec is no longer normative. The only thing that matters is how the syntax is is specified in the JSON database. If that syntax is ambiguous, then it might be a good idea to file a ticket for the OpenMP language committee to see if it can be resolved.
https://github.com/llvm/llvm-project/pull/121815
More information about the flang-commits
mailing list