[llvm-branch-commits] [Flang][OpenMP][MLIR] Extend derived (record) type map support in Flang OpenMP by adding some initial support for explicit member mapping (PR #81511)

Kareem Ergawy via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 14 06:26:07 PST 2024


================
@@ -49,14 +49,16 @@ using DeclareTargetCapturePair =
 //===----------------------------------------------------------------------===//
 
 static Fortran::semantics::Symbol *
-getOmpObjectSymbol(const Fortran::parser::OmpObject &ompObject) {
+getOmpObjParentSymbol(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)) {
+            if (auto *structComp = Fortran::parser::Unwrap<
+                    Fortran::parser::StructureComponent>(designator)) {
+              sym = GetFirstName(structComp->base).symbol;
----------------
ergawy wrote:

`const Name &GetFirstName(const StructureComponent &x)` does this for you.
```suggestion
              sym = GetFirstName(structComp).symbol;
```
Just to not repeat the logic if it is already provided somewhere else.

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


More information about the llvm-branch-commits mailing list