ABataev added a comment.

Erroneous test are required



================
Comment at: clang/include/clang/AST/OpenMPClause.h:310-314
+  /// Fetches list of variables associated with this clause.
+  Expr *getIteratorRef() {
+    return (static_cast<T *>(this)
+                ->template getTrailingObjects<Expr *>())[2 * NumVars];
+  }
----------------
Why do we need it here, if it is specific to map clause?


================
Comment at: clang/include/clang/AST/OpenMPClause.h:317
+  /// Sets the list of variables for this clause.
+  void setIteratorRef(ArrayRef<Expr *> IL) {
+    assert(IL.size() == 1 && "Number of iterator expressions must be 1");
----------------
Why ArrayRef if only one expression is expected?


================
Comment at: clang/include/clang/AST/OpenMPClause.h:5940-5942
+    if (HasIteratorModifier)
+      return getIteratorRef();
+    return nullptr;
----------------
Just `getIteratorRef()` should be enough.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:1166-1169
+    for (auto *IteratorVD : Top->IteratorVarDecls)
+      if (IteratorVD == VD->getCanonicalDecl())
+        return true;
+    return false;
----------------
Use llvm::any_of()


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

https://reviews.llvm.org/D141871

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to