================ @@ -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 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits