[PATCH] D79972: [OpenMP5.0] map item can be non-contiguous for target update

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 2 09:52:34 PDT 2020


ABataev added a comment.

Still: Did you think about implementing it in the compiler instead of the runtime?



================
Comment at: clang/include/clang/AST/OpenMPClause.h:4676-4677
     explicit MappableComponent() = default;
-    explicit MappableComponent(Expr *AssociatedExpression,
+    explicit MappableComponent(llvm::PointerIntPair<Expr *, 1, bool>
+                                   AssociatedExpressionNonContiguousPr,
                                ValueDecl *AssociatedDeclaration)
----------------
I would suggest to pass `Expr *` and `bool` as separate parameters here rather than as `PointerIntPair` 


================
Comment at: clang/include/clang/AST/OpenMPClause.h:4690
+
+    bool getNonContiguous() const {
+      return AssociatedExpressionNonContiguousPr.getInt();
----------------
`isNonContiguous()`


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:16356
   OMPClauseMappableExprCommon::MappableExprComponentList &Components;
+  bool IsNonContiguous;
   bool NoDiagnose = false;
----------------
Add default initializer


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:16540-16544
+      if (IsPointer && !AllowAnotherPtr) {
+        SemaRef.Diag(ELoc, diag::err_omp_section_length_undefined) << true;
+      } else {
+        IsNonContiguous = true;
+      }
----------------
Remove braces here, they are not needed.


================
Comment at: clang/lib/Serialization/ASTWriter.cpp:6575
     Record.AddStmt(M.getAssociatedExpression());
+    Record.push_back(M.getNonContiguous());
     Record.AddDeclRef(M.getAssociatedDeclaration());
----------------
There is a member function `writeBool`


================
Comment at: clang/lib/Serialization/ASTWriter.cpp:6600
     Record.AddStmt(M.getAssociatedExpression());
+    Record.push_back(M.getNonContiguous());
     Record.AddDeclRef(M.getAssociatedDeclaration());
----------------
Same, use `writeBool`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79972





More information about the cfe-commits mailing list