clang  19.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 
301  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
302  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
303  const HelperExprs &Exprs, OpenMPDirectiveKind ParamPrevMappedDirective) {
304  auto *Dir = createDirective<OMPSimdDirective>(
305  C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_simd),
306  StartLoc, EndLoc, CollapsedNum);
307  Dir->setIterationVariable(Exprs.IterationVarRef);
308  Dir->setLastIteration(Exprs.LastIteration);
309  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
310  Dir->setPreCond(Exprs.PreCond);
311  Dir->setCond(Exprs.Cond);
312  Dir->setInit(Exprs.Init);
313  Dir->setInc(Exprs.Inc);
314  Dir->setCounters(Exprs.Counters);
315  Dir->setPrivateCounters(Exprs.PrivateCounters);
316  Dir->setInits(Exprs.Inits);
317  Dir->setUpdates(Exprs.Updates);
318  Dir->setFinals(Exprs.Finals);
319  Dir->setDependentCounters(Exprs.DependentCounters);
320  Dir->setDependentInits(Exprs.DependentInits);
321  Dir->setFinalsConditions(Exprs.FinalsConditions);
322  Dir->setPreInits(Exprs.PreInits);
323  Dir->setMappedDirective(ParamPrevMappedDirective);
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  OpenMPDirectiveKind ParamPrevMappedDirective) {
341  auto *Dir = createDirective<OMPForDirective>(
342  C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for) + 1,
343  StartLoc, EndLoc, CollapsedNum);
344  Dir->setIterationVariable(Exprs.IterationVarRef);
345  Dir->setLastIteration(Exprs.LastIteration);
346  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
347  Dir->setPreCond(Exprs.PreCond);
348  Dir->setCond(Exprs.Cond);
349  Dir->setInit(Exprs.Init);
350  Dir->setInc(Exprs.Inc);
351  Dir->setIsLastIterVariable(Exprs.IL);
352  Dir->setLowerBoundVariable(Exprs.LB);
353  Dir->setUpperBoundVariable(Exprs.UB);
354  Dir->setStrideVariable(Exprs.ST);
355  Dir->setEnsureUpperBound(Exprs.EUB);
356  Dir->setNextLowerBound(Exprs.NLB);
357  Dir->setNextUpperBound(Exprs.NUB);
358  Dir->setNumIterations(Exprs.NumIterations);
359  Dir->setCounters(Exprs.Counters);
360  Dir->setPrivateCounters(Exprs.PrivateCounters);
361  Dir->setInits(Exprs.Inits);
362  Dir->setUpdates(Exprs.Updates);
363  Dir->setFinals(Exprs.Finals);
364  Dir->setDependentCounters(Exprs.DependentCounters);
365  Dir->setDependentInits(Exprs.DependentInits);
366  Dir->setFinalsConditions(Exprs.FinalsConditions);
367  Dir->setPreInits(Exprs.PreInits);
368  Dir->setTaskReductionRefExpr(TaskRedRef);
369  Dir->setHasCancel(HasCancel);
370  Dir->setMappedDirective(ParamPrevMappedDirective);
371  return Dir;
372 }
373 
375  switch (getStmtClass()) {
376 #define STMT(CLASS, PARENT)
377 #define ABSTRACT_STMT(CLASS)
378 #define OMPLOOPTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
379  case Stmt::CLASS##Class: \
380  return static_cast<const CLASS *>(this)->getTransformedStmt();
381 #include "clang/AST/StmtNodes.inc"
382  default:
383  llvm_unreachable("Not a loop transformation");
384  }
385 }
386 
388  switch (getStmtClass()) {
389 #define STMT(CLASS, PARENT)
390 #define ABSTRACT_STMT(CLASS)
391 #define OMPLOOPTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
392  case Stmt::CLASS##Class: \
393  return static_cast<const CLASS *>(this)->getPreInits();
394 #include "clang/AST/StmtNodes.inc"
395  default:
396  llvm_unreachable("Not a loop transformation");
397  }
398 }
399 
401  unsigned NumClauses,
402  unsigned CollapsedNum,
403  EmptyShell) {
404  return createEmptyDirective<OMPForDirective>(
405  C, NumClauses, /*HasAssociatedStmt=*/true,
406  numLoopChildren(CollapsedNum, OMPD_for) + 1, CollapsedNum);
407 }
408 
411  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
412  unsigned NumLoops, Stmt *AssociatedStmt,
413  Stmt *TransformedStmt, Stmt *PreInits) {
414  OMPTileDirective *Dir = createDirective<OMPTileDirective>(
415  C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
416  NumLoops);
417  Dir->setTransformedStmt(TransformedStmt);
418  Dir->setPreInits(PreInits);
419  return Dir;
420 }
421 
423  unsigned NumClauses,
424  unsigned NumLoops) {
425  return createEmptyDirective<OMPTileDirective>(
426  C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1,
427  SourceLocation(), SourceLocation(), NumLoops);
428 }
429 
432  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
433  Stmt *AssociatedStmt, unsigned NumGeneratedLoops,
434  Stmt *TransformedStmt, Stmt *PreInits) {
435  assert(NumGeneratedLoops <= 1 && "Unrolling generates at most one loop");
436 
437  auto *Dir = createDirective<OMPUnrollDirective>(
438  C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc);
439  Dir->setNumGeneratedLoops(NumGeneratedLoops);
440  Dir->setTransformedStmt(TransformedStmt);
441  Dir->setPreInits(PreInits);
442  return Dir;
443 }
444 
446  unsigned NumClauses) {
447  return createEmptyDirective<OMPUnrollDirective>(
448  C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1,
450 }
451 
454  SourceLocation EndLoc, unsigned CollapsedNum,
455  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
456  const HelperExprs &Exprs) {
457  auto *Dir = createDirective<OMPForSimdDirective>(
458  C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for_simd),
459  StartLoc, EndLoc, CollapsedNum);
460  Dir->setIterationVariable(Exprs.IterationVarRef);
461  Dir->setLastIteration(Exprs.LastIteration);
462  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
463  Dir->setPreCond(Exprs.PreCond);
464  Dir->setCond(Exprs.Cond);
465  Dir->setInit(Exprs.Init);
466  Dir->setInc(Exprs.Inc);
467  Dir->setIsLastIterVariable(Exprs.IL);
468  Dir->setLowerBoundVariable(Exprs.LB);
469  Dir->setUpperBoundVariable(Exprs.UB);
470  Dir->setStrideVariable(Exprs.ST);
471  Dir->setEnsureUpperBound(Exprs.EUB);
472  Dir->setNextLowerBound(Exprs.NLB);
473  Dir->setNextUpperBound(Exprs.NUB);
474  Dir->setNumIterations(Exprs.NumIterations);
475  Dir->setCounters(Exprs.Counters);
476  Dir->setPrivateCounters(Exprs.PrivateCounters);
477  Dir->setInits(Exprs.Inits);
478  Dir->setUpdates(Exprs.Updates);
479  Dir->setFinals(Exprs.Finals);
480  Dir->setDependentCounters(Exprs.DependentCounters);
481  Dir->setDependentInits(Exprs.DependentInits);
482  Dir->setFinalsConditions(Exprs.FinalsConditions);
483  Dir->setPreInits(Exprs.PreInits);
484  return Dir;
485 }
486 
488  unsigned NumClauses,
489  unsigned CollapsedNum,
490  EmptyShell) {
491  return createEmptyDirective<OMPForSimdDirective>(
492  C, NumClauses, /*HasAssociatedStmt=*/true,
493  numLoopChildren(CollapsedNum, OMPD_for_simd), CollapsedNum);
494 }
495 
497  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
498  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
499  bool HasCancel) {
500  auto *Dir = createDirective<OMPSectionsDirective>(C, Clauses, AssociatedStmt,
501  /*NumChildren=*/1, StartLoc,
502  EndLoc);
503  Dir->setTaskReductionRefExpr(TaskRedRef);
504  Dir->setHasCancel(HasCancel);
505  return Dir;
506 }
507 
509  unsigned NumClauses,
510  EmptyShell) {
511  return createEmptyDirective<OMPSectionsDirective>(C, NumClauses,
512  /*HasAssociatedStmt=*/true,
513  /*NumChildren=*/1);
514 }
515 
517  SourceLocation StartLoc,
518  SourceLocation EndLoc,
519  Stmt *AssociatedStmt,
520  bool HasCancel) {
521  auto *Dir =
522  createDirective<OMPSectionDirective>(C, std::nullopt, AssociatedStmt,
523  /*NumChildren=*/0, StartLoc, EndLoc);
524  Dir->setHasCancel(HasCancel);
525  return Dir;
526 }
527 
529  EmptyShell) {
530  return createEmptyDirective<OMPSectionDirective>(C, /*NumClauses=*/0,
531  /*HasAssociatedStmt=*/true);
532 }
533 
535  SourceLocation StartLoc,
536  SourceLocation EndLoc,
537  ArrayRef<OMPClause *> Clauses,
538  Stmt *AssociatedStmt) {
539  return createDirective<OMPScopeDirective>(C, Clauses, AssociatedStmt,
540  /*NumChildren=*/0, StartLoc,
541  EndLoc);
542 }
543 
545  unsigned NumClauses,
546  EmptyShell) {
547  return createEmptyDirective<OMPScopeDirective>(C, NumClauses,
548  /*HasAssociatedStmt=*/true);
549 }
550 
552  SourceLocation StartLoc,
553  SourceLocation EndLoc,
554  ArrayRef<OMPClause *> Clauses,
555  Stmt *AssociatedStmt) {
556  return createDirective<OMPSingleDirective>(C, Clauses, AssociatedStmt,
557  /*NumChildren=*/0, StartLoc,
558  EndLoc);
559 }
560 
562  unsigned NumClauses,
563  EmptyShell) {
564  return createEmptyDirective<OMPSingleDirective>(C, NumClauses,
565  /*HasAssociatedStmt=*/true);
566 }
567 
569  SourceLocation StartLoc,
570  SourceLocation EndLoc,
571  Stmt *AssociatedStmt) {
572  return createDirective<OMPMasterDirective>(C, std::nullopt, AssociatedStmt,
573  /*NumChildren=*/0, StartLoc,
574  EndLoc);
575 }
576 
578  EmptyShell) {
579  return createEmptyDirective<OMPMasterDirective>(C, /*NumClauses=*/0,
580  /*HasAssociatedStmt=*/true);
581 }
582 
584  const ASTContext &C, const DeclarationNameInfo &Name,
585  SourceLocation StartLoc, SourceLocation EndLoc,
586  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
587  return createDirective<OMPCriticalDirective>(C, Clauses, AssociatedStmt,
588  /*NumChildren=*/0, Name,
589  StartLoc, EndLoc);
590 }
591 
593  unsigned NumClauses,
594  EmptyShell) {
595  return createEmptyDirective<OMPCriticalDirective>(C, NumClauses,
596  /*HasAssociatedStmt=*/true);
597 }
598 
600  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
601  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
602  const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
603  auto *Dir = createDirective<OMPParallelForDirective>(
604  C, Clauses, AssociatedStmt,
605  numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, StartLoc, EndLoc,
606  CollapsedNum);
607  Dir->setIterationVariable(Exprs.IterationVarRef);
608  Dir->setLastIteration(Exprs.LastIteration);
609  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
610  Dir->setPreCond(Exprs.PreCond);
611  Dir->setCond(Exprs.Cond);
612  Dir->setInit(Exprs.Init);
613  Dir->setInc(Exprs.Inc);
614  Dir->setIsLastIterVariable(Exprs.IL);
615  Dir->setLowerBoundVariable(Exprs.LB);
616  Dir->setUpperBoundVariable(Exprs.UB);
617  Dir->setStrideVariable(Exprs.ST);
618  Dir->setEnsureUpperBound(Exprs.EUB);
619  Dir->setNextLowerBound(Exprs.NLB);
620  Dir->setNextUpperBound(Exprs.NUB);
621  Dir->setNumIterations(Exprs.NumIterations);
622  Dir->setCounters(Exprs.Counters);
623  Dir->setPrivateCounters(Exprs.PrivateCounters);
624  Dir->setInits(Exprs.Inits);
625  Dir->setUpdates(Exprs.Updates);
626  Dir->setFinals(Exprs.Finals);
627  Dir->setDependentCounters(Exprs.DependentCounters);
628  Dir->setDependentInits(Exprs.DependentInits);
629  Dir->setFinalsConditions(Exprs.FinalsConditions);
630  Dir->setPreInits(Exprs.PreInits);
631  Dir->setTaskReductionRefExpr(TaskRedRef);
632  Dir->setHasCancel(HasCancel);
633  return Dir;
634 }
635 
637 OMPParallelForDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
638  unsigned CollapsedNum, EmptyShell) {
639  return createEmptyDirective<OMPParallelForDirective>(
640  C, NumClauses, /*HasAssociatedStmt=*/true,
641  numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, CollapsedNum);
642 }
643 
645  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
646  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
647  const HelperExprs &Exprs) {
648  auto *Dir = createDirective<OMPParallelForSimdDirective>(
649  C, Clauses, AssociatedStmt,
650  numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), StartLoc, EndLoc,
651  CollapsedNum);
652  Dir->setIterationVariable(Exprs.IterationVarRef);
653  Dir->setLastIteration(Exprs.LastIteration);
654  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
655  Dir->setPreCond(Exprs.PreCond);
656  Dir->setCond(Exprs.Cond);
657  Dir->setInit(Exprs.Init);
658  Dir->setInc(Exprs.Inc);
659  Dir->setIsLastIterVariable(Exprs.IL);
660  Dir->setLowerBoundVariable(Exprs.LB);
661  Dir->setUpperBoundVariable(Exprs.UB);
662  Dir->setStrideVariable(Exprs.ST);
663  Dir->setEnsureUpperBound(Exprs.EUB);
664  Dir->setNextLowerBound(Exprs.NLB);
665  Dir->setNextUpperBound(Exprs.NUB);
666  Dir->setNumIterations(Exprs.NumIterations);
667  Dir->setCounters(Exprs.Counters);
668  Dir->setPrivateCounters(Exprs.PrivateCounters);
669  Dir->setInits(Exprs.Inits);
670  Dir->setUpdates(Exprs.Updates);
671  Dir->setFinals(Exprs.Finals);
672  Dir->setDependentCounters(Exprs.DependentCounters);
673  Dir->setDependentInits(Exprs.DependentInits);
674  Dir->setFinalsConditions(Exprs.FinalsConditions);
675  Dir->setPreInits(Exprs.PreInits);
676  return Dir;
677 }
678 
681  unsigned NumClauses,
682  unsigned CollapsedNum, EmptyShell) {
683  return createEmptyDirective<OMPParallelForSimdDirective>(
684  C, NumClauses, /*HasAssociatedStmt=*/true,
685  numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), CollapsedNum);
686 }
687 
689  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
690  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) {
691  auto *Dir = createDirective<OMPParallelMasterDirective>(
692  C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
693  Dir->setTaskReductionRefExpr(TaskRedRef);
694  return Dir;
695 }
696 
699  unsigned NumClauses, EmptyShell) {
700  return createEmptyDirective<OMPParallelMasterDirective>(
701  C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
702 }
703 
705  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
706  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) {
707  auto *Dir = createDirective<OMPParallelMaskedDirective>(
708  C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
709  Dir->setTaskReductionRefExpr(TaskRedRef);
710  return Dir;
711 }
712 
715  unsigned NumClauses, EmptyShell) {
716  return createEmptyDirective<OMPParallelMaskedDirective>(
717  C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
718 }
719 
721  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
722  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
723  bool HasCancel) {
724  auto *Dir = createDirective<OMPParallelSectionsDirective>(
725  C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
726  Dir->setTaskReductionRefExpr(TaskRedRef);
727  Dir->setHasCancel(HasCancel);
728  return Dir;
729 }
730 
733  unsigned NumClauses, EmptyShell) {
734  return createEmptyDirective<OMPParallelSectionsDirective>(
735  C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
736 }
737 
740  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
741  Stmt *AssociatedStmt, bool HasCancel) {
742  auto *Dir = createDirective<OMPTaskDirective>(
743  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
744  Dir->setHasCancel(HasCancel);
745  return Dir;
746 }
747 
749  unsigned NumClauses,
750  EmptyShell) {
751  return createEmptyDirective<OMPTaskDirective>(C, NumClauses,
752  /*HasAssociatedStmt=*/true);
753 }
754 
756  SourceLocation StartLoc,
757  SourceLocation EndLoc) {
758  return new (C) OMPTaskyieldDirective(StartLoc, EndLoc);
759 }
760 
762  EmptyShell) {
763  return new (C) OMPTaskyieldDirective();
764 }
765 
767  SourceLocation StartLoc,
768  SourceLocation EndLoc,
769  ArrayRef<OMPClause *> Clauses) {
770  return createDirective<OMPErrorDirective>(
771  C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
772  EndLoc);
773 }
774 
776  unsigned NumClauses,
777  EmptyShell) {
778  return createEmptyDirective<OMPErrorDirective>(C, NumClauses);
779 }
780 
782  SourceLocation StartLoc,
783  SourceLocation EndLoc) {
784  return new (C) OMPBarrierDirective(StartLoc, EndLoc);
785 }
786 
788  EmptyShell) {
789  return new (C) OMPBarrierDirective();
790 }
791 
794  SourceLocation EndLoc,
795  ArrayRef<OMPClause *> Clauses) {
796  return createDirective<OMPTaskwaitDirective>(
797  C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
798  EndLoc);
799 }
800 
802  unsigned NumClauses,
803  EmptyShell) {
804  return createEmptyDirective<OMPTaskwaitDirective>(C, NumClauses);
805 }
806 
808  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
809  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) {
810  auto *Dir = createDirective<OMPTaskgroupDirective>(
811  C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
812  Dir->setReductionRef(ReductionRef);
813  return Dir;
814 }
815 
817  unsigned NumClauses,
818  EmptyShell) {
819  return createEmptyDirective<OMPTaskgroupDirective>(
820  C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
821 }
822 
824  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
825  OpenMPDirectiveKind CancelRegion) {
826  auto *Dir = new (C) OMPCancellationPointDirective(StartLoc, EndLoc);
827  Dir->setCancelRegion(CancelRegion);
828  return Dir;
829 }
830 
833  return new (C) OMPCancellationPointDirective();
834 }
835 
838  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
839  OpenMPDirectiveKind CancelRegion) {
840  auto *Dir = createDirective<OMPCancelDirective>(
841  C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
842  EndLoc);
843  Dir->setCancelRegion(CancelRegion);
844  return Dir;
845 }
846 
848  unsigned NumClauses,
849  EmptyShell) {
850  return createEmptyDirective<OMPCancelDirective>(C, NumClauses);
851 }
852 
854  SourceLocation StartLoc,
855  SourceLocation EndLoc,
856  ArrayRef<OMPClause *> Clauses) {
857  return createDirective<OMPFlushDirective>(
858  C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
859  EndLoc);
860 }
861 
863  unsigned NumClauses,
864  EmptyShell) {
865  return createEmptyDirective<OMPFlushDirective>(C, NumClauses);
866 }
867 
869  SourceLocation StartLoc,
870  SourceLocation EndLoc,
871  ArrayRef<OMPClause *> Clauses) {
872  return createDirective<OMPDepobjDirective>(
873  C, Clauses, /*AssociatedStmt=*/nullptr,
874  /*NumChildren=*/0, StartLoc, EndLoc);
875 }
876 
878  unsigned NumClauses,
879  EmptyShell) {
880  return createEmptyDirective<OMPDepobjDirective>(C, NumClauses);
881 }
882 
884  SourceLocation StartLoc,
885  SourceLocation EndLoc,
886  ArrayRef<OMPClause *> Clauses) {
887  return createDirective<OMPScanDirective>(C, Clauses,
888  /*AssociatedStmt=*/nullptr,
889  /*NumChildren=*/0, StartLoc, EndLoc);
890 }
891 
893  unsigned NumClauses,
894  EmptyShell) {
895  return createEmptyDirective<OMPScanDirective>(C, NumClauses);
896 }
897 
899  SourceLocation StartLoc,
900  SourceLocation EndLoc,
901  ArrayRef<OMPClause *> Clauses,
902  Stmt *AssociatedStmt) {
903  return createDirective<OMPOrderedDirective>(
904  C, Clauses, cast_or_null<CapturedStmt>(AssociatedStmt),
905  /*NumChildren=*/0, StartLoc, EndLoc);
906 }
907 
909  unsigned NumClauses,
910  bool IsStandalone,
911  EmptyShell) {
912  return createEmptyDirective<OMPOrderedDirective>(C, NumClauses,
913  !IsStandalone);
914 }
915 
918  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
919  Stmt *AssociatedStmt, Expressions Exprs) {
920  auto *Dir = createDirective<OMPAtomicDirective>(
921  C, Clauses, AssociatedStmt, /*NumChildren=*/7, StartLoc, EndLoc);
922  Dir->setX(Exprs.X);
923  Dir->setV(Exprs.V);
924  Dir->setR(Exprs.R);
925  Dir->setExpr(Exprs.E);
926  Dir->setUpdateExpr(Exprs.UE);
927  Dir->setD(Exprs.D);
928  Dir->setCond(Exprs.Cond);
929  Dir->Flags.IsXLHSInRHSPart = Exprs.IsXLHSInRHSPart ? 1 : 0;
930  Dir->Flags.IsPostfixUpdate = Exprs.IsPostfixUpdate ? 1 : 0;
931  Dir->Flags.IsFailOnly = Exprs.IsFailOnly ? 1 : 0;
932  return Dir;
933 }
934 
936  unsigned NumClauses,
937  EmptyShell) {
938  return createEmptyDirective<OMPAtomicDirective>(
939  C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/7);
940 }
941 
943  SourceLocation StartLoc,
944  SourceLocation EndLoc,
945  ArrayRef<OMPClause *> Clauses,
946  Stmt *AssociatedStmt) {
947  return createDirective<OMPTargetDirective>(
948  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
949 }
950 
952  unsigned NumClauses,
953  EmptyShell) {
954  return createEmptyDirective<OMPTargetDirective>(C, NumClauses,
955  /*HasAssociatedStmt=*/true);
956 }
957 
959  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
960  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
961  bool HasCancel) {
962  auto *Dir = createDirective<OMPTargetParallelDirective>(
963  C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
964  Dir->setTaskReductionRefExpr(TaskRedRef);
965  Dir->setHasCancel(HasCancel);
966  return Dir;
967 }
968 
971  unsigned NumClauses, EmptyShell) {
972  return createEmptyDirective<OMPTargetParallelDirective>(
973  C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
974 }
975 
977  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
978  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
979  const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
980  auto *Dir = createDirective<OMPTargetParallelForDirective>(
981  C, Clauses, AssociatedStmt,
982  numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1, StartLoc,
983  EndLoc, CollapsedNum);
984  Dir->setIterationVariable(Exprs.IterationVarRef);
985  Dir->setLastIteration(Exprs.LastIteration);
986  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
987  Dir->setPreCond(Exprs.PreCond);
988  Dir->setCond(Exprs.Cond);
989  Dir->setInit(Exprs.Init);
990  Dir->setInc(Exprs.Inc);
991  Dir->setIsLastIterVariable(Exprs.IL);
992  Dir->setLowerBoundVariable(Exprs.LB);
993  Dir->setUpperBoundVariable(Exprs.UB);
994  Dir->setStrideVariable(Exprs.ST);
995  Dir->setEnsureUpperBound(Exprs.EUB);
996  Dir->setNextLowerBound(Exprs.NLB);
997  Dir->setNextUpperBound(Exprs.NUB);
998  Dir->setNumIterations(Exprs.NumIterations);
999  Dir->setCounters(Exprs.Counters);
1000  Dir->setPrivateCounters(Exprs.PrivateCounters);
1001  Dir->setInits(Exprs.Inits);
1002  Dir->setUpdates(Exprs.Updates);
1003  Dir->setFinals(Exprs.Finals);
1004  Dir->setDependentCounters(Exprs.DependentCounters);
1005  Dir->setDependentInits(Exprs.DependentInits);
1006  Dir->setFinalsConditions(Exprs.FinalsConditions);
1007  Dir->setPreInits(Exprs.PreInits);
1008  Dir->setTaskReductionRefExpr(TaskRedRef);
1009  Dir->setHasCancel(HasCancel);
1010  return Dir;
1011 }
1012 
1015  unsigned NumClauses,
1016  unsigned CollapsedNum, EmptyShell) {
1017  return createEmptyDirective<OMPTargetParallelForDirective>(
1018  C, NumClauses, /*HasAssociatedStmt=*/true,
1019  numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1,
1020  CollapsedNum);
1021 }
1022 
1024  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1025  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1026  return createDirective<OMPTargetDataDirective>(
1027  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1028 }
1029 
1031  unsigned N,
1032  EmptyShell) {
1033  return createEmptyDirective<OMPTargetDataDirective>(
1034  C, N, /*HasAssociatedStmt=*/true);
1035 }
1036 
1038  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1039  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1040  return createDirective<OMPTargetEnterDataDirective>(
1041  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1042 }
1043 
1046  EmptyShell) {
1047  return createEmptyDirective<OMPTargetEnterDataDirective>(
1048  C, N, /*HasAssociatedStmt=*/true);
1049 }
1050 
1052  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1053  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1054  return createDirective<OMPTargetExitDataDirective>(
1055  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1056 }
1057 
1060  EmptyShell) {
1061  return createEmptyDirective<OMPTargetExitDataDirective>(
1062  C, N, /*HasAssociatedStmt=*/true);
1063 }
1064 
1066  SourceLocation StartLoc,
1067  SourceLocation EndLoc,
1068  ArrayRef<OMPClause *> Clauses,
1069  Stmt *AssociatedStmt) {
1070  return createDirective<OMPTeamsDirective>(
1071  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1072 }
1073 
1075  unsigned NumClauses,
1076  EmptyShell) {
1077  return createEmptyDirective<OMPTeamsDirective>(C, NumClauses,
1078  /*HasAssociatedStmt=*/true);
1079 }
1080 
1082  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1083  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1084  const HelperExprs &Exprs, bool HasCancel) {
1085  auto *Dir = createDirective<OMPTaskLoopDirective>(
1086  C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_taskloop),
1087  StartLoc, EndLoc, CollapsedNum);
1088  Dir->setIterationVariable(Exprs.IterationVarRef);
1089  Dir->setLastIteration(Exprs.LastIteration);
1090  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1091  Dir->setPreCond(Exprs.PreCond);
1092  Dir->setCond(Exprs.Cond);
1093  Dir->setInit(Exprs.Init);
1094  Dir->setInc(Exprs.Inc);
1095  Dir->setIsLastIterVariable(Exprs.IL);
1096  Dir->setLowerBoundVariable(Exprs.LB);
1097  Dir->setUpperBoundVariable(Exprs.UB);
1098  Dir->setStrideVariable(Exprs.ST);
1099  Dir->setEnsureUpperBound(Exprs.EUB);
1100  Dir->setNextLowerBound(Exprs.NLB);
1101  Dir->setNextUpperBound(Exprs.NUB);
1102  Dir->setNumIterations(Exprs.NumIterations);
1103  Dir->setCounters(Exprs.Counters);
1104  Dir->setPrivateCounters(Exprs.PrivateCounters);
1105  Dir->setInits(Exprs.Inits);
1106  Dir->setUpdates(Exprs.Updates);
1107  Dir->setFinals(Exprs.Finals);
1108  Dir->setDependentCounters(Exprs.DependentCounters);
1109  Dir->setDependentInits(Exprs.DependentInits);
1110  Dir->setFinalsConditions(Exprs.FinalsConditions);
1111  Dir->setPreInits(Exprs.PreInits);
1112  Dir->setHasCancel(HasCancel);
1113  return Dir;
1114 }
1115 
1117  unsigned NumClauses,
1118  unsigned CollapsedNum,
1119  EmptyShell) {
1120  return createEmptyDirective<OMPTaskLoopDirective>(
1121  C, NumClauses, /*HasAssociatedStmt=*/true,
1122  numLoopChildren(CollapsedNum, OMPD_taskloop), CollapsedNum);
1123 }
1124 
1126  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1127  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1128  const HelperExprs &Exprs) {
1129  auto *Dir = createDirective<OMPTaskLoopSimdDirective>(
1130  C, Clauses, AssociatedStmt,
1131  numLoopChildren(CollapsedNum, OMPD_taskloop_simd), StartLoc, EndLoc,
1132  CollapsedNum);
1133  Dir->setIterationVariable(Exprs.IterationVarRef);
1134  Dir->setLastIteration(Exprs.LastIteration);
1135  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1136  Dir->setPreCond(Exprs.PreCond);
1137  Dir->setCond(Exprs.Cond);
1138  Dir->setInit(Exprs.Init);
1139  Dir->setInc(Exprs.Inc);
1140  Dir->setIsLastIterVariable(Exprs.IL);
1141  Dir->setLowerBoundVariable(Exprs.LB);
1142  Dir->setUpperBoundVariable(Exprs.UB);
1143  Dir->setStrideVariable(Exprs.ST);
1144  Dir->setEnsureUpperBound(Exprs.EUB);
1145  Dir->setNextLowerBound(Exprs.NLB);
1146  Dir->setNextUpperBound(Exprs.NUB);
1147  Dir->setNumIterations(Exprs.NumIterations);
1148  Dir->setCounters(Exprs.Counters);
1149  Dir->setPrivateCounters(Exprs.PrivateCounters);
1150  Dir->setInits(Exprs.Inits);
1151  Dir->setUpdates(Exprs.Updates);
1152  Dir->setFinals(Exprs.Finals);
1153  Dir->setDependentCounters(Exprs.DependentCounters);
1154  Dir->setDependentInits(Exprs.DependentInits);
1155  Dir->setFinalsConditions(Exprs.FinalsConditions);
1156  Dir->setPreInits(Exprs.PreInits);
1157  return Dir;
1158 }
1159 
1162  unsigned CollapsedNum, EmptyShell) {
1163  return createEmptyDirective<OMPTaskLoopSimdDirective>(
1164  C, NumClauses, /*HasAssociatedStmt=*/true,
1165  numLoopChildren(CollapsedNum, OMPD_taskloop_simd), CollapsedNum);
1166 }
1167 
1169  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1170  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1171  const HelperExprs &Exprs, bool HasCancel) {
1172  auto *Dir = createDirective<OMPMasterTaskLoopDirective>(
1173  C, Clauses, AssociatedStmt,
1174  numLoopChildren(CollapsedNum, OMPD_master_taskloop), StartLoc, EndLoc,
1175  CollapsedNum);
1176  Dir->setIterationVariable(Exprs.IterationVarRef);
1177  Dir->setLastIteration(Exprs.LastIteration);
1178  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1179  Dir->setPreCond(Exprs.PreCond);
1180  Dir->setCond(Exprs.Cond);
1181  Dir->setInit(Exprs.Init);
1182  Dir->setInc(Exprs.Inc);
1183  Dir->setIsLastIterVariable(Exprs.IL);
1184  Dir->setLowerBoundVariable(Exprs.LB);
1185  Dir->setUpperBoundVariable(Exprs.UB);
1186  Dir->setStrideVariable(Exprs.ST);
1187  Dir->setEnsureUpperBound(Exprs.EUB);
1188  Dir->setNextLowerBound(Exprs.NLB);
1189  Dir->setNextUpperBound(Exprs.NUB);
1190  Dir->setNumIterations(Exprs.NumIterations);
1191  Dir->setCounters(Exprs.Counters);
1192  Dir->setPrivateCounters(Exprs.PrivateCounters);
1193  Dir->setInits(Exprs.Inits);
1194  Dir->setUpdates(Exprs.Updates);
1195  Dir->setFinals(Exprs.Finals);
1196  Dir->setDependentCounters(Exprs.DependentCounters);
1197  Dir->setDependentInits(Exprs.DependentInits);
1198  Dir->setFinalsConditions(Exprs.FinalsConditions);
1199  Dir->setPreInits(Exprs.PreInits);
1200  Dir->setHasCancel(HasCancel);
1201  return Dir;
1202 }
1203 
1206  unsigned NumClauses,
1207  unsigned CollapsedNum, EmptyShell) {
1208  return createEmptyDirective<OMPMasterTaskLoopDirective>(
1209  C, NumClauses, /*HasAssociatedStmt=*/true,
1210  numLoopChildren(CollapsedNum, OMPD_master_taskloop), CollapsedNum);
1211 }
1212 
1214  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1215  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1216  const HelperExprs &Exprs, bool HasCancel) {
1217  auto *Dir = createDirective<OMPMaskedTaskLoopDirective>(
1218  C, Clauses, AssociatedStmt,
1219  numLoopChildren(CollapsedNum, OMPD_masked_taskloop), StartLoc, EndLoc,
1220  CollapsedNum);
1221  Dir->setIterationVariable(Exprs.IterationVarRef);
1222  Dir->setLastIteration(Exprs.LastIteration);
1223  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1224  Dir->setPreCond(Exprs.PreCond);
1225  Dir->setCond(Exprs.Cond);
1226  Dir->setInit(Exprs.Init);
1227  Dir->setInc(Exprs.Inc);
1228  Dir->setIsLastIterVariable(Exprs.IL);
1229  Dir->setLowerBoundVariable(Exprs.LB);
1230  Dir->setUpperBoundVariable(Exprs.UB);
1231  Dir->setStrideVariable(Exprs.ST);
1232  Dir->setEnsureUpperBound(Exprs.EUB);
1233  Dir->setNextLowerBound(Exprs.NLB);
1234  Dir->setNextUpperBound(Exprs.NUB);
1235  Dir->setNumIterations(Exprs.NumIterations);
1236  Dir->setCounters(Exprs.Counters);
1237  Dir->setPrivateCounters(Exprs.PrivateCounters);
1238  Dir->setInits(Exprs.Inits);
1239  Dir->setUpdates(Exprs.Updates);
1240  Dir->setFinals(Exprs.Finals);
1241  Dir->setDependentCounters(Exprs.DependentCounters);
1242  Dir->setDependentInits(Exprs.DependentInits);
1243  Dir->setFinalsConditions(Exprs.FinalsConditions);
1244  Dir->setPreInits(Exprs.PreInits);
1245  Dir->setHasCancel(HasCancel);
1246  return Dir;
1247 }
1248 
1251  unsigned NumClauses,
1252  unsigned CollapsedNum, EmptyShell) {
1253  return createEmptyDirective<OMPMaskedTaskLoopDirective>(
1254  C, NumClauses, /*HasAssociatedStmt=*/true,
1255  numLoopChildren(CollapsedNum, OMPD_masked_taskloop), CollapsedNum);
1256 }
1257 
1259  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1260  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1261  const HelperExprs &Exprs) {
1262  auto *Dir = createDirective<OMPMasterTaskLoopSimdDirective>(
1263  C, Clauses, AssociatedStmt,
1264  numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), StartLoc,
1265  EndLoc, CollapsedNum);
1266  Dir->setIterationVariable(Exprs.IterationVarRef);
1267  Dir->setLastIteration(Exprs.LastIteration);
1268  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1269  Dir->setPreCond(Exprs.PreCond);
1270  Dir->setCond(Exprs.Cond);
1271  Dir->setInit(Exprs.Init);
1272  Dir->setInc(Exprs.Inc);
1273  Dir->setIsLastIterVariable(Exprs.IL);
1274  Dir->setLowerBoundVariable(Exprs.LB);
1275  Dir->setUpperBoundVariable(Exprs.UB);
1276  Dir->setStrideVariable(Exprs.ST);
1277  Dir->setEnsureUpperBound(Exprs.EUB);
1278  Dir->setNextLowerBound(Exprs.NLB);
1279  Dir->setNextUpperBound(Exprs.NUB);
1280  Dir->setNumIterations(Exprs.NumIterations);
1281  Dir->setCounters(Exprs.Counters);
1282  Dir->setPrivateCounters(Exprs.PrivateCounters);
1283  Dir->setInits(Exprs.Inits);
1284  Dir->setUpdates(Exprs.Updates);
1285  Dir->setFinals(Exprs.Finals);
1286  Dir->setDependentCounters(Exprs.DependentCounters);
1287  Dir->setDependentInits(Exprs.DependentInits);
1288  Dir->setFinalsConditions(Exprs.FinalsConditions);
1289  Dir->setPreInits(Exprs.PreInits);
1290  return Dir;
1291 }
1292 
1295  unsigned NumClauses,
1296  unsigned CollapsedNum, EmptyShell) {
1297  return createEmptyDirective<OMPMasterTaskLoopSimdDirective>(
1298  C, NumClauses, /*HasAssociatedStmt=*/true,
1299  numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), CollapsedNum);
1300 }
1301 
1303  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1304  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1305  const HelperExprs &Exprs) {
1306  auto *Dir = createDirective<OMPMaskedTaskLoopSimdDirective>(
1307  C, Clauses, AssociatedStmt,
1308  numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), StartLoc,
1309  EndLoc, CollapsedNum);
1310  Dir->setIterationVariable(Exprs.IterationVarRef);
1311  Dir->setLastIteration(Exprs.LastIteration);
1312  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1313  Dir->setPreCond(Exprs.PreCond);
1314  Dir->setCond(Exprs.Cond);
1315  Dir->setInit(Exprs.Init);
1316  Dir->setInc(Exprs.Inc);
1317  Dir->setIsLastIterVariable(Exprs.IL);
1318  Dir->setLowerBoundVariable(Exprs.LB);
1319  Dir->setUpperBoundVariable(Exprs.UB);
1320  Dir->setStrideVariable(Exprs.ST);
1321  Dir->setEnsureUpperBound(Exprs.EUB);
1322  Dir->setNextLowerBound(Exprs.NLB);
1323  Dir->setNextUpperBound(Exprs.NUB);
1324  Dir->setNumIterations(Exprs.NumIterations);
1325  Dir->setCounters(Exprs.Counters);
1326  Dir->setPrivateCounters(Exprs.PrivateCounters);
1327  Dir->setInits(Exprs.Inits);
1328  Dir->setUpdates(Exprs.Updates);
1329  Dir->setFinals(Exprs.Finals);
1330  Dir->setDependentCounters(Exprs.DependentCounters);
1331  Dir->setDependentInits(Exprs.DependentInits);
1332  Dir->setFinalsConditions(Exprs.FinalsConditions);
1333  Dir->setPreInits(Exprs.PreInits);
1334  return Dir;
1335 }
1336 
1339  unsigned NumClauses,
1340  unsigned CollapsedNum, EmptyShell) {
1341  return createEmptyDirective<OMPMaskedTaskLoopSimdDirective>(
1342  C, NumClauses, /*HasAssociatedStmt=*/true,
1343  numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), CollapsedNum);
1344 }
1345 
1347  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1348  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1349  const HelperExprs &Exprs, bool HasCancel) {
1350  auto *Dir = createDirective<OMPParallelMasterTaskLoopDirective>(
1351  C, Clauses, AssociatedStmt,
1352  numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop), StartLoc,
1353  EndLoc, CollapsedNum);
1354  Dir->setIterationVariable(Exprs.IterationVarRef);
1355  Dir->setLastIteration(Exprs.LastIteration);
1356  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1357  Dir->setPreCond(Exprs.PreCond);
1358  Dir->setCond(Exprs.Cond);
1359  Dir->setInit(Exprs.Init);
1360  Dir->setInc(Exprs.Inc);
1361  Dir->setIsLastIterVariable(Exprs.IL);
1362  Dir->setLowerBoundVariable(Exprs.LB);
1363  Dir->setUpperBoundVariable(Exprs.UB);
1364  Dir->setStrideVariable(Exprs.ST);
1365  Dir->setEnsureUpperBound(Exprs.EUB);
1366  Dir->setNextLowerBound(Exprs.NLB);
1367  Dir->setNextUpperBound(Exprs.NUB);
1368  Dir->setNumIterations(Exprs.NumIterations);
1369  Dir->setCounters(Exprs.Counters);
1370  Dir->setPrivateCounters(Exprs.PrivateCounters);
1371  Dir->setInits(Exprs.Inits);
1372  Dir->setUpdates(Exprs.Updates);
1373  Dir->setFinals(Exprs.Finals);
1374  Dir->setDependentCounters(Exprs.DependentCounters);
1375  Dir->setDependentInits(Exprs.DependentInits);
1376  Dir->setFinalsConditions(Exprs.FinalsConditions);
1377  Dir->setPreInits(Exprs.PreInits);
1378  Dir->setHasCancel(HasCancel);
1379  return Dir;
1380 }
1381 
1384  unsigned NumClauses,
1385  unsigned CollapsedNum,
1386  EmptyShell) {
1387  return createEmptyDirective<OMPParallelMasterTaskLoopDirective>(
1388  C, NumClauses, /*HasAssociatedStmt=*/true,
1389  numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop),
1390  CollapsedNum);
1391 }
1392 
1394  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1395  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1396  const HelperExprs &Exprs, bool HasCancel) {
1397  auto *Dir = createDirective<OMPParallelMaskedTaskLoopDirective>(
1398  C, Clauses, AssociatedStmt,
1399  numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop), StartLoc,
1400  EndLoc, CollapsedNum);
1401  Dir->setIterationVariable(Exprs.IterationVarRef);
1402  Dir->setLastIteration(Exprs.LastIteration);
1403  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1404  Dir->setPreCond(Exprs.PreCond);
1405  Dir->setCond(Exprs.Cond);
1406  Dir->setInit(Exprs.Init);
1407  Dir->setInc(Exprs.Inc);
1408  Dir->setIsLastIterVariable(Exprs.IL);
1409  Dir->setLowerBoundVariable(Exprs.LB);
1410  Dir->setUpperBoundVariable(Exprs.UB);
1411  Dir->setStrideVariable(Exprs.ST);
1412  Dir->setEnsureUpperBound(Exprs.EUB);
1413  Dir->setNextLowerBound(Exprs.NLB);
1414  Dir->setNextUpperBound(Exprs.NUB);
1415  Dir->setNumIterations(Exprs.NumIterations);
1416  Dir->setCounters(Exprs.Counters);
1417  Dir->setPrivateCounters(Exprs.PrivateCounters);
1418  Dir->setInits(Exprs.Inits);
1419  Dir->setUpdates(Exprs.Updates);
1420  Dir->setFinals(Exprs.Finals);
1421  Dir->setDependentCounters(Exprs.DependentCounters);
1422  Dir->setDependentInits(Exprs.DependentInits);
1423  Dir->setFinalsConditions(Exprs.FinalsConditions);
1424  Dir->setPreInits(Exprs.PreInits);
1425  Dir->setHasCancel(HasCancel);
1426  return Dir;
1427 }
1428 
1431  unsigned NumClauses,
1432  unsigned CollapsedNum,
1433  EmptyShell) {
1434  return createEmptyDirective<OMPParallelMaskedTaskLoopDirective>(
1435  C, NumClauses, /*HasAssociatedStmt=*/true,
1436  numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop),
1437  CollapsedNum);
1438 }
1439 
1442  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1443  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1444  const HelperExprs &Exprs) {
1445  auto *Dir = createDirective<OMPParallelMasterTaskLoopSimdDirective>(
1446  C, Clauses, AssociatedStmt,
1447  numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),
1448  StartLoc, EndLoc, CollapsedNum);
1449  Dir->setIterationVariable(Exprs.IterationVarRef);
1450  Dir->setLastIteration(Exprs.LastIteration);
1451  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1452  Dir->setPreCond(Exprs.PreCond);
1453  Dir->setCond(Exprs.Cond);
1454  Dir->setInit(Exprs.Init);
1455  Dir->setInc(Exprs.Inc);
1456  Dir->setIsLastIterVariable(Exprs.IL);
1457  Dir->setLowerBoundVariable(Exprs.LB);
1458  Dir->setUpperBoundVariable(Exprs.UB);
1459  Dir->setStrideVariable(Exprs.ST);
1460  Dir->setEnsureUpperBound(Exprs.EUB);
1461  Dir->setNextLowerBound(Exprs.NLB);
1462  Dir->setNextUpperBound(Exprs.NUB);
1463  Dir->setNumIterations(Exprs.NumIterations);
1464  Dir->setCounters(Exprs.Counters);
1465  Dir->setPrivateCounters(Exprs.PrivateCounters);
1466  Dir->setInits(Exprs.Inits);
1467  Dir->setUpdates(Exprs.Updates);
1468  Dir->setFinals(Exprs.Finals);
1469  Dir->setDependentCounters(Exprs.DependentCounters);
1470  Dir->setDependentInits(Exprs.DependentInits);
1471  Dir->setFinalsConditions(Exprs.FinalsConditions);
1472  Dir->setPreInits(Exprs.PreInits);
1473  return Dir;
1474 }
1475 
1478  unsigned NumClauses,
1479  unsigned CollapsedNum,
1480  EmptyShell) {
1481  return createEmptyDirective<OMPParallelMasterTaskLoopSimdDirective>(
1482  C, NumClauses, /*HasAssociatedStmt=*/true,
1483  numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),
1484  CollapsedNum);
1485 }
1486 
1489  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1490  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1491  const HelperExprs &Exprs) {
1492  auto *Dir = createDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1493  C, Clauses, AssociatedStmt,
1494  numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd),
1495  StartLoc, EndLoc, CollapsedNum);
1496  Dir->setIterationVariable(Exprs.IterationVarRef);
1497  Dir->setLastIteration(Exprs.LastIteration);
1498  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1499  Dir->setPreCond(Exprs.PreCond);
1500  Dir->setCond(Exprs.Cond);
1501  Dir->setInit(Exprs.Init);
1502  Dir->setInc(Exprs.Inc);
1503  Dir->setIsLastIterVariable(Exprs.IL);
1504  Dir->setLowerBoundVariable(Exprs.LB);
1505  Dir->setUpperBoundVariable(Exprs.UB);
1506  Dir->setStrideVariable(Exprs.ST);
1507  Dir->setEnsureUpperBound(Exprs.EUB);
1508  Dir->setNextLowerBound(Exprs.NLB);
1509  Dir->setNextUpperBound(Exprs.NUB);
1510  Dir->setNumIterations(Exprs.NumIterations);
1511  Dir->setCounters(Exprs.Counters);
1512  Dir->setPrivateCounters(Exprs.PrivateCounters);
1513  Dir->setInits(Exprs.Inits);
1514  Dir->setUpdates(Exprs.Updates);
1515  Dir->setFinals(Exprs.Finals);
1516  Dir->setDependentCounters(Exprs.DependentCounters);
1517  Dir->setDependentInits(Exprs.DependentInits);
1518  Dir->setFinalsConditions(Exprs.FinalsConditions);
1519  Dir->setPreInits(Exprs.PreInits);
1520  return Dir;
1521 }
1522 
1525  unsigned NumClauses,
1526  unsigned CollapsedNum,
1527  EmptyShell) {
1528  return createEmptyDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1529  C, NumClauses, /*HasAssociatedStmt=*/true,
1530  numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd),
1531  CollapsedNum);
1532 }
1533 
1535  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1536  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1537  const HelperExprs &Exprs, OpenMPDirectiveKind ParamPrevMappedDirective) {
1538  auto *Dir = createDirective<OMPDistributeDirective>(
1539  C, Clauses, AssociatedStmt,
1540  numLoopChildren(CollapsedNum, OMPD_distribute), StartLoc, EndLoc,
1541  CollapsedNum);
1542  Dir->setIterationVariable(Exprs.IterationVarRef);
1543  Dir->setLastIteration(Exprs.LastIteration);
1544  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1545  Dir->setPreCond(Exprs.PreCond);
1546  Dir->setCond(Exprs.Cond);
1547  Dir->setInit(Exprs.Init);
1548  Dir->setInc(Exprs.Inc);
1549  Dir->setIsLastIterVariable(Exprs.IL);
1550  Dir->setLowerBoundVariable(Exprs.LB);
1551  Dir->setUpperBoundVariable(Exprs.UB);
1552  Dir->setStrideVariable(Exprs.ST);
1553  Dir->setEnsureUpperBound(Exprs.EUB);
1554  Dir->setNextLowerBound(Exprs.NLB);
1555  Dir->setNextUpperBound(Exprs.NUB);
1556  Dir->setNumIterations(Exprs.NumIterations);
1557  Dir->setCounters(Exprs.Counters);
1558  Dir->setPrivateCounters(Exprs.PrivateCounters);
1559  Dir->setInits(Exprs.Inits);
1560  Dir->setUpdates(Exprs.Updates);
1561  Dir->setFinals(Exprs.Finals);
1562  Dir->setDependentCounters(Exprs.DependentCounters);
1563  Dir->setDependentInits(Exprs.DependentInits);
1564  Dir->setFinalsConditions(Exprs.FinalsConditions);
1565  Dir->setPreInits(Exprs.PreInits);
1566  Dir->setMappedDirective(ParamPrevMappedDirective);
1567  return Dir;
1568 }
1569 
1571 OMPDistributeDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
1572  unsigned CollapsedNum, EmptyShell) {
1573  return createEmptyDirective<OMPDistributeDirective>(
1574  C, NumClauses, /*HasAssociatedStmt=*/true,
1575  numLoopChildren(CollapsedNum, OMPD_distribute), CollapsedNum);
1576 }
1577 
1579  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1580  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1581  return createDirective<OMPTargetUpdateDirective>(C, Clauses, AssociatedStmt,
1582  /*NumChildren=*/0, StartLoc,
1583  EndLoc);
1584 }
1585 
1588  EmptyShell) {
1589  return createEmptyDirective<OMPTargetUpdateDirective>(
1590  C, NumClauses, /*HasAssociatedStmt=*/true);
1591 }
1592 
1594  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1595  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1596  const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1597  auto *Dir = createDirective<OMPDistributeParallelForDirective>(
1598  C, Clauses, AssociatedStmt,
1599  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1, StartLoc,
1600  EndLoc, CollapsedNum);
1601  Dir->setIterationVariable(Exprs.IterationVarRef);
1602  Dir->setLastIteration(Exprs.LastIteration);
1603  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1604  Dir->setPreCond(Exprs.PreCond);
1605  Dir->setCond(Exprs.Cond);
1606  Dir->setInit(Exprs.Init);
1607  Dir->setInc(Exprs.Inc);
1608  Dir->setIsLastIterVariable(Exprs.IL);
1609  Dir->setLowerBoundVariable(Exprs.LB);
1610  Dir->setUpperBoundVariable(Exprs.UB);
1611  Dir->setStrideVariable(Exprs.ST);
1612  Dir->setEnsureUpperBound(Exprs.EUB);
1613  Dir->setNextLowerBound(Exprs.NLB);
1614  Dir->setNextUpperBound(Exprs.NUB);
1615  Dir->setNumIterations(Exprs.NumIterations);
1616  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1617  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1618  Dir->setDistInc(Exprs.DistInc);
1619  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1620  Dir->setCounters(Exprs.Counters);
1621  Dir->setPrivateCounters(Exprs.PrivateCounters);
1622  Dir->setInits(Exprs.Inits);
1623  Dir->setUpdates(Exprs.Updates);
1624  Dir->setFinals(Exprs.Finals);
1625  Dir->setDependentCounters(Exprs.DependentCounters);
1626  Dir->setDependentInits(Exprs.DependentInits);
1627  Dir->setFinalsConditions(Exprs.FinalsConditions);
1628  Dir->setPreInits(Exprs.PreInits);
1629  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1630  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1631  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1632  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1633  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1634  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1635  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1636  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1637  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1638  Dir->setTaskReductionRefExpr(TaskRedRef);
1639  Dir->HasCancel = HasCancel;
1640  return Dir;
1641 }
1642 
1645  unsigned NumClauses,
1646  unsigned CollapsedNum,
1647  EmptyShell) {
1648  return createEmptyDirective<OMPDistributeParallelForDirective>(
1649  C, NumClauses, /*HasAssociatedStmt=*/true,
1650  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1,
1651  CollapsedNum);
1652 }
1653 
1656  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1657  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1658  const HelperExprs &Exprs) {
1659  auto *Dir = createDirective<OMPDistributeParallelForSimdDirective>(
1660  C, Clauses, AssociatedStmt,
1661  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),
1662  StartLoc, EndLoc, CollapsedNum);
1663  Dir->setIterationVariable(Exprs.IterationVarRef);
1664  Dir->setLastIteration(Exprs.LastIteration);
1665  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1666  Dir->setPreCond(Exprs.PreCond);
1667  Dir->setCond(Exprs.Cond);
1668  Dir->setInit(Exprs.Init);
1669  Dir->setInc(Exprs.Inc);
1670  Dir->setIsLastIterVariable(Exprs.IL);
1671  Dir->setLowerBoundVariable(Exprs.LB);
1672  Dir->setUpperBoundVariable(Exprs.UB);
1673  Dir->setStrideVariable(Exprs.ST);
1674  Dir->setEnsureUpperBound(Exprs.EUB);
1675  Dir->setNextLowerBound(Exprs.NLB);
1676  Dir->setNextUpperBound(Exprs.NUB);
1677  Dir->setNumIterations(Exprs.NumIterations);
1678  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1679  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1680  Dir->setDistInc(Exprs.DistInc);
1681  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1682  Dir->setCounters(Exprs.Counters);
1683  Dir->setPrivateCounters(Exprs.PrivateCounters);
1684  Dir->setInits(Exprs.Inits);
1685  Dir->setUpdates(Exprs.Updates);
1686  Dir->setFinals(Exprs.Finals);
1687  Dir->setDependentCounters(Exprs.DependentCounters);
1688  Dir->setDependentInits(Exprs.DependentInits);
1689  Dir->setFinalsConditions(Exprs.FinalsConditions);
1690  Dir->setPreInits(Exprs.PreInits);
1691  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1692  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1693  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1694  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1695  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1696  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1697  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1698  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1699  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1700  return Dir;
1701 }
1702 
1705  unsigned NumClauses,
1706  unsigned CollapsedNum,
1707  EmptyShell) {
1708  return createEmptyDirective<OMPDistributeParallelForSimdDirective>(
1709  C, NumClauses, /*HasAssociatedStmt=*/true,
1710  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),
1711  CollapsedNum);
1712 }
1713 
1715  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1716  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1717  const HelperExprs &Exprs) {
1718  auto *Dir = createDirective<OMPDistributeSimdDirective>(
1719  C, Clauses, AssociatedStmt,
1720  numLoopChildren(CollapsedNum, OMPD_distribute_simd), StartLoc, EndLoc,
1721  CollapsedNum);
1722  Dir->setIterationVariable(Exprs.IterationVarRef);
1723  Dir->setLastIteration(Exprs.LastIteration);
1724  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1725  Dir->setPreCond(Exprs.PreCond);
1726  Dir->setCond(Exprs.Cond);
1727  Dir->setInit(Exprs.Init);
1728  Dir->setInc(Exprs.Inc);
1729  Dir->setIsLastIterVariable(Exprs.IL);
1730  Dir->setLowerBoundVariable(Exprs.LB);
1731  Dir->setUpperBoundVariable(Exprs.UB);
1732  Dir->setStrideVariable(Exprs.ST);
1733  Dir->setEnsureUpperBound(Exprs.EUB);
1734  Dir->setNextLowerBound(Exprs.NLB);
1735  Dir->setNextUpperBound(Exprs.NUB);
1736  Dir->setNumIterations(Exprs.NumIterations);
1737  Dir->setCounters(Exprs.Counters);
1738  Dir->setPrivateCounters(Exprs.PrivateCounters);
1739  Dir->setInits(Exprs.Inits);
1740  Dir->setUpdates(Exprs.Updates);
1741  Dir->setFinals(Exprs.Finals);
1742  Dir->setDependentCounters(Exprs.DependentCounters);
1743  Dir->setDependentInits(Exprs.DependentInits);
1744  Dir->setFinalsConditions(Exprs.FinalsConditions);
1745  Dir->setPreInits(Exprs.PreInits);
1746  return Dir;
1747 }
1748 
1751  unsigned NumClauses,
1752  unsigned CollapsedNum, EmptyShell) {
1753  return createEmptyDirective<OMPDistributeSimdDirective>(
1754  C, NumClauses, /*HasAssociatedStmt=*/true,
1755  numLoopChildren(CollapsedNum, OMPD_distribute_simd), CollapsedNum);
1756 }
1757 
1759  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1760  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1761  const HelperExprs &Exprs) {
1762  auto *Dir = createDirective<OMPTargetParallelForSimdDirective>(
1763  C, Clauses, AssociatedStmt,
1764  numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd), StartLoc,
1765  EndLoc, CollapsedNum);
1766  Dir->setIterationVariable(Exprs.IterationVarRef);
1767  Dir->setLastIteration(Exprs.LastIteration);
1768  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1769  Dir->setPreCond(Exprs.PreCond);
1770  Dir->setCond(Exprs.Cond);
1771  Dir->setInit(Exprs.Init);
1772  Dir->setInc(Exprs.Inc);
1773  Dir->setIsLastIterVariable(Exprs.IL);
1774  Dir->setLowerBoundVariable(Exprs.LB);
1775  Dir->setUpperBoundVariable(Exprs.UB);
1776  Dir->setStrideVariable(Exprs.ST);
1777  Dir->setEnsureUpperBound(Exprs.EUB);
1778  Dir->setNextLowerBound(Exprs.NLB);
1779  Dir->setNextUpperBound(Exprs.NUB);
1780  Dir->setNumIterations(Exprs.NumIterations);
1781  Dir->setCounters(Exprs.Counters);
1782  Dir->setPrivateCounters(Exprs.PrivateCounters);
1783  Dir->setInits(Exprs.Inits);
1784  Dir->setUpdates(Exprs.Updates);
1785  Dir->setFinals(Exprs.Finals);
1786  Dir->setDependentCounters(Exprs.DependentCounters);
1787  Dir->setDependentInits(Exprs.DependentInits);
1788  Dir->setFinalsConditions(Exprs.FinalsConditions);
1789  Dir->setPreInits(Exprs.PreInits);
1790  return Dir;
1791 }
1792 
1795  unsigned NumClauses,
1796  unsigned CollapsedNum,
1797  EmptyShell) {
1798  return createEmptyDirective<OMPTargetParallelForSimdDirective>(
1799  C, NumClauses, /*HasAssociatedStmt=*/true,
1800  numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd),
1801  CollapsedNum);
1802 }
1803 
1806  SourceLocation EndLoc, unsigned CollapsedNum,
1807  ArrayRef<OMPClause *> Clauses,
1808  Stmt *AssociatedStmt, const HelperExprs &Exprs) {
1809  auto *Dir = createDirective<OMPTargetSimdDirective>(
1810  C, Clauses, AssociatedStmt,
1811  numLoopChildren(CollapsedNum, OMPD_target_simd), StartLoc, EndLoc,
1812  CollapsedNum);
1813  Dir->setIterationVariable(Exprs.IterationVarRef);
1814  Dir->setLastIteration(Exprs.LastIteration);
1815  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1816  Dir->setPreCond(Exprs.PreCond);
1817  Dir->setCond(Exprs.Cond);
1818  Dir->setInit(Exprs.Init);
1819  Dir->setInc(Exprs.Inc);
1820  Dir->setCounters(Exprs.Counters);
1821  Dir->setPrivateCounters(Exprs.PrivateCounters);
1822  Dir->setInits(Exprs.Inits);
1823  Dir->setUpdates(Exprs.Updates);
1824  Dir->setFinals(Exprs.Finals);
1825  Dir->setDependentCounters(Exprs.DependentCounters);
1826  Dir->setDependentInits(Exprs.DependentInits);
1827  Dir->setFinalsConditions(Exprs.FinalsConditions);
1828  Dir->setPreInits(Exprs.PreInits);
1829  return Dir;
1830 }
1831 
1833 OMPTargetSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
1834  unsigned CollapsedNum, EmptyShell) {
1835  return createEmptyDirective<OMPTargetSimdDirective>(
1836  C, NumClauses, /*HasAssociatedStmt=*/true,
1837  numLoopChildren(CollapsedNum, OMPD_target_simd), CollapsedNum);
1838 }
1839 
1841  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1842  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1843  const HelperExprs &Exprs) {
1844  auto *Dir = createDirective<OMPTeamsDistributeDirective>(
1845  C, Clauses, AssociatedStmt,
1846  numLoopChildren(CollapsedNum, OMPD_teams_distribute), StartLoc, EndLoc,
1847  CollapsedNum);
1848  Dir->setIterationVariable(Exprs.IterationVarRef);
1849  Dir->setLastIteration(Exprs.LastIteration);
1850  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1851  Dir->setPreCond(Exprs.PreCond);
1852  Dir->setCond(Exprs.Cond);
1853  Dir->setInit(Exprs.Init);
1854  Dir->setInc(Exprs.Inc);
1855  Dir->setIsLastIterVariable(Exprs.IL);
1856  Dir->setLowerBoundVariable(Exprs.LB);
1857  Dir->setUpperBoundVariable(Exprs.UB);
1858  Dir->setStrideVariable(Exprs.ST);
1859  Dir->setEnsureUpperBound(Exprs.EUB);
1860  Dir->setNextLowerBound(Exprs.NLB);
1861  Dir->setNextUpperBound(Exprs.NUB);
1862  Dir->setNumIterations(Exprs.NumIterations);
1863  Dir->setCounters(Exprs.Counters);
1864  Dir->setPrivateCounters(Exprs.PrivateCounters);
1865  Dir->setInits(Exprs.Inits);
1866  Dir->setUpdates(Exprs.Updates);
1867  Dir->setFinals(Exprs.Finals);
1868  Dir->setDependentCounters(Exprs.DependentCounters);
1869  Dir->setDependentInits(Exprs.DependentInits);
1870  Dir->setFinalsConditions(Exprs.FinalsConditions);
1871  Dir->setPreInits(Exprs.PreInits);
1872  return Dir;
1873 }
1874 
1877  unsigned NumClauses,
1878  unsigned CollapsedNum, EmptyShell) {
1879  return createEmptyDirective<OMPTeamsDistributeDirective>(
1880  C, NumClauses, /*HasAssociatedStmt=*/true,
1881  numLoopChildren(CollapsedNum, OMPD_teams_distribute), CollapsedNum);
1882 }
1883 
1885  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1886  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1887  const HelperExprs &Exprs) {
1888  auto *Dir = createDirective<OMPTeamsDistributeSimdDirective>(
1889  C, Clauses, AssociatedStmt,
1890  numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), StartLoc,
1891  EndLoc, CollapsedNum);
1892  Dir->setIterationVariable(Exprs.IterationVarRef);
1893  Dir->setLastIteration(Exprs.LastIteration);
1894  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1895  Dir->setPreCond(Exprs.PreCond);
1896  Dir->setCond(Exprs.Cond);
1897  Dir->setInit(Exprs.Init);
1898  Dir->setInc(Exprs.Inc);
1899  Dir->setIsLastIterVariable(Exprs.IL);
1900  Dir->setLowerBoundVariable(Exprs.LB);
1901  Dir->setUpperBoundVariable(Exprs.UB);
1902  Dir->setStrideVariable(Exprs.ST);
1903  Dir->setEnsureUpperBound(Exprs.EUB);
1904  Dir->setNextLowerBound(Exprs.NLB);
1905  Dir->setNextUpperBound(Exprs.NUB);
1906  Dir->setNumIterations(Exprs.NumIterations);
1907  Dir->setCounters(Exprs.Counters);
1908  Dir->setPrivateCounters(Exprs.PrivateCounters);
1909  Dir->setInits(Exprs.Inits);
1910  Dir->setUpdates(Exprs.Updates);
1911  Dir->setFinals(Exprs.Finals);
1912  Dir->setDependentCounters(Exprs.DependentCounters);
1913  Dir->setDependentInits(Exprs.DependentInits);
1914  Dir->setFinalsConditions(Exprs.FinalsConditions);
1915  Dir->setPreInits(Exprs.PreInits);
1916  return Dir;
1917 }
1918 
1920  const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1921  EmptyShell) {
1922  return createEmptyDirective<OMPTeamsDistributeSimdDirective>(
1923  C, NumClauses, /*HasAssociatedStmt=*/true,
1924  numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), CollapsedNum);
1925 }
1926 
1929  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1930  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1931  const HelperExprs &Exprs) {
1932  auto *Dir = createDirective<OMPTeamsDistributeParallelForSimdDirective>(
1933  C, Clauses, AssociatedStmt,
1934  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
1935  StartLoc, EndLoc, CollapsedNum);
1936  Dir->setIterationVariable(Exprs.IterationVarRef);
1937  Dir->setLastIteration(Exprs.LastIteration);
1938  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1939  Dir->setPreCond(Exprs.PreCond);
1940  Dir->setCond(Exprs.Cond);
1941  Dir->setInit(Exprs.Init);
1942  Dir->setInc(Exprs.Inc);
1943  Dir->setIsLastIterVariable(Exprs.IL);
1944  Dir->setLowerBoundVariable(Exprs.LB);
1945  Dir->setUpperBoundVariable(Exprs.UB);
1946  Dir->setStrideVariable(Exprs.ST);
1947  Dir->setEnsureUpperBound(Exprs.EUB);
1948  Dir->setNextLowerBound(Exprs.NLB);
1949  Dir->setNextUpperBound(Exprs.NUB);
1950  Dir->setNumIterations(Exprs.NumIterations);
1951  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1952  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1953  Dir->setDistInc(Exprs.DistInc);
1954  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1955  Dir->setCounters(Exprs.Counters);
1956  Dir->setPrivateCounters(Exprs.PrivateCounters);
1957  Dir->setInits(Exprs.Inits);
1958  Dir->setUpdates(Exprs.Updates);
1959  Dir->setFinals(Exprs.Finals);
1960  Dir->setDependentCounters(Exprs.DependentCounters);
1961  Dir->setDependentInits(Exprs.DependentInits);
1962  Dir->setFinalsConditions(Exprs.FinalsConditions);
1963  Dir->setPreInits(Exprs.PreInits);
1964  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1965  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1966  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1967  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1968  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1969  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1970  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1971  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1972  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1973  return Dir;
1974 }
1975 
1978  unsigned NumClauses,
1979  unsigned CollapsedNum,
1980  EmptyShell) {
1981  return createEmptyDirective<OMPTeamsDistributeParallelForSimdDirective>(
1982  C, NumClauses, /*HasAssociatedStmt=*/true,
1983  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
1984  CollapsedNum);
1985 }
1986 
1989  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1990  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1991  const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1992  auto *Dir = createDirective<OMPTeamsDistributeParallelForDirective>(
1993  C, Clauses, AssociatedStmt,
1994  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
1995  StartLoc, EndLoc, CollapsedNum);
1996  Dir->setIterationVariable(Exprs.IterationVarRef);
1997  Dir->setLastIteration(Exprs.LastIteration);
1998  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1999  Dir->setPreCond(Exprs.PreCond);
2000  Dir->setCond(Exprs.Cond);
2001  Dir->setInit(Exprs.Init);
2002  Dir->setInc(Exprs.Inc);
2003  Dir->setIsLastIterVariable(Exprs.IL);
2004  Dir->setLowerBoundVariable(Exprs.LB);
2005  Dir->setUpperBoundVariable(Exprs.UB);
2006  Dir->setStrideVariable(Exprs.ST);
2007  Dir->setEnsureUpperBound(Exprs.EUB);
2008  Dir->setNextLowerBound(Exprs.NLB);
2009  Dir->setNextUpperBound(Exprs.NUB);
2010  Dir->setNumIterations(Exprs.NumIterations);
2011  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2012  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2013  Dir->setDistInc(Exprs.DistInc);
2014  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2015  Dir->setCounters(Exprs.Counters);
2016  Dir->setPrivateCounters(Exprs.PrivateCounters);
2017  Dir->setInits(Exprs.Inits);
2018  Dir->setUpdates(Exprs.Updates);
2019  Dir->setFinals(Exprs.Finals);
2020  Dir->setDependentCounters(Exprs.DependentCounters);
2021  Dir->setDependentInits(Exprs.DependentInits);
2022  Dir->setFinalsConditions(Exprs.FinalsConditions);
2023  Dir->setPreInits(Exprs.PreInits);
2024  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2025  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2026  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2027  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2028  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2029  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2030  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2031  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2032  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2033  Dir->setTaskReductionRefExpr(TaskRedRef);
2034  Dir->HasCancel = HasCancel;
2035  return Dir;
2036 }
2037 
2040  unsigned NumClauses,
2041  unsigned CollapsedNum,
2042  EmptyShell) {
2043  return createEmptyDirective<OMPTeamsDistributeParallelForDirective>(
2044  C, NumClauses, /*HasAssociatedStmt=*/true,
2045  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
2046  CollapsedNum);
2047 }
2048 
2050  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2051  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
2052  return createDirective<OMPTargetTeamsDirective>(C, Clauses, AssociatedStmt,
2053  /*NumChildren=*/0, StartLoc,
2054  EndLoc);
2055 }
2056 
2058 OMPTargetTeamsDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
2059  EmptyShell) {
2060  return createEmptyDirective<OMPTargetTeamsDirective>(
2061  C, NumClauses, /*HasAssociatedStmt=*/true);
2062 }
2063 
2065  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2066  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2067  const HelperExprs &Exprs) {
2068  auto *Dir = createDirective<OMPTargetTeamsDistributeDirective>(
2069  C, Clauses, AssociatedStmt,
2070  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute), StartLoc,
2071  EndLoc, CollapsedNum);
2072  Dir->setIterationVariable(Exprs.IterationVarRef);
2073  Dir->setLastIteration(Exprs.LastIteration);
2074  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2075  Dir->setPreCond(Exprs.PreCond);
2076  Dir->setCond(Exprs.Cond);
2077  Dir->setInit(Exprs.Init);
2078  Dir->setInc(Exprs.Inc);
2079  Dir->setIsLastIterVariable(Exprs.IL);
2080  Dir->setLowerBoundVariable(Exprs.LB);
2081  Dir->setUpperBoundVariable(Exprs.UB);
2082  Dir->setStrideVariable(Exprs.ST);
2083  Dir->setEnsureUpperBound(Exprs.EUB);
2084  Dir->setNextLowerBound(Exprs.NLB);
2085  Dir->setNextUpperBound(Exprs.NUB);
2086  Dir->setNumIterations(Exprs.NumIterations);
2087  Dir->setCounters(Exprs.Counters);
2088  Dir->setPrivateCounters(Exprs.PrivateCounters);
2089  Dir->setInits(Exprs.Inits);
2090  Dir->setUpdates(Exprs.Updates);
2091  Dir->setFinals(Exprs.Finals);
2092  Dir->setDependentCounters(Exprs.DependentCounters);
2093  Dir->setDependentInits(Exprs.DependentInits);
2094  Dir->setFinalsConditions(Exprs.FinalsConditions);
2095  Dir->setPreInits(Exprs.PreInits);
2096  return Dir;
2097 }
2098 
2101  unsigned NumClauses,
2102  unsigned CollapsedNum,
2103  EmptyShell) {
2104  return createEmptyDirective<OMPTargetTeamsDistributeDirective>(
2105  C, NumClauses, /*HasAssociatedStmt=*/true,
2106  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute),
2107  CollapsedNum);
2108 }
2109 
2112  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2113  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2114  const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
2115  auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForDirective>(
2116  C, Clauses, AssociatedStmt,
2117  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
2118  1,
2119  StartLoc, EndLoc, CollapsedNum);
2120  Dir->setIterationVariable(Exprs.IterationVarRef);
2121  Dir->setLastIteration(Exprs.LastIteration);
2122  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2123  Dir->setPreCond(Exprs.PreCond);
2124  Dir->setCond(Exprs.Cond);
2125  Dir->setInit(Exprs.Init);
2126  Dir->setInc(Exprs.Inc);
2127  Dir->setIsLastIterVariable(Exprs.IL);
2128  Dir->setLowerBoundVariable(Exprs.LB);
2129  Dir->setUpperBoundVariable(Exprs.UB);
2130  Dir->setStrideVariable(Exprs.ST);
2131  Dir->setEnsureUpperBound(Exprs.EUB);
2132  Dir->setNextLowerBound(Exprs.NLB);
2133  Dir->setNextUpperBound(Exprs.NUB);
2134  Dir->setNumIterations(Exprs.NumIterations);
2135  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2136  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2137  Dir->setDistInc(Exprs.DistInc);
2138  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2139  Dir->setCounters(Exprs.Counters);
2140  Dir->setPrivateCounters(Exprs.PrivateCounters);
2141  Dir->setInits(Exprs.Inits);
2142  Dir->setUpdates(Exprs.Updates);
2143  Dir->setFinals(Exprs.Finals);
2144  Dir->setDependentCounters(Exprs.DependentCounters);
2145  Dir->setDependentInits(Exprs.DependentInits);
2146  Dir->setFinalsConditions(Exprs.FinalsConditions);
2147  Dir->setPreInits(Exprs.PreInits);
2148  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2149  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2150  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2151  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2152  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2153  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2154  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2155  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2156  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2157  Dir->setTaskReductionRefExpr(TaskRedRef);
2158  Dir->HasCancel = HasCancel;
2159  return Dir;
2160 }
2161 
2164  unsigned NumClauses,
2165  unsigned CollapsedNum,
2166  EmptyShell) {
2167  return createEmptyDirective<OMPTargetTeamsDistributeParallelForDirective>(
2168  C, NumClauses, /*HasAssociatedStmt=*/true,
2169  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
2170  1,
2171  CollapsedNum);
2172 }
2173 
2176  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2177  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2178  const HelperExprs &Exprs) {
2179  auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
2180  C, Clauses, AssociatedStmt,
2181  numLoopChildren(CollapsedNum,
2182  OMPD_target_teams_distribute_parallel_for_simd),
2183  StartLoc, EndLoc, CollapsedNum);
2184  Dir->setIterationVariable(Exprs.IterationVarRef);
2185  Dir->setLastIteration(Exprs.LastIteration);
2186  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2187  Dir->setPreCond(Exprs.PreCond);
2188  Dir->setCond(Exprs.Cond);
2189  Dir->setInit(Exprs.Init);
2190  Dir->setInc(Exprs.Inc);
2191  Dir->setIsLastIterVariable(Exprs.IL);
2192  Dir->setLowerBoundVariable(Exprs.LB);
2193  Dir->setUpperBoundVariable(Exprs.UB);
2194  Dir->setStrideVariable(Exprs.ST);
2195  Dir->setEnsureUpperBound(Exprs.EUB);
2196  Dir->setNextLowerBound(Exprs.NLB);
2197  Dir->setNextUpperBound(Exprs.NUB);
2198  Dir->setNumIterations(Exprs.NumIterations);
2199  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2200  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2201  Dir->setDistInc(Exprs.DistInc);
2202  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2203  Dir->setCounters(Exprs.Counters);
2204  Dir->setPrivateCounters(Exprs.PrivateCounters);
2205  Dir->setInits(Exprs.Inits);
2206  Dir->setUpdates(Exprs.Updates);
2207  Dir->setFinals(Exprs.Finals);
2208  Dir->setDependentCounters(Exprs.DependentCounters);
2209  Dir->setDependentInits(Exprs.DependentInits);
2210  Dir->setFinalsConditions(Exprs.FinalsConditions);
2211  Dir->setPreInits(Exprs.PreInits);
2212  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2213  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2214  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2215  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2216  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2217  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2218  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2219  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2220  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2221  return Dir;
2222 }
2223 
2226  const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
2227  EmptyShell) {
2228  return createEmptyDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
2229  C, NumClauses, /*HasAssociatedStmt=*/true,
2230  numLoopChildren(CollapsedNum,
2231  OMPD_target_teams_distribute_parallel_for_simd),
2232  CollapsedNum);
2233 }
2234 
2237  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2238  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2239  const HelperExprs &Exprs) {
2240  auto *Dir = createDirective<OMPTargetTeamsDistributeSimdDirective>(
2241  C, Clauses, AssociatedStmt,
2242  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),
2243  StartLoc, EndLoc, CollapsedNum);
2244  Dir->setIterationVariable(Exprs.IterationVarRef);
2245  Dir->setLastIteration(Exprs.LastIteration);
2246  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2247  Dir->setPreCond(Exprs.PreCond);
2248  Dir->setCond(Exprs.Cond);
2249  Dir->setInit(Exprs.Init);
2250  Dir->setInc(Exprs.Inc);
2251  Dir->setIsLastIterVariable(Exprs.IL);
2252  Dir->setLowerBoundVariable(Exprs.LB);
2253  Dir->setUpperBoundVariable(Exprs.UB);
2254  Dir->setStrideVariable(Exprs.ST);
2255  Dir->setEnsureUpperBound(Exprs.EUB);
2256  Dir->setNextLowerBound(Exprs.NLB);
2257  Dir->setNextUpperBound(Exprs.NUB);
2258  Dir->setNumIterations(Exprs.NumIterations);
2259  Dir->setCounters(Exprs.Counters);
2260  Dir->setPrivateCounters(Exprs.PrivateCounters);
2261  Dir->setInits(Exprs.Inits);
2262  Dir->setUpdates(Exprs.Updates);
2263  Dir->setFinals(Exprs.Finals);
2264  Dir->setDependentCounters(Exprs.DependentCounters);
2265  Dir->setDependentInits(Exprs.DependentInits);
2266  Dir->setFinalsConditions(Exprs.FinalsConditions);
2267  Dir->setPreInits(Exprs.PreInits);
2268  return Dir;
2269 }
2270 
2273  unsigned NumClauses,
2274  unsigned CollapsedNum,
2275  EmptyShell) {
2276  return createEmptyDirective<OMPTargetTeamsDistributeSimdDirective>(
2277  C, NumClauses, /*HasAssociatedStmt=*/true,
2278  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),
2279  CollapsedNum);
2280 }
2281 
2284  SourceLocation EndLoc,
2285  ArrayRef<OMPClause *> Clauses) {
2286  return createDirective<OMPInteropDirective>(
2287  C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
2288  EndLoc);
2289 }
2290 
2292  unsigned NumClauses,
2293  EmptyShell) {
2294  return createEmptyDirective<OMPInteropDirective>(C, NumClauses);
2295 }
2296 
2298  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2299  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2300  SourceLocation TargetCallLoc) {
2301  auto *Dir = createDirective<OMPDispatchDirective>(
2302  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
2303  Dir->setTargetCallLoc(TargetCallLoc);
2304  return Dir;
2305 }
2306 
2308  unsigned NumClauses,
2309  EmptyShell) {
2310  return createEmptyDirective<OMPDispatchDirective>(C, NumClauses,
2311  /*HasAssociatedStmt=*/true,
2312  /*NumChildren=*/0);
2313 }
2314 
2316  SourceLocation StartLoc,
2317  SourceLocation EndLoc,
2318  ArrayRef<OMPClause *> Clauses,
2319  Stmt *AssociatedStmt) {
2320  return createDirective<OMPMaskedDirective>(C, Clauses, AssociatedStmt,
2321  /*NumChildren=*/0, StartLoc,
2322  EndLoc);
2323 }
2324 
2326  unsigned NumClauses,
2327  EmptyShell) {
2328  return createEmptyDirective<OMPMaskedDirective>(C, NumClauses,
2329  /*HasAssociatedStmt=*/true);
2330 }
2331 
2333  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2334  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2335  const HelperExprs &Exprs) {
2336  auto *Dir = createDirective<OMPGenericLoopDirective>(
2337  C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_loop),
2338  StartLoc, EndLoc, CollapsedNum);
2339  Dir->setIterationVariable(Exprs.IterationVarRef);
2340  Dir->setLastIteration(Exprs.LastIteration);
2341  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2342  Dir->setPreCond(Exprs.PreCond);
2343  Dir->setCond(Exprs.Cond);
2344  Dir->setInit(Exprs.Init);
2345  Dir->setInc(Exprs.Inc);
2346  Dir->setIsLastIterVariable(Exprs.IL);
2347  Dir->setLowerBoundVariable(Exprs.LB);
2348  Dir->setUpperBoundVariable(Exprs.UB);
2349  Dir->setStrideVariable(Exprs.ST);
2350  Dir->setEnsureUpperBound(Exprs.EUB);
2351  Dir->setNextLowerBound(Exprs.NLB);
2352  Dir->setNextUpperBound(Exprs.NUB);
2353  Dir->setNumIterations(Exprs.NumIterations);
2354  Dir->setCounters(Exprs.Counters);
2355  Dir->setPrivateCounters(Exprs.PrivateCounters);
2356  Dir->setInits(Exprs.Inits);
2357  Dir->setUpdates(Exprs.Updates);
2358  Dir->setFinals(Exprs.Finals);
2359  Dir->setDependentCounters(Exprs.DependentCounters);
2360  Dir->setDependentInits(Exprs.DependentInits);
2361  Dir->setFinalsConditions(Exprs.FinalsConditions);
2362  Dir->setPreInits(Exprs.PreInits);
2363  return Dir;
2364 }
2365 
2367 OMPGenericLoopDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
2368  unsigned CollapsedNum, EmptyShell) {
2369  return createEmptyDirective<OMPGenericLoopDirective>(
2370  C, NumClauses, /*HasAssociatedStmt=*/true,
2371  numLoopChildren(CollapsedNum, OMPD_loop), CollapsedNum);
2372 }
2373 
2375  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2376  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2377  const HelperExprs &Exprs) {
2378  auto *Dir = createDirective<OMPTeamsGenericLoopDirective>(
2379  C, Clauses, AssociatedStmt,
2380  numLoopChildren(CollapsedNum, OMPD_teams_loop), StartLoc, EndLoc,
2381  CollapsedNum);
2382  Dir->setIterationVariable(Exprs.IterationVarRef);
2383  Dir->setLastIteration(Exprs.LastIteration);
2384  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2385  Dir->setPreCond(Exprs.PreCond);
2386  Dir->setCond(Exprs.Cond);
2387  Dir->setInit(Exprs.Init);
2388  Dir->setInc(Exprs.Inc);
2389  Dir->setIsLastIterVariable(Exprs.IL);
2390  Dir->setLowerBoundVariable(Exprs.LB);
2391  Dir->setUpperBoundVariable(Exprs.UB);
2392  Dir->setStrideVariable(Exprs.ST);
2393  Dir->setEnsureUpperBound(Exprs.EUB);
2394  Dir->setNextLowerBound(Exprs.NLB);
2395  Dir->setNextUpperBound(Exprs.NUB);
2396  Dir->setNumIterations(Exprs.NumIterations);
2397  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2398  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2399  Dir->setDistInc(Exprs.DistInc);
2400  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2401  Dir->setCounters(Exprs.Counters);
2402  Dir->setPrivateCounters(Exprs.PrivateCounters);
2403  Dir->setInits(Exprs.Inits);
2404  Dir->setUpdates(Exprs.Updates);
2405  Dir->setFinals(Exprs.Finals);
2406  Dir->setDependentCounters(Exprs.DependentCounters);
2407  Dir->setDependentInits(Exprs.DependentInits);
2408  Dir->setFinalsConditions(Exprs.FinalsConditions);
2409  Dir->setPreInits(Exprs.PreInits);
2410  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2411  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2412  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2413  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2414  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2415  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2416  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2417  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2418  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2419  return Dir;
2420 }
2421 
2424  unsigned NumClauses,
2425  unsigned CollapsedNum, EmptyShell) {
2426  return createEmptyDirective<OMPTeamsGenericLoopDirective>(
2427  C, NumClauses, /*HasAssociatedStmt=*/true,
2428  numLoopChildren(CollapsedNum, OMPD_teams_loop), CollapsedNum);
2429 }
2430 
2432  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2433  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2434  const HelperExprs &Exprs, bool CanBeParallelFor) {
2435  auto *Dir = createDirective<OMPTargetTeamsGenericLoopDirective>(
2436  C, Clauses, AssociatedStmt,
2437  numLoopChildren(CollapsedNum, OMPD_target_teams_loop), StartLoc, EndLoc,
2438  CollapsedNum);
2439  Dir->setIterationVariable(Exprs.IterationVarRef);
2440  Dir->setLastIteration(Exprs.LastIteration);
2441  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2442  Dir->setPreCond(Exprs.PreCond);
2443  Dir->setCond(Exprs.Cond);
2444  Dir->setInit(Exprs.Init);
2445  Dir->setInc(Exprs.Inc);
2446  Dir->setIsLastIterVariable(Exprs.IL);
2447  Dir->setLowerBoundVariable(Exprs.LB);
2448  Dir->setUpperBoundVariable(Exprs.UB);
2449  Dir->setStrideVariable(Exprs.ST);
2450  Dir->setEnsureUpperBound(Exprs.EUB);
2451  Dir->setNextLowerBound(Exprs.NLB);
2452  Dir->setNextUpperBound(Exprs.NUB);
2453  Dir->setNumIterations(Exprs.NumIterations);
2454  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2455  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2456  Dir->setDistInc(Exprs.DistInc);
2457  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2458  Dir->setCounters(Exprs.Counters);
2459  Dir->setPrivateCounters(Exprs.PrivateCounters);
2460  Dir->setInits(Exprs.Inits);
2461  Dir->setUpdates(Exprs.Updates);
2462  Dir->setFinals(Exprs.Finals);
2463  Dir->setDependentCounters(Exprs.DependentCounters);
2464  Dir->setDependentInits(Exprs.DependentInits);
2465  Dir->setFinalsConditions(Exprs.FinalsConditions);
2466  Dir->setPreInits(Exprs.PreInits);
2467  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2468  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2469  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2470  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2471  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2472  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2473  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2474  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2475  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2476  Dir->setCanBeParallelFor(CanBeParallelFor);
2477  return Dir;
2478 }
2479 
2482  unsigned NumClauses,
2483  unsigned CollapsedNum,
2484  EmptyShell) {
2485  return createEmptyDirective<OMPTargetTeamsGenericLoopDirective>(
2486  C, NumClauses, /*HasAssociatedStmt=*/true,
2487  numLoopChildren(CollapsedNum, OMPD_target_teams_loop), CollapsedNum);
2488 }
2489 
2491  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2492  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2493  const HelperExprs &Exprs) {
2494  auto *Dir = createDirective<OMPParallelGenericLoopDirective>(
2495  C, Clauses, AssociatedStmt,
2496  numLoopChildren(CollapsedNum, OMPD_parallel_loop), StartLoc, EndLoc,
2497  CollapsedNum);
2498  Dir->setIterationVariable(Exprs.IterationVarRef);
2499  Dir->setLastIteration(Exprs.LastIteration);
2500  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2501  Dir->setPreCond(Exprs.PreCond);
2502  Dir->setCond(Exprs.Cond);
2503  Dir->setInit(Exprs.Init);
2504  Dir->setInc(Exprs.Inc);
2505  Dir->setIsLastIterVariable(Exprs.IL);
2506  Dir->setLowerBoundVariable(Exprs.LB);
2507  Dir->setUpperBoundVariable(Exprs.UB);
2508  Dir->setStrideVariable(Exprs.ST);
2509  Dir->setEnsureUpperBound(Exprs.EUB);
2510  Dir->setNextLowerBound(Exprs.NLB);
2511  Dir->setNextUpperBound(Exprs.NUB);
2512  Dir->setNumIterations(Exprs.NumIterations);
2513  Dir->setCounters(Exprs.Counters);
2514  Dir->setPrivateCounters(Exprs.PrivateCounters);
2515  Dir->setInits(Exprs.Inits);
2516  Dir->setUpdates(Exprs.Updates);
2517  Dir->setFinals(Exprs.Finals);
2518  Dir->setDependentCounters(Exprs.DependentCounters);
2519  Dir->setDependentInits(Exprs.DependentInits);
2520  Dir->setFinalsConditions(Exprs.FinalsConditions);
2521  Dir->setPreInits(Exprs.PreInits);
2522  return Dir;
2523 }
2524 
2526  const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
2527  EmptyShell) {
2528  return createEmptyDirective<OMPParallelGenericLoopDirective>(
2529  C, NumClauses, /*HasAssociatedStmt=*/true,
2530  numLoopChildren(CollapsedNum, OMPD_parallel_loop), CollapsedNum);
2531 }
2532 
2535  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2536  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2537  const HelperExprs &Exprs) {
2538  auto *Dir = createDirective<OMPTargetParallelGenericLoopDirective>(
2539  C, Clauses, AssociatedStmt,
2540  numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), StartLoc,
2541  EndLoc, CollapsedNum);
2542  Dir->setIterationVariable(Exprs.IterationVarRef);
2543  Dir->setLastIteration(Exprs.LastIteration);
2544  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2545  Dir->setPreCond(Exprs.PreCond);
2546  Dir->setCond(Exprs.Cond);
2547  Dir->setInit(Exprs.Init);
2548  Dir->setInc(Exprs.Inc);
2549  Dir->setIsLastIterVariable(Exprs.IL);
2550  Dir->setLowerBoundVariable(Exprs.LB);
2551  Dir->setUpperBoundVariable(Exprs.UB);
2552  Dir->setStrideVariable(Exprs.ST);
2553  Dir->setEnsureUpperBound(Exprs.EUB);
2554  Dir->setNextLowerBound(Exprs.NLB);
2555  Dir->setNextUpperBound(Exprs.NUB);
2556  Dir->setNumIterations(Exprs.NumIterations);
2557  Dir->setCounters(Exprs.Counters);
2558  Dir->setPrivateCounters(Exprs.PrivateCounters);
2559  Dir->setInits(Exprs.Inits);
2560  Dir->setUpdates(Exprs.Updates);
2561  Dir->setFinals(Exprs.Finals);
2562  Dir->setDependentCounters(Exprs.DependentCounters);
2563  Dir->setDependentInits(Exprs.DependentInits);
2564  Dir->setFinalsConditions(Exprs.FinalsConditions);
2565  Dir->setPreInits(Exprs.PreInits);
2566  return Dir;
2567 }
2568 
2571  unsigned NumClauses,
2572  unsigned CollapsedNum,
2573  EmptyShell) {
2574  return createEmptyDirective<OMPTargetParallelGenericLoopDirective>(
2575  C, NumClauses, /*HasAssociatedStmt=*/true,
2576  numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), CollapsedNum);
2577 }
Defines the clang::ASTContext interface.
const char * Data
This file defines OpenMP AST classes for executable directives and clauses.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:185
This represents one expression.
Definition: Expr.h:110
IfStmt - This represents an if/then/else.
Definition: Stmt.h:2138
This represents '#pragma omp atomic' directive.
Definition: StmtOpenMP.h:2963
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:935
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:917
This represents '#pragma omp barrier' directive.
Definition: StmtOpenMP.h:2641
static OMPBarrierDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:781
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:787
This represents '#pragma omp cancel' directive.
Definition: StmtOpenMP.h:3671
static OMPCancelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, OpenMPDirectiveKind CancelRegion)
Creates directive.
Definition: StmtOpenMP.cpp:837
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:847
This represents '#pragma omp cancellation point' directive.
Definition: StmtOpenMP.h:3613
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:832
static OMPCancellationPointDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Creates directive.
Definition: StmtOpenMP.cpp:823
Contains data for OpenMP directives: clauses, children expressions/statements (helpers for codegen) a...
void setClauses(ArrayRef< OMPClause * > Clauses)
Sets the list of variables for this clause.
Definition: StmtOpenMP.cpp:27
MutableArrayRef< Stmt * > getChildren()
Definition: StmtOpenMP.cpp:33
This represents '#pragma omp critical' directive.
Definition: StmtOpenMP.h:2092
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:592
static OMPCriticalDirective * Create(const ASTContext &C, const DeclarationNameInfo &Name, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:583
This represents '#pragma omp depobj' directive.
Definition: StmtOpenMP.h:2857
static OMPDepobjDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:877
static OMPDepobjDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:868
This represents '#pragma omp dispatch' directive.
Definition: StmtOpenMP.h:5827
static OMPDispatchDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, SourceLocation TargetCallLoc)
Creates directive with a list of Clauses.
static OMPDispatchDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp distribute' directive.
Definition: StmtOpenMP.h:4441
static OMPDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, OpenMPDirectiveKind ParamPrevMappedDirective)
Creates directive with a list of Clauses.
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp distribute parallel for' composite directive.
Definition: StmtOpenMP.h:4564
static OMPDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
This represents '#pragma omp distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:4660
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.
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp distribute simd' composite directive.
Definition: StmtOpenMP.h:4725
static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
This represents '#pragma omp error' directive.
Definition: StmtOpenMP.h:6311
static OMPErrorDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Definition: StmtOpenMP.cpp:766
static OMPErrorDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:775
const Stmt * getStructuredBlock() const
Returns the AST node representing OpenMP structured-block of this OpenMP executable directive,...
Definition: StmtOpenMP.h:601
bool isStandaloneDirective() const
Returns whether or not this is a Standalone directive.
Definition: StmtOpenMP.cpp:58
This represents '#pragma omp flush' directive.
Definition: StmtOpenMP.h:2805
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:862
static OMPFlushDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:853
This represents '#pragma omp for' directive.
Definition: StmtOpenMP.h:1649
static OMPForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel, OpenMPDirectiveKind ParamPrevMappedDirective)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:336
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:400
This represents '#pragma omp for simd' directive.
Definition: StmtOpenMP.h:1740
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:487
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:453
This represents '#pragma omp loop' directive.
Definition: StmtOpenMP.h:5982
static OMPGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with a place for NumClauses clauses.
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.
This represents '#pragma omp interop' directive.
Definition: StmtOpenMP.h:5774
static OMPInteropDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPInteropDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive.
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
static Stmt * tryToFindNextInnerLoop(Stmt *CurStmt, bool TryImperfectlyNestedLoops)
Try to find the next loop sub-statement in the specified statement CurStmt.
Definition: StmtOpenMP.cpp:78
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
void setFinals(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:237
void setDependentCounters(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:243
void setFinalsConditions(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:256
void setInits(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:225
void setCounters(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:212
void setDependentInits(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:250
void setUpdates(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:231
void setPrivateCounters(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:218
The base class for all loop transformation directives.
Definition: StmtOpenMP.h:975
Stmt * getPreInits() const
Return preinits statement.
Definition: StmtOpenMP.cpp:387
Stmt * getTransformedStmt() const
Get the de-sugared statements after the loop transformation.
Definition: StmtOpenMP.cpp:374
This represents '#pragma omp masked' directive.
Definition: StmtOpenMP.h:5892
static OMPMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPMaskedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
This represents '#pragma omp masked taskloop' directive.
Definition: StmtOpenMP.h:3946
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.
static OMPMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp masked taskloop simd' directive.
Definition: StmtOpenMP.h:4087
static OMPMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
This represents '#pragma omp master' directive.
Definition: StmtOpenMP.h:2044
static OMPMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:568
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:577
This represents '#pragma omp master taskloop' directive.
Definition: StmtOpenMP.h:3870
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.
static OMPMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp master taskloop simd' directive.
Definition: StmtOpenMP.h:4022
static OMPMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
This represents '#pragma omp metadirective' directive.
Definition: StmtOpenMP.h:5943
static OMPMetaDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Definition: StmtOpenMP.cpp:273
static OMPMetaDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Stmt *IfStmt)
Definition: StmtOpenMP.cpp:262
This represents '#pragma omp ordered' directive.
Definition: StmtOpenMP.h:2909
static OMPOrderedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:898
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, bool IsStandalone, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:908
This represents '#pragma omp parallel' directive.
Definition: StmtOpenMP.h:627
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
static OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:292
This represents '#pragma omp parallel for' directive.
Definition: StmtOpenMP.h:2163
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:599
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:637
This represents '#pragma omp parallel for simd' directive.
Definition: StmtOpenMP.h:2260
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:680
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:644
This represents '#pragma omp parallel loop' directive.
Definition: StmtOpenMP.h:6184
static OMPParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
This represents '#pragma omp parallel masked' directive.
Definition: StmtOpenMP.h:2388
static OMPParallelMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:714
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:704
This represents '#pragma omp parallel masked taskloop' directive.
Definition: StmtOpenMP.h:4231
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.
static OMPParallelMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel masked taskloop simd' directive.
Definition: StmtOpenMP.h:4376
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.
static OMPParallelMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel master' directive.
Definition: StmtOpenMP.h:2325
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:688
static OMPParallelMasterDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:698
This represents '#pragma omp parallel master taskloop' directive.
Definition: StmtOpenMP.h:4153
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.
static OMPParallelMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel master taskloop simd' directive.
Definition: StmtOpenMP.h:4309
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.
static OMPParallelMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel sections' directive.
Definition: StmtOpenMP.h:2452
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:720
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:732
This represents '#pragma omp scan' directive.
Definition: StmtOpenMP.h:5721
static OMPScanDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:892
static OMPScanDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:883
This represents '#pragma omp scope' directive.
Definition: StmtOpenMP.h:1941
static OMPScopeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:534
static OMPScopeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:544
This represents '#pragma omp section' directive.
Definition: StmtOpenMP.h:1880
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:528
static OMPSectionDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, bool HasCancel)
Creates directive.
Definition: StmtOpenMP.cpp:516
This represents '#pragma omp sections' directive.
Definition: StmtOpenMP.h:1803
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:496
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:508
This represents '#pragma omp simd' directive.
Definition: StmtOpenMP.h:1585
static OMPSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, OpenMPDirectiveKind ParamPrevMappedDirective)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:300
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
This represents '#pragma omp single' directive.
Definition: StmtOpenMP.h:1993
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:551
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:561
This represents '#pragma omp target data' directive.
Definition: StmtOpenMP.h:3222
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
static OMPTargetDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
This represents '#pragma omp target' directive.
Definition: StmtOpenMP.h:3168
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:942
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:951
This represents '#pragma omp target enter data' directive.
Definition: StmtOpenMP.h:3276
static OMPTargetEnterDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents '#pragma omp target exit data' directive.
Definition: StmtOpenMP.h:3331
static OMPTargetExitDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents '#pragma omp target parallel' directive.
Definition: StmtOpenMP.h:3385
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:970
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:958
This represents '#pragma omp target parallel for' directive.
Definition: StmtOpenMP.h:3465
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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:976
This represents '#pragma omp target parallel for simd' directive.
Definition: StmtOpenMP.h:4791
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.
static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target parallel loop' directive.
Definition: StmtOpenMP.h:6249
static OMPTargetParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
This represents '#pragma omp target simd' directive.
Definition: StmtOpenMP.h:4858
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.
static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams' directive.
Definition: StmtOpenMP.h:5216
static OMPTargetTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams distribute' combined directive.
Definition: StmtOpenMP.h:5272
static OMPTargetTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
This represents '#pragma omp target teams distribute parallel for' combined directive.
Definition: StmtOpenMP.h:5339
static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
Definition: StmtOpenMP.h:5437
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.
static OMPTargetTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams distribute simd' combined directive.
Definition: StmtOpenMP.h:5507
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.
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams loop' directive.
Definition: StmtOpenMP.h:6109
static OMPTargetTeamsGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool CanBeParallelFor)
Creates directive with a list of Clauses.
static OMPTargetTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target update' directive.
Definition: StmtOpenMP.h:4508
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetUpdateDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
This represents '#pragma omp task' directive.
Definition: StmtOpenMP.h:2533
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:748
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:739
This represents '#pragma omp taskloop' directive.
Definition: StmtOpenMP.h:3731
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.
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp taskloop simd' directive.
Definition: StmtOpenMP.h:3804
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
This represents '#pragma omp taskgroup' directive.
Definition: StmtOpenMP.h:2738
static OMPTaskgroupDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *ReductionRef)
Creates directive.
Definition: StmtOpenMP.cpp:807
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:816
This represents '#pragma omp taskwait' directive.
Definition: StmtOpenMP.h:2687
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:801
static OMPTaskwaitDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive.
Definition: StmtOpenMP.cpp:793
This represents '#pragma omp taskyield' directive.
Definition: StmtOpenMP.h:2595
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:761
static OMPTaskyieldDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:755
This represents '#pragma omp teams' directive.
Definition: StmtOpenMP.h:3560
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
This represents '#pragma omp teams distribute' directive.
Definition: StmtOpenMP.h:4923
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.
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams distribute parallel for' composite directive.
Definition: StmtOpenMP.h:5123
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.
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:5057
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.
static OMPTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams distribute simd' combined directive.
Definition: StmtOpenMP.h:4989
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.
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams loop' directive.
Definition: StmtOpenMP.h:6044
static OMPTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
This represents the '#pragma omp tile' loop transformation directive.
Definition: StmtOpenMP.h:5565
static OMPTileDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty '#pragma omp tile' AST node for deserialization.
Definition: StmtOpenMP.cpp:422
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:410
This represents the '#pragma omp unroll' loop transformation directive.
Definition: StmtOpenMP.h:5647
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:431
static OMPUnrollDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Build an empty '#pragma omp unroll' AST node for deserialization.
Definition: StmtOpenMP.cpp:445
Encodes a location in the source.
Stmt - This represents one statement.
Definition: Stmt.h:84
Stmt * IgnoreContainers(bool IgnoreCaptured=false)
Skip no-op (attributed, compound) container stmts and skip captured stmt at the top,...
Definition: Stmt.cpp:197
The JSON file list parser is used to communicate input to InstallAPI.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:24
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
Expr * E
'expr' part of the associated expression/statement.
Definition: StmtOpenMP.h:3048
Expr * D
'd' part of the associated expression/statement.
Definition: StmtOpenMP.h:3054
Expr * UE
UE Helper expression of the form: 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExp...
Definition: StmtOpenMP.h:3052
bool IsFailOnly
True if 'v' is updated only when the condition is false (compare capture only).
Definition: StmtOpenMP.h:3063
Expr * X
'x' part of the associated expression/statement.
Definition: StmtOpenMP.h:3042
Expr * Cond
Conditional expression in atomic compare construct.
Definition: StmtOpenMP.h:3056
Expr * V
'v' part of the associated expression/statement.
Definition: StmtOpenMP.h:3044
bool IsPostfixUpdate
True if original value of 'x' must be stored in 'v', not an updated one.
Definition: StmtOpenMP.h:3060
bool IsXLHSInRHSPart
True if UE has the first form and false if the second.
Definition: StmtOpenMP.h:3058
Expr * ParForInDistCond
'omp parallel for' loop condition used when composed with 'omp distribute' in the same construct and ...
Definition: StmtOpenMP.h:751
Expr * LB
DistributeLowerBound - used when composing 'omp distribute' with 'omp for' in a same construct.
Definition: StmtOpenMP.h:725
Expr * Init
Distribute loop iteration variable init used when composing 'omp distribute' with 'omp for' in a same...
Definition: StmtOpenMP.h:735
Expr * NUB
Update of UpperBound for statically scheduled omp loops for outer loop in combined constructs (e....
Definition: StmtOpenMP.h:744
Expr * EUB
DistributeEnsureUpperBound - used when composing 'omp distribute' with 'omp for' in a same construct,...
Definition: StmtOpenMP.h:731
Expr * UB
DistributeUpperBound - used when composing 'omp distribute' with 'omp for' in a same construct.
Definition: StmtOpenMP.h:728
Expr * NLB
Update of LowerBound for statically scheduled omp loops for outer loop in combined constructs (e....
Definition: StmtOpenMP.h:741
Expr * DistCond
Distribute Loop condition used when composing 'omp distribute' with 'omp for' in a same construct whe...
Definition: StmtOpenMP.h:747
Expr * Cond
Distribute Loop condition used when composing 'omp distribute' with 'omp for' in a same construct.
Definition: StmtOpenMP.h:738
The expressions built for the OpenMP loop CodeGen for the whole collapsed loop nest.
Definition: StmtOpenMP.h:756
Expr * LastIteration
Loop last iteration number.
Definition: StmtOpenMP.h:760
SmallVector< Expr *, 4 > DependentInits
List of initializers required for the generation of the non-rectangular loops.
Definition: StmtOpenMP.h:818
SmallVector< Expr *, 4 > Inits
Expressions for loop counters inits for CodeGen.
Definition: StmtOpenMP.h:808
Expr * PrevEUB
PrevEUB - expression similar to EUB but to be used when loop scheduling uses PrevLB and PrevUB (e....
Definition: StmtOpenMP.h:802
Expr * DistInc
DistInc - increment expression for distribute loop when found combined with a further loop level (e....
Definition: StmtOpenMP.h:796
Expr * IL
IsLastIteration - local flag variable passed to runtime.
Definition: StmtOpenMP.h:774
SmallVector< Expr *, 4 > PrivateCounters
PrivateCounters Loop counters.
Definition: StmtOpenMP.h:806
Expr * CalcLastIteration
Calculation of last iteration.
Definition: StmtOpenMP.h:764
SmallVector< Expr *, 4 > Updates
Expressions for loop counters update for CodeGen.
Definition: StmtOpenMP.h:810
Expr * ST
Stride - local variable passed to runtime.
Definition: StmtOpenMP.h:780
SmallVector< Expr *, 4 > Finals
Final loop counter values for GodeGen.
Definition: StmtOpenMP.h:812
SmallVector< Expr *, 4 > FinalsConditions
List of final conditions required for the generation of the non-rectangular loops.
Definition: StmtOpenMP.h:821
Expr * PreCond
Loop pre-condition.
Definition: StmtOpenMP.h:766
Stmt * PreInits
Init statement for all captured expressions.
Definition: StmtOpenMP.h:823
Expr * IterationVarRef
Loop iteration variable.
Definition: StmtOpenMP.h:758
Expr * NumIterations
Loop number of iterations.
Definition: StmtOpenMP.h:762
SmallVector< Expr *, 4 > Counters
Counters Loop counters.
Definition: StmtOpenMP.h:804
Expr * NLB
Update of LowerBound for statically scheduled 'omp for' loops.
Definition: StmtOpenMP.h:784
Expr * PrevUB
PreviousUpperBound - local variable passed to runtime in the enclosing schedule or null if that does ...
Definition: StmtOpenMP.h:792
DistCombinedHelperExprs DistCombinedFields
Expressions used when combining OpenMP loop pragmas.
Definition: StmtOpenMP.h:826
Expr * EUB
EnsureUpperBound – expression UB = min(UB, NumIterations).
Definition: StmtOpenMP.h:782
Expr * UB
UpperBound - local variable passed to runtime.
Definition: StmtOpenMP.h:778
Expr * NUB
Update of UpperBound for statically scheduled 'omp for' loops.
Definition: StmtOpenMP.h:786
Expr * LB
LowerBound - local variable passed to runtime.
Definition: StmtOpenMP.h:776
Expr * PrevLB
PreviousLowerBound - local variable passed to runtime in the enclosing schedule or null if that does ...
Definition: StmtOpenMP.h:789
SmallVector< Expr *, 4 > DependentCounters
List of counters required for the generation of the non-rectangular loops.
Definition: StmtOpenMP.h:815
Expr * Init
Loop iteration variable init.
Definition: StmtOpenMP.h:770
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....
Definition: Stmt.h:1298