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

Alexey Bataev via Phabricator via cfe-commits cfe-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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108132/new/

https://reviews.llvm.org/D108132



More information about the cfe-commits mailing list