ABataev added a comment.

Tests?



================
Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:1736
+  const AttributedStmt *AS = nullptr;
+  if (auto *OMPD = dyn_cast<OMPParallelForDirective>(&S)) {
+    const CapturedStmt *CS = OMPD->getCapturedStmt(OMPD_parallel);
----------------
1. Cast it to `OMPExecutableDirective` here, it should be enough.
2. No need for conditional casting, use `cast<OMPExecutableDirective>(...)`. Or 
you can change the function itself to accept `const OMPExecutableDirective &S` 
instead of `const Stmt &S`.


================
Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:1737
+  if (auto *OMPD = dyn_cast<OMPParallelForDirective>(&S)) {
+    const CapturedStmt *CS = OMPD->getCapturedStmt(OMPD_parallel);
+    const Stmt *SS = CS->getCapturedStmt();
----------------
Use `getInnermostCapturedStmt()` instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79921



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

Reply via email to