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

Chi Chun Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 24 08:31:59 PST 2020


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


================
Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7829
         if (EncounteredME) {
-          const auto *FD = dyn_cast<FieldDecl>(EncounteredME->getMemberDecl());
-          unsigned FieldIndex = FD->getFieldIndex();
-
-          // Update info about the lowest and highest elements for this struct
-          if (!PartialStruct.Base.isValid()) {
-            PartialStruct.LowestElem = {FieldIndex, LB};
-            PartialStruct.HighestElem = {FieldIndex, LB};
-            PartialStruct.Base = BP;
-          } else if (FieldIndex < PartialStruct.LowestElem.first) {
-            PartialStruct.LowestElem = {FieldIndex, LB};
-          } else if (FieldIndex > PartialStruct.HighestElem.first) {
-            PartialStruct.HighestElem = {FieldIndex, LB};
+          // MemberExpr can also be FunctionDecl after we allow all lvalue
+          if (const auto *FD =
----------------
ABataev wrote:
> Here we should not have any functiondecls. Must be an assert.
Don't we need to support something like `#pragma omp target map(r.S.foo()[:12])`?


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:15283
+  explicit LocatorChecker(
+      OMPClauseMappableExprCommon::MappableExprComponentList &CurComponents)
+      : CurComponents(CurComponents), DerefCnt(0) {}
----------------
ABataev wrote:
> Why do you need components list here?
Since I need to insert the information in `VisitDeclRefExpr`.


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