1651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines//===- StmtOpenMP.h - Classes for OpenMP directives  ------------*- C++ -*-===//
24fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev//
34fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev//                     The LLVM Compiler Infrastructure
44fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev//
54fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev// This file is distributed under the University of Illinois Open Source
64fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev// License. See LICENSE.TXT for details.
74fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev//
84fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev//===----------------------------------------------------------------------===//
94fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev/// \file
104fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev/// \brief This file defines OpenMP AST classes for executable directives and
114fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev/// clauses.
124fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev///
134fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev//===----------------------------------------------------------------------===//
144fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
154fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev#ifndef LLVM_CLANG_AST_STMTOPENMP_H
164fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev#define LLVM_CLANG_AST_STMTOPENMP_H
174fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
184fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev#include "clang/AST/Expr.h"
19651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines#include "clang/AST/OpenMPClause.h"
204fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev#include "clang/AST/Stmt.h"
21651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines#include "clang/Basic/OpenMPKinds.h"
22651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines#include "clang/Basic/SourceLocation.h"
234fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
244fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataevnamespace clang {
254fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
264fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev//===----------------------------------------------------------------------===//
274fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev// AST classes for directives.
284fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev//===----------------------------------------------------------------------===//
294fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
304fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev/// \brief This is a basic class for representing single OpenMP executable
314fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev/// directive.
324fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev///
334fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataevclass OMPExecutableDirective : public Stmt {
344fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  friend class ASTStmtReader;
354fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Kind of the directive.
364fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  OpenMPDirectiveKind Kind;
374fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Starting location of the directive (directive keyword).
384fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  SourceLocation StartLoc;
394fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Ending location of the directive.
404fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  SourceLocation EndLoc;
41651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \brief Numbers of clauses.
42651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  const unsigned NumClauses;
43651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \brief Number of child expressions/stmts.
44651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  const unsigned NumChildren;
45651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \brief Offset from this to the start of clauses.
46651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// There are NumClauses pointers to clauses, they are followed by
47651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// NumChildren pointers to child stmts/exprs (if the directive type
48651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// requires an associated stmt, then it has to be the first of them).
49651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  const unsigned ClausesOffset;
50651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines
51651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \brief Get the clauses storage.
52ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  MutableArrayRef<OMPClause *> getClauses() {
53651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines    OMPClause **ClauseStorage = reinterpret_cast<OMPClause **>(
54651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines        reinterpret_cast<char *>(this) + ClausesOffset);
55ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    return MutableArrayRef<OMPClause *>(ClauseStorage, NumClauses);
56651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  }
57651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines
584fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataevprotected:
594fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Build instance of directive of class \a K.
604fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
614fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \param SC Statement class.
624fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \param K Kind of OpenMP directive.
637a8918fe69d419c41956a7245874b0196e03127bNAKAMURA Takumi  /// \param StartLoc Starting location of the directive (directive keyword).
647a8918fe69d419c41956a7245874b0196e03127bNAKAMURA Takumi  /// \param EndLoc Ending location of the directive.
654fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
664fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  template <typename T>
674fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  OMPExecutableDirective(const T *, StmtClass SC, OpenMPDirectiveKind K,
684fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev                         SourceLocation StartLoc, SourceLocation EndLoc,
69651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines                         unsigned NumClauses, unsigned NumChildren)
70ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      : Stmt(SC), Kind(K), StartLoc(std::move(StartLoc)),
71ef8225444452a1486bd721f3285301fe84643b00Stephen Hines        EndLoc(std::move(EndLoc)), NumClauses(NumClauses),
72ef8225444452a1486bd721f3285301fe84643b00Stephen Hines        NumChildren(NumChildren),
73651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines        ClausesOffset(llvm::RoundUpToAlignment(sizeof(T),
74651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines                                               llvm::alignOf<OMPClause *>())) {}
754fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
764fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Sets the list of variables for this clause.
774fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
784fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \param Clauses The list of clauses for the directive.
794fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
804fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  void setClauses(ArrayRef<OMPClause *> Clauses);
814fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
824fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Set the associated statement for the directive.
834fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
844fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// /param S Associated statement.
854fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
86651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  void setAssociatedStmt(Stmt *S) { *child_begin() = S; }
874fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
884fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataevpublic:
89ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Iterates over a filtered subrange of clauses applied to a
90ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// directive.
91ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
92ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// This iterator visits only those declarations that meet some run-time
93ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// criteria.
94ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  template <class FilterPredicate> class filtered_clause_iterator {
95ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    ArrayRef<OMPClause *>::const_iterator Current;
96ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    ArrayRef<OMPClause *>::const_iterator End;
97ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    FilterPredicate Pred;
98ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    void SkipToNextClause() {
99ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      while (Current != End && !Pred(*Current))
100ef8225444452a1486bd721f3285301fe84643b00Stephen Hines        ++Current;
101ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    }
102ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
103ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  public:
104ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    typedef const OMPClause *value_type;
105ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    filtered_clause_iterator() : Current(), End() {}
106ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    filtered_clause_iterator(ArrayRef<OMPClause *> Arr, FilterPredicate Pred)
107ef8225444452a1486bd721f3285301fe84643b00Stephen Hines        : Current(Arr.begin()), End(Arr.end()), Pred(Pred) {
108ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      SkipToNextClause();
109ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    }
110ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    value_type operator*() const { return *Current; }
111ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    value_type operator->() const { return *Current; }
112ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    filtered_clause_iterator &operator++() {
113ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      ++Current;
114ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      SkipToNextClause();
115ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      return *this;
116ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    }
117ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
118ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    filtered_clause_iterator operator++(int) {
119ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      filtered_clause_iterator tmp(*this);
120ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      ++(*this);
121ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      return tmp;
122ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    }
123ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
124ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    bool operator!() { return Current == End; }
125ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    operator bool() { return Current != End; }
126ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  };
127ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
1284fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Returns starting location of directive kind.
1294fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  SourceLocation getLocStart() const { return StartLoc; }
1304fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Returns ending location of directive.
1314fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  SourceLocation getLocEnd() const { return EndLoc; }
1324fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
1334fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Set starting location of directive kind.
1344fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
1354fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \param Loc New starting location of directive.
1364fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
1374fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  void setLocStart(SourceLocation Loc) { StartLoc = Loc; }
1384fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Set ending location of directive.
1394fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
1404fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \param Loc New ending location of directive.
1414fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
1424fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  void setLocEnd(SourceLocation Loc) { EndLoc = Loc; }
1434fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
1444fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Get number of clauses.
145651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  unsigned getNumClauses() const { return NumClauses; }
1464fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
1474fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Returns specified clause.
1484fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
1494fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \param i Number of clause.
1504fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
151651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  OMPClause *getClause(unsigned i) const { return clauses()[i]; }
1524fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
1534fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Returns statement associated with the directive.
154651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  Stmt *getAssociatedStmt() const { return const_cast<Stmt *>(*child_begin()); }
1554fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
1564fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  OpenMPDirectiveKind getDirectiveKind() const { return Kind; }
1574fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
1584fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  static bool classof(const Stmt *S) {
1594fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev    return S->getStmtClass() >= firstOMPExecutableDirectiveConstant &&
1604fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev           S->getStmtClass() <= lastOMPExecutableDirectiveConstant;
1614fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  }
1624fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
1634fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  child_range children() {
164651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines    Stmt **ChildStorage = reinterpret_cast<Stmt **>(getClauses().end());
165651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines    return child_range(ChildStorage, ChildStorage + NumChildren);
1664fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  }
1674fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
168651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  ArrayRef<OMPClause *> clauses() { return getClauses(); }
1694fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
170651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  ArrayRef<OMPClause *> clauses() const {
171651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines    return const_cast<OMPExecutableDirective *>(this)->getClauses();
172651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  }
1734fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev};
1744fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
1754fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev/// \brief This represents '#pragma omp parallel' directive.
1764fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev///
1774fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev/// \code
1784fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev/// #pragma omp parallel private(a,b) reduction(+: c,d)
1794fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev/// \endcode
1804fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev/// In this example directive '#pragma omp parallel' has clauses 'private'
1814fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev/// with the variables 'a' and 'b' and 'reduction' with operator '+' and
1824fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev/// variables 'c' and 'd'.
1834fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev///
1844fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataevclass OMPParallelDirective : public OMPExecutableDirective {
1854fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Build directive with the given start and end location.
1864fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
1877a8918fe69d419c41956a7245874b0196e03127bNAKAMURA Takumi  /// \param StartLoc Starting location of the directive (directive keyword).
1884fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \param EndLoc Ending Location of the directive.
1894fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
1904fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  OMPParallelDirective(SourceLocation StartLoc, SourceLocation EndLoc,
191651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines                       unsigned NumClauses)
192651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines      : OMPExecutableDirective(this, OMPParallelDirectiveClass, OMPD_parallel,
193651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines                               StartLoc, EndLoc, NumClauses, 1) {}
1944fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
1954fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Build an empty directive.
1964fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
197651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \param NumClauses Number of clauses.
1984fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
199651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  explicit OMPParallelDirective(unsigned NumClauses)
200651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines      : OMPExecutableDirective(this, OMPParallelDirectiveClass, OMPD_parallel,
201651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines                               SourceLocation(), SourceLocation(), NumClauses,
202651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines                               1) {}
203651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines
2044fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataevpublic:
2054fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Creates directive with a list of \a Clauses.
2064fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
2074fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \param C AST context.
2084fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \param StartLoc Starting location of the directive kind.
2094fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \param EndLoc Ending Location of the directive.
2104fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \param Clauses List of clauses.
2114fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \param AssociatedStmt Statement associated with the directive.
2124fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
213651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  static OMPParallelDirective *
214651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
215651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2164fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
2174fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \brief Creates an empty directive with the place for \a N clauses.
2184fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
2194fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  /// \param C AST context.
220651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \param NumClauses Number of clauses.
2214fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  ///
222651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  static OMPParallelDirective *CreateEmpty(const ASTContext &C,
223651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines                                           unsigned NumClauses, EmptyShell);
2244fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
2254fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  static bool classof(const Stmt *T) {
2264fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev    return T->getStmtClass() == OMPParallelDirectiveClass;
2274fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev  }
2284fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev};
2294fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
230651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines/// \brief This represents '#pragma omp simd' directive.
231651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines///
232651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines/// \code
233651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines/// #pragma omp simd private(a,b) linear(i,j:s) reduction(+:c,d)
234651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines/// \endcode
235651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines/// In this example directive '#pragma omp simd' has clauses 'private'
236651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines/// with the variables 'a' and 'b', 'linear' with variables 'i', 'j' and
237651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines/// linear step 's', 'reduction' with operator '+' and variables 'c' and 'd'.
238651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines///
239651f13cea278ec967336033dd032faef0e9fc2ecStephen Hinesclass OMPSimdDirective : public OMPExecutableDirective {
240651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  friend class ASTStmtReader;
241651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \brief Number of collapsed loops as specified by 'collapse' clause.
242651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  unsigned CollapsedNum;
243651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \brief Build directive with the given start and end location.
244651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  ///
245651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \param StartLoc Starting location of the directive kind.
246651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \param EndLoc Ending location of the directive.
247651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \param CollapsedNum Number of collapsed nested loops.
248651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \param NumClauses Number of clauses.
249651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  ///
250651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  OMPSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
251651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines                   unsigned CollapsedNum, unsigned NumClauses)
252651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines      : OMPExecutableDirective(this, OMPSimdDirectiveClass, OMPD_simd, StartLoc,
253651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines                               EndLoc, NumClauses, 1),
254651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines        CollapsedNum(CollapsedNum) {}
255651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines
256651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \brief Build an empty directive.
257651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  ///
258651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \param CollapsedNum Number of collapsed nested loops.
259651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \param NumClauses Number of clauses.
260651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  ///
261651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  explicit OMPSimdDirective(unsigned CollapsedNum, unsigned NumClauses)
262651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines      : OMPExecutableDirective(this, OMPSimdDirectiveClass, OMPD_simd,
263651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines                               SourceLocation(), SourceLocation(), NumClauses,
264651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines                               1),
265651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines        CollapsedNum(CollapsedNum) {}
266651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines
267651f13cea278ec967336033dd032faef0e9fc2ecStephen Hinespublic:
268651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \brief Creates directive with a list of \a Clauses.
269651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  ///
270651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \param C AST context.
271651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \param StartLoc Starting location of the directive kind.
272651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \param EndLoc Ending Location of the directive.
273ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param CollapsedNum Number of collapsed loops.
274651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \param Clauses List of clauses.
275651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \param AssociatedStmt Statement, associated with the directive.
276651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  ///
277651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  static OMPSimdDirective *Create(const ASTContext &C, SourceLocation StartLoc,
278ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                                  SourceLocation EndLoc, unsigned CollapsedNum,
279651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines                                  ArrayRef<OMPClause *> Clauses,
280651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines                                  Stmt *AssociatedStmt);
281651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines
282651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \brief Creates an empty directive with the place
283651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// for \a NumClauses clauses.
284651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  ///
285651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \param C AST context.
286651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \param CollapsedNum Number of collapsed nested loops.
287651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  /// \param NumClauses Number of clauses.
288651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  ///
289651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  static OMPSimdDirective *CreateEmpty(const ASTContext &C, unsigned NumClauses,
290651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines                                       unsigned CollapsedNum, EmptyShell);
291651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines
292651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  unsigned getCollapsedNumber() const { return CollapsedNum; }
293651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines
294651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  static bool classof(const Stmt *T) {
295651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines    return T->getStmtClass() == OMPSimdDirectiveClass;
296651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  }
297651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines};
298651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines
299ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \brief This represents '#pragma omp for' directive.
300ef8225444452a1486bd721f3285301fe84643b00Stephen Hines///
301ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \code
302ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// #pragma omp for private(a,b) reduction(+:c,d)
303ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \endcode
304ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// In this example directive '#pragma omp for' has clauses 'private' with the
305ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// variables 'a' and 'b' and 'reduction' with operator '+' and variables 'c'
306ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// and 'd'.
307ef8225444452a1486bd721f3285301fe84643b00Stephen Hines///
308ef8225444452a1486bd721f3285301fe84643b00Stephen Hinesclass OMPForDirective : public OMPExecutableDirective {
309ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  friend class ASTStmtReader;
310ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Number of collapsed loops as specified by 'collapse' clause.
311ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  unsigned CollapsedNum;
312ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Build directive with the given start and end location.
313ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
314ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param StartLoc Starting location of the directive kind.
315ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param EndLoc Ending location of the directive.
316ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param CollapsedNum Number of collapsed nested loops.
317ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param NumClauses Number of clauses.
318ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
319ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  OMPForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
320ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                  unsigned CollapsedNum, unsigned NumClauses)
321ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      : OMPExecutableDirective(this, OMPForDirectiveClass, OMPD_for, StartLoc,
322ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               EndLoc, NumClauses, 1),
323ef8225444452a1486bd721f3285301fe84643b00Stephen Hines        CollapsedNum(CollapsedNum) {}
324ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
325ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Build an empty directive.
326ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
327ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param CollapsedNum Number of collapsed nested loops.
328ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param NumClauses Number of clauses.
329ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
330ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  explicit OMPForDirective(unsigned CollapsedNum, unsigned NumClauses)
331ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      : OMPExecutableDirective(this, OMPForDirectiveClass, OMPD_for,
332ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               SourceLocation(), SourceLocation(), NumClauses,
333ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               1),
334ef8225444452a1486bd721f3285301fe84643b00Stephen Hines        CollapsedNum(CollapsedNum) {}
335ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
336ef8225444452a1486bd721f3285301fe84643b00Stephen Hinespublic:
337ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Creates directive with a list of \a Clauses.
338ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
339ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param C AST context.
340ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param StartLoc Starting location of the directive kind.
341ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param EndLoc Ending Location of the directive.
342ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param CollapsedNum Number of collapsed loops.
343ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param Clauses List of clauses.
344ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param AssociatedStmt Statement, associated with the directive.
345ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
346ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static OMPForDirective *Create(const ASTContext &C, SourceLocation StartLoc,
347ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                                 SourceLocation EndLoc, unsigned CollapsedNum,
348ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                                 ArrayRef<OMPClause *> Clauses,
349ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                                 Stmt *AssociatedStmt);
350ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
351ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Creates an empty directive with the place
352ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// for \a NumClauses clauses.
353ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
354ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param C AST context.
355ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param CollapsedNum Number of collapsed nested loops.
356ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param NumClauses Number of clauses.
357ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
358ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static OMPForDirective *CreateEmpty(const ASTContext &C, unsigned NumClauses,
359ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                                      unsigned CollapsedNum, EmptyShell);
360ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
361ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  unsigned getCollapsedNumber() const { return CollapsedNum; }
362ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
363ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static bool classof(const Stmt *T) {
364ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    return T->getStmtClass() == OMPForDirectiveClass;
365ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  }
366ef8225444452a1486bd721f3285301fe84643b00Stephen Hines};
367ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
368ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \brief This represents '#pragma omp sections' directive.
369ef8225444452a1486bd721f3285301fe84643b00Stephen Hines///
370ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \code
371ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// #pragma omp sections private(a,b) reduction(+:c,d)
372ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \endcode
373ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// In this example directive '#pragma omp sections' has clauses 'private' with
374ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// the variables 'a' and 'b' and 'reduction' with operator '+' and variables
375ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// 'c' and 'd'.
376ef8225444452a1486bd721f3285301fe84643b00Stephen Hines///
377ef8225444452a1486bd721f3285301fe84643b00Stephen Hinesclass OMPSectionsDirective : public OMPExecutableDirective {
378ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  friend class ASTStmtReader;
379ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Build directive with the given start and end location.
380ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
381ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param StartLoc Starting location of the directive kind.
382ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param EndLoc Ending location of the directive.
383ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param NumClauses Number of clauses.
384ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
385ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  OMPSectionsDirective(SourceLocation StartLoc, SourceLocation EndLoc,
386ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                       unsigned NumClauses)
387ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      : OMPExecutableDirective(this, OMPSectionsDirectiveClass, OMPD_sections,
388ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               StartLoc, EndLoc, NumClauses, 1) {}
389ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
390ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Build an empty directive.
391ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
392ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param NumClauses Number of clauses.
393ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
394ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  explicit OMPSectionsDirective(unsigned NumClauses)
395ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      : OMPExecutableDirective(this, OMPSectionsDirectiveClass, OMPD_sections,
396ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               SourceLocation(), SourceLocation(), NumClauses,
397ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               1) {}
398ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
399ef8225444452a1486bd721f3285301fe84643b00Stephen Hinespublic:
400ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Creates directive with a list of \a Clauses.
401ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
402ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param C AST context.
403ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param StartLoc Starting location of the directive kind.
404ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param EndLoc Ending Location of the directive.
405ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param Clauses List of clauses.
406ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param AssociatedStmt Statement, associated with the directive.
407ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
408ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static OMPSectionsDirective *
409ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
410ef8225444452a1486bd721f3285301fe84643b00Stephen Hines         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
411ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
412ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Creates an empty directive with the place for \a NumClauses
413ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// clauses.
414ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
415ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param C AST context.
416ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param NumClauses Number of clauses.
417ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
418ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static OMPSectionsDirective *CreateEmpty(const ASTContext &C,
419ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                                           unsigned NumClauses, EmptyShell);
420ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
421ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static bool classof(const Stmt *T) {
422ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    return T->getStmtClass() == OMPSectionsDirectiveClass;
423ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  }
424ef8225444452a1486bd721f3285301fe84643b00Stephen Hines};
425ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
426ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \brief This represents '#pragma omp section' directive.
427ef8225444452a1486bd721f3285301fe84643b00Stephen Hines///
428ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \code
429ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// #pragma omp section
430ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \endcode
431ef8225444452a1486bd721f3285301fe84643b00Stephen Hines///
432ef8225444452a1486bd721f3285301fe84643b00Stephen Hinesclass OMPSectionDirective : public OMPExecutableDirective {
433ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  friend class ASTStmtReader;
434ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Build directive with the given start and end location.
435ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
436ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param StartLoc Starting location of the directive kind.
437ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param EndLoc Ending location of the directive.
438ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
439ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  OMPSectionDirective(SourceLocation StartLoc, SourceLocation EndLoc)
440ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      : OMPExecutableDirective(this, OMPSectionDirectiveClass, OMPD_section,
441ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               StartLoc, EndLoc, 0, 1) {}
442ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
443ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Build an empty directive.
444ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
445ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  explicit OMPSectionDirective()
446ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      : OMPExecutableDirective(this, OMPSectionDirectiveClass, OMPD_section,
447ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               SourceLocation(), SourceLocation(), 0, 1) {}
448ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
449ef8225444452a1486bd721f3285301fe84643b00Stephen Hinespublic:
450ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Creates directive.
451ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
452ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param C AST context.
453ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param StartLoc Starting location of the directive kind.
454ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param EndLoc Ending Location of the directive.
455ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param AssociatedStmt Statement, associated with the directive.
456ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
457ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static OMPSectionDirective *Create(const ASTContext &C,
458ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                                     SourceLocation StartLoc,
459ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                                     SourceLocation EndLoc,
460ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                                     Stmt *AssociatedStmt);
461ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
462ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Creates an empty directive.
463ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
464ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param C AST context.
465ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
466ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static OMPSectionDirective *CreateEmpty(const ASTContext &C, EmptyShell);
467ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
468ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static bool classof(const Stmt *T) {
469ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    return T->getStmtClass() == OMPSectionDirectiveClass;
470ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  }
471ef8225444452a1486bd721f3285301fe84643b00Stephen Hines};
472ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
473ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \brief This represents '#pragma omp single' directive.
474ef8225444452a1486bd721f3285301fe84643b00Stephen Hines///
475ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \code
476ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// #pragma omp single private(a,b) copyprivate(c,d)
477ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \endcode
478ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// In this example directive '#pragma omp single' has clauses 'private' with
479ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// the variables 'a' and 'b' and 'copyprivate' with variables 'c' and 'd'.
480ef8225444452a1486bd721f3285301fe84643b00Stephen Hines///
481ef8225444452a1486bd721f3285301fe84643b00Stephen Hinesclass OMPSingleDirective : public OMPExecutableDirective {
482ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  friend class ASTStmtReader;
483ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Build directive with the given start and end location.
484ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
485ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param StartLoc Starting location of the directive kind.
486ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param EndLoc Ending location of the directive.
487ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param NumClauses Number of clauses.
488ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
489ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  OMPSingleDirective(SourceLocation StartLoc, SourceLocation EndLoc,
490ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                     unsigned NumClauses)
491ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      : OMPExecutableDirective(this, OMPSingleDirectiveClass, OMPD_single,
492ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               StartLoc, EndLoc, NumClauses, 1) {}
493ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
494ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Build an empty directive.
495ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
496ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param NumClauses Number of clauses.
497ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
498ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  explicit OMPSingleDirective(unsigned NumClauses)
499ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      : OMPExecutableDirective(this, OMPSingleDirectiveClass, OMPD_single,
500ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               SourceLocation(), SourceLocation(), NumClauses,
501ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               1) {}
502ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
503ef8225444452a1486bd721f3285301fe84643b00Stephen Hinespublic:
504ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Creates directive with a list of \a Clauses.
505ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
506ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param C AST context.
507ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param StartLoc Starting location of the directive kind.
508ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param EndLoc Ending Location of the directive.
509ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param Clauses List of clauses.
510ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param AssociatedStmt Statement, associated with the directive.
511ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
512ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static OMPSingleDirective *
513ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
514ef8225444452a1486bd721f3285301fe84643b00Stephen Hines         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
515ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
516ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Creates an empty directive with the place for \a NumClauses
517ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// clauses.
518ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
519ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param C AST context.
520ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param NumClauses Number of clauses.
521ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
522ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static OMPSingleDirective *CreateEmpty(const ASTContext &C,
523ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                                         unsigned NumClauses, EmptyShell);
524ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
525ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static bool classof(const Stmt *T) {
526ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    return T->getStmtClass() == OMPSingleDirectiveClass;
527ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  }
528ef8225444452a1486bd721f3285301fe84643b00Stephen Hines};
529ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
530ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \brief This represents '#pragma omp parallel for' directive.
531ef8225444452a1486bd721f3285301fe84643b00Stephen Hines///
532ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \code
533ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// #pragma omp parallel for private(a,b) reduction(+:c,d)
534ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \endcode
535ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// In this example directive '#pragma omp parallel for' has clauses 'private'
536ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// with the variables 'a' and 'b' and 'reduction' with operator '+' and
537ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// variables 'c' and 'd'.
538ef8225444452a1486bd721f3285301fe84643b00Stephen Hines///
539ef8225444452a1486bd721f3285301fe84643b00Stephen Hinesclass OMPParallelForDirective : public OMPExecutableDirective {
540ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  friend class ASTStmtReader;
541ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Number of collapsed loops as specified by 'collapse' clause.
542ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  unsigned CollapsedNum;
543ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Build directive with the given start and end location.
544ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
545ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param StartLoc Starting location of the directive kind.
546ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param EndLoc Ending location of the directive.
547ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param CollapsedNum Number of collapsed nested loops.
548ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param NumClauses Number of clauses.
549ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
550ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  OMPParallelForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
551ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                          unsigned CollapsedNum, unsigned NumClauses)
552ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      : OMPExecutableDirective(this, OMPParallelForDirectiveClass,
553ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               OMPD_parallel_for, StartLoc, EndLoc, NumClauses,
554ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               1),
555ef8225444452a1486bd721f3285301fe84643b00Stephen Hines        CollapsedNum(CollapsedNum) {}
556ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
557ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Build an empty directive.
558ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
559ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param CollapsedNum Number of collapsed nested loops.
560ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param NumClauses Number of clauses.
561ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
562ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  explicit OMPParallelForDirective(unsigned CollapsedNum, unsigned NumClauses)
563ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      : OMPExecutableDirective(this, OMPParallelForDirectiveClass,
564ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               OMPD_parallel_for, SourceLocation(),
565ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               SourceLocation(), NumClauses, 1),
566ef8225444452a1486bd721f3285301fe84643b00Stephen Hines        CollapsedNum(CollapsedNum) {}
567ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
568ef8225444452a1486bd721f3285301fe84643b00Stephen Hinespublic:
569ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Creates directive with a list of \a Clauses.
570ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
571ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param C AST context.
572ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param StartLoc Starting location of the directive kind.
573ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param EndLoc Ending Location of the directive.
574ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param CollapsedNum Number of collapsed loops.
575ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param Clauses List of clauses.
576ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param AssociatedStmt Statement, associated with the directive.
577ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
578ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static OMPParallelForDirective *
579ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
580ef8225444452a1486bd721f3285301fe84643b00Stephen Hines         unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
581ef8225444452a1486bd721f3285301fe84643b00Stephen Hines         Stmt *AssociatedStmt);
582ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
583ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Creates an empty directive with the place
584ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// for \a NumClauses clauses.
585ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
586ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param C AST context.
587ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param CollapsedNum Number of collapsed nested loops.
588ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param NumClauses Number of clauses.
589ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
590ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static OMPParallelForDirective *CreateEmpty(const ASTContext &C,
591ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                                              unsigned NumClauses,
592ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                                              unsigned CollapsedNum,
593ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                                              EmptyShell);
594ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
595ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  unsigned getCollapsedNumber() const { return CollapsedNum; }
596ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
597ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static bool classof(const Stmt *T) {
598ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    return T->getStmtClass() == OMPParallelForDirectiveClass;
599ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  }
600ef8225444452a1486bd721f3285301fe84643b00Stephen Hines};
601ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
602ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \brief This represents '#pragma omp parallel sections' directive.
603ef8225444452a1486bd721f3285301fe84643b00Stephen Hines///
604ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \code
605ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// #pragma omp parallel sections private(a,b) reduction(+:c,d)
606ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// \endcode
607ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// In this example directive '#pragma omp parallel sections' has clauses
608ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// 'private' with the variables 'a' and 'b' and 'reduction' with operator '+'
609ef8225444452a1486bd721f3285301fe84643b00Stephen Hines/// and variables 'c' and 'd'.
610ef8225444452a1486bd721f3285301fe84643b00Stephen Hines///
611ef8225444452a1486bd721f3285301fe84643b00Stephen Hinesclass OMPParallelSectionsDirective : public OMPExecutableDirective {
612ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  friend class ASTStmtReader;
613ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Build directive with the given start and end location.
614ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
615ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param StartLoc Starting location of the directive kind.
616ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param EndLoc Ending location of the directive.
617ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param NumClauses Number of clauses.
618ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
619ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  OMPParallelSectionsDirective(SourceLocation StartLoc, SourceLocation EndLoc,
620ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               unsigned NumClauses)
621ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      : OMPExecutableDirective(this, OMPParallelSectionsDirectiveClass,
622ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               OMPD_parallel_sections, StartLoc, EndLoc,
623ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               NumClauses, 1) {}
624ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
625ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Build an empty directive.
626ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
627ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param NumClauses Number of clauses.
628ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
629ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  explicit OMPParallelSectionsDirective(unsigned NumClauses)
630ef8225444452a1486bd721f3285301fe84643b00Stephen Hines      : OMPExecutableDirective(this, OMPParallelSectionsDirectiveClass,
631ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               OMPD_parallel_sections, SourceLocation(),
632ef8225444452a1486bd721f3285301fe84643b00Stephen Hines                               SourceLocation(), NumClauses, 1) {}
633ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
634ef8225444452a1486bd721f3285301fe84643b00Stephen Hinespublic:
635ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Creates directive with a list of \a Clauses.
636ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
637ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param C AST context.
638ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param StartLoc Starting location of the directive kind.
639ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param EndLoc Ending Location of the directive.
640ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param Clauses List of clauses.
641ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param AssociatedStmt Statement, associated with the directive.
642ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
643ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static OMPParallelSectionsDirective *
644ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
645ef8225444452a1486bd721f3285301fe84643b00Stephen Hines         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
646ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
647ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \brief Creates an empty directive with the place for \a NumClauses
648ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// clauses.
649ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
650ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param C AST context.
651ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  /// \param NumClauses Number of clauses.
652ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  ///
653ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static OMPParallelSectionsDirective *
654ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell);
655ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
656ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  static bool classof(const Stmt *T) {
657ef8225444452a1486bd721f3285301fe84643b00Stephen Hines    return T->getStmtClass() == OMPParallelSectionsDirectiveClass;
658ef8225444452a1486bd721f3285301fe84643b00Stephen Hines  }
659ef8225444452a1486bd721f3285301fe84643b00Stephen Hines};
660ef8225444452a1486bd721f3285301fe84643b00Stephen Hines
661651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines} // end namespace clang
6624fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev
6634fa7eab771ab8212e1058bd1a91061ff120c8fbbAlexey Bataev#endif
664