@@ -6911,6 +6911,80 @@ class OMPDetachClause final : public OMPClause {
69116911 }
69126912};
69136913
6914+ // / This represents clause 'inclusive' in the '#pragma omp scan' directive.
6915+ // /
6916+ // / \code
6917+ // / #pragma omp scan inclusive(a,b)
6918+ // / \endcode
6919+ // / In this example directive '#pragma omp scan' has clause 'inclusive'
6920+ // / with the variables 'a' and 'b'.
6921+ class OMPInclusiveClause final
6922+ : public OMPVarListClause<OMPInclusiveClause>,
6923+ private llvm::TrailingObjects<OMPInclusiveClause, Expr *> {
6924+ friend class OMPClauseReader ;
6925+ friend OMPVarListClause;
6926+ friend TrailingObjects;
6927+
6928+ // / Build clause with number of variables \a N.
6929+ // /
6930+ // / \param StartLoc Starting location of the clause.
6931+ // / \param LParenLoc Location of '('.
6932+ // / \param EndLoc Ending location of the clause.
6933+ // / \param N Number of the variables in the clause.
6934+ OMPInclusiveClause (SourceLocation StartLoc, SourceLocation LParenLoc,
6935+ SourceLocation EndLoc, unsigned N)
6936+ : OMPVarListClause<OMPInclusiveClause>(OMPC_inclusive, StartLoc,
6937+ LParenLoc, EndLoc, N) {}
6938+
6939+ // / Build an empty clause.
6940+ // /
6941+ // / \param N Number of variables.
6942+ explicit OMPInclusiveClause (unsigned N)
6943+ : OMPVarListClause<OMPInclusiveClause>(OMPC_inclusive, SourceLocation(),
6944+ SourceLocation(), SourceLocation(),
6945+ N) {}
6946+
6947+ public:
6948+ // / Creates clause with a list of variables \a VL.
6949+ // /
6950+ // / \param C AST context.
6951+ // / \param StartLoc Starting location of the clause.
6952+ // / \param LParenLoc Location of '('.
6953+ // / \param EndLoc Ending location of the clause.
6954+ // / \param VL List of references to the original variables.
6955+ static OMPInclusiveClause *Create (const ASTContext &C,
6956+ SourceLocation StartLoc,
6957+ SourceLocation LParenLoc,
6958+ SourceLocation EndLoc, ArrayRef<Expr *> VL);
6959+
6960+ // / Creates an empty clause with the place for \a N variables.
6961+ // /
6962+ // / \param C AST context.
6963+ // / \param N The number of variables.
6964+ static OMPInclusiveClause *CreateEmpty (const ASTContext &C, unsigned N);
6965+
6966+ child_range children () {
6967+ return child_range (reinterpret_cast <Stmt **>(varlist_begin ()),
6968+ reinterpret_cast <Stmt **>(varlist_end ()));
6969+ }
6970+
6971+ const_child_range children () const {
6972+ auto Children = const_cast <OMPInclusiveClause *>(this )->children ();
6973+ return const_child_range (Children.begin (), Children.end ());
6974+ }
6975+
6976+ child_range used_children () {
6977+ return child_range (child_iterator (), child_iterator ());
6978+ }
6979+ const_child_range used_children () const {
6980+ return const_child_range (const_child_iterator (), const_child_iterator ());
6981+ }
6982+
6983+ static bool classof (const OMPClause *T) {
6984+ return T->getClauseKind () == OMPC_inclusive;
6985+ }
6986+ };
6987+
69146988// / This class implements a simple visitor for OMPClause
69156989// / subclasses.
69166990template <class ImplClass , template <typename > class Ptr , typename RetTy>
0 commit comments