[PATCH] D59214: [clang][OpeMP] Model OpenMP structured-block in AST (PR40563)
Alexey Bataev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 11 09:42:52 PDT 2019
ABataev added inline comments.
================
Comment at: include/clang/AST/StmtOpenMP.h:335
+ llvm::Optional<Stmt *> getStructuredBlockImpl() const {
+ return const_cast<Stmt *>(getInnermostCapturedStmt()->getCapturedStmt());
----------------
No need to insert it into each class, just add:
```
Stmt * OMPExecutableDirective::getStructuredBlock() const {
if (!hasAssociatedStmt() || !getAssociatedStmt())
return nullptr;
if (auto *LD = dyn_cast<OMPLoopDirective>(this))
return LD->getBody();
return getInnermostCapturedStmt()->getCapturedStmt();
}
```
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59214/new/
https://reviews.llvm.org/D59214
More information about the cfe-commits
mailing list