clang  14.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  /*NumChildre=*/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  bool HasCancel) {
689  auto *Dir = createDirective<OMPParallelSectionsDirective>(
690  C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
691  Dir->setTaskReductionRefExpr(TaskRedRef);
692  Dir->setHasCancel(HasCancel);
693  return Dir;
694 }
695 
698  unsigned NumClauses, EmptyShell) {
699  return createEmptyDirective<OMPParallelSectionsDirective>(
700  C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
701 }
702 
705  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
706  Stmt *AssociatedStmt, bool HasCancel) {
707  auto *Dir = createDirective<OMPTaskDirective>(
708  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
709  Dir->setHasCancel(HasCancel);
710  return Dir;
711 }
712 
714  unsigned NumClauses,
715  EmptyShell) {
716  return createEmptyDirective<OMPTaskDirective>(C, NumClauses,
717  /*HasAssociatedStmt=*/true);
718 }
719 
721  SourceLocation StartLoc,
722  SourceLocation EndLoc) {
723  return new (C) OMPTaskyieldDirective(StartLoc, EndLoc);
724 }
725 
727  EmptyShell) {
728  return new (C) OMPTaskyieldDirective();
729 }
730 
732  SourceLocation StartLoc,
733  SourceLocation EndLoc) {
734  return new (C) OMPBarrierDirective(StartLoc, EndLoc);
735 }
736 
738  EmptyShell) {
739  return new (C) OMPBarrierDirective();
740 }
741 
744  SourceLocation EndLoc,
745  ArrayRef<OMPClause *> Clauses) {
746  return createDirective<OMPTaskwaitDirective>(
747  C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
748  EndLoc);
749 }
750 
752  unsigned NumClauses,
753  EmptyShell) {
754  return createEmptyDirective<OMPTaskwaitDirective>(C, NumClauses);
755 }
756 
758  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
759  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) {
760  auto *Dir = createDirective<OMPTaskgroupDirective>(
761  C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
762  Dir->setReductionRef(ReductionRef);
763  return Dir;
764 }
765 
767  unsigned NumClauses,
768  EmptyShell) {
769  return createEmptyDirective<OMPTaskgroupDirective>(
770  C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
771 }
772 
774  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
775  OpenMPDirectiveKind CancelRegion) {
776  auto *Dir = new (C) OMPCancellationPointDirective(StartLoc, EndLoc);
777  Dir->setCancelRegion(CancelRegion);
778  return Dir;
779 }
780 
783  return new (C) OMPCancellationPointDirective();
784 }
785 
788  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
789  OpenMPDirectiveKind CancelRegion) {
790  auto *Dir = createDirective<OMPCancelDirective>(
791  C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
792  EndLoc);
793  Dir->setCancelRegion(CancelRegion);
794  return Dir;
795 }
796 
798  unsigned NumClauses,
799  EmptyShell) {
800  return createEmptyDirective<OMPCancelDirective>(C, NumClauses);
801 }
802 
804  SourceLocation StartLoc,
805  SourceLocation EndLoc,
806  ArrayRef<OMPClause *> Clauses) {
807  return createDirective<OMPFlushDirective>(
808  C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
809  EndLoc);
810 }
811 
813  unsigned NumClauses,
814  EmptyShell) {
815  return createEmptyDirective<OMPFlushDirective>(C, NumClauses);
816 }
817 
819  SourceLocation StartLoc,
820  SourceLocation EndLoc,
821  ArrayRef<OMPClause *> Clauses) {
822  return createDirective<OMPDepobjDirective>(
823  C, Clauses, /*AssociatedStmt=*/nullptr,
824  /*NumChildren=*/0, StartLoc, EndLoc);
825 }
826 
828  unsigned NumClauses,
829  EmptyShell) {
830  return createEmptyDirective<OMPDepobjDirective>(C, NumClauses);
831 }
832 
834  SourceLocation StartLoc,
835  SourceLocation EndLoc,
836  ArrayRef<OMPClause *> Clauses) {
837  return createDirective<OMPScanDirective>(C, Clauses,
838  /*AssociatedStmt=*/nullptr,
839  /*NumChildren=*/0, StartLoc, EndLoc);
840 }
841 
843  unsigned NumClauses,
844  EmptyShell) {
845  return createEmptyDirective<OMPScanDirective>(C, NumClauses);
846 }
847 
849  SourceLocation StartLoc,
850  SourceLocation EndLoc,
851  ArrayRef<OMPClause *> Clauses,
852  Stmt *AssociatedStmt) {
853  return createDirective<OMPOrderedDirective>(
854  C, Clauses, cast_or_null<CapturedStmt>(AssociatedStmt),
855  /*NumChildren=*/0, StartLoc, EndLoc);
856 }
857 
859  unsigned NumClauses,
860  bool IsStandalone,
861  EmptyShell) {
862  return createEmptyDirective<OMPOrderedDirective>(C, NumClauses,
863  !IsStandalone);
864 }
865 
867  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
868  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V,
869  Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate) {
870  auto *Dir = createDirective<OMPAtomicDirective>(
871  C, Clauses, AssociatedStmt, /*NumChildren=*/4, StartLoc, EndLoc);
872  Dir->setX(X);
873  Dir->setV(V);
874  Dir->setExpr(E);
875  Dir->setUpdateExpr(UE);
876  Dir->IsXLHSInRHSPart = IsXLHSInRHSPart;
877  Dir->IsPostfixUpdate = IsPostfixUpdate;
878  return Dir;
879 }
880 
882  unsigned NumClauses,
883  EmptyShell) {
884  return createEmptyDirective<OMPAtomicDirective>(
885  C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/4);
886 }
887 
889  SourceLocation StartLoc,
890  SourceLocation EndLoc,
891  ArrayRef<OMPClause *> Clauses,
892  Stmt *AssociatedStmt) {
893  return createDirective<OMPTargetDirective>(
894  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
895 }
896 
898  unsigned NumClauses,
899  EmptyShell) {
900  return createEmptyDirective<OMPTargetDirective>(C, NumClauses,
901  /*HasAssociatedStmt=*/true);
902 }
903 
905  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
906  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
907  bool HasCancel) {
908  auto *Dir = createDirective<OMPTargetParallelDirective>(
909  C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
910  Dir->setTaskReductionRefExpr(TaskRedRef);
911  Dir->setHasCancel(HasCancel);
912  return Dir;
913 }
914 
917  unsigned NumClauses, EmptyShell) {
918  return createEmptyDirective<OMPTargetParallelDirective>(
919  C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
920 }
921 
923  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
924  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
925  const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
926  auto *Dir = createDirective<OMPTargetParallelForDirective>(
927  C, Clauses, AssociatedStmt,
928  numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1, StartLoc,
929  EndLoc, CollapsedNum);
930  Dir->setIterationVariable(Exprs.IterationVarRef);
931  Dir->setLastIteration(Exprs.LastIteration);
932  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
933  Dir->setPreCond(Exprs.PreCond);
934  Dir->setCond(Exprs.Cond);
935  Dir->setInit(Exprs.Init);
936  Dir->setInc(Exprs.Inc);
937  Dir->setIsLastIterVariable(Exprs.IL);
938  Dir->setLowerBoundVariable(Exprs.LB);
939  Dir->setUpperBoundVariable(Exprs.UB);
940  Dir->setStrideVariable(Exprs.ST);
941  Dir->setEnsureUpperBound(Exprs.EUB);
942  Dir->setNextLowerBound(Exprs.NLB);
943  Dir->setNextUpperBound(Exprs.NUB);
944  Dir->setNumIterations(Exprs.NumIterations);
945  Dir->setCounters(Exprs.Counters);
946  Dir->setPrivateCounters(Exprs.PrivateCounters);
947  Dir->setInits(Exprs.Inits);
948  Dir->setUpdates(Exprs.Updates);
949  Dir->setFinals(Exprs.Finals);
950  Dir->setDependentCounters(Exprs.DependentCounters);
951  Dir->setDependentInits(Exprs.DependentInits);
952  Dir->setFinalsConditions(Exprs.FinalsConditions);
953  Dir->setPreInits(Exprs.PreInits);
954  Dir->setTaskReductionRefExpr(TaskRedRef);
955  Dir->setHasCancel(HasCancel);
956  return Dir;
957 }
958 
961  unsigned NumClauses,
962  unsigned CollapsedNum, EmptyShell) {
963  return createEmptyDirective<OMPTargetParallelForDirective>(
964  C, NumClauses, /*HasAssociatedStmt=*/true,
965  numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1,
966  CollapsedNum);
967 }
968 
970  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
971  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
972  return createDirective<OMPTargetDataDirective>(
973  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
974 }
975 
977  unsigned N,
978  EmptyShell) {
979  return createEmptyDirective<OMPTargetDataDirective>(
980  C, N, /*HasAssociatedStmt=*/true);
981 }
982 
984  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
985  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
986  return createDirective<OMPTargetEnterDataDirective>(
987  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
988 }
989 
992  EmptyShell) {
993  return createEmptyDirective<OMPTargetEnterDataDirective>(
994  C, N, /*HasAssociatedStmt=*/true);
995 }
996 
998  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
999  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1000  return createDirective<OMPTargetExitDataDirective>(
1001  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1002 }
1003 
1006  EmptyShell) {
1007  return createEmptyDirective<OMPTargetExitDataDirective>(
1008  C, N, /*HasAssociatedStmt=*/true);
1009 }
1010 
1012  SourceLocation StartLoc,
1013  SourceLocation EndLoc,
1014  ArrayRef<OMPClause *> Clauses,
1015  Stmt *AssociatedStmt) {
1016  return createDirective<OMPTeamsDirective>(
1017  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1018 }
1019 
1021  unsigned NumClauses,
1022  EmptyShell) {
1023  return createEmptyDirective<OMPTeamsDirective>(C, NumClauses,
1024  /*HasAssociatedStmt=*/true);
1025 }
1026 
1028  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1029  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1030  const HelperExprs &Exprs, bool HasCancel) {
1031  auto *Dir = createDirective<OMPTaskLoopDirective>(
1032  C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_taskloop),
1033  StartLoc, EndLoc, CollapsedNum);
1034  Dir->setIterationVariable(Exprs.IterationVarRef);
1035  Dir->setLastIteration(Exprs.LastIteration);
1036  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1037  Dir->setPreCond(Exprs.PreCond);
1038  Dir->setCond(Exprs.Cond);
1039  Dir->setInit(Exprs.Init);
1040  Dir->setInc(Exprs.Inc);
1041  Dir->setIsLastIterVariable(Exprs.IL);
1042  Dir->setLowerBoundVariable(Exprs.LB);
1043  Dir->setUpperBoundVariable(Exprs.UB);
1044  Dir->setStrideVariable(Exprs.ST);
1045  Dir->setEnsureUpperBound(Exprs.EUB);
1046  Dir->setNextLowerBound(Exprs.NLB);
1047  Dir->setNextUpperBound(Exprs.NUB);
1048  Dir->setNumIterations(Exprs.NumIterations);
1049  Dir->setCounters(Exprs.Counters);
1050  Dir->setPrivateCounters(Exprs.PrivateCounters);
1051  Dir->setInits(Exprs.Inits);
1052  Dir->setUpdates(Exprs.Updates);
1053  Dir->setFinals(Exprs.Finals);
1054  Dir->setDependentCounters(Exprs.DependentCounters);
1055  Dir->setDependentInits(Exprs.DependentInits);
1056  Dir->setFinalsConditions(Exprs.FinalsConditions);
1057  Dir->setPreInits(Exprs.PreInits);
1058  Dir->setHasCancel(HasCancel);
1059  return Dir;
1060 }
1061 
1063  unsigned NumClauses,
1064  unsigned CollapsedNum,
1065  EmptyShell) {
1066  return createEmptyDirective<OMPTaskLoopDirective>(
1067  C, NumClauses, /*HasAssociatedStmt=*/true,
1068  numLoopChildren(CollapsedNum, OMPD_taskloop), CollapsedNum);
1069 }
1070 
1072  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1073  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1074  const HelperExprs &Exprs) {
1075  auto *Dir = createDirective<OMPTaskLoopSimdDirective>(
1076  C, Clauses, AssociatedStmt,
1077  numLoopChildren(CollapsedNum, OMPD_taskloop_simd), StartLoc, EndLoc,
1078  CollapsedNum);
1079  Dir->setIterationVariable(Exprs.IterationVarRef);
1080  Dir->setLastIteration(Exprs.LastIteration);
1081  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1082  Dir->setPreCond(Exprs.PreCond);
1083  Dir->setCond(Exprs.Cond);
1084  Dir->setInit(Exprs.Init);
1085  Dir->setInc(Exprs.Inc);
1086  Dir->setIsLastIterVariable(Exprs.IL);
1087  Dir->setLowerBoundVariable(Exprs.LB);
1088  Dir->setUpperBoundVariable(Exprs.UB);
1089  Dir->setStrideVariable(Exprs.ST);
1090  Dir->setEnsureUpperBound(Exprs.EUB);
1091  Dir->setNextLowerBound(Exprs.NLB);
1092  Dir->setNextUpperBound(Exprs.NUB);
1093  Dir->setNumIterations(Exprs.NumIterations);
1094  Dir->setCounters(Exprs.Counters);
1095  Dir->setPrivateCounters(Exprs.PrivateCounters);
1096  Dir->setInits(Exprs.Inits);
1097  Dir->setUpdates(Exprs.Updates);
1098  Dir->setFinals(Exprs.Finals);
1099  Dir->setDependentCounters(Exprs.DependentCounters);
1100  Dir->setDependentInits(Exprs.DependentInits);
1101  Dir->setFinalsConditions(Exprs.FinalsConditions);
1102  Dir->setPreInits(Exprs.PreInits);
1103  return Dir;
1104 }
1105 
1108  unsigned CollapsedNum, EmptyShell) {
1109  return createEmptyDirective<OMPTaskLoopSimdDirective>(
1110  C, NumClauses, /*HasAssociatedStmt=*/true,
1111  numLoopChildren(CollapsedNum, OMPD_taskloop_simd), CollapsedNum);
1112 }
1113 
1115  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1116  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1117  const HelperExprs &Exprs, bool HasCancel) {
1118  auto *Dir = createDirective<OMPMasterTaskLoopDirective>(
1119  C, Clauses, AssociatedStmt,
1120  numLoopChildren(CollapsedNum, OMPD_master_taskloop), StartLoc, EndLoc,
1121  CollapsedNum);
1122  Dir->setIterationVariable(Exprs.IterationVarRef);
1123  Dir->setLastIteration(Exprs.LastIteration);
1124  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1125  Dir->setPreCond(Exprs.PreCond);
1126  Dir->setCond(Exprs.Cond);
1127  Dir->setInit(Exprs.Init);
1128  Dir->setInc(Exprs.Inc);
1129  Dir->setIsLastIterVariable(Exprs.IL);
1130  Dir->setLowerBoundVariable(Exprs.LB);
1131  Dir->setUpperBoundVariable(Exprs.UB);
1132  Dir->setStrideVariable(Exprs.ST);
1133  Dir->setEnsureUpperBound(Exprs.EUB);
1134  Dir->setNextLowerBound(Exprs.NLB);
1135  Dir->setNextUpperBound(Exprs.NUB);
1136  Dir->setNumIterations(Exprs.NumIterations);
1137  Dir->setCounters(Exprs.Counters);
1138  Dir->setPrivateCounters(Exprs.PrivateCounters);
1139  Dir->setInits(Exprs.Inits);
1140  Dir->setUpdates(Exprs.Updates);
1141  Dir->setFinals(Exprs.Finals);
1142  Dir->setDependentCounters(Exprs.DependentCounters);
1143  Dir->setDependentInits(Exprs.DependentInits);
1144  Dir->setFinalsConditions(Exprs.FinalsConditions);
1145  Dir->setPreInits(Exprs.PreInits);
1146  Dir->setHasCancel(HasCancel);
1147  return Dir;
1148 }
1149 
1152  unsigned NumClauses,
1153  unsigned CollapsedNum, EmptyShell) {
1154  return createEmptyDirective<OMPMasterTaskLoopDirective>(
1155  C, NumClauses, /*HasAssociatedStmt=*/true,
1156  numLoopChildren(CollapsedNum, OMPD_master_taskloop), CollapsedNum);
1157 }
1158 
1160  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1161  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1162  const HelperExprs &Exprs) {
1163  auto *Dir = createDirective<OMPMasterTaskLoopSimdDirective>(
1164  C, Clauses, AssociatedStmt,
1165  numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), StartLoc,
1166  EndLoc, CollapsedNum);
1167  Dir->setIterationVariable(Exprs.IterationVarRef);
1168  Dir->setLastIteration(Exprs.LastIteration);
1169  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1170  Dir->setPreCond(Exprs.PreCond);
1171  Dir->setCond(Exprs.Cond);
1172  Dir->setInit(Exprs.Init);
1173  Dir->setInc(Exprs.Inc);
1174  Dir->setIsLastIterVariable(Exprs.IL);
1175  Dir->setLowerBoundVariable(Exprs.LB);
1176  Dir->setUpperBoundVariable(Exprs.UB);
1177  Dir->setStrideVariable(Exprs.ST);
1178  Dir->setEnsureUpperBound(Exprs.EUB);
1179  Dir->setNextLowerBound(Exprs.NLB);
1180  Dir->setNextUpperBound(Exprs.NUB);
1181  Dir->setNumIterations(Exprs.NumIterations);
1182  Dir->setCounters(Exprs.Counters);
1183  Dir->setPrivateCounters(Exprs.PrivateCounters);
1184  Dir->setInits(Exprs.Inits);
1185  Dir->setUpdates(Exprs.Updates);
1186  Dir->setFinals(Exprs.Finals);
1187  Dir->setDependentCounters(Exprs.DependentCounters);
1188  Dir->setDependentInits(Exprs.DependentInits);
1189  Dir->setFinalsConditions(Exprs.FinalsConditions);
1190  Dir->setPreInits(Exprs.PreInits);
1191  return Dir;
1192 }
1193 
1196  unsigned NumClauses,
1197  unsigned CollapsedNum, EmptyShell) {
1198  return createEmptyDirective<OMPMasterTaskLoopSimdDirective>(
1199  C, NumClauses, /*HasAssociatedStmt=*/true,
1200  numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), CollapsedNum);
1201 }
1202 
1204  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1205  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1206  const HelperExprs &Exprs, bool HasCancel) {
1207  auto *Dir = createDirective<OMPParallelMasterTaskLoopDirective>(
1208  C, Clauses, AssociatedStmt,
1209  numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop), StartLoc,
1210  EndLoc, CollapsedNum);
1211  Dir->setIterationVariable(Exprs.IterationVarRef);
1212  Dir->setLastIteration(Exprs.LastIteration);
1213  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1214  Dir->setPreCond(Exprs.PreCond);
1215  Dir->setCond(Exprs.Cond);
1216  Dir->setInit(Exprs.Init);
1217  Dir->setInc(Exprs.Inc);
1218  Dir->setIsLastIterVariable(Exprs.IL);
1219  Dir->setLowerBoundVariable(Exprs.LB);
1220  Dir->setUpperBoundVariable(Exprs.UB);
1221  Dir->setStrideVariable(Exprs.ST);
1222  Dir->setEnsureUpperBound(Exprs.EUB);
1223  Dir->setNextLowerBound(Exprs.NLB);
1224  Dir->setNextUpperBound(Exprs.NUB);
1225  Dir->setNumIterations(Exprs.NumIterations);
1226  Dir->setCounters(Exprs.Counters);
1227  Dir->setPrivateCounters(Exprs.PrivateCounters);
1228  Dir->setInits(Exprs.Inits);
1229  Dir->setUpdates(Exprs.Updates);
1230  Dir->setFinals(Exprs.Finals);
1231  Dir->setDependentCounters(Exprs.DependentCounters);
1232  Dir->setDependentInits(Exprs.DependentInits);
1233  Dir->setFinalsConditions(Exprs.FinalsConditions);
1234  Dir->setPreInits(Exprs.PreInits);
1235  Dir->setHasCancel(HasCancel);
1236  return Dir;
1237 }
1238 
1241  unsigned NumClauses,
1242  unsigned CollapsedNum,
1243  EmptyShell) {
1244  return createEmptyDirective<OMPParallelMasterTaskLoopDirective>(
1245  C, NumClauses, /*HasAssociatedStmt=*/true,
1246  numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop),
1247  CollapsedNum);
1248 }
1249 
1252  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1253  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1254  const HelperExprs &Exprs) {
1255  auto *Dir = createDirective<OMPParallelMasterTaskLoopSimdDirective>(
1256  C, Clauses, AssociatedStmt,
1257  numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),
1258  StartLoc, EndLoc, CollapsedNum);
1259  Dir->setIterationVariable(Exprs.IterationVarRef);
1260  Dir->setLastIteration(Exprs.LastIteration);
1261  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1262  Dir->setPreCond(Exprs.PreCond);
1263  Dir->setCond(Exprs.Cond);
1264  Dir->setInit(Exprs.Init);
1265  Dir->setInc(Exprs.Inc);
1266  Dir->setIsLastIterVariable(Exprs.IL);
1267  Dir->setLowerBoundVariable(Exprs.LB);
1268  Dir->setUpperBoundVariable(Exprs.UB);
1269  Dir->setStrideVariable(Exprs.ST);
1270  Dir->setEnsureUpperBound(Exprs.EUB);
1271  Dir->setNextLowerBound(Exprs.NLB);
1272  Dir->setNextUpperBound(Exprs.NUB);
1273  Dir->setNumIterations(Exprs.NumIterations);
1274  Dir->setCounters(Exprs.Counters);
1275  Dir->setPrivateCounters(Exprs.PrivateCounters);
1276  Dir->setInits(Exprs.Inits);
1277  Dir->setUpdates(Exprs.Updates);
1278  Dir->setFinals(Exprs.Finals);
1279  Dir->setDependentCounters(Exprs.DependentCounters);
1280  Dir->setDependentInits(Exprs.DependentInits);
1281  Dir->setFinalsConditions(Exprs.FinalsConditions);
1282  Dir->setPreInits(Exprs.PreInits);
1283  return Dir;
1284 }
1285 
1288  unsigned NumClauses,
1289  unsigned CollapsedNum,
1290  EmptyShell) {
1291  return createEmptyDirective<OMPParallelMasterTaskLoopSimdDirective>(
1292  C, NumClauses, /*HasAssociatedStmt=*/true,
1293  numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),
1294  CollapsedNum);
1295 }
1296 
1298  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1299  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1300  const HelperExprs &Exprs) {
1301  auto *Dir = createDirective<OMPDistributeDirective>(
1302  C, Clauses, AssociatedStmt,
1303  numLoopChildren(CollapsedNum, OMPD_distribute), StartLoc, EndLoc,
1304  CollapsedNum);
1305  Dir->setIterationVariable(Exprs.IterationVarRef);
1306  Dir->setLastIteration(Exprs.LastIteration);
1307  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1308  Dir->setPreCond(Exprs.PreCond);
1309  Dir->setCond(Exprs.Cond);
1310  Dir->setInit(Exprs.Init);
1311  Dir->setInc(Exprs.Inc);
1312  Dir->setIsLastIterVariable(Exprs.IL);
1313  Dir->setLowerBoundVariable(Exprs.LB);
1314  Dir->setUpperBoundVariable(Exprs.UB);
1315  Dir->setStrideVariable(Exprs.ST);
1316  Dir->setEnsureUpperBound(Exprs.EUB);
1317  Dir->setNextLowerBound(Exprs.NLB);
1318  Dir->setNextUpperBound(Exprs.NUB);
1319  Dir->setNumIterations(Exprs.NumIterations);
1320  Dir->setCounters(Exprs.Counters);
1321  Dir->setPrivateCounters(Exprs.PrivateCounters);
1322  Dir->setInits(Exprs.Inits);
1323  Dir->setUpdates(Exprs.Updates);
1324  Dir->setFinals(Exprs.Finals);
1325  Dir->setDependentCounters(Exprs.DependentCounters);
1326  Dir->setDependentInits(Exprs.DependentInits);
1327  Dir->setFinalsConditions(Exprs.FinalsConditions);
1328  Dir->setPreInits(Exprs.PreInits);
1329  return Dir;
1330 }
1331 
1333 OMPDistributeDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
1334  unsigned CollapsedNum, EmptyShell) {
1335  return createEmptyDirective<OMPDistributeDirective>(
1336  C, NumClauses, /*HasAssociatedStmt=*/true,
1337  numLoopChildren(CollapsedNum, OMPD_distribute), CollapsedNum);
1338 }
1339 
1341  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1342  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1343  return createDirective<OMPTargetUpdateDirective>(C, Clauses, AssociatedStmt,
1344  /*NumChildren=*/0, StartLoc,
1345  EndLoc);
1346 }
1347 
1350  EmptyShell) {
1351  return createEmptyDirective<OMPTargetUpdateDirective>(
1352  C, NumClauses, /*HasAssociatedStmt=*/true);
1353 }
1354 
1356  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1357  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1358  const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1359  auto *Dir = createDirective<OMPDistributeParallelForDirective>(
1360  C, Clauses, AssociatedStmt,
1361  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1, StartLoc,
1362  EndLoc, CollapsedNum);
1363  Dir->setIterationVariable(Exprs.IterationVarRef);
1364  Dir->setLastIteration(Exprs.LastIteration);
1365  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1366  Dir->setPreCond(Exprs.PreCond);
1367  Dir->setCond(Exprs.Cond);
1368  Dir->setInit(Exprs.Init);
1369  Dir->setInc(Exprs.Inc);
1370  Dir->setIsLastIterVariable(Exprs.IL);
1371  Dir->setLowerBoundVariable(Exprs.LB);
1372  Dir->setUpperBoundVariable(Exprs.UB);
1373  Dir->setStrideVariable(Exprs.ST);
1374  Dir->setEnsureUpperBound(Exprs.EUB);
1375  Dir->setNextLowerBound(Exprs.NLB);
1376  Dir->setNextUpperBound(Exprs.NUB);
1377  Dir->setNumIterations(Exprs.NumIterations);
1378  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1379  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1380  Dir->setDistInc(Exprs.DistInc);
1381  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
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->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1392  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1393  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1394  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1395  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1396  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1397  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1398  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1399  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1400  Dir->setTaskReductionRefExpr(TaskRedRef);
1401  Dir->HasCancel = HasCancel;
1402  return Dir;
1403 }
1404 
1407  unsigned NumClauses,
1408  unsigned CollapsedNum,
1409  EmptyShell) {
1410  return createEmptyDirective<OMPDistributeParallelForDirective>(
1411  C, NumClauses, /*HasAssociatedStmt=*/true,
1412  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1,
1413  CollapsedNum);
1414 }
1415 
1418  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1419  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1420  const HelperExprs &Exprs) {
1421  auto *Dir = createDirective<OMPDistributeParallelForSimdDirective>(
1422  C, Clauses, AssociatedStmt,
1423  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),
1424  StartLoc, EndLoc, CollapsedNum);
1425  Dir->setIterationVariable(Exprs.IterationVarRef);
1426  Dir->setLastIteration(Exprs.LastIteration);
1427  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1428  Dir->setPreCond(Exprs.PreCond);
1429  Dir->setCond(Exprs.Cond);
1430  Dir->setInit(Exprs.Init);
1431  Dir->setInc(Exprs.Inc);
1432  Dir->setIsLastIterVariable(Exprs.IL);
1433  Dir->setLowerBoundVariable(Exprs.LB);
1434  Dir->setUpperBoundVariable(Exprs.UB);
1435  Dir->setStrideVariable(Exprs.ST);
1436  Dir->setEnsureUpperBound(Exprs.EUB);
1437  Dir->setNextLowerBound(Exprs.NLB);
1438  Dir->setNextUpperBound(Exprs.NUB);
1439  Dir->setNumIterations(Exprs.NumIterations);
1440  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1441  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1442  Dir->setDistInc(Exprs.DistInc);
1443  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1444  Dir->setCounters(Exprs.Counters);
1445  Dir->setPrivateCounters(Exprs.PrivateCounters);
1446  Dir->setInits(Exprs.Inits);
1447  Dir->setUpdates(Exprs.Updates);
1448  Dir->setFinals(Exprs.Finals);
1449  Dir->setDependentCounters(Exprs.DependentCounters);
1450  Dir->setDependentInits(Exprs.DependentInits);
1451  Dir->setFinalsConditions(Exprs.FinalsConditions);
1452  Dir->setPreInits(Exprs.PreInits);
1453  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1454  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1455  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1456  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1457  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1458  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1459  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1460  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1461  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1462  return Dir;
1463 }
1464 
1467  unsigned NumClauses,
1468  unsigned CollapsedNum,
1469  EmptyShell) {
1470  return createEmptyDirective<OMPDistributeParallelForSimdDirective>(
1471  C, NumClauses, /*HasAssociatedStmt=*/true,
1472  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),
1473  CollapsedNum);
1474 }
1475 
1477  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1478  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1479  const HelperExprs &Exprs) {
1480  auto *Dir = createDirective<OMPDistributeSimdDirective>(
1481  C, Clauses, AssociatedStmt,
1482  numLoopChildren(CollapsedNum, OMPD_distribute_simd), StartLoc, EndLoc,
1483  CollapsedNum);
1484  Dir->setIterationVariable(Exprs.IterationVarRef);
1485  Dir->setLastIteration(Exprs.LastIteration);
1486  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1487  Dir->setPreCond(Exprs.PreCond);
1488  Dir->setCond(Exprs.Cond);
1489  Dir->setInit(Exprs.Init);
1490  Dir->setInc(Exprs.Inc);
1491  Dir->setIsLastIterVariable(Exprs.IL);
1492  Dir->setLowerBoundVariable(Exprs.LB);
1493  Dir->setUpperBoundVariable(Exprs.UB);
1494  Dir->setStrideVariable(Exprs.ST);
1495  Dir->setEnsureUpperBound(Exprs.EUB);
1496  Dir->setNextLowerBound(Exprs.NLB);
1497  Dir->setNextUpperBound(Exprs.NUB);
1498  Dir->setNumIterations(Exprs.NumIterations);
1499  Dir->setCounters(Exprs.Counters);
1500  Dir->setPrivateCounters(Exprs.PrivateCounters);
1501  Dir->setInits(Exprs.Inits);
1502  Dir->setUpdates(Exprs.Updates);
1503  Dir->setFinals(Exprs.Finals);
1504  Dir->setDependentCounters(Exprs.DependentCounters);
1505  Dir->setDependentInits(Exprs.DependentInits);
1506  Dir->setFinalsConditions(Exprs.FinalsConditions);
1507  Dir->setPreInits(Exprs.PreInits);
1508  return Dir;
1509 }
1510 
1513  unsigned NumClauses,
1514  unsigned CollapsedNum, EmptyShell) {
1515  return createEmptyDirective<OMPDistributeSimdDirective>(
1516  C, NumClauses, /*HasAssociatedStmt=*/true,
1517  numLoopChildren(CollapsedNum, OMPD_distribute_simd), CollapsedNum);
1518 }
1519 
1521  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1522  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1523  const HelperExprs &Exprs) {
1524  auto *Dir = createDirective<OMPTargetParallelForSimdDirective>(
1525  C, Clauses, AssociatedStmt,
1526  numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd), StartLoc,
1527  EndLoc, CollapsedNum);
1528  Dir->setIterationVariable(Exprs.IterationVarRef);
1529  Dir->setLastIteration(Exprs.LastIteration);
1530  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1531  Dir->setPreCond(Exprs.PreCond);
1532  Dir->setCond(Exprs.Cond);
1533  Dir->setInit(Exprs.Init);
1534  Dir->setInc(Exprs.Inc);
1535  Dir->setIsLastIterVariable(Exprs.IL);
1536  Dir->setLowerBoundVariable(Exprs.LB);
1537  Dir->setUpperBoundVariable(Exprs.UB);
1538  Dir->setStrideVariable(Exprs.ST);
1539  Dir->setEnsureUpperBound(Exprs.EUB);
1540  Dir->setNextLowerBound(Exprs.NLB);
1541  Dir->setNextUpperBound(Exprs.NUB);
1542  Dir->setNumIterations(Exprs.NumIterations);
1543  Dir->setCounters(Exprs.Counters);
1544  Dir->setPrivateCounters(Exprs.PrivateCounters);
1545  Dir->setInits(Exprs.Inits);
1546  Dir->setUpdates(Exprs.Updates);
1547  Dir->setFinals(Exprs.Finals);
1548  Dir->setDependentCounters(Exprs.DependentCounters);
1549  Dir->setDependentInits(Exprs.DependentInits);
1550  Dir->setFinalsConditions(Exprs.FinalsConditions);
1551  Dir->setPreInits(Exprs.PreInits);
1552  return Dir;
1553 }
1554 
1557  unsigned NumClauses,
1558  unsigned CollapsedNum,
1559  EmptyShell) {
1560  return createEmptyDirective<OMPTargetParallelForSimdDirective>(
1561  C, NumClauses, /*HasAssociatedStmt=*/true,
1562  numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd),
1563  CollapsedNum);
1564 }
1565 
1568  SourceLocation EndLoc, unsigned CollapsedNum,
1569  ArrayRef<OMPClause *> Clauses,
1570  Stmt *AssociatedStmt, const HelperExprs &Exprs) {
1571  auto *Dir = createDirective<OMPTargetSimdDirective>(
1572  C, Clauses, AssociatedStmt,
1573  numLoopChildren(CollapsedNum, OMPD_target_simd), StartLoc, EndLoc,
1574  CollapsedNum);
1575  Dir->setIterationVariable(Exprs.IterationVarRef);
1576  Dir->setLastIteration(Exprs.LastIteration);
1577  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1578  Dir->setPreCond(Exprs.PreCond);
1579  Dir->setCond(Exprs.Cond);
1580  Dir->setInit(Exprs.Init);
1581  Dir->setInc(Exprs.Inc);
1582  Dir->setCounters(Exprs.Counters);
1583  Dir->setPrivateCounters(Exprs.PrivateCounters);
1584  Dir->setInits(Exprs.Inits);
1585  Dir->setUpdates(Exprs.Updates);
1586  Dir->setFinals(Exprs.Finals);
1587  Dir->setDependentCounters(Exprs.DependentCounters);
1588  Dir->setDependentInits(Exprs.DependentInits);
1589  Dir->setFinalsConditions(Exprs.FinalsConditions);
1590  Dir->setPreInits(Exprs.PreInits);
1591  return Dir;
1592 }
1593 
1595 OMPTargetSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
1596  unsigned CollapsedNum, EmptyShell) {
1597  return createEmptyDirective<OMPTargetSimdDirective>(
1598  C, NumClauses, /*HasAssociatedStmt=*/true,
1599  numLoopChildren(CollapsedNum, OMPD_target_simd), CollapsedNum);
1600 }
1601 
1603  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1604  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1605  const HelperExprs &Exprs) {
1606  auto *Dir = createDirective<OMPTeamsDistributeDirective>(
1607  C, Clauses, AssociatedStmt,
1608  numLoopChildren(CollapsedNum, OMPD_teams_distribute), StartLoc, EndLoc,
1609  CollapsedNum);
1610  Dir->setIterationVariable(Exprs.IterationVarRef);
1611  Dir->setLastIteration(Exprs.LastIteration);
1612  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1613  Dir->setPreCond(Exprs.PreCond);
1614  Dir->setCond(Exprs.Cond);
1615  Dir->setInit(Exprs.Init);
1616  Dir->setInc(Exprs.Inc);
1617  Dir->setIsLastIterVariable(Exprs.IL);
1618  Dir->setLowerBoundVariable(Exprs.LB);
1619  Dir->setUpperBoundVariable(Exprs.UB);
1620  Dir->setStrideVariable(Exprs.ST);
1621  Dir->setEnsureUpperBound(Exprs.EUB);
1622  Dir->setNextLowerBound(Exprs.NLB);
1623  Dir->setNextUpperBound(Exprs.NUB);
1624  Dir->setNumIterations(Exprs.NumIterations);
1625  Dir->setCounters(Exprs.Counters);
1626  Dir->setPrivateCounters(Exprs.PrivateCounters);
1627  Dir->setInits(Exprs.Inits);
1628  Dir->setUpdates(Exprs.Updates);
1629  Dir->setFinals(Exprs.Finals);
1630  Dir->setDependentCounters(Exprs.DependentCounters);
1631  Dir->setDependentInits(Exprs.DependentInits);
1632  Dir->setFinalsConditions(Exprs.FinalsConditions);
1633  Dir->setPreInits(Exprs.PreInits);
1634  return Dir;
1635 }
1636 
1639  unsigned NumClauses,
1640  unsigned CollapsedNum, EmptyShell) {
1641  return createEmptyDirective<OMPTeamsDistributeDirective>(
1642  C, NumClauses, /*HasAssociatedStmt=*/true,
1643  numLoopChildren(CollapsedNum, OMPD_teams_distribute), CollapsedNum);
1644 }
1645 
1647  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1648  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1649  const HelperExprs &Exprs) {
1650  auto *Dir = createDirective<OMPTeamsDistributeSimdDirective>(
1651  C, Clauses, AssociatedStmt,
1652  numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), StartLoc,
1653  EndLoc, CollapsedNum);
1654  Dir->setIterationVariable(Exprs.IterationVarRef);
1655  Dir->setLastIteration(Exprs.LastIteration);
1656  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1657  Dir->setPreCond(Exprs.PreCond);
1658  Dir->setCond(Exprs.Cond);
1659  Dir->setInit(Exprs.Init);
1660  Dir->setInc(Exprs.Inc);
1661  Dir->setIsLastIterVariable(Exprs.IL);
1662  Dir->setLowerBoundVariable(Exprs.LB);
1663  Dir->setUpperBoundVariable(Exprs.UB);
1664  Dir->setStrideVariable(Exprs.ST);
1665  Dir->setEnsureUpperBound(Exprs.EUB);
1666  Dir->setNextLowerBound(Exprs.NLB);
1667  Dir->setNextUpperBound(Exprs.NUB);
1668  Dir->setNumIterations(Exprs.NumIterations);
1669  Dir->setCounters(Exprs.Counters);
1670  Dir->setPrivateCounters(Exprs.PrivateCounters);
1671  Dir->setInits(Exprs.Inits);
1672  Dir->setUpdates(Exprs.Updates);
1673  Dir->setFinals(Exprs.Finals);
1674  Dir->setDependentCounters(Exprs.DependentCounters);
1675  Dir->setDependentInits(Exprs.DependentInits);
1676  Dir->setFinalsConditions(Exprs.FinalsConditions);
1677  Dir->setPreInits(Exprs.PreInits);
1678  return Dir;
1679 }
1680 
1682  const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1683  EmptyShell) {
1684  return createEmptyDirective<OMPTeamsDistributeSimdDirective>(
1685  C, NumClauses, /*HasAssociatedStmt=*/true,
1686  numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), CollapsedNum);
1687 }
1688 
1691  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1692  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1693  const HelperExprs &Exprs) {
1694  auto *Dir = createDirective<OMPTeamsDistributeParallelForSimdDirective>(
1695  C, Clauses, AssociatedStmt,
1696  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
1697  StartLoc, EndLoc, CollapsedNum);
1698  Dir->setIterationVariable(Exprs.IterationVarRef);
1699  Dir->setLastIteration(Exprs.LastIteration);
1700  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1701  Dir->setPreCond(Exprs.PreCond);
1702  Dir->setCond(Exprs.Cond);
1703  Dir->setInit(Exprs.Init);
1704  Dir->setInc(Exprs.Inc);
1705  Dir->setIsLastIterVariable(Exprs.IL);
1706  Dir->setLowerBoundVariable(Exprs.LB);
1707  Dir->setUpperBoundVariable(Exprs.UB);
1708  Dir->setStrideVariable(Exprs.ST);
1709  Dir->setEnsureUpperBound(Exprs.EUB);
1710  Dir->setNextLowerBound(Exprs.NLB);
1711  Dir->setNextUpperBound(Exprs.NUB);
1712  Dir->setNumIterations(Exprs.NumIterations);
1713  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1714  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1715  Dir->setDistInc(Exprs.DistInc);
1716  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1717  Dir->setCounters(Exprs.Counters);
1718  Dir->setPrivateCounters(Exprs.PrivateCounters);
1719  Dir->setInits(Exprs.Inits);
1720  Dir->setUpdates(Exprs.Updates);
1721  Dir->setFinals(Exprs.Finals);
1722  Dir->setDependentCounters(Exprs.DependentCounters);
1723  Dir->setDependentInits(Exprs.DependentInits);
1724  Dir->setFinalsConditions(Exprs.FinalsConditions);
1725  Dir->setPreInits(Exprs.PreInits);
1726  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1727  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1728  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1729  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1730  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1731  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1732  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1733  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1734  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1735  return Dir;
1736 }
1737 
1740  unsigned NumClauses,
1741  unsigned CollapsedNum,
1742  EmptyShell) {
1743  return createEmptyDirective<OMPTeamsDistributeParallelForSimdDirective>(
1744  C, NumClauses, /*HasAssociatedStmt=*/true,
1745  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
1746  CollapsedNum);
1747 }
1748 
1751  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1752  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1753  const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1754  auto *Dir = createDirective<OMPTeamsDistributeParallelForDirective>(
1755  C, Clauses, AssociatedStmt,
1756  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
1757  StartLoc, EndLoc, CollapsedNum);
1758  Dir->setIterationVariable(Exprs.IterationVarRef);
1759  Dir->setLastIteration(Exprs.LastIteration);
1760  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1761  Dir->setPreCond(Exprs.PreCond);
1762  Dir->setCond(Exprs.Cond);
1763  Dir->setInit(Exprs.Init);
1764  Dir->setInc(Exprs.Inc);
1765  Dir->setIsLastIterVariable(Exprs.IL);
1766  Dir->setLowerBoundVariable(Exprs.LB);
1767  Dir->setUpperBoundVariable(Exprs.UB);
1768  Dir->setStrideVariable(Exprs.ST);
1769  Dir->setEnsureUpperBound(Exprs.EUB);
1770  Dir->setNextLowerBound(Exprs.NLB);
1771  Dir->setNextUpperBound(Exprs.NUB);
1772  Dir->setNumIterations(Exprs.NumIterations);
1773  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1774  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1775  Dir->setDistInc(Exprs.DistInc);
1776  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1777  Dir->setCounters(Exprs.Counters);
1778  Dir->setPrivateCounters(Exprs.PrivateCounters);
1779  Dir->setInits(Exprs.Inits);
1780  Dir->setUpdates(Exprs.Updates);
1781  Dir->setFinals(Exprs.Finals);
1782  Dir->setDependentCounters(Exprs.DependentCounters);
1783  Dir->setDependentInits(Exprs.DependentInits);
1784  Dir->setFinalsConditions(Exprs.FinalsConditions);
1785  Dir->setPreInits(Exprs.PreInits);
1786  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1787  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1788  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1789  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1790  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1791  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1792  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1793  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1794  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1795  Dir->setTaskReductionRefExpr(TaskRedRef);
1796  Dir->HasCancel = HasCancel;
1797  return Dir;
1798 }
1799 
1802  unsigned NumClauses,
1803  unsigned CollapsedNum,
1804  EmptyShell) {
1805  return createEmptyDirective<OMPTeamsDistributeParallelForDirective>(
1806  C, NumClauses, /*HasAssociatedStmt=*/true,
1807  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
1808  CollapsedNum);
1809 }
1810 
1812  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1813  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1814  return createDirective<OMPTargetTeamsDirective>(C, Clauses, AssociatedStmt,
1815  /*NumChildren=*/0, StartLoc,
1816  EndLoc);
1817 }
1818 
1820 OMPTargetTeamsDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
1821  EmptyShell) {
1822  return createEmptyDirective<OMPTargetTeamsDirective>(
1823  C, NumClauses, /*HasAssociatedStmt=*/true);
1824 }
1825 
1827  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1828  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1829  const HelperExprs &Exprs) {
1830  auto *Dir = createDirective<OMPTargetTeamsDistributeDirective>(
1831  C, Clauses, AssociatedStmt,
1832  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute), StartLoc,
1833  EndLoc, CollapsedNum);
1834  Dir->setIterationVariable(Exprs.IterationVarRef);
1835  Dir->setLastIteration(Exprs.LastIteration);
1836  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1837  Dir->setPreCond(Exprs.PreCond);
1838  Dir->setCond(Exprs.Cond);
1839  Dir->setInit(Exprs.Init);
1840  Dir->setInc(Exprs.Inc);
1841  Dir->setIsLastIterVariable(Exprs.IL);
1842  Dir->setLowerBoundVariable(Exprs.LB);
1843  Dir->setUpperBoundVariable(Exprs.UB);
1844  Dir->setStrideVariable(Exprs.ST);
1845  Dir->setEnsureUpperBound(Exprs.EUB);
1846  Dir->setNextLowerBound(Exprs.NLB);
1847  Dir->setNextUpperBound(Exprs.NUB);
1848  Dir->setNumIterations(Exprs.NumIterations);
1849  Dir->setCounters(Exprs.Counters);
1850  Dir->setPrivateCounters(Exprs.PrivateCounters);
1851  Dir->setInits(Exprs.Inits);
1852  Dir->setUpdates(Exprs.Updates);
1853  Dir->setFinals(Exprs.Finals);
1854  Dir->setDependentCounters(Exprs.DependentCounters);
1855  Dir->setDependentInits(Exprs.DependentInits);
1856  Dir->setFinalsConditions(Exprs.FinalsConditions);
1857  Dir->setPreInits(Exprs.PreInits);
1858  return Dir;
1859 }
1860 
1863  unsigned NumClauses,
1864  unsigned CollapsedNum,
1865  EmptyShell) {
1866  return createEmptyDirective<OMPTargetTeamsDistributeDirective>(
1867  C, NumClauses, /*HasAssociatedStmt=*/true,
1868  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute),
1869  CollapsedNum);
1870 }
1871 
1874  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1875  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1876  const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1877  auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForDirective>(
1878  C, Clauses, AssociatedStmt,
1879  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
1880  1,
1881  StartLoc, EndLoc, CollapsedNum);
1882  Dir->setIterationVariable(Exprs.IterationVarRef);
1883  Dir->setLastIteration(Exprs.LastIteration);
1884  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1885  Dir->setPreCond(Exprs.PreCond);
1886  Dir->setCond(Exprs.Cond);
1887  Dir->setInit(Exprs.Init);
1888  Dir->setInc(Exprs.Inc);
1889  Dir->setIsLastIterVariable(Exprs.IL);
1890  Dir->setLowerBoundVariable(Exprs.LB);
1891  Dir->setUpperBoundVariable(Exprs.UB);
1892  Dir->setStrideVariable(Exprs.ST);
1893  Dir->setEnsureUpperBound(Exprs.EUB);
1894  Dir->setNextLowerBound(Exprs.NLB);
1895  Dir->setNextUpperBound(Exprs.NUB);
1896  Dir->setNumIterations(Exprs.NumIterations);
1897  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1898  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1899  Dir->setDistInc(Exprs.DistInc);
1900  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1901  Dir->setCounters(Exprs.Counters);
1902  Dir->setPrivateCounters(Exprs.PrivateCounters);
1903  Dir->setInits(Exprs.Inits);
1904  Dir->setUpdates(Exprs.Updates);
1905  Dir->setFinals(Exprs.Finals);
1906  Dir->setDependentCounters(Exprs.DependentCounters);
1907  Dir->setDependentInits(Exprs.DependentInits);
1908  Dir->setFinalsConditions(Exprs.FinalsConditions);
1909  Dir->setPreInits(Exprs.PreInits);
1910  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1911  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1912  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1913  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1914  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1915  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1916  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1917  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1918  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1919  Dir->setTaskReductionRefExpr(TaskRedRef);
1920  Dir->HasCancel = HasCancel;
1921  return Dir;
1922 }
1923 
1926  unsigned NumClauses,
1927  unsigned CollapsedNum,
1928  EmptyShell) {
1929  return createEmptyDirective<OMPTargetTeamsDistributeParallelForDirective>(
1930  C, NumClauses, /*HasAssociatedStmt=*/true,
1931  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
1932  1,
1933  CollapsedNum);
1934 }
1935 
1938  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1939  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1940  const HelperExprs &Exprs) {
1941  auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
1942  C, Clauses, AssociatedStmt,
1943  numLoopChildren(CollapsedNum,
1944  OMPD_target_teams_distribute_parallel_for_simd),
1945  StartLoc, EndLoc, CollapsedNum);
1946  Dir->setIterationVariable(Exprs.IterationVarRef);
1947  Dir->setLastIteration(Exprs.LastIteration);
1948  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1949  Dir->setPreCond(Exprs.PreCond);
1950  Dir->setCond(Exprs.Cond);
1951  Dir->setInit(Exprs.Init);
1952  Dir->setInc(Exprs.Inc);
1953  Dir->setIsLastIterVariable(Exprs.IL);
1954  Dir->setLowerBoundVariable(Exprs.LB);
1955  Dir->setUpperBoundVariable(Exprs.UB);
1956  Dir->setStrideVariable(Exprs.ST);
1957  Dir->setEnsureUpperBound(Exprs.EUB);
1958  Dir->setNextLowerBound(Exprs.NLB);
1959  Dir->setNextUpperBound(Exprs.NUB);
1960  Dir->setNumIterations(Exprs.NumIterations);
1961  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1962  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1963  Dir->setDistInc(Exprs.DistInc);
1964  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1965  Dir->setCounters(Exprs.Counters);
1966  Dir->setPrivateCounters(Exprs.PrivateCounters);
1967  Dir->setInits(Exprs.Inits);
1968  Dir->setUpdates(Exprs.Updates);
1969  Dir->setFinals(Exprs.Finals);
1970  Dir->setDependentCounters(Exprs.DependentCounters);
1971  Dir->setDependentInits(Exprs.DependentInits);
1972  Dir->setFinalsConditions(Exprs.FinalsConditions);
1973  Dir->setPreInits(Exprs.PreInits);
1974  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1975  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1976  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1977  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1978  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1979  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1980  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1981  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1982  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1983  return Dir;
1984 }
1985 
1988  const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1989  EmptyShell) {
1990  return createEmptyDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
1991  C, NumClauses, /*HasAssociatedStmt=*/true,
1992  numLoopChildren(CollapsedNum,
1993  OMPD_target_teams_distribute_parallel_for_simd),
1994  CollapsedNum);
1995 }
1996 
1999  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2000  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2001  const HelperExprs &Exprs) {
2002  auto *Dir = createDirective<OMPTargetTeamsDistributeSimdDirective>(
2003  C, Clauses, AssociatedStmt,
2004  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),
2005  StartLoc, EndLoc, CollapsedNum);
2006  Dir->setIterationVariable(Exprs.IterationVarRef);
2007  Dir->setLastIteration(Exprs.LastIteration);
2008  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2009  Dir->setPreCond(Exprs.PreCond);
2010  Dir->setCond(Exprs.Cond);
2011  Dir->setInit(Exprs.Init);
2012  Dir->setInc(Exprs.Inc);
2013  Dir->setIsLastIterVariable(Exprs.IL);
2014  Dir->setLowerBoundVariable(Exprs.LB);
2015  Dir->setUpperBoundVariable(Exprs.UB);
2016  Dir->setStrideVariable(Exprs.ST);
2017  Dir->setEnsureUpperBound(Exprs.EUB);
2018  Dir->setNextLowerBound(Exprs.NLB);
2019  Dir->setNextUpperBound(Exprs.NUB);
2020  Dir->setNumIterations(Exprs.NumIterations);
2021  Dir->setCounters(Exprs.Counters);
2022  Dir->setPrivateCounters(Exprs.PrivateCounters);
2023  Dir->setInits(Exprs.Inits);
2024  Dir->setUpdates(Exprs.Updates);
2025  Dir->setFinals(Exprs.Finals);
2026  Dir->setDependentCounters(Exprs.DependentCounters);
2027  Dir->setDependentInits(Exprs.DependentInits);
2028  Dir->setFinalsConditions(Exprs.FinalsConditions);
2029  Dir->setPreInits(Exprs.PreInits);
2030  return Dir;
2031 }
2032 
2035  unsigned NumClauses,
2036  unsigned CollapsedNum,
2037  EmptyShell) {
2038  return createEmptyDirective<OMPTargetTeamsDistributeSimdDirective>(
2039  C, NumClauses, /*HasAssociatedStmt=*/true,
2040  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),
2041  CollapsedNum);
2042 }
2043 
2046  SourceLocation EndLoc,
2047  ArrayRef<OMPClause *> Clauses) {
2048  return createDirective<OMPInteropDirective>(
2049  C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
2050  EndLoc);
2051 }
2052 
2054  unsigned NumClauses,
2055  EmptyShell) {
2056  return createEmptyDirective<OMPInteropDirective>(C, NumClauses);
2057 }
2058 
2060  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2061  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2062  SourceLocation TargetCallLoc) {
2063  auto *Dir = createDirective<OMPDispatchDirective>(
2064  C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
2065  Dir->setTargetCallLoc(TargetCallLoc);
2066  return Dir;
2067 }
2068 
2070  unsigned NumClauses,
2071  EmptyShell) {
2072  return createEmptyDirective<OMPDispatchDirective>(C, NumClauses,
2073  /*HasAssociatedStmt=*/true,
2074  /*NumChildren=*/0);
2075 }
2076 
2078  SourceLocation StartLoc,
2079  SourceLocation EndLoc,
2080  ArrayRef<OMPClause *> Clauses,
2081  Stmt *AssociatedStmt) {
2082  return createDirective<OMPMaskedDirective>(C, Clauses, AssociatedStmt,
2083  /*NumChildren=*/0, StartLoc,
2084  EndLoc);
2085 }
2086 
2088  unsigned NumClauses,
2089  EmptyShell) {
2090  return createEmptyDirective<OMPMaskedDirective>(C, NumClauses,
2091  /*HasAssociatedStmt=*/true);
2092 }
2093 
2095  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2096  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2097  const HelperExprs &Exprs) {
2098  auto *Dir = createDirective<OMPGenericLoopDirective>(
2099  C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_loop),
2100  StartLoc, EndLoc, CollapsedNum);
2101  Dir->setIterationVariable(Exprs.IterationVarRef);
2102  Dir->setLastIteration(Exprs.LastIteration);
2103  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2104  Dir->setPreCond(Exprs.PreCond);
2105  Dir->setCond(Exprs.Cond);
2106  Dir->setInit(Exprs.Init);
2107  Dir->setInc(Exprs.Inc);
2108  Dir->setIsLastIterVariable(Exprs.IL);
2109  Dir->setLowerBoundVariable(Exprs.LB);
2110  Dir->setUpperBoundVariable(Exprs.UB);
2111  Dir->setStrideVariable(Exprs.ST);
2112  Dir->setEnsureUpperBound(Exprs.EUB);
2113  Dir->setNextLowerBound(Exprs.NLB);
2114  Dir->setNextUpperBound(Exprs.NUB);
2115  Dir->setNumIterations(Exprs.NumIterations);
2116  Dir->setCounters(Exprs.Counters);
2117  Dir->setPrivateCounters(Exprs.PrivateCounters);
2118  Dir->setInits(Exprs.Inits);
2119  Dir->setUpdates(Exprs.Updates);
2120  Dir->setFinals(Exprs.Finals);
2121  Dir->setDependentCounters(Exprs.DependentCounters);
2122  Dir->setDependentInits(Exprs.DependentInits);
2123  Dir->setFinalsConditions(Exprs.FinalsConditions);
2124  Dir->setPreInits(Exprs.PreInits);
2125  return Dir;
2126 }
2127 
2129 OMPGenericLoopDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
2130  unsigned CollapsedNum, EmptyShell) {
2131  return createEmptyDirective<OMPGenericLoopDirective>(
2132  C, NumClauses, /*HasAssociatedStmt=*/true,
2133  numLoopChildren(CollapsedNum, OMPD_loop), CollapsedNum);
2134 }
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:1020
clang::OMPLoopBasedDirective::HelperExprs::IterationVarRef
Expr * IterationVarRef
Loop iteration variable.
Definition: StmtOpenMP.h:742
clang::OMPForDirective
This represents '#pragma omp for' directive.
Definition: StmtOpenMP.h:1624
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:3746
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:2455
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:1567
clang::OMPCancellationPointDirective::Create
static OMPCancellationPointDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Creates directive.
Definition: StmtOpenMP.cpp:773
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:1005
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:2059
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:1011
clang::OMPTileDirective
This represents the '#pragma omp tile' loop transformation directive.
Definition: StmtOpenMP.h:5078
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:5405
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:797
clang::OMPParallelMasterTaskLoopDirective
This represents '#pragma omp parallel master taskloop' directive.
Definition: StmtOpenMP.h:3812
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:1466
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:4785
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:922
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:827
clang::OMPTargetTeamsDistributeSimdDirective
This represents '#pragma omp target teams distribute simd' combined directive.
Definition: StmtOpenMP.h:5020
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:916
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:818
clang::OMPMasterDirective
This represents '#pragma omp master' directive.
Definition: StmtOpenMP.h:1967
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:1151
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:2547
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:803
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:1854
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:888
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:4502
clang::OMPCancellationPointDirective::CreateEmpty
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:782
clang::IfStmt
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1909
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:1297
clang::OMPInteropDirective::Create
static OMPInteropDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive.
Definition: StmtOpenMP.cpp:2045
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:766
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:1333
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:1027
clang::tooling::X
static ToolExecutorPluginRegistry::Add< AllTUsToolExecutorPlugin > X("all-TUs", "Runs FrontendActions on all TUs in the compilation database. " "Tool results are stored in memory.")
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::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:1159
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:1103
clang::OMPTargetTeamsDistributeParallelForDirective
This represents '#pragma omp target teams distribute parallel for' combined directive.
Definition: StmtOpenMP.h:4851
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:1355
clang::OMPTaskgroupDirective
This represents '#pragma omp taskgroup' directive.
Definition: StmtOpenMP.h:2598
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:1937
clang::OMPTaskwaitDirective::Create
static OMPTaskwaitDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive.
Definition: StmtOpenMP.cpp:743
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:1998
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:1062
clang::OMPTargetExitDataDirective
This represents '#pragma omp target exit data' directive.
Definition: StmtOpenMP.h:3131
clang::OMPForSimdDirective
This represents '#pragma omp for simd' directive.
Definition: StmtOpenMP.h:1714
llvm::MutableArrayRef
Definition: LLVM.h:35
V
#define V(N, I)
Definition: ASTContext.h:3127
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:1925
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:969
clang::OMPParallelMasterDirective
This represents '#pragma omp parallel master' directive.
Definition: StmtOpenMP.h:2248
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:685
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:1114
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:8734
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:1349
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:848
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:1512
clang::OMPTeamsDirective
This represents '#pragma omp teams' directive.
Definition: StmtOpenMP.h:3360
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:5234
clang::OMPMaskedDirective::CreateEmpty
static OMPMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:2087
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:212
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:1417
clang::OMPMetaDirective
This represents '#pragma omp metadirective' directive.
Definition: StmtOpenMP.h:5456
clang::OMPCancelDirective::Create
static OMPCancelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, OpenMPDirectiveKind CancelRegion)
Creates directive.
Definition: StmtOpenMP.cpp:787
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:1071
clang::OMPDistributeParallelForSimdDirective
This represents '#pragma omp distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:4173
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:1203
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:2717
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:1820
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:881
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:2183
clang::OMPTaskDirective
This represents '#pragma omp task' directive.
Definition: StmtOpenMP.h:2393
clang::OMPTargetParallelDirective
This represents '#pragma omp target parallel' directive.
Definition: StmtOpenMP.h:3185
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:2086
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:697
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:997
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:2015
clang::OMPLoopDirective::setInits
void setInits(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:225
clang::OMPTargetParallelForSimdDirective
This represents '#pragma omp target parallel for simd' directive.
Definition: StmtOpenMP.h:4304
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:3670
clang::OMPTeamsDistributeDirective
This represents '#pragma omp teams distribute' directive.
Definition: StmtOpenMP.h:4436
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:960
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:1251
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:726
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:1862
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:842
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:1595
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:3471
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:1739
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:1777
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::OMPTargetTeamsDistributeParallelForSimdDirective
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
Definition: StmtOpenMP.h:4949
clang::OMPTaskyieldDirective::Create
static OMPTaskyieldDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:720
clang::OMPFlushDirective
This represents '#pragma omp flush' directive.
Definition: StmtOpenMP.h:2665
clang::OMPTargetEnterDataDirective
This represents '#pragma omp target enter data' directive.
Definition: StmtOpenMP.h:3076
clang::OMPInteropDirective
This represents '#pragma omp interop' directive.
Definition: StmtOpenMP.h:5287
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:976
clang::OMPDistributeDirective
This represents '#pragma omp distribute' directive.
Definition: StmtOpenMP.h:3955
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:2069
clang::OMPSingleDirective
This represents '#pragma omp single' directive.
Definition: StmtOpenMP.h:1916
clang::OMPTaskwaitDirective::CreateEmpty
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:751
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:1340
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:737
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:1287
llvm::ArrayRef
Definition: LLVM.h:34
clang::OMPTaskLoopDirective
This represents '#pragma omp taskloop' directive.
Definition: StmtOpenMP.h:3531
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:1690
clang::OMPLoopBasedDirective::HelperExprs::Finals
SmallVector< Expr *, 4 > Finals
Final loop counter values for GodeGen.
Definition: StmtOpenMP.h:796
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:757
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:2034
clang::OMPCancellationPointDirective
This represents '#pragma omp cancellation point' directive.
Definition: StmtOpenMP.h:3413
clang::OMPDispatchDirective
This represents '#pragma omp dispatch' directive.
Definition: StmtOpenMP.h:5340
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:1811
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:1638
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:1107
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:2053
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:897
clang::OMPMaskedDirective::Create
static OMPMaskedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:2077
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:1240
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:1681
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:4636
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:858
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:1750
clang::OMPSimdDirective
This represents '#pragma omp simd' directive.
Definition: StmtOpenMP.h:1561
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:1646
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::OMPTargetTeamsDirective
This represents '#pragma omp target teams' directive.
Definition: StmtOpenMP.h:4729
clang::OMPLoopBasedDirective::HelperExprs::Init
Expr * Init
Loop iteration variable init.
Definition: StmtOpenMP.h:754
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:1826
clang::Stmt
Stmt - This represents one statement.
Definition: Stmt.h:69
clang::OMPDistributeParallelForDirective
This represents '#pragma omp distribute parallel for' composite directive.
Definition: StmtOpenMP.h:4077
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:2129
clang::OMPBarrierDirective::Create
static OMPBarrierDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:731
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:1873
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:904
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:1195
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:1602
clang::OMPUnrollDirective
This represents the '#pragma omp unroll' loop transformation directive.
Definition: StmtOpenMP.h:5160
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:1476
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:704
clang::OMPLoopDirective::setDependentInits
void setDependentInits(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:250
clang::OMPTargetDirective
This represents '#pragma omp target' directive.
Definition: StmtOpenMP.h:2968
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:1556
clang::OMPGenericLoopDirective
This represents '#pragma omp loop' directive.
Definition: StmtOpenMP.h:5495
clang::OMPTargetUpdateDirective
This represents '#pragma omp target update' directive.
Definition: StmtOpenMP.h:4021
clang::OMPLoopBasedDirective::HelperExprs::NUB
Expr * NUB
Update of UpperBound for statically scheduled 'omp for' loops.
Definition: StmtOpenMP.h:770
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:2094
clang::OMPOrderedDirective
This represents '#pragma omp ordered' directive.
Definition: StmtOpenMP.h:2769
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:1520
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:4238
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:991
clang::OMPAtomicDirective::Create
static OMPAtomicDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V, Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate)
Creates directive with a list of Clauses and 'x', 'v' and 'expr' parts of the atomic construct (see S...
Definition: StmtOpenMP.cpp:866
clang::OMPParallelMasterTaskLoopSimdDirective
This represents '#pragma omp parallel master taskloop simd' directive.
Definition: StmtOpenMP.h:3890
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:833
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:1406
clang::OMPTargetDataDirective
This represents '#pragma omp target data' directive.
Definition: StmtOpenMP.h:3022
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:1801
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:983
clang::OMPTargetSimdDirective
This represents '#pragma omp target simd' directive.
Definition: StmtOpenMP.h:4371
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:713
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:758
clang::OMPLoopBasedDirective::HelperExprs::Cond
Expr * Cond
Loop condition.
Definition: StmtOpenMP.h:752
clang::OMPTaskLoopSimdDirective
This represents '#pragma omp taskloop simd' directive.
Definition: StmtOpenMP.h:3604
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:3265
clang::OMPParallelSectionsDirective
This represents '#pragma omp parallel sections' directive.
Definition: StmtOpenMP.h:2312
clang::OMPAtomicDirective
This represents '#pragma omp atomic' directive.
Definition: StmtOpenMP.h:2823
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:1987
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:4569
clang::OMPBarrierDirective
This represents '#pragma omp barrier' directive.
Definition: StmtOpenMP.h:2501
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:812