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

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 25 07:10:03 PST 2020


ABataev added inline comments.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:15683
   }
+  bool VisitUnaryOperator(UnaryOperator *UO) {
+    if (SemaRef.getLangOpts().OpenMP < 50) {
----------------
I think you need to extend this to support paren expressions, at least.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:15708-15710
+    const clang::Type *RootT = BO->getType().getTypePtr();
+    const clang::Type *LT = LE->getType().getTypePtr();
+    const clang::Type *RT = RE->getType().getTypePtr();
----------------
I don't think you need these variables here anymore.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:15714-15718
+      if (RootT == LT)
+        Visit(LE);
+      else
+        Visit(RE);
+      return true;
----------------
This does not look correct. At least, it should return the result of one of `Visit()` calls. Plus, it seems to me, it won't handle something like `*(a+5)`. That's why I suggest excluding binary op from this patch, it is not complete.


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