diff options
author | Alexander Musman <alexander.musman@gmail.com> | 2014-04-22 13:09:42 +0000 |
---|---|---|
committer | Alexander Musman <alexander.musman@gmail.com> | 2014-04-22 13:09:42 +0000 |
commit | 8dba66412b0a7dba4a07de30fb74eabd37a69e79 (patch) | |
tree | 263fd67f395fb278ebf7289e61f9bb24dfc08271 /clang/lib/Sema/TreeTransform.h | |
parent | 761aa37e3efb3f3371acd486c6ec5f5e89a36ea3 (diff) | |
download | bcm5719-llvm-8dba66412b0a7dba4a07de30fb74eabd37a69e79.tar.gz bcm5719-llvm-8dba66412b0a7dba4a07de30fb74eabd37a69e79.zip |
[OPENMP] parsing 'linear' clause (for directive 'omp simd')
Differential Revision: http://reviews.llvm.org/D3272
llvm-svn: 206891
Diffstat (limited to 'clang/lib/Sema/TreeTransform.h')
-rw-r--r-- | clang/lib/Sema/TreeTransform.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index 22913104d74..f1138918825 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -1382,6 +1382,19 @@ public: EndLoc); } + /// \brief Build a new OpenMP 'linear' clause. + /// + /// By default, performs semantic analysis to build the new statement. + /// Subclasses may override this routine to provide different behavior. + OMPClause *RebuildOMPLinearClause(ArrayRef<Expr *> VarList, Expr *Step, + SourceLocation StartLoc, + SourceLocation LParenLoc, + SourceLocation ColonLoc, + SourceLocation EndLoc) { + return getSema().ActOnOpenMPLinearClause(VarList, Step, StartLoc, LParenLoc, + ColonLoc, EndLoc); + } + /// \brief Build a new OpenMP 'copyin' clause. /// /// By default, performs semantic analysis to build the new statement. @@ -6436,6 +6449,25 @@ TreeTransform<Derived>::TransformOMPSharedClause(OMPSharedClause *C) { template<typename Derived> OMPClause * +TreeTransform<Derived>::TransformOMPLinearClause(OMPLinearClause *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 0; + Vars.push_back(EVar.take()); + } + ExprResult Step = getDerived().TransformExpr(C->getStep()); + if (Step.isInvalid()) + return 0; + return getDerived().RebuildOMPLinearClause( + Vars, Step.take(), C->getLocStart(), C->getLParenLoc(), C->getColonLoc(), + C->getLocEnd()); +} + +template<typename Derived> +OMPClause * TreeTransform<Derived>::TransformOMPCopyinClause(OMPCopyinClause *C) { llvm::SmallVector<Expr *, 16> Vars; Vars.reserve(C->varlist_size()); |