clang  9.0.0svn
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/StmtOpenMP.h"
14 
15 #include "clang/AST/ASTContext.h"
16 
17 using namespace clang;
18 
20  assert(Clauses.size() == getNumClauses() &&
21  "Number of clauses is not the same as the preallocated buffer");
22  std::copy(Clauses.begin(), Clauses.end(), getClauses().begin());
23 }
24 
26  // Special case: 'omp target enter data', 'omp target exit data',
27  // 'omp target update' are stand-alone directives, but for implementation
28  // reasons they have empty synthetic structured block, to simplify codegen.
29  if (isa<OMPTargetEnterDataDirective>(this) ||
30  isa<OMPTargetExitDataDirective>(this) ||
31  isa<OMPTargetUpdateDirective>(this))
32  return true;
33  return !hasAssociatedStmt() || !getAssociatedStmt();
34 }
35 
37  assert(!isStandaloneDirective() &&
38  "Standalone Executable Directives don't have Structured Blocks.");
39  if (auto *LD = dyn_cast<OMPLoopDirective>(this))
40  return LD->getBody();
42 }
43 
45  assert(A.size() == getCollapsedNumber() &&
46  "Number of loop counters is not the same as the collapsed number");
47  std::copy(A.begin(), A.end(), getCounters().begin());
48 }
49 
51  assert(A.size() == getCollapsedNumber() && "Number of loop private counters "
52  "is not the same as the collapsed "
53  "number");
54  std::copy(A.begin(), A.end(), getPrivateCounters().begin());
55 }
56 
58  assert(A.size() == getCollapsedNumber() &&
59  "Number of counter inits is not the same as the collapsed number");
60  std::copy(A.begin(), A.end(), getInits().begin());
61 }
62 
64  assert(A.size() == getCollapsedNumber() &&
65  "Number of counter updates is not the same as the collapsed number");
66  std::copy(A.begin(), A.end(), getUpdates().begin());
67 }
68 
70  assert(A.size() == getCollapsedNumber() &&
71  "Number of counter finals is not the same as the collapsed number");
72  std::copy(A.begin(), A.end(), getFinals().begin());
73 }
74 
76  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
77  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
78  unsigned Size =
79  llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *));
80  void *Mem =
81  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
83  new (Mem) OMPParallelDirective(StartLoc, EndLoc, Clauses.size());
84  Dir->setClauses(Clauses);
85  Dir->setAssociatedStmt(AssociatedStmt);
86  Dir->setHasCancel(HasCancel);
87  return Dir;
88 }
89 
91  unsigned NumClauses,
92  EmptyShell) {
93  unsigned Size =
94  llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *));
95  void *Mem =
96  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
97  return new (Mem) OMPParallelDirective(NumClauses);
98 }
99 
102  SourceLocation EndLoc, unsigned CollapsedNum,
103  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
104  const HelperExprs &Exprs) {
105  unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *));
106  void *Mem =
107  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
108  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
109  OMPSimdDirective *Dir = new (Mem)
110  OMPSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
111  Dir->setClauses(Clauses);
112  Dir->setAssociatedStmt(AssociatedStmt);
114  Dir->setLastIteration(Exprs.LastIteration);
116  Dir->setPreCond(Exprs.PreCond);
117  Dir->setCond(Exprs.Cond);
118  Dir->setInit(Exprs.Init);
119  Dir->setInc(Exprs.Inc);
120  Dir->setCounters(Exprs.Counters);
122  Dir->setInits(Exprs.Inits);
123  Dir->setUpdates(Exprs.Updates);
124  Dir->setFinals(Exprs.Finals);
125  Dir->setPreInits(Exprs.PreInits);
126  return Dir;
127 }
128 
130  unsigned NumClauses,
131  unsigned CollapsedNum,
132  EmptyShell) {
133  unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *));
134  void *Mem =
135  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
136  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
137  return new (Mem) OMPSimdDirective(CollapsedNum, NumClauses);
138 }
139 
142  SourceLocation EndLoc, unsigned CollapsedNum,
143  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
144  const HelperExprs &Exprs, bool HasCancel) {
145  unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *));
146  void *Mem =
147  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
148  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
149  OMPForDirective *Dir =
150  new (Mem) OMPForDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
151  Dir->setClauses(Clauses);
152  Dir->setAssociatedStmt(AssociatedStmt);
154  Dir->setLastIteration(Exprs.LastIteration);
156  Dir->setPreCond(Exprs.PreCond);
157  Dir->setCond(Exprs.Cond);
158  Dir->setInit(Exprs.Init);
159  Dir->setInc(Exprs.Inc);
160  Dir->setIsLastIterVariable(Exprs.IL);
161  Dir->setLowerBoundVariable(Exprs.LB);
162  Dir->setUpperBoundVariable(Exprs.UB);
163  Dir->setStrideVariable(Exprs.ST);
164  Dir->setEnsureUpperBound(Exprs.EUB);
165  Dir->setNextLowerBound(Exprs.NLB);
166  Dir->setNextUpperBound(Exprs.NUB);
167  Dir->setNumIterations(Exprs.NumIterations);
168  Dir->setCounters(Exprs.Counters);
170  Dir->setInits(Exprs.Inits);
171  Dir->setUpdates(Exprs.Updates);
172  Dir->setFinals(Exprs.Finals);
173  Dir->setPreInits(Exprs.PreInits);
174  Dir->setHasCancel(HasCancel);
175  return Dir;
176 }
177 
179  unsigned NumClauses,
180  unsigned CollapsedNum,
181  EmptyShell) {
182  unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *));
183  void *Mem =
184  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
185  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
186  return new (Mem) OMPForDirective(CollapsedNum, NumClauses);
187 }
188 
191  SourceLocation EndLoc, unsigned CollapsedNum,
192  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
193  const HelperExprs &Exprs) {
194  unsigned Size =
195  llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *));
196  void *Mem =
197  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
198  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
199  OMPForSimdDirective *Dir = new (Mem)
200  OMPForSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
201  Dir->setClauses(Clauses);
202  Dir->setAssociatedStmt(AssociatedStmt);
204  Dir->setLastIteration(Exprs.LastIteration);
206  Dir->setPreCond(Exprs.PreCond);
207  Dir->setCond(Exprs.Cond);
208  Dir->setInit(Exprs.Init);
209  Dir->setInc(Exprs.Inc);
210  Dir->setIsLastIterVariable(Exprs.IL);
211  Dir->setLowerBoundVariable(Exprs.LB);
212  Dir->setUpperBoundVariable(Exprs.UB);
213  Dir->setStrideVariable(Exprs.ST);
214  Dir->setEnsureUpperBound(Exprs.EUB);
215  Dir->setNextLowerBound(Exprs.NLB);
216  Dir->setNextUpperBound(Exprs.NUB);
217  Dir->setNumIterations(Exprs.NumIterations);
218  Dir->setCounters(Exprs.Counters);
220  Dir->setInits(Exprs.Inits);
221  Dir->setUpdates(Exprs.Updates);
222  Dir->setFinals(Exprs.Finals);
223  Dir->setPreInits(Exprs.PreInits);
224  return Dir;
225 }
226 
228  unsigned NumClauses,
229  unsigned CollapsedNum,
230  EmptyShell) {
231  unsigned Size =
232  llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *));
233  void *Mem =
234  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
235  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
236  return new (Mem) OMPForSimdDirective(CollapsedNum, NumClauses);
237 }
238 
240  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
241  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
242  unsigned Size =
243  llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *));
244  void *Mem =
245  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
246  OMPSectionsDirective *Dir =
247  new (Mem) OMPSectionsDirective(StartLoc, EndLoc, Clauses.size());
248  Dir->setClauses(Clauses);
249  Dir->setAssociatedStmt(AssociatedStmt);
250  Dir->setHasCancel(HasCancel);
251  return Dir;
252 }
253 
255  unsigned NumClauses,
256  EmptyShell) {
257  unsigned Size =
258  llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *));
259  void *Mem =
260  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
261  return new (Mem) OMPSectionsDirective(NumClauses);
262 }
263 
265  SourceLocation StartLoc,
266  SourceLocation EndLoc,
267  Stmt *AssociatedStmt,
268  bool HasCancel) {
269  unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *));
270  void *Mem = C.Allocate(Size + sizeof(Stmt *));
271  OMPSectionDirective *Dir = new (Mem) OMPSectionDirective(StartLoc, EndLoc);
272  Dir->setAssociatedStmt(AssociatedStmt);
273  Dir->setHasCancel(HasCancel);
274  return Dir;
275 }
276 
278  EmptyShell) {
279  unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *));
280  void *Mem = C.Allocate(Size + sizeof(Stmt *));
281  return new (Mem) OMPSectionDirective();
282 }
283 
285  SourceLocation StartLoc,
286  SourceLocation EndLoc,
287  ArrayRef<OMPClause *> Clauses,
288  Stmt *AssociatedStmt) {
289  unsigned Size =
290  llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *));
291  void *Mem =
292  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
293  OMPSingleDirective *Dir =
294  new (Mem) OMPSingleDirective(StartLoc, EndLoc, Clauses.size());
295  Dir->setClauses(Clauses);
296  Dir->setAssociatedStmt(AssociatedStmt);
297  return Dir;
298 }
299 
301  unsigned NumClauses,
302  EmptyShell) {
303  unsigned Size =
304  llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *));
305  void *Mem =
306  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
307  return new (Mem) OMPSingleDirective(NumClauses);
308 }
309 
311  SourceLocation StartLoc,
312  SourceLocation EndLoc,
313  Stmt *AssociatedStmt) {
314  unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *));
315  void *Mem = C.Allocate(Size + sizeof(Stmt *));
316  OMPMasterDirective *Dir = new (Mem) OMPMasterDirective(StartLoc, EndLoc);
317  Dir->setAssociatedStmt(AssociatedStmt);
318  return Dir;
319 }
320 
322  EmptyShell) {
323  unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *));
324  void *Mem = C.Allocate(Size + sizeof(Stmt *));
325  return new (Mem) OMPMasterDirective();
326 }
327 
329  const ASTContext &C, const DeclarationNameInfo &Name,
330  SourceLocation StartLoc, SourceLocation EndLoc,
331  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
332  unsigned Size =
333  llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *));
334  void *Mem =
335  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
336  OMPCriticalDirective *Dir =
337  new (Mem) OMPCriticalDirective(Name, StartLoc, EndLoc, Clauses.size());
338  Dir->setClauses(Clauses);
339  Dir->setAssociatedStmt(AssociatedStmt);
340  return Dir;
341 }
342 
344  unsigned NumClauses,
345  EmptyShell) {
346  unsigned Size =
347  llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *));
348  void *Mem =
349  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
350  return new (Mem) OMPCriticalDirective(NumClauses);
351 }
352 
354  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
355  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
356  const HelperExprs &Exprs, bool HasCancel) {
357  unsigned Size =
358  llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *));
359  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
360  sizeof(Stmt *) *
361  numLoopChildren(CollapsedNum, OMPD_parallel_for));
362  OMPParallelForDirective *Dir = new (Mem)
363  OMPParallelForDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
364  Dir->setClauses(Clauses);
365  Dir->setAssociatedStmt(AssociatedStmt);
367  Dir->setLastIteration(Exprs.LastIteration);
369  Dir->setPreCond(Exprs.PreCond);
370  Dir->setCond(Exprs.Cond);
371  Dir->setInit(Exprs.Init);
372  Dir->setInc(Exprs.Inc);
373  Dir->setIsLastIterVariable(Exprs.IL);
374  Dir->setLowerBoundVariable(Exprs.LB);
375  Dir->setUpperBoundVariable(Exprs.UB);
376  Dir->setStrideVariable(Exprs.ST);
377  Dir->setEnsureUpperBound(Exprs.EUB);
378  Dir->setNextLowerBound(Exprs.NLB);
379  Dir->setNextUpperBound(Exprs.NUB);
380  Dir->setNumIterations(Exprs.NumIterations);
381  Dir->setCounters(Exprs.Counters);
383  Dir->setInits(Exprs.Inits);
384  Dir->setUpdates(Exprs.Updates);
385  Dir->setFinals(Exprs.Finals);
386  Dir->setPreInits(Exprs.PreInits);
387  Dir->setHasCancel(HasCancel);
388  return Dir;
389 }
390 
393  unsigned CollapsedNum, EmptyShell) {
394  unsigned Size =
395  llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *));
396  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
397  sizeof(Stmt *) *
398  numLoopChildren(CollapsedNum, OMPD_parallel_for));
399  return new (Mem) OMPParallelForDirective(CollapsedNum, NumClauses);
400 }
401 
403  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
404  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
405  const HelperExprs &Exprs) {
406  unsigned Size =
407  llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *));
408  void *Mem = C.Allocate(
409  Size + sizeof(OMPClause *) * Clauses.size() +
410  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
412  StartLoc, EndLoc, CollapsedNum, Clauses.size());
413  Dir->setClauses(Clauses);
414  Dir->setAssociatedStmt(AssociatedStmt);
416  Dir->setLastIteration(Exprs.LastIteration);
418  Dir->setPreCond(Exprs.PreCond);
419  Dir->setCond(Exprs.Cond);
420  Dir->setInit(Exprs.Init);
421  Dir->setInc(Exprs.Inc);
422  Dir->setIsLastIterVariable(Exprs.IL);
423  Dir->setLowerBoundVariable(Exprs.LB);
424  Dir->setUpperBoundVariable(Exprs.UB);
425  Dir->setStrideVariable(Exprs.ST);
426  Dir->setEnsureUpperBound(Exprs.EUB);
427  Dir->setNextLowerBound(Exprs.NLB);
428  Dir->setNextUpperBound(Exprs.NUB);
429  Dir->setNumIterations(Exprs.NumIterations);
430  Dir->setCounters(Exprs.Counters);
432  Dir->setInits(Exprs.Inits);
433  Dir->setUpdates(Exprs.Updates);
434  Dir->setFinals(Exprs.Finals);
435  Dir->setPreInits(Exprs.PreInits);
436  return Dir;
437 }
438 
441  unsigned NumClauses,
442  unsigned CollapsedNum, EmptyShell) {
443  unsigned Size =
444  llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *));
445  void *Mem = C.Allocate(
446  Size + sizeof(OMPClause *) * NumClauses +
447  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
448  return new (Mem) OMPParallelForSimdDirective(CollapsedNum, NumClauses);
449 }
450 
452  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
453  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
454  unsigned Size =
455  llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *));
456  void *Mem =
457  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
459  new (Mem) OMPParallelSectionsDirective(StartLoc, EndLoc, Clauses.size());
460  Dir->setClauses(Clauses);
461  Dir->setAssociatedStmt(AssociatedStmt);
462  Dir->setHasCancel(HasCancel);
463  return Dir;
464 }
465 
468  unsigned NumClauses, EmptyShell) {
469  unsigned Size =
470  llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *));
471  void *Mem =
472  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
473  return new (Mem) OMPParallelSectionsDirective(NumClauses);
474 }
475 
478  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
479  Stmt *AssociatedStmt, bool HasCancel) {
480  unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *));
481  void *Mem =
482  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
483  OMPTaskDirective *Dir =
484  new (Mem) OMPTaskDirective(StartLoc, EndLoc, Clauses.size());
485  Dir->setClauses(Clauses);
486  Dir->setAssociatedStmt(AssociatedStmt);
487  Dir->setHasCancel(HasCancel);
488  return Dir;
489 }
490 
492  unsigned NumClauses,
493  EmptyShell) {
494  unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *));
495  void *Mem =
496  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
497  return new (Mem) OMPTaskDirective(NumClauses);
498 }
499 
501  SourceLocation StartLoc,
502  SourceLocation EndLoc) {
503  void *Mem = C.Allocate(sizeof(OMPTaskyieldDirective));
504  OMPTaskyieldDirective *Dir =
505  new (Mem) OMPTaskyieldDirective(StartLoc, EndLoc);
506  return Dir;
507 }
508 
510  EmptyShell) {
511  void *Mem = C.Allocate(sizeof(OMPTaskyieldDirective));
512  return new (Mem) OMPTaskyieldDirective();
513 }
514 
516  SourceLocation StartLoc,
517  SourceLocation EndLoc) {
518  void *Mem = C.Allocate(sizeof(OMPBarrierDirective));
519  OMPBarrierDirective *Dir = new (Mem) OMPBarrierDirective(StartLoc, EndLoc);
520  return Dir;
521 }
522 
524  EmptyShell) {
525  void *Mem = C.Allocate(sizeof(OMPBarrierDirective));
526  return new (Mem) OMPBarrierDirective();
527 }
528 
530  SourceLocation StartLoc,
531  SourceLocation EndLoc) {
532  void *Mem = C.Allocate(sizeof(OMPTaskwaitDirective));
533  OMPTaskwaitDirective *Dir = new (Mem) OMPTaskwaitDirective(StartLoc, EndLoc);
534  return Dir;
535 }
536 
538  EmptyShell) {
539  void *Mem = C.Allocate(sizeof(OMPTaskwaitDirective));
540  return new (Mem) OMPTaskwaitDirective();
541 }
542 
544  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
545  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) {
546  unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective) +
547  sizeof(OMPClause *) * Clauses.size(),
548  alignof(Stmt *));
549  void *Mem = C.Allocate(Size + sizeof(Stmt *) + sizeof(Expr *));
550  OMPTaskgroupDirective *Dir =
551  new (Mem) OMPTaskgroupDirective(StartLoc, EndLoc, Clauses.size());
552  Dir->setAssociatedStmt(AssociatedStmt);
553  Dir->setReductionRef(ReductionRef);
554  Dir->setClauses(Clauses);
555  return Dir;
556 }
557 
559  unsigned NumClauses,
560  EmptyShell) {
561  unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective) +
562  sizeof(OMPClause *) * NumClauses,
563  alignof(Stmt *));
564  void *Mem = C.Allocate(Size + sizeof(Stmt *) + sizeof(Expr *));
565  return new (Mem) OMPTaskgroupDirective(NumClauses);
566 }
567 
569  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
570  OpenMPDirectiveKind CancelRegion) {
571  unsigned Size =
572  llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *));
573  void *Mem = C.Allocate(Size);
575  new (Mem) OMPCancellationPointDirective(StartLoc, EndLoc);
576  Dir->setCancelRegion(CancelRegion);
577  return Dir;
578 }
579 
582  unsigned Size =
583  llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *));
584  void *Mem = C.Allocate(Size);
585  return new (Mem) OMPCancellationPointDirective();
586 }
587 
590  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
591  OpenMPDirectiveKind CancelRegion) {
592  unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
593  sizeof(OMPClause *) * Clauses.size(),
594  alignof(Stmt *));
595  void *Mem = C.Allocate(Size);
596  OMPCancelDirective *Dir =
597  new (Mem) OMPCancelDirective(StartLoc, EndLoc, Clauses.size());
598  Dir->setClauses(Clauses);
599  Dir->setCancelRegion(CancelRegion);
600  return Dir;
601 }
602 
604  unsigned NumClauses,
605  EmptyShell) {
606  unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
607  sizeof(OMPClause *) * NumClauses,
608  alignof(Stmt *));
609  void *Mem = C.Allocate(Size);
610  return new (Mem) OMPCancelDirective(NumClauses);
611 }
612 
614  SourceLocation StartLoc,
615  SourceLocation EndLoc,
616  ArrayRef<OMPClause *> Clauses) {
617  unsigned Size =
618  llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *));
619  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size());
620  OMPFlushDirective *Dir =
621  new (Mem) OMPFlushDirective(StartLoc, EndLoc, Clauses.size());
622  Dir->setClauses(Clauses);
623  return Dir;
624 }
625 
627  unsigned NumClauses,
628  EmptyShell) {
629  unsigned Size =
630  llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *));
631  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses);
632  return new (Mem) OMPFlushDirective(NumClauses);
633 }
634 
636  SourceLocation StartLoc,
637  SourceLocation EndLoc,
638  ArrayRef<OMPClause *> Clauses,
639  Stmt *AssociatedStmt) {
640  unsigned Size =
641  llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *));
642  void *Mem =
643  C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * Clauses.size());
644  OMPOrderedDirective *Dir =
645  new (Mem) OMPOrderedDirective(StartLoc, EndLoc, Clauses.size());
646  Dir->setClauses(Clauses);
647  Dir->setAssociatedStmt(AssociatedStmt);
648  return Dir;
649 }
650 
652  unsigned NumClauses,
653  EmptyShell) {
654  unsigned Size =
655  llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *));
656  void *Mem =
657  C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * NumClauses);
658  return new (Mem) OMPOrderedDirective(NumClauses);
659 }
660 
662  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
663  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V,
664  Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate) {
665  unsigned Size =
666  llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *));
667  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
668  5 * sizeof(Stmt *));
669  OMPAtomicDirective *Dir =
670  new (Mem) OMPAtomicDirective(StartLoc, EndLoc, Clauses.size());
671  Dir->setClauses(Clauses);
672  Dir->setAssociatedStmt(AssociatedStmt);
673  Dir->setX(X);
674  Dir->setV(V);
675  Dir->setExpr(E);
676  Dir->setUpdateExpr(UE);
677  Dir->IsXLHSInRHSPart = IsXLHSInRHSPart;
678  Dir->IsPostfixUpdate = IsPostfixUpdate;
679  return Dir;
680 }
681 
683  unsigned NumClauses,
684  EmptyShell) {
685  unsigned Size =
686  llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *));
687  void *Mem =
688  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 5 * sizeof(Stmt *));
689  return new (Mem) OMPAtomicDirective(NumClauses);
690 }
691 
693  SourceLocation StartLoc,
694  SourceLocation EndLoc,
695  ArrayRef<OMPClause *> Clauses,
696  Stmt *AssociatedStmt) {
697  unsigned Size =
698  llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *));
699  void *Mem =
700  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
701  OMPTargetDirective *Dir =
702  new (Mem) OMPTargetDirective(StartLoc, EndLoc, Clauses.size());
703  Dir->setClauses(Clauses);
704  Dir->setAssociatedStmt(AssociatedStmt);
705  return Dir;
706 }
707 
709  unsigned NumClauses,
710  EmptyShell) {
711  unsigned Size =
712  llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *));
713  void *Mem =
714  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
715  return new (Mem) OMPTargetDirective(NumClauses);
716 }
717 
719  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
720  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
721  unsigned Size =
722  llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *));
723  void *Mem =
724  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
726  new (Mem) OMPTargetParallelDirective(StartLoc, EndLoc, Clauses.size());
727  Dir->setClauses(Clauses);
728  Dir->setAssociatedStmt(AssociatedStmt);
729  return Dir;
730 }
731 
734  unsigned NumClauses, EmptyShell) {
735  unsigned Size =
736  llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *));
737  void *Mem =
738  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
739  return new (Mem) OMPTargetParallelDirective(NumClauses);
740 }
741 
743  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
744  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
745  const HelperExprs &Exprs, bool HasCancel) {
746  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
747  alignof(OMPClause *));
748  void *Mem = C.Allocate(
749  Size + sizeof(OMPClause *) * Clauses.size() +
750  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
752  StartLoc, EndLoc, CollapsedNum, Clauses.size());
753  Dir->setClauses(Clauses);
754  Dir->setAssociatedStmt(AssociatedStmt);
756  Dir->setLastIteration(Exprs.LastIteration);
758  Dir->setPreCond(Exprs.PreCond);
759  Dir->setCond(Exprs.Cond);
760  Dir->setInit(Exprs.Init);
761  Dir->setInc(Exprs.Inc);
762  Dir->setIsLastIterVariable(Exprs.IL);
763  Dir->setLowerBoundVariable(Exprs.LB);
764  Dir->setUpperBoundVariable(Exprs.UB);
765  Dir->setStrideVariable(Exprs.ST);
766  Dir->setEnsureUpperBound(Exprs.EUB);
767  Dir->setNextLowerBound(Exprs.NLB);
768  Dir->setNextUpperBound(Exprs.NUB);
769  Dir->setNumIterations(Exprs.NumIterations);
770  Dir->setCounters(Exprs.Counters);
772  Dir->setInits(Exprs.Inits);
773  Dir->setUpdates(Exprs.Updates);
774  Dir->setFinals(Exprs.Finals);
775  Dir->setPreInits(Exprs.PreInits);
776  Dir->setHasCancel(HasCancel);
777  return Dir;
778 }
779 
782  unsigned NumClauses,
783  unsigned CollapsedNum, EmptyShell) {
784  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
785  alignof(OMPClause *));
786  void *Mem = C.Allocate(
787  Size + sizeof(OMPClause *) * NumClauses +
788  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
789  return new (Mem) OMPTargetParallelForDirective(CollapsedNum, NumClauses);
790 }
791 
793  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
794  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
795  void *Mem = C.Allocate(
796  llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) +
797  sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
799  new (Mem) OMPTargetDataDirective(StartLoc, EndLoc, Clauses.size());
800  Dir->setClauses(Clauses);
801  Dir->setAssociatedStmt(AssociatedStmt);
802  return Dir;
803 }
804 
806  unsigned N,
807  EmptyShell) {
808  void *Mem = C.Allocate(
809  llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) +
810  sizeof(OMPClause *) * N + sizeof(Stmt *));
811  return new (Mem) OMPTargetDataDirective(N);
812 }
813 
815  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
816  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
817  void *Mem = C.Allocate(
818  llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) +
819  sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
821  new (Mem) OMPTargetEnterDataDirective(StartLoc, EndLoc, Clauses.size());
822  Dir->setClauses(Clauses);
823  Dir->setAssociatedStmt(AssociatedStmt);
824  return Dir;
825 }
826 
829  EmptyShell) {
830  void *Mem = C.Allocate(
831  llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) +
832  sizeof(OMPClause *) * N + sizeof(Stmt *));
833  return new (Mem) OMPTargetEnterDataDirective(N);
834 }
835 
837  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
838  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
839  void *Mem = C.Allocate(
840  llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) +
841  sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
843  new (Mem) OMPTargetExitDataDirective(StartLoc, EndLoc, Clauses.size());
844  Dir->setClauses(Clauses);
845  Dir->setAssociatedStmt(AssociatedStmt);
846  return Dir;
847 }
848 
851  EmptyShell) {
852  void *Mem = C.Allocate(
853  llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) +
854  sizeof(OMPClause *) * N + sizeof(Stmt *));
855  return new (Mem) OMPTargetExitDataDirective(N);
856 }
857 
859  SourceLocation StartLoc,
860  SourceLocation EndLoc,
861  ArrayRef<OMPClause *> Clauses,
862  Stmt *AssociatedStmt) {
863  unsigned Size =
864  llvm::alignTo(sizeof(OMPTeamsDirective), alignof(OMPClause *));
865  void *Mem =
866  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
867  OMPTeamsDirective *Dir =
868  new (Mem) OMPTeamsDirective(StartLoc, EndLoc, Clauses.size());
869  Dir->setClauses(Clauses);
870  Dir->setAssociatedStmt(AssociatedStmt);
871  return Dir;
872 }
873 
875  unsigned NumClauses,
876  EmptyShell) {
877  unsigned Size =
878  llvm::alignTo(sizeof(OMPTeamsDirective), alignof(OMPClause *));
879  void *Mem =
880  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
881  return new (Mem) OMPTeamsDirective(NumClauses);
882 }
883 
885  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
886  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
887  const HelperExprs &Exprs) {
888  unsigned Size =
889  llvm::alignTo(sizeof(OMPTaskLoopDirective), alignof(OMPClause *));
890  void *Mem =
891  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
892  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
893  OMPTaskLoopDirective *Dir = new (Mem)
894  OMPTaskLoopDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
895  Dir->setClauses(Clauses);
896  Dir->setAssociatedStmt(AssociatedStmt);
898  Dir->setLastIteration(Exprs.LastIteration);
900  Dir->setPreCond(Exprs.PreCond);
901  Dir->setCond(Exprs.Cond);
902  Dir->setInit(Exprs.Init);
903  Dir->setInc(Exprs.Inc);
904  Dir->setIsLastIterVariable(Exprs.IL);
905  Dir->setLowerBoundVariable(Exprs.LB);
906  Dir->setUpperBoundVariable(Exprs.UB);
907  Dir->setStrideVariable(Exprs.ST);
908  Dir->setEnsureUpperBound(Exprs.EUB);
909  Dir->setNextLowerBound(Exprs.NLB);
910  Dir->setNextUpperBound(Exprs.NUB);
911  Dir->setNumIterations(Exprs.NumIterations);
912  Dir->setCounters(Exprs.Counters);
914  Dir->setInits(Exprs.Inits);
915  Dir->setUpdates(Exprs.Updates);
916  Dir->setFinals(Exprs.Finals);
917  Dir->setPreInits(Exprs.PreInits);
918  return Dir;
919 }
920 
922  unsigned NumClauses,
923  unsigned CollapsedNum,
924  EmptyShell) {
925  unsigned Size =
926  llvm::alignTo(sizeof(OMPTaskLoopDirective), alignof(OMPClause *));
927  void *Mem =
928  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
929  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
930  return new (Mem) OMPTaskLoopDirective(CollapsedNum, NumClauses);
931 }
932 
934  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
935  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
936  const HelperExprs &Exprs) {
937  unsigned Size =
938  llvm::alignTo(sizeof(OMPTaskLoopSimdDirective), alignof(OMPClause *));
939  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
940  sizeof(Stmt *) *
941  numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
942  OMPTaskLoopSimdDirective *Dir = new (Mem)
943  OMPTaskLoopSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
944  Dir->setClauses(Clauses);
945  Dir->setAssociatedStmt(AssociatedStmt);
947  Dir->setLastIteration(Exprs.LastIteration);
949  Dir->setPreCond(Exprs.PreCond);
950  Dir->setCond(Exprs.Cond);
951  Dir->setInit(Exprs.Init);
952  Dir->setInc(Exprs.Inc);
953  Dir->setIsLastIterVariable(Exprs.IL);
954  Dir->setLowerBoundVariable(Exprs.LB);
955  Dir->setUpperBoundVariable(Exprs.UB);
956  Dir->setStrideVariable(Exprs.ST);
957  Dir->setEnsureUpperBound(Exprs.EUB);
958  Dir->setNextLowerBound(Exprs.NLB);
959  Dir->setNextUpperBound(Exprs.NUB);
960  Dir->setNumIterations(Exprs.NumIterations);
961  Dir->setCounters(Exprs.Counters);
963  Dir->setInits(Exprs.Inits);
964  Dir->setUpdates(Exprs.Updates);
965  Dir->setFinals(Exprs.Finals);
966  Dir->setPreInits(Exprs.PreInits);
967  return Dir;
968 }
969 
972  unsigned CollapsedNum, EmptyShell) {
973  unsigned Size =
974  llvm::alignTo(sizeof(OMPTaskLoopSimdDirective), alignof(OMPClause *));
975  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
976  sizeof(Stmt *) *
977  numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
978  return new (Mem) OMPTaskLoopSimdDirective(CollapsedNum, NumClauses);
979 }
980 
982  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
983  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
984  const HelperExprs &Exprs) {
985  unsigned Size =
986  llvm::alignTo(sizeof(OMPDistributeDirective), alignof(OMPClause *));
987  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
988  sizeof(Stmt *) *
989  numLoopChildren(CollapsedNum, OMPD_distribute));
990  OMPDistributeDirective *Dir = new (Mem)
991  OMPDistributeDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
992  Dir->setClauses(Clauses);
993  Dir->setAssociatedStmt(AssociatedStmt);
995  Dir->setLastIteration(Exprs.LastIteration);
997  Dir->setPreCond(Exprs.PreCond);
998  Dir->setCond(Exprs.Cond);
999  Dir->setInit(Exprs.Init);
1000  Dir->setInc(Exprs.Inc);
1001  Dir->setIsLastIterVariable(Exprs.IL);
1002  Dir->setLowerBoundVariable(Exprs.LB);
1003  Dir->setUpperBoundVariable(Exprs.UB);
1004  Dir->setStrideVariable(Exprs.ST);
1005  Dir->setEnsureUpperBound(Exprs.EUB);
1006  Dir->setNextLowerBound(Exprs.NLB);
1007  Dir->setNextUpperBound(Exprs.NUB);
1008  Dir->setNumIterations(Exprs.NumIterations);
1009  Dir->setCounters(Exprs.Counters);
1010  Dir->setPrivateCounters(Exprs.PrivateCounters);
1011  Dir->setInits(Exprs.Inits);
1012  Dir->setUpdates(Exprs.Updates);
1013  Dir->setFinals(Exprs.Finals);
1014  Dir->setPreInits(Exprs.PreInits);
1015  return Dir;
1016 }
1017 
1020  unsigned CollapsedNum, EmptyShell) {
1021  unsigned Size =
1022  llvm::alignTo(sizeof(OMPDistributeDirective), alignof(OMPClause *));
1023  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1024  sizeof(Stmt *) *
1025  numLoopChildren(CollapsedNum, OMPD_distribute));
1026  return new (Mem) OMPDistributeDirective(CollapsedNum, NumClauses);
1027 }
1028 
1030  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1031  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1032  unsigned Size =
1033  llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *));
1034  void *Mem =
1035  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
1037  new (Mem) OMPTargetUpdateDirective(StartLoc, EndLoc, Clauses.size());
1038  Dir->setClauses(Clauses);
1039  Dir->setAssociatedStmt(AssociatedStmt);
1040  return Dir;
1041 }
1042 
1045  EmptyShell) {
1046  unsigned Size =
1047  llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *));
1048  void *Mem =
1049  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
1050  return new (Mem) OMPTargetUpdateDirective(NumClauses);
1051 }
1052 
1054  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1055  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1056  const HelperExprs &Exprs, bool HasCancel) {
1057  unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
1058  alignof(OMPClause *));
1059  void *Mem = C.Allocate(
1060  Size + sizeof(OMPClause *) * Clauses.size() +
1061  sizeof(Stmt *) *
1062  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for));
1064  new (Mem) OMPDistributeParallelForDirective(StartLoc, EndLoc,
1065  CollapsedNum, Clauses.size());
1066  Dir->setClauses(Clauses);
1067  Dir->setAssociatedStmt(AssociatedStmt);
1069  Dir->setLastIteration(Exprs.LastIteration);
1071  Dir->setPreCond(Exprs.PreCond);
1072  Dir->setCond(Exprs.Cond);
1073  Dir->setInit(Exprs.Init);
1074  Dir->setInc(Exprs.Inc);
1075  Dir->setIsLastIterVariable(Exprs.IL);
1076  Dir->setLowerBoundVariable(Exprs.LB);
1077  Dir->setUpperBoundVariable(Exprs.UB);
1078  Dir->setStrideVariable(Exprs.ST);
1079  Dir->setEnsureUpperBound(Exprs.EUB);
1080  Dir->setNextLowerBound(Exprs.NLB);
1081  Dir->setNextUpperBound(Exprs.NUB);
1082  Dir->setNumIterations(Exprs.NumIterations);
1083  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1084  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1085  Dir->setDistInc(Exprs.DistInc);
1086  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1087  Dir->setCounters(Exprs.Counters);
1088  Dir->setPrivateCounters(Exprs.PrivateCounters);
1089  Dir->setInits(Exprs.Inits);
1090  Dir->setUpdates(Exprs.Updates);
1091  Dir->setFinals(Exprs.Finals);
1092  Dir->setPreInits(Exprs.PreInits);
1102  Dir->HasCancel = HasCancel;
1103  return Dir;
1104 }
1105 
1108  unsigned NumClauses,
1109  unsigned CollapsedNum,
1110  EmptyShell) {
1111  unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
1112  alignof(OMPClause *));
1113  void *Mem = C.Allocate(
1114  Size + sizeof(OMPClause *) * NumClauses +
1115  sizeof(Stmt *) *
1116  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for));
1117  return new (Mem) OMPDistributeParallelForDirective(CollapsedNum, NumClauses);
1118 }
1119 
1122  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1123  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1124  const HelperExprs &Exprs) {
1125  unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
1126  alignof(OMPClause *));
1127  void *Mem = C.Allocate(
1128  Size + sizeof(OMPClause *) * Clauses.size() +
1129  sizeof(Stmt *) *
1130  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd));
1131  OMPDistributeParallelForSimdDirective *Dir = new (Mem)
1132  OMPDistributeParallelForSimdDirective(StartLoc, EndLoc, CollapsedNum,
1133  Clauses.size());
1134  Dir->setClauses(Clauses);
1135  Dir->setAssociatedStmt(AssociatedStmt);
1137  Dir->setLastIteration(Exprs.LastIteration);
1139  Dir->setPreCond(Exprs.PreCond);
1140  Dir->setCond(Exprs.Cond);
1141  Dir->setInit(Exprs.Init);
1142  Dir->setInc(Exprs.Inc);
1143  Dir->setIsLastIterVariable(Exprs.IL);
1144  Dir->setLowerBoundVariable(Exprs.LB);
1145  Dir->setUpperBoundVariable(Exprs.UB);
1146  Dir->setStrideVariable(Exprs.ST);
1147  Dir->setEnsureUpperBound(Exprs.EUB);
1148  Dir->setNextLowerBound(Exprs.NLB);
1149  Dir->setNextUpperBound(Exprs.NUB);
1150  Dir->setNumIterations(Exprs.NumIterations);
1151  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1152  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1153  Dir->setDistInc(Exprs.DistInc);
1154  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1155  Dir->setCounters(Exprs.Counters);
1156  Dir->setPrivateCounters(Exprs.PrivateCounters);
1157  Dir->setInits(Exprs.Inits);
1158  Dir->setUpdates(Exprs.Updates);
1159  Dir->setFinals(Exprs.Finals);
1160  Dir->setPreInits(Exprs.PreInits);
1170  return Dir;
1171 }
1172 
1175  unsigned NumClauses,
1176  unsigned CollapsedNum,
1177  EmptyShell) {
1178  unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
1179  alignof(OMPClause *));
1180  void *Mem = C.Allocate(
1181  Size + sizeof(OMPClause *) * NumClauses +
1182  sizeof(Stmt *) *
1183  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd));
1184  return new (Mem)
1185  OMPDistributeParallelForSimdDirective(CollapsedNum, NumClauses);
1186 }
1187 
1189  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1190  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1191  const HelperExprs &Exprs) {
1192  unsigned Size =
1193  llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *));
1194  void *Mem = C.Allocate(
1195  Size + sizeof(OMPClause *) * Clauses.size() +
1196  sizeof(Stmt *) *
1197  numLoopChildren(CollapsedNum, OMPD_distribute_simd));
1199  StartLoc, EndLoc, CollapsedNum, Clauses.size());
1200  Dir->setClauses(Clauses);
1201  Dir->setAssociatedStmt(AssociatedStmt);
1203  Dir->setLastIteration(Exprs.LastIteration);
1205  Dir->setPreCond(Exprs.PreCond);
1206  Dir->setCond(Exprs.Cond);
1207  Dir->setInit(Exprs.Init);
1208  Dir->setInc(Exprs.Inc);
1209  Dir->setIsLastIterVariable(Exprs.IL);
1210  Dir->setLowerBoundVariable(Exprs.LB);
1211  Dir->setUpperBoundVariable(Exprs.UB);
1212  Dir->setStrideVariable(Exprs.ST);
1213  Dir->setEnsureUpperBound(Exprs.EUB);
1214  Dir->setNextLowerBound(Exprs.NLB);
1215  Dir->setNextUpperBound(Exprs.NUB);
1216  Dir->setNumIterations(Exprs.NumIterations);
1217  Dir->setCounters(Exprs.Counters);
1218  Dir->setPrivateCounters(Exprs.PrivateCounters);
1219  Dir->setInits(Exprs.Inits);
1220  Dir->setUpdates(Exprs.Updates);
1221  Dir->setFinals(Exprs.Finals);
1222  Dir->setPreInits(Exprs.PreInits);
1223  return Dir;
1224 }
1225 
1228  unsigned NumClauses,
1229  unsigned CollapsedNum, EmptyShell) {
1230  unsigned Size =
1231  llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *));
1232  void *Mem = C.Allocate(
1233  Size + sizeof(OMPClause *) * NumClauses +
1234  sizeof(Stmt *) *
1235  numLoopChildren(CollapsedNum, OMPD_distribute_simd));
1236  return new (Mem) OMPDistributeSimdDirective(CollapsedNum, NumClauses);
1237 }
1238 
1240  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1241  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1242  const HelperExprs &Exprs) {
1243  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
1244  alignof(OMPClause *));
1245  void *Mem = C.Allocate(
1246  Size + sizeof(OMPClause *) * Clauses.size() +
1247  sizeof(Stmt *) *
1248  numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd));
1250  new (Mem) OMPTargetParallelForSimdDirective(StartLoc, EndLoc,
1251  CollapsedNum, Clauses.size());
1252  Dir->setClauses(Clauses);
1253  Dir->setAssociatedStmt(AssociatedStmt);
1255  Dir->setLastIteration(Exprs.LastIteration);
1257  Dir->setPreCond(Exprs.PreCond);
1258  Dir->setCond(Exprs.Cond);
1259  Dir->setInit(Exprs.Init);
1260  Dir->setInc(Exprs.Inc);
1261  Dir->setIsLastIterVariable(Exprs.IL);
1262  Dir->setLowerBoundVariable(Exprs.LB);
1263  Dir->setUpperBoundVariable(Exprs.UB);
1264  Dir->setStrideVariable(Exprs.ST);
1265  Dir->setEnsureUpperBound(Exprs.EUB);
1266  Dir->setNextLowerBound(Exprs.NLB);
1267  Dir->setNextUpperBound(Exprs.NUB);
1268  Dir->setNumIterations(Exprs.NumIterations);
1269  Dir->setCounters(Exprs.Counters);
1270  Dir->setPrivateCounters(Exprs.PrivateCounters);
1271  Dir->setInits(Exprs.Inits);
1272  Dir->setUpdates(Exprs.Updates);
1273  Dir->setFinals(Exprs.Finals);
1274  Dir->setPreInits(Exprs.PreInits);
1275  return Dir;
1276 }
1277 
1280  unsigned NumClauses,
1281  unsigned CollapsedNum,
1282  EmptyShell) {
1283  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
1284  alignof(OMPClause *));
1285  void *Mem = C.Allocate(
1286  Size + sizeof(OMPClause *) * NumClauses +
1287  sizeof(Stmt *) *
1288  numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd));
1289  return new (Mem) OMPTargetParallelForSimdDirective(CollapsedNum, NumClauses);
1290 }
1291 
1294  SourceLocation EndLoc, unsigned CollapsedNum,
1295  ArrayRef<OMPClause *> Clauses,
1296  Stmt *AssociatedStmt, const HelperExprs &Exprs) {
1297  unsigned Size =
1298  llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *));
1299  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1300  sizeof(Stmt *) *
1301  numLoopChildren(CollapsedNum, OMPD_target_simd));
1302  OMPTargetSimdDirective *Dir = new (Mem)
1303  OMPTargetSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
1304  Dir->setClauses(Clauses);
1305  Dir->setAssociatedStmt(AssociatedStmt);
1307  Dir->setLastIteration(Exprs.LastIteration);
1309  Dir->setPreCond(Exprs.PreCond);
1310  Dir->setCond(Exprs.Cond);
1311  Dir->setInit(Exprs.Init);
1312  Dir->setInc(Exprs.Inc);
1313  Dir->setCounters(Exprs.Counters);
1314  Dir->setPrivateCounters(Exprs.PrivateCounters);
1315  Dir->setInits(Exprs.Inits);
1316  Dir->setUpdates(Exprs.Updates);
1317  Dir->setFinals(Exprs.Finals);
1318  Dir->setPreInits(Exprs.PreInits);
1319  return Dir;
1320 }
1321 
1324  unsigned CollapsedNum, EmptyShell) {
1325  unsigned Size =
1326  llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *));
1327  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1328  sizeof(Stmt *) *
1329  numLoopChildren(CollapsedNum, OMPD_target_simd));
1330  return new (Mem) OMPTargetSimdDirective(CollapsedNum, NumClauses);
1331 }
1332 
1334  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1335  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1336  const HelperExprs &Exprs) {
1337  unsigned Size =
1338  llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *));
1339  void *Mem = C.Allocate(
1340  Size + sizeof(OMPClause *) * Clauses.size() +
1341  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
1343  StartLoc, EndLoc, CollapsedNum, Clauses.size());
1344  Dir->setClauses(Clauses);
1345  Dir->setAssociatedStmt(AssociatedStmt);
1347  Dir->setLastIteration(Exprs.LastIteration);
1349  Dir->setPreCond(Exprs.PreCond);
1350  Dir->setCond(Exprs.Cond);
1351  Dir->setInit(Exprs.Init);
1352  Dir->setInc(Exprs.Inc);
1353  Dir->setIsLastIterVariable(Exprs.IL);
1354  Dir->setLowerBoundVariable(Exprs.LB);
1355  Dir->setUpperBoundVariable(Exprs.UB);
1356  Dir->setStrideVariable(Exprs.ST);
1357  Dir->setEnsureUpperBound(Exprs.EUB);
1358  Dir->setNextLowerBound(Exprs.NLB);
1359  Dir->setNextUpperBound(Exprs.NUB);
1360  Dir->setNumIterations(Exprs.NumIterations);
1361  Dir->setCounters(Exprs.Counters);
1362  Dir->setPrivateCounters(Exprs.PrivateCounters);
1363  Dir->setInits(Exprs.Inits);
1364  Dir->setUpdates(Exprs.Updates);
1365  Dir->setFinals(Exprs.Finals);
1366  Dir->setPreInits(Exprs.PreInits);
1367  return Dir;
1368 }
1369 
1372  unsigned NumClauses,
1373  unsigned CollapsedNum, EmptyShell) {
1374  unsigned Size =
1375  llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *));
1376  void *Mem = C.Allocate(
1377  Size + sizeof(OMPClause *) * NumClauses +
1378  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
1379  return new (Mem) OMPTeamsDistributeDirective(CollapsedNum, NumClauses);
1380 }
1381 
1383  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1384  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1385  const HelperExprs &Exprs) {
1386  unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeSimdDirective),
1387  alignof(OMPClause *));
1388  void *Mem =
1389  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1390  sizeof(Stmt *) *
1391  numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd));
1393  new (Mem) OMPTeamsDistributeSimdDirective(StartLoc, EndLoc, CollapsedNum,
1394  Clauses.size());
1395  Dir->setClauses(Clauses);
1396  Dir->setAssociatedStmt(AssociatedStmt);
1398  Dir->setLastIteration(Exprs.LastIteration);
1400  Dir->setPreCond(Exprs.PreCond);
1401  Dir->setCond(Exprs.Cond);
1402  Dir->setInit(Exprs.Init);
1403  Dir->setInc(Exprs.Inc);
1404  Dir->setIsLastIterVariable(Exprs.IL);
1405  Dir->setLowerBoundVariable(Exprs.LB);
1406  Dir->setUpperBoundVariable(Exprs.UB);
1407  Dir->setStrideVariable(Exprs.ST);
1408  Dir->setEnsureUpperBound(Exprs.EUB);
1409  Dir->setNextLowerBound(Exprs.NLB);
1410  Dir->setNextUpperBound(Exprs.NUB);
1411  Dir->setNumIterations(Exprs.NumIterations);
1412  Dir->setCounters(Exprs.Counters);
1413  Dir->setPrivateCounters(Exprs.PrivateCounters);
1414  Dir->setInits(Exprs.Inits);
1415  Dir->setUpdates(Exprs.Updates);
1416  Dir->setFinals(Exprs.Finals);
1417  Dir->setPreInits(Exprs.PreInits);
1418  return Dir;
1419 }
1420 
1422  const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1423  EmptyShell) {
1424  unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeSimdDirective),
1425  alignof(OMPClause *));
1426  void *Mem =
1427  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1428  sizeof(Stmt *) *
1429  numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd));
1430  return new (Mem) OMPTeamsDistributeSimdDirective(CollapsedNum, NumClauses);
1431 }
1432 
1435  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1436  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1437  const HelperExprs &Exprs) {
1438  auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForSimdDirective),
1439  alignof(OMPClause *));
1440  void *Mem =
1441  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1442  sizeof(Stmt *) *
1443  numLoopChildren(CollapsedNum,
1444  OMPD_teams_distribute_parallel_for_simd));
1446  OMPTeamsDistributeParallelForSimdDirective(StartLoc, EndLoc, CollapsedNum,
1447  Clauses.size());
1448  Dir->setClauses(Clauses);
1449  Dir->setAssociatedStmt(AssociatedStmt);
1451  Dir->setLastIteration(Exprs.LastIteration);
1453  Dir->setPreCond(Exprs.PreCond);
1454  Dir->setCond(Exprs.Cond);
1455  Dir->setInit(Exprs.Init);
1456  Dir->setInc(Exprs.Inc);
1457  Dir->setIsLastIterVariable(Exprs.IL);
1458  Dir->setLowerBoundVariable(Exprs.LB);
1459  Dir->setUpperBoundVariable(Exprs.UB);
1460  Dir->setStrideVariable(Exprs.ST);
1461  Dir->setEnsureUpperBound(Exprs.EUB);
1462  Dir->setNextLowerBound(Exprs.NLB);
1463  Dir->setNextUpperBound(Exprs.NUB);
1464  Dir->setNumIterations(Exprs.NumIterations);
1465  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1466  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1467  Dir->setDistInc(Exprs.DistInc);
1468  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1469  Dir->setCounters(Exprs.Counters);
1470  Dir->setPrivateCounters(Exprs.PrivateCounters);
1471  Dir->setInits(Exprs.Inits);
1472  Dir->setUpdates(Exprs.Updates);
1473  Dir->setFinals(Exprs.Finals);
1474  Dir->setPreInits(Exprs.PreInits);
1484  return Dir;
1485 }
1486 
1489  unsigned NumClauses,
1490  unsigned CollapsedNum,
1491  EmptyShell) {
1492  auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForSimdDirective),
1493  alignof(OMPClause *));
1494  void *Mem =
1495  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1496  sizeof(Stmt *) *
1497  numLoopChildren(CollapsedNum,
1498  OMPD_teams_distribute_parallel_for_simd));
1499  return new (Mem)
1500  OMPTeamsDistributeParallelForSimdDirective(CollapsedNum, NumClauses);
1501 }
1502 
1505  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1506  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1507  const HelperExprs &Exprs, bool HasCancel) {
1508  auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForDirective),
1509  alignof(OMPClause *));
1510  void *Mem = C.Allocate(
1511  Size + sizeof(OMPClause *) * Clauses.size() +
1512  sizeof(Stmt *) *
1513  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for));
1515  OMPTeamsDistributeParallelForDirective(StartLoc, EndLoc, CollapsedNum,
1516  Clauses.size());
1517  Dir->setClauses(Clauses);
1518  Dir->setAssociatedStmt(AssociatedStmt);
1520  Dir->setLastIteration(Exprs.LastIteration);
1522  Dir->setPreCond(Exprs.PreCond);
1523  Dir->setCond(Exprs.Cond);
1524  Dir->setInit(Exprs.Init);
1525  Dir->setInc(Exprs.Inc);
1526  Dir->setIsLastIterVariable(Exprs.IL);
1527  Dir->setLowerBoundVariable(Exprs.LB);
1528  Dir->setUpperBoundVariable(Exprs.UB);
1529  Dir->setStrideVariable(Exprs.ST);
1530  Dir->setEnsureUpperBound(Exprs.EUB);
1531  Dir->setNextLowerBound(Exprs.NLB);
1532  Dir->setNextUpperBound(Exprs.NUB);
1533  Dir->setNumIterations(Exprs.NumIterations);
1534  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1535  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1536  Dir->setDistInc(Exprs.DistInc);
1537  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1538  Dir->setCounters(Exprs.Counters);
1539  Dir->setPrivateCounters(Exprs.PrivateCounters);
1540  Dir->setInits(Exprs.Inits);
1541  Dir->setUpdates(Exprs.Updates);
1542  Dir->setFinals(Exprs.Finals);
1543  Dir->setPreInits(Exprs.PreInits);
1553  Dir->HasCancel = HasCancel;
1554  return Dir;
1555 }
1556 
1559  unsigned NumClauses,
1560  unsigned CollapsedNum,
1561  EmptyShell) {
1562  auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForDirective),
1563  alignof(OMPClause *));
1564  void *Mem = C.Allocate(
1565  Size + sizeof(OMPClause *) * NumClauses +
1566  sizeof(Stmt *) *
1567  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for));
1568  return new (Mem)
1569  OMPTeamsDistributeParallelForDirective(CollapsedNum, NumClauses);
1570 }
1571 
1573  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1574  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1575  auto Size =
1576  llvm::alignTo(sizeof(OMPTargetTeamsDirective), alignof(OMPClause *));
1577  void *Mem =
1578  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
1580  new (Mem) OMPTargetTeamsDirective(StartLoc, EndLoc, Clauses.size());
1581  Dir->setClauses(Clauses);
1582  Dir->setAssociatedStmt(AssociatedStmt);
1583  return Dir;
1584 }
1585 
1588  EmptyShell) {
1589  auto Size =
1590  llvm::alignTo(sizeof(OMPTargetTeamsDirective), alignof(OMPClause *));
1591  void *Mem =
1592  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
1593  return new (Mem) OMPTargetTeamsDirective(NumClauses);
1594 }
1595 
1597  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1598  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1599  const HelperExprs &Exprs) {
1600  auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeDirective),
1601  alignof(OMPClause *));
1602  void *Mem = C.Allocate(
1603  Size + sizeof(OMPClause *) * Clauses.size() +
1604  sizeof(Stmt *) *
1605  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute));
1607  new (Mem) OMPTargetTeamsDistributeDirective(StartLoc, EndLoc, CollapsedNum,
1608  Clauses.size());
1609  Dir->setClauses(Clauses);
1610  Dir->setAssociatedStmt(AssociatedStmt);
1612  Dir->setLastIteration(Exprs.LastIteration);
1614  Dir->setPreCond(Exprs.PreCond);
1615  Dir->setCond(Exprs.Cond);
1616  Dir->setInit(Exprs.Init);
1617  Dir->setInc(Exprs.Inc);
1618  Dir->setIsLastIterVariable(Exprs.IL);
1619  Dir->setLowerBoundVariable(Exprs.LB);
1620  Dir->setUpperBoundVariable(Exprs.UB);
1621  Dir->setStrideVariable(Exprs.ST);
1622  Dir->setEnsureUpperBound(Exprs.EUB);
1623  Dir->setNextLowerBound(Exprs.NLB);
1624  Dir->setNextUpperBound(Exprs.NUB);
1625  Dir->setNumIterations(Exprs.NumIterations);
1626  Dir->setCounters(Exprs.Counters);
1627  Dir->setPrivateCounters(Exprs.PrivateCounters);
1628  Dir->setInits(Exprs.Inits);
1629  Dir->setUpdates(Exprs.Updates);
1630  Dir->setFinals(Exprs.Finals);
1631  Dir->setPreInits(Exprs.PreInits);
1632  return Dir;
1633 }
1634 
1637  unsigned NumClauses,
1638  unsigned CollapsedNum,
1639  EmptyShell) {
1640  auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeDirective),
1641  alignof(OMPClause *));
1642  void *Mem = C.Allocate(
1643  Size + sizeof(OMPClause *) * NumClauses +
1644  sizeof(Stmt *) *
1645  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute));
1646  return new (Mem) OMPTargetTeamsDistributeDirective(CollapsedNum, NumClauses);
1647 }
1648 
1651  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1652  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1653  const HelperExprs &Exprs, bool HasCancel) {
1654  auto Size =
1655  llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForDirective),
1656  alignof(OMPClause *));
1657  void *Mem = C.Allocate(
1658  Size + sizeof(OMPClause *) * Clauses.size() +
1659  sizeof(Stmt *) *
1660  numLoopChildren(CollapsedNum,
1661  OMPD_target_teams_distribute_parallel_for));
1664  StartLoc, EndLoc, CollapsedNum, Clauses.size());
1665  Dir->setClauses(Clauses);
1666  Dir->setAssociatedStmt(AssociatedStmt);
1668  Dir->setLastIteration(Exprs.LastIteration);
1670  Dir->setPreCond(Exprs.PreCond);
1671  Dir->setCond(Exprs.Cond);
1672  Dir->setInit(Exprs.Init);
1673  Dir->setInc(Exprs.Inc);
1674  Dir->setIsLastIterVariable(Exprs.IL);
1675  Dir->setLowerBoundVariable(Exprs.LB);
1676  Dir->setUpperBoundVariable(Exprs.UB);
1677  Dir->setStrideVariable(Exprs.ST);
1678  Dir->setEnsureUpperBound(Exprs.EUB);
1679  Dir->setNextLowerBound(Exprs.NLB);
1680  Dir->setNextUpperBound(Exprs.NUB);
1681  Dir->setNumIterations(Exprs.NumIterations);
1682  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1683  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1684  Dir->setDistInc(Exprs.DistInc);
1685  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1686  Dir->setCounters(Exprs.Counters);
1687  Dir->setPrivateCounters(Exprs.PrivateCounters);
1688  Dir->setInits(Exprs.Inits);
1689  Dir->setUpdates(Exprs.Updates);
1690  Dir->setFinals(Exprs.Finals);
1691  Dir->setPreInits(Exprs.PreInits);
1701  Dir->HasCancel = HasCancel;
1702  return Dir;
1703 }
1704 
1707  unsigned NumClauses,
1708  unsigned CollapsedNum,
1709  EmptyShell) {
1710  auto Size =
1711  llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForDirective),
1712  alignof(OMPClause *));
1713  void *Mem = C.Allocate(
1714  Size + sizeof(OMPClause *) * NumClauses +
1715  sizeof(Stmt *) *
1716  numLoopChildren(CollapsedNum,
1717  OMPD_target_teams_distribute_parallel_for));
1718  return new (Mem)
1719  OMPTargetTeamsDistributeParallelForDirective(CollapsedNum, NumClauses);
1720 }
1721 
1724  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1725  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1726  const HelperExprs &Exprs) {
1727  auto Size =
1729  alignof(OMPClause *));
1730  void *Mem = C.Allocate(
1731  Size + sizeof(OMPClause *) * Clauses.size() +
1732  sizeof(Stmt *) *
1733  numLoopChildren(CollapsedNum,
1734  OMPD_target_teams_distribute_parallel_for_simd));
1737  StartLoc, EndLoc, CollapsedNum, Clauses.size());
1738  Dir->setClauses(Clauses);
1739  Dir->setAssociatedStmt(AssociatedStmt);
1741  Dir->setLastIteration(Exprs.LastIteration);
1743  Dir->setPreCond(Exprs.PreCond);
1744  Dir->setCond(Exprs.Cond);
1745  Dir->setInit(Exprs.Init);
1746  Dir->setInc(Exprs.Inc);
1747  Dir->setIsLastIterVariable(Exprs.IL);
1748  Dir->setLowerBoundVariable(Exprs.LB);
1749  Dir->setUpperBoundVariable(Exprs.UB);
1750  Dir->setStrideVariable(Exprs.ST);
1751  Dir->setEnsureUpperBound(Exprs.EUB);
1752  Dir->setNextLowerBound(Exprs.NLB);
1753  Dir->setNextUpperBound(Exprs.NUB);
1754  Dir->setNumIterations(Exprs.NumIterations);
1755  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1756  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1757  Dir->setDistInc(Exprs.DistInc);
1758  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1759  Dir->setCounters(Exprs.Counters);
1760  Dir->setPrivateCounters(Exprs.PrivateCounters);
1761  Dir->setInits(Exprs.Inits);
1762  Dir->setUpdates(Exprs.Updates);
1763  Dir->setFinals(Exprs.Finals);
1764  Dir->setPreInits(Exprs.PreInits);
1774  return Dir;
1775 }
1776 
1779  const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1780  EmptyShell) {
1781  auto Size =
1783  alignof(OMPClause *));
1784  void *Mem = C.Allocate(
1785  Size + sizeof(OMPClause *) * NumClauses +
1786  sizeof(Stmt *) *
1787  numLoopChildren(CollapsedNum,
1788  OMPD_target_teams_distribute_parallel_for_simd));
1790  CollapsedNum, NumClauses);
1791 }
1792 
1795  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1796  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1797  const HelperExprs &Exprs) {
1798  auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeSimdDirective),
1799  alignof(OMPClause *));
1800  void *Mem = C.Allocate(
1801  Size + sizeof(OMPClause *) * Clauses.size() +
1802  sizeof(Stmt *) *
1803  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd));
1804  OMPTargetTeamsDistributeSimdDirective *Dir = new (Mem)
1805  OMPTargetTeamsDistributeSimdDirective(StartLoc, EndLoc, CollapsedNum,
1806  Clauses.size());
1807  Dir->setClauses(Clauses);
1808  Dir->setAssociatedStmt(AssociatedStmt);
1810  Dir->setLastIteration(Exprs.LastIteration);
1812  Dir->setPreCond(Exprs.PreCond);
1813  Dir->setCond(Exprs.Cond);
1814  Dir->setInit(Exprs.Init);
1815  Dir->setInc(Exprs.Inc);
1816  Dir->setIsLastIterVariable(Exprs.IL);
1817  Dir->setLowerBoundVariable(Exprs.LB);
1818  Dir->setUpperBoundVariable(Exprs.UB);
1819  Dir->setStrideVariable(Exprs.ST);
1820  Dir->setEnsureUpperBound(Exprs.EUB);
1821  Dir->setNextLowerBound(Exprs.NLB);
1822  Dir->setNextUpperBound(Exprs.NUB);
1823  Dir->setNumIterations(Exprs.NumIterations);
1824  Dir->setCounters(Exprs.Counters);
1825  Dir->setPrivateCounters(Exprs.PrivateCounters);
1826  Dir->setInits(Exprs.Inits);
1827  Dir->setUpdates(Exprs.Updates);
1828  Dir->setFinals(Exprs.Finals);
1829  Dir->setPreInits(Exprs.PreInits);
1830  return Dir;
1831 }
1832 
1835  unsigned NumClauses,
1836  unsigned CollapsedNum,
1837  EmptyShell) {
1838  auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeSimdDirective),
1839  alignof(OMPClause *));
1840  void *Mem = C.Allocate(
1841  Size + sizeof(OMPClause *) * NumClauses +
1842  sizeof(Stmt *) *
1843  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd));
1844  return new (Mem)
1845  OMPTargetTeamsDistributeSimdDirective(CollapsedNum, NumClauses);
1846 }
void setPreInits(Stmt *PreInits)
Definition: StmtOpenMP.h:519
void setCombinedParForInDistCond(Expr *CombParForInDistCond)
Definition: StmtOpenMP.h:638
Expr * NLB
Update of LowerBound for statically scheduled &#39;omp for&#39; loops.
Definition: StmtOpenMP.h:715
Defines the clang::ASTContext interface.
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3271
SmallVector< Expr *, 4 > Finals
Final loop counter values for GodeGen.
Definition: StmtOpenMP.h:743
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1454
Expr * NUB
Update of UpperBound for statically scheduled omp loops for outer loop in combined constructs (e...
Definition: StmtOpenMP.h:675
SmallVector< Expr *, 4 > Updates
Expressions for loop counters update for CodeGen.
Definition: StmtOpenMP.h:741
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:1794
void setEnsureUpperBound(Expr *EUB)
Definition: StmtOpenMP.h:550
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:321
static OMPDistributeParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
static 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 &#39;x&#39;, &#39;v&#39; and &#39;expr&#39; parts of the atomic construct (see S...
Definition: StmtOpenMP.cpp:661
void setCombinedCond(Expr *CombCond)
Definition: StmtOpenMP.h:618
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:858
void setCombinedLowerBoundVariable(Expr *CombLB)
Definition: StmtOpenMP.h:598
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:537
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:733
void setHasCancel(bool Has)
Set cancel state.
Definition: StmtOpenMP.h:1381
Stmt - This represents one statement.
Definition: Stmt.h:66
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:558
void setLastIteration(Expr *LI)
Definition: StmtOpenMP.h:505
bool isStandaloneDirective() const
Returns whether or not this is a Standalone directive.
Definition: StmtOpenMP.cpp:25
static OMPTaskgroupDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef)
Creates directive.
Definition: StmtOpenMP.cpp:543
void setPrivateCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:50
static OMPTargetTeamsDistributeParallelForDirective * 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.
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1204
Expr * EUB
EnsureUpperBound – expression UB = min(UB, NumIterations).
Definition: StmtOpenMP.h:713
Expr * DistInc
DistInc - increment expression for distribute loop when found combined with a further loop level (e...
Definition: StmtOpenMP.h:727
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3682
static OMPSectionDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, bool HasCancel)
Creates directive.
Definition: StmtOpenMP.cpp:264
void setPrevEnsureUpperBound(Expr *PrevEUB)
Definition: StmtOpenMP.h:593
CapturedStmt * getInnermostCapturedStmt()
Get innermost captured statement for the construct.
Definition: StmtOpenMP.h:225
void setUpperBoundVariable(Expr *UB)
Definition: StmtOpenMP.h:536
void setNumIterations(Expr *NI)
Definition: StmtOpenMP.h:571
This represents &#39;#pragma omp target teams distribute&#39; combined directive.
Definition: StmtOpenMP.h:3819
void setNextLowerBound(Expr *NLB)
Definition: StmtOpenMP.h:557
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1575
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:3887
static OMPTeamsDistributeParallelForDirective * 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.
void setIsLastIterVariable(Expr *IL)
Definition: StmtOpenMP.h:522
Expr * PrevLB
PreviousLowerBound - local variable passed to runtime in the enclosing schedule or null if that does ...
Definition: StmtOpenMP.h:720
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2486
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:90
void setCombinedDistCond(Expr *CombDistCond)
Definition: StmtOpenMP.h:633
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.
void setInit(Expr *Init)
Definition: StmtOpenMP.h:517
Expr * LastIteration
Loop last iteration number.
Definition: StmtOpenMP.h:691
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:850
static OMPTargetParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTargetTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
const Stmt * getStructuredBlock() const
Returns the AST node representing OpenMP structured-block of this OpenMP executable directive...
Definition: StmtOpenMP.cpp:36
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:708
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:299
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:154
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:971
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:814
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:781
static OMPTargetUpdateDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:626
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:3407
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:477
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:981
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:1906
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1501
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:343
void setCond(Expr *Cond)
Definition: StmtOpenMP.h:514
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:921
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3122
This represents &#39;#pragma omp teams distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3611
static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Expr * LB
DistributeLowerBound - used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same construct...
Definition: StmtOpenMP.h:656
Expr * EUB
DistributeEnsureUpperBound - used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same construct...
Definition: StmtOpenMP.h:662
static OMPTeamsDistributeSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents &#39;#pragma omp cancellation point&#39; directive.
Definition: StmtOpenMP.h:2741
void setCombinedInit(Expr *CombInit)
Definition: StmtOpenMP.h:613
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:2684
static OMPFlushDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:613
Expr * CalcLastIteration
Calculation of last iteration.
Definition: StmtOpenMP.h:695
static OMPTargetTeamsDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
This represents &#39;#pragma omp teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:3541
static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:509
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:402
Expr * NUB
Update of UpperBound for statically scheduled &#39;omp for&#39; loops.
Definition: StmtOpenMP.h:717
Expr * Cond
Loop condition.
Definition: StmtOpenMP.h:699
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.
static OMPTargetParallelForDirective * 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:742
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:805
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetParallelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:718
Expr * PreCond
Loop pre-condition.
Definition: StmtOpenMP.h:697
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:3339
The expressions built for the OpenMP loop CodeGen for the whole collapsed loop nest.
Definition: StmtOpenMP.h:687
static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents &#39;#pragma omp taskgroup&#39; directive.
Definition: StmtOpenMP.h:1994
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:300
static OMPCriticalDirective * Create(const ASTContext &C, const DeclarationNameInfo &Name, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:328
Expr * DistCond
Distribute Loop condition used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same construct whe...
Definition: StmtOpenMP.h:678
Expr * IterationVarRef
Loop iteration variable.
Definition: StmtOpenMP.h:689
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.
Expr * Init
Distribute loop iteration variable init used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same...
Definition: StmtOpenMP.h:666
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:874
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:2995
void setInits(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:57
const Stmt * getAssociatedStmt() const
Returns statement associated with the directive.
Definition: StmtOpenMP.h:195
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:129
This represents one expression.
Definition: Expr.h:108
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.
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
#define V(N, I)
Definition: ASTContext.h:2912
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:310
This represents &#39;#pragma omp target teams distribute parallel for simd&#39; combined directive.
Definition: StmtOpenMP.h:3971
static OMPTargetSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTargetDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:692
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4044
unsigned getNumClauses() const
Get number of clauses.
Definition: StmtOpenMP.h:183
Expr * PrevUB
PreviousUpperBound - local variable passed to runtime in the enclosing schedule or null if that does ...
Definition: StmtOpenMP.h:723
static OMPOrderedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:635
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1127
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:828
This represents &#39;#pragma omp target teams&#39; directive.
Definition: StmtOpenMP.h:3760
void setAssociatedStmt(Stmt *S)
Set the associated statement for the directive.
Definition: StmtOpenMP.h:84
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Expr * ParForInDistCond
&#39;omp parallel for&#39; loop condition used when composed with &#39;omp distribute&#39; in the same construct and ...
Definition: StmtOpenMP.h:682
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:440
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:2799
void setDistInc(Expr *DistInc)
Definition: StmtOpenMP.h:588
Expr * NLB
Update of LowerBound for statically scheduled omp loops for outer loop in combined constructs (e...
Definition: StmtOpenMP.h:672
static OMPDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setClauses(ArrayRef< OMPClause *> Clauses)
Sets the list of variables for this clause.
Definition: StmtOpenMP.cpp:19
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:2067
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1655
Expr * NumIterations
Loop number of iterations.
Definition: StmtOpenMP.h:693
static OMPForDirective * 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:141
Expr * ST
Stride - local variable passed to runtime.
Definition: StmtOpenMP.h:711
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:392
This represents &#39;#pragma omp target enter data&#39; directive.
Definition: StmtOpenMP.h:2427
void setUpdates(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:63
SmallVector< Expr *, 4 > PrivateCounters
PrivateCounters Loop counters.
Definition: StmtOpenMP.h:737
void setLowerBoundVariable(Expr *LB)
Definition: StmtOpenMP.h:529
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:277
SmallVector< Expr *, 4 > Counters
Counters Loop counters.
Definition: StmtOpenMP.h:735
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1399
Encodes a location in the source.
void setPrevLowerBoundVariable(Expr *PrevLB)
Definition: StmtOpenMP.h:578
void setIterationVariable(Expr *IV)
Definition: StmtOpenMP.h:502
MutableArrayRef< Expr * > getInits()
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:491
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setCombinedNextLowerBound(Expr *CombNLB)
Definition: StmtOpenMP.h:623
static OMPParallelForDirective * 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:353
OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:22
static OMPParallelDirective * 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:75
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:836
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:682
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:1950
Expr * PrevEUB
PrevEUB - expression similar to EUB but to be used when loop scheduling uses PrevLB and PrevUB (e...
Definition: StmtOpenMP.h:733
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:50
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:651
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition: Stmt.h:3429
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2311
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
DistCombinedHelperExprs DistCombinedFields
Expressions used when combining OpenMP loop pragmas.
Definition: StmtOpenMP.h:748
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:190
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2122
Expr * LB
LowerBound - local variable passed to runtime.
Definition: StmtOpenMP.h:707
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:3063
Expr * Init
Loop iteration variable init.
Definition: StmtOpenMP.h:701
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:284
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
Definition: Stmt.h:1027
void * Allocate(size_t Size, unsigned Align=8) const
Definition: ASTContext.h:672
void setPrevUpperBoundVariable(Expr *PrevUB)
Definition: StmtOpenMP.h:583
void setCombinedEnsureUpperBound(Expr *CombEUB)
Definition: StmtOpenMP.h:608
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:178
void setCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:44
Dataflow Directional Tag Classes.
SmallVector< Expr *, 4 > Inits
Expressions for loop counters inits for CodeGen.
Definition: StmtOpenMP.h:739
void setCombinedUpperBoundVariable(Expr *CombUB)
Definition: StmtOpenMP.h:603
static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents &#39;#pragma omp section&#39; directive.
Definition: StmtOpenMP.h:1337
This represents &#39;#pragma omp teams distribute&#39; directive.
Definition: StmtOpenMP.h:3473
static OMPParallelSectionsDirective * 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:451
This represents &#39;#pragma omp simd&#39; directive.
Definition: StmtOpenMP.h:1062
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
This represents &#39;#pragma omp atomic&#39; directive.
Definition: StmtOpenMP.h:2177
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:227
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:523
This file defines OpenMP AST classes for executable directives and clauses.
static OMPSectionsDirective * 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:239
Expr * Inc
Loop increment.
Definition: StmtOpenMP.h:703
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
Definition: StmtOpenMP.h:192
static OMPTargetTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTaskLoopDirective * 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:884
Expr * UB
DistributeUpperBound - used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same construct...
Definition: StmtOpenMP.h:659
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
Definition: SemaDecl.cpp:14125
static OMPTaskyieldDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:500
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:792
Expr * UB
UpperBound - local variable passed to runtime.
Definition: StmtOpenMP.h:709
This represents &#39;#pragma omp target parallel&#39; directive.
Definition: StmtOpenMP.h:2544
void setStrideVariable(Expr *ST)
Definition: StmtOpenMP.h:543
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:467
static OMPBarrierDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:515
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:101
This represents &#39;#pragma omp taskloop simd&#39; directive.
Definition: StmtOpenMP.h:2929
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:254
void setPreCond(Expr *PC)
Definition: StmtOpenMP.h:511
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:603
static OMPTaskwaitDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:529
This represents &#39;#pragma omp sections&#39; directive.
Definition: StmtOpenMP.h:1269
Expr * Cond
Distribute Loop condition used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same construct...
Definition: StmtOpenMP.h:669
Stmt * PreInits
Init statement for all captured expressions.
Definition: StmtOpenMP.h:745
This represents &#39;#pragma omp target data&#39; directive.
Definition: StmtOpenMP.h:2369
void setNextUpperBound(Expr *NUB)
Definition: StmtOpenMP.h:564
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.
void setInc(Expr *Inc)
Definition: StmtOpenMP.h:518
static OMPCancelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, OpenMPDirectiveKind CancelRegion)
Creates directive.
Definition: StmtOpenMP.cpp:589
Expr * IL
IsLastIteration - local flag variable passed to runtime.
Definition: StmtOpenMP.h:705
This represents &#39;#pragma omp taskyield&#39; directive.
Definition: StmtOpenMP.h:1862
This represents &#39;#pragma omp distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3202
static OMPCancellationPointDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Creates directive.
Definition: StmtOpenMP.cpp:568
This represents &#39;#pragma omp parallel sections&#39; directive.
Definition: StmtOpenMP.h:1723
void setCalcLastIteration(Expr *CLI)
Definition: StmtOpenMP.h:508
void setCombinedNextUpperBound(Expr *CombNUB)
Definition: StmtOpenMP.h:628
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:933
void setFinals(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:69
static OMPTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents &#39;#pragma omp target parallel for&#39; directive.
Definition: StmtOpenMP.h:2604
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:581
This represents &#39;#pragma omp taskloop&#39; directive.
Definition: StmtOpenMP.h:2864