diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2014-06-27 10:37:06 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2014-06-27 10:37:06 +0000 |
commit | 3b54d86f4f0bedfffb6305b6f12283f9c62682db (patch) | |
tree | 04730260ddc52d65d4452d6e651786058fd92015 /include/clang/AST/OpenMPClause.h | |
parent | 11a33cee19725d88b474912665c72835db03a87f (diff) | |
download | clang-3b54d86f4f0bedfffb6305b6f12283f9c62682db.tar.gz clang-3b54d86f4f0bedfffb6305b6f12283f9c62682db.tar.bz2 clang-3b54d86f4f0bedfffb6305b6f12283f9c62682db.tar.xz |
[OPENMP] Parsing and sema analysis for 'copyprivate' clause.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211886 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/OpenMPClause.h')
-rw-r--r-- | include/clang/AST/OpenMPClause.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/include/clang/AST/OpenMPClause.h b/include/clang/AST/OpenMPClause.h index 46fc4207c9..0b1aaffcf3 100644 --- a/include/clang/AST/OpenMPClause.h +++ b/include/clang/AST/OpenMPClause.h @@ -1218,6 +1218,66 @@ public: } }; +/// \brief This represents clause 'copyprivate' in the '#pragma omp ...' +/// directives. +/// +/// \code +/// #pragma omp single copyprivate(a,b) +/// \endcode +/// In this example directive '#pragma omp single' has clause 'copyprivate' +/// with the variables 'a' and 'b'. +/// +class OMPCopyprivateClause : public OMPVarListClause<OMPCopyprivateClause> { + /// \brief Build clause with number of variables \a N. + /// + /// \param StartLoc Starting location of the clause. + /// \param LParenLoc Location of '('. + /// \param EndLoc Ending location of the clause. + /// \param N Number of the variables in the clause. + /// + OMPCopyprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation EndLoc, unsigned N) + : OMPVarListClause<OMPCopyprivateClause>(OMPC_copyprivate, StartLoc, + LParenLoc, EndLoc, N) {} + + /// \brief Build an empty clause. + /// + /// \param N Number of variables. + /// + explicit OMPCopyprivateClause(unsigned N) + : OMPVarListClause<OMPCopyprivateClause>( + OMPC_copyprivate, SourceLocation(), SourceLocation(), + SourceLocation(), N) {} + +public: + /// \brief Creates clause with a list of variables \a VL. + /// + /// \param C AST context. + /// \param StartLoc Starting location of the clause. + /// \param LParenLoc Location of '('. + /// \param EndLoc Ending location of the clause. + /// \param VL List of references to the variables. + /// + static OMPCopyprivateClause * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation EndLoc, ArrayRef<Expr *> VL); + /// \brief Creates an empty clause with \a N variables. + /// + /// \param C AST context. + /// \param N The number of variables. + /// + static OMPCopyprivateClause *CreateEmpty(const ASTContext &C, unsigned N); + + StmtRange children() { + return StmtRange(reinterpret_cast<Stmt **>(varlist_begin()), + reinterpret_cast<Stmt **>(varlist_end())); + } + + static bool classof(const OMPClause *T) { + return T->getClauseKind() == OMPC_copyprivate; + } +}; + } // end namespace clang #endif |