[Openmp-commits] [PATCH] D108132: Add implicit map for a list item appears in a reduction clause.

Alexey Bataev via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Aug 17 11:10:51 PDT 2021

ABataev added inline comments.

Comment at: clang/lib/Sema/SemaOpenMP.cpp:5825
+          for (Expr *E : RC->varlists())
+            if (!dyn_cast<DeclRefExpr>(E))
+              ImplicitExprs.emplace_back(E);
jyu2 wrote:
> ABataev wrote:
> > `isa`. Also, what if this is a `MemberExpr`?
> Yes isa.   Changed.  Thanks.
> For reduction MemeberExpr is not allowed, it is only allowed variable name, array element or array section.
I would also do this check if it is a not template parsing/analysis mode + also would do this for `E->IgnoreParensImpCasts()`

Comment at: clang/lib/Sema/SemaOpenMP.cpp:19481-19482
     if (VD && DSAS->isThreadPrivate(VD)) {
+      if (NoDiagnose)
+        continue;
       DSAStackTy::DSAVarData DVar = DSAS->getTopDSA(VD, /*FromParent=*/false);
jyu2 wrote:
> ABataev wrote:
> > Hmm, should not we still diagnose this case?
> The rule is skip the error as well as skip adding implicit map clause.  So that we don't get regression for old code.
I think we already have the check for it for the reduction clause, so I think we can skip this check here.

  rG LLVM Github Monorepo



More information about the Openmp-commits mailing list