diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2014-03-31 03:36:38 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2014-03-31 03:36:38 +0000 |
commit | a100391cc47d7e9db05cc239b1919b958da71cb0 (patch) | |
tree | 65e4fdc8dfbbefb0dde3b1bac53621c1e312b1c3 /include/clang/AST/OpenMPClause.h | |
parent | 78afefd7cad396fe8c1844e4ff359737d1766b6a (diff) | |
download | clang-a100391cc47d7e9db05cc239b1919b958da71cb0.tar.gz clang-a100391cc47d7e9db05cc239b1919b958da71cb0.tar.bz2 clang-a100391cc47d7e9db05cc239b1919b958da71cb0.tar.xz |
[OPENMP] Implemented 'copyin' clause
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205164 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/OpenMPClause.h')
-rw-r--r-- | include/clang/AST/OpenMPClause.h | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/include/clang/AST/OpenMPClause.h b/include/clang/AST/OpenMPClause.h index 97c4869b98..64b5ce4c5b 100644 --- a/include/clang/AST/OpenMPClause.h +++ b/include/clang/AST/OpenMPClause.h @@ -95,7 +95,7 @@ protected: llvm::RoundUpToAlignment(sizeof(T), llvm::alignOf<Expr *>()))); } - /// \brief Build clause with number of variables \a N. + /// \brief Build a clause with \a N variables /// /// \param K Kind of the clause. /// \param StartLoc Starting location of the clause (the clause keyword). @@ -553,6 +553,65 @@ public: } }; +/// \brief This represents clause 'copyin' in the '#pragma omp ...' directives. +/// +/// \code +/// #pragma omp parallel copyin(a,b) +/// \endcode +/// In this example directive '#pragma omp parallel' has clause 'copyin' +/// with the variables 'a' and 'b'. +/// +class OMPCopyinClause : public OMPVarListClause<OMPCopyinClause> { + /// \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. + /// + OMPCopyinClause(SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation EndLoc, unsigned N) + : OMPVarListClause<OMPCopyinClause>(OMPC_copyin, StartLoc, LParenLoc, + EndLoc, N) {} + + /// \brief Build an empty clause. + /// + /// \param N Number of variables. + /// + explicit OMPCopyinClause(unsigned N) + : OMPVarListClause<OMPCopyinClause>(OMPC_copyin, 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 OMPCopyinClause *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 OMPCopyinClause *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_copyin; + } +}; + } // end namespace clang #endif |