[flang-commits] [flang] [flang][OpenMP] Use OmpDirectiveSpecification in simple directives (PR #131162)

Mats Petersson via flang-commits flang-commits at lists.llvm.org
Fri Mar 14 02:37:51 PDT 2025


================
@@ -1198,24 +1228,32 @@ TYPE_PARSER(sourced( //
         verbatim("FLUSH"_tok), maybe(parenthesized(Parser<OmpObjectList>{})),
         Parser<OmpClauseList>{}, pure(/*TrailingClauses=*/true))))
 
-// Simple Standalone Directives
-TYPE_PARSER(sourced(construct<OmpSimpleStandaloneDirective>(first(
-    "BARRIER" >> pure(llvm::omp::Directive::OMPD_barrier),
-    "ORDERED" >> pure(llvm::omp::Directive::OMPD_ordered),
-    "SCAN" >> pure(llvm::omp::Directive::OMPD_scan),
-    "TARGET ENTER DATA" >> pure(llvm::omp::Directive::OMPD_target_enter_data),
-    "TARGET EXIT DATA" >> pure(llvm::omp::Directive::OMPD_target_exit_data),
-    "TARGET UPDATE" >> pure(llvm::omp::Directive::OMPD_target_update),
-    "TASKWAIT" >> pure(llvm::omp::Directive::OMPD_taskwait),
-    "TASKYIELD" >> pure(llvm::omp::Directive::OMPD_taskyield)))))
+static bool IsSimpleStandalone(const OmpDirectiveName &name) {
----------------
Leporacanthicus wrote:

It seems to me that `DirectiveName` is really more of `DirectiveID`. Especially as it correspond to `DirId` in other places - unless I'm missing something. Something called name implies in my head that it's a string... 

https://github.com/llvm/llvm-project/pull/131162


More information about the flang-commits mailing list