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