diff options
author | Alexander Musman <alexander.musman@gmail.com> | 2014-06-04 13:06:39 +0000 |
---|---|---|
committer | Alexander Musman <alexander.musman@gmail.com> | 2014-06-04 13:06:39 +0000 |
commit | 1bb328cca568d7031a588ba3a19b8a472bd50c33 (patch) | |
tree | a8a76cecb9af199f5272c655b7e01e51af01ebd9 /clang/lib/AST/Stmt.cpp | |
parent | a69ca9be127f26e22053243f7562d1079339314f (diff) | |
download | bcm5719-llvm-1bb328cca568d7031a588ba3a19b8a472bd50c33.tar.gz bcm5719-llvm-1bb328cca568d7031a588ba3a19b8a472bd50c33.zip |
[OPENMP] Parsing/Sema for OMPLasprivateClause.
Parsing this clause, allowing it on directive ‘omp simd’ and semantic checks.
llvm-svn: 210184
Diffstat (limited to 'clang/lib/AST/Stmt.cpp')
-rw-r--r-- | clang/lib/AST/Stmt.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp index e6aa472c399..52906877cf2 100644 --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -1168,6 +1168,28 @@ OMPFirstprivateClause *OMPFirstprivateClause::CreateEmpty(const ASTContext &C, return new (Mem) OMPFirstprivateClause(N); } +OMPLastprivateClause *OMPLastprivateClause::Create(const ASTContext &C, + SourceLocation StartLoc, + SourceLocation LParenLoc, + SourceLocation EndLoc, + ArrayRef<Expr *> VL) { + void *Mem = C.Allocate(llvm::RoundUpToAlignment(sizeof(OMPLastprivateClause), + llvm::alignOf<Expr *>()) + + sizeof(Expr *) * VL.size()); + OMPLastprivateClause *Clause = + new (Mem) OMPLastprivateClause(StartLoc, LParenLoc, EndLoc, VL.size()); + Clause->setVarRefs(VL); + return Clause; +} + +OMPLastprivateClause *OMPLastprivateClause::CreateEmpty(const ASTContext &C, + unsigned N) { + void *Mem = C.Allocate(llvm::RoundUpToAlignment(sizeof(OMPLastprivateClause), + llvm::alignOf<Expr *>()) + + sizeof(Expr *) * N); + return new (Mem) OMPLastprivateClause(N); +} + OMPSharedClause *OMPSharedClause::Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, |