[PATCH] D72811: [WIP][OPENMP5.0] allow lvalue for motion clause

Chi Chun Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 16 08:57:08 PST 2020


cchen marked 2 inline comments as done.
cchen added inline comments.


================
Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7709-7712
                 isa<MemberExpr>(Next->getAssociatedExpression()) ||
                 isa<ArraySubscriptExpr>(Next->getAssociatedExpression()) ||
-                isa<OMPArraySectionExpr>(Next->getAssociatedExpression())) &&
+                isa<OMPArraySectionExpr>(Next->getAssociatedExpression()) ||
+                isa<UnaryOperator>(Next->getAssociatedExpression())) &&
----------------
ABataev wrote:
> This assertion must check that the expression is just an lvalue, no?
Yes.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:15442-15443
+      CurComponents.emplace_back(CurE, nullptr);
+    } else if (auto *CurE = dyn_cast<BinaryOperator>(E)) {
+      E = CurE->getLHS()->IgnoreParenImpCasts();
     } else {
----------------
ABataev wrote:
> Why just the LHS is analyzed? Also, what about support for other expressions, like casting, call, choose etc., which may result in lvalue?
1. LHS: I'll fix that
2. I'll add support for casting, call, etc
3. For "choose" are you referring to something like (a < b ? b : a)?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72811





More information about the cfe-commits mailing list