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 | bf87624a623ca6de8a2bd864921e129fb848fff6 (patch) | |
tree | 6f5befbaf9fcd4309f2009670ac67ec572aa85f4 /include/clang/AST/OpenMPClause.h | |
parent | 77258921c2916416381c288a676d97565a3aac84 (diff) | |
download | clang-bf87624a623ca6de8a2bd864921e129fb848fff6.tar.gz clang-bf87624a623ca6de8a2bd864921e129fb848fff6.tar.bz2 clang-bf87624a623ca6de8a2bd864921e129fb848fff6.tar.xz |
[OPENMP] Parsing/Sema for OMPLasprivateClause.
Parsing this clause, allowing it on directive ‘omp simd’ and semantic checks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210184 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 c4717c8ea0..74a6a9eedc 100644 --- a/include/clang/AST/OpenMPClause.h +++ b/include/clang/AST/OpenMPClause.h @@ -620,6 +620,66 @@ public: } }; +/// \brief This represents clause 'lastprivate' in the '#pragma omp ...' +/// directives. +/// +/// \code +/// #pragma omp simd lastprivate(a,b) +/// \endcode +/// In this example directive '#pragma omp simd' has clause 'lastprivate' +/// with the variables 'a' and 'b'. +/// +class OMPLastprivateClause : public OMPVarListClause<OMPLastprivateClause> { + /// \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. + /// + OMPLastprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation EndLoc, unsigned N) + : OMPVarListClause<OMPLastprivateClause>(OMPC_lastprivate, StartLoc, + LParenLoc, EndLoc, N) {} + + /// \brief Build an empty clause. + /// + /// \param N Number of variables. + /// + explicit OMPLastprivateClause(unsigned N) + : OMPVarListClause<OMPLastprivateClause>( + OMPC_lastprivate, 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 OMPLastprivateClause * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation EndLoc, ArrayRef<Expr *> VL); + /// \brief Creates an empty clause with the place for \a N variables. + /// + /// \param C AST context. + /// \param N The number of variables. + /// + static OMPLastprivateClause *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_lastprivate; + } +}; + /// \brief This represents clause 'shared' in the '#pragma omp ...' directives. /// /// \code |