[flang-commits] [flang] [llvm] [OpenMP][Draft] Breaking up of combined/composite directives (PR #80059)

Krzysztof Parzyszek via flang-commits flang-commits at lists.llvm.org
Fri Feb 16 07:41:35 PST 2024


================
@@ -48,27 +49,76 @@ using DeclareTargetCapturePair =
 // Common helper functions
 //===----------------------------------------------------------------------===//
 
-static Fortran::semantics::Symbol *
-getOmpObjectSymbol(const Fortran::parser::OmpObject &ompObject) {
-  Fortran::semantics::Symbol *sym = nullptr;
-  std::visit(
-      Fortran::common::visitors{
-          [&](const Fortran::parser::Designator &designator) {
-            if (auto *arrayEle =
-                    Fortran::parser::Unwrap<Fortran::parser::ArrayElement>(
-                        designator)) {
-              sym = GetFirstName(arrayEle->base).symbol;
-            } else if (auto *structComp = Fortran::parser::Unwrap<
-                           Fortran::parser::StructureComponent>(designator)) {
-              sym = structComp->component.symbol;
-            } else if (const Fortran::parser::Name *name =
-                           Fortran::semantics::getDesignatorNameIfDataRef(
-                               designator)) {
-              sym = name->symbol;
-            }
-          },
-          [&](const Fortran::parser::Name &name) { sym = name.symbol; }},
-      ompObject.u);
+static llvm::ArrayRef<llvm::omp::Directive> getWorksharing() {
----------------
kparzysz wrote:

Yes, I think it would be nice to have flags in the .td file whether a given construct is composite, compound, worksharing, worksharing-loop, etc.

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


More information about the flang-commits mailing list