[PATCH] D79921: [OpenMP] Fix omp and clang pragmas
Alexey Bataev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu May 14 05:52:16 PDT 2020
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
More information about the cfe-commits
mailing list