[Openmp-commits] [PATCH] D145093: Add map info for dereference pointer.
Alexey Bataev via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Mar 2 11:00:53 PST 2023
ABataev added inline comments.
================
Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7487-7497
+ auto TNext = Next;
+ bool IsVarDerefAssoWithArray = false;
+ if (UO && UO->getOpcode() == UO_Deref)
+ for (; TNext != CE; TNext = std::next(TNext))
+ if (isa<OMPArraySectionExpr>(TNext->getAssociatedExpression()) ||
+ isa<MemberExpr>(TNext->getAssociatedExpression()) ||
+ isa<OMPArrayShapingExpr>(TNext->getAssociatedExpression()) ||
----------------
Why need a loop here? Can you somehow merge analysis for (*p) expression with the pointer subscript analysis?
================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:2206-2207
return false;
-
- if (isa<ArraySubscriptExpr>(EI->getAssociatedExpression()) ||
- isa<OMPArraySectionExpr>(EI->getAssociatedExpression()) ||
- isa<MemberExpr>(EI->getAssociatedExpression()) ||
- isa<OMPArrayShapingExpr>(EI->getAssociatedExpression())) {
- IsVariableAssociatedWithSection = true;
- // There is nothing more we need to know about this variable.
- return true;
+ auto Next = EI;
+ for (; Next != EE; Next = std::next(Next)) {
+ if (isa<ArraySubscriptExpr>(Next->getAssociatedExpression()) ||
----------------
Why do you need a loop here?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145093/new/
https://reviews.llvm.org/D145093
More information about the Openmp-commits
mailing list