Clang Project

clang_source_code/include/clang/AST/StmtOpenMP.h
1//===- StmtOpenMP.h - Classes for OpenMP directives  ------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8/// \file
9/// This file defines OpenMP AST classes for executable directives and
10/// clauses.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_AST_STMTOPENMP_H
15#define LLVM_CLANG_AST_STMTOPENMP_H
16
17#include "clang/AST/Expr.h"
18#include "clang/AST/OpenMPClause.h"
19#include "clang/AST/Stmt.h"
20#include "clang/Basic/OpenMPKinds.h"
21#include "clang/Basic/SourceLocation.h"
22
23namespace clang {
24
25//===----------------------------------------------------------------------===//
26// AST classes for directives.
27//===----------------------------------------------------------------------===//
28
29/// This is a basic class for representing single OpenMP executable
30/// directive.
31///
32class OMPExecutableDirective : public Stmt {
33  friend class ASTStmtReader;
34  /// Kind of the directive.
35  OpenMPDirectiveKind Kind;
36  /// Starting location of the directive (directive keyword).
37  SourceLocation StartLoc;
38  /// Ending location of the directive.
39  SourceLocation EndLoc;
40  /// Numbers of clauses.
41  const unsigned NumClauses;
42  /// Number of child expressions/stmts.
43  const unsigned NumChildren;
44  /// Offset from this to the start of clauses.
45  /// There are NumClauses pointers to clauses, they are followed by
46  /// NumChildren pointers to child stmts/exprs (if the directive type
47  /// requires an associated stmt, then it has to be the first of them).
48  const unsigned ClausesOffset;
49
50  /// Get the clauses storage.
51  MutableArrayRef<OMPClause *> getClauses() {
52    OMPClause **ClauseStorage = reinterpret_cast<OMPClause **>(
53        reinterpret_cast<char *>(this) + ClausesOffset);
54    return MutableArrayRef<OMPClause *>(ClauseStorage, NumClauses);
55  }
56
57protected:
58  /// Build instance of directive of class \a K.
59  ///
60  /// \param SC Statement class.
61  /// \param K Kind of OpenMP directive.
62  /// \param StartLoc Starting location of the directive (directive keyword).
63  /// \param EndLoc Ending location of the directive.
64  ///
65  template <typename T>
66  OMPExecutableDirective(const T *, StmtClass SCOpenMPDirectiveKind K,
67                         SourceLocation StartLocSourceLocation EndLoc,
68                         unsigned NumClausesunsigned NumChildren)
69      : Stmt(SC), Kind(K), StartLoc(std::move(StartLoc)),
70        EndLoc(std::move(EndLoc)), NumClauses(NumClauses),
71        NumChildren(NumChildren),
72        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
73
74  /// Sets the list of variables for this clause.
75  ///
76  /// \param Clauses The list of clauses for the directive.
77  ///
78  void setClauses(ArrayRef<OMPClause *> Clauses);
79
80  /// Set the associated statement for the directive.
81  ///
82  /// /param S Associated statement.
83  ///
84  void setAssociatedStmt(Stmt *S) {
85     (0) . __assert_fail ("hasAssociatedStmt() && \"no associated statement.\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 85, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(hasAssociatedStmt() && "no associated statement.");
86    *child_begin() = S;
87  }
88
89public:
90  /// Iterates over a filtered subrange of clauses applied to a
91  /// directive.
92  ///
93  /// This iterator visits only clauses of type SpecificClause.
94  template <typename SpecificClause>
95  class specific_clause_iterator
96      : public llvm::iterator_adaptor_base<
97            specific_clause_iterator<SpecificClause>,
98            ArrayRef<OMPClause *>::const_iterator, std::forward_iterator_tag,
99            const SpecificClause *, ptrdiff_t, const SpecificClause *,
100            const SpecificClause *> {
101    ArrayRef<OMPClause *>::const_iterator End;
102
103    void SkipToNextClause() {
104      while (this->I != End && !isa<SpecificClause>(*this->I))
105        ++this->I;
106    }
107
108  public:
109    explicit specific_clause_iterator(ArrayRef<OMPClause *> Clauses)
110        : specific_clause_iterator::iterator_adaptor_base(Clauses.begin()),
111          End(Clauses.end()) {
112      SkipToNextClause();
113    }
114
115    const SpecificClause *operator*() const {
116      return cast<SpecificClause>(*this->I);
117    }
118    const SpecificClause *operator->() const { return **this; }
119
120    specific_clause_iterator &operator++() {
121      ++this->I;
122      SkipToNextClause();
123      return *this;
124    }
125  };
126
127  template <typename SpecificClause>
128  static llvm::iterator_range<specific_clause_iterator<SpecificClause>>
129  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
130    return {specific_clause_iterator<SpecificClause>(Clauses),
131            specific_clause_iterator<SpecificClause>(
132                llvm::makeArrayRef(Clauses.end(), 0))};
133  }
134
135  template <typename SpecificClause>
136  llvm::iterator_range<specific_clause_iterator<SpecificClause>>
137  getClausesOfKind() const {
138    return getClausesOfKind<SpecificClause>(clauses());
139  }
140
141  /// Gets a single clause of the specified kind associated with the
142  /// current directive iff there is only one clause of this kind (and assertion
143  /// is fired if there is more than one clause is associated with the
144  /// directive). Returns nullptr if no clause of this kind is associated with
145  /// the directive.
146  template <typename SpecificClause>
147  const SpecificClause *getSingleClause() const {
148    auto Clauses = getClausesOfKind<SpecificClause>();
149
150    if (Clauses.begin() != Clauses.end()) {
151       (0) . __assert_fail ("std..next(Clauses.begin()) == Clauses.end() && \"There are at least 2 clauses of the specified kind\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 152, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(std::next(Clauses.begin()) == Clauses.end() &&
152 (0) . __assert_fail ("std..next(Clauses.begin()) == Clauses.end() && \"There are at least 2 clauses of the specified kind\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 152, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">             "There are at least 2 clauses of the specified kind");
153      return *Clauses.begin();
154    }
155    return nullptr;
156  }
157
158  /// Returns true if the current directive has one or more clauses of a
159  /// specific kind.
160  template <typename SpecificClause>
161  bool hasClausesOfKind() const {
162    auto Clauses = getClausesOfKind<SpecificClause>();
163    return Clauses.begin() != Clauses.end();
164  }
165
166  /// Returns starting location of directive kind.
167  SourceLocation getBeginLoc() const { return StartLoc; }
168  /// Returns ending location of directive.
169  SourceLocation getEndLoc() const { return EndLoc; }
170
171  /// Set starting location of directive kind.
172  ///
173  /// \param Loc New starting location of directive.
174  ///
175  void setLocStart(SourceLocation Loc) { StartLoc = Loc; }
176  /// Set ending location of directive.
177  ///
178  /// \param Loc New ending location of directive.
179  ///
180  void setLocEnd(SourceLocation Loc) { EndLoc = Loc; }
181
182  /// Get number of clauses.
183  unsigned getNumClauses() const { return NumClauses; }
184
185  /// Returns specified clause.
186  ///
187  /// \param i Number of clause.
188  ///
189  OMPClause *getClause(unsigned iconst { return clauses()[i]; }
190
191  /// Returns true if directive has associated statement.
192  bool hasAssociatedStmt() const { return NumChildren > 0; }
193
194  /// Returns statement associated with the directive.
195  const Stmt *getAssociatedStmt() const {
196     (0) . __assert_fail ("hasAssociatedStmt() && \"no associated statement.\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 196, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(hasAssociatedStmt() && "no associated statement.");
197    return *child_begin();
198  }
199  Stmt *getAssociatedStmt() {
200     (0) . __assert_fail ("hasAssociatedStmt() && \"no associated statement.\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 200, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(hasAssociatedStmt() && "no associated statement.");
201    return *child_begin();
202  }
203
204  /// Returns the captured statement associated with the
205  /// component region within the (combined) directive.
206  //
207  // \param RegionKind Component region kind.
208  const CapturedStmt *getCapturedStmt(OpenMPDirectiveKind RegionKindconst {
209    SmallVector<OpenMPDirectiveKind4CaptureRegions;
210    getOpenMPCaptureRegions(CaptureRegions, getDirectiveKind());
211     (0) . __assert_fail ("std..any_of( CaptureRegions.begin(), CaptureRegions.end(), [=](const OpenMPDirectiveKind K) { return K == RegionKind; }) && \"RegionKind not found in OpenMP CaptureRegions.\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 214, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(std::any_of(
212 (0) . __assert_fail ("std..any_of( CaptureRegions.begin(), CaptureRegions.end(), [=](const OpenMPDirectiveKind K) { return K == RegionKind; }) && \"RegionKind not found in OpenMP CaptureRegions.\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 214, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">               CaptureRegions.begin(), CaptureRegions.end(),
213 (0) . __assert_fail ("std..any_of( CaptureRegions.begin(), CaptureRegions.end(), [=](const OpenMPDirectiveKind K) { return K == RegionKind; }) && \"RegionKind not found in OpenMP CaptureRegions.\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 214, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">               [=](const OpenMPDirectiveKind K) { return K == RegionKind; }) &&
214 (0) . __assert_fail ("std..any_of( CaptureRegions.begin(), CaptureRegions.end(), [=](const OpenMPDirectiveKind K) { return K == RegionKind; }) && \"RegionKind not found in OpenMP CaptureRegions.\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 214, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "RegionKind not found in OpenMP CaptureRegions.");
215    auto *CS = cast<CapturedStmt>(getAssociatedStmt());
216    for (auto ThisCaptureRegion : CaptureRegions) {
217      if (ThisCaptureRegion == RegionKind)
218        return CS;
219      CS = cast<CapturedStmt>(CS->getCapturedStmt());
220    }
221    llvm_unreachable("Incorrect RegionKind specified for directive.");
222  }
223
224  /// Get innermost captured statement for the construct.
225  CapturedStmt *getInnermostCapturedStmt() {
226     (0) . __assert_fail ("hasAssociatedStmt() && getAssociatedStmt() && \"Must have associated statement.\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 227, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(hasAssociatedStmt() && getAssociatedStmt() &&
227 (0) . __assert_fail ("hasAssociatedStmt() && getAssociatedStmt() && \"Must have associated statement.\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 227, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "Must have associated statement.");
228    SmallVector<OpenMPDirectiveKind4CaptureRegions;
229    getOpenMPCaptureRegions(CaptureRegions, getDirectiveKind());
230     (0) . __assert_fail ("!CaptureRegions.empty() && \"At least one captured statement must be provided.\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 231, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!CaptureRegions.empty() &&
231 (0) . __assert_fail ("!CaptureRegions.empty() && \"At least one captured statement must be provided.\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 231, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "At least one captured statement must be provided.");
232    auto *CS = cast<CapturedStmt>(getAssociatedStmt());
233    for (unsigned Level = CaptureRegions.size(); Level > 1; --Level)
234      CS = cast<CapturedStmt>(CS->getCapturedStmt());
235    return CS;
236  }
237
238  const CapturedStmt *getInnermostCapturedStmt() const {
239    return const_cast<OMPExecutableDirective *>(this)
240        ->getInnermostCapturedStmt();
241  }
242
243  OpenMPDirectiveKind getDirectiveKind() const { return Kind; }
244
245  static bool classof(const Stmt *S) {
246    return S->getStmtClass() >= firstOMPExecutableDirectiveConstant &&
247           S->getStmtClass() <= lastOMPExecutableDirectiveConstant;
248  }
249
250  child_range children() {
251    if (!hasAssociatedStmt())
252      return child_range(child_iterator(), child_iterator());
253    Stmt **ChildStorage = reinterpret_cast<Stmt **>(getClauses().end());
254    /// Do not mark all the special expression/statements as children, except
255    /// for the associated statement.
256    return child_range(ChildStorageChildStorage + 1);
257  }
258
259  ArrayRef<OMPClause *> clauses() { return getClauses(); }
260
261  ArrayRef<OMPClause *> clauses() const {
262    return const_cast<OMPExecutableDirective *>(this)->getClauses();
263  }
264
265  /// Returns whether or not this is a Standalone directive.
266  ///
267  /// Stand-alone directives are executable directives
268  /// that have no associated user code.
269  bool isStandaloneDirective() const;
270
271  /// Returns the AST node representing OpenMP structured-block of this
272  /// OpenMP executable directive,
273  /// Prerequisite: Executable Directive must not be Standalone directive.
274  const Stmt *getStructuredBlock() const;
275
276  Stmt *getStructuredBlock() {
277    return const_cast<Stmt *>(
278        const_cast<const OMPExecutableDirective *>(this)->getStructuredBlock());
279  }
280};
281
282/// This represents '#pragma omp parallel' directive.
283///
284/// \code
285/// #pragma omp parallel private(a,b) reduction(+: c,d)
286/// \endcode
287/// In this example directive '#pragma omp parallel' has clauses 'private'
288/// with the variables 'a' and 'b' and 'reduction' with operator '+' and
289/// variables 'c' and 'd'.
290///
291class OMPParallelDirective : public OMPExecutableDirective {
292  friend class ASTStmtReader;
293  /// true if the construct has inner cancel directive.
294  bool HasCancel;
295
296  /// Build directive with the given start and end location.
297  ///
298  /// \param StartLoc Starting location of the directive (directive keyword).
299  /// \param EndLoc Ending Location of the directive.
300  ///
301  OMPParallelDirective(SourceLocation StartLocSourceLocation EndLoc,
302                       unsigned NumClauses)
303      : OMPExecutableDirective(this, OMPParallelDirectiveClass, OMPD_parallel,
304                               StartLoc, EndLoc, NumClauses, 1),
305        HasCancel(false) {}
306
307  /// Build an empty directive.
308  ///
309  /// \param NumClauses Number of clauses.
310  ///
311  explicit OMPParallelDirective(unsigned NumClauses)
312      : OMPExecutableDirective(this, OMPParallelDirectiveClass, OMPD_parallel,
313                               SourceLocation(), SourceLocation(), NumClauses,
314                               1),
315        HasCancel(false) {}
316
317  /// Set cancel state.
318  void setHasCancel(bool Has) { HasCancel = Has; }
319
320public:
321  /// Creates directive with a list of \a Clauses.
322  ///
323  /// \param C AST context.
324  /// \param StartLoc Starting location of the directive kind.
325  /// \param EndLoc Ending Location of the directive.
326  /// \param Clauses List of clauses.
327  /// \param AssociatedStmt Statement associated with the directive.
328  /// \param HasCancel true if this directive has inner cancel directive.
329  ///
330  static OMPParallelDirective *
331  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
332         ArrayRef<OMPClause *> ClausesStmt *AssociatedStmtbool HasCancel);
333
334  /// Creates an empty directive with the place for \a N clauses.
335  ///
336  /// \param C AST context.
337  /// \param NumClauses Number of clauses.
338  ///
339  static OMPParallelDirective *CreateEmpty(const ASTContext &C,
340                                           unsigned NumClausesEmptyShell);
341
342  /// Return true if current directive has inner cancel directive.
343  bool hasCancel() const { return HasCancel; }
344
345  static bool classof(const Stmt *T) {
346    return T->getStmtClass() == OMPParallelDirectiveClass;
347  }
348};
349
350/// This is a common base class for loop directives ('omp simd', 'omp
351/// for', 'omp for simd' etc.). It is responsible for the loop code generation.
352///
353class OMPLoopDirective : public OMPExecutableDirective {
354  friend class ASTStmtReader;
355  /// Number of collapsed loops as specified by 'collapse' clause.
356  unsigned CollapsedNum;
357
358  /// Offsets to the stored exprs.
359  /// This enumeration contains offsets to all the pointers to children
360  /// expressions stored in OMPLoopDirective.
361  /// The first 9 children are necessary for all the loop directives,
362  /// the next 8 are specific to the worksharing ones, and the next 11 are
363  /// used for combined constructs containing two pragmas associated to loops.
364  /// After the fixed children, three arrays of length CollapsedNum are
365  /// allocated: loop counters, their updates and final values.
366  /// PrevLowerBound and PrevUpperBound are used to communicate blocking
367  /// information in composite constructs which require loop blocking
368  /// DistInc is used to generate the increment expression for the distribute
369  /// loop when combined with a further nested loop
370  /// PrevEnsureUpperBound is used as the EnsureUpperBound expression for the
371  /// for loop when combined with a previous distribute loop in the same pragma
372  /// (e.g. 'distribute parallel for')
373  ///
374  enum {
375    AssociatedStmtOffset = 0,
376    IterationVariableOffset = 1,
377    LastIterationOffset = 2,
378    CalcLastIterationOffset = 3,
379    PreConditionOffset = 4,
380    CondOffset = 5,
381    InitOffset = 6,
382    IncOffset = 7,
383    PreInitsOffset = 8,
384    // The '...End' enumerators do not correspond to child expressions - they
385    // specify the offset to the end (and start of the following counters/
386    // updates/finals arrays).
387    DefaultEnd = 9,
388    // The following 8 exprs are used by worksharing and distribute loops only.
389    IsLastIterVariableOffset = 9,
390    LowerBoundVariableOffset = 10,
391    UpperBoundVariableOffset = 11,
392    StrideVariableOffset = 12,
393    EnsureUpperBoundOffset = 13,
394    NextLowerBoundOffset = 14,
395    NextUpperBoundOffset = 15,
396    NumIterationsOffset = 16,
397    // Offset to the end for worksharing loop directives.
398    WorksharingEnd = 17,
399    PrevLowerBoundVariableOffset = 17,
400    PrevUpperBoundVariableOffset = 18,
401    DistIncOffset = 19,
402    PrevEnsureUpperBoundOffset = 20,
403    CombinedLowerBoundVariableOffset = 21,
404    CombinedUpperBoundVariableOffset = 22,
405    CombinedEnsureUpperBoundOffset = 23,
406    CombinedInitOffset = 24,
407    CombinedConditionOffset = 25,
408    CombinedNextLowerBoundOffset = 26,
409    CombinedNextUpperBoundOffset = 27,
410    CombinedDistConditionOffset = 28,
411    CombinedParForInDistConditionOffset = 29,
412    // Offset to the end (and start of the following counters/updates/finals
413    // arrays) for combined distribute loop directives.
414    CombinedDistributeEnd = 30,
415  };
416
417  /// Get the counters storage.
418  MutableArrayRef<Expr *> getCounters() {
419    Expr **Storage = reinterpret_cast<Expr **>(
420        &(*(std::next(child_begin(), getArraysOffset(getDirectiveKind())))));
421    return MutableArrayRef<Expr *>(Storage, CollapsedNum);
422  }
423
424  /// Get the private counters storage.
425  MutableArrayRef<Expr *> getPrivateCounters() {
426    Expr **Storage = reinterpret_cast<Expr **>(&*std::next(
427        child_begin(), getArraysOffset(getDirectiveKind()) + CollapsedNum));
428    return MutableArrayRef<Expr *>(Storage, CollapsedNum);
429  }
430
431  /// Get the updates storage.
432  MutableArrayRef<Expr *> getInits() {
433    Expr **Storage = reinterpret_cast<Expr **>(
434        &*std::next(child_begin(),
435                    getArraysOffset(getDirectiveKind()) + 2 * CollapsedNum));
436    return MutableArrayRef<Expr *>(Storage, CollapsedNum);
437  }
438
439  /// Get the updates storage.
440  MutableArrayRef<Expr *> getUpdates() {
441    Expr **Storage = reinterpret_cast<Expr **>(
442        &*std::next(child_begin(),
443                    getArraysOffset(getDirectiveKind()) + 3 * CollapsedNum));
444    return MutableArrayRef<Expr *>(Storage, CollapsedNum);
445  }
446
447  /// Get the final counter updates storage.
448  MutableArrayRef<Expr *> getFinals() {
449    Expr **Storage = reinterpret_cast<Expr **>(
450        &*std::next(child_begin(),
451                    getArraysOffset(getDirectiveKind()) + 4 * CollapsedNum));
452    return MutableArrayRef<Expr *>(Storage, CollapsedNum);
453  }
454
455protected:
456  /// Build instance of loop directive of class \a Kind.
457  ///
458  /// \param SC Statement class.
459  /// \param Kind Kind of OpenMP directive.
460  /// \param StartLoc Starting location of the directive (directive keyword).
461  /// \param EndLoc Ending location of the directive.
462  /// \param CollapsedNum Number of collapsed loops from 'collapse' clause.
463  /// \param NumClauses Number of clauses.
464  /// \param NumSpecialChildren Number of additional directive-specific stmts.
465  ///
466  template <typename T>
467  OMPLoopDirective(const T *ThatStmtClass SCOpenMPDirectiveKind Kind,
468                   SourceLocation StartLocSourceLocation EndLoc,
469                   unsigned CollapsedNumunsigned NumClauses,
470                   unsigned NumSpecialChildren = 0)
471      : OMPExecutableDirective(ThatSCKindStartLocEndLocNumClauses,
472                               numLoopChildren(CollapsedNumKind) +
473                                   NumSpecialChildren),
474        CollapsedNum(CollapsedNum) {}
475
476  /// Offset to the start of children expression arrays.
477  static unsigned getArraysOffset(OpenMPDirectiveKind Kind) {
478    if (isOpenMPLoopBoundSharingDirective(Kind))
479      return CombinedDistributeEnd;
480    if (isOpenMPWorksharingDirective(Kind) || isOpenMPTaskLoopDirective(Kind) ||
481        isOpenMPDistributeDirective(Kind))
482      return WorksharingEnd;
483    return DefaultEnd;
484  }
485
486  /// Children number.
487  static unsigned numLoopChildren(unsigned CollapsedNum,
488                                  OpenMPDirectiveKind Kind) {
489    return getArraysOffset(Kind) + 5 * CollapsedNum// Counters,
490                                                     // PrivateCounters, Inits,
491                                                     // Updates and Finals
492  }
493
494  void setIterationVariable(Expr *IV) {
495    *std::next(child_begin(), IterationVariableOffset) = IV;
496  }
497  void setLastIteration(Expr *LI) {
498    *std::next(child_begin(), LastIterationOffset) = LI;
499  }
500  void setCalcLastIteration(Expr *CLI) {
501    *std::next(child_begin(), CalcLastIterationOffset) = CLI;
502  }
503  void setPreCond(Expr *PC) {
504    *std::next(child_begin(), PreConditionOffset) = PC;
505  }
506  void setCond(Expr *Cond) {
507    *std::next(child_begin(), CondOffset) = Cond;
508  }
509  void setInit(Expr *Init) { *std::next(child_begin(), InitOffset) = Init; }
510  void setInc(Expr *Inc) { *std::next(child_begin(), IncOffset) = Inc; }
511  void setPreInits(Stmt *PreInits) {
512    *std::next(child_begin(), PreInitsOffset) = PreInits;
513  }
514  void setIsLastIterVariable(Expr *IL) {
515     (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 518, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
516 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 518, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
517 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 518, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPDistributeDirective(getDirectiveKind())) &&
518 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 518, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected worksharing loop directive");
519    *std::next(child_begin(), IsLastIterVariableOffset) = IL;
520  }
521  void setLowerBoundVariable(Expr *LB) {
522     (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 525, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
523 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 525, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
524 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 525, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPDistributeDirective(getDirectiveKind())) &&
525 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 525, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected worksharing loop directive");
526    *std::next(child_begin(), LowerBoundVariableOffset) = LB;
527  }
528  void setUpperBoundVariable(Expr *UB) {
529     (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 532, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
530 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 532, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
531 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 532, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPDistributeDirective(getDirectiveKind())) &&
532 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 532, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected worksharing loop directive");
533    *std::next(child_begin(), UpperBoundVariableOffset) = UB;
534  }
535  void setStrideVariable(Expr *ST) {
536     (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 539, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
537 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 539, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
538 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 539, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPDistributeDirective(getDirectiveKind())) &&
539 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 539, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected worksharing loop directive");
540    *std::next(child_begin(), StrideVariableOffset) = ST;
541  }
542  void setEnsureUpperBound(Expr *EUB) {
543     (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 546, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
544 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 546, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
545 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 546, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPDistributeDirective(getDirectiveKind())) &&
546 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 546, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected worksharing loop directive");
547    *std::next(child_begin(), EnsureUpperBoundOffset) = EUB;
548  }
549  void setNextLowerBound(Expr *NLB) {
550     (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 553, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
551 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 553, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
552 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 553, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPDistributeDirective(getDirectiveKind())) &&
553 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 553, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected worksharing loop directive");
554    *std::next(child_begin(), NextLowerBoundOffset) = NLB;
555  }
556  void setNextUpperBound(Expr *NUB) {
557     (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 560, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
558 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 560, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
559 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 560, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPDistributeDirective(getDirectiveKind())) &&
560 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 560, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected worksharing loop directive");
561    *std::next(child_begin(), NextUpperBoundOffset) = NUB;
562  }
563  void setNumIterations(Expr *NI) {
564     (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 567, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
565 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 567, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
566 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 567, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPDistributeDirective(getDirectiveKind())) &&
567 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 567, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected worksharing loop directive");
568    *std::next(child_begin(), NumIterationsOffset) = NI;
569  }
570  void setPrevLowerBoundVariable(Expr *PrevLB) {
571     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 572, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
572 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 572, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
573    *std::next(child_begin(), PrevLowerBoundVariableOffset) = PrevLB;
574  }
575  void setPrevUpperBoundVariable(Expr *PrevUB) {
576     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 577, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
577 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 577, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
578    *std::next(child_begin(), PrevUpperBoundVariableOffset) = PrevUB;
579  }
580  void setDistInc(Expr *DistInc) {
581     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 582, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
582 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 582, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
583    *std::next(child_begin(), DistIncOffset) = DistInc;
584  }
585  void setPrevEnsureUpperBound(Expr *PrevEUB) {
586     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 587, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
587 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 587, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
588    *std::next(child_begin(), PrevEnsureUpperBoundOffset) = PrevEUB;
589  }
590  void setCombinedLowerBoundVariable(Expr *CombLB) {
591     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 592, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
592 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 592, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
593    *std::next(child_begin(), CombinedLowerBoundVariableOffset) = CombLB;
594  }
595  void setCombinedUpperBoundVariable(Expr *CombUB) {
596     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 597, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
597 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 597, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
598    *std::next(child_begin(), CombinedUpperBoundVariableOffset) = CombUB;
599  }
600  void setCombinedEnsureUpperBound(Expr *CombEUB) {
601     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 602, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
602 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 602, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
603    *std::next(child_begin(), CombinedEnsureUpperBoundOffset) = CombEUB;
604  }
605  void setCombinedInit(Expr *CombInit) {
606     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 607, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
607 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 607, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
608    *std::next(child_begin(), CombinedInitOffset) = CombInit;
609  }
610  void setCombinedCond(Expr *CombCond) {
611     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 612, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
612 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 612, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
613    *std::next(child_begin(), CombinedConditionOffset) = CombCond;
614  }
615  void setCombinedNextLowerBound(Expr *CombNLB) {
616     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 617, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
617 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 617, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
618    *std::next(child_begin(), CombinedNextLowerBoundOffset) = CombNLB;
619  }
620  void setCombinedNextUpperBound(Expr *CombNUB) {
621     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 622, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
622 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 622, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
623    *std::next(child_begin(), CombinedNextUpperBoundOffset) = CombNUB;
624  }
625  void setCombinedDistCond(Expr *CombDistCond) {
626     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound distribute sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 627, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
627 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound distribute sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 627, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound distribute sharing directive");
628    *std::next(child_begin(), CombinedDistConditionOffset) = CombDistCond;
629  }
630  void setCombinedParForInDistCond(Expr *CombParForInDistCond) {
631     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound distribute sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 632, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
632 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound distribute sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 632, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound distribute sharing directive");
633    *std::next(child_begin(),
634               CombinedParForInDistConditionOffset) = CombParForInDistCond;
635  }
636  void setCounters(ArrayRef<Expr *> A);
637  void setPrivateCounters(ArrayRef<Expr *> A);
638  void setInits(ArrayRef<Expr *> A);
639  void setUpdates(ArrayRef<Expr *> A);
640  void setFinals(ArrayRef<Expr *> A);
641
642public:
643  /// The expressions built to support OpenMP loops in combined/composite
644  /// pragmas (e.g. pragma omp distribute parallel for)
645  struct DistCombinedHelperExprs {
646    /// DistributeLowerBound - used when composing 'omp distribute' with
647    /// 'omp for' in a same construct.
648    Expr *LB;
649    /// DistributeUpperBound - used when composing 'omp distribute' with
650    /// 'omp for' in a same construct.
651    Expr *UB;
652    /// DistributeEnsureUpperBound - used when composing 'omp distribute'
653    ///  with 'omp for' in a same construct, EUB depends on DistUB
654    Expr *EUB;
655    /// Distribute loop iteration variable init used when composing 'omp
656    /// distribute'
657    ///  with 'omp for' in a same construct
658    Expr *Init;
659    /// Distribute Loop condition used when composing 'omp distribute'
660    ///  with 'omp for' in a same construct
661    Expr *Cond;
662    /// Update of LowerBound for statically scheduled omp loops for
663    /// outer loop in combined constructs (e.g. 'distribute parallel for')
664    Expr *NLB;
665    /// Update of UpperBound for statically scheduled omp loops for
666    /// outer loop in combined constructs (e.g. 'distribute parallel for')
667    Expr *NUB;
668    /// Distribute Loop condition used when composing 'omp distribute'
669    ///  with 'omp for' in a same construct when schedule is chunked.
670    Expr *DistCond;
671    /// 'omp parallel for' loop condition used when composed with
672    /// 'omp distribute' in the same construct and when schedule is
673    /// chunked and the chunk size is 1.
674    Expr *ParForInDistCond;
675  };
676
677  /// The expressions built for the OpenMP loop CodeGen for the
678  /// whole collapsed loop nest.
679  struct HelperExprs {
680    /// Loop iteration variable.
681    Expr *IterationVarRef;
682    /// Loop last iteration number.
683    Expr *LastIteration;
684    /// Loop number of iterations.
685    Expr *NumIterations;
686    /// Calculation of last iteration.
687    Expr *CalcLastIteration;
688    /// Loop pre-condition.
689    Expr *PreCond;
690    /// Loop condition.
691    Expr *Cond;
692    /// Loop iteration variable init.
693    Expr *Init;
694    /// Loop increment.
695    Expr *Inc;
696    /// IsLastIteration - local flag variable passed to runtime.
697    Expr *IL;
698    /// LowerBound - local variable passed to runtime.
699    Expr *LB;
700    /// UpperBound - local variable passed to runtime.
701    Expr *UB;
702    /// Stride - local variable passed to runtime.
703    Expr *ST;
704    /// EnsureUpperBound -- expression UB = min(UB, NumIterations).
705    Expr *EUB;
706    /// Update of LowerBound for statically scheduled 'omp for' loops.
707    Expr *NLB;
708    /// Update of UpperBound for statically scheduled 'omp for' loops.
709    Expr *NUB;
710    /// PreviousLowerBound - local variable passed to runtime in the
711    /// enclosing schedule or null if that does not apply.
712    Expr *PrevLB;
713    /// PreviousUpperBound - local variable passed to runtime in the
714    /// enclosing schedule or null if that does not apply.
715    Expr *PrevUB;
716    /// DistInc - increment expression for distribute loop when found
717    /// combined with a further loop level (e.g. in 'distribute parallel for')
718    /// expression IV = IV + ST
719    Expr *DistInc;
720    /// PrevEUB - expression similar to EUB but to be used when loop
721    /// scheduling uses PrevLB and PrevUB (e.g.  in 'distribute parallel for'
722    /// when ensuring that the UB is either the calculated UB by the runtime or
723    /// the end of the assigned distribute chunk)
724    /// expression UB = min (UB, PrevUB)
725    Expr *PrevEUB;
726    /// Counters Loop counters.
727    SmallVector<Expr *, 4Counters;
728    /// PrivateCounters Loop counters.
729    SmallVector<Expr *, 4PrivateCounters;
730    /// Expressions for loop counters inits for CodeGen.
731    SmallVector<Expr *, 4Inits;
732    /// Expressions for loop counters update for CodeGen.
733    SmallVector<Expr *, 4Updates;
734    /// Final loop counter values for GodeGen.
735    SmallVector<Expr *, 4Finals;
736    /// Init statement for all captured expressions.
737    Stmt *PreInits;
738
739    /// Expressions used when combining OpenMP loop pragmas
740    DistCombinedHelperExprs DistCombinedFields;
741
742    /// Check if all the expressions are built (does not check the
743    /// worksharing ones).
744    bool builtAll() {
745      return IterationVarRef != nullptr && LastIteration != nullptr &&
746             NumIterations != nullptr && PreCond != nullptr &&
747             Cond != nullptr && Init != nullptr && Inc != nullptr;
748    }
749
750    /// Initialize all the fields to null.
751    /// \param Size Number of elements in the counters/finals/updates arrays.
752    void clear(unsigned Size) {
753      IterationVarRef = nullptr;
754      LastIteration = nullptr;
755      CalcLastIteration = nullptr;
756      PreCond = nullptr;
757      Cond = nullptr;
758      Init = nullptr;
759      Inc = nullptr;
760      IL = nullptr;
761      LB = nullptr;
762      UB = nullptr;
763      ST = nullptr;
764      EUB = nullptr;
765      NLB = nullptr;
766      NUB = nullptr;
767      NumIterations = nullptr;
768      PrevLB = nullptr;
769      PrevUB = nullptr;
770      DistInc = nullptr;
771      PrevEUB = nullptr;
772      Counters.resize(Size);
773      PrivateCounters.resize(Size);
774      Inits.resize(Size);
775      Updates.resize(Size);
776      Finals.resize(Size);
777      for (unsigned i = 0i < Size; ++i) {
778        Counters[i] = nullptr;
779        PrivateCounters[i] = nullptr;
780        Inits[i] = nullptr;
781        Updates[i] = nullptr;
782        Finals[i] = nullptr;
783      }
784      PreInits = nullptr;
785      DistCombinedFields.LB = nullptr;
786      DistCombinedFields.UB = nullptr;
787      DistCombinedFields.EUB = nullptr;
788      DistCombinedFields.Init = nullptr;
789      DistCombinedFields.Cond = nullptr;
790      DistCombinedFields.NLB = nullptr;
791      DistCombinedFields.NUB = nullptr;
792      DistCombinedFields.DistCond = nullptr;
793      DistCombinedFields.ParForInDistCond = nullptr;
794    }
795  };
796
797  /// Get number of collapsed loops.
798  unsigned getCollapsedNumber() const { return CollapsedNum; }
799
800  Expr *getIterationVariable() const {
801    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
802        *std::next(child_begin(), IterationVariableOffset)));
803  }
804  Expr *getLastIteration() const {
805    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
806        *std::next(child_begin(), LastIterationOffset)));
807  }
808  Expr *getCalcLastIteration() const {
809    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
810        *std::next(child_begin(), CalcLastIterationOffset)));
811  }
812  Expr *getPreCond() const {
813    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
814        *std::next(child_begin(), PreConditionOffset)));
815  }
816  Expr *getCond() const {
817    return const_cast<Expr *>(
818        reinterpret_cast<const Expr *>(*std::next(child_begin(), CondOffset)));
819  }
820  Expr *getInit() const {
821    return const_cast<Expr *>(
822        reinterpret_cast<const Expr *>(*std::next(child_begin(), InitOffset)));
823  }
824  Expr *getInc() const {
825    return const_cast<Expr *>(
826        reinterpret_cast<const Expr *>(*std::next(child_begin(), IncOffset)));
827  }
828  const Stmt *getPreInits() const {
829    return *std::next(child_begin(), PreInitsOffset);
830  }
831  Stmt *getPreInits() { return *std::next(child_begin(), PreInitsOffset); }
832  Expr *getIsLastIterVariable() const {
833     (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 836, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
834 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 836, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
835 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 836, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPDistributeDirective(getDirectiveKind())) &&
836 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 836, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected worksharing loop directive");
837    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
838        *std::next(child_begin(), IsLastIterVariableOffset)));
839  }
840  Expr *getLowerBoundVariable() const {
841     (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 844, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
842 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 844, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
843 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 844, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPDistributeDirective(getDirectiveKind())) &&
844 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 844, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected worksharing loop directive");
845    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
846        *std::next(child_begin(), LowerBoundVariableOffset)));
847  }
848  Expr *getUpperBoundVariable() const {
849     (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 852, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
850 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 852, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
851 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 852, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPDistributeDirective(getDirectiveKind())) &&
852 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 852, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected worksharing loop directive");
853    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
854        *std::next(child_begin(), UpperBoundVariableOffset)));
855  }
856  Expr *getStrideVariable() const {
857     (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 860, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
858 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 860, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
859 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 860, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPDistributeDirective(getDirectiveKind())) &&
860 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 860, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected worksharing loop directive");
861    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
862        *std::next(child_begin(), StrideVariableOffset)));
863  }
864  Expr *getEnsureUpperBound() const {
865     (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 868, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
866 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 868, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
867 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 868, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPDistributeDirective(getDirectiveKind())) &&
868 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 868, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected worksharing loop directive");
869    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
870        *std::next(child_begin(), EnsureUpperBoundOffset)));
871  }
872  Expr *getNextLowerBound() const {
873     (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 876, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
874 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 876, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
875 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 876, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPDistributeDirective(getDirectiveKind())) &&
876 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 876, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected worksharing loop directive");
877    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
878        *std::next(child_begin(), NextLowerBoundOffset)));
879  }
880  Expr *getNextUpperBound() const {
881     (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 884, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
882 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 884, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
883 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 884, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPDistributeDirective(getDirectiveKind())) &&
884 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 884, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected worksharing loop directive");
885    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
886        *std::next(child_begin(), NextUpperBoundOffset)));
887  }
888  Expr *getNumIterations() const {
889     (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 892, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
890 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 892, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
891 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 892, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            isOpenMPDistributeDirective(getDirectiveKind())) &&
892 (0) . __assert_fail ("(isOpenMPWorksharingDirective(getDirectiveKind()) || isOpenMPTaskLoopDirective(getDirectiveKind()) || isOpenMPDistributeDirective(getDirectiveKind())) && \"expected worksharing loop directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 892, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected worksharing loop directive");
893    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
894        *std::next(child_begin(), NumIterationsOffset)));
895  }
896  Expr *getPrevLowerBoundVariable() const {
897     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 898, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
898 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 898, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
899    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
900        *std::next(child_begin(), PrevLowerBoundVariableOffset)));
901  }
902  Expr *getPrevUpperBoundVariable() const {
903     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 904, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
904 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 904, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
905    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
906        *std::next(child_begin(), PrevUpperBoundVariableOffset)));
907  }
908  Expr *getDistInc() const {
909     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 910, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
910 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 910, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
911    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
912        *std::next(child_begin(), DistIncOffset)));
913  }
914  Expr *getPrevEnsureUpperBound() const {
915     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 916, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
916 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 916, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
917    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
918        *std::next(child_begin(), PrevEnsureUpperBoundOffset)));
919  }
920  Expr *getCombinedLowerBoundVariable() const {
921     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 922, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
922 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 922, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
923    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
924        *std::next(child_begin(), CombinedLowerBoundVariableOffset)));
925  }
926  Expr *getCombinedUpperBoundVariable() const {
927     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 928, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
928 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 928, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
929    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
930        *std::next(child_begin(), CombinedUpperBoundVariableOffset)));
931  }
932  Expr *getCombinedEnsureUpperBound() const {
933     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 934, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
934 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 934, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
935    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
936        *std::next(child_begin(), CombinedEnsureUpperBoundOffset)));
937  }
938  Expr *getCombinedInit() const {
939     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 940, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
940 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 940, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
941    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
942        *std::next(child_begin(), CombinedInitOffset)));
943  }
944  Expr *getCombinedCond() const {
945     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 946, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
946 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 946, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
947    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
948        *std::next(child_begin(), CombinedConditionOffset)));
949  }
950  Expr *getCombinedNextLowerBound() const {
951     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 952, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
952 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 952, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
953    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
954        *std::next(child_begin(), CombinedNextLowerBoundOffset)));
955  }
956  Expr *getCombinedNextUpperBound() const {
957     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 958, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
958 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 958, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound sharing directive");
959    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
960        *std::next(child_begin(), CombinedNextUpperBoundOffset)));
961  }
962  Expr *getCombinedDistCond() const {
963     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound distribute sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 964, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
964 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound distribute sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 964, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound distribute sharing directive");
965    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
966        *std::next(child_begin(), CombinedDistConditionOffset)));
967  }
968  Expr *getCombinedParForInDistCond() const {
969     (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound distribute sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 970, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
970 (0) . __assert_fail ("isOpenMPLoopBoundSharingDirective(getDirectiveKind()) && \"expected loop bound distribute sharing directive\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/StmtOpenMP.h", 970, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "expected loop bound distribute sharing directive");
971    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
972        *std::next(child_begin(), CombinedParForInDistConditionOffset)));
973  }
974  const Stmt *getBody() const {
975    // This relies on the loop form is already checked by Sema.
976    const Stmt *Body =
977        getInnermostCapturedStmt()->getCapturedStmt()->IgnoreContainers();
978    Body = cast<ForStmt>(Body)->getBody();
979    for (unsigned Cnt = 1Cnt < CollapsedNum; ++Cnt) {
980      Body = Body->IgnoreContainers();
981      Body = cast<ForStmt>(Body)->getBody();
982    }
983    return Body;
984  }
985
986  ArrayRef<Expr *> counters() { return getCounters(); }
987
988  ArrayRef<Expr *> counters() const {
989    return const_cast<OMPLoopDirective *>(this)->getCounters();
990  }
991
992  ArrayRef<Expr *> private_counters() { return getPrivateCounters(); }
993
994  ArrayRef<Expr *> private_counters() const {
995    return const_cast<OMPLoopDirective *>(this)->getPrivateCounters();
996  }
997
998  ArrayRef<Expr *> inits() { return getInits(); }
999
1000  ArrayRef<Expr *> inits() const {
1001    return const_cast<OMPLoopDirective *>(this)->getInits();
1002  }
1003
1004  ArrayRef<Expr *> updates() { return getUpdates(); }
1005
1006  ArrayRef<Expr *> updates() const {
1007    return const_cast<OMPLoopDirective *>(this)->getUpdates();
1008  }
1009
1010  ArrayRef<Expr *> finals() { return getFinals(); }
1011
1012  ArrayRef<Expr *> finals() const {
1013    return const_cast<OMPLoopDirective *>(this)->getFinals();
1014  }
1015
1016  static bool classof(const Stmt *T) {
1017    return T->getStmtClass() == OMPSimdDirectiveClass ||
1018           T->getStmtClass() == OMPForDirectiveClass ||
1019           T->getStmtClass() == OMPForSimdDirectiveClass ||
1020           T->getStmtClass() == OMPParallelForDirectiveClass ||
1021           T->getStmtClass() == OMPParallelForSimdDirectiveClass ||
1022           T->getStmtClass() == OMPTaskLoopDirectiveClass ||
1023           T->getStmtClass() == OMPTaskLoopSimdDirectiveClass ||
1024           T->getStmtClass() == OMPDistributeDirectiveClass ||
1025           T->getStmtClass() == OMPTargetParallelForDirectiveClass ||
1026           T->getStmtClass() == OMPDistributeParallelForDirectiveClass ||
1027           T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass ||
1028           T->getStmtClass() == OMPDistributeSimdDirectiveClass ||
1029           T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass ||
1030           T->getStmtClass() == OMPTargetSimdDirectiveClass ||
1031           T->getStmtClass() == OMPTeamsDistributeDirectiveClass ||
1032           T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass ||
1033           T->getStmtClass() ==
1034               OMPTeamsDistributeParallelForSimdDirectiveClass ||
1035           T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass ||
1036           T->getStmtClass() ==
1037               OMPTargetTeamsDistributeParallelForDirectiveClass ||
1038           T->getStmtClass() ==
1039               OMPTargetTeamsDistributeParallelForSimdDirectiveClass ||
1040           T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass ||
1041           T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
1042  }
1043};
1044
1045/// This represents '#pragma omp simd' directive.
1046///
1047/// \code
1048/// #pragma omp simd private(a,b) linear(i,j:s) reduction(+:c,d)
1049/// \endcode
1050/// In this example directive '#pragma omp simd' has clauses 'private'
1051/// with the variables 'a' and 'b', 'linear' with variables 'i', 'j' and
1052/// linear step 's', 'reduction' with operator '+' and variables 'c' and 'd'.
1053///
1054class OMPSimdDirective : public OMPLoopDirective {
1055  friend class ASTStmtReader;
1056  /// Build directive with the given start and end location.
1057  ///
1058  /// \param StartLoc Starting location of the directive kind.
1059  /// \param EndLoc Ending location of the directive.
1060  /// \param CollapsedNum Number of collapsed nested loops.
1061  /// \param NumClauses Number of clauses.
1062  ///
1063  OMPSimdDirective(SourceLocation StartLocSourceLocation EndLoc,
1064                   unsigned CollapsedNumunsigned NumClauses)
1065      : OMPLoopDirective(this, OMPSimdDirectiveClass, OMPD_simd, StartLoc,
1066                         EndLoc, CollapsedNum, NumClauses) {}
1067
1068  /// Build an empty directive.
1069  ///
1070  /// \param CollapsedNum Number of collapsed nested loops.
1071  /// \param NumClauses Number of clauses.
1072  ///
1073  explicit OMPSimdDirective(unsigned CollapsedNumunsigned NumClauses)
1074      : OMPLoopDirective(this, OMPSimdDirectiveClass, OMPD_simd,
1075                         SourceLocation(), SourceLocation(), CollapsedNum,
1076                         NumClauses) {}
1077
1078public:
1079  /// Creates directive with a list of \a Clauses.
1080  ///
1081  /// \param C AST context.
1082  /// \param StartLoc Starting location of the directive kind.
1083  /// \param EndLoc Ending Location of the directive.
1084  /// \param CollapsedNum Number of collapsed loops.
1085  /// \param Clauses List of clauses.
1086  /// \param AssociatedStmt Statement, associated with the directive.
1087  /// \param Exprs Helper expressions for CodeGen.
1088  ///
1089  static OMPSimdDirective *Create(const ASTContext &CSourceLocation StartLoc,
1090                                  SourceLocation EndLocunsigned CollapsedNum,
1091                                  ArrayRef<OMPClause *> Clauses,
1092                                  Stmt *AssociatedStmt,
1093                                  const HelperExprs &Exprs);
1094
1095  /// Creates an empty directive with the place
1096  /// for \a NumClauses clauses.
1097  ///
1098  /// \param C AST context.
1099  /// \param CollapsedNum Number of collapsed nested loops.
1100  /// \param NumClauses Number of clauses.
1101  ///
1102  static OMPSimdDirective *CreateEmpty(const ASTContext &Cunsigned NumClauses,
1103                                       unsigned CollapsedNumEmptyShell);
1104
1105  static bool classof(const Stmt *T) {
1106    return T->getStmtClass() == OMPSimdDirectiveClass;
1107  }
1108};
1109
1110/// This represents '#pragma omp for' directive.
1111///
1112/// \code
1113/// #pragma omp for private(a,b) reduction(+:c,d)
1114/// \endcode
1115/// In this example directive '#pragma omp for' has clauses 'private' with the
1116/// variables 'a' and 'b' and 'reduction' with operator '+' and variables 'c'
1117/// and 'd'.
1118///
1119class OMPForDirective : public OMPLoopDirective {
1120  friend class ASTStmtReader;
1121
1122  /// true if current directive has inner cancel directive.
1123  bool HasCancel;
1124
1125  /// Build directive with the given start and end location.
1126  ///
1127  /// \param StartLoc Starting location of the directive kind.
1128  /// \param EndLoc Ending location of the directive.
1129  /// \param CollapsedNum Number of collapsed nested loops.
1130  /// \param NumClauses Number of clauses.
1131  ///
1132  OMPForDirective(SourceLocation StartLocSourceLocation EndLoc,
1133                  unsigned CollapsedNumunsigned NumClauses)
1134      : OMPLoopDirective(this, OMPForDirectiveClass, OMPD_for, StartLoc, EndLoc,
1135                         CollapsedNum, NumClauses),
1136        HasCancel(false) {}
1137
1138  /// Build an empty directive.
1139  ///
1140  /// \param CollapsedNum Number of collapsed nested loops.
1141  /// \param NumClauses Number of clauses.
1142  ///
1143  explicit OMPForDirective(unsigned CollapsedNumunsigned NumClauses)
1144      : OMPLoopDirective(this, OMPForDirectiveClass, OMPD_for, SourceLocation(),
1145                         SourceLocation(), CollapsedNum, NumClauses),
1146        HasCancel(false) {}
1147
1148  /// Set cancel state.
1149  void setHasCancel(bool Has) { HasCancel = Has; }
1150
1151public:
1152  /// Creates directive with a list of \a Clauses.
1153  ///
1154  /// \param C AST context.
1155  /// \param StartLoc Starting location of the directive kind.
1156  /// \param EndLoc Ending Location of the directive.
1157  /// \param CollapsedNum Number of collapsed loops.
1158  /// \param Clauses List of clauses.
1159  /// \param AssociatedStmt Statement, associated with the directive.
1160  /// \param Exprs Helper expressions for CodeGen.
1161  /// \param HasCancel true if current directive has inner cancel directive.
1162  ///
1163  static OMPForDirective *Create(const ASTContext &CSourceLocation StartLoc,
1164                                 SourceLocation EndLocunsigned CollapsedNum,
1165                                 ArrayRef<OMPClause *> Clauses,
1166                                 Stmt *AssociatedStmtconst HelperExprs &Exprs,
1167                                 bool HasCancel);
1168
1169  /// Creates an empty directive with the place
1170  /// for \a NumClauses clauses.
1171  ///
1172  /// \param C AST context.
1173  /// \param CollapsedNum Number of collapsed nested loops.
1174  /// \param NumClauses Number of clauses.
1175  ///
1176  static OMPForDirective *CreateEmpty(const ASTContext &Cunsigned NumClauses,
1177                                      unsigned CollapsedNumEmptyShell);
1178
1179  /// Return true if current directive has inner cancel directive.
1180  bool hasCancel() const { return HasCancel; }
1181
1182  static bool classof(const Stmt *T) {
1183    return T->getStmtClass() == OMPForDirectiveClass;
1184  }
1185};
1186
1187/// This represents '#pragma omp for simd' directive.
1188///
1189/// \code
1190/// #pragma omp for simd private(a,b) linear(i,j:s) reduction(+:c,d)
1191/// \endcode
1192/// In this example directive '#pragma omp for simd' has clauses 'private'
1193/// with the variables 'a' and 'b', 'linear' with variables 'i', 'j' and
1194/// linear step 's', 'reduction' with operator '+' and variables 'c' and 'd'.
1195///
1196class OMPForSimdDirective : public OMPLoopDirective {
1197  friend class ASTStmtReader;
1198  /// Build directive with the given start and end location.
1199  ///
1200  /// \param StartLoc Starting location of the directive kind.
1201  /// \param EndLoc Ending location of the directive.
1202  /// \param CollapsedNum Number of collapsed nested loops.
1203  /// \param NumClauses Number of clauses.
1204  ///
1205  OMPForSimdDirective(SourceLocation StartLocSourceLocation EndLoc,
1206                      unsigned CollapsedNumunsigned NumClauses)
1207      : OMPLoopDirective(this, OMPForSimdDirectiveClass, OMPD_for_simd,
1208                         StartLoc, EndLoc, CollapsedNum, NumClauses) {}
1209
1210  /// Build an empty directive.
1211  ///
1212  /// \param CollapsedNum Number of collapsed nested loops.
1213  /// \param NumClauses Number of clauses.
1214  ///
1215  explicit OMPForSimdDirective(unsigned CollapsedNumunsigned NumClauses)
1216      : OMPLoopDirective(this, OMPForSimdDirectiveClass, OMPD_for_simd,
1217                         SourceLocation(), SourceLocation(), CollapsedNum,
1218                         NumClauses) {}
1219
1220public:
1221  /// Creates directive with a list of \a Clauses.
1222  ///
1223  /// \param C AST context.
1224  /// \param StartLoc Starting location of the directive kind.
1225  /// \param EndLoc Ending Location of the directive.
1226  /// \param CollapsedNum Number of collapsed loops.
1227  /// \param Clauses List of clauses.
1228  /// \param AssociatedStmt Statement, associated with the directive.
1229  /// \param Exprs Helper expressions for CodeGen.
1230  ///
1231  static OMPForSimdDirective *
1232  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
1233         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
1234         Stmt *AssociatedStmtconst HelperExprs &Exprs);
1235
1236  /// Creates an empty directive with the place
1237  /// for \a NumClauses clauses.
1238  ///
1239  /// \param C AST context.
1240  /// \param CollapsedNum Number of collapsed nested loops.
1241  /// \param NumClauses Number of clauses.
1242  ///
1243  static OMPForSimdDirective *CreateEmpty(const ASTContext &C,
1244                                          unsigned NumClauses,
1245                                          unsigned CollapsedNumEmptyShell);
1246
1247  static bool classof(const Stmt *T) {
1248    return T->getStmtClass() == OMPForSimdDirectiveClass;
1249  }
1250};
1251
1252/// This represents '#pragma omp sections' directive.
1253///
1254/// \code
1255/// #pragma omp sections private(a,b) reduction(+:c,d)
1256/// \endcode
1257/// In this example directive '#pragma omp sections' has clauses 'private' with
1258/// the variables 'a' and 'b' and 'reduction' with operator '+' and variables
1259/// 'c' and 'd'.
1260///
1261class OMPSectionsDirective : public OMPExecutableDirective {
1262  friend class ASTStmtReader;
1263
1264  /// true if current directive has inner cancel directive.
1265  bool HasCancel;
1266
1267  /// Build directive with the given start and end location.
1268  ///
1269  /// \param StartLoc Starting location of the directive kind.
1270  /// \param EndLoc Ending location of the directive.
1271  /// \param NumClauses Number of clauses.
1272  ///
1273  OMPSectionsDirective(SourceLocation StartLocSourceLocation EndLoc,
1274                       unsigned NumClauses)
1275      : OMPExecutableDirective(this, OMPSectionsDirectiveClass, OMPD_sections,
1276                               StartLoc, EndLoc, NumClauses, 1),
1277        HasCancel(false) {}
1278
1279  /// Build an empty directive.
1280  ///
1281  /// \param NumClauses Number of clauses.
1282  ///
1283  explicit OMPSectionsDirective(unsigned NumClauses)
1284      : OMPExecutableDirective(this, OMPSectionsDirectiveClass, OMPD_sections,
1285                               SourceLocation(), SourceLocation(), NumClauses,
1286                               1),
1287        HasCancel(false) {}
1288
1289  /// Set cancel state.
1290  void setHasCancel(bool Has) { HasCancel = Has; }
1291
1292public:
1293  /// Creates directive with a list of \a Clauses.
1294  ///
1295  /// \param C AST context.
1296  /// \param StartLoc Starting location of the directive kind.
1297  /// \param EndLoc Ending Location of the directive.
1298  /// \param Clauses List of clauses.
1299  /// \param AssociatedStmt Statement, associated with the directive.
1300  /// \param HasCancel true if current directive has inner directive.
1301  ///
1302  static OMPSectionsDirective *
1303  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
1304         ArrayRef<OMPClause *> ClausesStmt *AssociatedStmtbool HasCancel);
1305
1306  /// Creates an empty directive with the place for \a NumClauses
1307  /// clauses.
1308  ///
1309  /// \param C AST context.
1310  /// \param NumClauses Number of clauses.
1311  ///
1312  static OMPSectionsDirective *CreateEmpty(const ASTContext &C,
1313                                           unsigned NumClausesEmptyShell);
1314
1315  /// Return true if current directive has inner cancel directive.
1316  bool hasCancel() const { return HasCancel; }
1317
1318  static bool classof(const Stmt *T) {
1319    return T->getStmtClass() == OMPSectionsDirectiveClass;
1320  }
1321};
1322
1323/// This represents '#pragma omp section' directive.
1324///
1325/// \code
1326/// #pragma omp section
1327/// \endcode
1328///
1329class OMPSectionDirective : public OMPExecutableDirective {
1330  friend class ASTStmtReader;
1331
1332  /// true if current directive has inner cancel directive.
1333  bool HasCancel;
1334
1335  /// Build directive with the given start and end location.
1336  ///
1337  /// \param StartLoc Starting location of the directive kind.
1338  /// \param EndLoc Ending location of the directive.
1339  ///
1340  OMPSectionDirective(SourceLocation StartLocSourceLocation EndLoc)
1341      : OMPExecutableDirective(this, OMPSectionDirectiveClass, OMPD_section,
1342                               StartLoc, EndLoc, 01),
1343        HasCancel(false) {}
1344
1345  /// Build an empty directive.
1346  ///
1347  explicit OMPSectionDirective()
1348      : OMPExecutableDirective(this, OMPSectionDirectiveClass, OMPD_section,
1349                               SourceLocation(), SourceLocation(), 01),
1350        HasCancel(false) {}
1351
1352public:
1353  /// Creates directive.
1354  ///
1355  /// \param C AST context.
1356  /// \param StartLoc Starting location of the directive kind.
1357  /// \param EndLoc Ending Location of the directive.
1358  /// \param AssociatedStmt Statement, associated with the directive.
1359  /// \param HasCancel true if current directive has inner directive.
1360  ///
1361  static OMPSectionDirective *Create(const ASTContext &C,
1362                                     SourceLocation StartLoc,
1363                                     SourceLocation EndLoc,
1364                                     Stmt *AssociatedStmtbool HasCancel);
1365
1366  /// Creates an empty directive.
1367  ///
1368  /// \param C AST context.
1369  ///
1370  static OMPSectionDirective *CreateEmpty(const ASTContext &CEmptyShell);
1371
1372  /// Set cancel state.
1373  void setHasCancel(bool Has) { HasCancel = Has; }
1374
1375  /// Return true if current directive has inner cancel directive.
1376  bool hasCancel() const { return HasCancel; }
1377
1378  static bool classof(const Stmt *T) {
1379    return T->getStmtClass() == OMPSectionDirectiveClass;
1380  }
1381};
1382
1383/// This represents '#pragma omp single' directive.
1384///
1385/// \code
1386/// #pragma omp single private(a,b) copyprivate(c,d)
1387/// \endcode
1388/// In this example directive '#pragma omp single' has clauses 'private' with
1389/// the variables 'a' and 'b' and 'copyprivate' with variables 'c' and 'd'.
1390///
1391class OMPSingleDirective : public OMPExecutableDirective {
1392  friend class ASTStmtReader;
1393  /// Build directive with the given start and end location.
1394  ///
1395  /// \param StartLoc Starting location of the directive kind.
1396  /// \param EndLoc Ending location of the directive.
1397  /// \param NumClauses Number of clauses.
1398  ///
1399  OMPSingleDirective(SourceLocation StartLocSourceLocation EndLoc,
1400                     unsigned NumClauses)
1401      : OMPExecutableDirective(this, OMPSingleDirectiveClass, OMPD_single,
1402                               StartLoc, EndLoc, NumClauses, 1) {}
1403
1404  /// Build an empty directive.
1405  ///
1406  /// \param NumClauses Number of clauses.
1407  ///
1408  explicit OMPSingleDirective(unsigned NumClauses)
1409      : OMPExecutableDirective(this, OMPSingleDirectiveClass, OMPD_single,
1410                               SourceLocation(), SourceLocation(), NumClauses,
1411                               1) {}
1412
1413public:
1414  /// Creates directive with a list of \a Clauses.
1415  ///
1416  /// \param C AST context.
1417  /// \param StartLoc Starting location of the directive kind.
1418  /// \param EndLoc Ending Location of the directive.
1419  /// \param Clauses List of clauses.
1420  /// \param AssociatedStmt Statement, associated with the directive.
1421  ///
1422  static OMPSingleDirective *
1423  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
1424         ArrayRef<OMPClause *> ClausesStmt *AssociatedStmt);
1425
1426  /// Creates an empty directive with the place for \a NumClauses
1427  /// clauses.
1428  ///
1429  /// \param C AST context.
1430  /// \param NumClauses Number of clauses.
1431  ///
1432  static OMPSingleDirective *CreateEmpty(const ASTContext &C,
1433                                         unsigned NumClausesEmptyShell);
1434
1435  static bool classof(const Stmt *T) {
1436    return T->getStmtClass() == OMPSingleDirectiveClass;
1437  }
1438};
1439
1440/// This represents '#pragma omp master' directive.
1441///
1442/// \code
1443/// #pragma omp master
1444/// \endcode
1445///
1446class OMPMasterDirective : public OMPExecutableDirective {
1447  friend class ASTStmtReader;
1448  /// Build directive with the given start and end location.
1449  ///
1450  /// \param StartLoc Starting location of the directive kind.
1451  /// \param EndLoc Ending location of the directive.
1452  ///
1453  OMPMasterDirective(SourceLocation StartLocSourceLocation EndLoc)
1454      : OMPExecutableDirective(this, OMPMasterDirectiveClass, OMPD_master,
1455                               StartLoc, EndLoc, 01) {}
1456
1457  /// Build an empty directive.
1458  ///
1459  explicit OMPMasterDirective()
1460      : OMPExecutableDirective(this, OMPMasterDirectiveClass, OMPD_master,
1461                               SourceLocation(), SourceLocation(), 01) {}
1462
1463public:
1464  /// Creates directive.
1465  ///
1466  /// \param C AST context.
1467  /// \param StartLoc Starting location of the directive kind.
1468  /// \param EndLoc Ending Location of the directive.
1469  /// \param AssociatedStmt Statement, associated with the directive.
1470  ///
1471  static OMPMasterDirective *Create(const ASTContext &C,
1472                                    SourceLocation StartLoc,
1473                                    SourceLocation EndLoc,
1474                                    Stmt *AssociatedStmt);
1475
1476  /// Creates an empty directive.
1477  ///
1478  /// \param C AST context.
1479  ///
1480  static OMPMasterDirective *CreateEmpty(const ASTContext &CEmptyShell);
1481
1482  static bool classof(const Stmt *T) {
1483    return T->getStmtClass() == OMPMasterDirectiveClass;
1484  }
1485};
1486
1487/// This represents '#pragma omp critical' directive.
1488///
1489/// \code
1490/// #pragma omp critical
1491/// \endcode
1492///
1493class OMPCriticalDirective : public OMPExecutableDirective {
1494  friend class ASTStmtReader;
1495  /// Name of the directive.
1496  DeclarationNameInfo DirName;
1497  /// Build directive with the given start and end location.
1498  ///
1499  /// \param Name Name of the directive.
1500  /// \param StartLoc Starting location of the directive kind.
1501  /// \param EndLoc Ending location of the directive.
1502  /// \param NumClauses Number of clauses.
1503  ///
1504  OMPCriticalDirective(const DeclarationNameInfo &NameSourceLocation StartLoc,
1505                       SourceLocation EndLocunsigned NumClauses)
1506      : OMPExecutableDirective(this, OMPCriticalDirectiveClass, OMPD_critical,
1507                               StartLoc, EndLoc, NumClauses, 1),
1508        DirName(Name) {}
1509
1510  /// Build an empty directive.
1511  ///
1512  /// \param NumClauses Number of clauses.
1513  ///
1514  explicit OMPCriticalDirective(unsigned NumClauses)
1515      : OMPExecutableDirective(this, OMPCriticalDirectiveClass, OMPD_critical,
1516                               SourceLocation(), SourceLocation(), NumClauses,
1517                               1),
1518        DirName() {}
1519
1520  /// Set name of the directive.
1521  ///
1522  /// \param Name Name of the directive.
1523  ///
1524  void setDirectiveName(const DeclarationNameInfo &Name) { DirName = Name; }
1525
1526public:
1527  /// Creates directive.
1528  ///
1529  /// \param C AST context.
1530  /// \param Name Name of the directive.
1531  /// \param StartLoc Starting location of the directive kind.
1532  /// \param EndLoc Ending Location of the directive.
1533  /// \param Clauses List of clauses.
1534  /// \param AssociatedStmt Statement, associated with the directive.
1535  ///
1536  static OMPCriticalDirective *
1537  Create(const ASTContext &Cconst DeclarationNameInfo &Name,
1538         SourceLocation StartLocSourceLocation EndLoc,
1539         ArrayRef<OMPClause *> ClausesStmt *AssociatedStmt);
1540
1541  /// Creates an empty directive.
1542  ///
1543  /// \param C AST context.
1544  /// \param NumClauses Number of clauses.
1545  ///
1546  static OMPCriticalDirective *CreateEmpty(const ASTContext &C,
1547                                           unsigned NumClausesEmptyShell);
1548
1549  /// Return name of the directive.
1550  ///
1551  DeclarationNameInfo getDirectiveName() const { return DirName; }
1552
1553  static bool classof(const Stmt *T) {
1554    return T->getStmtClass() == OMPCriticalDirectiveClass;
1555  }
1556};
1557
1558/// This represents '#pragma omp parallel for' directive.
1559///
1560/// \code
1561/// #pragma omp parallel for private(a,b) reduction(+:c,d)
1562/// \endcode
1563/// In this example directive '#pragma omp parallel for' has clauses 'private'
1564/// with the variables 'a' and 'b' and 'reduction' with operator '+' and
1565/// variables 'c' and 'd'.
1566///
1567class OMPParallelForDirective : public OMPLoopDirective {
1568  friend class ASTStmtReader;
1569
1570  /// true if current region has inner cancel directive.
1571  bool HasCancel;
1572
1573  /// Build directive with the given start and end location.
1574  ///
1575  /// \param StartLoc Starting location of the directive kind.
1576  /// \param EndLoc Ending location of the directive.
1577  /// \param CollapsedNum Number of collapsed nested loops.
1578  /// \param NumClauses Number of clauses.
1579  ///
1580  OMPParallelForDirective(SourceLocation StartLocSourceLocation EndLoc,
1581                          unsigned CollapsedNumunsigned NumClauses)
1582      : OMPLoopDirective(this, OMPParallelForDirectiveClass, OMPD_parallel_for,
1583                         StartLoc, EndLoc, CollapsedNum, NumClauses),
1584        HasCancel(false) {}
1585
1586  /// Build an empty directive.
1587  ///
1588  /// \param CollapsedNum Number of collapsed nested loops.
1589  /// \param NumClauses Number of clauses.
1590  ///
1591  explicit OMPParallelForDirective(unsigned CollapsedNumunsigned NumClauses)
1592      : OMPLoopDirective(this, OMPParallelForDirectiveClass, OMPD_parallel_for,
1593                         SourceLocation(), SourceLocation(), CollapsedNum,
1594                         NumClauses),
1595        HasCancel(false) {}
1596
1597  /// Set cancel state.
1598  void setHasCancel(bool Has) { HasCancel = Has; }
1599
1600public:
1601  /// Creates directive with a list of \a Clauses.
1602  ///
1603  /// \param C AST context.
1604  /// \param StartLoc Starting location of the directive kind.
1605  /// \param EndLoc Ending Location of the directive.
1606  /// \param CollapsedNum Number of collapsed loops.
1607  /// \param Clauses List of clauses.
1608  /// \param AssociatedStmt Statement, associated with the directive.
1609  /// \param Exprs Helper expressions for CodeGen.
1610  /// \param HasCancel true if current directive has inner cancel directive.
1611  ///
1612  static OMPParallelForDirective *
1613  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
1614         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
1615         Stmt *AssociatedStmtconst HelperExprs &Exprsbool HasCancel);
1616
1617  /// Creates an empty directive with the place
1618  /// for \a NumClauses clauses.
1619  ///
1620  /// \param C AST context.
1621  /// \param CollapsedNum Number of collapsed nested loops.
1622  /// \param NumClauses Number of clauses.
1623  ///
1624  static OMPParallelForDirective *CreateEmpty(const ASTContext &C,
1625                                              unsigned NumClauses,
1626                                              unsigned CollapsedNum,
1627                                              EmptyShell);
1628
1629  /// Return true if current directive has inner cancel directive.
1630  bool hasCancel() const { return HasCancel; }
1631
1632  static bool classof(const Stmt *T) {
1633    return T->getStmtClass() == OMPParallelForDirectiveClass;
1634  }
1635};
1636
1637/// This represents '#pragma omp parallel for simd' directive.
1638///
1639/// \code
1640/// #pragma omp parallel for simd private(a,b) linear(i,j:s) reduction(+:c,d)
1641/// \endcode
1642/// In this example directive '#pragma omp parallel for simd' has clauses
1643/// 'private' with the variables 'a' and 'b', 'linear' with variables 'i', 'j'
1644/// and linear step 's', 'reduction' with operator '+' and variables 'c' and
1645/// 'd'.
1646///
1647class OMPParallelForSimdDirective : public OMPLoopDirective {
1648  friend class ASTStmtReader;
1649  /// Build directive with the given start and end location.
1650  ///
1651  /// \param StartLoc Starting location of the directive kind.
1652  /// \param EndLoc Ending location of the directive.
1653  /// \param CollapsedNum Number of collapsed nested loops.
1654  /// \param NumClauses Number of clauses.
1655  ///
1656  OMPParallelForSimdDirective(SourceLocation StartLocSourceLocation EndLoc,
1657                              unsigned CollapsedNumunsigned NumClauses)
1658      : OMPLoopDirective(this, OMPParallelForSimdDirectiveClass,
1659                         OMPD_parallel_for_simd, StartLoc, EndLoc, CollapsedNum,
1660                         NumClauses) {}
1661
1662  /// Build an empty directive.
1663  ///
1664  /// \param CollapsedNum Number of collapsed nested loops.
1665  /// \param NumClauses Number of clauses.
1666  ///
1667  explicit OMPParallelForSimdDirective(unsigned CollapsedNum,
1668                                       unsigned NumClauses)
1669      : OMPLoopDirective(this, OMPParallelForSimdDirectiveClass,
1670                         OMPD_parallel_for_simd, SourceLocation(),
1671                         SourceLocation(), CollapsedNum, NumClauses) {}
1672
1673public:
1674  /// Creates directive with a list of \a Clauses.
1675  ///
1676  /// \param C AST context.
1677  /// \param StartLoc Starting location of the directive kind.
1678  /// \param EndLoc Ending Location of the directive.
1679  /// \param CollapsedNum Number of collapsed loops.
1680  /// \param Clauses List of clauses.
1681  /// \param AssociatedStmt Statement, associated with the directive.
1682  /// \param Exprs Helper expressions for CodeGen.
1683  ///
1684  static OMPParallelForSimdDirective *
1685  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
1686         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
1687         Stmt *AssociatedStmtconst HelperExprs &Exprs);
1688
1689  /// Creates an empty directive with the place
1690  /// for \a NumClauses clauses.
1691  ///
1692  /// \param C AST context.
1693  /// \param CollapsedNum Number of collapsed nested loops.
1694  /// \param NumClauses Number of clauses.
1695  ///
1696  static OMPParallelForSimdDirective *CreateEmpty(const ASTContext &C,
1697                                                  unsigned NumClauses,
1698                                                  unsigned CollapsedNum,
1699                                                  EmptyShell);
1700
1701  static bool classof(const Stmt *T) {
1702    return T->getStmtClass() == OMPParallelForSimdDirectiveClass;
1703  }
1704};
1705
1706/// This represents '#pragma omp parallel sections' directive.
1707///
1708/// \code
1709/// #pragma omp parallel sections private(a,b) reduction(+:c,d)
1710/// \endcode
1711/// In this example directive '#pragma omp parallel sections' has clauses
1712/// 'private' with the variables 'a' and 'b' and 'reduction' with operator '+'
1713/// and variables 'c' and 'd'.
1714///
1715class OMPParallelSectionsDirective : public OMPExecutableDirective {
1716  friend class ASTStmtReader;
1717
1718  /// true if current directive has inner cancel directive.
1719  bool HasCancel;
1720
1721  /// Build directive with the given start and end location.
1722  ///
1723  /// \param StartLoc Starting location of the directive kind.
1724  /// \param EndLoc Ending location of the directive.
1725  /// \param NumClauses Number of clauses.
1726  ///
1727  OMPParallelSectionsDirective(SourceLocation StartLocSourceLocation EndLoc,
1728                               unsigned NumClauses)
1729      : OMPExecutableDirective(this, OMPParallelSectionsDirectiveClass,
1730                               OMPD_parallel_sections, StartLoc, EndLoc,
1731                               NumClauses, 1),
1732        HasCancel(false) {}
1733
1734  /// Build an empty directive.
1735  ///
1736  /// \param NumClauses Number of clauses.
1737  ///
1738  explicit OMPParallelSectionsDirective(unsigned NumClauses)
1739      : OMPExecutableDirective(this, OMPParallelSectionsDirectiveClass,
1740                               OMPD_parallel_sections, SourceLocation(),
1741                               SourceLocation(), NumClauses, 1),
1742        HasCancel(false) {}
1743
1744  /// Set cancel state.
1745  void setHasCancel(bool Has) { HasCancel = Has; }
1746
1747public:
1748  /// Creates directive with a list of \a Clauses.
1749  ///
1750  /// \param C AST context.
1751  /// \param StartLoc Starting location of the directive kind.
1752  /// \param EndLoc Ending Location of the directive.
1753  /// \param Clauses List of clauses.
1754  /// \param AssociatedStmt Statement, associated with the directive.
1755  /// \param HasCancel true if current directive has inner cancel directive.
1756  ///
1757  static OMPParallelSectionsDirective *
1758  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
1759         ArrayRef<OMPClause *> ClausesStmt *AssociatedStmtbool HasCancel);
1760
1761  /// Creates an empty directive with the place for \a NumClauses
1762  /// clauses.
1763  ///
1764  /// \param C AST context.
1765  /// \param NumClauses Number of clauses.
1766  ///
1767  static OMPParallelSectionsDirective *
1768  CreateEmpty(const ASTContext &Cunsigned NumClausesEmptyShell);
1769
1770  /// Return true if current directive has inner cancel directive.
1771  bool hasCancel() const { return HasCancel; }
1772
1773  static bool classof(const Stmt *T) {
1774    return T->getStmtClass() == OMPParallelSectionsDirectiveClass;
1775  }
1776};
1777
1778/// This represents '#pragma omp task' directive.
1779///
1780/// \code
1781/// #pragma omp task private(a,b) final(d)
1782/// \endcode
1783/// In this example directive '#pragma omp task' has clauses 'private' with the
1784/// variables 'a' and 'b' and 'final' with condition 'd'.
1785///
1786class OMPTaskDirective : public OMPExecutableDirective {
1787  friend class ASTStmtReader;
1788  /// true if this directive has inner cancel directive.
1789  bool HasCancel;
1790
1791  /// Build directive with the given start and end location.
1792  ///
1793  /// \param StartLoc Starting location of the directive kind.
1794  /// \param EndLoc Ending location of the directive.
1795  /// \param NumClauses Number of clauses.
1796  ///
1797  OMPTaskDirective(SourceLocation StartLocSourceLocation EndLoc,
1798                   unsigned NumClauses)
1799      : OMPExecutableDirective(this, OMPTaskDirectiveClass, OMPD_task, StartLoc,
1800                               EndLoc, NumClauses, 1),
1801        HasCancel(false) {}
1802
1803  /// Build an empty directive.
1804  ///
1805  /// \param NumClauses Number of clauses.
1806  ///
1807  explicit OMPTaskDirective(unsigned NumClauses)
1808      : OMPExecutableDirective(this, OMPTaskDirectiveClass, OMPD_task,
1809                               SourceLocation(), SourceLocation(), NumClauses,
1810                               1),
1811        HasCancel(false) {}
1812
1813  /// Set cancel state.
1814  void setHasCancel(bool Has) { HasCancel = Has; }
1815
1816public:
1817  /// Creates directive with a list of \a Clauses.
1818  ///
1819  /// \param C AST context.
1820  /// \param StartLoc Starting location of the directive kind.
1821  /// \param EndLoc Ending Location of the directive.
1822  /// \param Clauses List of clauses.
1823  /// \param AssociatedStmt Statement, associated with the directive.
1824  /// \param HasCancel true, if current directive has inner cancel directive.
1825  ///
1826  static OMPTaskDirective *Create(const ASTContext &CSourceLocation StartLoc,
1827                                  SourceLocation EndLoc,
1828                                  ArrayRef<OMPClause *> Clauses,
1829                                  Stmt *AssociatedStmtbool HasCancel);
1830
1831  /// Creates an empty directive with the place for \a NumClauses
1832  /// clauses.
1833  ///
1834  /// \param C AST context.
1835  /// \param NumClauses Number of clauses.
1836  ///
1837  static OMPTaskDirective *CreateEmpty(const ASTContext &Cunsigned NumClauses,
1838                                       EmptyShell);
1839
1840  /// Return true if current directive has inner cancel directive.
1841  bool hasCancel() const { return HasCancel; }
1842
1843  static bool classof(const Stmt *T) {
1844    return T->getStmtClass() == OMPTaskDirectiveClass;
1845  }
1846};
1847
1848/// This represents '#pragma omp taskyield' directive.
1849///
1850/// \code
1851/// #pragma omp taskyield
1852/// \endcode
1853///
1854class OMPTaskyieldDirective : public OMPExecutableDirective {
1855  friend class ASTStmtReader;
1856  /// Build directive with the given start and end location.
1857  ///
1858  /// \param StartLoc Starting location of the directive kind.
1859  /// \param EndLoc Ending location of the directive.
1860  ///
1861  OMPTaskyieldDirective(SourceLocation StartLocSourceLocation EndLoc)
1862      : OMPExecutableDirective(this, OMPTaskyieldDirectiveClass, OMPD_taskyield,
1863                               StartLoc, EndLoc, 00) {}
1864
1865  /// Build an empty directive.
1866  ///
1867  explicit OMPTaskyieldDirective()
1868      : OMPExecutableDirective(this, OMPTaskyieldDirectiveClass, OMPD_taskyield,
1869                               SourceLocation(), SourceLocation(), 00) {}
1870
1871public:
1872  /// Creates directive.
1873  ///
1874  /// \param C AST context.
1875  /// \param StartLoc Starting location of the directive kind.
1876  /// \param EndLoc Ending Location of the directive.
1877  ///
1878  static OMPTaskyieldDirective *
1879  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc);
1880
1881  /// Creates an empty directive.
1882  ///
1883  /// \param C AST context.
1884  ///
1885  static OMPTaskyieldDirective *CreateEmpty(const ASTContext &CEmptyShell);
1886
1887  static bool classof(const Stmt *T) {
1888    return T->getStmtClass() == OMPTaskyieldDirectiveClass;
1889  }
1890};
1891
1892/// This represents '#pragma omp barrier' directive.
1893///
1894/// \code
1895/// #pragma omp barrier
1896/// \endcode
1897///
1898class OMPBarrierDirective : public OMPExecutableDirective {
1899  friend class ASTStmtReader;
1900  /// Build directive with the given start and end location.
1901  ///
1902  /// \param StartLoc Starting location of the directive kind.
1903  /// \param EndLoc Ending location of the directive.
1904  ///
1905  OMPBarrierDirective(SourceLocation StartLocSourceLocation EndLoc)
1906      : OMPExecutableDirective(this, OMPBarrierDirectiveClass, OMPD_barrier,
1907                               StartLoc, EndLoc, 00) {}
1908
1909  /// Build an empty directive.
1910  ///
1911  explicit OMPBarrierDirective()
1912      : OMPExecutableDirective(this, OMPBarrierDirectiveClass, OMPD_barrier,
1913                               SourceLocation(), SourceLocation(), 00) {}
1914
1915public:
1916  /// Creates directive.
1917  ///
1918  /// \param C AST context.
1919  /// \param StartLoc Starting location of the directive kind.
1920  /// \param EndLoc Ending Location of the directive.
1921  ///
1922  static OMPBarrierDirective *
1923  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc);
1924
1925  /// Creates an empty directive.
1926  ///
1927  /// \param C AST context.
1928  ///
1929  static OMPBarrierDirective *CreateEmpty(const ASTContext &CEmptyShell);
1930
1931  static bool classof(const Stmt *T) {
1932    return T->getStmtClass() == OMPBarrierDirectiveClass;
1933  }
1934};
1935
1936/// This represents '#pragma omp taskwait' directive.
1937///
1938/// \code
1939/// #pragma omp taskwait
1940/// \endcode
1941///
1942class OMPTaskwaitDirective : public OMPExecutableDirective {
1943  friend class ASTStmtReader;
1944  /// Build directive with the given start and end location.
1945  ///
1946  /// \param StartLoc Starting location of the directive kind.
1947  /// \param EndLoc Ending location of the directive.
1948  ///
1949  OMPTaskwaitDirective(SourceLocation StartLocSourceLocation EndLoc)
1950      : OMPExecutableDirective(this, OMPTaskwaitDirectiveClass, OMPD_taskwait,
1951                               StartLoc, EndLoc, 00) {}
1952
1953  /// Build an empty directive.
1954  ///
1955  explicit OMPTaskwaitDirective()
1956      : OMPExecutableDirective(this, OMPTaskwaitDirectiveClass, OMPD_taskwait,
1957                               SourceLocation(), SourceLocation(), 00) {}
1958
1959public:
1960  /// Creates directive.
1961  ///
1962  /// \param C AST context.
1963  /// \param StartLoc Starting location of the directive kind.
1964  /// \param EndLoc Ending Location of the directive.
1965  ///
1966  static OMPTaskwaitDirective *
1967  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc);
1968
1969  /// Creates an empty directive.
1970  ///
1971  /// \param C AST context.
1972  ///
1973  static OMPTaskwaitDirective *CreateEmpty(const ASTContext &CEmptyShell);
1974
1975  static bool classof(const Stmt *T) {
1976    return T->getStmtClass() == OMPTaskwaitDirectiveClass;
1977  }
1978};
1979
1980/// This represents '#pragma omp taskgroup' directive.
1981///
1982/// \code
1983/// #pragma omp taskgroup
1984/// \endcode
1985///
1986class OMPTaskgroupDirective : public OMPExecutableDirective {
1987  friend class ASTStmtReader;
1988  /// Build directive with the given start and end location.
1989  ///
1990  /// \param StartLoc Starting location of the directive kind.
1991  /// \param EndLoc Ending location of the directive.
1992  /// \param NumClauses Number of clauses.
1993  ///
1994  OMPTaskgroupDirective(SourceLocation StartLocSourceLocation EndLoc,
1995                        unsigned NumClauses)
1996      : OMPExecutableDirective(this, OMPTaskgroupDirectiveClass, OMPD_taskgroup,
1997                               StartLoc, EndLoc, NumClauses, 2) {}
1998
1999  /// Build an empty directive.
2000  /// \param NumClauses Number of clauses.
2001  ///
2002  explicit OMPTaskgroupDirective(unsigned NumClauses)
2003      : OMPExecutableDirective(this, OMPTaskgroupDirectiveClass, OMPD_taskgroup,
2004                               SourceLocation(), SourceLocation(), NumClauses,
2005                               2) {}
2006
2007  /// Sets the task_reduction return variable.
2008  void setReductionRef(Expr *RR) {
2009    *std::next(child_begin(), 1) = RR;
2010  }
2011
2012public:
2013  /// Creates directive.
2014  ///
2015  /// \param C AST context.
2016  /// \param StartLoc Starting location of the directive kind.
2017  /// \param EndLoc Ending Location of the directive.
2018  /// \param Clauses List of clauses.
2019  /// \param AssociatedStmt Statement, associated with the directive.
2020  /// \param ReductionRef Reference to the task_reduction return variable.
2021  ///
2022  static OMPTaskgroupDirective *
2023  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
2024         ArrayRef<OMPClause *> ClausesStmt *AssociatedStmt,
2025         Expr *ReductionRef);
2026
2027  /// Creates an empty directive.
2028  ///
2029  /// \param C AST context.
2030  /// \param NumClauses Number of clauses.
2031  ///
2032  static OMPTaskgroupDirective *CreateEmpty(const ASTContext &C,
2033                                            unsigned NumClausesEmptyShell);
2034
2035
2036  /// Returns reference to the task_reduction return variable.
2037  const Expr *getReductionRef() const {
2038    return static_cast<const Expr *>(*std::next(child_begin(), 1));
2039  }
2040  Expr *getReductionRef() {
2041    return static_cast<Expr *>(*std::next(child_begin(), 1));
2042  }
2043
2044  static bool classof(const Stmt *T) {
2045    return T->getStmtClass() == OMPTaskgroupDirectiveClass;
2046  }
2047};
2048
2049/// This represents '#pragma omp flush' directive.
2050///
2051/// \code
2052/// #pragma omp flush(a,b)
2053/// \endcode
2054/// In this example directive '#pragma omp flush' has 2 arguments- variables 'a'
2055/// and 'b'.
2056/// 'omp flush' directive does not have clauses but have an optional list of
2057/// variables to flush. This list of variables is stored within some fake clause
2058/// FlushClause.
2059class OMPFlushDirective : public OMPExecutableDirective {
2060  friend class ASTStmtReader;
2061  /// Build directive with the given start and end location.
2062  ///
2063  /// \param StartLoc Starting location of the directive kind.
2064  /// \param EndLoc Ending location of the directive.
2065  /// \param NumClauses Number of clauses.
2066  ///
2067  OMPFlushDirective(SourceLocation StartLocSourceLocation EndLoc,
2068                    unsigned NumClauses)
2069      : OMPExecutableDirective(this, OMPFlushDirectiveClass, OMPD_flush,
2070                               StartLoc, EndLoc, NumClauses, 0) {}
2071
2072  /// Build an empty directive.
2073  ///
2074  /// \param NumClauses Number of clauses.
2075  ///
2076  explicit OMPFlushDirective(unsigned NumClauses)
2077      : OMPExecutableDirective(this, OMPFlushDirectiveClass, OMPD_flush,
2078                               SourceLocation(), SourceLocation(), NumClauses,
2079                               0) {}
2080
2081public:
2082  /// Creates directive with a list of \a Clauses.
2083  ///
2084  /// \param C AST context.
2085  /// \param StartLoc Starting location of the directive kind.
2086  /// \param EndLoc Ending Location of the directive.
2087  /// \param Clauses List of clauses (only single OMPFlushClause clause is
2088  /// allowed).
2089  ///
2090  static OMPFlushDirective *Create(const ASTContext &CSourceLocation StartLoc,
2091                                   SourceLocation EndLoc,
2092                                   ArrayRef<OMPClause *> Clauses);
2093
2094  /// Creates an empty directive with the place for \a NumClauses
2095  /// clauses.
2096  ///
2097  /// \param C AST context.
2098  /// \param NumClauses Number of clauses.
2099  ///
2100  static OMPFlushDirective *CreateEmpty(const ASTContext &C,
2101                                        unsigned NumClausesEmptyShell);
2102
2103  static bool classof(const Stmt *T) {
2104    return T->getStmtClass() == OMPFlushDirectiveClass;
2105  }
2106};
2107
2108/// This represents '#pragma omp ordered' directive.
2109///
2110/// \code
2111/// #pragma omp ordered
2112/// \endcode
2113///
2114class OMPOrderedDirective : public OMPExecutableDirective {
2115  friend class ASTStmtReader;
2116  /// Build directive with the given start and end location.
2117  ///
2118  /// \param StartLoc Starting location of the directive kind.
2119  /// \param EndLoc Ending location of the directive.
2120  /// \param NumClauses Number of clauses.
2121  ///
2122  OMPOrderedDirective(SourceLocation StartLocSourceLocation EndLoc,
2123                      unsigned NumClauses)
2124      : OMPExecutableDirective(this, OMPOrderedDirectiveClass, OMPD_ordered,
2125                               StartLoc, EndLoc, NumClauses, 1) {}
2126
2127  /// Build an empty directive.
2128  ///
2129  /// \param NumClauses Number of clauses.
2130  ///
2131  explicit OMPOrderedDirective(unsigned NumClauses)
2132      : OMPExecutableDirective(this, OMPOrderedDirectiveClass, OMPD_ordered,
2133                               SourceLocation(), SourceLocation(), NumClauses,
2134                               1) {}
2135
2136public:
2137  /// Creates directive.
2138  ///
2139  /// \param C AST context.
2140  /// \param StartLoc Starting location of the directive kind.
2141  /// \param EndLoc Ending Location of the directive.
2142  /// \param Clauses List of clauses.
2143  /// \param AssociatedStmt Statement, associated with the directive.
2144  ///
2145  static OMPOrderedDirective *
2146  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
2147         ArrayRef<OMPClause *> ClausesStmt *AssociatedStmt);
2148
2149  /// Creates an empty directive.
2150  ///
2151  /// \param C AST context.
2152  /// \param NumClauses Number of clauses.
2153  ///
2154  static OMPOrderedDirective *CreateEmpty(const ASTContext &C,
2155                                          unsigned NumClausesEmptyShell);
2156
2157  static bool classof(const Stmt *T) {
2158    return T->getStmtClass() == OMPOrderedDirectiveClass;
2159  }
2160};
2161
2162/// This represents '#pragma omp atomic' directive.
2163///
2164/// \code
2165/// #pragma omp atomic capture
2166/// \endcode
2167/// In this example directive '#pragma omp atomic' has clause 'capture'.
2168///
2169class OMPAtomicDirective : public OMPExecutableDirective {
2170  friend class ASTStmtReader;
2171  /// Used for 'atomic update' or 'atomic capture' constructs. They may
2172  /// have atomic expressions of forms
2173  /// \code
2174  /// x = x binop expr;
2175  /// x = expr binop x;
2176  /// \endcode
2177  /// This field is true for the first form of the expression and false for the
2178  /// second. Required for correct codegen of non-associative operations (like
2179  /// << or >>).
2180  bool IsXLHSInRHSPart;
2181  /// Used for 'atomic update' or 'atomic capture' constructs. They may
2182  /// have atomic expressions of forms
2183  /// \code
2184  /// v = x; <update x>;
2185  /// <update x>; v = x;
2186  /// \endcode
2187  /// This field is true for the first(postfix) form of the expression and false
2188  /// otherwise.
2189  bool IsPostfixUpdate;
2190
2191  /// Build directive with the given start and end location.
2192  ///
2193  /// \param StartLoc Starting location of the directive kind.
2194  /// \param EndLoc Ending location of the directive.
2195  /// \param NumClauses Number of clauses.
2196  ///
2197  OMPAtomicDirective(SourceLocation StartLocSourceLocation EndLoc,
2198                     unsigned NumClauses)
2199      : OMPExecutableDirective(this, OMPAtomicDirectiveClass, OMPD_atomic,
2200                               StartLoc, EndLoc, NumClauses, 5),
2201        IsXLHSInRHSPart(false), IsPostfixUpdate(false) {}
2202
2203  /// Build an empty directive.
2204  ///
2205  /// \param NumClauses Number of clauses.
2206  ///
2207  explicit OMPAtomicDirective(unsigned NumClauses)
2208      : OMPExecutableDirective(this, OMPAtomicDirectiveClass, OMPD_atomic,
2209                               SourceLocation(), SourceLocation(), NumClauses,
2210                               5),
2211        IsXLHSInRHSPart(false), IsPostfixUpdate(false) {}
2212
2213  /// Set 'x' part of the associated expression/statement.
2214  void setX(Expr *X) { *std::next(child_begin()) = X; }
2215  /// Set helper expression of the form
2216  /// 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or
2217  /// 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'.
2218  void setUpdateExpr(Expr *UE) { *std::next(child_begin(), 2) = UE; }
2219  /// Set 'v' part of the associated expression/statement.
2220  void setV(Expr *V) { *std::next(child_begin(), 3) = V; }
2221  /// Set 'expr' part of the associated expression/statement.
2222  void setExpr(Expr *E) { *std::next(child_begin(), 4) = E; }
2223
2224public:
2225  /// Creates directive with a list of \a Clauses and 'x', 'v' and 'expr'
2226  /// parts of the atomic construct (see Section 2.12.6, atomic Construct, for
2227  /// detailed description of 'x', 'v' and 'expr').
2228  ///
2229  /// \param C AST context.
2230  /// \param StartLoc Starting location of the directive kind.
2231  /// \param EndLoc Ending Location of the directive.
2232  /// \param Clauses List of clauses.
2233  /// \param AssociatedStmt Statement, associated with the directive.
2234  /// \param X 'x' part of the associated expression/statement.
2235  /// \param V 'v' part of the associated expression/statement.
2236  /// \param E 'expr' part of the associated expression/statement.
2237  /// \param UE Helper expression of the form
2238  /// 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or
2239  /// 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'.
2240  /// \param IsXLHSInRHSPart true if \a UE has the first form and false if the
2241  /// second.
2242  /// \param IsPostfixUpdate true if original value of 'x' must be stored in
2243  /// 'v', not an updated one.
2244  static OMPAtomicDirective *
2245  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
2246         ArrayRef<OMPClause *> ClausesStmt *AssociatedStmtExpr *XExpr *V,
2247         Expr *EExpr *UEbool IsXLHSInRHSPartbool IsPostfixUpdate);
2248
2249  /// Creates an empty directive with the place for \a NumClauses
2250  /// clauses.
2251  ///
2252  /// \param C AST context.
2253  /// \param NumClauses Number of clauses.
2254  ///
2255  static OMPAtomicDirective *CreateEmpty(const ASTContext &C,
2256                                         unsigned NumClausesEmptyShell);
2257
2258  /// Get 'x' part of the associated expression/statement.
2259  Expr *getX() { return cast_or_null<Expr>(*std::next(child_begin())); }
2260  const Expr *getX() const {
2261    return cast_or_null<Expr>(*std::next(child_begin()));
2262  }
2263  /// Get helper expression of the form
2264  /// 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or
2265  /// 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'.
2266  Expr *getUpdateExpr() {
2267    return cast_or_null<Expr>(*std::next(child_begin(), 2));
2268  }
2269  const Expr *getUpdateExpr() const {
2270    return cast_or_null<Expr>(*std::next(child_begin(), 2));
2271  }
2272  /// Return true if helper update expression has form
2273  /// 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' and false if it has form
2274  /// 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'.
2275  bool isXLHSInRHSPart() const { return IsXLHSInRHSPart; }
2276  /// Return true if 'v' expression must be updated to original value of
2277  /// 'x', false if 'v' must be updated to the new value of 'x'.
2278  bool isPostfixUpdate() const { return IsPostfixUpdate; }
2279  /// Get 'v' part of the associated expression/statement.
2280  Expr *getV() { return cast_or_null<Expr>(*std::next(child_begin(), 3)); }
2281  const Expr *getV() const {
2282    return cast_or_null<Expr>(*std::next(child_begin(), 3));
2283  }
2284  /// Get 'expr' part of the associated expression/statement.
2285  Expr *getExpr() { return cast_or_null<Expr>(*std::next(child_begin(), 4)); }
2286  const Expr *getExpr() const {
2287    return cast_or_null<Expr>(*std::next(child_begin(), 4));
2288  }
2289
2290  static bool classof(const Stmt *T) {
2291    return T->getStmtClass() == OMPAtomicDirectiveClass;
2292  }
2293};
2294
2295/// This represents '#pragma omp target' directive.
2296///
2297/// \code
2298/// #pragma omp target if(a)
2299/// \endcode
2300/// In this example directive '#pragma omp target' has clause 'if' with
2301/// condition 'a'.
2302///
2303class OMPTargetDirective : public OMPExecutableDirective {
2304  friend class ASTStmtReader;
2305  /// Build directive with the given start and end location.
2306  ///
2307  /// \param StartLoc Starting location of the directive kind.
2308  /// \param EndLoc Ending location of the directive.
2309  /// \param NumClauses Number of clauses.
2310  ///
2311  OMPTargetDirective(SourceLocation StartLocSourceLocation EndLoc,
2312                     unsigned NumClauses)
2313      : OMPExecutableDirective(this, OMPTargetDirectiveClass, OMPD_target,
2314                               StartLoc, EndLoc, NumClauses, 1) {}
2315
2316  /// Build an empty directive.
2317  ///
2318  /// \param NumClauses Number of clauses.
2319  ///
2320  explicit OMPTargetDirective(unsigned NumClauses)
2321      : OMPExecutableDirective(this, OMPTargetDirectiveClass, OMPD_target,
2322                               SourceLocation(), SourceLocation(), NumClauses,
2323                               1) {}
2324
2325public:
2326  /// Creates directive with a list of \a Clauses.
2327  ///
2328  /// \param C AST context.
2329  /// \param StartLoc Starting location of the directive kind.
2330  /// \param EndLoc Ending Location of the directive.
2331  /// \param Clauses List of clauses.
2332  /// \param AssociatedStmt Statement, associated with the directive.
2333  ///
2334  static OMPTargetDirective *
2335  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
2336         ArrayRef<OMPClause *> ClausesStmt *AssociatedStmt);
2337
2338  /// Creates an empty directive with the place for \a NumClauses
2339  /// clauses.
2340  ///
2341  /// \param C AST context.
2342  /// \param NumClauses Number of clauses.
2343  ///
2344  static OMPTargetDirective *CreateEmpty(const ASTContext &C,
2345                                         unsigned NumClausesEmptyShell);
2346
2347  static bool classof(const Stmt *T) {
2348    return T->getStmtClass() == OMPTargetDirectiveClass;
2349  }
2350};
2351
2352/// This represents '#pragma omp target data' directive.
2353///
2354/// \code
2355/// #pragma omp target data device(0) if(a) map(b[:])
2356/// \endcode
2357/// In this example directive '#pragma omp target data' has clauses 'device'
2358/// with the value '0', 'if' with condition 'a' and 'map' with array
2359/// section 'b[:]'.
2360///
2361class OMPTargetDataDirective : public OMPExecutableDirective {
2362  friend class ASTStmtReader;
2363  /// Build directive with the given start and end location.
2364  ///
2365  /// \param StartLoc Starting location of the directive kind.
2366  /// \param EndLoc Ending Location of the directive.
2367  /// \param NumClauses The number of clauses.
2368  ///
2369  OMPTargetDataDirective(SourceLocation StartLocSourceLocation EndLoc,
2370                         unsigned NumClauses)
2371      : OMPExecutableDirective(this, OMPTargetDataDirectiveClass,
2372                               OMPD_target_data, StartLoc, EndLoc, NumClauses,
2373                               1) {}
2374
2375  /// Build an empty directive.
2376  ///
2377  /// \param NumClauses Number of clauses.
2378  ///
2379  explicit OMPTargetDataDirective(unsigned NumClauses)
2380      : OMPExecutableDirective(this, OMPTargetDataDirectiveClass,
2381                               OMPD_target_data, SourceLocation(),
2382                               SourceLocation(), NumClauses, 1) {}
2383
2384public:
2385  /// Creates directive with a list of \a Clauses.
2386  ///
2387  /// \param C AST context.
2388  /// \param StartLoc Starting location of the directive kind.
2389  /// \param EndLoc Ending Location of the directive.
2390  /// \param Clauses List of clauses.
2391  /// \param AssociatedStmt Statement, associated with the directive.
2392  ///
2393  static OMPTargetDataDirective *
2394  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
2395         ArrayRef<OMPClause *> ClausesStmt *AssociatedStmt);
2396
2397  /// Creates an empty directive with the place for \a N clauses.
2398  ///
2399  /// \param C AST context.
2400  /// \param N The number of clauses.
2401  ///
2402  static OMPTargetDataDirective *CreateEmpty(const ASTContext &Cunsigned N,
2403                                             EmptyShell);
2404
2405  static bool classof(const Stmt *T) {
2406    return T->getStmtClass() == OMPTargetDataDirectiveClass;
2407  }
2408};
2409
2410/// This represents '#pragma omp target enter data' directive.
2411///
2412/// \code
2413/// #pragma omp target enter data device(0) if(a) map(b[:])
2414/// \endcode
2415/// In this example directive '#pragma omp target enter data' has clauses
2416/// 'device' with the value '0', 'if' with condition 'a' and 'map' with array
2417/// section 'b[:]'.
2418///
2419class OMPTargetEnterDataDirective : public OMPExecutableDirective {
2420  friend class ASTStmtReader;
2421  /// Build directive with the given start and end location.
2422  ///
2423  /// \param StartLoc Starting location of the directive kind.
2424  /// \param EndLoc Ending Location of the directive.
2425  /// \param NumClauses The number of clauses.
2426  ///
2427  OMPTargetEnterDataDirective(SourceLocation StartLocSourceLocation EndLoc,
2428                              unsigned NumClauses)
2429      : OMPExecutableDirective(this, OMPTargetEnterDataDirectiveClass,
2430                               OMPD_target_enter_data, StartLoc, EndLoc,
2431                               NumClauses, /*NumChildren=*/1) {}
2432
2433  /// Build an empty directive.
2434  ///
2435  /// \param NumClauses Number of clauses.
2436  ///
2437  explicit OMPTargetEnterDataDirective(unsigned NumClauses)
2438      : OMPExecutableDirective(this, OMPTargetEnterDataDirectiveClass,
2439                               OMPD_target_enter_data, SourceLocation(),
2440                               SourceLocation(), NumClauses,
2441                               /*NumChildren=*/1) {}
2442
2443public:
2444  /// Creates directive with a list of \a Clauses.
2445  ///
2446  /// \param C AST context.
2447  /// \param StartLoc Starting location of the directive kind.
2448  /// \param EndLoc Ending Location of the directive.
2449  /// \param Clauses List of clauses.
2450  /// \param AssociatedStmt Statement, associated with the directive.
2451  ///
2452  static OMPTargetEnterDataDirective *
2453  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
2454         ArrayRef<OMPClause *> ClausesStmt *AssociatedStmt);
2455
2456  /// Creates an empty directive with the place for \a N clauses.
2457  ///
2458  /// \param C AST context.
2459  /// \param N The number of clauses.
2460  ///
2461  static OMPTargetEnterDataDirective *CreateEmpty(const ASTContext &C,
2462                                                  unsigned NEmptyShell);
2463
2464  static bool classof(const Stmt *T) {
2465    return T->getStmtClass() == OMPTargetEnterDataDirectiveClass;
2466  }
2467};
2468
2469/// This represents '#pragma omp target exit data' directive.
2470///
2471/// \code
2472/// #pragma omp target exit data device(0) if(a) map(b[:])
2473/// \endcode
2474/// In this example directive '#pragma omp target exit data' has clauses
2475/// 'device' with the value '0', 'if' with condition 'a' and 'map' with array
2476/// section 'b[:]'.
2477///
2478class OMPTargetExitDataDirective : public OMPExecutableDirective {
2479  friend class ASTStmtReader;
2480  /// Build directive with the given start and end location.
2481  ///
2482  /// \param StartLoc Starting location of the directive kind.
2483  /// \param EndLoc Ending Location of the directive.
2484  /// \param NumClauses The number of clauses.
2485  ///
2486  OMPTargetExitDataDirective(SourceLocation StartLocSourceLocation EndLoc,
2487                             unsigned NumClauses)
2488      : OMPExecutableDirective(this, OMPTargetExitDataDirectiveClass,
2489                               OMPD_target_exit_data, StartLoc, EndLoc,
2490                               NumClauses, /*NumChildren=*/1) {}
2491
2492  /// Build an empty directive.
2493  ///
2494  /// \param NumClauses Number of clauses.
2495  ///
2496  explicit OMPTargetExitDataDirective(unsigned NumClauses)
2497      : OMPExecutableDirective(this, OMPTargetExitDataDirectiveClass,
2498                               OMPD_target_exit_data, SourceLocation(),
2499                               SourceLocation(), NumClauses,
2500                               /*NumChildren=*/1) {}
2501
2502public:
2503  /// Creates directive with a list of \a Clauses.
2504  ///
2505  /// \param C AST context.
2506  /// \param StartLoc Starting location of the directive kind.
2507  /// \param EndLoc Ending Location of the directive.
2508  /// \param Clauses List of clauses.
2509  /// \param AssociatedStmt Statement, associated with the directive.
2510  ///
2511  static OMPTargetExitDataDirective *
2512  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
2513         ArrayRef<OMPClause *> ClausesStmt *AssociatedStmt);
2514
2515  /// Creates an empty directive with the place for \a N clauses.
2516  ///
2517  /// \param C AST context.
2518  /// \param N The number of clauses.
2519  ///
2520  static OMPTargetExitDataDirective *CreateEmpty(const ASTContext &C,
2521                                                 unsigned NEmptyShell);
2522
2523  static bool classof(const Stmt *T) {
2524    return T->getStmtClass() == OMPTargetExitDataDirectiveClass;
2525  }
2526};
2527
2528/// This represents '#pragma omp target parallel' directive.
2529///
2530/// \code
2531/// #pragma omp target parallel if(a)
2532/// \endcode
2533/// In this example directive '#pragma omp target parallel' has clause 'if' with
2534/// condition 'a'.
2535///
2536class OMPTargetParallelDirective : public OMPExecutableDirective {
2537  friend class ASTStmtReader;
2538  /// Build directive with the given start and end location.
2539  ///
2540  /// \param StartLoc Starting location of the directive kind.
2541  /// \param EndLoc Ending location of the directive.
2542  /// \param NumClauses Number of clauses.
2543  ///
2544  OMPTargetParallelDirective(SourceLocation StartLocSourceLocation EndLoc,
2545                             unsigned NumClauses)
2546      : OMPExecutableDirective(this, OMPTargetParallelDirectiveClass,
2547                               OMPD_target_parallel, StartLoc, EndLoc,
2548                               NumClauses, /*NumChildren=*/1) {}
2549
2550  /// Build an empty directive.
2551  ///
2552  /// \param NumClauses Number of clauses.
2553  ///
2554  explicit OMPTargetParallelDirective(unsigned NumClauses)
2555      : OMPExecutableDirective(this, OMPTargetParallelDirectiveClass,
2556                               OMPD_target_parallel, SourceLocation(),
2557                               SourceLocation(), NumClauses,
2558                               /*NumChildren=*/1) {}
2559
2560public:
2561  /// Creates directive with a list of \a Clauses.
2562  ///
2563  /// \param C AST context.
2564  /// \param StartLoc Starting location of the directive kind.
2565  /// \param EndLoc Ending Location of the directive.
2566  /// \param Clauses List of clauses.
2567  /// \param AssociatedStmt Statement, associated with the directive.
2568  ///
2569  static OMPTargetParallelDirective *
2570  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
2571         ArrayRef<OMPClause *> ClausesStmt *AssociatedStmt);
2572
2573  /// Creates an empty directive with the place for \a NumClauses
2574  /// clauses.
2575  ///
2576  /// \param C AST context.
2577  /// \param NumClauses Number of clauses.
2578  ///
2579  static OMPTargetParallelDirective *
2580  CreateEmpty(const ASTContext &Cunsigned NumClausesEmptyShell);
2581
2582  static bool classof(const Stmt *T) {
2583    return T->getStmtClass() == OMPTargetParallelDirectiveClass;
2584  }
2585};
2586
2587/// This represents '#pragma omp target parallel for' directive.
2588///
2589/// \code
2590/// #pragma omp target parallel for private(a,b) reduction(+:c,d)
2591/// \endcode
2592/// In this example directive '#pragma omp target parallel for' has clauses
2593/// 'private' with the variables 'a' and 'b' and 'reduction' with operator '+'
2594/// and variables 'c' and 'd'.
2595///
2596class OMPTargetParallelForDirective : public OMPLoopDirective {
2597  friend class ASTStmtReader;
2598
2599  /// true if current region has inner cancel directive.
2600  bool HasCancel;
2601
2602  /// Build directive with the given start and end location.
2603  ///
2604  /// \param StartLoc Starting location of the directive kind.
2605  /// \param EndLoc Ending location of the directive.
2606  /// \param CollapsedNum Number of collapsed nested loops.
2607  /// \param NumClauses Number of clauses.
2608  ///
2609  OMPTargetParallelForDirective(SourceLocation StartLocSourceLocation EndLoc,
2610                                unsigned CollapsedNumunsigned NumClauses)
2611      : OMPLoopDirective(this, OMPTargetParallelForDirectiveClass,
2612                         OMPD_target_parallel_for, StartLoc, EndLoc,
2613                         CollapsedNum, NumClauses),
2614        HasCancel(false) {}
2615
2616  /// Build an empty directive.
2617  ///
2618  /// \param CollapsedNum Number of collapsed nested loops.
2619  /// \param NumClauses Number of clauses.
2620  ///
2621  explicit OMPTargetParallelForDirective(unsigned CollapsedNum,
2622                                         unsigned NumClauses)
2623      : OMPLoopDirective(this, OMPTargetParallelForDirectiveClass,
2624                         OMPD_target_parallel_for, SourceLocation(),
2625                         SourceLocation(), CollapsedNum, NumClauses),
2626        HasCancel(false) {}
2627
2628  /// Set cancel state.
2629  void setHasCancel(bool Has) { HasCancel = Has; }
2630
2631public:
2632  /// Creates directive with a list of \a Clauses.
2633  ///
2634  /// \param C AST context.
2635  /// \param StartLoc Starting location of the directive kind.
2636  /// \param EndLoc Ending Location of the directive.
2637  /// \param CollapsedNum Number of collapsed loops.
2638  /// \param Clauses List of clauses.
2639  /// \param AssociatedStmt Statement, associated with the directive.
2640  /// \param Exprs Helper expressions for CodeGen.
2641  /// \param HasCancel true if current directive has inner cancel directive.
2642  ///
2643  static OMPTargetParallelForDirective *
2644  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
2645         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
2646         Stmt *AssociatedStmtconst HelperExprs &Exprsbool HasCancel);
2647
2648  /// Creates an empty directive with the place
2649  /// for \a NumClauses clauses.
2650  ///
2651  /// \param C AST context.
2652  /// \param CollapsedNum Number of collapsed nested loops.
2653  /// \param NumClauses Number of clauses.
2654  ///
2655  static OMPTargetParallelForDirective *CreateEmpty(const ASTContext &C,
2656                                                    unsigned NumClauses,
2657                                                    unsigned CollapsedNum,
2658                                                    EmptyShell);
2659
2660  /// Return true if current directive has inner cancel directive.
2661  bool hasCancel() const { return HasCancel; }
2662
2663  static bool classof(const Stmt *T) {
2664    return T->getStmtClass() == OMPTargetParallelForDirectiveClass;
2665  }
2666};
2667
2668/// This represents '#pragma omp teams' directive.
2669///
2670/// \code
2671/// #pragma omp teams if(a)
2672/// \endcode
2673/// In this example directive '#pragma omp teams' has clause 'if' with
2674/// condition 'a'.
2675///
2676class OMPTeamsDirective : public OMPExecutableDirective {
2677  friend class ASTStmtReader;
2678  /// Build directive with the given start and end location.
2679  ///
2680  /// \param StartLoc Starting location of the directive kind.
2681  /// \param EndLoc Ending location of the directive.
2682  /// \param NumClauses Number of clauses.
2683  ///
2684  OMPTeamsDirective(SourceLocation StartLocSourceLocation EndLoc,
2685                    unsigned NumClauses)
2686      : OMPExecutableDirective(this, OMPTeamsDirectiveClass, OMPD_teams,
2687                               StartLoc, EndLoc, NumClauses, 1) {}
2688
2689  /// Build an empty directive.
2690  ///
2691  /// \param NumClauses Number of clauses.
2692  ///
2693  explicit OMPTeamsDirective(unsigned NumClauses)
2694      : OMPExecutableDirective(this, OMPTeamsDirectiveClass, OMPD_teams,
2695                               SourceLocation(), SourceLocation(), NumClauses,
2696                               1) {}
2697
2698public:
2699  /// Creates directive with a list of \a Clauses.
2700  ///
2701  /// \param C AST context.
2702  /// \param StartLoc Starting location of the directive kind.
2703  /// \param EndLoc Ending Location of the directive.
2704  /// \param Clauses List of clauses.
2705  /// \param AssociatedStmt Statement, associated with the directive.
2706  ///
2707  static OMPTeamsDirective *Create(const ASTContext &CSourceLocation StartLoc,
2708                                   SourceLocation EndLoc,
2709                                   ArrayRef<OMPClause *> Clauses,
2710                                   Stmt *AssociatedStmt);
2711
2712  /// Creates an empty directive with the place for \a NumClauses
2713  /// clauses.
2714  ///
2715  /// \param C AST context.
2716  /// \param NumClauses Number of clauses.
2717  ///
2718  static OMPTeamsDirective *CreateEmpty(const ASTContext &C,
2719                                        unsigned NumClausesEmptyShell);
2720
2721  static bool classof(const Stmt *T) {
2722    return T->getStmtClass() == OMPTeamsDirectiveClass;
2723  }
2724};
2725
2726/// This represents '#pragma omp cancellation point' directive.
2727///
2728/// \code
2729/// #pragma omp cancellation point for
2730/// \endcode
2731///
2732/// In this example a cancellation point is created for innermost 'for' region.
2733class OMPCancellationPointDirective : public OMPExecutableDirective {
2734  friend class ASTStmtReader;
2735  OpenMPDirectiveKind CancelRegion;
2736  /// Build directive with the given start and end location.
2737  ///
2738  /// \param StartLoc Starting location of the directive kind.
2739  /// \param EndLoc Ending location of the directive.
2740  ///
2741  OMPCancellationPointDirective(SourceLocation StartLocSourceLocation EndLoc)
2742      : OMPExecutableDirective(this, OMPCancellationPointDirectiveClass,
2743                               OMPD_cancellation_point, StartLoc, EndLoc, 00),
2744        CancelRegion(OMPD_unknown) {}
2745
2746  /// Build an empty directive.
2747  ///
2748  explicit OMPCancellationPointDirective()
2749      : OMPExecutableDirective(this, OMPCancellationPointDirectiveClass,
2750                               OMPD_cancellation_point, SourceLocation(),
2751                               SourceLocation(), 00),
2752        CancelRegion(OMPD_unknown) {}
2753
2754  /// Set cancel region for current cancellation point.
2755  /// \param CR Cancellation region.
2756  void setCancelRegion(OpenMPDirectiveKind CR) { CancelRegion = CR; }
2757
2758public:
2759  /// Creates directive.
2760  ///
2761  /// \param C AST context.
2762  /// \param StartLoc Starting location of the directive kind.
2763  /// \param EndLoc Ending Location of the directive.
2764  ///
2765  static OMPCancellationPointDirective *
2766  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
2767         OpenMPDirectiveKind CancelRegion);
2768
2769  /// Creates an empty directive.
2770  ///
2771  /// \param C AST context.
2772  ///
2773  static OMPCancellationPointDirective *CreateEmpty(const ASTContext &C,
2774                                                    EmptyShell);
2775
2776  /// Get cancellation region for the current cancellation point.
2777  OpenMPDirectiveKind getCancelRegion() const { return CancelRegion; }
2778
2779  static bool classof(const Stmt *T) {
2780    return T->getStmtClass() == OMPCancellationPointDirectiveClass;
2781  }
2782};
2783
2784/// This represents '#pragma omp cancel' directive.
2785///
2786/// \code
2787/// #pragma omp cancel for
2788/// \endcode
2789///
2790/// In this example a cancel is created for innermost 'for' region.
2791class OMPCancelDirective : public OMPExecutableDirective {
2792  friend class ASTStmtReader;
2793  OpenMPDirectiveKind CancelRegion;
2794  /// Build directive with the given start and end location.
2795  ///
2796  /// \param StartLoc Starting location of the directive kind.
2797  /// \param EndLoc Ending location of the directive.
2798  /// \param NumClauses Number of clauses.
2799  ///
2800  OMPCancelDirective(SourceLocation StartLocSourceLocation EndLoc,
2801                     unsigned NumClauses)
2802      : OMPExecutableDirective(this, OMPCancelDirectiveClass, OMPD_cancel,
2803                               StartLoc, EndLoc, NumClauses, 0),
2804        CancelRegion(OMPD_unknown) {}
2805
2806  /// Build an empty directive.
2807  ///
2808  /// \param NumClauses Number of clauses.
2809  explicit OMPCancelDirective(unsigned NumClauses)
2810      : OMPExecutableDirective(this, OMPCancelDirectiveClass, OMPD_cancel,
2811                               SourceLocation(), SourceLocation(), NumClauses,
2812                               0),
2813        CancelRegion(OMPD_unknown) {}
2814
2815  /// Set cancel region for current cancellation point.
2816  /// \param CR Cancellation region.
2817  void setCancelRegion(OpenMPDirectiveKind CR) { CancelRegion = CR; }
2818
2819public:
2820  /// Creates directive.
2821  ///
2822  /// \param C AST context.
2823  /// \param StartLoc Starting location of the directive kind.
2824  /// \param EndLoc Ending Location of the directive.
2825  /// \param Clauses List of clauses.
2826  ///
2827  static OMPCancelDirective *
2828  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
2829         ArrayRef<OMPClause *> ClausesOpenMPDirectiveKind CancelRegion);
2830
2831  /// Creates an empty directive.
2832  ///
2833  /// \param C AST context.
2834  /// \param NumClauses Number of clauses.
2835  ///
2836  static OMPCancelDirective *CreateEmpty(const ASTContext &C,
2837                                         unsigned NumClausesEmptyShell);
2838
2839  /// Get cancellation region for the current cancellation point.
2840  OpenMPDirectiveKind getCancelRegion() const { return CancelRegion; }
2841
2842  static bool classof(const Stmt *T) {
2843    return T->getStmtClass() == OMPCancelDirectiveClass;
2844  }
2845};
2846
2847/// This represents '#pragma omp taskloop' directive.
2848///
2849/// \code
2850/// #pragma omp taskloop private(a,b) grainsize(val) num_tasks(num)
2851/// \endcode
2852/// In this example directive '#pragma omp taskloop' has clauses 'private'
2853/// with the variables 'a' and 'b', 'grainsize' with expression 'val' and
2854/// 'num_tasks' with expression 'num'.
2855///
2856class OMPTaskLoopDirective : public OMPLoopDirective {
2857  friend class ASTStmtReader;
2858  /// Build directive with the given start and end location.
2859  ///
2860  /// \param StartLoc Starting location of the directive kind.
2861  /// \param EndLoc Ending location of the directive.
2862  /// \param CollapsedNum Number of collapsed nested loops.
2863  /// \param NumClauses Number of clauses.
2864  ///
2865  OMPTaskLoopDirective(SourceLocation StartLocSourceLocation EndLoc,
2866                       unsigned CollapsedNumunsigned NumClauses)
2867      : OMPLoopDirective(this, OMPTaskLoopDirectiveClass, OMPD_taskloop,
2868                         StartLoc, EndLoc, CollapsedNum, NumClauses) {}
2869
2870  /// Build an empty directive.
2871  ///
2872  /// \param CollapsedNum Number of collapsed nested loops.
2873  /// \param NumClauses Number of clauses.
2874  ///
2875  explicit OMPTaskLoopDirective(unsigned CollapsedNumunsigned NumClauses)
2876      : OMPLoopDirective(this, OMPTaskLoopDirectiveClass, OMPD_taskloop,
2877                         SourceLocation(), SourceLocation(), CollapsedNum,
2878                         NumClauses) {}
2879
2880public:
2881  /// Creates directive with a list of \a Clauses.
2882  ///
2883  /// \param C AST context.
2884  /// \param StartLoc Starting location of the directive kind.
2885  /// \param EndLoc Ending Location of the directive.
2886  /// \param CollapsedNum Number of collapsed loops.
2887  /// \param Clauses List of clauses.
2888  /// \param AssociatedStmt Statement, associated with the directive.
2889  /// \param Exprs Helper expressions for CodeGen.
2890  ///
2891  static OMPTaskLoopDirective *
2892  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
2893         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
2894         Stmt *AssociatedStmtconst HelperExprs &Exprs);
2895
2896  /// Creates an empty directive with the place
2897  /// for \a NumClauses clauses.
2898  ///
2899  /// \param C AST context.
2900  /// \param CollapsedNum Number of collapsed nested loops.
2901  /// \param NumClauses Number of clauses.
2902  ///
2903  static OMPTaskLoopDirective *CreateEmpty(const ASTContext &C,
2904                                           unsigned NumClauses,
2905                                           unsigned CollapsedNumEmptyShell);
2906
2907  static bool classof(const Stmt *T) {
2908    return T->getStmtClass() == OMPTaskLoopDirectiveClass;
2909  }
2910};
2911
2912/// This represents '#pragma omp taskloop simd' directive.
2913///
2914/// \code
2915/// #pragma omp taskloop simd private(a,b) grainsize(val) num_tasks(num)
2916/// \endcode
2917/// In this example directive '#pragma omp taskloop simd' has clauses 'private'
2918/// with the variables 'a' and 'b', 'grainsize' with expression 'val' and
2919/// 'num_tasks' with expression 'num'.
2920///
2921class OMPTaskLoopSimdDirective : public OMPLoopDirective {
2922  friend class ASTStmtReader;
2923  /// Build directive with the given start and end location.
2924  ///
2925  /// \param StartLoc Starting location of the directive kind.
2926  /// \param EndLoc Ending location of the directive.
2927  /// \param CollapsedNum Number of collapsed nested loops.
2928  /// \param NumClauses Number of clauses.
2929  ///
2930  OMPTaskLoopSimdDirective(SourceLocation StartLocSourceLocation EndLoc,
2931                           unsigned CollapsedNumunsigned NumClauses)
2932      : OMPLoopDirective(this, OMPTaskLoopSimdDirectiveClass,
2933                         OMPD_taskloop_simd, StartLoc, EndLoc, CollapsedNum,
2934                         NumClauses) {}
2935
2936  /// Build an empty directive.
2937  ///
2938  /// \param CollapsedNum Number of collapsed nested loops.
2939  /// \param NumClauses Number of clauses.
2940  ///
2941  explicit OMPTaskLoopSimdDirective(unsigned CollapsedNumunsigned NumClauses)
2942      : OMPLoopDirective(this, OMPTaskLoopSimdDirectiveClass,
2943                         OMPD_taskloop_simd, SourceLocation(), SourceLocation(),
2944                         CollapsedNum, NumClauses) {}
2945
2946public:
2947  /// Creates directive with a list of \a Clauses.
2948  ///
2949  /// \param C AST context.
2950  /// \param StartLoc Starting location of the directive kind.
2951  /// \param EndLoc Ending Location of the directive.
2952  /// \param CollapsedNum Number of collapsed loops.
2953  /// \param Clauses List of clauses.
2954  /// \param AssociatedStmt Statement, associated with the directive.
2955  /// \param Exprs Helper expressions for CodeGen.
2956  ///
2957  static OMPTaskLoopSimdDirective *
2958  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
2959         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
2960         Stmt *AssociatedStmtconst HelperExprs &Exprs);
2961
2962  /// Creates an empty directive with the place
2963  /// for \a NumClauses clauses.
2964  ///
2965  /// \param C AST context.
2966  /// \param CollapsedNum Number of collapsed nested loops.
2967  /// \param NumClauses Number of clauses.
2968  ///
2969  static OMPTaskLoopSimdDirective *CreateEmpty(const ASTContext &C,
2970                                               unsigned NumClauses,
2971                                               unsigned CollapsedNum,
2972                                               EmptyShell);
2973
2974  static bool classof(const Stmt *T) {
2975    return T->getStmtClass() == OMPTaskLoopSimdDirectiveClass;
2976  }
2977};
2978
2979/// This represents '#pragma omp distribute' directive.
2980///
2981/// \code
2982/// #pragma omp distribute private(a,b)
2983/// \endcode
2984/// In this example directive '#pragma omp distribute' has clauses 'private'
2985/// with the variables 'a' and 'b'
2986///
2987class OMPDistributeDirective : public OMPLoopDirective {
2988  friend class ASTStmtReader;
2989
2990  /// Build directive with the given start and end location.
2991  ///
2992  /// \param StartLoc Starting location of the directive kind.
2993  /// \param EndLoc Ending location of the directive.
2994  /// \param CollapsedNum Number of collapsed nested loops.
2995  /// \param NumClauses Number of clauses.
2996  ///
2997  OMPDistributeDirective(SourceLocation StartLocSourceLocation EndLoc,
2998                         unsigned CollapsedNumunsigned NumClauses)
2999      : OMPLoopDirective(this, OMPDistributeDirectiveClass, OMPD_distribute,
3000                         StartLoc, EndLoc, CollapsedNum, NumClauses)
3001        {}
3002
3003  /// Build an empty directive.
3004  ///
3005  /// \param CollapsedNum Number of collapsed nested loops.
3006  /// \param NumClauses Number of clauses.
3007  ///
3008  explicit OMPDistributeDirective(unsigned CollapsedNumunsigned NumClauses)
3009      : OMPLoopDirective(this, OMPDistributeDirectiveClass, OMPD_distribute,
3010                         SourceLocation(), SourceLocation(), CollapsedNum,
3011                         NumClauses)
3012        {}
3013
3014public:
3015  /// Creates directive with a list of \a Clauses.
3016  ///
3017  /// \param C AST context.
3018  /// \param StartLoc Starting location of the directive kind.
3019  /// \param EndLoc Ending Location of the directive.
3020  /// \param CollapsedNum Number of collapsed loops.
3021  /// \param Clauses List of clauses.
3022  /// \param AssociatedStmt Statement, associated with the directive.
3023  /// \param Exprs Helper expressions for CodeGen.
3024  ///
3025  static OMPDistributeDirective *
3026  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
3027         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
3028         Stmt *AssociatedStmtconst HelperExprs &Exprs);
3029
3030  /// Creates an empty directive with the place
3031  /// for \a NumClauses clauses.
3032  ///
3033  /// \param C AST context.
3034  /// \param CollapsedNum Number of collapsed nested loops.
3035  /// \param NumClauses Number of clauses.
3036  ///
3037  static OMPDistributeDirective *CreateEmpty(const ASTContext &C,
3038                                             unsigned NumClauses,
3039                                             unsigned CollapsedNumEmptyShell);
3040
3041  static bool classof(const Stmt *T) {
3042    return T->getStmtClass() == OMPDistributeDirectiveClass;
3043  }
3044};
3045
3046/// This represents '#pragma omp target update' directive.
3047///
3048/// \code
3049/// #pragma omp target update to(a) from(b) device(1)
3050/// \endcode
3051/// In this example directive '#pragma omp target update' has clause 'to' with
3052/// argument 'a', clause 'from' with argument 'b' and clause 'device' with
3053/// argument '1'.
3054///
3055class OMPTargetUpdateDirective : public OMPExecutableDirective {
3056  friend class ASTStmtReader;
3057  /// Build directive with the given start and end location.
3058  ///
3059  /// \param StartLoc Starting location of the directive kind.
3060  /// \param EndLoc Ending Location of the directive.
3061  /// \param NumClauses The number of clauses.
3062  ///
3063  OMPTargetUpdateDirective(SourceLocation StartLocSourceLocation EndLoc,
3064                           unsigned NumClauses)
3065      : OMPExecutableDirective(this, OMPTargetUpdateDirectiveClass,
3066                               OMPD_target_update, StartLoc, EndLoc, NumClauses,
3067                               1) {}
3068
3069  /// Build an empty directive.
3070  ///
3071  /// \param NumClauses Number of clauses.
3072  ///
3073  explicit OMPTargetUpdateDirective(unsigned NumClauses)
3074      : OMPExecutableDirective(this, OMPTargetUpdateDirectiveClass,
3075                               OMPD_target_update, SourceLocation(),
3076                               SourceLocation(), NumClauses, 1) {}
3077
3078public:
3079  /// Creates directive with a list of \a Clauses.
3080  ///
3081  /// \param C AST context.
3082  /// \param StartLoc Starting location of the directive kind.
3083  /// \param EndLoc Ending Location of the directive.
3084  /// \param Clauses List of clauses.
3085  /// \param AssociatedStmt Statement, associated with the directive.
3086  ///
3087  static OMPTargetUpdateDirective *
3088  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
3089         ArrayRef<OMPClause *> ClausesStmt *AssociatedStmt);
3090
3091  /// Creates an empty directive with the place for \a NumClauses
3092  /// clauses.
3093  ///
3094  /// \param C AST context.
3095  /// \param NumClauses The number of clauses.
3096  ///
3097  static OMPTargetUpdateDirective *CreateEmpty(const ASTContext &C,
3098                                               unsigned NumClausesEmptyShell);
3099
3100  static bool classof(const Stmt *T) {
3101    return T->getStmtClass() == OMPTargetUpdateDirectiveClass;
3102  }
3103};
3104
3105/// This represents '#pragma omp distribute parallel for' composite
3106///  directive.
3107///
3108/// \code
3109/// #pragma omp distribute parallel for private(a,b)
3110/// \endcode
3111/// In this example directive '#pragma omp distribute parallel for' has clause
3112/// 'private' with the variables 'a' and 'b'
3113///
3114class OMPDistributeParallelForDirective : public OMPLoopDirective {
3115  friend class ASTStmtReader;
3116  /// true if the construct has inner cancel directive.
3117  bool HasCancel = false;
3118
3119  /// Build directive with the given start and end location.
3120  ///
3121  /// \param StartLoc Starting location of the directive kind.
3122  /// \param EndLoc Ending location of the directive.
3123  /// \param CollapsedNum Number of collapsed nested loops.
3124  /// \param NumClauses Number of clauses.
3125  ///
3126  OMPDistributeParallelForDirective(SourceLocation StartLoc,
3127                                    SourceLocation EndLoc,
3128                                    unsigned CollapsedNumunsigned NumClauses)
3129      : OMPLoopDirective(this, OMPDistributeParallelForDirectiveClass,
3130                         OMPD_distribute_parallel_for, StartLoc, EndLoc,
3131                         CollapsedNum, NumClauses), HasCancel(false) {}
3132
3133  /// Build an empty directive.
3134  ///
3135  /// \param CollapsedNum Number of collapsed nested loops.
3136  /// \param NumClauses Number of clauses.
3137  ///
3138  explicit OMPDistributeParallelForDirective(unsigned CollapsedNum,
3139                                             unsigned NumClauses)
3140      : OMPLoopDirective(this, OMPDistributeParallelForDirectiveClass,
3141                         OMPD_distribute_parallel_for, SourceLocation(),
3142                         SourceLocation(), CollapsedNum, NumClauses),
3143        HasCancel(false) {}
3144
3145  /// Set cancel state.
3146  void setHasCancel(bool Has) { HasCancel = Has; }
3147
3148public:
3149  /// Creates directive with a list of \a Clauses.
3150  ///
3151  /// \param C AST context.
3152  /// \param StartLoc Starting location of the directive kind.
3153  /// \param EndLoc Ending Location of the directive.
3154  /// \param CollapsedNum Number of collapsed loops.
3155  /// \param Clauses List of clauses.
3156  /// \param AssociatedStmt Statement, associated with the directive.
3157  /// \param Exprs Helper expressions for CodeGen.
3158  /// \param HasCancel true if this directive has inner cancel directive.
3159  ///
3160  static OMPDistributeParallelForDirective *
3161  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
3162         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
3163         Stmt *AssociatedStmtconst HelperExprs &Exprsbool HasCancel);
3164
3165  /// Creates an empty directive with the place
3166  /// for \a NumClauses clauses.
3167  ///
3168  /// \param C AST context.
3169  /// \param CollapsedNum Number of collapsed nested loops.
3170  /// \param NumClauses Number of clauses.
3171  ///
3172  static OMPDistributeParallelForDirective *CreateEmpty(const ASTContext &C,
3173                                                        unsigned NumClauses,
3174                                                        unsigned CollapsedNum,
3175                                                        EmptyShell);
3176
3177  /// Return true if current directive has inner cancel directive.
3178  bool hasCancel() const { return HasCancel; }
3179
3180  static bool classof(const Stmt *T) {
3181    return T->getStmtClass() == OMPDistributeParallelForDirectiveClass;
3182  }
3183};
3184
3185/// This represents '#pragma omp distribute parallel for simd' composite
3186/// directive.
3187///
3188/// \code
3189/// #pragma omp distribute parallel for simd private(x)
3190/// \endcode
3191/// In this example directive '#pragma omp distribute parallel for simd' has
3192/// clause 'private' with the variables 'x'
3193///
3194class OMPDistributeParallelForSimdDirective final : public OMPLoopDirective {
3195  friend class ASTStmtReader;
3196
3197  /// Build directive with the given start and end location.
3198  ///
3199  /// \param StartLoc Starting location of the directive kind.
3200  /// \param EndLoc Ending location of the directive.
3201  /// \param CollapsedNum Number of collapsed nested loops.
3202  /// \param NumClauses Number of clauses.
3203  ///
3204  OMPDistributeParallelForSimdDirective(SourceLocation StartLoc,
3205                                        SourceLocation EndLoc,
3206                                        unsigned CollapsedNum,
3207                                        unsigned NumClauses)
3208      : OMPLoopDirective(this, OMPDistributeParallelForSimdDirectiveClass,
3209                         OMPD_distribute_parallel_for_simd, StartLoc,
3210                         EndLoc, CollapsedNum, NumClauses) {}
3211
3212  /// Build an empty directive.
3213  ///
3214  /// \param CollapsedNum Number of collapsed nested loops.
3215  /// \param NumClauses Number of clauses.
3216  ///
3217  explicit OMPDistributeParallelForSimdDirective(unsigned CollapsedNum,
3218                                                 unsigned NumClauses)
3219      : OMPLoopDirective(this, OMPDistributeParallelForSimdDirectiveClass,
3220                         OMPD_distribute_parallel_for_simd,
3221                         SourceLocation(), SourceLocation(), CollapsedNum,
3222                         NumClauses) {}
3223
3224public:
3225  /// Creates directive with a list of \a Clauses.
3226  ///
3227  /// \param C AST context.
3228  /// \param StartLoc Starting location of the directive kind.
3229  /// \param EndLoc Ending Location of the directive.
3230  /// \param CollapsedNum Number of collapsed loops.
3231  /// \param Clauses List of clauses.
3232  /// \param AssociatedStmt Statement, associated with the directive.
3233  /// \param Exprs Helper expressions for CodeGen.
3234  ///
3235  static OMPDistributeParallelForSimdDirective *Create(
3236      const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
3237      unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
3238      Stmt *AssociatedStmtconst HelperExprs &Exprs);
3239
3240  /// Creates an empty directive with the place for \a NumClauses clauses.
3241  ///
3242  /// \param C AST context.
3243  /// \param CollapsedNum Number of collapsed nested loops.
3244  /// \param NumClauses Number of clauses.
3245  ///
3246  static OMPDistributeParallelForSimdDirective *CreateEmpty(
3247      const ASTContext &Cunsigned NumClausesunsigned CollapsedNum,
3248      EmptyShell);
3249
3250  static bool classof(const Stmt *T) {
3251    return T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass;
3252  }
3253};
3254
3255/// This represents '#pragma omp distribute simd' composite directive.
3256///
3257/// \code
3258/// #pragma omp distribute simd private(x)
3259/// \endcode
3260/// In this example directive '#pragma omp distribute simd' has clause
3261/// 'private' with the variables 'x'
3262///
3263class OMPDistributeSimdDirective final : public OMPLoopDirective {
3264  friend class ASTStmtReader;
3265
3266  /// Build directive with the given start and end location.
3267  ///
3268  /// \param StartLoc Starting location of the directive kind.
3269  /// \param EndLoc Ending location of the directive.
3270  /// \param CollapsedNum Number of collapsed nested loops.
3271  /// \param NumClauses Number of clauses.
3272  ///
3273  OMPDistributeSimdDirective(SourceLocation StartLocSourceLocation EndLoc,
3274                             unsigned CollapsedNumunsigned NumClauses)
3275      : OMPLoopDirective(this, OMPDistributeSimdDirectiveClass,
3276                         OMPD_distribute_simd, StartLoc, EndLoc, CollapsedNum,
3277                         NumClauses) {}
3278
3279  /// Build an empty directive.
3280  ///
3281  /// \param CollapsedNum Number of collapsed nested loops.
3282  /// \param NumClauses Number of clauses.
3283  ///
3284  explicit OMPDistributeSimdDirective(unsigned CollapsedNum,
3285                                      unsigned NumClauses)
3286      : OMPLoopDirective(this, OMPDistributeSimdDirectiveClass,
3287                         OMPD_distribute_simd, SourceLocation(),
3288                         SourceLocation(), CollapsedNum, NumClauses) {}
3289
3290public:
3291  /// Creates directive with a list of \a Clauses.
3292  ///
3293  /// \param C AST context.
3294  /// \param StartLoc Starting location of the directive kind.
3295  /// \param EndLoc Ending Location of the directive.
3296  /// \param CollapsedNum Number of collapsed loops.
3297  /// \param Clauses List of clauses.
3298  /// \param AssociatedStmt Statement, associated with the directive.
3299  /// \param Exprs Helper expressions for CodeGen.
3300  ///
3301  static OMPDistributeSimdDirective *
3302  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
3303         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
3304         Stmt *AssociatedStmtconst HelperExprs &Exprs);
3305
3306  /// Creates an empty directive with the place for \a NumClauses clauses.
3307  ///
3308  /// \param C AST context.
3309  /// \param CollapsedNum Number of collapsed nested loops.
3310  /// \param NumClauses Number of clauses.
3311  ///
3312  static OMPDistributeSimdDirective *CreateEmpty(const ASTContext &C,
3313                                                 unsigned NumClauses,
3314                                                 unsigned CollapsedNum,
3315                                                 EmptyShell);
3316
3317  static bool classof(const Stmt *T) {
3318    return T->getStmtClass() == OMPDistributeSimdDirectiveClass;
3319  }
3320};
3321
3322/// This represents '#pragma omp target parallel for simd' directive.
3323///
3324/// \code
3325/// #pragma omp target parallel for simd private(a) map(b) safelen(c)
3326/// \endcode
3327/// In this example directive '#pragma omp target parallel for simd' has clauses
3328/// 'private' with the variable 'a', 'map' with the variable 'b' and 'safelen'
3329/// with the variable 'c'.
3330///
3331class OMPTargetParallelForSimdDirective final : public OMPLoopDirective {
3332  friend class ASTStmtReader;
3333
3334  /// Build directive with the given start and end location.
3335  ///
3336  /// \param StartLoc Starting location of the directive kind.
3337  /// \param EndLoc Ending location of the directive.
3338  /// \param CollapsedNum Number of collapsed nested loops.
3339  /// \param NumClauses Number of clauses.
3340  ///
3341  OMPTargetParallelForSimdDirective(SourceLocation StartLocSourceLocation EndLoc,
3342                                unsigned CollapsedNumunsigned NumClauses)
3343      : OMPLoopDirective(this, OMPTargetParallelForSimdDirectiveClass,
3344                         OMPD_target_parallel_for_simd, StartLoc, EndLoc,
3345                         CollapsedNum, NumClauses) {}
3346
3347  /// Build an empty directive.
3348  ///
3349  /// \param CollapsedNum Number of collapsed nested loops.
3350  /// \param NumClauses Number of clauses.
3351  ///
3352  explicit OMPTargetParallelForSimdDirective(unsigned CollapsedNum,
3353                                             unsigned NumClauses)
3354      : OMPLoopDirective(this, OMPTargetParallelForSimdDirectiveClass,
3355                         OMPD_target_parallel_for_simd, SourceLocation(),
3356                         SourceLocation(), CollapsedNum, NumClauses) {}
3357
3358public:
3359  /// Creates directive with a list of \a Clauses.
3360  ///
3361  /// \param C AST context.
3362  /// \param StartLoc Starting location of the directive kind.
3363  /// \param EndLoc Ending Location of the directive.
3364  /// \param CollapsedNum Number of collapsed loops.
3365  /// \param Clauses List of clauses.
3366  /// \param AssociatedStmt Statement, associated with the directive.
3367  /// \param Exprs Helper expressions for CodeGen.
3368  ///
3369  static OMPTargetParallelForSimdDirective *
3370  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
3371         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
3372         Stmt *AssociatedStmtconst HelperExprs &Exprs);
3373
3374  /// Creates an empty directive with the place for \a NumClauses clauses.
3375  ///
3376  /// \param C AST context.
3377  /// \param CollapsedNum Number of collapsed nested loops.
3378  /// \param NumClauses Number of clauses.
3379  ///
3380  static OMPTargetParallelForSimdDirective *CreateEmpty(const ASTContext &C,
3381                                                        unsigned NumClauses,
3382                                                        unsigned CollapsedNum,
3383                                                        EmptyShell);
3384
3385  static bool classof(const Stmt *T) {
3386    return T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass;
3387  }
3388};
3389
3390/// This represents '#pragma omp target simd' directive.
3391///
3392/// \code
3393/// #pragma omp target simd private(a) map(b) safelen(c)
3394/// \endcode
3395/// In this example directive '#pragma omp target simd' has clauses 'private'
3396/// with the variable 'a', 'map' with the variable 'b' and 'safelen' with
3397/// the variable 'c'.
3398///
3399class OMPTargetSimdDirective final : public OMPLoopDirective {
3400  friend class ASTStmtReader;
3401
3402  /// Build directive with the given start and end location.
3403  ///
3404  /// \param StartLoc Starting location of the directive kind.
3405  /// \param EndLoc Ending location of the directive.
3406  /// \param CollapsedNum Number of collapsed nested loops.
3407  /// \param NumClauses Number of clauses.
3408  ///
3409  OMPTargetSimdDirective(SourceLocation StartLocSourceLocation EndLoc,
3410                         unsigned CollapsedNumunsigned NumClauses)
3411      : OMPLoopDirective(this, OMPTargetSimdDirectiveClass,
3412                         OMPD_target_simd, StartLoc, EndLoc, CollapsedNum,
3413                         NumClauses) {}
3414
3415  /// Build an empty directive.
3416  ///
3417  /// \param CollapsedNum Number of collapsed nested loops.
3418  /// \param NumClauses Number of clauses.
3419  ///
3420  explicit OMPTargetSimdDirective(unsigned CollapsedNumunsigned NumClauses)
3421      : OMPLoopDirective(this, OMPTargetSimdDirectiveClass, OMPD_target_simd,
3422                         SourceLocation(),SourceLocation(), CollapsedNum,
3423                         NumClauses) {}
3424
3425public:
3426  /// Creates directive with a list of \a Clauses.
3427  ///
3428  /// \param C AST context.
3429  /// \param StartLoc Starting location of the directive kind.
3430  /// \param EndLoc Ending Location of the directive.
3431  /// \param CollapsedNum Number of collapsed loops.
3432  /// \param Clauses List of clauses.
3433  /// \param AssociatedStmt Statement, associated with the directive.
3434  /// \param Exprs Helper expressions for CodeGen.
3435  ///
3436  static OMPTargetSimdDirective *
3437  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
3438         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
3439         Stmt *AssociatedStmtconst HelperExprs &Exprs);
3440
3441  /// Creates an empty directive with the place for \a NumClauses clauses.
3442  ///
3443  /// \param C AST context.
3444  /// \param CollapsedNum Number of collapsed nested loops.
3445  /// \param NumClauses Number of clauses.
3446  ///
3447  static OMPTargetSimdDirective *CreateEmpty(const ASTContext &C,
3448                                             unsigned NumClauses,
3449                                             unsigned CollapsedNum,
3450                                             EmptyShell);
3451
3452  static bool classof(const Stmt *T) {
3453    return T->getStmtClass() == OMPTargetSimdDirectiveClass;
3454  }
3455};
3456
3457/// This represents '#pragma omp teams distribute' directive.
3458///
3459/// \code
3460/// #pragma omp teams distribute private(a,b)
3461/// \endcode
3462/// In this example directive '#pragma omp teams distribute' has clauses
3463/// 'private' with the variables 'a' and 'b'
3464///
3465class OMPTeamsDistributeDirective final : public OMPLoopDirective {
3466  friend class ASTStmtReader;
3467
3468  /// Build directive with the given start and end location.
3469  ///
3470  /// \param StartLoc Starting location of the directive kind.
3471  /// \param EndLoc Ending location of the directive.
3472  /// \param CollapsedNum Number of collapsed nested loops.
3473  /// \param NumClauses Number of clauses.
3474  ///
3475  OMPTeamsDistributeDirective(SourceLocation StartLocSourceLocation EndLoc,
3476                              unsigned CollapsedNumunsigned NumClauses)
3477      : OMPLoopDirective(this, OMPTeamsDistributeDirectiveClass,
3478                         OMPD_teams_distribute, StartLoc, EndLoc,
3479                         CollapsedNum, NumClauses) {}
3480
3481  /// Build an empty directive.
3482  ///
3483  /// \param CollapsedNum Number of collapsed nested loops.
3484  /// \param NumClauses Number of clauses.
3485  ///
3486  explicit OMPTeamsDistributeDirective(unsigned CollapsedNum,
3487                                       unsigned NumClauses)
3488      : OMPLoopDirective(this, OMPTeamsDistributeDirectiveClass,
3489                         OMPD_teams_distribute, SourceLocation(),
3490                         SourceLocation(), CollapsedNum, NumClauses) {}
3491
3492public:
3493  /// Creates directive with a list of \a Clauses.
3494  ///
3495  /// \param C AST context.
3496  /// \param StartLoc Starting location of the directive kind.
3497  /// \param EndLoc Ending Location of the directive.
3498  /// \param CollapsedNum Number of collapsed loops.
3499  /// \param Clauses List of clauses.
3500  /// \param AssociatedStmt Statement, associated with the directive.
3501  /// \param Exprs Helper expressions for CodeGen.
3502  ///
3503  static OMPTeamsDistributeDirective *
3504  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
3505         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
3506         Stmt *AssociatedStmtconst HelperExprs &Exprs);
3507
3508  /// Creates an empty directive with the place for \a NumClauses clauses.
3509  ///
3510  /// \param C AST context.
3511  /// \param CollapsedNum Number of collapsed nested loops.
3512  /// \param NumClauses Number of clauses.
3513  ///
3514  static OMPTeamsDistributeDirective *CreateEmpty(const ASTContext &C,
3515                                                  unsigned NumClauses,
3516                                                  unsigned CollapsedNum,
3517                                                  EmptyShell);
3518
3519  static bool classof(const Stmt *T) {
3520    return T->getStmtClass() == OMPTeamsDistributeDirectiveClass;
3521  }
3522};
3523
3524/// This represents '#pragma omp teams distribute simd'
3525/// combined directive.
3526///
3527/// \code
3528/// #pragma omp teams distribute simd private(a,b)
3529/// \endcode
3530/// In this example directive '#pragma omp teams distribute simd'
3531/// has clause 'private' with the variables 'a' and 'b'
3532///
3533class OMPTeamsDistributeSimdDirective final : public OMPLoopDirective {
3534  friend class ASTStmtReader;
3535
3536  /// Build directive with the given start and end location.
3537  ///
3538  /// \param StartLoc Starting location of the directive kind.
3539  /// \param EndLoc Ending location of the directive.
3540  /// \param CollapsedNum Number of collapsed nested loops.
3541  /// \param NumClauses Number of clauses.
3542  ///
3543  OMPTeamsDistributeSimdDirective(SourceLocation StartLoc,
3544                                  SourceLocation EndLocunsigned CollapsedNum,
3545                                  unsigned NumClauses)
3546      : OMPLoopDirective(this, OMPTeamsDistributeSimdDirectiveClass,
3547                         OMPD_teams_distribute_simd, StartLoc, EndLoc,
3548                         CollapsedNum, NumClauses) {}
3549
3550  /// Build an empty directive.
3551  ///
3552  /// \param CollapsedNum Number of collapsed nested loops.
3553  /// \param NumClauses Number of clauses.
3554  ///
3555  explicit OMPTeamsDistributeSimdDirective(unsigned CollapsedNum,
3556                                           unsigned NumClauses)
3557      : OMPLoopDirective(this, OMPTeamsDistributeSimdDirectiveClass,
3558                         OMPD_teams_distribute_simd, SourceLocation(),
3559                         SourceLocation(), CollapsedNum, NumClauses) {}
3560
3561public:
3562  /// Creates directive with a list of \a Clauses.
3563  ///
3564  /// \param C AST context.
3565  /// \param StartLoc Starting location of the directive kind.
3566  /// \param EndLoc Ending Location of the directive.
3567  /// \param CollapsedNum Number of collapsed loops.
3568  /// \param Clauses List of clauses.
3569  /// \param AssociatedStmt Statement, associated with the directive.
3570  /// \param Exprs Helper expressions for CodeGen.
3571  ///
3572  static OMPTeamsDistributeSimdDirective *
3573  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
3574         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
3575         Stmt *AssociatedStmtconst HelperExprs &Exprs);
3576
3577  /// Creates an empty directive with the place
3578  /// for \a NumClauses clauses.
3579  ///
3580  /// \param C AST context.
3581  /// \param CollapsedNum Number of collapsed nested loops.
3582  /// \param NumClauses Number of clauses.
3583  ///
3584  static OMPTeamsDistributeSimdDirective *CreateEmpty(const ASTContext &C,
3585                                                      unsigned NumClauses,
3586                                                      unsigned CollapsedNum,
3587                                                      EmptyShell);
3588
3589  static bool classof(const Stmt *T) {
3590    return T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass;
3591  }
3592};
3593
3594/// This represents '#pragma omp teams distribute parallel for simd' composite
3595/// directive.
3596///
3597/// \code
3598/// #pragma omp teams distribute parallel for simd private(x)
3599/// \endcode
3600/// In this example directive '#pragma omp teams distribute parallel for simd'
3601/// has clause 'private' with the variables 'x'
3602///
3603class OMPTeamsDistributeParallelForSimdDirective final
3604    : public OMPLoopDirective {
3605  friend class ASTStmtReader;
3606
3607  /// Build directive with the given start and end location.
3608  ///
3609  /// \param StartLoc Starting location of the directive kind.
3610  /// \param EndLoc Ending location of the directive.
3611  /// \param CollapsedNum Number of collapsed nested loops.
3612  /// \param NumClauses Number of clauses.
3613  ///
3614  OMPTeamsDistributeParallelForSimdDirective(SourceLocation StartLoc,
3615                                             SourceLocation EndLoc,
3616                                             unsigned CollapsedNum,
3617                                             unsigned NumClauses)
3618      : OMPLoopDirective(this, OMPTeamsDistributeParallelForSimdDirectiveClass,
3619                         OMPD_teams_distribute_parallel_for_simd, StartLoc,
3620                         EndLoc, CollapsedNum, NumClauses) {}
3621
3622  /// Build an empty directive.
3623  ///
3624  /// \param CollapsedNum Number of collapsed nested loops.
3625  /// \param NumClauses Number of clauses.
3626  ///
3627  explicit OMPTeamsDistributeParallelForSimdDirective(unsigned CollapsedNum,
3628                                                      unsigned NumClauses)
3629      : OMPLoopDirective(this, OMPTeamsDistributeParallelForSimdDirectiveClass,
3630                         OMPD_teams_distribute_parallel_for_simd,
3631                         SourceLocation(), SourceLocation(), CollapsedNum,
3632                         NumClauses) {}
3633
3634public:
3635  /// Creates directive with a list of \a Clauses.
3636  ///
3637  /// \param C AST context.
3638  /// \param StartLoc Starting location of the directive kind.
3639  /// \param EndLoc Ending Location of the directive.
3640  /// \param CollapsedNum Number of collapsed loops.
3641  /// \param Clauses List of clauses.
3642  /// \param AssociatedStmt Statement, associated with the directive.
3643  /// \param Exprs Helper expressions for CodeGen.
3644  ///
3645  static OMPTeamsDistributeParallelForSimdDirective *
3646  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
3647         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
3648         Stmt *AssociatedStmtconst HelperExprs &Exprs);
3649
3650  /// Creates an empty directive with the place for \a NumClauses clauses.
3651  ///
3652  /// \param C AST context.
3653  /// \param CollapsedNum Number of collapsed nested loops.
3654  /// \param NumClauses Number of clauses.
3655  ///
3656  static OMPTeamsDistributeParallelForSimdDirective *
3657  CreateEmpty(const ASTContext &Cunsigned NumClausesunsigned CollapsedNum,
3658              EmptyShell);
3659
3660  static bool classof(const Stmt *T) {
3661    return T->getStmtClass() == OMPTeamsDistributeParallelForSimdDirectiveClass;
3662  }
3663};
3664
3665/// This represents '#pragma omp teams distribute parallel for' composite
3666/// directive.
3667///
3668/// \code
3669/// #pragma omp teams distribute parallel for private(x)
3670/// \endcode
3671/// In this example directive '#pragma omp teams distribute parallel for'
3672/// has clause 'private' with the variables 'x'
3673///
3674class OMPTeamsDistributeParallelForDirective final : public OMPLoopDirective {
3675  friend class ASTStmtReader;
3676  /// true if the construct has inner cancel directive.
3677  bool HasCancel = false;
3678
3679  /// Build directive with the given start and end location.
3680  ///
3681  /// \param StartLoc Starting location of the directive kind.
3682  /// \param EndLoc Ending location of the directive.
3683  /// \param CollapsedNum Number of collapsed nested loops.
3684  /// \param NumClauses Number of clauses.
3685  ///
3686  OMPTeamsDistributeParallelForDirective(SourceLocation StartLoc,
3687                                         SourceLocation EndLoc,
3688                                         unsigned CollapsedNum,
3689                                         unsigned NumClauses)
3690      : OMPLoopDirective(this, OMPTeamsDistributeParallelForDirectiveClass,
3691                         OMPD_teams_distribute_parallel_for, StartLoc, EndLoc,
3692                         CollapsedNum, NumClauses), HasCancel(false) {}
3693
3694  /// Build an empty directive.
3695  ///
3696  /// \param CollapsedNum Number of collapsed nested loops.
3697  /// \param NumClauses Number of clauses.
3698  ///
3699  explicit OMPTeamsDistributeParallelForDirective(unsigned CollapsedNum,
3700                                                  unsigned NumClauses)
3701      : OMPLoopDirective(this, OMPTeamsDistributeParallelForDirectiveClass,
3702                         OMPD_teams_distribute_parallel_for, SourceLocation(),
3703                         SourceLocation(), CollapsedNum, NumClauses),
3704        HasCancel(false) {}
3705
3706  /// Set cancel state.
3707  void setHasCancel(bool Has) { HasCancel = Has; }
3708
3709public:
3710  /// Creates directive with a list of \a Clauses.
3711  ///
3712  /// \param C AST context.
3713  /// \param StartLoc Starting location of the directive kind.
3714  /// \param EndLoc Ending Location of the directive.
3715  /// \param CollapsedNum Number of collapsed loops.
3716  /// \param Clauses List of clauses.
3717  /// \param AssociatedStmt Statement, associated with the directive.
3718  /// \param Exprs Helper expressions for CodeGen.
3719  /// \param HasCancel true if this directive has inner cancel directive.
3720  ///
3721  static OMPTeamsDistributeParallelForDirective *
3722  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
3723         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
3724         Stmt *AssociatedStmtconst HelperExprs &Exprsbool HasCancel);
3725
3726  /// Creates an empty directive with the place for \a NumClauses clauses.
3727  ///
3728  /// \param C AST context.
3729  /// \param CollapsedNum Number of collapsed nested loops.
3730  /// \param NumClauses Number of clauses.
3731  ///
3732  static OMPTeamsDistributeParallelForDirective *
3733  CreateEmpty(const ASTContext &Cunsigned NumClausesunsigned CollapsedNum,
3734              EmptyShell);
3735
3736  /// Return true if current directive has inner cancel directive.
3737  bool hasCancel() const { return HasCancel; }
3738
3739  static bool classof(const Stmt *T) {
3740    return T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass;
3741  }
3742};
3743
3744/// This represents '#pragma omp target teams' directive.
3745///
3746/// \code
3747/// #pragma omp target teams if(a>0)
3748/// \endcode
3749/// In this example directive '#pragma omp target teams' has clause 'if' with
3750/// condition 'a>0'.
3751///
3752class OMPTargetTeamsDirective final : public OMPExecutableDirective {
3753  friend class ASTStmtReader;
3754  /// Build directive with the given start and end location.
3755  ///
3756  /// \param StartLoc Starting location of the directive kind.
3757  /// \param EndLoc Ending location of the directive.
3758  /// \param NumClauses Number of clauses.
3759  ///
3760  OMPTargetTeamsDirective(SourceLocation StartLocSourceLocation EndLoc,
3761                          unsigned NumClauses)
3762      : OMPExecutableDirective(this, OMPTargetTeamsDirectiveClass,
3763                               OMPD_target_teams, StartLoc, EndLoc, NumClauses,
3764                               1) {}
3765
3766  /// Build an empty directive.
3767  ///
3768  /// \param NumClauses Number of clauses.
3769  ///
3770  explicit OMPTargetTeamsDirective(unsigned NumClauses)
3771      : OMPExecutableDirective(this, OMPTargetTeamsDirectiveClass,
3772                               OMPD_target_teams, SourceLocation(),
3773                               SourceLocation(), NumClauses, 1) {}
3774
3775public:
3776  /// Creates directive with a list of \a Clauses.
3777  ///
3778  /// \param C AST context.
3779  /// \param StartLoc Starting location of the directive kind.
3780  /// \param EndLoc Ending Location of the directive.
3781  /// \param Clauses List of clauses.
3782  /// \param AssociatedStmt Statement, associated with the directive.
3783  ///
3784  static OMPTargetTeamsDirective *Create(const ASTContext &C,
3785                                         SourceLocation StartLoc,
3786                                         SourceLocation EndLoc,
3787                                         ArrayRef<OMPClause *> Clauses,
3788                                         Stmt *AssociatedStmt);
3789
3790  /// Creates an empty directive with the place for \a NumClauses clauses.
3791  ///
3792  /// \param C AST context.
3793  /// \param NumClauses Number of clauses.
3794  ///
3795  static OMPTargetTeamsDirective *CreateEmpty(const ASTContext &C,
3796                                              unsigned NumClausesEmptyShell);
3797
3798  static bool classof(const Stmt *T) {
3799    return T->getStmtClass() == OMPTargetTeamsDirectiveClass;
3800  }
3801};
3802
3803/// This represents '#pragma omp target teams distribute' combined directive.
3804///
3805/// \code
3806/// #pragma omp target teams distribute private(x)
3807/// \endcode
3808/// In this example directive '#pragma omp target teams distribute' has clause
3809/// 'private' with the variables 'x'
3810///
3811class OMPTargetTeamsDistributeDirective final : public OMPLoopDirective {
3812  friend class ASTStmtReader;
3813
3814  /// Build directive with the given start and end location.
3815  ///
3816  /// \param StartLoc Starting location of the directive kind.
3817  /// \param EndLoc Ending location of the directive.
3818  /// \param CollapsedNum Number of collapsed nested loops.
3819  /// \param NumClauses Number of clauses.
3820  ///
3821  OMPTargetTeamsDistributeDirective(SourceLocation StartLoc,
3822                                    SourceLocation EndLoc,
3823                                    unsigned CollapsedNumunsigned NumClauses)
3824      : OMPLoopDirective(this, OMPTargetTeamsDistributeDirectiveClass,
3825                         OMPD_target_teams_distribute, StartLoc, EndLoc,
3826                         CollapsedNum, NumClauses) {}
3827
3828  /// Build an empty directive.
3829  ///
3830  /// \param CollapsedNum Number of collapsed nested loops.
3831  /// \param NumClauses Number of clauses.
3832  ///
3833  explicit OMPTargetTeamsDistributeDirective(unsigned CollapsedNum,
3834                                             unsigned NumClauses)
3835      : OMPLoopDirective(this, OMPTargetTeamsDistributeDirectiveClass,
3836                         OMPD_target_teams_distribute, SourceLocation(),
3837                         SourceLocation(), CollapsedNum, NumClauses) {}
3838
3839public:
3840  /// Creates directive with a list of \a Clauses.
3841  ///
3842  /// \param C AST context.
3843  /// \param StartLoc Starting location of the directive kind.
3844  /// \param EndLoc Ending Location of the directive.
3845  /// \param CollapsedNum Number of collapsed loops.
3846  /// \param Clauses List of clauses.
3847  /// \param AssociatedStmt Statement, associated with the directive.
3848  /// \param Exprs Helper expressions for CodeGen.
3849  ///
3850  static OMPTargetTeamsDistributeDirective *
3851  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
3852         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
3853         Stmt *AssociatedStmtconst HelperExprs &Exprs);
3854
3855  /// Creates an empty directive with the place for \a NumClauses clauses.
3856  ///
3857  /// \param C AST context.
3858  /// \param CollapsedNum Number of collapsed nested loops.
3859  /// \param NumClauses Number of clauses.
3860  ///
3861  static OMPTargetTeamsDistributeDirective *
3862  CreateEmpty(const ASTContext &Cunsigned NumClausesunsigned CollapsedNum,
3863              EmptyShell);
3864
3865  static bool classof(const Stmt *T) {
3866    return T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass;
3867  }
3868};
3869
3870/// This represents '#pragma omp target teams distribute parallel for' combined
3871/// directive.
3872///
3873/// \code
3874/// #pragma omp target teams distribute parallel for private(x)
3875/// \endcode
3876/// In this example directive '#pragma omp target teams distribute parallel
3877/// for' has clause 'private' with the variables 'x'
3878///
3879class OMPTargetTeamsDistributeParallelForDirective final
3880    : public OMPLoopDirective {
3881  friend class ASTStmtReader;
3882  /// true if the construct has inner cancel directive.
3883  bool HasCancel = false;
3884
3885  /// Build directive with the given start and end location.
3886  ///
3887  /// \param StartLoc Starting location of the directive kind.
3888  /// \param EndLoc Ending location of the directive.
3889  /// \param CollapsedNum Number of collapsed nested loops.
3890  /// \param NumClauses Number of clauses.
3891  ///
3892  OMPTargetTeamsDistributeParallelForDirective(SourceLocation StartLoc,
3893                                               SourceLocation EndLoc,
3894                                               unsigned CollapsedNum,
3895                                               unsigned NumClauses)
3896      : OMPLoopDirective(this,
3897                         OMPTargetTeamsDistributeParallelForDirectiveClass,
3898                         OMPD_target_teams_distribute_parallel_for, StartLoc,
3899                         EndLoc, CollapsedNum, NumClauses),
3900        HasCancel(false) {}
3901
3902  /// Build an empty directive.
3903  ///
3904  /// \param CollapsedNum Number of collapsed nested loops.
3905  /// \param NumClauses Number of clauses.
3906  ///
3907  explicit OMPTargetTeamsDistributeParallelForDirective(unsigned CollapsedNum,
3908                                                        unsigned NumClauses)
3909      : OMPLoopDirective(
3910            this, OMPTargetTeamsDistributeParallelForDirectiveClass,
3911            OMPD_target_teams_distribute_parallel_for, SourceLocation(),
3912            SourceLocation(), CollapsedNum, NumClauses),
3913        HasCancel(false) {}
3914
3915  /// Set cancel state.
3916  void setHasCancel(bool Has) { HasCancel = Has; }
3917
3918public:
3919  /// Creates directive with a list of \a Clauses.
3920  ///
3921  /// \param C AST context.
3922  /// \param StartLoc Starting location of the directive kind.
3923  /// \param EndLoc Ending Location of the directive.
3924  /// \param CollapsedNum Number of collapsed loops.
3925  /// \param Clauses List of clauses.
3926  /// \param AssociatedStmt Statement, associated with the directive.
3927  /// \param Exprs Helper expressions for CodeGen.
3928  /// \param HasCancel true if this directive has inner cancel directive.
3929  ///
3930  static OMPTargetTeamsDistributeParallelForDirective *
3931  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
3932         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
3933         Stmt *AssociatedStmtconst HelperExprs &Exprsbool HasCancel);
3934
3935  /// Creates an empty directive with the place for \a NumClauses clauses.
3936  ///
3937  /// \param C AST context.
3938  /// \param CollapsedNum Number of collapsed nested loops.
3939  /// \param NumClauses Number of clauses.
3940  ///
3941  static OMPTargetTeamsDistributeParallelForDirective *
3942  CreateEmpty(const ASTContext &Cunsigned NumClausesunsigned CollapsedNum,
3943              EmptyShell);
3944
3945  /// Return true if current directive has inner cancel directive.
3946  bool hasCancel() const { return HasCancel; }
3947
3948  static bool classof(const Stmt *T) {
3949    return T->getStmtClass() ==
3950           OMPTargetTeamsDistributeParallelForDirectiveClass;
3951  }
3952};
3953
3954/// This represents '#pragma omp target teams distribute parallel for simd'
3955/// combined directive.
3956///
3957/// \code
3958/// #pragma omp target teams distribute parallel for simd private(x)
3959/// \endcode
3960/// In this example directive '#pragma omp target teams distribute parallel
3961/// for simd' has clause 'private' with the variables 'x'
3962///
3963class OMPTargetTeamsDistributeParallelForSimdDirective final
3964    : public OMPLoopDirective {
3965  friend class ASTStmtReader;
3966
3967  /// Build directive with the given start and end location.
3968  ///
3969  /// \param StartLoc Starting location of the directive kind.
3970  /// \param EndLoc Ending location of the directive.
3971  /// \param CollapsedNum Number of collapsed nested loops.
3972  /// \param NumClauses Number of clauses.
3973  ///
3974  OMPTargetTeamsDistributeParallelForSimdDirective(SourceLocation StartLoc,
3975                                                   SourceLocation EndLoc,
3976                                                   unsigned CollapsedNum,
3977                                                   unsigned NumClauses)
3978      : OMPLoopDirective(this,
3979                         OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
3980                         OMPD_target_teams_distribute_parallel_for_simd,
3981                         StartLoc, EndLoc, CollapsedNum, NumClauses) {}
3982
3983  /// Build an empty directive.
3984  ///
3985  /// \param CollapsedNum Number of collapsed nested loops.
3986  /// \param NumClauses Number of clauses.
3987  ///
3988  explicit OMPTargetTeamsDistributeParallelForSimdDirective(
3989      unsigned CollapsedNumunsigned NumClauses)
3990      : OMPLoopDirective(
3991            this, OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
3992            OMPD_target_teams_distribute_parallel_for_simd, SourceLocation(),
3993            SourceLocation(), CollapsedNum, NumClauses) {}
3994
3995public:
3996  /// Creates directive with a list of \a Clauses.
3997  ///
3998  /// \param C AST context.
3999  /// \param StartLoc Starting location of the directive kind.
4000  /// \param EndLoc Ending Location of the directive.
4001  /// \param CollapsedNum Number of collapsed loops.
4002  /// \param Clauses List of clauses.
4003  /// \param AssociatedStmt Statement, associated with the directive.
4004  /// \param Exprs Helper expressions for CodeGen.
4005  ///
4006  static OMPTargetTeamsDistributeParallelForSimdDirective *
4007  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
4008         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
4009         Stmt *AssociatedStmtconst HelperExprs &Exprs);
4010
4011  /// Creates an empty directive with the place for \a NumClauses clauses.
4012  ///
4013  /// \param C AST context.
4014  /// \param CollapsedNum Number of collapsed nested loops.
4015  /// \param NumClauses Number of clauses.
4016  ///
4017  static OMPTargetTeamsDistributeParallelForSimdDirective *
4018  CreateEmpty(const ASTContext &Cunsigned NumClausesunsigned CollapsedNum,
4019              EmptyShell);
4020
4021  static bool classof(const Stmt *T) {
4022    return T->getStmtClass() ==
4023           OMPTargetTeamsDistributeParallelForSimdDirectiveClass;
4024  }
4025};
4026
4027/// This represents '#pragma omp target teams distribute simd' combined
4028/// directive.
4029///
4030/// \code
4031/// #pragma omp target teams distribute simd private(x)
4032/// \endcode
4033/// In this example directive '#pragma omp target teams distribute simd'
4034/// has clause 'private' with the variables 'x'
4035///
4036class OMPTargetTeamsDistributeSimdDirective final : public OMPLoopDirective {
4037  friend class ASTStmtReader;
4038
4039  /// Build directive with the given start and end location.
4040  ///
4041  /// \param StartLoc Starting location of the directive kind.
4042  /// \param EndLoc Ending location of the directive.
4043  /// \param CollapsedNum Number of collapsed nested loops.
4044  /// \param NumClauses Number of clauses.
4045  ///
4046  OMPTargetTeamsDistributeSimdDirective(SourceLocation StartLoc,
4047                                        SourceLocation EndLoc,
4048                                        unsigned CollapsedNum,
4049                                        unsigned NumClauses)
4050      : OMPLoopDirective(this, OMPTargetTeamsDistributeSimdDirectiveClass,
4051                         OMPD_target_teams_distribute_simd, StartLoc, EndLoc,
4052                         CollapsedNum, NumClauses) {}
4053
4054  /// Build an empty directive.
4055  ///
4056  /// \param CollapsedNum Number of collapsed nested loops.
4057  /// \param NumClauses Number of clauses.
4058  ///
4059  explicit OMPTargetTeamsDistributeSimdDirective(unsigned CollapsedNum,
4060                                                 unsigned NumClauses)
4061      : OMPLoopDirective(this, OMPTargetTeamsDistributeSimdDirectiveClass,
4062                         OMPD_target_teams_distribute_simd, SourceLocation(),
4063                         SourceLocation(), CollapsedNum, NumClauses) {}
4064
4065public:
4066  /// Creates directive with a list of \a Clauses.
4067  ///
4068  /// \param C AST context.
4069  /// \param StartLoc Starting location of the directive kind.
4070  /// \param EndLoc Ending Location of the directive.
4071  /// \param CollapsedNum Number of collapsed loops.
4072  /// \param Clauses List of clauses.
4073  /// \param AssociatedStmt Statement, associated with the directive.
4074  /// \param Exprs Helper expressions for CodeGen.
4075  ///
4076  static OMPTargetTeamsDistributeSimdDirective *
4077  Create(const ASTContext &CSourceLocation StartLocSourceLocation EndLoc,
4078         unsigned CollapsedNumArrayRef<OMPClause *> Clauses,
4079         Stmt *AssociatedStmtconst HelperExprs &Exprs);
4080
4081  /// Creates an empty directive with the place for \a NumClauses clauses.
4082  ///
4083  /// \param C AST context.
4084  /// \param CollapsedNum Number of collapsed nested loops.
4085  /// \param NumClauses Number of clauses.
4086  ///
4087  static OMPTargetTeamsDistributeSimdDirective *
4088  CreateEmpty(const ASTContext &Cunsigned NumClausesunsigned CollapsedNum,
4089              EmptyShell);
4090
4091  static bool classof(const Stmt *T) {
4092    return T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
4093  }
4094};
4095
4096// end namespace clang
4097
4098#endif
4099
clang::OMPExecutableDirective::Kind
clang::OMPExecutableDirective::StartLoc
clang::OMPExecutableDirective::EndLoc
clang::OMPExecutableDirective::NumClauses
clang::OMPExecutableDirective::NumChildren
clang::OMPExecutableDirective::ClausesOffset
clang::OMPExecutableDirective::getClauses
clang::OMPExecutableDirective::setClauses
clang::OMPExecutableDirective::setAssociatedStmt
clang::OMPExecutableDirective::specific_clause_iterator
clang::OMPExecutableDirective::specific_clause_iterator::End
clang::OMPExecutableDirective::specific_clause_iterator::SkipToNextClause
clang::OMPExecutableDirective::getClausesOfKind
clang::OMPExecutableDirective::getClausesOfKind
clang::OMPExecutableDirective::getSingleClause
clang::OMPExecutableDirective::hasClausesOfKind
clang::OMPExecutableDirective::getBeginLoc
clang::OMPExecutableDirective::getEndLoc
clang::OMPExecutableDirective::setLocStart
clang::OMPExecutableDirective::setLocEnd
clang::OMPExecutableDirective::getNumClauses
clang::OMPExecutableDirective::getClause
clang::OMPExecutableDirective::hasAssociatedStmt
clang::OMPExecutableDirective::getAssociatedStmt
clang::OMPExecutableDirective::getAssociatedStmt
clang::OMPExecutableDirective::getCapturedStmt
clang::OMPExecutableDirective::getInnermostCapturedStmt
clang::OMPExecutableDirective::getInnermostCapturedStmt
clang::OMPExecutableDirective::getDirectiveKind
clang::OMPExecutableDirective::classof
clang::OMPExecutableDirective::children
clang::OMPExecutableDirective::clauses
clang::OMPExecutableDirective::clauses
clang::OMPExecutableDirective::isStandaloneDirective
clang::OMPExecutableDirective::getStructuredBlock
clang::OMPExecutableDirective::getStructuredBlock
clang::OMPParallelDirective::HasCancel
clang::OMPParallelDirective::setHasCancel
clang::OMPParallelDirective::Create
clang::OMPParallelDirective::CreateEmpty
clang::OMPParallelDirective::hasCancel
clang::OMPParallelDirective::classof
clang::OMPLoopDirective::CollapsedNum
clang::OMPLoopDirective::getCounters
clang::OMPLoopDirective::getPrivateCounters
clang::OMPLoopDirective::getInits
clang::OMPLoopDirective::getUpdates
clang::OMPLoopDirective::getFinals
clang::OMPLoopDirective::getArraysOffset
clang::OMPLoopDirective::numLoopChildren
clang::OMPLoopDirective::setIterationVariable
clang::OMPLoopDirective::setLastIteration
clang::OMPLoopDirective::setCalcLastIteration
clang::OMPLoopDirective::setPreCond
clang::OMPLoopDirective::setCond
clang::OMPLoopDirective::setInit
clang::OMPLoopDirective::setInc
clang::OMPLoopDirective::setPreInits
clang::OMPLoopDirective::setIsLastIterVariable
clang::OMPLoopDirective::setLowerBoundVariable
clang::OMPLoopDirective::setUpperBoundVariable
clang::OMPLoopDirective::setStrideVariable
clang::OMPLoopDirective::setEnsureUpperBound
clang::OMPLoopDirective::setNextLowerBound
clang::OMPLoopDirective::setNextUpperBound
clang::OMPLoopDirective::setNumIterations
clang::OMPLoopDirective::setPrevLowerBoundVariable
clang::OMPLoopDirective::setPrevUpperBoundVariable
clang::OMPLoopDirective::setDistInc
clang::OMPLoopDirective::setPrevEnsureUpperBound
clang::OMPLoopDirective::setCombinedLowerBoundVariable
clang::OMPLoopDirective::setCombinedUpperBoundVariable
clang::OMPLoopDirective::setCombinedEnsureUpperBound
clang::OMPLoopDirective::setCombinedInit
clang::OMPLoopDirective::setCombinedCond
clang::OMPLoopDirective::setCombinedNextLowerBound
clang::OMPLoopDirective::setCombinedNextUpperBound
clang::OMPLoopDirective::setCombinedDistCond
clang::OMPLoopDirective::setCombinedParForInDistCond
clang::OMPLoopDirective::setCounters
clang::OMPLoopDirective::setPrivateCounters
clang::OMPLoopDirective::setInits
clang::OMPLoopDirective::setUpdates
clang::OMPLoopDirective::setFinals
clang::OMPLoopDirective::DistCombinedHelperExprs
clang::OMPLoopDirective::DistCombinedHelperExprs::LB
clang::OMPLoopDirective::DistCombinedHelperExprs::UB
clang::OMPLoopDirective::DistCombinedHelperExprs::EUB
clang::OMPLoopDirective::DistCombinedHelperExprs::Init
clang::OMPLoopDirective::DistCombinedHelperExprs::Cond
clang::OMPLoopDirective::DistCombinedHelperExprs::NLB
clang::OMPLoopDirective::DistCombinedHelperExprs::NUB
clang::OMPLoopDirective::DistCombinedHelperExprs::DistCond
clang::OMPLoopDirective::DistCombinedHelperExprs::ParForInDistCond
clang::OMPLoopDirective::HelperExprs
clang::OMPLoopDirective::HelperExprs::IterationVarRef
clang::OMPLoopDirective::HelperExprs::LastIteration
clang::OMPLoopDirective::HelperExprs::NumIterations
clang::OMPLoopDirective::HelperExprs::CalcLastIteration
clang::OMPLoopDirective::HelperExprs::PreCond
clang::OMPLoopDirective::HelperExprs::Cond
clang::OMPLoopDirective::HelperExprs::Init
clang::OMPLoopDirective::HelperExprs::Inc
clang::OMPLoopDirective::HelperExprs::IL
clang::OMPLoopDirective::HelperExprs::LB
clang::OMPLoopDirective::HelperExprs::UB
clang::OMPLoopDirective::HelperExprs::ST
clang::OMPLoopDirective::HelperExprs::EUB
clang::OMPLoopDirective::HelperExprs::NLB
clang::OMPLoopDirective::HelperExprs::NUB
clang::OMPLoopDirective::HelperExprs::PrevLB
clang::OMPLoopDirective::HelperExprs::PrevUB
clang::OMPLoopDirective::HelperExprs::DistInc
clang::OMPLoopDirective::HelperExprs::PrevEUB
clang::OMPLoopDirective::HelperExprs::Counters
clang::OMPLoopDirective::HelperExprs::PrivateCounters
clang::OMPLoopDirective::HelperExprs::Inits
clang::OMPLoopDirective::HelperExprs::Updates
clang::OMPLoopDirective::HelperExprs::Finals
clang::OMPLoopDirective::HelperExprs::PreInits
clang::OMPLoopDirective::HelperExprs::DistCombinedFields
clang::OMPLoopDirective::HelperExprs::builtAll
clang::OMPLoopDirective::HelperExprs::clear
clang::OMPLoopDirective::getCollapsedNumber
clang::OMPLoopDirective::getIterationVariable
clang::OMPLoopDirective::getLastIteration
clang::OMPLoopDirective::getCalcLastIteration
clang::OMPLoopDirective::getPreCond
clang::OMPLoopDirective::getCond
clang::OMPLoopDirective::getInit
clang::OMPLoopDirective::getInc
clang::OMPLoopDirective::getPreInits
clang::OMPLoopDirective::getPreInits
clang::OMPLoopDirective::getIsLastIterVariable
clang::OMPLoopDirective::getLowerBoundVariable
clang::OMPLoopDirective::getUpperBoundVariable
clang::OMPLoopDirective::getStrideVariable
clang::OMPLoopDirective::getEnsureUpperBound
clang::OMPLoopDirective::getNextLowerBound
clang::OMPLoopDirective::getNextUpperBound
clang::OMPLoopDirective::getNumIterations
clang::OMPLoopDirective::getPrevLowerBoundVariable
clang::OMPLoopDirective::getPrevUpperBoundVariable
clang::OMPLoopDirective::getDistInc
clang::OMPLoopDirective::getPrevEnsureUpperBound
clang::OMPLoopDirective::getCombinedLowerBoundVariable
clang::OMPLoopDirective::getCombinedUpperBoundVariable
clang::OMPLoopDirective::getCombinedEnsureUpperBound
clang::OMPLoopDirective::getCombinedInit
clang::OMPLoopDirective::getCombinedCond
clang::OMPLoopDirective::getCombinedNextLowerBound
clang::OMPLoopDirective::getCombinedNextUpperBound
clang::OMPLoopDirective::getCombinedDistCond
clang::OMPLoopDirective::getCombinedParForInDistCond
clang::OMPLoopDirective::getBody
clang::OMPLoopDirective::counters
clang::OMPLoopDirective::counters
clang::OMPLoopDirective::private_counters
clang::OMPLoopDirective::private_counters
clang::OMPLoopDirective::inits
clang::OMPLoopDirective::inits
clang::OMPLoopDirective::updates
clang::OMPLoopDirective::updates
clang::OMPLoopDirective::finals
clang::OMPLoopDirective::finals
clang::OMPLoopDirective::classof
clang::OMPSimdDirective::Create
clang::OMPSimdDirective::CreateEmpty
clang::OMPSimdDirective::classof
clang::OMPForDirective::HasCancel
clang::OMPForDirective::setHasCancel
clang::OMPForDirective::Create
clang::OMPForDirective::CreateEmpty
clang::OMPForDirective::hasCancel
clang::OMPForDirective::classof
clang::OMPForSimdDirective::Create
clang::OMPForSimdDirective::CreateEmpty
clang::OMPForSimdDirective::classof
clang::OMPSectionsDirective::HasCancel
clang::OMPSectionsDirective::setHasCancel
clang::OMPSectionsDirective::Create
clang::OMPSectionsDirective::CreateEmpty
clang::OMPSectionsDirective::hasCancel
clang::OMPSectionsDirective::classof
clang::OMPSectionDirective::HasCancel
clang::OMPSectionDirective::Create
clang::OMPSectionDirective::CreateEmpty
clang::OMPSectionDirective::setHasCancel
clang::OMPSectionDirective::hasCancel
clang::OMPSectionDirective::classof
clang::OMPSingleDirective::Create
clang::OMPSingleDirective::CreateEmpty
clang::OMPSingleDirective::classof
clang::OMPMasterDirective::Create
clang::OMPMasterDirective::CreateEmpty
clang::OMPMasterDirective::classof
clang::OMPCriticalDirective::DirName
clang::OMPCriticalDirective::setDirectiveName
clang::OMPCriticalDirective::Create
clang::OMPCriticalDirective::CreateEmpty
clang::OMPCriticalDirective::getDirectiveName
clang::OMPCriticalDirective::classof
clang::OMPParallelForDirective::HasCancel
clang::OMPParallelForDirective::setHasCancel
clang::OMPParallelForDirective::Create
clang::OMPParallelForDirective::CreateEmpty
clang::OMPParallelForDirective::hasCancel
clang::OMPParallelForDirective::classof
clang::OMPParallelForSimdDirective::Create
clang::OMPParallelForSimdDirective::CreateEmpty
clang::OMPParallelForSimdDirective::classof
clang::OMPParallelSectionsDirective::HasCancel
clang::OMPParallelSectionsDirective::setHasCancel
clang::OMPParallelSectionsDirective::Create
clang::OMPParallelSectionsDirective::CreateEmpty
clang::OMPParallelSectionsDirective::hasCancel
clang::OMPParallelSectionsDirective::classof
clang::OMPTaskDirective::HasCancel
clang::OMPTaskDirective::setHasCancel
clang::OMPTaskDirective::Create
clang::OMPTaskDirective::CreateEmpty
clang::OMPTaskDirective::hasCancel
clang::OMPTaskDirective::classof
clang::OMPTaskyieldDirective::Create
clang::OMPTaskyieldDirective::CreateEmpty
clang::OMPTaskyieldDirective::classof
clang::OMPBarrierDirective::Create
clang::OMPBarrierDirective::CreateEmpty
clang::OMPBarrierDirective::classof
clang::OMPTaskwaitDirective::Create
clang::OMPTaskwaitDirective::CreateEmpty
clang::OMPTaskwaitDirective::classof
clang::OMPTaskgroupDirective::setReductionRef
clang::OMPTaskgroupDirective::Create
clang::OMPTaskgroupDirective::CreateEmpty
clang::OMPTaskgroupDirective::getReductionRef
clang::OMPTaskgroupDirective::getReductionRef
clang::OMPTaskgroupDirective::classof
clang::OMPFlushDirective::Create
clang::OMPFlushDirective::CreateEmpty
clang::OMPFlushDirective::classof
clang::OMPOrderedDirective::Create
clang::OMPOrderedDirective::CreateEmpty
clang::OMPOrderedDirective::classof
clang::OMPAtomicDirective::IsXLHSInRHSPart
clang::OMPAtomicDirective::IsPostfixUpdate
clang::OMPAtomicDirective::setX
clang::OMPAtomicDirective::setUpdateExpr
clang::OMPAtomicDirective::setV
clang::OMPAtomicDirective::setExpr
clang::OMPAtomicDirective::Create
clang::OMPAtomicDirective::CreateEmpty
clang::OMPAtomicDirective::getX
clang::OMPAtomicDirective::getX
clang::OMPAtomicDirective::getUpdateExpr
clang::OMPAtomicDirective::getUpdateExpr
clang::OMPAtomicDirective::isXLHSInRHSPart
clang::OMPAtomicDirective::isPostfixUpdate
clang::OMPAtomicDirective::getV
clang::OMPAtomicDirective::getV
clang::OMPAtomicDirective::getExpr
clang::OMPAtomicDirective::getExpr
clang::OMPAtomicDirective::classof
clang::OMPTargetDirective::Create
clang::OMPTargetDirective::CreateEmpty
clang::OMPTargetDirective::classof
clang::OMPTargetDataDirective::Create
clang::OMPTargetDataDirective::CreateEmpty
clang::OMPTargetDataDirective::classof
clang::OMPTargetEnterDataDirective::Create
clang::OMPTargetEnterDataDirective::CreateEmpty
clang::OMPTargetEnterDataDirective::classof
clang::OMPTargetExitDataDirective::Create
clang::OMPTargetExitDataDirective::CreateEmpty
clang::OMPTargetExitDataDirective::classof
clang::OMPTargetParallelDirective::Create
clang::OMPTargetParallelDirective::CreateEmpty
clang::OMPTargetParallelDirective::classof
clang::OMPTargetParallelForDirective::HasCancel
clang::OMPTargetParallelForDirective::setHasCancel
clang::OMPTargetParallelForDirective::Create
clang::OMPTargetParallelForDirective::CreateEmpty
clang::OMPTargetParallelForDirective::hasCancel
clang::OMPTargetParallelForDirective::classof
clang::OMPTeamsDirective::Create
clang::OMPTeamsDirective::CreateEmpty
clang::OMPTeamsDirective::classof
clang::OMPCancellationPointDirective::CancelRegion
clang::OMPCancellationPointDirective::setCancelRegion
clang::OMPCancellationPointDirective::Create
clang::OMPCancellationPointDirective::CreateEmpty
clang::OMPCancellationPointDirective::getCancelRegion
clang::OMPCancellationPointDirective::classof
clang::OMPCancelDirective::CancelRegion
clang::OMPCancelDirective::setCancelRegion
clang::OMPCancelDirective::Create
clang::OMPCancelDirective::CreateEmpty
clang::OMPCancelDirective::getCancelRegion
clang::OMPCancelDirective::classof
clang::OMPTaskLoopDirective::Create
clang::OMPTaskLoopDirective::CreateEmpty
clang::OMPTaskLoopDirective::classof
clang::OMPTaskLoopSimdDirective::Create
clang::OMPTaskLoopSimdDirective::CreateEmpty
clang::OMPTaskLoopSimdDirective::classof
clang::OMPDistributeDirective::Create
clang::OMPDistributeDirective::CreateEmpty
clang::OMPDistributeDirective::classof
clang::OMPTargetUpdateDirective::Create
clang::OMPTargetUpdateDirective::CreateEmpty
clang::OMPTargetUpdateDirective::classof
clang::OMPDistributeParallelForDirective::HasCancel
clang::OMPDistributeParallelForDirective::setHasCancel
clang::OMPDistributeParallelForDirective::Create
clang::OMPDistributeParallelForDirective::CreateEmpty
clang::OMPDistributeParallelForDirective::hasCancel
clang::OMPDistributeParallelForDirective::classof
clang::OMPDistributeParallelForSimdDirective::Create
clang::OMPDistributeParallelForSimdDirective::CreateEmpty
clang::OMPDistributeParallelForSimdDirective::classof
clang::OMPDistributeSimdDirective::Create
clang::OMPDistributeSimdDirective::CreateEmpty
clang::OMPDistributeSimdDirective::classof
clang::OMPTargetParallelForSimdDirective::Create
clang::OMPTargetParallelForSimdDirective::CreateEmpty
clang::OMPTargetParallelForSimdDirective::classof
clang::OMPTargetSimdDirective::Create
clang::OMPTargetSimdDirective::CreateEmpty
clang::OMPTargetSimdDirective::classof
clang::OMPTeamsDistributeDirective::Create
clang::OMPTeamsDistributeDirective::CreateEmpty
clang::OMPTeamsDistributeDirective::classof
clang::OMPTeamsDistributeSimdDirective::Create
clang::OMPTeamsDistributeSimdDirective::CreateEmpty
clang::OMPTeamsDistributeSimdDirective::classof
clang::OMPTeamsDistributeParallelForSimdDirective::Create
clang::OMPTeamsDistributeParallelForSimdDirective::CreateEmpty
clang::OMPTeamsDistributeParallelForSimdDirective::classof
clang::OMPTeamsDistributeParallelForDirective::HasCancel
clang::OMPTeamsDistributeParallelForDirective::setHasCancel
clang::OMPTeamsDistributeParallelForDirective::Create
clang::OMPTeamsDistributeParallelForDirective::CreateEmpty
clang::OMPTeamsDistributeParallelForDirective::hasCancel
clang::OMPTeamsDistributeParallelForDirective::classof
clang::OMPTargetTeamsDirective::Create
clang::OMPTargetTeamsDirective::CreateEmpty
clang::OMPTargetTeamsDirective::classof
clang::OMPTargetTeamsDistributeDirective::Create
clang::OMPTargetTeamsDistributeDirective::CreateEmpty
clang::OMPTargetTeamsDistributeDirective::classof
clang::OMPTargetTeamsDistributeParallelForDirective::HasCancel
clang::OMPTargetTeamsDistributeParallelForDirective::setHasCancel
clang::OMPTargetTeamsDistributeParallelForDirective::Create
clang::OMPTargetTeamsDistributeParallelForDirective::CreateEmpty
clang::OMPTargetTeamsDistributeParallelForDirective::hasCancel
clang::OMPTargetTeamsDistributeParallelForDirective::classof
clang::OMPTargetTeamsDistributeParallelForSimdDirective::Create
clang::OMPTargetTeamsDistributeParallelForSimdDirective::CreateEmpty
clang::OMPTargetTeamsDistributeParallelForSimdDirective::classof
clang::OMPTargetTeamsDistributeSimdDirective::Create
clang::OMPTargetTeamsDistributeSimdDirective::CreateEmpty
clang::OMPTargetTeamsDistributeSimdDirective::classof