[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 24 13:44:07 PST 2020


ABataev added inline comments.


================
Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7616
           dyn_cast<OMPArraySectionExpr>(I->getAssociatedExpression());
+      const auto *UO = dyn_cast<UnaryOperator>(I->getAssociatedExpression());
       bool IsPointer =
----------------
What about binary operator?


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:15698
+  }
+  bool VisitBinaryOperator(BinaryOperator *BO) {
+    if (SemaRef.getLangOpts().OpenMP < 50) {
----------------
Better to discuss the implementation for this in a separate patch, it really requires some additional analysis and extra work.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:15712
+    const std::string RTS = RT->getCanonicalTypeInternal().getAsString();
+    auto CntLayer = [](char c) { return c == '*' || c == '['; };
+    size_t LLayerCnt = std::count_if(LTS.begin(), LTS.end(), CntLayer);
----------------
Again, bad idea to count this stuff.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:15729
+      Components.emplace_back(CTE, nullptr);
+      this->RelevantExpr = cast<Expr>(CTE);
+    }
----------------
No need for `this->`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75077





More information about the cfe-commits mailing list