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/AST/Stmt.cpp | |
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/AST/Stmt.cpp')
-rw-r--r-- | clang/lib/AST/Stmt.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp index a03ef00ce76..8e937fb08b1 100644 --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -1192,6 +1192,30 @@ OMPSharedClause *OMPSharedClause::CreateEmpty(const ASTContext &C, return new (Mem) OMPSharedClause(N); } +OMPLinearClause *OMPLinearClause::Create(const ASTContext &C, + SourceLocation StartLoc, + SourceLocation LParenLoc, + SourceLocation ColonLoc, + SourceLocation EndLoc, + ArrayRef<Expr *> VL, Expr *Step) { + void *Mem = C.Allocate(llvm::RoundUpToAlignment(sizeof(OMPLinearClause), + llvm::alignOf<Expr *>()) + + sizeof(Expr *) * (VL.size() + 1)); + OMPLinearClause *Clause = new (Mem) + OMPLinearClause(StartLoc, LParenLoc, ColonLoc, EndLoc, VL.size()); + Clause->setVarRefs(VL); + Clause->setStep(Step); + return Clause; +} + +OMPLinearClause *OMPLinearClause::CreateEmpty(const ASTContext &C, + unsigned NumVars) { + void *Mem = C.Allocate(llvm::RoundUpToAlignment(sizeof(OMPLinearClause), + llvm::alignOf<Expr *>()) + + sizeof(Expr *) * (NumVars + 1)); + return new (Mem) OMPLinearClause(NumVars); +} + OMPCopyinClause *OMPCopyinClause::Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, |