diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-06-23 14:25:19 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-06-23 14:25:19 +0000 |
commit | 1c2cfbc3eac44ab3ec79bcdae56a23a17e5c9693 (patch) | |
tree | 2158e97e424dd441a8db2fcd5704f1d3ddec7fca /clang/lib/Sema/TreeTransform.h | |
parent | 8c5f537f184a1e78d9a734cef3202382946a0108 (diff) | |
download | bcm5719-llvm-1c2cfbc3eac44ab3ec79bcdae56a23a17e5c9693.tar.gz bcm5719-llvm-1c2cfbc3eac44ab3ec79bcdae56a23a17e5c9693.zip |
[OPENMP] Initial support for 'depend' clause (4.0).
Parsing and sema analysis (without support for array sections in arguments) for 'depend' clause (used in 'task' directive, OpenMP 4.0).
llvm-svn: 240409
Diffstat (limited to 'clang/lib/Sema/TreeTransform.h')
-rw-r--r-- | clang/lib/Sema/TreeTransform.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index 322cb6ccb58..996dd2b0783 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -1551,6 +1551,19 @@ public: EndLoc); } + /// \brief Build a new OpenMP 'depend' pseudo clause. + /// + /// By default, performs semantic analysis to build the new OpenMP clause. + /// Subclasses may override this routine to provide different behavior. + OMPClause * + RebuildOMPDependClause(OpenMPDependClauseKind DepKind, SourceLocation DepLoc, + SourceLocation ColonLoc, ArrayRef<Expr *> VarList, + SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation EndLoc) { + return getSema().ActOnOpenMPDependClause(DepKind, DepLoc, ColonLoc, VarList, + StartLoc, LParenLoc, EndLoc); + } + /// \brief Rebuild the operand to an Objective-C \@synchronized statement. /// /// By default, performs semantic analysis to build the new statement. @@ -7255,6 +7268,22 @@ OMPClause *TreeTransform<Derived>::TransformOMPFlushClause(OMPFlushClause *C) { C->getLParenLoc(), C->getLocEnd()); } +template <typename Derived> +OMPClause * +TreeTransform<Derived>::TransformOMPDependClause(OMPDependClause *C) { + llvm::SmallVector<Expr *, 16> Vars; + Vars.reserve(C->varlist_size()); + for (auto *VE : C->varlists()) { + ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE)); + if (EVar.isInvalid()) + return nullptr; + Vars.push_back(EVar.get()); + } + return getDerived().RebuildOMPDependClause( + C->getDependencyKind(), C->getDependencyLoc(), C->getColonLoc(), Vars, + C->getLocStart(), C->getLParenLoc(), C->getLocEnd()); +} + //===----------------------------------------------------------------------===// // Expression transformation //===----------------------------------------------------------------------===// |