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

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 2 14:03:41 PDT 2020


ABataev added inline comments.


================
Comment at: clang/lib/Parse/ParseExpr.cpp:1928-1930
           if (Tok.isNot(tok::r_square))
-            Length = ParseExpression();
+            if (getLangOpts().OpenMP < 50 ||
+                ((Tok.isNot(tok::colon) && getLangOpts().OpenMP >= 50)))
----------------
Better merge into one logical expression.


================
Comment at: clang/lib/Parse/ParseExpr.cpp:1933-1934
         }
+        if (getLangOpts().OpenMP >= 50)
+          if (Tok.is(tok::colon)) {
+            // Consume ':'
----------------
Same, better to merge into one condition.


================
Comment at: clang/lib/Sema/TreeTransform.h:10344
+  ExprResult Stride;
+  if (E->getStride()) {
+    Stride = getDerived().TransformExpr(E->getStride());
----------------
Better to make it this way:
```
if (Expr *Str = E->getStride()) {
  Stride = getDerived().TransformExpr(Str);
  ...
}
```


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