[PATCH] D82800: [OPENMP50] extend array section for stride (Parsing/Sema/AST)

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 7 08:08:13 PDT 2020


ABataev added inline comments.


================
Comment at: clang/lib/Parse/ParseExpr.cpp:1933
         }
+        if (getLangOpts().OpenMP >= 50 && Tok.is(tok::colon)) {
+          // Consume ':'
----------------
You need to insert an additional check for `OMPClauseKind == llvm::omp::Clause::OMPC_to || OMPClauseKind == llvm::omp::Clause::OMPC_from` here. I.e. we shall expect stride not only if the version is 5.0, but also if the current clauses is `to` or `from`


================
Comment at: clang/lib/Parse/ParseExpr.cpp:1938-1947
+            // Stride can only be null or one for any clause that is not to or
+            // from
+            if (OMPClauseKind != llvm::omp::Clause::OMPC_to &&
+                OMPClauseKind != llvm::omp::Clause::OMPC_from) {
+              Expr::EvalResult Result;
+              Expr *StrideExpr = Stride.get();
+              if (StrideExpr) {
----------------
No, what I meant, that `ParseExpression()` should be called only if `OMPClauseKind == llvm::omp::Clause::OMPC_to || OMPClauseKind == llvm::omp::Clause::OMPC_from` 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82800





More information about the cfe-commits mailing list