[PATCH] D76211: OpenMP Metadirective with user defined condition

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 21:36:58 PDT 2020


jdoerfert added a comment.

Some comments but I haven't gone through all of it. The tests are still missing.



================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:6334
+
+  for (auto i = Clauses.rbegin(); i < Clauses.rend(); i++) {
+    OMPWhenClause *WhenClause = dyn_cast<OMPWhenClause>(*i);
----------------
`i` is not a name for whatever this is. Don't use auto if the type is not obvious, consider a reverse range adapter.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:6337
+    Expr *WhenCondExpr = NULL;
+    Stmt *ThenStmt = NULL;
+    OpenMPDirectiveKind DKind = WhenClause->getDKind();
----------------
`NULL` is a poor substitute for `nullptr`, use the latter, always.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:6397
+      }
+    }
+
----------------
Do not reimplement parts of logic already existing. Use the same mechanism to find a match we use in other places. See `ActOnOpenMPCall`, and the `llvm/Frontend/OpenMP/OMPContext.h`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76211



More information about the llvm-commits mailing list