clang  17.0.0git
StmtOpenMP.cpp
Go to the documentation of this file.
1 //===--- StmtOpenMP.cpp - Classes for OpenMP directives -------------------===//
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 //
9 // This file implements the subclesses of Stmt class declared in StmtOpenMP.h
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "clang/AST/ASTContext.h"
14 #include "clang/AST/StmtOpenMP.h"
15 
16 using namespace clang;
17 using namespace llvm::omp;
18 
19 size_t OMPChildren::size(unsigned NumClauses, bool HasAssociatedStmt,
20  unsigned NumChildren) {
21  return llvm::alignTo(
22  totalSizeToAlloc<OMPClause *, Stmt *>(
23  NumClauses, NumChildren + (HasAssociatedStmt ? 1 : 0)),
24  alignof(OMPChildren));
25 }
26 
28  assert(Clauses.size() == NumClauses &&
29  "Number of clauses is not the same as the preallocated buffer");
30  llvm::copy(Clauses, getTrailingObjects<OMPClause *>());
31 }
32 
34  return llvm::MutableArrayRef(getTrailingObjects<Stmt *>(), NumChildren);
35 }
36 
37 OMPChildren *OMPChildren::Create(void *Mem, ArrayRef<OMPClause *> Clauses) {
38  auto *Data = CreateEmpty(Mem, Clauses.size());
39  Data->setClauses(Clauses);
40  return Data;
41 }
42 
43 OMPChildren *OMPChildren::Create(void *Mem, ArrayRef<OMPClause *> Clauses,
44  Stmt *S, unsigned NumChildren) {
45  auto *Data = CreateEmpty(Mem, Clauses.size(), S, NumChildren);
46  Data->setClauses(Clauses);
47  if (S)
48  Data->setAssociatedStmt(S);
49  return Data;
50 }
51 
52 OMPChildren *OMPChildren::CreateEmpty(void *Mem, unsigned NumClauses,
53  bool HasAssociatedStmt,
54  unsigned NumChildren) {
55  return new (Mem) OMPChildren(NumClauses, NumChildren, HasAssociatedStmt);
56 }
57 
59  // Special case: 'omp target enter data', 'omp target exit data',
60  // 'omp target update' are stand-alone directives, but for implementation
61  // reasons they have empty synthetic structured block, to simplify codegen.
62  if (isa<OMPTargetEnterDataDirective>(this) ||
63  isa<OMPTargetExitDataDirective>(this) ||
64  isa<OMPTargetUpdateDirective>(this))
65  return true;
66  return !hasAssociatedStmt();
67 }
68 
70  assert(!isStandaloneDirective() &&
71  "Standalone Executable Directives don't have Structured Blocks.");
72  if (auto *LD = dyn_cast<OMPLoopDirective>(this))
73  return LD->getBody();
74  return getRawStmt();
75 }
76 
77 Stmt *
79  bool TryImperfectlyNestedLoops) {
80  Stmt *OrigStmt = CurStmt;
81  CurStmt = CurStmt->IgnoreContainers();
82  // Additional work for imperfectly nested loops, introduced in OpenMP 5.0.
83  if (TryImperfectlyNestedLoops) {
84  if (auto *CS = dyn_cast<CompoundStmt>(CurStmt)) {
85  CurStmt = nullptr;
86  SmallVector<CompoundStmt *, 4> Statements(1, CS);
87  SmallVector<CompoundStmt *, 4> NextStatements;
88  while (!Statements.empty()) {
89  CS = Statements.pop_back_val();
90  if (!CS)
91  continue;
92  for (Stmt *S : CS->body()) {
93  if (!S)
94  continue;
95  if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(S))
96  S = CanonLoop->getLoopStmt();
97  if (isa<ForStmt>(S) || isa<CXXForRangeStmt>(S) ||
98  (isa<OMPLoopBasedDirective>(S) && !isa<OMPLoopDirective>(S))) {
99  // Only single loop construct is allowed.
100  if (CurStmt) {
101  CurStmt = OrigStmt;
102  break;
103  }
104  CurStmt = S;
105  continue;
106  }
107  S = S->IgnoreContainers();
108  if (auto *InnerCS = dyn_cast_or_null<CompoundStmt>(S))
109  NextStatements.push_back(InnerCS);
110  }
111  if (Statements.empty()) {
112  // Found single inner loop or multiple loops - exit.
113  if (CurStmt)
114  break;
115  Statements.swap(NextStatements);
116  }
117  }
118  if (!CurStmt)
119  CurStmt = OrigStmt;
120  }
121  }
122  return CurStmt;
123 }
124 
126  Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops,
127  llvm::function_ref<bool(unsigned, Stmt *)> Callback,
128  llvm::function_ref<void(OMPLoopTransformationDirective *)>
129  OnTransformationCallback) {
130  CurStmt = CurStmt->IgnoreContainers();
131  for (unsigned Cnt = 0; Cnt < NumLoops; ++Cnt) {
132  while (true) {
133  auto *Dir = dyn_cast<OMPLoopTransformationDirective>(CurStmt);
134  if (!Dir)
135  break;
136 
137  OnTransformationCallback(Dir);
138 
139  Stmt *TransformedStmt = Dir->getTransformedStmt();
140  if (!TransformedStmt) {
141  unsigned NumGeneratedLoops = Dir->getNumGeneratedLoops();
142  if (NumGeneratedLoops == 0) {
143  // May happen if the loop transformation does not result in a
144  // generated loop (such as full unrolling).
145  break;
146  }
147  if (NumGeneratedLoops > 0) {
148  // The loop transformation construct has generated loops, but these
149  // may not have been generated yet due to being in a dependent
150  // context.
151  return true;
152  }
153  }
154 
155  CurStmt = TransformedStmt;
156  }
157  if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(CurStmt))
158  CurStmt = CanonLoop->getLoopStmt();
159  if (Callback(Cnt, CurStmt))
160  return false;
161  // Move on to the next nested for loop, or to the loop body.
162  // OpenMP [2.8.1, simd construct, Restrictions]
163  // All loops associated with the construct must be perfectly nested; that
164  // is, there must be no intervening code nor any OpenMP directive between
165  // any two loops.
166  if (auto *For = dyn_cast<ForStmt>(CurStmt)) {
167  CurStmt = For->getBody();
168  } else {
169  assert(isa<CXXForRangeStmt>(CurStmt) &&
170  "Expected canonical for or range-based for loops.");
171  CurStmt = cast<CXXForRangeStmt>(CurStmt)->getBody();
172  }
174  CurStmt, TryImperfectlyNestedLoops);
175  }
176  return true;
177 }
178 
180  Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops,
181  llvm::function_ref<void(unsigned, Stmt *, Stmt *)> Callback) {
183  CurStmt, TryImperfectlyNestedLoops, NumLoops,
184  [Callback](unsigned Cnt, Stmt *Loop) {
185  Stmt *Body = nullptr;
186  if (auto *For = dyn_cast<ForStmt>(Loop)) {
187  Body = For->getBody();
188  } else {
189  assert(isa<CXXForRangeStmt>(Loop) &&
190  "Expected canonical for or range-based for loops.");
191  Body = cast<CXXForRangeStmt>(Loop)->getBody();
192  }
193  if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Body))
194  Body = CanonLoop->getLoopStmt();
195  Callback(Cnt, Loop, Body);
196  return false;
197  });
198  assert(Res && "Expected only loops");
199  (void)Res;
200 }
201 
203  // This relies on the loop form is already checked by Sema.
204  Stmt *Body = nullptr;
206  Data->getRawStmt(), /*TryImperfectlyNestedLoops=*/true,
207  NumAssociatedLoops,
208  [&Body](unsigned, Stmt *, Stmt *BodyStmt) { Body = BodyStmt; });
209  return Body;
210 }
211 
213  assert(A.size() == getLoopsNumber() &&
214  "Number of loop counters is not the same as the collapsed number");
215  llvm::copy(A, getCounters().begin());
216 }
217 
219  assert(A.size() == getLoopsNumber() && "Number of loop private counters "
220  "is not the same as the collapsed "
221  "number");
222  llvm::copy(A, getPrivateCounters().begin());
223 }
224 
226  assert(A.size() == getLoopsNumber() &&
227  "Number of counter inits is not the same as the collapsed number");
228  llvm::copy(A, getInits().begin());
229 }
230 
232  assert(A.size() == getLoopsNumber() &&
233  "Number of counter updates is not the same as the collapsed number");
234  llvm::copy(A, getUpdates().begin());
235 }
236 
238  assert(A.size() == getLoopsNumber() &&
239  "Number of counter finals is not the same as the collapsed number");
240  llvm::copy(A, getFinals().begin());
241 }
242 
244  assert(
245  A.size() == getLoopsNumber() &&
246  "Number of dependent counters is not the same as the collapsed number");
247  llvm::copy(A, getDependentCounters().begin());
248 }
249 
251  assert(A.size() == getLoopsNumber() &&
252  "Number of dependent inits is not the same as the collapsed number");
253  llvm::copy(A, getDependentInits().begin());
254 }
255 
257  assert(A.size() == getLoopsNumber() &&
258  "Number of finals conditions is not the same as the collapsed number");
259  llvm::copy(A, getFinalsConditions().begin());
260 }
261 
263  SourceLocation StartLoc,
264  SourceLocation EndLoc,
265  ArrayRef<OMPClause *> Clauses,
266  Stmt *AssociatedStmt, Stmt *IfStmt) {
267  auto *Dir = createDirective<OMPMetaDirective>(
268  C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
269  Dir->setIfStmt(IfStmt);
270  return Dir;
271 }
272 
274  unsigned NumClauses,
275  EmptyShell) {
276  return createEmptyDirective<OMPMetaDirective>(C, NumClauses,
277  /*HasAssociatedStmt=*/true,
278  /*NumChildren=*/1);
279 }
280 
282  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
283  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
284  bool HasCancel) {
285  auto *Dir = createDirective<OMPParallelDirective>(
286  C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
287  Dir->setTaskReductionRefExpr(TaskRedRef);
288  Dir->setHasCancel(HasCancel);
289  return Dir;
290 }
291 
293  unsigned NumClauses,
294  EmptyShell) {
295  return createEmptyDirective<OMPParallelDirective>(C, NumClauses,
296  /*HasAssociatedStmt=*/true,
297  /*NumChildren=*/1);
298 }
299 
302  SourceLocation EndLoc, unsigned CollapsedNum,
303  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
304  const HelperExprs &Exprs) {
305  auto *Dir = createDirective<OMPSimdDirective>(
306  C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_simd),
307  StartLoc, EndLoc, CollapsedNum);
308  Dir->setIterationVariable(Exprs.IterationVarRef);
309  Dir->setLastIteration(Exprs.LastIteration);
310  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
311  Dir->setPreCond(Exprs.PreCond);
312  Dir->setCond(Exprs.Cond);
313  Dir->setInit(Exprs.Init);
314  Dir->setInc(Exprs.Inc);
315  Dir->setCounters(Exprs.Counters);
316  Dir->setPrivateCounters(Exprs.PrivateCounters);
317  Dir->setInits(Exprs.Inits);
318  Dir->setUpdates(Exprs.Updates);
319  Dir->setFinals(Exprs.Finals);
320  Dir->setDependentCounters(Exprs.DependentCounters);
321  Dir->setDependentInits(Exprs.DependentInits);
322  Dir->setFinalsConditions(Exprs.FinalsConditions);
323  Dir->setPreInits(Exprs.PreInits);
324  return Dir;
325 }
326 
328  unsigned NumClauses,
329  unsigned CollapsedNum,
330  EmptyShell) {
331  return createEmptyDirective<OMPSimdDirective>(
332  C, NumClauses, /*HasAssociatedStmt=*/true,
333  numLoopChildren(CollapsedNum, OMPD_simd), CollapsedNum);
334 }
335 
337  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
338  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
339  const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
340  auto *Dir = createDirective<OMPForDirective>(
341  C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for) + 1,
342  StartLoc, EndLoc, CollapsedNum);
343  Dir->setIterationVariable(Exprs.IterationVarRef);
344  Dir->setLastIteration(Exprs.LastIteration);
345  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
346  Dir->setPreCond(Exprs.PreCond);
347  Dir->setCond(Exprs.Cond);
348  Dir->setInit(Exprs.Init);
349  Dir->setInc(Exprs.Inc);
350  Dir->setIsLastIterVariable(Exprs.IL);
351  Dir->setLowerBoundVariable(Exprs.LB);
352  Dir->setUpperBoundVariable(Exprs.UB);
353  Dir->setStrideVariable(Exprs.ST);
354  Dir->setEnsureUpperBound(Exprs.EUB);
355  Dir->setNextLowerBound(Exprs.NLB);
356  Dir->setNextUpperBound(Exprs.NUB);
357  Dir->setNumIterations(Exprs.NumIterations);
358  Dir->setCounters(Exprs.Counters);
359  Dir->setPrivateCounters(Exprs.PrivateCounters);
360  Dir->setInits(Exprs.Inits);
361  Dir->setUpdates(Exprs.Updates);
362  Dir->setFinals(Exprs.Finals);
363  Dir->setDependentCounters(Exprs.DependentCounters);
364  Dir->setDependentInits(Exprs.DependentInits);
365  Dir->setFinalsConditions(Exprs.FinalsConditions);
366  Dir->setPreInits(Exprs.PreInits);
367  Dir->setTaskReductionRefExpr(TaskRedRef);
368  Dir->setHasCancel(HasCancel);
369  return Dir;
370 }
371 
373  switch (getStmtClass()) {
374 #define STMT(CLASS, PARENT)
375 #define ABSTRACT_STMT(CLASS)
376 #define OMPLOOPTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
377  case Stmt::CLASS##Class: \
378  return static_cast<const CLASS *>(this)->getTransformedStmt();
379 #include "clang/AST/StmtNodes.inc"
380  default:
381  llvm_unreachable("Not a loop transformation");
382  }
383 }
384 
386  switch (getStmtClass()) {
387 #define STMT(CLASS, PARENT)
388 #define ABSTRACT_STMT(CLASS)
389 #define OMPLOOPTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
390  case Stmt::CLASS##Class: \
391  return static_cast<const CLASS *>(this)->getPreInits();
392 #include "clang/AST/StmtNodes.inc"
393  default:
394  llvm_unreachable("Not a loop transformation");
395  }
396 }
397 
399  unsigned NumClauses,
400  unsigned CollapsedNum,
401  EmptyShell) {
402  return createEmptyDirective<OMPForDirective>(
403  C, NumClauses, /*HasAssociatedStmt=*/true,
404  numLoopChildren(CollapsedNum, OMPD_for) + 1, CollapsedNum);
405 }
406 
409  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
410  unsigned NumLoops, Stmt *AssociatedStmt,
411  Stmt *TransformedStmt, Stmt *PreInits) {
412  OMPTileDirective *Dir = createDirective<OMPTileDirective>(
413  C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
414  NumLoops);
415  Dir->setTransformedStmt(TransformedStmt);
416  Dir->setPreInits(PreInits);
417  return Dir;
418 }
419 
421  unsigned NumClauses,
422  unsigned NumLoops) {
423  return createEmptyDirective<OMPTileDirective>(
424  C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1,
425  SourceLocation(), SourceLocation(), NumLoops);
426 }
427 
430  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
431  Stmt *AssociatedStmt, unsigned NumGeneratedLoops,
432  Stmt *TransformedStmt, Stmt *PreInits) {
433  assert(NumGeneratedLoops <= 1 && "Unrolling generates at most one loop");
434 
435  auto *Dir = createDirective<OMPUnrollDirective>(
436  C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc);
437  Dir->setNumGeneratedLoops(NumGeneratedLoops);
438  Dir->setTransformedStmt(TransformedStmt);
439  Dir->setPreInits(PreInits);
440  return Dir;
441 }
442 
444  unsigned NumClauses) {
445  return createEmptyDirective<OMPUnrollDirective>(
446  C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1,
448 }
449 
452  SourceLocation EndLoc, unsigned CollapsedNum,
453  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
454  const HelperExprs &Exprs) {
455  auto *Dir = createDirective<OMPForSimdDirective>(
456  C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for_simd),
457  StartLoc, EndLoc, CollapsedNum);
458  Dir->setIterationVariable(Exprs.IterationVarRef);
459  Dir->setLastIteration(Exprs.LastIteration);
460  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
461  Dir->setPreCond(Exprs.PreCond);
462  Dir->setCond(Exprs.Cond);
463  Dir->setInit(Exprs.Init);
464  Dir->setInc(Exprs.Inc);
465  Dir->setIsLastIterVariable(Exprs.IL);
466  Dir->setLowerBoundVariable(Exprs.LB);
467  Dir->setUpperBoundVariable(Exprs.UB);
468  Dir->setStrideVariable(Exprs.ST);
469  Dir->setEnsureUpperBound(Exprs.EUB);
470  Dir->setNextLowerBound(Exprs.NLB);
471  Dir->setNextUpperBound(Exprs.NUB);
472  Dir->setNumIterations(Exprs.NumIterations);
473  Dir->setCounters(Exprs.Counters);
474  Dir->setPrivateCounters(Exprs.PrivateCounters);
475  Dir->setInits(Exprs.Inits);
476  Dir->setUpdates(Exprs.Updates);
477  Dir->setFinals(Exprs.Finals);
478  Dir->setDependentCounters(Exprs.DependentCounters);
479  Dir->setDependentInits(Exprs.DependentInits);
480  Dir->setFinalsConditions(Exprs.FinalsConditions);
481  Dir->setPreInits(Exprs.PreInits);
482  return Dir;
483 }
484 
486  unsigned NumClauses,
487  unsigned CollapsedNum,
488  EmptyShell) {
489  return createEmptyDirective<OMPForSimdDirective>(
490  C, NumClauses, /*HasAssociatedStmt=*/true,
491  numLoopChildren(CollapsedNum, OMPD_for_simd), CollapsedNum);
492 }
493 
495  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
496  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
497  bool HasCancel) {
498  auto *Dir = createDirective<OMPSectionsDirective>(C, Clauses, AssociatedStmt,
499  /*NumChildren=*/1, StartLoc,
500  EndLoc);
501  Dir->setTaskReductionRefExpr(TaskRedRef);
502  Dir->setHasCancel(HasCancel);
503  return Dir;
504 }
505 
507  unsigned NumClauses,
508  EmptyShell) {
509  return createEmptyDirective<OMPSectionsDirective>(C, NumClauses,
510  /*HasAssociatedStmt=*/true,
511  /*NumChildren=*/1);
512 }
513 
515  SourceLocation StartLoc,
516  SourceLocation EndLoc,
517  Stmt *AssociatedStmt,
518  bool HasCancel) {
519  auto *Dir =
520  createDirective<OMPSectionDirective>(C, std::nullopt, AssociatedStmt,
521  /*NumChildren=*/0, StartLoc, EndLoc);
522  Dir->setHasCancel(HasCancel);
523  return Dir;
524 }
525 
527  EmptyShell) {
528  return createEmptyDirective<OMPSectionDirective>(C, /*NumClauses=*/0,
529  /*HasAssociatedStmt=*/true);
530 }
531 
533  SourceLocation StartLoc,
534  SourceLocation EndLoc,
535  ArrayRef<OMPClause *> Clauses,
536  Stmt *AssociatedStmt) {
537  return createDirective<OMPSingleDirective>(C, Clauses, AssociatedStmt,
538  /*NumChildren=*/0, StartLoc,
539  EndLoc);
540 }
541 
543  unsigned NumClauses,
544  EmptyShell) {
545  return createEmptyDirective<OMPSingleDirective>(C, NumClauses,
546  /*HasAssociatedStmt=*/true);
547 }
548 
550  SourceLocation StartLoc,
551  SourceLocation EndLoc,
552  Stmt *AssociatedStmt) {
553  return createDirective<OMPMasterDirective>(C, std::nullopt, AssociatedStmt,
554  /*NumChildren=*/0, StartLoc,
555  EndLoc);
556 }
557 
559  EmptyShell) {
560  return createEmptyDirective<OMPMasterDirective>(C, /*NumClauses=*/0,
561  /*HasAssociatedStmt=*/true);
562 }
563 
565  const ASTContext &C, const DeclarationNameInfo &Name,
566  SourceLocation StartLoc, SourceLocation EndLoc,
567  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
568  return createDirective<OMPCriticalDirective>(C, Clauses, AssociatedStmt,
569  /*NumChildren=*/0, Name,
570  StartLoc, EndLoc);
571 }
572 
574  unsigned NumClauses,
575  EmptyShell) {
576  return createEmptyDirective<OMPCriticalDirective>(C, NumClauses,
577  /*HasAssociatedStmt=*/true);
578 }
579 
581  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
582  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
583  const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
584  auto *Dir = createDirective<OMPParallelForDirective>(
585  C, Clauses, AssociatedStmt,
586  numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, StartLoc, EndLoc,
587  CollapsedNum);
588  Dir->setIterationVariable(Exprs.IterationVarRef);
589  Dir->setLastIteration(Exprs.LastIteration);
590  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
591  Dir->setPreCond(Exprs.PreCond);
592  Dir->setCond(Exprs.Cond);
593  Dir->setInit(Exprs.Init);
594  Dir->setInc(Exprs.Inc);
595  Dir->setIsLastIterVariable(Exprs.IL);
596  Dir->setLowerBoundVariable(Exprs.LB);
597  Dir->setUpperBoundVariable(Exprs.UB);
598  Dir->setStrideVariable(Exprs.ST);
599  Dir->setEnsureUpperBound(Exprs.EUB);
600  Dir->setNextLowerBound(Exprs.NLB);
601  Dir->setNextUpperBound(Exprs.NUB);
602  Dir->setNumIterations(Exprs.NumIterations);
603  Dir->setCounters(Exprs.Counters);
604  Dir->setPrivateCounters(Exprs.PrivateCounters);
605  Dir->setInits(Exprs.Inits);
606  Dir->setUpdates(Exprs.Updates);
607  Dir->setFinals(Exprs.Finals);
608  Dir->setDependentCounters(Exprs.DependentCounters);
609  Dir->setDependentInits(Exprs.DependentInits);
610  Dir->setFinalsConditions(Exprs.FinalsConditions);
611  Dir->setPreInits(Exprs.PreInits);
612  Dir->setTaskReductionRefExpr(TaskRedRef);
613  Dir->setHasCancel(HasCancel);
614  return Dir;
615 }
616 
618 OMPParallelForDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
619  unsigned CollapsedNum, EmptyShell) {
620  return createEmptyDirective<OMPParallelForDirective>(
621  C, NumClauses, /*HasAssociatedStmt=*/true,
622  numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, CollapsedNum);
623 }
624 
626  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
627  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
628  const HelperExprs &Exprs) {
629  auto *Dir = createDirective<OMPParallelForSimdDirective>(
630  C, Clauses, AssociatedStmt,
631  numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), StartLoc, EndLoc,
632  CollapsedNum);
633  Dir->setIterationVariable(Exprs.IterationVarRef);
634  Dir->setLastIteration(Exprs.LastIteration);
635  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
636  Dir->setPreCond(Exprs.PreCond);
637  Dir->setCond(Exprs.Cond);
638  Dir->setInit(Exprs.Init);
639  Dir->setInc(Exprs.Inc);
640  Dir->setIsLastIterVariable(Exprs.IL);
641  Dir->setLowerBoundVariable(Exprs.LB);
642  Dir->setUpperBoundVariable(Exprs.UB);
643  Dir->setStrideVariable(Exprs.ST);
644  Dir->setEnsureUpperBound(Exprs.EUB);
645  Dir->setNextLowerBound(Exprs.NLB);
646  Dir->setNextUpperBound(Exprs.NUB);
647  Dir->setNumIterations(Exprs.NumIterations);
648  Dir->setCounters(Exprs.Counters);
649  Dir->setPrivateCounters(Exprs.PrivateCounters);
650  Dir->setInits(Exprs.Inits);
651  Dir->setUpdates(Exprs.Updates);
652  Dir->setFinals(Exprs.Finals);
653  Dir->setDependentCounters(Exprs.DependentCounters);
654  Dir->setDependentInits(Exprs.DependentInits);
655  Dir->setFinalsConditions(Exprs.FinalsConditions);
656  Dir->setPreInits(Exprs.PreInits);
657  return Dir;
658 }
659 
662  unsigned NumClauses,
663  unsigned CollapsedNum, EmptyShell) {
664  return createEmptyDirective<OMPParallelForSimdDirective>(
665  C, NumClauses, /*HasAssociatedStmt=*/true,
666  numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), CollapsedNum);
667 }
668 
670  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
671  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) {
672  auto *Dir = createDirective<OMPParallelMasterDirective>(
673  C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
674  Dir->setTaskReductionRefExpr(TaskRedRef);
675  return Dir;
676 }
677 
680  unsigned NumClauses, EmptyShell) {
681  return createEmptyDirective<OMPParallelMasterDirective>(
682  C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
683 }
684 
686  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
687  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) {
688  auto *Dir = createDirective<OMPParallelMaskedDirective>(
689  C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
690  Dir->setTaskReductionRefExpr(TaskRedRef);
691  return Dir;
692 }
693 
696  unsigned NumClauses, EmptyShell) {
697  return createEmptyDirective<OMPParallelMaskedDirective>(
698  C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
699 }
700 
702  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
703  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
704  bool HasCancel) {
705  auto *Dir = createDirective<OMPParallelSectionsDirective>(
706  C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
707  Dir->setTaskReductionRefExpr(TaskRedRef);
708  Dir->setHasCancel(HasCancel);
709  return Dir;
710 }
711 
714  unsigned NumClauses, EmptyShell) {
715  return createEmptyDirective<OMPParallelSectionsDirective>(
716  C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
717 }
718 
721  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
722  Stmt *AssociatedStmt, bool HasCancel) {
723  auto *Dir = createDirective<OMPTaskDirective>(
724  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
725  Dir->setHasCancel(HasCancel);
726  return Dir;
727 }
728 
730  unsigned NumClauses,
731  EmptyShell) {
732  return createEmptyDirective<OMPTaskDirective>(C, NumClauses,
733  /*HasAssociatedStmt=*/true);
734 }
735 
737  SourceLocation StartLoc,
738  SourceLocation EndLoc) {
739  return new (C) OMPTaskyieldDirective(StartLoc, EndLoc);
740 }
741 
743  EmptyShell) {
744  return new (C) OMPTaskyieldDirective();
745 }
746 
748  SourceLocation StartLoc,
749  SourceLocation EndLoc,
750  ArrayRef<OMPClause *> Clauses) {
751  return createDirective<OMPErrorDirective>(
752  C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
753  EndLoc);
754 }
755 
757  unsigned NumClauses,
758  EmptyShell) {
759  return createEmptyDirective<OMPErrorDirective>(C, NumClauses);
760 }
761 
763  SourceLocation StartLoc,
764  SourceLocation EndLoc) {
765  return new (C) OMPBarrierDirective(StartLoc, EndLoc);
766 }
767 
769  EmptyShell) {
770  return new (C) OMPBarrierDirective();
771 }
772 
775  SourceLocation EndLoc,
776  ArrayRef<OMPClause *> Clauses) {
777  return createDirective<OMPTaskwaitDirective>(
778  C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
779  EndLoc);
780 }
781 
783  unsigned NumClauses,
784  EmptyShell) {
785  return createEmptyDirective<OMPTaskwaitDirective>(C, NumClauses);
786 }
787 
789  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
790  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) {
791  auto *Dir = createDirective<OMPTaskgroupDirective>(
792  C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
793  Dir->setReductionRef(ReductionRef);
794  return Dir;
795 }
796 
798  unsigned NumClauses,
799  EmptyShell) {
800  return createEmptyDirective<OMPTaskgroupDirective>(
801  C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
802 }
803 
805  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
806  OpenMPDirectiveKind CancelRegion) {
807  auto *Dir = new (C) OMPCancellationPointDirective(StartLoc, EndLoc);
808  Dir->setCancelRegion(CancelRegion);
809  return Dir;
810 }
811 
814  return new (C) OMPCancellationPointDirective();
815 }
816 
819  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
820  OpenMPDirectiveKind CancelRegion) {
821  auto *Dir = createDirective<OMPCancelDirective>(
822  C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
823  EndLoc);
824  Dir->setCancelRegion(CancelRegion);
825  return Dir;
826 }
827 
829  unsigned NumClauses,
830  EmptyShell) {
831  return createEmptyDirective<OMPCancelDirective>(C, NumClauses);
832 }
833 
835  SourceLocation StartLoc,
836  SourceLocation EndLoc,
837  ArrayRef<OMPClause *> Clauses) {
838  return createDirective<OMPFlushDirective>(
839  C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
840  EndLoc);
841 }
842 
844  unsigned NumClauses,
845  EmptyShell) {
846  return createEmptyDirective<OMPFlushDirective>(C, NumClauses);
847 }
848 
850  SourceLocation StartLoc,
851  SourceLocation EndLoc,
852  ArrayRef<OMPClause *> Clauses) {
853  return createDirective<OMPDepobjDirective>(
854  C, Clauses, /*AssociatedStmt=*/nullptr,
855  /*NumChildren=*/0, StartLoc, EndLoc);
856 }
857 
859  unsigned NumClauses,
860  EmptyShell) {
861  return createEmptyDirective<OMPDepobjDirective>(C, NumClauses);
862 }
863 
865  SourceLocation StartLoc,
866  SourceLocation EndLoc,
867  ArrayRef<OMPClause *> Clauses) {
868  return createDirective<OMPScanDirective>(C, Clauses,
869  /*AssociatedStmt=*/nullptr,
870  /*NumChildren=*/0, StartLoc, EndLoc);
871 }
872 
874  unsigned NumClauses,
875  EmptyShell) {
876  return createEmptyDirective<OMPScanDirective>(C, NumClauses);
877 }
878 
880  SourceLocation StartLoc,
881  SourceLocation EndLoc,
882  ArrayRef<OMPClause *> Clauses,
883  Stmt *AssociatedStmt) {
884  return createDirective<OMPOrderedDirective>(
885  C, Clauses, cast_or_null<CapturedStmt>(AssociatedStmt),
886  /*NumChildren=*/0, StartLoc, EndLoc);
887 }
888 
890  unsigned NumClauses,
891  bool IsStandalone,
892  EmptyShell) {
893  return createEmptyDirective<OMPOrderedDirective>(C, NumClauses,
894  !IsStandalone);
895 }
896 
899  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
900  Stmt *AssociatedStmt, Expressions Exprs) {
901  auto *Dir = createDirective<OMPAtomicDirective>(
902  C, Clauses, AssociatedStmt, /*NumChildren=*/7, StartLoc, EndLoc);
903  Dir->setX(Exprs.X);
904  Dir->setV(Exprs.V);
905  Dir->setR(Exprs.R);
906  Dir->setExpr(Exprs.E);
907  Dir->setUpdateExpr(Exprs.UE);
908  Dir->setD(Exprs.D);
909  Dir->setCond(Exprs.Cond);
910  Dir->Flags.IsXLHSInRHSPart = Exprs.IsXLHSInRHSPart ? 1 : 0;
911  Dir->Flags.IsPostfixUpdate = Exprs.IsPostfixUpdate ? 1 : 0;
912  Dir->Flags.IsFailOnly = Exprs.IsFailOnly ? 1 : 0;
913  return Dir;
914 }
915 
917  unsigned NumClauses,
918  EmptyShell) {
919  return createEmptyDirective<OMPAtomicDirective>(
920  C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/7);
921 }
922 
924  SourceLocation StartLoc,
925  SourceLocation EndLoc,
926  ArrayRef<OMPClause *> Clauses,
927  Stmt *AssociatedStmt) {
928  return createDirective<OMPTargetDirective>(
929  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
930 }
931 
933  unsigned NumClauses,
934  EmptyShell) {
935  return createEmptyDirective<OMPTargetDirective>(C, NumClauses,
936  /*HasAssociatedStmt=*/true);
937 }
938 
940  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
941  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
942  bool HasCancel) {
943  auto *Dir = createDirective<OMPTargetParallelDirective>(
944  C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
945  Dir->setTaskReductionRefExpr(TaskRedRef);
946  Dir->setHasCancel(HasCancel);
947  return Dir;
948 }
949 
952  unsigned NumClauses, EmptyShell) {
953  return createEmptyDirective<OMPTargetParallelDirective>(
954  C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
955 }
956 
958  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
959  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
960  const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
961  auto *Dir = createDirective<OMPTargetParallelForDirective>(
962  C, Clauses, AssociatedStmt,
963  numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1, StartLoc,
964  EndLoc, CollapsedNum);
965  Dir->setIterationVariable(Exprs.IterationVarRef);
966  Dir->setLastIteration(Exprs.LastIteration);
967  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
968  Dir->setPreCond(Exprs.PreCond);
969  Dir->setCond(Exprs.Cond);
970  Dir->setInit(Exprs.Init);
971  Dir->setInc(Exprs.Inc);
972  Dir->setIsLastIterVariable(Exprs.IL);
973  Dir->setLowerBoundVariable(Exprs.LB);
974  Dir->setUpperBoundVariable(Exprs.UB);
975  Dir->setStrideVariable(Exprs.ST);
976  Dir->setEnsureUpperBound(Exprs.EUB);
977  Dir->setNextLowerBound(Exprs.NLB);
978  Dir->setNextUpperBound(Exprs.NUB);
979  Dir->setNumIterations(Exprs.NumIterations);
980  Dir->setCounters(Exprs.Counters);
981  Dir->setPrivateCounters(Exprs.PrivateCounters);
982  Dir->setInits(Exprs.Inits);
983  Dir->setUpdates(Exprs.Updates);
984  Dir->setFinals(Exprs.Finals);
985  Dir->setDependentCounters(Exprs.DependentCounters);
986  Dir->setDependentInits(Exprs.DependentInits);
987  Dir->setFinalsConditions(Exprs.FinalsConditions);
988  Dir->setPreInits(Exprs.PreInits);
989  Dir->setTaskReductionRefExpr(TaskRedRef);
990  Dir->setHasCancel(HasCancel);
991  return Dir;
992 }
993 
996  unsigned NumClauses,
997  unsigned CollapsedNum, EmptyShell) {
998  return createEmptyDirective<OMPTargetParallelForDirective>(
999  C, NumClauses, /*HasAssociatedStmt=*/true,
1000  numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1,
1001  CollapsedNum);
1002 }
1003 
1005  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1006  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1007  return createDirective<OMPTargetDataDirective>(
1008  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1009 }
1010 
1012  unsigned N,
1013  EmptyShell) {
1014  return createEmptyDirective<OMPTargetDataDirective>(
1015  C, N, /*HasAssociatedStmt=*/true);
1016 }
1017 
1019  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1020  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1021  return createDirective<OMPTargetEnterDataDirective>(
1022  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1023 }
1024 
1027  EmptyShell) {
1028  return createEmptyDirective<OMPTargetEnterDataDirective>(
1029  C, N, /*HasAssociatedStmt=*/true);
1030 }
1031 
1033  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1034  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1035  return createDirective<OMPTargetExitDataDirective>(
1036  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1037 }
1038 
1041  EmptyShell) {
1042  return createEmptyDirective<OMPTargetExitDataDirective>(
1043  C, N, /*HasAssociatedStmt=*/true);
1044 }
1045 
1047  SourceLocation StartLoc,
1048  SourceLocation EndLoc,
1049  ArrayRef<OMPClause *> Clauses,
1050  Stmt *AssociatedStmt) {
1051  return createDirective<OMPTeamsDirective>(
1052  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1053 }
1054 
1056  unsigned NumClauses,
1057  EmptyShell) {
1058  return createEmptyDirective<OMPTeamsDirective>(C, NumClauses,
1059  /*HasAssociatedStmt=*/true);
1060 }
1061 
1063  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1064  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1065  const HelperExprs &Exprs, bool HasCancel) {
1066  auto *Dir = createDirective<OMPTaskLoopDirective>(
1067  C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_taskloop),
1068  StartLoc, EndLoc, CollapsedNum);
1069  Dir->setIterationVariable(Exprs.IterationVarRef);
1070  Dir->setLastIteration(Exprs.LastIteration);
1071  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1072  Dir->setPreCond(Exprs.PreCond);
1073  Dir->setCond(Exprs.Cond);
1074  Dir->setInit(Exprs.Init);
1075  Dir->setInc(Exprs.Inc);
1076  Dir->setIsLastIterVariable(Exprs.IL);
1077  Dir->setLowerBoundVariable(Exprs.LB);
1078  Dir->setUpperBoundVariable(Exprs.UB);
1079  Dir->setStrideVariable(Exprs.ST);
1080  Dir->setEnsureUpperBound(Exprs.EUB);
1081  Dir->setNextLowerBound(Exprs.NLB);
1082  Dir->setNextUpperBound(Exprs.NUB);
1083  Dir->setNumIterations(Exprs.NumIterations);
1084  Dir->setCounters(Exprs.Counters);
1085  Dir->setPrivateCounters(Exprs.PrivateCounters);
1086  Dir->setInits(Exprs.Inits);
1087  Dir->setUpdates(Exprs.Updates);
1088  Dir->setFinals(Exprs.Finals);
1089  Dir->setDependentCounters(Exprs.DependentCounters);
1090  Dir->setDependentInits(Exprs.DependentInits);
1091  Dir->setFinalsConditions(Exprs.FinalsConditions);
1092  Dir->setPreInits(Exprs.PreInits);
1093  Dir->setHasCancel(HasCancel);
1094  return Dir;
1095 }
1096 
1098  unsigned NumClauses,
1099  unsigned CollapsedNum,
1100  EmptyShell) {
1101  return createEmptyDirective<OMPTaskLoopDirective>(
1102  C, NumClauses, /*HasAssociatedStmt=*/true,
1103  numLoopChildren(CollapsedNum, OMPD_taskloop), CollapsedNum);
1104 }
1105 
1107  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1108  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1109  const HelperExprs &Exprs) {
1110  auto *Dir = createDirective<OMPTaskLoopSimdDirective>(
1111  C, Clauses, AssociatedStmt,
1112  numLoopChildren(CollapsedNum, OMPD_taskloop_simd), StartLoc, EndLoc,
1113  CollapsedNum);
1114  Dir->setIterationVariable(Exprs.IterationVarRef);
1115  Dir->setLastIteration(Exprs.LastIteration);
1116  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1117  Dir->setPreCond(Exprs.PreCond);
1118  Dir->setCond(Exprs.Cond);
1119  Dir->setInit(Exprs.Init);
1120  Dir->setInc(Exprs.Inc);
1121  Dir->setIsLastIterVariable(Exprs.IL);
1122  Dir->setLowerBoundVariable(Exprs.LB);
1123  Dir->setUpperBoundVariable(Exprs.UB);
1124  Dir->setStrideVariable(Exprs.ST);
1125  Dir->setEnsureUpperBound(Exprs.EUB);
1126  Dir->setNextLowerBound(Exprs.NLB);
1127  Dir->setNextUpperBound(Exprs.NUB);
1128  Dir->setNumIterations(Exprs.NumIterations);
1129  Dir->setCounters(Exprs.Counters);
1130  Dir->setPrivateCounters(Exprs.PrivateCounters);
1131  Dir->setInits(Exprs.Inits);
1132  Dir->setUpdates(Exprs.Updates);
1133  Dir->setFinals(Exprs.Finals);
1134  Dir->setDependentCounters(Exprs.DependentCounters);
1135  Dir->setDependentInits(Exprs.DependentInits);
1136  Dir->setFinalsConditions(Exprs.FinalsConditions);
1137  Dir->setPreInits(Exprs.PreInits);
1138  return Dir;
1139 }
1140 
1143  unsigned CollapsedNum, EmptyShell) {
1144  return createEmptyDirective<OMPTaskLoopSimdDirective>(
1145  C, NumClauses, /*HasAssociatedStmt=*/true,
1146  numLoopChildren(CollapsedNum, OMPD_taskloop_simd), CollapsedNum);
1147 }
1148 
1150  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1151  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1152  const HelperExprs &Exprs, bool HasCancel) {
1153  auto *Dir = createDirective<OMPMasterTaskLoopDirective>(
1154  C, Clauses, AssociatedStmt,
1155  numLoopChildren(CollapsedNum, OMPD_master_taskloop), StartLoc, EndLoc,
1156  CollapsedNum);
1157  Dir->setIterationVariable(Exprs.IterationVarRef);
1158  Dir->setLastIteration(Exprs.LastIteration);
1159  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1160  Dir->setPreCond(Exprs.PreCond);
1161  Dir->setCond(Exprs.Cond);
1162  Dir->setInit(Exprs.Init);
1163  Dir->setInc(Exprs.Inc);
1164  Dir->setIsLastIterVariable(Exprs.IL);
1165  Dir->setLowerBoundVariable(Exprs.LB);
1166  Dir->setUpperBoundVariable(Exprs.UB);
1167  Dir->setStrideVariable(Exprs.ST);
1168  Dir->setEnsureUpperBound(Exprs.EUB);
1169  Dir->setNextLowerBound(Exprs.NLB);
1170  Dir->setNextUpperBound(Exprs.NUB);
1171  Dir->setNumIterations(Exprs.NumIterations);
1172  Dir->setCounters(Exprs.Counters);
1173  Dir->setPrivateCounters(Exprs.PrivateCounters);
1174  Dir->setInits(Exprs.Inits);
1175  Dir->setUpdates(Exprs.Updates);
1176  Dir->setFinals(Exprs.Finals);
1177  Dir->setDependentCounters(Exprs.DependentCounters);
1178  Dir->setDependentInits(Exprs.DependentInits);
1179  Dir->setFinalsConditions(Exprs.FinalsConditions);
1180  Dir->setPreInits(Exprs.PreInits);
1181  Dir->setHasCancel(HasCancel);
1182  return Dir;
1183 }
1184 
1187  unsigned NumClauses,
1188  unsigned CollapsedNum, EmptyShell) {
1189  return createEmptyDirective<OMPMasterTaskLoopDirective>(
1190  C, NumClauses, /*HasAssociatedStmt=*/true,
1191  numLoopChildren(CollapsedNum, OMPD_master_taskloop), CollapsedNum);
1192 }
1193 
1195  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1196  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1197  const HelperExprs &Exprs, bool HasCancel) {
1198  auto *Dir = createDirective<OMPMaskedTaskLoopDirective>(
1199  C, Clauses, AssociatedStmt,
1200  numLoopChildren(CollapsedNum, OMPD_masked_taskloop), StartLoc, EndLoc,
1201  CollapsedNum);
1202  Dir->setIterationVariable(Exprs.IterationVarRef);
1203  Dir->setLastIteration(Exprs.LastIteration);
1204  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1205  Dir->setPreCond(Exprs.PreCond);
1206  Dir->setCond(Exprs.Cond);
1207  Dir->setInit(Exprs.Init);
1208  Dir->setInc(Exprs.Inc);
1209  Dir->setIsLastIterVariable(Exprs.IL);
1210  Dir->setLowerBoundVariable(Exprs.LB);
1211  Dir->setUpperBoundVariable(Exprs.UB);
1212  Dir->setStrideVariable(Exprs.ST);
1213  Dir->setEnsureUpperBound(Exprs.EUB);
1214  Dir->setNextLowerBound(Exprs.NLB);
1215  Dir->setNextUpperBound(Exprs.NUB);
1216  Dir->setNumIterations(Exprs.NumIterations);
1217  Dir->setCounters(Exprs.Counters);
1218  Dir->setPrivateCounters(Exprs.PrivateCounters);
1219  Dir->setInits(Exprs.Inits);
1220  Dir->setUpdates(Exprs.Updates);
1221  Dir->setFinals(Exprs.Finals);
1222  Dir->setDependentCounters(Exprs.DependentCounters);
1223  Dir->setDependentInits(Exprs.DependentInits);
1224  Dir->setFinalsConditions(Exprs.FinalsConditions);
1225  Dir->setPreInits(Exprs.PreInits);
1226  Dir->setHasCancel(HasCancel);
1227  return Dir;
1228 }
1229 
1232  unsigned NumClauses,
1233  unsigned CollapsedNum, EmptyShell) {
1234  return createEmptyDirective<OMPMaskedTaskLoopDirective>(
1235  C, NumClauses, /*HasAssociatedStmt=*/true,
1236  numLoopChildren(CollapsedNum, OMPD_masked_taskloop), CollapsedNum);
1237 }
1238 
1240  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1241  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1242  const HelperExprs &Exprs) {
1243  auto *Dir = createDirective<OMPMasterTaskLoopSimdDirective>(
1244  C, Clauses, AssociatedStmt,
1245  numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), StartLoc,
1246  EndLoc, CollapsedNum);
1247  Dir->setIterationVariable(Exprs.IterationVarRef);
1248  Dir->setLastIteration(Exprs.LastIteration);
1249  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1250  Dir->setPreCond(Exprs.PreCond);
1251  Dir->setCond(Exprs.Cond);
1252  Dir->setInit(Exprs.Init);
1253  Dir->setInc(Exprs.Inc);
1254  Dir->setIsLastIterVariable(Exprs.IL);
1255  Dir->setLowerBoundVariable(Exprs.LB);
1256  Dir->setUpperBoundVariable(Exprs.UB);
1257  Dir->setStrideVariable(Exprs.ST);
1258  Dir->setEnsureUpperBound(Exprs.EUB);
1259  Dir->setNextLowerBound(Exprs.NLB);
1260  Dir->setNextUpperBound(Exprs.NUB);
1261  Dir->setNumIterations(Exprs.NumIterations);
1262  Dir->setCounters(Exprs.Counters);
1263  Dir->setPrivateCounters(Exprs.PrivateCounters);
1264  Dir->setInits(Exprs.Inits);
1265  Dir->setUpdates(Exprs.Updates);
1266  Dir->setFinals(Exprs.Finals);
1267  Dir->setDependentCounters(Exprs.DependentCounters);
1268  Dir->setDependentInits(Exprs.DependentInits);
1269  Dir->setFinalsConditions(Exprs.FinalsConditions);
1270  Dir->setPreInits(Exprs.PreInits);
1271  return Dir;
1272 }
1273 
1276  unsigned NumClauses,
1277  unsigned CollapsedNum, EmptyShell) {
1278  return createEmptyDirective<OMPMasterTaskLoopSimdDirective>(
1279  C, NumClauses, /*HasAssociatedStmt=*/true,
1280  numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), CollapsedNum);
1281 }
1282 
1284  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1285  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1286  const HelperExprs &Exprs) {
1287  auto *Dir = createDirective<OMPMaskedTaskLoopSimdDirective>(
1288  C, Clauses, AssociatedStmt,
1289  numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), StartLoc,
1290  EndLoc, CollapsedNum);
1291  Dir->setIterationVariable(Exprs.IterationVarRef);
1292  Dir->setLastIteration(Exprs.LastIteration);
1293  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1294  Dir->setPreCond(Exprs.PreCond);
1295  Dir->setCond(Exprs.Cond);
1296  Dir->setInit(Exprs.Init);
1297  Dir->setInc(Exprs.Inc);
1298  Dir->setIsLastIterVariable(Exprs.IL);
1299  Dir->setLowerBoundVariable(Exprs.LB);
1300  Dir->setUpperBoundVariable(Exprs.UB);
1301  Dir->setStrideVariable(Exprs.ST);
1302  Dir->setEnsureUpperBound(Exprs.EUB);
1303  Dir->setNextLowerBound(Exprs.NLB);
1304  Dir->setNextUpperBound(Exprs.NUB);
1305  Dir->setNumIterations(Exprs.NumIterations);
1306  Dir->setCounters(Exprs.Counters);
1307  Dir->setPrivateCounters(Exprs.PrivateCounters);
1308  Dir->setInits(Exprs.Inits);
1309  Dir->setUpdates(Exprs.Updates);
1310  Dir->setFinals(Exprs.Finals);
1311  Dir->setDependentCounters(Exprs.DependentCounters);
1312  Dir->setDependentInits(Exprs.DependentInits);
1313  Dir->setFinalsConditions(Exprs.FinalsConditions);
1314  Dir->setPreInits(Exprs.PreInits);
1315  return Dir;
1316 }
1317 
1320  unsigned NumClauses,
1321  unsigned CollapsedNum, EmptyShell) {
1322  return createEmptyDirective<OMPMaskedTaskLoopSimdDirective>(
1323  C, NumClauses, /*HasAssociatedStmt=*/true,
1324  numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), CollapsedNum);
1325 }
1326 
1328  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1329  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1330  const HelperExprs &Exprs, bool HasCancel) {
1331  auto *Dir = createDirective<OMPParallelMasterTaskLoopDirective>(
1332  C, Clauses, AssociatedStmt,
1333  numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop), StartLoc,
1334  EndLoc, CollapsedNum);
1335  Dir->setIterationVariable(Exprs.IterationVarRef);
1336  Dir->setLastIteration(Exprs.LastIteration);
1337  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1338  Dir->setPreCond(Exprs.PreCond);
1339  Dir->setCond(Exprs.Cond);
1340  Dir->setInit(Exprs.Init);
1341  Dir->setInc(Exprs.Inc);
1342  Dir->setIsLastIterVariable(Exprs.IL);
1343  Dir->setLowerBoundVariable(Exprs.LB);
1344  Dir->setUpperBoundVariable(Exprs.UB);
1345  Dir->setStrideVariable(Exprs.ST);
1346  Dir->setEnsureUpperBound(Exprs.EUB);
1347  Dir->setNextLowerBound(Exprs.NLB);
1348  Dir->setNextUpperBound(Exprs.NUB);
1349  Dir->setNumIterations(Exprs.NumIterations);
1350  Dir->setCounters(Exprs.Counters);
1351  Dir->setPrivateCounters(Exprs.PrivateCounters);
1352  Dir->setInits(Exprs.Inits);
1353  Dir->setUpdates(Exprs.Updates);
1354  Dir->setFinals(Exprs.Finals);
1355  Dir->setDependentCounters(Exprs.DependentCounters);
1356  Dir->setDependentInits(Exprs.DependentInits);
1357  Dir->setFinalsConditions(Exprs.FinalsConditions);
1358  Dir->setPreInits(Exprs.PreInits);
1359  Dir->setHasCancel(HasCancel);
1360  return Dir;
1361 }
1362 
1365  unsigned NumClauses,
1366  unsigned CollapsedNum,
1367  EmptyShell) {
1368  return createEmptyDirective<OMPParallelMasterTaskLoopDirective>(
1369  C, NumClauses, /*HasAssociatedStmt=*/true,
1370  numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop),
1371  CollapsedNum);
1372 }
1373 
1375  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1376  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1377  const HelperExprs &Exprs, bool HasCancel) {
1378  auto *Dir = createDirective<OMPParallelMaskedTaskLoopDirective>(
1379  C, Clauses, AssociatedStmt,
1380  numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop), StartLoc,
1381  EndLoc, CollapsedNum);
1382  Dir->setIterationVariable(Exprs.IterationVarRef);
1383  Dir->setLastIteration(Exprs.LastIteration);
1384  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1385  Dir->setPreCond(Exprs.PreCond);
1386  Dir->setCond(Exprs.Cond);
1387  Dir->setInit(Exprs.Init);
1388  Dir->setInc(Exprs.Inc);
1389  Dir->setIsLastIterVariable(Exprs.IL);
1390  Dir->setLowerBoundVariable(Exprs.LB);
1391  Dir->setUpperBoundVariable(Exprs.UB);
1392  Dir->setStrideVariable(Exprs.ST);
1393  Dir->setEnsureUpperBound(Exprs.EUB);
1394  Dir->setNextLowerBound(Exprs.NLB);
1395  Dir->setNextUpperBound(Exprs.NUB);
1396  Dir->setNumIterations(Exprs.NumIterations);
1397  Dir->setCounters(Exprs.Counters);
1398  Dir->setPrivateCounters(Exprs.PrivateCounters);
1399  Dir->setInits(Exprs.Inits);
1400  Dir->setUpdates(Exprs.Updates);
1401  Dir->setFinals(Exprs.Finals);
1402  Dir->setDependentCounters(Exprs.DependentCounters);
1403  Dir->setDependentInits(Exprs.DependentInits);
1404  Dir->setFinalsConditions(Exprs.FinalsConditions);
1405  Dir->setPreInits(Exprs.PreInits);
1406  Dir->setHasCancel(HasCancel);
1407  return Dir;
1408 }
1409 
1412  unsigned NumClauses,
1413  unsigned CollapsedNum,
1414  EmptyShell) {
1415  return createEmptyDirective<OMPParallelMaskedTaskLoopDirective>(
1416  C, NumClauses, /*HasAssociatedStmt=*/true,
1417  numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop),
1418  CollapsedNum);
1419 }
1420 
1423  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1424  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1425  const HelperExprs &Exprs) {
1426  auto *Dir = createDirective<OMPParallelMasterTaskLoopSimdDirective>(
1427  C, Clauses, AssociatedStmt,
1428  numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),
1429  StartLoc, EndLoc, CollapsedNum);
1430  Dir->setIterationVariable(Exprs.IterationVarRef);
1431  Dir->setLastIteration(Exprs.LastIteration);
1432  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1433  Dir->setPreCond(Exprs.PreCond);
1434  Dir->setCond(Exprs.Cond);
1435  Dir->setInit(Exprs.Init);
1436  Dir->setInc(Exprs.Inc);
1437  Dir->setIsLastIterVariable(Exprs.IL);
1438  Dir->setLowerBoundVariable(Exprs.LB);
1439  Dir->setUpperBoundVariable(Exprs.UB);
1440  Dir->setStrideVariable(Exprs.ST);
1441  Dir->setEnsureUpperBound(Exprs.EUB);
1442  Dir->setNextLowerBound(Exprs.NLB);
1443  Dir->setNextUpperBound(Exprs.NUB);
1444  Dir->setNumIterations(Exprs.NumIterations);
1445  Dir->setCounters(Exprs.Counters);
1446  Dir->setPrivateCounters(Exprs.PrivateCounters);
1447  Dir->setInits(Exprs.Inits);
1448  Dir->setUpdates(Exprs.Updates);
1449  Dir->setFinals(Exprs.Finals);
1450  Dir->setDependentCounters(Exprs.DependentCounters);
1451  Dir->setDependentInits(Exprs.DependentInits);
1452  Dir->setFinalsConditions(Exprs.FinalsConditions);
1453  Dir->setPreInits(Exprs.PreInits);
1454  return Dir;
1455 }
1456 
1459  unsigned NumClauses,
1460  unsigned CollapsedNum,
1461  EmptyShell) {
1462  return createEmptyDirective<OMPParallelMasterTaskLoopSimdDirective>(
1463  C, NumClauses, /*HasAssociatedStmt=*/true,
1464  numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),
1465  CollapsedNum);
1466 }
1467 
1470  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1471  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1472  const HelperExprs &Exprs) {
1473  auto *Dir = createDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1474  C, Clauses, AssociatedStmt,
1475  numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd),
1476  StartLoc, EndLoc, CollapsedNum);
1477  Dir->setIterationVariable(Exprs.IterationVarRef);
1478  Dir->setLastIteration(Exprs.LastIteration);
1479  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1480  Dir->setPreCond(Exprs.PreCond);
1481  Dir->setCond(Exprs.Cond);
1482  Dir->setInit(Exprs.Init);
1483  Dir->setInc(Exprs.Inc);
1484  Dir->setIsLastIterVariable(Exprs.IL);
1485  Dir->setLowerBoundVariable(Exprs.LB);
1486  Dir->setUpperBoundVariable(Exprs.UB);
1487  Dir->setStrideVariable(Exprs.ST);
1488  Dir->setEnsureUpperBound(Exprs.EUB);
1489  Dir->setNextLowerBound(Exprs.NLB);
1490  Dir->setNextUpperBound(Exprs.NUB);
1491  Dir->setNumIterations(Exprs.NumIterations);
1492  Dir->setCounters(Exprs.Counters);
1493  Dir->setPrivateCounters(Exprs.PrivateCounters);
1494  Dir->setInits(Exprs.Inits);
1495  Dir->setUpdates(Exprs.Updates);
1496  Dir->setFinals(Exprs.Finals);
1497  Dir->setDependentCounters(Exprs.DependentCounters);
1498  Dir->setDependentInits(Exprs.DependentInits);
1499  Dir->setFinalsConditions(Exprs.FinalsConditions);
1500  Dir->setPreInits(Exprs.PreInits);
1501  return Dir;
1502 }
1503 
1506  unsigned NumClauses,
1507  unsigned CollapsedNum,
1508  EmptyShell) {
1509  return createEmptyDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1510  C, NumClauses, /*HasAssociatedStmt=*/true,
1511  numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd),
1512  CollapsedNum);
1513 }
1514 
1516  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1517  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1518  const HelperExprs &Exprs) {
1519  auto *Dir = createDirective<OMPDistributeDirective>(
1520  C, Clauses, AssociatedStmt,
1521  numLoopChildren(CollapsedNum, OMPD_distribute), StartLoc, EndLoc,
1522  CollapsedNum);
1523  Dir->setIterationVariable(Exprs.IterationVarRef);
1524  Dir->setLastIteration(Exprs.LastIteration);
1525  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1526  Dir->setPreCond(Exprs.PreCond);
1527  Dir->setCond(Exprs.Cond);
1528  Dir->setInit(Exprs.Init);
1529  Dir->setInc(Exprs.Inc);
1530  Dir->setIsLastIterVariable(Exprs.IL);
1531  Dir->setLowerBoundVariable(Exprs.LB);
1532  Dir->setUpperBoundVariable(Exprs.UB);
1533  Dir->setStrideVariable(Exprs.ST);
1534  Dir->setEnsureUpperBound(Exprs.EUB);
1535  Dir->setNextLowerBound(Exprs.NLB);
1536  Dir->setNextUpperBound(Exprs.NUB);
1537  Dir->setNumIterations(Exprs.NumIterations);
1538  Dir->setCounters(Exprs.Counters);
1539  Dir->setPrivateCounters(Exprs.PrivateCounters);
1540  Dir->setInits(Exprs.Inits);
1541  Dir->setUpdates(Exprs.Updates);
1542  Dir->setFinals(Exprs.Finals);
1543  Dir->setDependentCounters(Exprs.DependentCounters);
1544  Dir->setDependentInits(Exprs.DependentInits);
1545  Dir->setFinalsConditions(Exprs.FinalsConditions);
1546  Dir->setPreInits(Exprs.PreInits);
1547  return Dir;
1548 }
1549 
1551 OMPDistributeDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
1552  unsigned CollapsedNum, EmptyShell) {
1553  return createEmptyDirective<OMPDistributeDirective>(
1554  C, NumClauses, /*HasAssociatedStmt=*/true,
1555  numLoopChildren(CollapsedNum, OMPD_distribute), CollapsedNum);
1556 }
1557 
1559  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1560  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1561  return createDirective<OMPTargetUpdateDirective>(C, Clauses, AssociatedStmt,
1562  /*NumChildren=*/0, StartLoc,
1563  EndLoc);
1564 }
1565 
1568  EmptyShell) {
1569  return createEmptyDirective<OMPTargetUpdateDirective>(
1570  C, NumClauses, /*HasAssociatedStmt=*/true);
1571 }
1572 
1574  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1575  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1576  const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1577  auto *Dir = createDirective<OMPDistributeParallelForDirective>(
1578  C, Clauses, AssociatedStmt,
1579  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1, StartLoc,
1580  EndLoc, CollapsedNum);
1581  Dir->setIterationVariable(Exprs.IterationVarRef);
1582  Dir->setLastIteration(Exprs.LastIteration);
1583  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1584  Dir->setPreCond(Exprs.PreCond);
1585  Dir->setCond(Exprs.Cond);
1586  Dir->setInit(Exprs.Init);
1587  Dir->setInc(Exprs.Inc);
1588  Dir->setIsLastIterVariable(Exprs.IL);
1589  Dir->setLowerBoundVariable(Exprs.LB);
1590  Dir->setUpperBoundVariable(Exprs.UB);
1591  Dir->setStrideVariable(Exprs.ST);
1592  Dir->setEnsureUpperBound(Exprs.EUB);
1593  Dir->setNextLowerBound(Exprs.NLB);
1594  Dir->setNextUpperBound(Exprs.NUB);
1595  Dir->setNumIterations(Exprs.NumIterations);
1596  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1597  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1598  Dir->setDistInc(Exprs.DistInc);
1599  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1600  Dir->setCounters(Exprs.Counters);
1601  Dir->setPrivateCounters(Exprs.PrivateCounters);
1602  Dir->setInits(Exprs.Inits);
1603  Dir->setUpdates(Exprs.Updates);
1604  Dir->setFinals(Exprs.Finals);
1605  Dir->setDependentCounters(Exprs.DependentCounters);
1606  Dir->setDependentInits(Exprs.DependentInits);
1607  Dir->setFinalsConditions(Exprs.FinalsConditions);
1608  Dir->setPreInits(Exprs.PreInits);
1609  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1610  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1611  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1612  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1613  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1614  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1615  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1616  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1617  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1618  Dir->setTaskReductionRefExpr(TaskRedRef);
1619  Dir->HasCancel = HasCancel;
1620  return Dir;
1621 }
1622 
1625  unsigned NumClauses,
1626  unsigned CollapsedNum,
1627  EmptyShell) {
1628  return createEmptyDirective<OMPDistributeParallelForDirective>(
1629  C, NumClauses, /*HasAssociatedStmt=*/true,
1630  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1,
1631  CollapsedNum);
1632 }
1633 
1636  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1637  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1638  const HelperExprs &Exprs) {
1639  auto *Dir = createDirective<OMPDistributeParallelForSimdDirective>(
1640  C, Clauses, AssociatedStmt,
1641  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),
1642  StartLoc, EndLoc, CollapsedNum);
1643  Dir->setIterationVariable(Exprs.IterationVarRef);
1644  Dir->setLastIteration(Exprs.LastIteration);
1645  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1646  Dir->setPreCond(Exprs.PreCond);
1647  Dir->setCond(Exprs.Cond);
1648  Dir->setInit(Exprs.Init);
1649  Dir->setInc(Exprs.Inc);
1650  Dir->setIsLastIterVariable(Exprs.IL);
1651  Dir->setLowerBoundVariable(Exprs.LB);
1652  Dir->setUpperBoundVariable(Exprs.UB);
1653  Dir->setStrideVariable(Exprs.ST);
1654  Dir->setEnsureUpperBound(Exprs.EUB);
1655  Dir->setNextLowerBound(Exprs.NLB);
1656  Dir->setNextUpperBound(Exprs.NUB);
1657  Dir->setNumIterations(Exprs.NumIterations);
1658  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1659  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1660  Dir->setDistInc(Exprs.DistInc);
1661  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1662  Dir->setCounters(Exprs.Counters);
1663  Dir->setPrivateCounters(Exprs.PrivateCounters);
1664  Dir->setInits(Exprs.Inits);
1665  Dir->setUpdates(Exprs.Updates);
1666  Dir->setFinals(Exprs.Finals);
1667  Dir->setDependentCounters(Exprs.DependentCounters);
1668  Dir->setDependentInits(Exprs.DependentInits);
1669  Dir->setFinalsConditions(Exprs.FinalsConditions);
1670  Dir->setPreInits(Exprs.PreInits);
1671  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1672  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1673  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1674  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1675  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1676  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1677  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1678  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1679  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1680  return Dir;
1681 }
1682 
1685  unsigned NumClauses,
1686  unsigned CollapsedNum,
1687  EmptyShell) {
1688  return createEmptyDirective<OMPDistributeParallelForSimdDirective>(
1689  C, NumClauses, /*HasAssociatedStmt=*/true,
1690  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),
1691  CollapsedNum);
1692 }
1693 
1695  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1696  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1697  const HelperExprs &Exprs) {
1698  auto *Dir = createDirective<OMPDistributeSimdDirective>(
1699  C, Clauses, AssociatedStmt,
1700  numLoopChildren(CollapsedNum, OMPD_distribute_simd), StartLoc, EndLoc,
1701  CollapsedNum);
1702  Dir->setIterationVariable(Exprs.IterationVarRef);
1703  Dir->setLastIteration(Exprs.LastIteration);
1704  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1705  Dir->setPreCond(Exprs.PreCond);
1706  Dir->setCond(Exprs.Cond);
1707  Dir->setInit(Exprs.Init);
1708  Dir->setInc(Exprs.Inc);
1709  Dir->setIsLastIterVariable(Exprs.IL);
1710  Dir->setLowerBoundVariable(Exprs.LB);
1711  Dir->setUpperBoundVariable(Exprs.UB);
1712  Dir->setStrideVariable(Exprs.ST);
1713  Dir->setEnsureUpperBound(Exprs.EUB);
1714  Dir->setNextLowerBound(Exprs.NLB);
1715  Dir->setNextUpperBound(Exprs.NUB);
1716  Dir->setNumIterations(Exprs.NumIterations);
1717  Dir->setCounters(Exprs.Counters);
1718  Dir->setPrivateCounters(Exprs.PrivateCounters);
1719  Dir->setInits(Exprs.Inits);
1720  Dir->setUpdates(Exprs.Updates);
1721  Dir->setFinals(Exprs.Finals);
1722  Dir->setDependentCounters(Exprs.DependentCounters);
1723  Dir->setDependentInits(Exprs.DependentInits);
1724  Dir->setFinalsConditions(Exprs.FinalsConditions);
1725  Dir->setPreInits(Exprs.PreInits);
1726  return Dir;
1727 }
1728 
1731  unsigned NumClauses,
1732  unsigned CollapsedNum, EmptyShell) {
1733  return createEmptyDirective<OMPDistributeSimdDirective>(
1734  C, NumClauses, /*HasAssociatedStmt=*/true,
1735  numLoopChildren(CollapsedNum, OMPD_distribute_simd), CollapsedNum);
1736 }
1737 
1739  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1740  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1741  const HelperExprs &Exprs) {
1742  auto *Dir = createDirective<OMPTargetParallelForSimdDirective>(
1743  C, Clauses, AssociatedStmt,
1744  numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd), StartLoc,
1745  EndLoc, CollapsedNum);
1746  Dir->setIterationVariable(Exprs.IterationVarRef);
1747  Dir->setLastIteration(Exprs.LastIteration);
1748  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1749  Dir->setPreCond(Exprs.PreCond);
1750  Dir->setCond(Exprs.Cond);
1751  Dir->setInit(Exprs.Init);
1752  Dir->setInc(Exprs.Inc);
1753  Dir->setIsLastIterVariable(Exprs.IL);
1754  Dir->setLowerBoundVariable(Exprs.LB);
1755  Dir->setUpperBoundVariable(Exprs.UB);
1756  Dir->setStrideVariable(Exprs.ST);
1757  Dir->setEnsureUpperBound(Exprs.EUB);
1758  Dir->setNextLowerBound(Exprs.NLB);
1759  Dir->setNextUpperBound(Exprs.NUB);
1760  Dir->setNumIterations(Exprs.NumIterations);
1761  Dir->setCounters(Exprs.Counters);
1762  Dir->setPrivateCounters(Exprs.PrivateCounters);
1763  Dir->setInits(Exprs.Inits);
1764  Dir->setUpdates(Exprs.Updates);
1765  Dir->setFinals(Exprs.Finals);
1766  Dir->setDependentCounters(Exprs.DependentCounters);
1767  Dir->setDependentInits(Exprs.DependentInits);
1768  Dir->setFinalsConditions(Exprs.FinalsConditions);
1769  Dir->setPreInits(Exprs.PreInits);
1770  return Dir;
1771 }
1772 
1775  unsigned NumClauses,
1776  unsigned CollapsedNum,
1777  EmptyShell) {
1778  return createEmptyDirective<OMPTargetParallelForSimdDirective>(
1779  C, NumClauses, /*HasAssociatedStmt=*/true,
1780  numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd),
1781  CollapsedNum);
1782 }
1783 
1786  SourceLocation EndLoc, unsigned CollapsedNum,
1787  ArrayRef<OMPClause *> Clauses,
1788  Stmt *AssociatedStmt, const HelperExprs &Exprs) {
1789  auto *Dir = createDirective<OMPTargetSimdDirective>(
1790  C, Clauses, AssociatedStmt,
1791  numLoopChildren(CollapsedNum, OMPD_target_simd), StartLoc, EndLoc,
1792  CollapsedNum);
1793  Dir->setIterationVariable(Exprs.IterationVarRef);
1794  Dir->setLastIteration(Exprs.LastIteration);
1795  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1796  Dir->setPreCond(Exprs.PreCond);
1797  Dir->setCond(Exprs.Cond);
1798  Dir->setInit(Exprs.Init);
1799  Dir->setInc(Exprs.Inc);
1800  Dir->setCounters(Exprs.Counters);
1801  Dir->setPrivateCounters(Exprs.PrivateCounters);
1802  Dir->setInits(Exprs.Inits);
1803  Dir->setUpdates(Exprs.Updates);
1804  Dir->setFinals(Exprs.Finals);
1805  Dir->setDependentCounters(Exprs.DependentCounters);
1806  Dir->setDependentInits(Exprs.DependentInits);
1807  Dir->setFinalsConditions(Exprs.FinalsConditions);
1808  Dir->setPreInits(Exprs.PreInits);
1809  return Dir;
1810 }
1811 
1813 OMPTargetSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
1814  unsigned CollapsedNum, EmptyShell) {
1815  return createEmptyDirective<OMPTargetSimdDirective>(
1816  C, NumClauses, /*HasAssociatedStmt=*/true,
1817  numLoopChildren(CollapsedNum, OMPD_target_simd), CollapsedNum);
1818 }
1819 
1821  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1822  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1823  const HelperExprs &Exprs) {
1824  auto *Dir = createDirective<OMPTeamsDistributeDirective>(
1825  C, Clauses, AssociatedStmt,
1826  numLoopChildren(CollapsedNum, OMPD_teams_distribute), StartLoc, EndLoc,
1827  CollapsedNum);
1828  Dir->setIterationVariable(Exprs.IterationVarRef);
1829  Dir->setLastIteration(Exprs.LastIteration);
1830  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1831  Dir->setPreCond(Exprs.PreCond);
1832  Dir->setCond(Exprs.Cond);
1833  Dir->setInit(Exprs.Init);
1834  Dir->setInc(Exprs.Inc);
1835  Dir->setIsLastIterVariable(Exprs.IL);
1836  Dir->setLowerBoundVariable(Exprs.LB);
1837  Dir->setUpperBoundVariable(Exprs.UB);
1838  Dir->setStrideVariable(Exprs.ST);
1839  Dir->setEnsureUpperBound(Exprs.EUB);
1840  Dir->setNextLowerBound(Exprs.NLB);
1841  Dir->setNextUpperBound(Exprs.NUB);
1842  Dir->setNumIterations(Exprs.NumIterations);
1843  Dir->setCounters(Exprs.Counters);
1844  Dir->setPrivateCounters(Exprs.PrivateCounters);
1845  Dir->setInits(Exprs.Inits);
1846  Dir->setUpdates(Exprs.Updates);
1847  Dir->setFinals(Exprs.Finals);
1848  Dir->setDependentCounters(Exprs.DependentCounters);
1849  Dir->setDependentInits(Exprs.DependentInits);
1850  Dir->setFinalsConditions(Exprs.FinalsConditions);
1851  Dir->setPreInits(Exprs.PreInits);
1852  return Dir;
1853 }
1854 
1857  unsigned NumClauses,
1858  unsigned CollapsedNum, EmptyShell) {
1859  return createEmptyDirective<OMPTeamsDistributeDirective>(
1860  C, NumClauses, /*HasAssociatedStmt=*/true,
1861  numLoopChildren(CollapsedNum, OMPD_teams_distribute), CollapsedNum);
1862 }
1863 
1865  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1866  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1867  const HelperExprs &Exprs) {
1868  auto *Dir = createDirective<OMPTeamsDistributeSimdDirective>(
1869  C, Clauses, AssociatedStmt,
1870  numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), StartLoc,
1871  EndLoc, CollapsedNum);
1872  Dir->setIterationVariable(Exprs.IterationVarRef);
1873  Dir->setLastIteration(Exprs.LastIteration);
1874  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1875  Dir->setPreCond(Exprs.PreCond);
1876  Dir->setCond(Exprs.Cond);
1877  Dir->setInit(Exprs.Init);
1878  Dir->setInc(Exprs.Inc);
1879  Dir->setIsLastIterVariable(Exprs.IL);
1880  Dir->setLowerBoundVariable(Exprs.LB);
1881  Dir->setUpperBoundVariable(Exprs.UB);
1882  Dir->setStrideVariable(Exprs.ST);
1883  Dir->setEnsureUpperBound(Exprs.EUB);
1884  Dir->setNextLowerBound(Exprs.NLB);
1885  Dir->setNextUpperBound(Exprs.NUB);
1886  Dir->setNumIterations(Exprs.NumIterations);
1887  Dir->setCounters(Exprs.Counters);
1888  Dir->setPrivateCounters(Exprs.PrivateCounters);
1889  Dir->setInits(Exprs.Inits);
1890  Dir->setUpdates(Exprs.Updates);
1891  Dir->setFinals(Exprs.Finals);
1892  Dir->setDependentCounters(Exprs.DependentCounters);
1893  Dir->setDependentInits(Exprs.DependentInits);
1894  Dir->setFinalsConditions(Exprs.FinalsConditions);
1895  Dir->setPreInits(Exprs.PreInits);
1896  return Dir;
1897 }
1898 
1900  const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1901  EmptyShell) {
1902  return createEmptyDirective<OMPTeamsDistributeSimdDirective>(
1903  C, NumClauses, /*HasAssociatedStmt=*/true,
1904  numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), CollapsedNum);
1905 }
1906 
1909  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1910  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1911  const HelperExprs &Exprs) {
1912  auto *Dir = createDirective<OMPTeamsDistributeParallelForSimdDirective>(
1913  C, Clauses, AssociatedStmt,
1914  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
1915  StartLoc, EndLoc, CollapsedNum);
1916  Dir->setIterationVariable(Exprs.IterationVarRef);
1917  Dir->setLastIteration(Exprs.LastIteration);
1918  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1919  Dir->setPreCond(Exprs.PreCond);
1920  Dir->setCond(Exprs.Cond);
1921  Dir->setInit(Exprs.Init);
1922  Dir->setInc(Exprs.Inc);
1923  Dir->setIsLastIterVariable(Exprs.IL);
1924  Dir->setLowerBoundVariable(Exprs.LB);
1925  Dir->setUpperBoundVariable(Exprs.UB);
1926  Dir->setStrideVariable(Exprs.ST);
1927  Dir->setEnsureUpperBound(Exprs.EUB);
1928  Dir->setNextLowerBound(Exprs.NLB);
1929  Dir->setNextUpperBound(Exprs.NUB);
1930  Dir->setNumIterations(Exprs.NumIterations);
1931  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1932  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1933  Dir->setDistInc(Exprs.DistInc);
1934  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1935  Dir->setCounters(Exprs.Counters);
1936  Dir->setPrivateCounters(Exprs.PrivateCounters);
1937  Dir->setInits(Exprs.Inits);
1938  Dir->setUpdates(Exprs.Updates);
1939  Dir->setFinals(Exprs.Finals);
1940  Dir->setDependentCounters(Exprs.DependentCounters);
1941  Dir->setDependentInits(Exprs.DependentInits);
1942  Dir->setFinalsConditions(Exprs.FinalsConditions);
1943  Dir->setPreInits(Exprs.PreInits);
1944  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1945  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1946  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1947  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1948  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1949  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1950  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1951  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1952  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1953  return Dir;
1954 }
1955 
1958  unsigned NumClauses,
1959  unsigned CollapsedNum,
1960  EmptyShell) {
1961  return createEmptyDirective<OMPTeamsDistributeParallelForSimdDirective>(
1962  C, NumClauses, /*HasAssociatedStmt=*/true,
1963  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
1964  CollapsedNum);
1965 }
1966 
1969  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1970  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1971  const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1972  auto *Dir = createDirective<OMPTeamsDistributeParallelForDirective>(
1973  C, Clauses, AssociatedStmt,
1974  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
1975  StartLoc, EndLoc, CollapsedNum);
1976  Dir->setIterationVariable(Exprs.IterationVarRef);
1977  Dir->setLastIteration(Exprs.LastIteration);
1978  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1979  Dir->setPreCond(Exprs.PreCond);
1980  Dir->setCond(Exprs.Cond);
1981  Dir->setInit(Exprs.Init);
1982  Dir->setInc(Exprs.Inc);
1983  Dir->setIsLastIterVariable(Exprs.IL);
1984  Dir->setLowerBoundVariable(Exprs.LB);
1985  Dir->setUpperBoundVariable(Exprs.UB);
1986  Dir->setStrideVariable(Exprs.ST);
1987  Dir->setEnsureUpperBound(Exprs.EUB);
1988  Dir->setNextLowerBound(Exprs.NLB);
1989  Dir->setNextUpperBound(Exprs.NUB);
1990  Dir->setNumIterations(Exprs.NumIterations);
1991  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1992  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1993  Dir->setDistInc(Exprs.DistInc);
1994  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1995  Dir->setCounters(Exprs.Counters);
1996  Dir->setPrivateCounters(Exprs.PrivateCounters);
1997  Dir->setInits(Exprs.Inits);
1998  Dir->setUpdates(Exprs.Updates);
1999  Dir->setFinals(Exprs.Finals);
2000  Dir->setDependentCounters(Exprs.DependentCounters);
2001  Dir->setDependentInits(Exprs.DependentInits);
2002  Dir->setFinalsConditions(Exprs.FinalsConditions);
2003  Dir->setPreInits(Exprs.PreInits);
2004  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2005  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2006  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2007  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2008  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2009  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2010  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2011  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2012  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2013  Dir->setTaskReductionRefExpr(TaskRedRef);
2014  Dir->HasCancel = HasCancel;
2015  return Dir;
2016 }
2017 
2020  unsigned NumClauses,
2021  unsigned CollapsedNum,
2022  EmptyShell) {
2023  return createEmptyDirective<OMPTeamsDistributeParallelForDirective>(
2024  C, NumClauses, /*HasAssociatedStmt=*/true,
2025  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
2026  CollapsedNum);
2027 }
2028 
2030  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2031  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
2032  return createDirective<OMPTargetTeamsDirective>(C, Clauses, AssociatedStmt,
2033  /*NumChildren=*/0, StartLoc,
2034  EndLoc);
2035 }
2036 
2038 OMPTargetTeamsDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
2039  EmptyShell) {
2040  return createEmptyDirective<OMPTargetTeamsDirective>(
2041  C, NumClauses, /*HasAssociatedStmt=*/true);
2042 }
2043 
2045  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2046  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2047  const HelperExprs &Exprs) {
2048  auto *Dir = createDirective<OMPTargetTeamsDistributeDirective>(
2049  C, Clauses, AssociatedStmt,
2050  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute), StartLoc,
2051  EndLoc, CollapsedNum);
2052  Dir->setIterationVariable(Exprs.IterationVarRef);
2053  Dir->setLastIteration(Exprs.LastIteration);
2054  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2055  Dir->setPreCond(Exprs.PreCond);
2056  Dir->setCond(Exprs.Cond);
2057  Dir->setInit(Exprs.Init);
2058  Dir->setInc(Exprs.Inc);
2059  Dir->setIsLastIterVariable(Exprs.IL);
2060  Dir->setLowerBoundVariable(Exprs.LB);
2061  Dir->setUpperBoundVariable(Exprs.UB);
2062  Dir->setStrideVariable(Exprs.ST);
2063  Dir->setEnsureUpperBound(Exprs.EUB);
2064  Dir->setNextLowerBound(Exprs.NLB);
2065  Dir->setNextUpperBound(Exprs.NUB);
2066  Dir->setNumIterations(Exprs.NumIterations);
2067  Dir->setCounters(Exprs.Counters);
2068  Dir->setPrivateCounters(Exprs.PrivateCounters);
2069  Dir->setInits(Exprs.Inits);
2070  Dir->setUpdates(Exprs.Updates);
2071  Dir->setFinals(Exprs.Finals);
2072  Dir->setDependentCounters(Exprs.DependentCounters);
2073  Dir->setDependentInits(Exprs.DependentInits);
2074  Dir->setFinalsConditions(Exprs.FinalsConditions);
2075  Dir->setPreInits(Exprs.PreInits);
2076  return Dir;
2077 }
2078 
2081  unsigned NumClauses,
2082  unsigned CollapsedNum,
2083  EmptyShell) {
2084  return createEmptyDirective<OMPTargetTeamsDistributeDirective>(
2085  C, NumClauses, /*HasAssociatedStmt=*/true,
2086  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute),
2087  CollapsedNum);
2088 }
2089 
2092  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2093  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2094  const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
2095  auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForDirective>(
2096  C, Clauses, AssociatedStmt,
2097  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
2098  1,
2099  StartLoc, EndLoc, CollapsedNum);
2100  Dir->setIterationVariable(Exprs.IterationVarRef);
2101  Dir->setLastIteration(Exprs.LastIteration);
2102  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2103  Dir->setPreCond(Exprs.PreCond);
2104  Dir->setCond(Exprs.Cond);
2105  Dir->setInit(Exprs.Init);
2106  Dir->setInc(Exprs.Inc);
2107  Dir->setIsLastIterVariable(Exprs.IL);
2108  Dir->setLowerBoundVariable(Exprs.LB);
2109  Dir->setUpperBoundVariable(Exprs.UB);
2110  Dir->setStrideVariable(Exprs.ST);
2111  Dir->setEnsureUpperBound(Exprs.EUB);
2112  Dir->setNextLowerBound(Exprs.NLB);
2113  Dir->setNextUpperBound(Exprs.NUB);
2114  Dir->setNumIterations(Exprs.NumIterations);
2115  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2116  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2117  Dir->setDistInc(Exprs.DistInc);
2118  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2119  Dir->setCounters(Exprs.Counters);
2120  Dir->setPrivateCounters(Exprs.PrivateCounters);
2121  Dir->setInits(Exprs.Inits);
2122  Dir->setUpdates(Exprs.Updates);
2123  Dir->setFinals(Exprs.Finals);
2124  Dir->setDependentCounters(Exprs.DependentCounters);
2125  Dir->setDependentInits(Exprs.DependentInits);
2126  Dir->setFinalsConditions(Exprs.FinalsConditions);
2127  Dir->setPreInits(Exprs.PreInits);
2128  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2129  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2130  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2131  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2132  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2133  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2134  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2135  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2136  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2137  Dir->setTaskReductionRefExpr(TaskRedRef);
2138  Dir->HasCancel = HasCancel;
2139  return Dir;
2140 }
2141 
2144  unsigned NumClauses,
2145  unsigned CollapsedNum,
2146  EmptyShell) {
2147  return createEmptyDirective<OMPTargetTeamsDistributeParallelForDirective>(
2148  C, NumClauses, /*HasAssociatedStmt=*/true,
2149  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
2150  1,
2151  CollapsedNum);
2152 }
2153 
2156  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2157  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2158  const HelperExprs &Exprs) {
2159  auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
2160  C, Clauses, AssociatedStmt,
2161  numLoopChildren(CollapsedNum,
2162  OMPD_target_teams_distribute_parallel_for_simd),
2163  StartLoc, EndLoc, CollapsedNum);
2164  Dir->setIterationVariable(Exprs.IterationVarRef);
2165  Dir->setLastIteration(Exprs.LastIteration);
2166  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2167  Dir->setPreCond(Exprs.PreCond);
2168  Dir->setCond(Exprs.Cond);
2169  Dir->setInit(Exprs.Init);
2170  Dir->setInc(Exprs.Inc);
2171  Dir->setIsLastIterVariable(Exprs.IL);
2172  Dir->setLowerBoundVariable(Exprs.LB);
2173  Dir->setUpperBoundVariable(Exprs.UB);
2174  Dir->setStrideVariable(Exprs.ST);
2175  Dir->setEnsureUpperBound(Exprs.EUB);
2176  Dir->setNextLowerBound(Exprs.NLB);
2177  Dir->setNextUpperBound(Exprs.NUB);
2178  Dir->setNumIterations(Exprs.NumIterations);
2179  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2180  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2181  Dir->setDistInc(Exprs.DistInc);
2182  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2183  Dir->setCounters(Exprs.Counters);
2184  Dir->setPrivateCounters(Exprs.PrivateCounters);
2185  Dir->setInits(Exprs.Inits);
2186  Dir->setUpdates(Exprs.Updates);
2187  Dir->setFinals(Exprs.Finals);
2188  Dir->setDependentCounters(Exprs.DependentCounters);
2189  Dir->setDependentInits(Exprs.DependentInits);
2190  Dir->setFinalsConditions(Exprs.FinalsConditions);
2191  Dir->setPreInits(Exprs.PreInits);
2192  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2193  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2194  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2195  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2196  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2197  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2198  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2199  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2200  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2201  return Dir;
2202 }
2203 
2206  const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
2207  EmptyShell) {
2208  return createEmptyDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
2209  C, NumClauses, /*HasAssociatedStmt=*/true,
2210  numLoopChildren(CollapsedNum,
2211  OMPD_target_teams_distribute_parallel_for_simd),
2212  CollapsedNum);
2213 }
2214 
2217  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2218  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2219  const HelperExprs &Exprs) {
2220  auto *Dir = createDirective<OMPTargetTeamsDistributeSimdDirective>(
2221  C, Clauses, AssociatedStmt,
2222  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),
2223  StartLoc, EndLoc, CollapsedNum);
2224  Dir->setIterationVariable(Exprs.IterationVarRef);
2225  Dir->setLastIteration(Exprs.LastIteration);
2226  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2227  Dir->setPreCond(Exprs.PreCond);
2228  Dir->setCond(Exprs.Cond);
2229  Dir->setInit(Exprs.Init);
2230  Dir->setInc(Exprs.Inc);
2231  Dir->setIsLastIterVariable(Exprs.IL);
2232  Dir->setLowerBoundVariable(Exprs.LB);
2233  Dir->setUpperBoundVariable(Exprs.UB);
2234  Dir->setStrideVariable(Exprs.ST);
2235  Dir->setEnsureUpperBound(Exprs.EUB);
2236  Dir->setNextLowerBound(Exprs.NLB);
2237  Dir->setNextUpperBound(Exprs.NUB);
2238  Dir->setNumIterations(Exprs.NumIterations);
2239  Dir->setCounters(Exprs.Counters);
2240  Dir->setPrivateCounters(Exprs.PrivateCounters);
2241  Dir->setInits(Exprs.Inits);
2242  Dir->setUpdates(Exprs.Updates);
2243  Dir->setFinals(Exprs.Finals);
2244  Dir->setDependentCounters(Exprs.DependentCounters);
2245  Dir->setDependentInits(Exprs.DependentInits);
2246  Dir->setFinalsConditions(Exprs.FinalsConditions);
2247  Dir->setPreInits(Exprs.PreInits);
2248  return Dir;
2249 }
2250 
2253  unsigned NumClauses,
2254  unsigned CollapsedNum,
2255  EmptyShell) {
2256  return createEmptyDirective<OMPTargetTeamsDistributeSimdDirective>(
2257  C, NumClauses, /*HasAssociatedStmt=*/true,
2258  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),
2259  CollapsedNum);
2260 }
2261 
2264  SourceLocation EndLoc,
2265  ArrayRef<OMPClause *> Clauses) {
2266  return createDirective<OMPInteropDirective>(
2267  C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
2268  EndLoc);
2269 }
2270 
2272  unsigned NumClauses,
2273  EmptyShell) {
2274  return createEmptyDirective<OMPInteropDirective>(C, NumClauses);
2275 }
2276 
2278  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2279  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2280  SourceLocation TargetCallLoc) {
2281  auto *Dir = createDirective<OMPDispatchDirective>(
2282  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
2283  Dir->setTargetCallLoc(TargetCallLoc);
2284  return Dir;
2285 }
2286 
2288  unsigned NumClauses,
2289  EmptyShell) {
2290  return createEmptyDirective<OMPDispatchDirective>(C, NumClauses,
2291  /*HasAssociatedStmt=*/true,
2292  /*NumChildren=*/0);
2293 }
2294 
2296  SourceLocation StartLoc,
2297  SourceLocation EndLoc,
2298  ArrayRef<OMPClause *> Clauses,
2299  Stmt *AssociatedStmt) {
2300  return createDirective<OMPMaskedDirective>(C, Clauses, AssociatedStmt,
2301  /*NumChildren=*/0, StartLoc,
2302  EndLoc);
2303 }
2304 
2306  unsigned NumClauses,
2307  EmptyShell) {
2308  return createEmptyDirective<OMPMaskedDirective>(C, NumClauses,
2309  /*HasAssociatedStmt=*/true);
2310 }
2311 
2313  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2314  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2315  const HelperExprs &Exprs) {
2316  auto *Dir = createDirective<OMPGenericLoopDirective>(
2317  C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_loop),
2318  StartLoc, EndLoc, CollapsedNum);
2319  Dir->setIterationVariable(Exprs.IterationVarRef);
2320  Dir->setLastIteration(Exprs.LastIteration);
2321  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2322  Dir->setPreCond(Exprs.PreCond);
2323  Dir->setCond(Exprs.Cond);
2324  Dir->setInit(Exprs.Init);
2325  Dir->setInc(Exprs.Inc);
2326  Dir->setIsLastIterVariable(Exprs.IL);
2327  Dir->setLowerBoundVariable(Exprs.LB);
2328  Dir->setUpperBoundVariable(Exprs.UB);
2329  Dir->setStrideVariable(Exprs.ST);
2330  Dir->setEnsureUpperBound(Exprs.EUB);
2331  Dir->setNextLowerBound(Exprs.NLB);
2332  Dir->setNextUpperBound(Exprs.NUB);
2333  Dir->setNumIterations(Exprs.NumIterations);
2334  Dir->setCounters(Exprs.Counters);
2335  Dir->setPrivateCounters(Exprs.PrivateCounters);
2336  Dir->setInits(Exprs.Inits);
2337  Dir->setUpdates(Exprs.Updates);
2338  Dir->setFinals(Exprs.Finals);
2339  Dir->setDependentCounters(Exprs.DependentCounters);
2340  Dir->setDependentInits(Exprs.DependentInits);
2341  Dir->setFinalsConditions(Exprs.FinalsConditions);
2342  Dir->setPreInits(Exprs.PreInits);
2343  return Dir;
2344 }
2345 
2347 OMPGenericLoopDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
2348  unsigned CollapsedNum, EmptyShell) {
2349  return createEmptyDirective<OMPGenericLoopDirective>(
2350  C, NumClauses, /*HasAssociatedStmt=*/true,
2351  numLoopChildren(CollapsedNum, OMPD_loop), CollapsedNum);
2352 }
2353 
2355  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2356  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2357  const HelperExprs &Exprs) {
2358  auto *Dir = createDirective<OMPTeamsGenericLoopDirective>(
2359  C, Clauses, AssociatedStmt,
2360  numLoopChildren(CollapsedNum, OMPD_teams_loop), StartLoc, EndLoc,
2361  CollapsedNum);
2362  Dir->setIterationVariable(Exprs.IterationVarRef);
2363  Dir->setLastIteration(Exprs.LastIteration);
2364  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2365  Dir->setPreCond(Exprs.PreCond);
2366  Dir->setCond(Exprs.Cond);
2367  Dir->setInit(Exprs.Init);
2368  Dir->setInc(Exprs.Inc);
2369  Dir->setIsLastIterVariable(Exprs.IL);
2370  Dir->setLowerBoundVariable(Exprs.LB);
2371  Dir->setUpperBoundVariable(Exprs.UB);
2372  Dir->setStrideVariable(Exprs.ST);
2373  Dir->setEnsureUpperBound(Exprs.EUB);
2374  Dir->setNextLowerBound(Exprs.NLB);
2375  Dir->setNextUpperBound(Exprs.NUB);
2376  Dir->setNumIterations(Exprs.NumIterations);
2377  Dir->setCounters(Exprs.Counters);
2378  Dir->setPrivateCounters(Exprs.PrivateCounters);
2379  Dir->setInits(Exprs.Inits);
2380  Dir->setUpdates(Exprs.Updates);
2381  Dir->setFinals(Exprs.Finals);
2382  Dir->setDependentCounters(Exprs.DependentCounters);
2383  Dir->setDependentInits(Exprs.DependentInits);
2384  Dir->setFinalsConditions(Exprs.FinalsConditions);
2385  Dir->setPreInits(Exprs.PreInits);
2386  return Dir;
2387 }
2388 
2391  unsigned NumClauses,
2392  unsigned CollapsedNum, EmptyShell) {
2393  return createEmptyDirective<OMPTeamsGenericLoopDirective>(
2394  C, NumClauses, /*HasAssociatedStmt=*/true,
2395  numLoopChildren(CollapsedNum, OMPD_teams_loop), CollapsedNum);
2396 }
2397 
2399  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2400  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2401  const HelperExprs &Exprs) {
2402  auto *Dir = createDirective<OMPTargetTeamsGenericLoopDirective>(
2403  C, Clauses, AssociatedStmt,
2404  numLoopChildren(CollapsedNum, OMPD_target_teams_loop), StartLoc, EndLoc,
2405  CollapsedNum);
2406  Dir->setIterationVariable(Exprs.IterationVarRef);
2407  Dir->setLastIteration(Exprs.LastIteration);
2408  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2409  Dir->setPreCond(Exprs.PreCond);
2410  Dir->setCond(Exprs.Cond);
2411  Dir->setInit(Exprs.Init);
2412  Dir->setInc(Exprs.Inc);
2413  Dir->setIsLastIterVariable(Exprs.IL);
2414  Dir->setLowerBoundVariable(Exprs.LB);
2415  Dir->setUpperBoundVariable(Exprs.UB);
2416  Dir->setStrideVariable(Exprs.ST);
2417  Dir->setEnsureUpperBound(Exprs.EUB);
2418  Dir->setNextLowerBound(Exprs.NLB);
2419  Dir->setNextUpperBound(Exprs.NUB);
2420  Dir->setNumIterations(Exprs.NumIterations);
2421  Dir->setCounters(Exprs.Counters);
2422  Dir->setPrivateCounters(Exprs.PrivateCounters);
2423  Dir->setInits(Exprs.Inits);
2424  Dir->setUpdates(Exprs.Updates);
2425  Dir->setFinals(Exprs.Finals);
2426  Dir->setDependentCounters(Exprs.DependentCounters);
2427  Dir->setDependentInits(Exprs.DependentInits);
2428  Dir->setFinalsConditions(Exprs.FinalsConditions);
2429  Dir->setPreInits(Exprs.PreInits);
2430  return Dir;
2431 }
2432 
2435  unsigned NumClauses,
2436  unsigned CollapsedNum,
2437  EmptyShell) {
2438  return createEmptyDirective<OMPTargetTeamsGenericLoopDirective>(
2439  C, NumClauses, /*HasAssociatedStmt=*/true,
2440  numLoopChildren(CollapsedNum, OMPD_target_teams_loop), CollapsedNum);
2441 }
2442 
2444  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2445  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2446  const HelperExprs &Exprs) {
2447  auto *Dir = createDirective<OMPParallelGenericLoopDirective>(
2448  C, Clauses, AssociatedStmt,
2449  numLoopChildren(CollapsedNum, OMPD_parallel_loop), StartLoc, EndLoc,
2450  CollapsedNum);
2451  Dir->setIterationVariable(Exprs.IterationVarRef);
2452  Dir->setLastIteration(Exprs.LastIteration);
2453  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2454  Dir->setPreCond(Exprs.PreCond);
2455  Dir->setCond(Exprs.Cond);
2456  Dir->setInit(Exprs.Init);
2457  Dir->setInc(Exprs.Inc);
2458  Dir->setIsLastIterVariable(Exprs.IL);
2459  Dir->setLowerBoundVariable(Exprs.LB);
2460  Dir->setUpperBoundVariable(Exprs.UB);
2461  Dir->setStrideVariable(Exprs.ST);
2462  Dir->setEnsureUpperBound(Exprs.EUB);
2463  Dir->setNextLowerBound(Exprs.NLB);
2464  Dir->setNextUpperBound(Exprs.NUB);
2465  Dir->setNumIterations(Exprs.NumIterations);
2466  Dir->setCounters(Exprs.Counters);
2467  Dir->setPrivateCounters(Exprs.PrivateCounters);
2468  Dir->setInits(Exprs.Inits);
2469  Dir->setUpdates(Exprs.Updates);
2470  Dir->setFinals(Exprs.Finals);
2471  Dir->setDependentCounters(Exprs.DependentCounters);
2472  Dir->setDependentInits(Exprs.DependentInits);
2473  Dir->setFinalsConditions(Exprs.FinalsConditions);
2474  Dir->setPreInits(Exprs.PreInits);
2475  return Dir;
2476 }
2477 
2479  const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
2480  EmptyShell) {
2481  return createEmptyDirective<OMPParallelGenericLoopDirective>(
2482  C, NumClauses, /*HasAssociatedStmt=*/true,
2483  numLoopChildren(CollapsedNum, OMPD_parallel_loop), CollapsedNum);
2484 }
2485 
2488  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2489  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2490  const HelperExprs &Exprs) {
2491  auto *Dir = createDirective<OMPTargetParallelGenericLoopDirective>(
2492  C, Clauses, AssociatedStmt,
2493  numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), StartLoc,
2494  EndLoc, CollapsedNum);
2495  Dir->setIterationVariable(Exprs.IterationVarRef);
2496  Dir->setLastIteration(Exprs.LastIteration);
2497  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2498  Dir->setPreCond(Exprs.PreCond);
2499  Dir->setCond(Exprs.Cond);
2500  Dir->setInit(Exprs.Init);
2501  Dir->setInc(Exprs.Inc);
2502  Dir->setIsLastIterVariable(Exprs.IL);
2503  Dir->setLowerBoundVariable(Exprs.LB);
2504  Dir->setUpperBoundVariable(Exprs.UB);
2505  Dir->setStrideVariable(Exprs.ST);
2506  Dir->setEnsureUpperBound(Exprs.EUB);
2507  Dir->setNextLowerBound(Exprs.NLB);
2508  Dir->setNextUpperBound(Exprs.NUB);
2509  Dir->setNumIterations(Exprs.NumIterations);
2510  Dir->setCounters(Exprs.Counters);
2511  Dir->setPrivateCounters(Exprs.PrivateCounters);
2512  Dir->setInits(Exprs.Inits);
2513  Dir->setUpdates(Exprs.Updates);
2514  Dir->setFinals(Exprs.Finals);
2515  Dir->setDependentCounters(Exprs.DependentCounters);
2516  Dir->setDependentInits(Exprs.DependentInits);
2517  Dir->setFinalsConditions(Exprs.FinalsConditions);
2518  Dir->setPreInits(Exprs.PreInits);
2519  return Dir;
2520 }
2521 
2524  unsigned NumClauses,
2525  unsigned CollapsedNum,
2526  EmptyShell) {
2527  return createEmptyDirective<OMPTargetParallelGenericLoopDirective>(
2528  C, NumClauses, /*HasAssociatedStmt=*/true,
2529  numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), CollapsedNum);
2530 }
clang::OMPTeamsDirective::CreateEmpty
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1055
clang::OMPLoopBasedDirective::HelperExprs::IterationVarRef
Expr * IterationVarRef
Loop iteration variable.
Definition: StmtOpenMP.h:743
clang::OMPForDirective
This represents '#pragma omp for' directive.
Definition: StmtOpenMP.h:1633
clang::OMPLoopDirective::setFinals
void setFinals(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:237
clang::OMPLoopBasedDirective::DistCombinedHelperExprs::Cond
Expr * Cond
Distribute Loop condition used when composing 'omp distribute' with 'omp for' in a same construct.
Definition: StmtOpenMP.h:723
clang::OMPMasterTaskLoopSimdDirective
This represents '#pragma omp master taskloop simd' directive.
Definition: StmtOpenMP.h:3951
clang::OMPLoopBasedDirective::HelperExprs::PrevEUB
Expr * PrevEUB
PrevEUB - expression similar to EUB but to be used when loop scheduling uses PrevLB and PrevUB (e....
Definition: StmtOpenMP.h:787
clang::OMPParallelDirective::CreateEmpty
static OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:292
clang::OMPTaskyieldDirective
This represents '#pragma omp taskyield' directive.
Definition: StmtOpenMP.h:2527
clang::OMPChildren::getChildren
MutableArrayRef< Stmt * > getChildren()
Definition: StmtOpenMP.cpp:33
clang::OMPParallelMasterDirective::CreateEmpty
static OMPParallelMasterDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:679
clang::OMPCriticalDirective::Create
static OMPCriticalDirective * Create(const ASTContext &C, const DeclarationNameInfo &Name, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:564
clang::OMPTargetSimdDirective::Create
static OMPTargetSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1785
clang::OMPAtomicDirective::Expressions::E
Expr * E
'expr' part of the associated expression/statement.
Definition: StmtOpenMP.h:2977
clang::OMPTeamsGenericLoopDirective::CreateEmpty
static OMPTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:2390
clang::OMPCancellationPointDirective::Create
static OMPCancellationPointDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Creates directive.
Definition: StmtOpenMP.cpp:804
clang::OMPAtomicDirective::Expressions::Cond
Expr * Cond
Conditional expression in atomic compare construct.
Definition: StmtOpenMP.h:2985
clang::OMPTargetExitDataDirective::CreateEmpty
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:1040
clang::OMPDispatchDirective::Create
static OMPDispatchDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, SourceLocation TargetCallLoc)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:2277
clang::OMPTeamsGenericLoopDirective::Create
static OMPTeamsGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:2354
clang::OMPTeamsDirective::Create
static OMPTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1046
clang::OMPTileDirective
This represents the '#pragma omp tile' loop transformation directive.
Definition: StmtOpenMP.h:5493
clang::OMPLoopBasedDirective::HelperExprs::LB
Expr * LB
LowerBound - local variable passed to runtime.
Definition: StmtOpenMP.h:761
clang::OMPMaskedDirective
This represents '#pragma omp masked' directive.
Definition: StmtOpenMP.h:5820
clang::OMPLoopBasedDirective::DistCombinedHelperExprs::Init
Expr * Init
Distribute loop iteration variable init used when composing 'omp distribute' with 'omp for' in a same...
Definition: StmtOpenMP.h:720
clang::OMPLoopBasedDirective::DistCombinedHelperExprs::ParForInDistCond
Expr * ParForInDistCond
'omp parallel for' loop condition used when composed with 'omp distribute' in the same construct and ...
Definition: StmtOpenMP.h:736
clang::OMPLoopBasedDirective::HelperExprs::Counters
SmallVector< Expr *, 4 > Counters
Counters Loop counters.
Definition: StmtOpenMP.h:789
clang::OMPLoopBasedDirective::HelperExprs::DistInc
Expr * DistInc
DistInc - increment expression for distribute loop when found combined with a further loop level (e....
Definition: StmtOpenMP.h:781
clang::OMPCancelDirective::CreateEmpty
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:828
clang::OMPParallelMasterTaskLoopDirective
This represents '#pragma omp parallel master taskloop' directive.
Definition: StmtOpenMP.h:4082
clang::OMPTargetParallelGenericLoopDirective
This represents '#pragma omp target parallel loop' directive.
Definition: StmtOpenMP.h:6168
clang::OMPDistributeParallelForSimdDirective::CreateEmpty
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1684
clang::OMPLoopBasedDirective::DistCombinedHelperExprs::UB
Expr * UB
DistributeUpperBound - used when composing 'omp distribute' with 'omp for' in a same construct.
Definition: StmtOpenMP.h:713
clang::OMPErrorDirective::CreateEmpty
static OMPErrorDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:756
clang::OMPLoopTransformationDirective::getTransformedStmt
Stmt * getTransformedStmt() const
Get the de-sugared statements after the loop transformation.
Definition: StmtOpenMP.cpp:372
clang::OMPTargetTeamsDistributeDirective
This represents '#pragma omp target teams distribute' combined directive.
Definition: StmtOpenMP.h:5200
clang::OMPTargetParallelForDirective::Create
static OMPTargetParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:957
clang::OMPDepobjDirective::CreateEmpty
static OMPDepobjDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:858
clang::OMPTargetTeamsDistributeSimdDirective
This represents '#pragma omp target teams distribute simd' combined directive.
Definition: StmtOpenMP.h:5435
llvm::SmallVector
Definition: LLVM.h:38
clang::OMPLoopBasedDirective::HelperExprs::IL
Expr * IL
IsLastIteration - local flag variable passed to runtime.
Definition: StmtOpenMP.h:759
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:86
clang::OMPTileDirective::CreateEmpty
static OMPTileDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty '#pragma omp tile' AST node for deserialization.
Definition: StmtOpenMP.cpp:420
clang::OMPLoopDirective::setFinalsConditions
void setFinalsConditions(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:256
clang::OMPTargetParallelDirective::CreateEmpty
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:951
clang::OMPDepobjDirective::Create
static OMPDepobjDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:849
clang::OMPMasterDirective
This represents '#pragma omp master' directive.
Definition: StmtOpenMP.h:1976
clang::OMPMasterTaskLoopDirective::CreateEmpty
static OMPMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1186
clang::OMPLoopBasedDirective::tryToFindNextInnerLoop
static Stmt * tryToFindNextInnerLoop(Stmt *CurStmt, bool TryImperfectlyNestedLoops)
Try to find the next loop sub-statement in the specified statement CurStmt.
Definition: StmtOpenMP.cpp:78
clang::OMPTaskwaitDirective
This represents '#pragma omp taskwait' directive.
Definition: StmtOpenMP.h:2619
clang::OMPFlushDirective::Create
static OMPFlushDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:834
clang::OMPParallelDirective::Create
static OMPParallelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:281
clang::OMPSectionDirective
This represents '#pragma omp section' directive.
Definition: StmtOpenMP.h:1863
clang::OMPAtomicDirective::Expressions::UE
Expr * UE
UE Helper expression of the form: 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExp...
Definition: StmtOpenMP.h:2981
clang::OMPTargetDirective::Create
static OMPTargetDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:923
clang::OMPLoopBasedDirective::HelperExprs::Inits
SmallVector< Expr *, 4 > Inits
Expressions for loop counters inits for CodeGen.
Definition: StmtOpenMP.h:793
clang::OMPTeamsDistributeSimdDirective
This represents '#pragma omp teams distribute simd' combined directive.
Definition: StmtOpenMP.h:4917
clang::OMPCancellationPointDirective::CreateEmpty
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:813
clang::IfStmt
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1948
clang::OMPDistributeDirective::Create
static OMPDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1515
clang::OMPInteropDirective::Create
static OMPInteropDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive.
Definition: StmtOpenMP.cpp:2263
clang::OMPLoopBasedDirective::HelperExprs::DependentCounters
SmallVector< Expr *, 4 > DependentCounters
List of counters required for the generation of the non-rectangular loops.
Definition: StmtOpenMP.h:800
clang::OMPLoopBasedDirective::HelperExprs::FinalsConditions
SmallVector< Expr *, 4 > FinalsConditions
List of final conditions required for the generation of the non-rectangular loops.
Definition: StmtOpenMP.h:806
clang::OMPTaskgroupDirective::CreateEmpty
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:797
clang::OMPLoopTransformationDirective
The base class for all loop transformation directives.
Definition: StmtOpenMP.h:960
clang::OMPDistributeDirective::CreateEmpty
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1551
clang::OMPTaskLoopDirective::Create
static OMPTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1062
clang::OMPParallelMaskedDirective::Create
static OMPParallelMaskedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:685
clang::OMPAtomicDirective::Expressions::IsXLHSInRHSPart
bool IsXLHSInRHSPart
True if UE has the first form and false if the second.
Definition: StmtOpenMP.h:2987
clang::OMPSingleDirective::CreateEmpty
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:542
clang::OMPSectionDirective::CreateEmpty
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:526
clang::OMPParallelMaskedTaskLoopSimdDirective::CreateEmpty
static OMPParallelMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1505
clang::OMPTargetParallelGenericLoopDirective::CreateEmpty
static OMPTargetParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:2523
clang::OMPMasterTaskLoopSimdDirective::Create
static OMPMasterTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1239
clang::OMPLoopBasedDirective::HelperExprs::PreCond
Expr * PreCond
Loop pre-condition.
Definition: StmtOpenMP.h:751
clang::Stmt::EmptyShell
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....
Definition: Stmt.h:1117
clang::OMPTargetTeamsDistributeParallelForDirective
This represents '#pragma omp target teams distribute parallel for' combined directive.
Definition: StmtOpenMP.h:5266
clang::OMPDistributeParallelForDirective::Create
static OMPDistributeParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1573
clang::OMPTaskgroupDirective
This represents '#pragma omp taskgroup' directive.
Definition: StmtOpenMP.h:2670
clang::OMPTargetTeamsDistributeParallelForSimdDirective::Create
static OMPTargetTeamsDistributeParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:2155
clang::OMPTaskwaitDirective::Create
static OMPTaskwaitDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive.
Definition: StmtOpenMP.cpp:774
clang::OMPTargetTeamsDistributeSimdDirective::Create
static OMPTargetTeamsDistributeSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:2216
clang::OMPTaskLoopDirective::CreateEmpty
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1097
clang::OMPTargetExitDataDirective
This represents '#pragma omp target exit data' directive.
Definition: StmtOpenMP.h:3260
clang::OMPForSimdDirective
This represents '#pragma omp for simd' directive.
Definition: StmtOpenMP.h:1723
clang::OMPParallelGenericLoopDirective
This represents '#pragma omp parallel loop' directive.
Definition: StmtOpenMP.h:6103
llvm::MutableArrayRef
Definition: LLVM.h:35
clang::OMPAtomicDirective::Expressions::IsFailOnly
bool IsFailOnly
True if 'v' is updated only when the condition is false (compare capture only).
Definition: StmtOpenMP.h:2992
clang::OMPErrorDirective
This represents '#pragma omp error' directive.
Definition: StmtOpenMP.h:6230
clang::OMPLoopBasedDirective::HelperExprs::NLB
Expr * NLB
Update of LowerBound for statically scheduled 'omp for' loops.
Definition: StmtOpenMP.h:769
clang::OMPTargetTeamsDistributeParallelForDirective::CreateEmpty
static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:2143
clang::OMPLoopBasedDirective::HelperExprs::PrivateCounters
SmallVector< Expr *, 4 > PrivateCounters
PrivateCounters Loop counters.
Definition: StmtOpenMP.h:791
clang::OMPTargetDataDirective::Create
static OMPTargetDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1004
clang::OMPParallelMasterDirective
This represents '#pragma omp parallel master' directive.
Definition: StmtOpenMP.h:2257
clang::OMPParallelSectionsDirective::Create
static OMPParallelSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:701
clang::OMPMasterTaskLoopDirective::Create
static OMPMasterTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1149
clang::OMPSimdDirective::Create
static OMPSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:301
clang::OMPChildren
Contains data for OpenMP directives: clauses, children expressions/statements (helpers for codegen) a...
Definition: OpenMPClause.h:8868
StmtOpenMP.h
clang::OMPLoopDirective::setUpdates
void setUpdates(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:231
clang::OMPTargetUpdateDirective::CreateEmpty
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1567
clang::OMPLoopBasedDirective::DistCombinedHelperExprs::EUB
Expr * EUB
DistributeEnsureUpperBound - used when composing 'omp distribute' with 'omp for' in a same construct,...
Definition: StmtOpenMP.h:716
clang::OMPForDirective::CreateEmpty
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:398
clang::OMPOrderedDirective::Create
static OMPOrderedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:879
clang::OMPDistributeSimdDirective::CreateEmpty
static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1730
clang::OMPTeamsDirective
This represents '#pragma omp teams' directive.
Definition: StmtOpenMP.h:3489
clang::OMPLoopBasedDirective::HelperExprs::LastIteration
Expr * LastIteration
Loop last iteration number.
Definition: StmtOpenMP.h:745
clang::OMPForDirective::Create
static OMPForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:336
clang::OMPParallelForDirective::CreateEmpty
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:618
clang::OMPScanDirective
This represents '#pragma omp scan' directive.
Definition: StmtOpenMP.h:5649
clang::OMPMaskedDirective::CreateEmpty
static OMPMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:2305
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:182
clang::OMPDistributeParallelForSimdDirective::Create
static OMPDistributeParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1635
clang::OMPMetaDirective
This represents '#pragma omp metadirective' directive.
Definition: StmtOpenMP.h:5871
clang::OMPParallelMaskedTaskLoopSimdDirective
This represents '#pragma omp parallel masked taskloop simd' directive.
Definition: StmtOpenMP.h:4305
clang::OMPCancelDirective::Create
static OMPCancelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, OpenMPDirectiveKind CancelRegion)
Creates directive.
Definition: StmtOpenMP.cpp:818
clang::OMPCriticalDirective::CreateEmpty
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:573
clang::OMPExecutableDirective::isStandaloneDirective
bool isStandaloneDirective() const
Returns whether or not this is a Standalone directive.
Definition: StmtOpenMP.cpp:58
clang::OMPTaskLoopSimdDirective::Create
static OMPTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1106
clang::OMPParallelMaskedTaskLoopDirective
This represents '#pragma omp parallel masked taskloop' directive.
Definition: StmtOpenMP.h:4160
clang::OMPParallelMaskedTaskLoopDirective::Create
static OMPParallelMaskedTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1374
clang::OMPDistributeParallelForSimdDirective
This represents '#pragma omp distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:4588
clang::OMPParallelMasterTaskLoopDirective::Create
static OMPParallelMasterTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1327
clang::OMPLoopBasedDirective::HelperExprs::CalcLastIteration
Expr * CalcLastIteration
Calculation of last iteration.
Definition: StmtOpenMP.h:749
clang::OMPDepobjDirective
This represents '#pragma omp depobj' directive.
Definition: StmtOpenMP.h:2789
clang::OMPParallelForSimdDirective::Create
static OMPParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:625
clang::OMPTargetTeamsDirective::CreateEmpty
static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:2038
clang::OMPMetaDirective::Create
static OMPMetaDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Stmt *IfStmt)
Definition: StmtOpenMP.cpp:262
clang::OMPAtomicDirective::CreateEmpty
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:916
clang::OMPSectionDirective::Create
static OMPSectionDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, bool HasCancel)
Creates directive.
Definition: StmtOpenMP.cpp:514
clang::OMPParallelDirective
This represents '#pragma omp parallel' directive.
Definition: StmtOpenMP.h:612
ASTContext.h
clang::OMPParallelForSimdDirective
This represents '#pragma omp parallel for simd' directive.
Definition: StmtOpenMP.h:2192
clang::OMPTaskDirective
This represents '#pragma omp task' directive.
Definition: StmtOpenMP.h:2465
clang::OMPTargetParallelDirective
This represents '#pragma omp target parallel' directive.
Definition: StmtOpenMP.h:3314
clang::OMPLoopBasedDirective::HelperExprs::PreInits
Stmt * PreInits
Init statement for all captured expressions.
Definition: StmtOpenMP.h:808
clang::OMPParallelForDirective
This represents '#pragma omp parallel for' directive.
Definition: StmtOpenMP.h:2095
clang::OMPSingleDirective::Create
static OMPSingleDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:532
clang::OMPParallelSectionsDirective::CreateEmpty
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:713
clang::OMPTargetExitDataDirective::Create
static OMPTargetExitDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1032
clang::OMPMasterDirective::CreateEmpty
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:558
clang::OMPChildren::setClauses
void setClauses(ArrayRef< OMPClause * > Clauses)
Sets the list of variables for this clause.
Definition: StmtOpenMP.cpp:27
clang::OMPLoopBasedDirective::HelperExprs::Inc
Expr * Inc
Loop increment.
Definition: StmtOpenMP.h:757
clang::OMPCriticalDirective
This represents '#pragma omp critical' directive.
Definition: StmtOpenMP.h:2024
clang::OMPLoopDirective::setInits
void setInits(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:225
clang::OMPTargetTeamsGenericLoopDirective
This represents '#pragma omp target teams loop' directive.
Definition: StmtOpenMP.h:6037
clang::OMPTargetParallelForSimdDirective
This represents '#pragma omp target parallel for simd' directive.
Definition: StmtOpenMP.h:4719
clang::OMPLoopBasedDirective::HelperExprs::DependentInits
SmallVector< Expr *, 4 > DependentInits
List of initializers required for the generation of the non-rectangular loops.
Definition: StmtOpenMP.h:803
clang::OMPMasterTaskLoopDirective
This represents '#pragma omp master taskloop' directive.
Definition: StmtOpenMP.h:3799
clang::OMPTeamsDistributeDirective
This represents '#pragma omp teams distribute' directive.
Definition: StmtOpenMP.h:4851
clang::OMPTargetParallelForDirective::CreateEmpty
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:995
clang::OMPParallelMasterTaskLoopSimdDirective::Create
static OMPParallelMasterTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1422
clang::OMPMaskedTaskLoopDirective::Create
static OMPMaskedTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1194
clang::OMPParallelMasterDirective::Create
static OMPParallelMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:669
clang::OMPLoopDirective::setPrivateCounters
void setPrivateCounters(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:218
clang::OMPTaskyieldDirective::CreateEmpty
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:742
clang::OMPAtomicDirective::Expressions::X
Expr * X
'x' part of the associated expression/statement.
Definition: StmtOpenMP.h:2971
clang::OMPLoopBasedDirective::DistCombinedHelperExprs::DistCond
Expr * DistCond
Distribute Loop condition used when composing 'omp distribute' with 'omp for' in a same construct whe...
Definition: StmtOpenMP.h:732
clang::OMPMetaDirective::CreateEmpty
static OMPMetaDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Definition: StmtOpenMP.cpp:273
clang::OMPLoopBasedDirective::HelperExprs::EUB
Expr * EUB
EnsureUpperBound – expression UB = min(UB, NumIterations).
Definition: StmtOpenMP.h:767
clang::OMPTargetTeamsDistributeDirective::CreateEmpty
static OMPTargetTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:2080
clang::OMPUnrollDirective::Create
static OMPUnrollDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, unsigned NumGeneratedLoops, Stmt *TransformedStmt, Stmt *PreInits)
Create a new AST node representation for '#pragma omp unroll'.
Definition: StmtOpenMP.cpp:429
clang::OMPScanDirective::CreateEmpty
static OMPScanDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:873
clang::OMPMaskedTaskLoopDirective
This represents '#pragma omp masked taskloop' directive.
Definition: StmtOpenMP.h:3875
clang::OMPTargetSimdDirective::CreateEmpty
static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1813
clang::OMPExecutableDirective::getStructuredBlock
const Stmt * getStructuredBlock() const
Returns the AST node representing OpenMP structured-block of this OpenMP executable directive,...
Definition: StmtOpenMP.h:588
clang::OMPCancelDirective
This represents '#pragma omp cancel' directive.
Definition: StmtOpenMP.h:3600
clang::OMPMasterDirective::Create
static OMPMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:549
clang::OMPTeamsDistributeParallelForSimdDirective::CreateEmpty
static OMPTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1957
clang::OMPForSimdDirective::Create
static OMPForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:451
clang::OMPSectionsDirective
This represents '#pragma omp sections' directive.
Definition: StmtOpenMP.h:1786
clang::OMPLoopBasedDirective::doForAllLoopsBodies
static void doForAllLoopsBodies(Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops, llvm::function_ref< void(unsigned, Stmt *, Stmt *)> Callback)
Calls the specified callback function for all the loop bodies in CurStmt, from the outermost loop to ...
Definition: StmtOpenMP.cpp:179
clang::OMPLoopBasedDirective::HelperExprs::PrevUB
Expr * PrevUB
PreviousUpperBound - local variable passed to runtime in the enclosing schedule or null if that does ...
Definition: StmtOpenMP.h:777
clang::OMPParallelMaskedTaskLoopSimdDirective::Create
static OMPParallelMaskedTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1469
clang::OMPTargetTeamsDistributeParallelForSimdDirective
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
Definition: StmtOpenMP.h:5364
clang::OMPMaskedTaskLoopSimdDirective
This represents '#pragma omp masked taskloop simd' directive.
Definition: StmtOpenMP.h:4016
clang::OMPTaskyieldDirective::Create
static OMPTaskyieldDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:736
clang::OMPFlushDirective
This represents '#pragma omp flush' directive.
Definition: StmtOpenMP.h:2737
clang::OMPTargetEnterDataDirective
This represents '#pragma omp target enter data' directive.
Definition: StmtOpenMP.h:3205
clang::OMPInteropDirective
This represents '#pragma omp interop' directive.
Definition: StmtOpenMP.h:5702
clang::OMPTargetDataDirective::CreateEmpty
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:1011
clang::OMPDistributeDirective
This represents '#pragma omp distribute' directive.
Definition: StmtOpenMP.h:4370
clang::OMPTeamsGenericLoopDirective
This represents '#pragma omp teams loop' directive.
Definition: StmtOpenMP.h:5972
clang::Stmt::IgnoreContainers
Stmt * IgnoreContainers(bool IgnoreCaptured=false)
Skip no-op (attributed, compound) container stmts and skip captured stmt at the top,...
Definition: Stmt.cpp:196
clang::OMPDispatchDirective::CreateEmpty
static OMPDispatchDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:2287
clang::OMPSingleDirective
This represents '#pragma omp single' directive.
Definition: StmtOpenMP.h:1925
clang::OMPTaskwaitDirective::CreateEmpty
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:782
clang::OMPErrorDirective::Create
static OMPErrorDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Definition: StmtOpenMP.cpp:747
clang::OMPSectionsDirective::Create
static OMPSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:494
clang::OMPTargetUpdateDirective::Create
static OMPTargetUpdateDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1558
clang::OMPLoopBasedDirective::HelperExprs
The expressions built for the OpenMP loop CodeGen for the whole collapsed loop nest.
Definition: StmtOpenMP.h:741
clang::OMPParallelForSimdDirective::CreateEmpty
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:661
clang::OMPForSimdDirective::CreateEmpty
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:485
clang::OMPBarrierDirective::CreateEmpty
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:768
clang::OMPParallelMasterTaskLoopSimdDirective::CreateEmpty
static OMPParallelMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1458
llvm::ArrayRef
Definition: LLVM.h:34
clang::OMPTaskLoopDirective
This represents '#pragma omp taskloop' directive.
Definition: StmtOpenMP.h:3660
clang::OMPTeamsDistributeParallelForSimdDirective::Create
static OMPTeamsDistributeParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1908
clang::OMPLoopBasedDirective::HelperExprs::Finals
SmallVector< Expr *, 4 > Finals
Final loop counter values for GodeGen.
Definition: StmtOpenMP.h:797
clang::OMPMaskedTaskLoopSimdDirective::CreateEmpty
static OMPMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1319
clang::OMPTaskgroupDirective::Create
static OMPTaskgroupDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *ReductionRef)
Creates directive.
Definition: StmtOpenMP.cpp:788
clang::OMPLoopBasedDirective::HelperExprs::Updates
SmallVector< Expr *, 4 > Updates
Expressions for loop counters update for CodeGen.
Definition: StmtOpenMP.h:795
clang::OMPTargetTeamsDistributeSimdDirective::CreateEmpty
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:2252
clang::OMPCancellationPointDirective
This represents '#pragma omp cancellation point' directive.
Definition: StmtOpenMP.h:3542
clang::OMPDispatchDirective
This represents '#pragma omp dispatch' directive.
Definition: StmtOpenMP.h:5755
clang::OMPTargetTeamsDirective::Create
static OMPTargetTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:2029
clang::OMPMaskedTaskLoopSimdDirective::Create
static OMPMaskedTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1283
clang::OMPSectionsDirective::CreateEmpty
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:506
clang::OMPTeamsDistributeDirective::CreateEmpty
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1856
clang::OMPTaskLoopSimdDirective::CreateEmpty
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1142
clang::OMPParallelGenericLoopDirective::CreateEmpty
static OMPParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:2478
clang::OMPParallelGenericLoopDirective::Create
static OMPParallelGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:2443
clang::OMPLoopBasedDirective::DistCombinedHelperExprs::NLB
Expr * NLB
Update of LowerBound for statically scheduled omp loops for outer loop in combined constructs (e....
Definition: StmtOpenMP.h:726
clang::OMPInteropDirective::CreateEmpty
static OMPInteropDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:2271
clang::OMPTargetDirective::CreateEmpty
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:932
clang::OMPMaskedDirective::Create
static OMPMaskedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:2295
clang::OMPParallelMasterTaskLoopDirective::CreateEmpty
static OMPParallelMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1364
clang::OMPLoopBasedDirective::HelperExprs::NumIterations
Expr * NumIterations
Loop number of iterations.
Definition: StmtOpenMP.h:747
clang::OMPTeamsDistributeSimdDirective::CreateEmpty
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1899
clang::OMPUnrollDirective::CreateEmpty
static OMPUnrollDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Build an empty '#pragma omp unroll' AST node for deserialization.
Definition: StmtOpenMP.cpp:443
clang::OMPLoopDirective::setCounters
void setCounters(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:212
clang::OMPSimdDirective::CreateEmpty
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:327
clang::OMPTeamsDistributeParallelForDirective
This represents '#pragma omp teams distribute parallel for' composite directive.
Definition: StmtOpenMP.h:5051
clang::OMPLoopBasedDirective::DistCombinedHelperExprs::LB
Expr * LB
DistributeLowerBound - used when composing 'omp distribute' with 'omp for' in a same construct.
Definition: StmtOpenMP.h:710
clang::OMPOrderedDirective::CreateEmpty
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, bool IsStandalone, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:889
clang::OMPAtomicDirective::Expressions::R
Expr * R
Definition: StmtOpenMP.h:2975
clang::OMPTeamsDistributeParallelForDirective::Create
static OMPTeamsDistributeParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1968
clang::OMPAtomicDirective::Create
static OMPAtomicDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expressions Exprs)
Creates directive with a list of Clauses and 'x', 'v' and 'expr' parts of the atomic construct (see S...
Definition: StmtOpenMP.cpp:898
clang::OMPSimdDirective
This represents '#pragma omp simd' directive.
Definition: StmtOpenMP.h:1570
clang::OMPAtomicDirective::Expressions::D
Expr * D
'd' part of the associated expression/statement.
Definition: StmtOpenMP.h:2983
clang::OMPTargetParallelGenericLoopDirective::Create
static OMPTargetParallelGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:2487
clang::OMPMaskedTaskLoopDirective::CreateEmpty
static OMPMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1231
clang::OMPTeamsDistributeSimdDirective::Create
static OMPTeamsDistributeSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1864
clang
Definition: CalledOnceCheck.h:17
clang::OMPLoopBasedDirective::HelperExprs::PrevLB
Expr * PrevLB
PreviousLowerBound - local variable passed to runtime in the enclosing schedule or null if that does ...
Definition: StmtOpenMP.h:774
clang::OMPAtomicDirective::Expressions::IsPostfixUpdate
bool IsPostfixUpdate
True if original value of 'x' must be stored in 'v', not an updated one.
Definition: StmtOpenMP.h:2989
clang::OMPTargetTeamsDirective
This represents '#pragma omp target teams' directive.
Definition: StmtOpenMP.h:5144
clang::OMPLoopBasedDirective::HelperExprs::Init
Expr * Init
Loop iteration variable init.
Definition: StmtOpenMP.h:755
clang::OMPTargetTeamsGenericLoopDirective::CreateEmpty
static OMPTargetTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:2434
clang::OMPTargetTeamsDistributeDirective::Create
static OMPTargetTeamsDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:2044
clang::Stmt
Stmt - This represents one statement.
Definition: Stmt.h:72
clang::OMPDistributeParallelForDirective
This represents '#pragma omp distribute parallel for' composite directive.
Definition: StmtOpenMP.h:4492
clang::OMPGenericLoopDirective::CreateEmpty
static OMPGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with a place for NumClauses clauses.
Definition: StmtOpenMP.cpp:2347
clang::OMPParallelMaskedDirective
This represents '#pragma omp parallel masked' directive.
Definition: StmtOpenMP.h:2320
clang::OMPBarrierDirective::Create
static OMPBarrierDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:762
clang::OMPTargetTeamsDistributeParallelForDirective::Create
static OMPTargetTeamsDistributeParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:2091
clang::OMPTargetParallelDirective::Create
static OMPTargetParallelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:939
clang::OMPMasterTaskLoopSimdDirective::CreateEmpty
static OMPMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1275
clang::OMPTeamsDistributeDirective::Create
static OMPTeamsDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1820
clang::OMPUnrollDirective
This represents the '#pragma omp unroll' loop transformation directive.
Definition: StmtOpenMP.h:5575
clang::OMPLoopTransformationDirective::getPreInits
Stmt * getPreInits() const
Return preinits statement.
Definition: StmtOpenMP.cpp:385
clang::OMPDistributeSimdDirective::Create
static OMPDistributeSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1694
clang::OMPTaskDirective::Create
static OMPTaskDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:720
clang::OMPLoopDirective::setDependentInits
void setDependentInits(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:250
clang::OMPTargetDirective
This represents '#pragma omp target' directive.
Definition: StmtOpenMP.h:3097
clang::OMPTargetParallelForSimdDirective::CreateEmpty
static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1774
clang::OMPGenericLoopDirective
This represents '#pragma omp loop' directive.
Definition: StmtOpenMP.h:5910
clang::OMPTargetUpdateDirective
This represents '#pragma omp target update' directive.
Definition: StmtOpenMP.h:4436
clang::OMPAtomicDirective::Expressions::V
Expr * V
'v' part of the associated expression/statement.
Definition: StmtOpenMP.h:2973
clang::OMPLoopBasedDirective::HelperExprs::NUB
Expr * NUB
Update of UpperBound for statically scheduled 'omp for' loops.
Definition: StmtOpenMP.h:771
clang::OMPParallelMaskedTaskLoopDirective::CreateEmpty
static OMPParallelMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1411
clang::OMPGenericLoopDirective::Create
static OMPGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:2312
clang::OMPOrderedDirective
This represents '#pragma omp ordered' directive.
Definition: StmtOpenMP.h:2841
clang::OMPLoopBasedDirective::HelperExprs::ST
Expr * ST
Stride - local variable passed to runtime.
Definition: StmtOpenMP.h:765
clang::OMPTargetParallelForSimdDirective::Create
static OMPTargetParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1738
clang::OpenMPDirectiveKind
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:24
clang::OMPDistributeSimdDirective
This represents '#pragma omp distribute simd' composite directive.
Definition: StmtOpenMP.h:4653
clang::OMPTargetEnterDataDirective::CreateEmpty
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:1026
clang::OMPParallelMasterTaskLoopSimdDirective
This represents '#pragma omp parallel master taskloop simd' directive.
Definition: StmtOpenMP.h:4238
clang::OMPScanDirective::Create
static OMPScanDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:864
clang::OMPLoopBasedDirective::HelperExprs::UB
Expr * UB
UpperBound - local variable passed to runtime.
Definition: StmtOpenMP.h:763
clang::Expr
This represents one expression.
Definition: Expr.h:110
clang::OMPDistributeParallelForDirective::CreateEmpty
static OMPDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1624
clang::OMPTargetDataDirective
This represents '#pragma omp target data' directive.
Definition: StmtOpenMP.h:3151
clang::OMPTileDirective::Create
static OMPTileDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits)
Create a new AST node representation for '#pragma omp tile'.
Definition: StmtOpenMP.cpp:408
clang::OMPParallelForDirective::Create
static OMPParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:580
clang::OMPTeamsDistributeParallelForDirective::CreateEmpty
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:2019
clang::OMPTargetEnterDataDirective::Create
static OMPTargetEnterDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:1018
clang::OMPTargetSimdDirective
This represents '#pragma omp target simd' directive.
Definition: StmtOpenMP.h:4786
clang::OMPTaskDirective::CreateEmpty
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:729
clang::OMPLoopBasedDirective::HelperExprs::DistCombinedFields
DistCombinedHelperExprs DistCombinedFields
Expressions used when combining OpenMP loop pragmas.
Definition: StmtOpenMP.h:811
clang::DeclarationNameInfo
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
Definition: DeclarationName.h:767
clang::OMPParallelMaskedDirective::CreateEmpty
static OMPParallelMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:695
clang::OMPLoopBasedDirective::HelperExprs::Cond
Expr * Cond
Loop condition.
Definition: StmtOpenMP.h:753
clang::OMPTaskLoopSimdDirective
This represents '#pragma omp taskloop simd' directive.
Definition: StmtOpenMP.h:3733
clang::OMPLoopBasedDirective::doForAllLoops
static bool doForAllLoops(Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops, llvm::function_ref< bool(unsigned, Stmt *)> Callback, llvm::function_ref< void(OMPLoopTransformationDirective *)> OnTransformationCallback)
Calls the specified callback function for all the loops in CurStmt, from the outermost to the innermo...
Definition: StmtOpenMP.cpp:125
clang::OMPTargetParallelForDirective
This represents '#pragma omp target parallel for' directive.
Definition: StmtOpenMP.h:3394
clang::OMPParallelSectionsDirective
This represents '#pragma omp parallel sections' directive.
Definition: StmtOpenMP.h:2384
clang::OMPTargetTeamsGenericLoopDirective::Create
static OMPTargetTeamsGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:2398
clang::OMPAtomicDirective::Expressions
Definition: StmtOpenMP.h:2969
clang::OMPAtomicDirective
This represents '#pragma omp atomic' directive.
Definition: StmtOpenMP.h:2895
clang::OMPLoopDirective::getBody
Stmt * getBody()
Definition: StmtOpenMP.cpp:202
clang::OMPTargetTeamsDistributeParallelForSimdDirective::CreateEmpty
static OMPTargetTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:2205
clang::OMPLoopBasedDirective::DistCombinedHelperExprs::NUB
Expr * NUB
Update of UpperBound for statically scheduled omp loops for outer loop in combined constructs (e....
Definition: StmtOpenMP.h:729
clang::OMPLoopDirective::setDependentCounters
void setDependentCounters(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:243
clang::OMPTeamsDistributeParallelForSimdDirective
This represents '#pragma omp teams distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:4984
clang::OMPBarrierDirective
This represents '#pragma omp barrier' directive.
Definition: StmtOpenMP.h:2573
clang::OMPFlushDirective::CreateEmpty
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:843