@@ -6985,6 +6985,80 @@ class OMPInclusiveClause final
69856985 }
69866986};
69876987
6988+ // / This represents clause 'exclusive' in the '#pragma omp scan' directive.
6989+ // /
6990+ // / \code
6991+ // / #pragma omp scan exclusive(a,b)
6992+ // / \endcode
6993+ // / In this example directive '#pragma omp scan' has clause 'exclusive'
6994+ // / with the variables 'a' and 'b'.
6995+ class OMPExclusiveClause final
6996+ : public OMPVarListClause<OMPExclusiveClause>,
6997+ private llvm::TrailingObjects<OMPExclusiveClause, Expr *> {
6998+ friend class OMPClauseReader ;
6999+ friend OMPVarListClause;
7000+ friend TrailingObjects;
7001+
7002+ // / Build clause with number of variables \a N.
7003+ // /
7004+ // / \param StartLoc Starting location of the clause.
7005+ // / \param LParenLoc Location of '('.
7006+ // / \param EndLoc Ending location of the clause.
7007+ // / \param N Number of the variables in the clause.
7008+ OMPExclusiveClause (SourceLocation StartLoc, SourceLocation LParenLoc,
7009+ SourceLocation EndLoc, unsigned N)
7010+ : OMPVarListClause<OMPExclusiveClause>(OMPC_exclusive, StartLoc,
7011+ LParenLoc, EndLoc, N) {}
7012+
7013+ // / Build an empty clause.
7014+ // /
7015+ // / \param N Number of variables.
7016+ explicit OMPExclusiveClause (unsigned N)
7017+ : OMPVarListClause<OMPExclusiveClause>(OMPC_exclusive, SourceLocation(),
7018+ SourceLocation(), SourceLocation(),
7019+ N) {}
7020+
7021+ public:
7022+ // / Creates clause with a list of variables \a VL.
7023+ // /
7024+ // / \param C AST context.
7025+ // / \param StartLoc Starting location of the clause.
7026+ // / \param LParenLoc Location of '('.
7027+ // / \param EndLoc Ending location of the clause.
7028+ // / \param VL List of references to the original variables.
7029+ static OMPExclusiveClause *Create (const ASTContext &C,
7030+ SourceLocation StartLoc,
7031+ SourceLocation LParenLoc,
7032+ SourceLocation EndLoc, ArrayRef<Expr *> VL);
7033+
7034+ // / Creates an empty clause with the place for \a N variables.
7035+ // /
7036+ // / \param C AST context.
7037+ // / \param N The number of variables.
7038+ static OMPExclusiveClause *CreateEmpty (const ASTContext &C, unsigned N);
7039+
7040+ child_range children () {
7041+ return child_range (reinterpret_cast <Stmt **>(varlist_begin ()),
7042+ reinterpret_cast <Stmt **>(varlist_end ()));
7043+ }
7044+
7045+ const_child_range children () const {
7046+ auto Children = const_cast <OMPExclusiveClause *>(this )->children ();
7047+ return const_child_range (Children.begin (), Children.end ());
7048+ }
7049+
7050+ child_range used_children () {
7051+ return child_range (child_iterator (), child_iterator ());
7052+ }
7053+ const_child_range used_children () const {
7054+ return const_child_range (const_child_iterator (), const_child_iterator ());
7055+ }
7056+
7057+ static bool classof (const OMPClause *T) {
7058+ return T->getClauseKind () == OMPC_exclusive;
7059+ }
7060+ };
7061+
69887062// / This class implements a simple visitor for OMPClause
69897063// / subclasses.
69907064template <class ImplClass , template <typename > class Ptr , typename RetTy>
0 commit comments