diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2013-09-03 12:55:52 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2013-09-03 12:55:52 +0000 |
commit | d4183dabd7a959746d558098762ab61e97d5ee6d (patch) | |
tree | aefe91fd5d6606ab46726a4812c03c0b06f98806 /clang/lib/AST/Stmt.cpp | |
parent | 32fd46c936ef4701d46804a4a637564f9bec9ebe (diff) | |
download | bcm5719-llvm-d4183dabd7a959746d558098762ab61e97d5ee6d.tar.gz bcm5719-llvm-d4183dabd7a959746d558098762ab61e97d5ee6d.zip |
OpenMP: Data-sharing attributes analysis and clause 'shared'
llvm-svn: 189795
Diffstat (limited to 'clang/lib/AST/Stmt.cpp')
-rw-r--r-- | clang/lib/AST/Stmt.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp index 2711e9ba979..0d654eeee35 100644 --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -1111,6 +1111,16 @@ bool CapturedStmt::capturesVariable(const VarDecl *Var) const { return false; } +StmtRange OMPClause::children() { + switch(getClauseKind()) { + default : break; +#define OPENMP_CLAUSE(Name, Class) \ + case OMPC_ ## Name : return static_cast<Class *>(this)->children(); +#include "clang/Basic/OpenMPKinds.def" + } + llvm_unreachable("unknown OMPClause"); +} + OMPPrivateClause *OMPPrivateClause::Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, @@ -1131,6 +1141,26 @@ OMPPrivateClause *OMPPrivateClause::CreateEmpty(const ASTContext &C, return new (Mem) OMPPrivateClause(N); } +OMPSharedClause *OMPSharedClause::Create(const ASTContext &C, + SourceLocation StartLoc, + SourceLocation LParenLoc, + SourceLocation EndLoc, + ArrayRef<Expr *> VL) { + void *Mem = C.Allocate(sizeof(OMPSharedClause) + sizeof(Expr *) * VL.size(), + llvm::alignOf<OMPSharedClause>()); + OMPSharedClause *Clause = new (Mem) OMPSharedClause(StartLoc, LParenLoc, + EndLoc, VL.size()); + Clause->setVarRefs(VL); + return Clause; +} + +OMPSharedClause *OMPSharedClause::CreateEmpty(const ASTContext &C, + unsigned N) { + void *Mem = C.Allocate(sizeof(OMPSharedClause) + sizeof(Expr *) * N, + llvm::alignOf<OMPSharedClause>()); + return new (Mem) OMPSharedClause(N); +} + void OMPExecutableDirective::setClauses(ArrayRef<OMPClause *> Clauses) { assert(Clauses.size() == this->Clauses.size() && "Number of clauses is not the same as the preallocated buffer"); |