clang  6.0.0svn
StmtOpenMP.cpp
Go to the documentation of this file.
1 //===--- StmtOpenMP.cpp - Classes for OpenMP directives -------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements the subclesses of Stmt class declared in StmtOpenMP.h
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "clang/AST/StmtOpenMP.h"
15 
16 #include "clang/AST/ASTContext.h"
17 
18 using namespace clang;
19 
21  assert(Clauses.size() == getNumClauses() &&
22  "Number of clauses is not the same as the preallocated buffer");
23  std::copy(Clauses.begin(), Clauses.end(), getClauses().begin());
24 }
25 
27  assert(A.size() == getCollapsedNumber() &&
28  "Number of loop counters is not the same as the collapsed number");
29  std::copy(A.begin(), A.end(), getCounters().begin());
30 }
31 
33  assert(A.size() == getCollapsedNumber() && "Number of loop private counters "
34  "is not the same as the collapsed "
35  "number");
36  std::copy(A.begin(), A.end(), getPrivateCounters().begin());
37 }
38 
40  assert(A.size() == getCollapsedNumber() &&
41  "Number of counter inits is not the same as the collapsed number");
42  std::copy(A.begin(), A.end(), getInits().begin());
43 }
44 
46  assert(A.size() == getCollapsedNumber() &&
47  "Number of counter updates is not the same as the collapsed number");
48  std::copy(A.begin(), A.end(), getUpdates().begin());
49 }
50 
52  assert(A.size() == getCollapsedNumber() &&
53  "Number of counter finals is not the same as the collapsed number");
54  std::copy(A.begin(), A.end(), getFinals().begin());
55 }
56 
58  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
59  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
60  unsigned Size =
61  llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *));
62  void *Mem =
63  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
65  new (Mem) OMPParallelDirective(StartLoc, EndLoc, Clauses.size());
66  Dir->setClauses(Clauses);
67  Dir->setAssociatedStmt(AssociatedStmt);
68  Dir->setHasCancel(HasCancel);
69  return Dir;
70 }
71 
73  unsigned NumClauses,
74  EmptyShell) {
75  unsigned Size =
76  llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *));
77  void *Mem =
78  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
79  return new (Mem) OMPParallelDirective(NumClauses);
80 }
81 
84  SourceLocation EndLoc, unsigned CollapsedNum,
85  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
86  const HelperExprs &Exprs) {
87  unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *));
88  void *Mem =
89  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
90  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
91  OMPSimdDirective *Dir = new (Mem)
92  OMPSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
93  Dir->setClauses(Clauses);
94  Dir->setAssociatedStmt(AssociatedStmt);
96  Dir->setLastIteration(Exprs.LastIteration);
98  Dir->setPreCond(Exprs.PreCond);
99  Dir->setCond(Exprs.Cond);
100  Dir->setInit(Exprs.Init);
101  Dir->setInc(Exprs.Inc);
102  Dir->setCounters(Exprs.Counters);
104  Dir->setInits(Exprs.Inits);
105  Dir->setUpdates(Exprs.Updates);
106  Dir->setFinals(Exprs.Finals);
107  Dir->setPreInits(Exprs.PreInits);
108  return Dir;
109 }
110 
112  unsigned NumClauses,
113  unsigned CollapsedNum,
114  EmptyShell) {
115  unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *));
116  void *Mem =
117  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
118  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
119  return new (Mem) OMPSimdDirective(CollapsedNum, NumClauses);
120 }
121 
124  SourceLocation EndLoc, unsigned CollapsedNum,
125  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
126  const HelperExprs &Exprs, bool HasCancel) {
127  unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *));
128  void *Mem =
129  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
130  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
131  OMPForDirective *Dir =
132  new (Mem) OMPForDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
133  Dir->setClauses(Clauses);
134  Dir->setAssociatedStmt(AssociatedStmt);
136  Dir->setLastIteration(Exprs.LastIteration);
138  Dir->setPreCond(Exprs.PreCond);
139  Dir->setCond(Exprs.Cond);
140  Dir->setInit(Exprs.Init);
141  Dir->setInc(Exprs.Inc);
142  Dir->setIsLastIterVariable(Exprs.IL);
143  Dir->setLowerBoundVariable(Exprs.LB);
144  Dir->setUpperBoundVariable(Exprs.UB);
145  Dir->setStrideVariable(Exprs.ST);
146  Dir->setEnsureUpperBound(Exprs.EUB);
147  Dir->setNextLowerBound(Exprs.NLB);
148  Dir->setNextUpperBound(Exprs.NUB);
149  Dir->setNumIterations(Exprs.NumIterations);
150  Dir->setCounters(Exprs.Counters);
152  Dir->setInits(Exprs.Inits);
153  Dir->setUpdates(Exprs.Updates);
154  Dir->setFinals(Exprs.Finals);
155  Dir->setPreInits(Exprs.PreInits);
156  Dir->setHasCancel(HasCancel);
157  return Dir;
158 }
159 
161  unsigned NumClauses,
162  unsigned CollapsedNum,
163  EmptyShell) {
164  unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *));
165  void *Mem =
166  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
167  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
168  return new (Mem) OMPForDirective(CollapsedNum, NumClauses);
169 }
170 
173  SourceLocation EndLoc, unsigned CollapsedNum,
174  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
175  const HelperExprs &Exprs) {
176  unsigned Size =
177  llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *));
178  void *Mem =
179  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
180  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
181  OMPForSimdDirective *Dir = new (Mem)
182  OMPForSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
183  Dir->setClauses(Clauses);
184  Dir->setAssociatedStmt(AssociatedStmt);
186  Dir->setLastIteration(Exprs.LastIteration);
188  Dir->setPreCond(Exprs.PreCond);
189  Dir->setCond(Exprs.Cond);
190  Dir->setInit(Exprs.Init);
191  Dir->setInc(Exprs.Inc);
192  Dir->setIsLastIterVariable(Exprs.IL);
193  Dir->setLowerBoundVariable(Exprs.LB);
194  Dir->setUpperBoundVariable(Exprs.UB);
195  Dir->setStrideVariable(Exprs.ST);
196  Dir->setEnsureUpperBound(Exprs.EUB);
197  Dir->setNextLowerBound(Exprs.NLB);
198  Dir->setNextUpperBound(Exprs.NUB);
199  Dir->setNumIterations(Exprs.NumIterations);
200  Dir->setCounters(Exprs.Counters);
202  Dir->setInits(Exprs.Inits);
203  Dir->setUpdates(Exprs.Updates);
204  Dir->setFinals(Exprs.Finals);
205  Dir->setPreInits(Exprs.PreInits);
206  return Dir;
207 }
208 
210  unsigned NumClauses,
211  unsigned CollapsedNum,
212  EmptyShell) {
213  unsigned Size =
214  llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *));
215  void *Mem =
216  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
217  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
218  return new (Mem) OMPForSimdDirective(CollapsedNum, NumClauses);
219 }
220 
222  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
223  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
224  unsigned Size =
225  llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *));
226  void *Mem =
227  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
228  OMPSectionsDirective *Dir =
229  new (Mem) OMPSectionsDirective(StartLoc, EndLoc, Clauses.size());
230  Dir->setClauses(Clauses);
231  Dir->setAssociatedStmt(AssociatedStmt);
232  Dir->setHasCancel(HasCancel);
233  return Dir;
234 }
235 
237  unsigned NumClauses,
238  EmptyShell) {
239  unsigned Size =
240  llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *));
241  void *Mem =
242  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
243  return new (Mem) OMPSectionsDirective(NumClauses);
244 }
245 
247  SourceLocation StartLoc,
248  SourceLocation EndLoc,
249  Stmt *AssociatedStmt,
250  bool HasCancel) {
251  unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *));
252  void *Mem = C.Allocate(Size + sizeof(Stmt *));
253  OMPSectionDirective *Dir = new (Mem) OMPSectionDirective(StartLoc, EndLoc);
254  Dir->setAssociatedStmt(AssociatedStmt);
255  Dir->setHasCancel(HasCancel);
256  return Dir;
257 }
258 
260  EmptyShell) {
261  unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *));
262  void *Mem = C.Allocate(Size + sizeof(Stmt *));
263  return new (Mem) OMPSectionDirective();
264 }
265 
267  SourceLocation StartLoc,
268  SourceLocation EndLoc,
269  ArrayRef<OMPClause *> Clauses,
270  Stmt *AssociatedStmt) {
271  unsigned Size =
272  llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *));
273  void *Mem =
274  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
275  OMPSingleDirective *Dir =
276  new (Mem) OMPSingleDirective(StartLoc, EndLoc, Clauses.size());
277  Dir->setClauses(Clauses);
278  Dir->setAssociatedStmt(AssociatedStmt);
279  return Dir;
280 }
281 
283  unsigned NumClauses,
284  EmptyShell) {
285  unsigned Size =
286  llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *));
287  void *Mem =
288  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
289  return new (Mem) OMPSingleDirective(NumClauses);
290 }
291 
293  SourceLocation StartLoc,
294  SourceLocation EndLoc,
295  Stmt *AssociatedStmt) {
296  unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *));
297  void *Mem = C.Allocate(Size + sizeof(Stmt *));
298  OMPMasterDirective *Dir = new (Mem) OMPMasterDirective(StartLoc, EndLoc);
299  Dir->setAssociatedStmt(AssociatedStmt);
300  return Dir;
301 }
302 
304  EmptyShell) {
305  unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *));
306  void *Mem = C.Allocate(Size + sizeof(Stmt *));
307  return new (Mem) OMPMasterDirective();
308 }
309 
311  const ASTContext &C, const DeclarationNameInfo &Name,
312  SourceLocation StartLoc, SourceLocation EndLoc,
313  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
314  unsigned Size =
315  llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *));
316  void *Mem =
317  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
318  OMPCriticalDirective *Dir =
319  new (Mem) OMPCriticalDirective(Name, StartLoc, EndLoc, Clauses.size());
320  Dir->setClauses(Clauses);
321  Dir->setAssociatedStmt(AssociatedStmt);
322  return Dir;
323 }
324 
326  unsigned NumClauses,
327  EmptyShell) {
328  unsigned Size =
329  llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *));
330  void *Mem =
331  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
332  return new (Mem) OMPCriticalDirective(NumClauses);
333 }
334 
336  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
337  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
338  const HelperExprs &Exprs, bool HasCancel) {
339  unsigned Size =
340  llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *));
341  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
342  sizeof(Stmt *) *
343  numLoopChildren(CollapsedNum, OMPD_parallel_for));
344  OMPParallelForDirective *Dir = new (Mem)
345  OMPParallelForDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
346  Dir->setClauses(Clauses);
347  Dir->setAssociatedStmt(AssociatedStmt);
349  Dir->setLastIteration(Exprs.LastIteration);
351  Dir->setPreCond(Exprs.PreCond);
352  Dir->setCond(Exprs.Cond);
353  Dir->setInit(Exprs.Init);
354  Dir->setInc(Exprs.Inc);
355  Dir->setIsLastIterVariable(Exprs.IL);
356  Dir->setLowerBoundVariable(Exprs.LB);
357  Dir->setUpperBoundVariable(Exprs.UB);
358  Dir->setStrideVariable(Exprs.ST);
359  Dir->setEnsureUpperBound(Exprs.EUB);
360  Dir->setNextLowerBound(Exprs.NLB);
361  Dir->setNextUpperBound(Exprs.NUB);
362  Dir->setNumIterations(Exprs.NumIterations);
363  Dir->setCounters(Exprs.Counters);
365  Dir->setInits(Exprs.Inits);
366  Dir->setUpdates(Exprs.Updates);
367  Dir->setFinals(Exprs.Finals);
368  Dir->setPreInits(Exprs.PreInits);
369  Dir->setHasCancel(HasCancel);
370  return Dir;
371 }
372 
375  unsigned CollapsedNum, EmptyShell) {
376  unsigned Size =
377  llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *));
378  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
379  sizeof(Stmt *) *
380  numLoopChildren(CollapsedNum, OMPD_parallel_for));
381  return new (Mem) OMPParallelForDirective(CollapsedNum, NumClauses);
382 }
383 
385  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
386  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
387  const HelperExprs &Exprs) {
388  unsigned Size =
389  llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *));
390  void *Mem = C.Allocate(
391  Size + sizeof(OMPClause *) * Clauses.size() +
392  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
394  StartLoc, EndLoc, CollapsedNum, Clauses.size());
395  Dir->setClauses(Clauses);
396  Dir->setAssociatedStmt(AssociatedStmt);
398  Dir->setLastIteration(Exprs.LastIteration);
400  Dir->setPreCond(Exprs.PreCond);
401  Dir->setCond(Exprs.Cond);
402  Dir->setInit(Exprs.Init);
403  Dir->setInc(Exprs.Inc);
404  Dir->setIsLastIterVariable(Exprs.IL);
405  Dir->setLowerBoundVariable(Exprs.LB);
406  Dir->setUpperBoundVariable(Exprs.UB);
407  Dir->setStrideVariable(Exprs.ST);
408  Dir->setEnsureUpperBound(Exprs.EUB);
409  Dir->setNextLowerBound(Exprs.NLB);
410  Dir->setNextUpperBound(Exprs.NUB);
411  Dir->setNumIterations(Exprs.NumIterations);
412  Dir->setCounters(Exprs.Counters);
414  Dir->setInits(Exprs.Inits);
415  Dir->setUpdates(Exprs.Updates);
416  Dir->setFinals(Exprs.Finals);
417  Dir->setPreInits(Exprs.PreInits);
418  return Dir;
419 }
420 
423  unsigned NumClauses,
424  unsigned CollapsedNum, EmptyShell) {
425  unsigned Size =
426  llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *));
427  void *Mem = C.Allocate(
428  Size + sizeof(OMPClause *) * NumClauses +
429  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
430  return new (Mem) OMPParallelForSimdDirective(CollapsedNum, NumClauses);
431 }
432 
434  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
435  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
436  unsigned Size =
437  llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *));
438  void *Mem =
439  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
441  new (Mem) OMPParallelSectionsDirective(StartLoc, EndLoc, Clauses.size());
442  Dir->setClauses(Clauses);
443  Dir->setAssociatedStmt(AssociatedStmt);
444  Dir->setHasCancel(HasCancel);
445  return Dir;
446 }
447 
450  unsigned NumClauses, EmptyShell) {
451  unsigned Size =
452  llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *));
453  void *Mem =
454  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
455  return new (Mem) OMPParallelSectionsDirective(NumClauses);
456 }
457 
460  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
461  Stmt *AssociatedStmt, bool HasCancel) {
462  unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *));
463  void *Mem =
464  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
465  OMPTaskDirective *Dir =
466  new (Mem) OMPTaskDirective(StartLoc, EndLoc, Clauses.size());
467  Dir->setClauses(Clauses);
468  Dir->setAssociatedStmt(AssociatedStmt);
469  Dir->setHasCancel(HasCancel);
470  return Dir;
471 }
472 
474  unsigned NumClauses,
475  EmptyShell) {
476  unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *));
477  void *Mem =
478  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
479  return new (Mem) OMPTaskDirective(NumClauses);
480 }
481 
483  SourceLocation StartLoc,
484  SourceLocation EndLoc) {
485  void *Mem = C.Allocate(sizeof(OMPTaskyieldDirective));
486  OMPTaskyieldDirective *Dir =
487  new (Mem) OMPTaskyieldDirective(StartLoc, EndLoc);
488  return Dir;
489 }
490 
492  EmptyShell) {
493  void *Mem = C.Allocate(sizeof(OMPTaskyieldDirective));
494  return new (Mem) OMPTaskyieldDirective();
495 }
496 
498  SourceLocation StartLoc,
499  SourceLocation EndLoc) {
500  void *Mem = C.Allocate(sizeof(OMPBarrierDirective));
501  OMPBarrierDirective *Dir = new (Mem) OMPBarrierDirective(StartLoc, EndLoc);
502  return Dir;
503 }
504 
506  EmptyShell) {
507  void *Mem = C.Allocate(sizeof(OMPBarrierDirective));
508  return new (Mem) OMPBarrierDirective();
509 }
510 
512  SourceLocation StartLoc,
513  SourceLocation EndLoc) {
514  void *Mem = C.Allocate(sizeof(OMPTaskwaitDirective));
515  OMPTaskwaitDirective *Dir = new (Mem) OMPTaskwaitDirective(StartLoc, EndLoc);
516  return Dir;
517 }
518 
520  EmptyShell) {
521  void *Mem = C.Allocate(sizeof(OMPTaskwaitDirective));
522  return new (Mem) OMPTaskwaitDirective();
523 }
524 
526  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
527  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) {
528  unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective) +
529  sizeof(OMPClause *) * Clauses.size(),
530  alignof(Stmt *));
531  void *Mem = C.Allocate(Size + sizeof(Stmt *) + sizeof(Expr *));
532  OMPTaskgroupDirective *Dir =
533  new (Mem) OMPTaskgroupDirective(StartLoc, EndLoc, Clauses.size());
534  Dir->setAssociatedStmt(AssociatedStmt);
535  Dir->setReductionRef(ReductionRef);
536  Dir->setClauses(Clauses);
537  return Dir;
538 }
539 
541  unsigned NumClauses,
542  EmptyShell) {
543  unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective) +
544  sizeof(OMPClause *) * NumClauses,
545  alignof(Stmt *));
546  void *Mem = C.Allocate(Size + sizeof(Stmt *) + sizeof(Expr *));
547  return new (Mem) OMPTaskgroupDirective(NumClauses);
548 }
549 
551  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
552  OpenMPDirectiveKind CancelRegion) {
553  unsigned Size =
554  llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *));
555  void *Mem = C.Allocate(Size);
557  new (Mem) OMPCancellationPointDirective(StartLoc, EndLoc);
558  Dir->setCancelRegion(CancelRegion);
559  return Dir;
560 }
561 
564  unsigned Size =
565  llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *));
566  void *Mem = C.Allocate(Size);
567  return new (Mem) OMPCancellationPointDirective();
568 }
569 
572  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
573  OpenMPDirectiveKind CancelRegion) {
574  unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
575  sizeof(OMPClause *) * Clauses.size(),
576  alignof(Stmt *));
577  void *Mem = C.Allocate(Size);
578  OMPCancelDirective *Dir =
579  new (Mem) OMPCancelDirective(StartLoc, EndLoc, Clauses.size());
580  Dir->setClauses(Clauses);
581  Dir->setCancelRegion(CancelRegion);
582  return Dir;
583 }
584 
586  unsigned NumClauses,
587  EmptyShell) {
588  unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
589  sizeof(OMPClause *) * NumClauses,
590  alignof(Stmt *));
591  void *Mem = C.Allocate(Size);
592  return new (Mem) OMPCancelDirective(NumClauses);
593 }
594 
596  SourceLocation StartLoc,
597  SourceLocation EndLoc,
598  ArrayRef<OMPClause *> Clauses) {
599  unsigned Size =
600  llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *));
601  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size());
602  OMPFlushDirective *Dir =
603  new (Mem) OMPFlushDirective(StartLoc, EndLoc, Clauses.size());
604  Dir->setClauses(Clauses);
605  return Dir;
606 }
607 
609  unsigned NumClauses,
610  EmptyShell) {
611  unsigned Size =
612  llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *));
613  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses);
614  return new (Mem) OMPFlushDirective(NumClauses);
615 }
616 
618  SourceLocation StartLoc,
619  SourceLocation EndLoc,
620  ArrayRef<OMPClause *> Clauses,
621  Stmt *AssociatedStmt) {
622  unsigned Size =
623  llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *));
624  void *Mem =
625  C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * Clauses.size());
626  OMPOrderedDirective *Dir =
627  new (Mem) OMPOrderedDirective(StartLoc, EndLoc, Clauses.size());
628  Dir->setClauses(Clauses);
629  Dir->setAssociatedStmt(AssociatedStmt);
630  return Dir;
631 }
632 
634  unsigned NumClauses,
635  EmptyShell) {
636  unsigned Size =
637  llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *));
638  void *Mem =
639  C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * NumClauses);
640  return new (Mem) OMPOrderedDirective(NumClauses);
641 }
642 
644  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
645  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V,
646  Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate) {
647  unsigned Size =
648  llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *));
649  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
650  5 * sizeof(Stmt *));
651  OMPAtomicDirective *Dir =
652  new (Mem) OMPAtomicDirective(StartLoc, EndLoc, Clauses.size());
653  Dir->setClauses(Clauses);
654  Dir->setAssociatedStmt(AssociatedStmt);
655  Dir->setX(X);
656  Dir->setV(V);
657  Dir->setExpr(E);
658  Dir->setUpdateExpr(UE);
659  Dir->IsXLHSInRHSPart = IsXLHSInRHSPart;
660  Dir->IsPostfixUpdate = IsPostfixUpdate;
661  return Dir;
662 }
663 
665  unsigned NumClauses,
666  EmptyShell) {
667  unsigned Size =
668  llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *));
669  void *Mem =
670  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 5 * sizeof(Stmt *));
671  return new (Mem) OMPAtomicDirective(NumClauses);
672 }
673 
675  SourceLocation StartLoc,
676  SourceLocation EndLoc,
677  ArrayRef<OMPClause *> Clauses,
678  Stmt *AssociatedStmt) {
679  unsigned Size =
680  llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *));
681  void *Mem =
682  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
683  OMPTargetDirective *Dir =
684  new (Mem) OMPTargetDirective(StartLoc, EndLoc, Clauses.size());
685  Dir->setClauses(Clauses);
686  Dir->setAssociatedStmt(AssociatedStmt);
687  return Dir;
688 }
689 
691  unsigned NumClauses,
692  EmptyShell) {
693  unsigned Size =
694  llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *));
695  void *Mem =
696  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
697  return new (Mem) OMPTargetDirective(NumClauses);
698 }
699 
701  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
702  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
703  unsigned Size =
704  llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *));
705  void *Mem =
706  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
708  new (Mem) OMPTargetParallelDirective(StartLoc, EndLoc, Clauses.size());
709  Dir->setClauses(Clauses);
710  Dir->setAssociatedStmt(AssociatedStmt);
711  return Dir;
712 }
713 
716  unsigned NumClauses, EmptyShell) {
717  unsigned Size =
718  llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *));
719  void *Mem =
720  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
721  return new (Mem) OMPTargetParallelDirective(NumClauses);
722 }
723 
725  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
726  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
727  const HelperExprs &Exprs, bool HasCancel) {
728  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
729  alignof(OMPClause *));
730  void *Mem = C.Allocate(
731  Size + sizeof(OMPClause *) * Clauses.size() +
732  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
734  StartLoc, EndLoc, CollapsedNum, Clauses.size());
735  Dir->setClauses(Clauses);
736  Dir->setAssociatedStmt(AssociatedStmt);
738  Dir->setLastIteration(Exprs.LastIteration);
740  Dir->setPreCond(Exprs.PreCond);
741  Dir->setCond(Exprs.Cond);
742  Dir->setInit(Exprs.Init);
743  Dir->setInc(Exprs.Inc);
744  Dir->setIsLastIterVariable(Exprs.IL);
745  Dir->setLowerBoundVariable(Exprs.LB);
746  Dir->setUpperBoundVariable(Exprs.UB);
747  Dir->setStrideVariable(Exprs.ST);
748  Dir->setEnsureUpperBound(Exprs.EUB);
749  Dir->setNextLowerBound(Exprs.NLB);
750  Dir->setNextUpperBound(Exprs.NUB);
751  Dir->setNumIterations(Exprs.NumIterations);
752  Dir->setCounters(Exprs.Counters);
754  Dir->setInits(Exprs.Inits);
755  Dir->setUpdates(Exprs.Updates);
756  Dir->setFinals(Exprs.Finals);
757  Dir->setPreInits(Exprs.PreInits);
758  Dir->setHasCancel(HasCancel);
759  return Dir;
760 }
761 
764  unsigned NumClauses,
765  unsigned CollapsedNum, EmptyShell) {
766  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
767  alignof(OMPClause *));
768  void *Mem = C.Allocate(
769  Size + sizeof(OMPClause *) * NumClauses +
770  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
771  return new (Mem) OMPTargetParallelForDirective(CollapsedNum, NumClauses);
772 }
773 
775  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
776  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
777  void *Mem = C.Allocate(
778  llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) +
779  sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
781  new (Mem) OMPTargetDataDirective(StartLoc, EndLoc, Clauses.size());
782  Dir->setClauses(Clauses);
783  Dir->setAssociatedStmt(AssociatedStmt);
784  return Dir;
785 }
786 
788  unsigned N,
789  EmptyShell) {
790  void *Mem = C.Allocate(
791  llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) +
792  sizeof(OMPClause *) * N + sizeof(Stmt *));
793  return new (Mem) OMPTargetDataDirective(N);
794 }
795 
797  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
798  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
799  void *Mem = C.Allocate(
800  llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) +
801  sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
803  new (Mem) OMPTargetEnterDataDirective(StartLoc, EndLoc, Clauses.size());
804  Dir->setClauses(Clauses);
805  Dir->setAssociatedStmt(AssociatedStmt);
806  return Dir;
807 }
808 
811  EmptyShell) {
812  void *Mem = C.Allocate(
813  llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) +
814  sizeof(OMPClause *) * N + sizeof(Stmt *));
815  return new (Mem) OMPTargetEnterDataDirective(N);
816 }
817 
819  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
820  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
821  void *Mem = C.Allocate(
822  llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) +
823  sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
825  new (Mem) OMPTargetExitDataDirective(StartLoc, EndLoc, Clauses.size());
826  Dir->setClauses(Clauses);
827  Dir->setAssociatedStmt(AssociatedStmt);
828  return Dir;
829 }
830 
833  EmptyShell) {
834  void *Mem = C.Allocate(
835  llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) +
836  sizeof(OMPClause *) * N + sizeof(Stmt *));
837  return new (Mem) OMPTargetExitDataDirective(N);
838 }
839 
841  SourceLocation StartLoc,
842  SourceLocation EndLoc,
843  ArrayRef<OMPClause *> Clauses,
844  Stmt *AssociatedStmt) {
845  unsigned Size =
846  llvm::alignTo(sizeof(OMPTeamsDirective), alignof(OMPClause *));
847  void *Mem =
848  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
849  OMPTeamsDirective *Dir =
850  new (Mem) OMPTeamsDirective(StartLoc, EndLoc, Clauses.size());
851  Dir->setClauses(Clauses);
852  Dir->setAssociatedStmt(AssociatedStmt);
853  return Dir;
854 }
855 
857  unsigned NumClauses,
858  EmptyShell) {
859  unsigned Size =
860  llvm::alignTo(sizeof(OMPTeamsDirective), alignof(OMPClause *));
861  void *Mem =
862  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
863  return new (Mem) OMPTeamsDirective(NumClauses);
864 }
865 
867  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
868  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
869  const HelperExprs &Exprs) {
870  unsigned Size =
871  llvm::alignTo(sizeof(OMPTaskLoopDirective), alignof(OMPClause *));
872  void *Mem =
873  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
874  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
875  OMPTaskLoopDirective *Dir = new (Mem)
876  OMPTaskLoopDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
877  Dir->setClauses(Clauses);
878  Dir->setAssociatedStmt(AssociatedStmt);
880  Dir->setLastIteration(Exprs.LastIteration);
882  Dir->setPreCond(Exprs.PreCond);
883  Dir->setCond(Exprs.Cond);
884  Dir->setInit(Exprs.Init);
885  Dir->setInc(Exprs.Inc);
886  Dir->setIsLastIterVariable(Exprs.IL);
887  Dir->setLowerBoundVariable(Exprs.LB);
888  Dir->setUpperBoundVariable(Exprs.UB);
889  Dir->setStrideVariable(Exprs.ST);
890  Dir->setEnsureUpperBound(Exprs.EUB);
891  Dir->setNextLowerBound(Exprs.NLB);
892  Dir->setNextUpperBound(Exprs.NUB);
893  Dir->setNumIterations(Exprs.NumIterations);
894  Dir->setCounters(Exprs.Counters);
896  Dir->setInits(Exprs.Inits);
897  Dir->setUpdates(Exprs.Updates);
898  Dir->setFinals(Exprs.Finals);
899  Dir->setPreInits(Exprs.PreInits);
900  return Dir;
901 }
902 
904  unsigned NumClauses,
905  unsigned CollapsedNum,
906  EmptyShell) {
907  unsigned Size =
908  llvm::alignTo(sizeof(OMPTaskLoopDirective), alignof(OMPClause *));
909  void *Mem =
910  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
911  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
912  return new (Mem) OMPTaskLoopDirective(CollapsedNum, NumClauses);
913 }
914 
916  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
917  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
918  const HelperExprs &Exprs) {
919  unsigned Size =
920  llvm::alignTo(sizeof(OMPTaskLoopSimdDirective), alignof(OMPClause *));
921  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
922  sizeof(Stmt *) *
923  numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
924  OMPTaskLoopSimdDirective *Dir = new (Mem)
925  OMPTaskLoopSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
926  Dir->setClauses(Clauses);
927  Dir->setAssociatedStmt(AssociatedStmt);
929  Dir->setLastIteration(Exprs.LastIteration);
931  Dir->setPreCond(Exprs.PreCond);
932  Dir->setCond(Exprs.Cond);
933  Dir->setInit(Exprs.Init);
934  Dir->setInc(Exprs.Inc);
935  Dir->setIsLastIterVariable(Exprs.IL);
936  Dir->setLowerBoundVariable(Exprs.LB);
937  Dir->setUpperBoundVariable(Exprs.UB);
938  Dir->setStrideVariable(Exprs.ST);
939  Dir->setEnsureUpperBound(Exprs.EUB);
940  Dir->setNextLowerBound(Exprs.NLB);
941  Dir->setNextUpperBound(Exprs.NUB);
942  Dir->setNumIterations(Exprs.NumIterations);
943  Dir->setCounters(Exprs.Counters);
945  Dir->setInits(Exprs.Inits);
946  Dir->setUpdates(Exprs.Updates);
947  Dir->setFinals(Exprs.Finals);
948  Dir->setPreInits(Exprs.PreInits);
949  return Dir;
950 }
951 
954  unsigned CollapsedNum, EmptyShell) {
955  unsigned Size =
956  llvm::alignTo(sizeof(OMPTaskLoopSimdDirective), alignof(OMPClause *));
957  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
958  sizeof(Stmt *) *
959  numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
960  return new (Mem) OMPTaskLoopSimdDirective(CollapsedNum, NumClauses);
961 }
962 
964  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
965  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
966  const HelperExprs &Exprs) {
967  unsigned Size =
968  llvm::alignTo(sizeof(OMPDistributeDirective), alignof(OMPClause *));
969  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
970  sizeof(Stmt *) *
971  numLoopChildren(CollapsedNum, OMPD_distribute));
972  OMPDistributeDirective *Dir = new (Mem)
973  OMPDistributeDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
974  Dir->setClauses(Clauses);
975  Dir->setAssociatedStmt(AssociatedStmt);
977  Dir->setLastIteration(Exprs.LastIteration);
979  Dir->setPreCond(Exprs.PreCond);
980  Dir->setCond(Exprs.Cond);
981  Dir->setInit(Exprs.Init);
982  Dir->setInc(Exprs.Inc);
983  Dir->setIsLastIterVariable(Exprs.IL);
984  Dir->setLowerBoundVariable(Exprs.LB);
985  Dir->setUpperBoundVariable(Exprs.UB);
986  Dir->setStrideVariable(Exprs.ST);
987  Dir->setEnsureUpperBound(Exprs.EUB);
988  Dir->setNextLowerBound(Exprs.NLB);
989  Dir->setNextUpperBound(Exprs.NUB);
990  Dir->setNumIterations(Exprs.NumIterations);
991  Dir->setCounters(Exprs.Counters);
993  Dir->setInits(Exprs.Inits);
994  Dir->setUpdates(Exprs.Updates);
995  Dir->setFinals(Exprs.Finals);
996  Dir->setPreInits(Exprs.PreInits);
997  return Dir;
998 }
999 
1002  unsigned CollapsedNum, EmptyShell) {
1003  unsigned Size =
1004  llvm::alignTo(sizeof(OMPDistributeDirective), alignof(OMPClause *));
1005  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1006  sizeof(Stmt *) *
1007  numLoopChildren(CollapsedNum, OMPD_distribute));
1008  return new (Mem) OMPDistributeDirective(CollapsedNum, NumClauses);
1009 }
1010 
1012  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1013  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1014  unsigned Size =
1015  llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *));
1016  void *Mem =
1017  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
1019  new (Mem) OMPTargetUpdateDirective(StartLoc, EndLoc, Clauses.size());
1020  Dir->setClauses(Clauses);
1021  Dir->setAssociatedStmt(AssociatedStmt);
1022  return Dir;
1023 }
1024 
1027  EmptyShell) {
1028  unsigned Size =
1029  llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *));
1030  void *Mem =
1031  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
1032  return new (Mem) OMPTargetUpdateDirective(NumClauses);
1033 }
1034 
1036  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1037  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1038  const HelperExprs &Exprs, bool HasCancel) {
1039  unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
1040  alignof(OMPClause *));
1041  void *Mem = C.Allocate(
1042  Size + sizeof(OMPClause *) * Clauses.size() +
1043  sizeof(Stmt *) *
1044  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for));
1046  new (Mem) OMPDistributeParallelForDirective(StartLoc, EndLoc,
1047  CollapsedNum, Clauses.size());
1048  Dir->setClauses(Clauses);
1049  Dir->setAssociatedStmt(AssociatedStmt);
1051  Dir->setLastIteration(Exprs.LastIteration);
1053  Dir->setPreCond(Exprs.PreCond);
1054  Dir->setCond(Exprs.Cond);
1055  Dir->setInit(Exprs.Init);
1056  Dir->setInc(Exprs.Inc);
1057  Dir->setIsLastIterVariable(Exprs.IL);
1058  Dir->setLowerBoundVariable(Exprs.LB);
1059  Dir->setUpperBoundVariable(Exprs.UB);
1060  Dir->setStrideVariable(Exprs.ST);
1061  Dir->setEnsureUpperBound(Exprs.EUB);
1062  Dir->setNextLowerBound(Exprs.NLB);
1063  Dir->setNextUpperBound(Exprs.NUB);
1064  Dir->setNumIterations(Exprs.NumIterations);
1065  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1066  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1067  Dir->setDistInc(Exprs.DistInc);
1068  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1069  Dir->setCounters(Exprs.Counters);
1070  Dir->setPrivateCounters(Exprs.PrivateCounters);
1071  Dir->setInits(Exprs.Inits);
1072  Dir->setUpdates(Exprs.Updates);
1073  Dir->setFinals(Exprs.Finals);
1074  Dir->setPreInits(Exprs.PreInits);
1082  Dir->HasCancel = HasCancel;
1083  return Dir;
1084 }
1085 
1088  unsigned NumClauses,
1089  unsigned CollapsedNum,
1090  EmptyShell) {
1091  unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
1092  alignof(OMPClause *));
1093  void *Mem = C.Allocate(
1094  Size + sizeof(OMPClause *) * NumClauses +
1095  sizeof(Stmt *) *
1096  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for));
1097  return new (Mem) OMPDistributeParallelForDirective(CollapsedNum, NumClauses);
1098 }
1099 
1102  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1103  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1104  const HelperExprs &Exprs) {
1105  unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
1106  alignof(OMPClause *));
1107  void *Mem = C.Allocate(
1108  Size + sizeof(OMPClause *) * Clauses.size() +
1109  sizeof(Stmt *) *
1110  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd));
1111  OMPDistributeParallelForSimdDirective *Dir = new (Mem)
1112  OMPDistributeParallelForSimdDirective(StartLoc, EndLoc, CollapsedNum,
1113  Clauses.size());
1114  Dir->setClauses(Clauses);
1115  Dir->setAssociatedStmt(AssociatedStmt);
1117  Dir->setLastIteration(Exprs.LastIteration);
1119  Dir->setPreCond(Exprs.PreCond);
1120  Dir->setCond(Exprs.Cond);
1121  Dir->setInit(Exprs.Init);
1122  Dir->setInc(Exprs.Inc);
1123  Dir->setIsLastIterVariable(Exprs.IL);
1124  Dir->setLowerBoundVariable(Exprs.LB);
1125  Dir->setUpperBoundVariable(Exprs.UB);
1126  Dir->setStrideVariable(Exprs.ST);
1127  Dir->setEnsureUpperBound(Exprs.EUB);
1128  Dir->setNextLowerBound(Exprs.NLB);
1129  Dir->setNextUpperBound(Exprs.NUB);
1130  Dir->setNumIterations(Exprs.NumIterations);
1131  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1132  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1133  Dir->setDistInc(Exprs.DistInc);
1134  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1135  Dir->setCounters(Exprs.Counters);
1136  Dir->setPrivateCounters(Exprs.PrivateCounters);
1137  Dir->setInits(Exprs.Inits);
1138  Dir->setUpdates(Exprs.Updates);
1139  Dir->setFinals(Exprs.Finals);
1140  Dir->setPreInits(Exprs.PreInits);
1148  return Dir;
1149 }
1150 
1153  unsigned NumClauses,
1154  unsigned CollapsedNum,
1155  EmptyShell) {
1156  unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
1157  alignof(OMPClause *));
1158  void *Mem = C.Allocate(
1159  Size + sizeof(OMPClause *) * NumClauses +
1160  sizeof(Stmt *) *
1161  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd));
1162  return new (Mem)
1163  OMPDistributeParallelForSimdDirective(CollapsedNum, NumClauses);
1164 }
1165 
1167  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1168  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1169  const HelperExprs &Exprs) {
1170  unsigned Size =
1171  llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *));
1172  void *Mem = C.Allocate(
1173  Size + sizeof(OMPClause *) * Clauses.size() +
1174  sizeof(Stmt *) *
1175  numLoopChildren(CollapsedNum, OMPD_distribute_simd));
1177  StartLoc, EndLoc, CollapsedNum, Clauses.size());
1178  Dir->setClauses(Clauses);
1179  Dir->setAssociatedStmt(AssociatedStmt);
1181  Dir->setLastIteration(Exprs.LastIteration);
1183  Dir->setPreCond(Exprs.PreCond);
1184  Dir->setCond(Exprs.Cond);
1185  Dir->setInit(Exprs.Init);
1186  Dir->setInc(Exprs.Inc);
1187  Dir->setIsLastIterVariable(Exprs.IL);
1188  Dir->setLowerBoundVariable(Exprs.LB);
1189  Dir->setUpperBoundVariable(Exprs.UB);
1190  Dir->setStrideVariable(Exprs.ST);
1191  Dir->setEnsureUpperBound(Exprs.EUB);
1192  Dir->setNextLowerBound(Exprs.NLB);
1193  Dir->setNextUpperBound(Exprs.NUB);
1194  Dir->setNumIterations(Exprs.NumIterations);
1195  Dir->setCounters(Exprs.Counters);
1196  Dir->setPrivateCounters(Exprs.PrivateCounters);
1197  Dir->setInits(Exprs.Inits);
1198  Dir->setUpdates(Exprs.Updates);
1199  Dir->setFinals(Exprs.Finals);
1200  Dir->setPreInits(Exprs.PreInits);
1201  return Dir;
1202 }
1203 
1206  unsigned NumClauses,
1207  unsigned CollapsedNum, EmptyShell) {
1208  unsigned Size =
1209  llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *));
1210  void *Mem = C.Allocate(
1211  Size + sizeof(OMPClause *) * NumClauses +
1212  sizeof(Stmt *) *
1213  numLoopChildren(CollapsedNum, OMPD_distribute_simd));
1214  return new (Mem) OMPDistributeSimdDirective(CollapsedNum, NumClauses);
1215 }
1216 
1218  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1219  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1220  const HelperExprs &Exprs) {
1221  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
1222  alignof(OMPClause *));
1223  void *Mem = C.Allocate(
1224  Size + sizeof(OMPClause *) * Clauses.size() +
1225  sizeof(Stmt *) *
1226  numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd));
1228  new (Mem) OMPTargetParallelForSimdDirective(StartLoc, EndLoc,
1229  CollapsedNum, Clauses.size());
1230  Dir->setClauses(Clauses);
1231  Dir->setAssociatedStmt(AssociatedStmt);
1233  Dir->setLastIteration(Exprs.LastIteration);
1235  Dir->setPreCond(Exprs.PreCond);
1236  Dir->setCond(Exprs.Cond);
1237  Dir->setInit(Exprs.Init);
1238  Dir->setInc(Exprs.Inc);
1239  Dir->setIsLastIterVariable(Exprs.IL);
1240  Dir->setLowerBoundVariable(Exprs.LB);
1241  Dir->setUpperBoundVariable(Exprs.UB);
1242  Dir->setStrideVariable(Exprs.ST);
1243  Dir->setEnsureUpperBound(Exprs.EUB);
1244  Dir->setNextLowerBound(Exprs.NLB);
1245  Dir->setNextUpperBound(Exprs.NUB);
1246  Dir->setNumIterations(Exprs.NumIterations);
1247  Dir->setCounters(Exprs.Counters);
1248  Dir->setPrivateCounters(Exprs.PrivateCounters);
1249  Dir->setInits(Exprs.Inits);
1250  Dir->setUpdates(Exprs.Updates);
1251  Dir->setFinals(Exprs.Finals);
1252  Dir->setPreInits(Exprs.PreInits);
1253  return Dir;
1254 }
1255 
1258  unsigned NumClauses,
1259  unsigned CollapsedNum,
1260  EmptyShell) {
1261  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
1262  alignof(OMPClause *));
1263  void *Mem = C.Allocate(
1264  Size + sizeof(OMPClause *) * NumClauses +
1265  sizeof(Stmt *) *
1266  numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd));
1267  return new (Mem) OMPTargetParallelForSimdDirective(CollapsedNum, NumClauses);
1268 }
1269 
1272  SourceLocation EndLoc, unsigned CollapsedNum,
1273  ArrayRef<OMPClause *> Clauses,
1274  Stmt *AssociatedStmt, const HelperExprs &Exprs) {
1275  unsigned Size =
1276  llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *));
1277  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1278  sizeof(Stmt *) *
1279  numLoopChildren(CollapsedNum, OMPD_target_simd));
1280  OMPTargetSimdDirective *Dir = new (Mem)
1281  OMPTargetSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
1282  Dir->setClauses(Clauses);
1283  Dir->setAssociatedStmt(AssociatedStmt);
1285  Dir->setLastIteration(Exprs.LastIteration);
1287  Dir->setPreCond(Exprs.PreCond);
1288  Dir->setCond(Exprs.Cond);
1289  Dir->setInit(Exprs.Init);
1290  Dir->setInc(Exprs.Inc);
1291  Dir->setCounters(Exprs.Counters);
1292  Dir->setPrivateCounters(Exprs.PrivateCounters);
1293  Dir->setInits(Exprs.Inits);
1294  Dir->setUpdates(Exprs.Updates);
1295  Dir->setFinals(Exprs.Finals);
1296  Dir->setPreInits(Exprs.PreInits);
1297  return Dir;
1298 }
1299 
1302  unsigned CollapsedNum, EmptyShell) {
1303  unsigned Size =
1304  llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *));
1305  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1306  sizeof(Stmt *) *
1307  numLoopChildren(CollapsedNum, OMPD_target_simd));
1308  return new (Mem) OMPTargetSimdDirective(CollapsedNum, NumClauses);
1309 }
1310 
1312  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1313  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1314  const HelperExprs &Exprs) {
1315  unsigned Size =
1316  llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *));
1317  void *Mem = C.Allocate(
1318  Size + sizeof(OMPClause *) * Clauses.size() +
1319  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
1321  StartLoc, EndLoc, CollapsedNum, Clauses.size());
1322  Dir->setClauses(Clauses);
1323  Dir->setAssociatedStmt(AssociatedStmt);
1325  Dir->setLastIteration(Exprs.LastIteration);
1327  Dir->setPreCond(Exprs.PreCond);
1328  Dir->setCond(Exprs.Cond);
1329  Dir->setInit(Exprs.Init);
1330  Dir->setInc(Exprs.Inc);
1331  Dir->setIsLastIterVariable(Exprs.IL);
1332  Dir->setLowerBoundVariable(Exprs.LB);
1333  Dir->setUpperBoundVariable(Exprs.UB);
1334  Dir->setStrideVariable(Exprs.ST);
1335  Dir->setEnsureUpperBound(Exprs.EUB);
1336  Dir->setNextLowerBound(Exprs.NLB);
1337  Dir->setNextUpperBound(Exprs.NUB);
1338  Dir->setNumIterations(Exprs.NumIterations);
1339  Dir->setCounters(Exprs.Counters);
1340  Dir->setPrivateCounters(Exprs.PrivateCounters);
1341  Dir->setInits(Exprs.Inits);
1342  Dir->setUpdates(Exprs.Updates);
1343  Dir->setFinals(Exprs.Finals);
1344  Dir->setPreInits(Exprs.PreInits);
1345  return Dir;
1346 }
1347 
1350  unsigned NumClauses,
1351  unsigned CollapsedNum, EmptyShell) {
1352  unsigned Size =
1353  llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *));
1354  void *Mem = C.Allocate(
1355  Size + sizeof(OMPClause *) * NumClauses +
1356  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
1357  return new (Mem) OMPTeamsDistributeDirective(CollapsedNum, NumClauses);
1358 }
1359 
1361  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1362  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1363  const HelperExprs &Exprs) {
1364  unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeSimdDirective),
1365  alignof(OMPClause *));
1366  void *Mem =
1367  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1368  sizeof(Stmt *) *
1369  numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd));
1371  new (Mem) OMPTeamsDistributeSimdDirective(StartLoc, EndLoc, CollapsedNum,
1372  Clauses.size());
1373  Dir->setClauses(Clauses);
1374  Dir->setAssociatedStmt(AssociatedStmt);
1376  Dir->setLastIteration(Exprs.LastIteration);
1378  Dir->setPreCond(Exprs.PreCond);
1379  Dir->setCond(Exprs.Cond);
1380  Dir->setInit(Exprs.Init);
1381  Dir->setInc(Exprs.Inc);
1382  Dir->setIsLastIterVariable(Exprs.IL);
1383  Dir->setLowerBoundVariable(Exprs.LB);
1384  Dir->setUpperBoundVariable(Exprs.UB);
1385  Dir->setStrideVariable(Exprs.ST);
1386  Dir->setEnsureUpperBound(Exprs.EUB);
1387  Dir->setNextLowerBound(Exprs.NLB);
1388  Dir->setNextUpperBound(Exprs.NUB);
1389  Dir->setNumIterations(Exprs.NumIterations);
1390  Dir->setCounters(Exprs.Counters);
1391  Dir->setPrivateCounters(Exprs.PrivateCounters);
1392  Dir->setInits(Exprs.Inits);
1393  Dir->setUpdates(Exprs.Updates);
1394  Dir->setFinals(Exprs.Finals);
1395  Dir->setPreInits(Exprs.PreInits);
1396  return Dir;
1397 }
1398 
1400  const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1401  EmptyShell) {
1402  unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeSimdDirective),
1403  alignof(OMPClause *));
1404  void *Mem =
1405  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1406  sizeof(Stmt *) *
1407  numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd));
1408  return new (Mem) OMPTeamsDistributeSimdDirective(CollapsedNum, NumClauses);
1409 }
1410 
1413  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1414  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1415  const HelperExprs &Exprs) {
1416  auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForSimdDirective),
1417  alignof(OMPClause *));
1418  void *Mem =
1419  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1420  sizeof(Stmt *) *
1421  numLoopChildren(CollapsedNum,
1422  OMPD_teams_distribute_parallel_for_simd));
1424  OMPTeamsDistributeParallelForSimdDirective(StartLoc, EndLoc, CollapsedNum,
1425  Clauses.size());
1426  Dir->setClauses(Clauses);
1427  Dir->setAssociatedStmt(AssociatedStmt);
1429  Dir->setLastIteration(Exprs.LastIteration);
1431  Dir->setPreCond(Exprs.PreCond);
1432  Dir->setCond(Exprs.Cond);
1433  Dir->setInit(Exprs.Init);
1434  Dir->setInc(Exprs.Inc);
1435  Dir->setIsLastIterVariable(Exprs.IL);
1436  Dir->setLowerBoundVariable(Exprs.LB);
1437  Dir->setUpperBoundVariable(Exprs.UB);
1438  Dir->setStrideVariable(Exprs.ST);
1439  Dir->setEnsureUpperBound(Exprs.EUB);
1440  Dir->setNextLowerBound(Exprs.NLB);
1441  Dir->setNextUpperBound(Exprs.NUB);
1442  Dir->setNumIterations(Exprs.NumIterations);
1443  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1444  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1445  Dir->setDistInc(Exprs.DistInc);
1446  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1447  Dir->setCounters(Exprs.Counters);
1448  Dir->setPrivateCounters(Exprs.PrivateCounters);
1449  Dir->setInits(Exprs.Inits);
1450  Dir->setUpdates(Exprs.Updates);
1451  Dir->setFinals(Exprs.Finals);
1452  Dir->setPreInits(Exprs.PreInits);
1460  return Dir;
1461 }
1462 
1465  unsigned NumClauses,
1466  unsigned CollapsedNum,
1467  EmptyShell) {
1468  auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForSimdDirective),
1469  alignof(OMPClause *));
1470  void *Mem =
1471  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1472  sizeof(Stmt *) *
1473  numLoopChildren(CollapsedNum,
1474  OMPD_teams_distribute_parallel_for_simd));
1475  return new (Mem)
1476  OMPTeamsDistributeParallelForSimdDirective(CollapsedNum, NumClauses);
1477 }
1478 
1481  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1482  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1483  const HelperExprs &Exprs, bool HasCancel) {
1484  auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForDirective),
1485  alignof(OMPClause *));
1486  void *Mem = C.Allocate(
1487  Size + sizeof(OMPClause *) * Clauses.size() +
1488  sizeof(Stmt *) *
1489  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for));
1491  OMPTeamsDistributeParallelForDirective(StartLoc, EndLoc, CollapsedNum,
1492  Clauses.size());
1493  Dir->setClauses(Clauses);
1494  Dir->setAssociatedStmt(AssociatedStmt);
1496  Dir->setLastIteration(Exprs.LastIteration);
1498  Dir->setPreCond(Exprs.PreCond);
1499  Dir->setCond(Exprs.Cond);
1500  Dir->setInit(Exprs.Init);
1501  Dir->setInc(Exprs.Inc);
1502  Dir->setIsLastIterVariable(Exprs.IL);
1503  Dir->setLowerBoundVariable(Exprs.LB);
1504  Dir->setUpperBoundVariable(Exprs.UB);
1505  Dir->setStrideVariable(Exprs.ST);
1506  Dir->setEnsureUpperBound(Exprs.EUB);
1507  Dir->setNextLowerBound(Exprs.NLB);
1508  Dir->setNextUpperBound(Exprs.NUB);
1509  Dir->setNumIterations(Exprs.NumIterations);
1510  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1511  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1512  Dir->setDistInc(Exprs.DistInc);
1513  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1514  Dir->setCounters(Exprs.Counters);
1515  Dir->setPrivateCounters(Exprs.PrivateCounters);
1516  Dir->setInits(Exprs.Inits);
1517  Dir->setUpdates(Exprs.Updates);
1518  Dir->setFinals(Exprs.Finals);
1519  Dir->setPreInits(Exprs.PreInits);
1527  Dir->HasCancel = HasCancel;
1528  return Dir;
1529 }
1530 
1533  unsigned NumClauses,
1534  unsigned CollapsedNum,
1535  EmptyShell) {
1536  auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForDirective),
1537  alignof(OMPClause *));
1538  void *Mem = C.Allocate(
1539  Size + sizeof(OMPClause *) * NumClauses +
1540  sizeof(Stmt *) *
1541  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for));
1542  return new (Mem)
1543  OMPTeamsDistributeParallelForDirective(CollapsedNum, NumClauses);
1544 }
1545 
1547  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1548  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1549  auto Size =
1550  llvm::alignTo(sizeof(OMPTargetTeamsDirective), alignof(OMPClause *));
1551  void *Mem =
1552  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
1554  new (Mem) OMPTargetTeamsDirective(StartLoc, EndLoc, Clauses.size());
1555  Dir->setClauses(Clauses);
1556  Dir->setAssociatedStmt(AssociatedStmt);
1557  return Dir;
1558 }
1559 
1562  EmptyShell) {
1563  auto Size =
1564  llvm::alignTo(sizeof(OMPTargetTeamsDirective), alignof(OMPClause *));
1565  void *Mem =
1566  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
1567  return new (Mem) OMPTargetTeamsDirective(NumClauses);
1568 }
1569 
1571  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1572  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1573  const HelperExprs &Exprs) {
1574  auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeDirective),
1575  alignof(OMPClause *));
1576  void *Mem = C.Allocate(
1577  Size + sizeof(OMPClause *) * Clauses.size() +
1578  sizeof(Stmt *) *
1579  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute));
1581  new (Mem) OMPTargetTeamsDistributeDirective(StartLoc, EndLoc, CollapsedNum,
1582  Clauses.size());
1583  Dir->setClauses(Clauses);
1584  Dir->setAssociatedStmt(AssociatedStmt);
1586  Dir->setLastIteration(Exprs.LastIteration);
1588  Dir->setPreCond(Exprs.PreCond);
1589  Dir->setCond(Exprs.Cond);
1590  Dir->setInit(Exprs.Init);
1591  Dir->setInc(Exprs.Inc);
1592  Dir->setIsLastIterVariable(Exprs.IL);
1593  Dir->setLowerBoundVariable(Exprs.LB);
1594  Dir->setUpperBoundVariable(Exprs.UB);
1595  Dir->setStrideVariable(Exprs.ST);
1596  Dir->setEnsureUpperBound(Exprs.EUB);
1597  Dir->setNextLowerBound(Exprs.NLB);
1598  Dir->setNextUpperBound(Exprs.NUB);
1599  Dir->setNumIterations(Exprs.NumIterations);
1600  Dir->setCounters(Exprs.Counters);
1601  Dir->setPrivateCounters(Exprs.PrivateCounters);
1602  Dir->setInits(Exprs.Inits);
1603  Dir->setUpdates(Exprs.Updates);
1604  Dir->setFinals(Exprs.Finals);
1605  Dir->setPreInits(Exprs.PreInits);
1606  return Dir;
1607 }
1608 
1611  unsigned NumClauses,
1612  unsigned CollapsedNum,
1613  EmptyShell) {
1614  auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeDirective),
1615  alignof(OMPClause *));
1616  void *Mem = C.Allocate(
1617  Size + sizeof(OMPClause *) * NumClauses +
1618  sizeof(Stmt *) *
1619  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute));
1620  return new (Mem) OMPTargetTeamsDistributeDirective(CollapsedNum, NumClauses);
1621 }
1622 
1625  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1626  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1627  const HelperExprs &Exprs, bool HasCancel) {
1628  auto Size =
1629  llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForDirective),
1630  alignof(OMPClause *));
1631  void *Mem = C.Allocate(
1632  Size + sizeof(OMPClause *) * Clauses.size() +
1633  sizeof(Stmt *) *
1634  numLoopChildren(CollapsedNum,
1635  OMPD_target_teams_distribute_parallel_for));
1638  StartLoc, EndLoc, CollapsedNum, Clauses.size());
1639  Dir->setClauses(Clauses);
1640  Dir->setAssociatedStmt(AssociatedStmt);
1642  Dir->setLastIteration(Exprs.LastIteration);
1644  Dir->setPreCond(Exprs.PreCond);
1645  Dir->setCond(Exprs.Cond);
1646  Dir->setInit(Exprs.Init);
1647  Dir->setInc(Exprs.Inc);
1648  Dir->setIsLastIterVariable(Exprs.IL);
1649  Dir->setLowerBoundVariable(Exprs.LB);
1650  Dir->setUpperBoundVariable(Exprs.UB);
1651  Dir->setStrideVariable(Exprs.ST);
1652  Dir->setEnsureUpperBound(Exprs.EUB);
1653  Dir->setNextLowerBound(Exprs.NLB);
1654  Dir->setNextUpperBound(Exprs.NUB);
1655  Dir->setNumIterations(Exprs.NumIterations);
1656  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1657  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1658  Dir->setDistInc(Exprs.DistInc);
1659  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1660  Dir->setCounters(Exprs.Counters);
1661  Dir->setPrivateCounters(Exprs.PrivateCounters);
1662  Dir->setInits(Exprs.Inits);
1663  Dir->setUpdates(Exprs.Updates);
1664  Dir->setFinals(Exprs.Finals);
1665  Dir->setPreInits(Exprs.PreInits);
1673  Dir->HasCancel = HasCancel;
1674  return Dir;
1675 }
1676 
1679  unsigned NumClauses,
1680  unsigned CollapsedNum,
1681  EmptyShell) {
1682  auto Size =
1683  llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForDirective),
1684  alignof(OMPClause *));
1685  void *Mem = C.Allocate(
1686  Size + sizeof(OMPClause *) * NumClauses +
1687  sizeof(Stmt *) *
1688  numLoopChildren(CollapsedNum,
1689  OMPD_target_teams_distribute_parallel_for));
1690  return new (Mem)
1691  OMPTargetTeamsDistributeParallelForDirective(CollapsedNum, NumClauses);
1692 }
1693 
1696  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1697  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1698  const HelperExprs &Exprs) {
1699  auto Size =
1701  alignof(OMPClause *));
1702  void *Mem = C.Allocate(
1703  Size + sizeof(OMPClause *) * Clauses.size() +
1704  sizeof(Stmt *) *
1705  numLoopChildren(CollapsedNum,
1706  OMPD_target_teams_distribute_parallel_for_simd));
1709  StartLoc, EndLoc, CollapsedNum, Clauses.size());
1710  Dir->setClauses(Clauses);
1711  Dir->setAssociatedStmt(AssociatedStmt);
1713  Dir->setLastIteration(Exprs.LastIteration);
1715  Dir->setPreCond(Exprs.PreCond);
1716  Dir->setCond(Exprs.Cond);
1717  Dir->setInit(Exprs.Init);
1718  Dir->setInc(Exprs.Inc);
1719  Dir->setIsLastIterVariable(Exprs.IL);
1720  Dir->setLowerBoundVariable(Exprs.LB);
1721  Dir->setUpperBoundVariable(Exprs.UB);
1722  Dir->setStrideVariable(Exprs.ST);
1723  Dir->setEnsureUpperBound(Exprs.EUB);
1724  Dir->setNextLowerBound(Exprs.NLB);
1725  Dir->setNextUpperBound(Exprs.NUB);
1726  Dir->setNumIterations(Exprs.NumIterations);
1727  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1728  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1729  Dir->setDistInc(Exprs.DistInc);
1730  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1731  Dir->setCounters(Exprs.Counters);
1732  Dir->setPrivateCounters(Exprs.PrivateCounters);
1733  Dir->setInits(Exprs.Inits);
1734  Dir->setUpdates(Exprs.Updates);
1735  Dir->setFinals(Exprs.Finals);
1736  Dir->setPreInits(Exprs.PreInits);
1744  return Dir;
1745 }
1746 
1749  const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1750  EmptyShell) {
1751  auto Size =
1753  alignof(OMPClause *));
1754  void *Mem = C.Allocate(
1755  Size + sizeof(OMPClause *) * NumClauses +
1756  sizeof(Stmt *) *
1757  numLoopChildren(CollapsedNum,
1758  OMPD_target_teams_distribute_parallel_for_simd));
1760  CollapsedNum, NumClauses);
1761 }
1762 
1765  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1766  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1767  const HelperExprs &Exprs) {
1768  auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeSimdDirective),
1769  alignof(OMPClause *));
1770  void *Mem = C.Allocate(
1771  Size + sizeof(OMPClause *) * Clauses.size() +
1772  sizeof(Stmt *) *
1773  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd));
1774  OMPTargetTeamsDistributeSimdDirective *Dir = new (Mem)
1775  OMPTargetTeamsDistributeSimdDirective(StartLoc, EndLoc, CollapsedNum,
1776  Clauses.size());
1777  Dir->setClauses(Clauses);
1778  Dir->setAssociatedStmt(AssociatedStmt);
1780  Dir->setLastIteration(Exprs.LastIteration);
1782  Dir->setPreCond(Exprs.PreCond);
1783  Dir->setCond(Exprs.Cond);
1784  Dir->setInit(Exprs.Init);
1785  Dir->setInc(Exprs.Inc);
1786  Dir->setIsLastIterVariable(Exprs.IL);
1787  Dir->setLowerBoundVariable(Exprs.LB);
1788  Dir->setUpperBoundVariable(Exprs.UB);
1789  Dir->setStrideVariable(Exprs.ST);
1790  Dir->setEnsureUpperBound(Exprs.EUB);
1791  Dir->setNextLowerBound(Exprs.NLB);
1792  Dir->setNextUpperBound(Exprs.NUB);
1793  Dir->setNumIterations(Exprs.NumIterations);
1794  Dir->setCounters(Exprs.Counters);
1795  Dir->setPrivateCounters(Exprs.PrivateCounters);
1796  Dir->setInits(Exprs.Inits);
1797  Dir->setUpdates(Exprs.Updates);
1798  Dir->setFinals(Exprs.Finals);
1799  Dir->setPreInits(Exprs.PreInits);
1800  return Dir;
1801 }
1802 
1805  unsigned NumClauses,
1806  unsigned CollapsedNum,
1807  EmptyShell) {
1808  auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeSimdDirective),
1809  alignof(OMPClause *));
1810  void *Mem = C.Allocate(
1811  Size + sizeof(OMPClause *) * NumClauses +
1812  sizeof(Stmt *) *
1813  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd));
1814  return new (Mem)
1815  OMPTargetTeamsDistributeSimdDirective(CollapsedNum, NumClauses);
1816 }
void setPreInits(Stmt *PreInits)
Definition: StmtOpenMP.h:469
Expr * NLB
Update of LowerBound for statically sheduled &#39;omp for&#39; loops.
Definition: StmtOpenMP.h:647
Defines the clang::ASTContext interface.
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3190
SmallVector< Expr *, 4 > Finals
Final loop counter values for GodeGen.
Definition: StmtOpenMP.h:675
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1373
Expr * NUB
Update of UpperBound for statically sheduled omp loops for outer loop in combined constructs (e...
Definition: StmtOpenMP.h:614
SmallVector< Expr *, 4 > Updates
Expressions for loop counters update for CodeGen.
Definition: StmtOpenMP.h:673
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:1713
void setEnsureUpperBound(Expr *EUB)
Definition: StmtOpenMP.h:500
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:303
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:643
void setCombinedCond(Expr *CombCond)
Definition: StmtOpenMP.h:568
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:840
void setCombinedLowerBoundVariable(Expr *CombLB)
Definition: StmtOpenMP.h:548
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:519
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:715
void setHasCancel(bool Has)
Set cancel state.
Definition: StmtOpenMP.h:1300
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:540
void setLastIteration(Expr *LI)
Definition: StmtOpenMP.h:455
static OMPTaskgroupDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef)
Creates directive.
Definition: StmtOpenMP.cpp:525
void setPrivateCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:32
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:1123
Expr * EUB
EnsureUpperBound – expression UB = min(UB, NumIterations).
Definition: StmtOpenMP.h:645
Expr * DistInc
DistInc - increment expression for distribute loop when found combined with a further loop level (e...
Definition: StmtOpenMP.h:659
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3601
static OMPSectionDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, bool HasCancel)
Creates directive.
Definition: StmtOpenMP.cpp:246
void setPrevEnsureUpperBound(Expr *PrevEUB)
Definition: StmtOpenMP.h:543
void setUpperBoundVariable(Expr *UB)
Definition: StmtOpenMP.h:486
void setNumIterations(Expr *NI)
Definition: StmtOpenMP.h:521
This represents &#39;#pragma omp target teams distribute&#39; combined directive.
Definition: StmtOpenMP.h:3738
void setNextLowerBound(Expr *NLB)
Definition: StmtOpenMP.h:507
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1494
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:3806
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:472
Expr * PrevLB
PreviousLowerBound - local variable passed to runtime in the enclosing schedule or null if that does ...
Definition: StmtOpenMP.h:652
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2405
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:72
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:467
Expr * LastIteration
Loop last iteration number.
Definition: StmtOpenMP.h:623
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:832
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.
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:690
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:251
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:149
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:953
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:796
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:763
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:608
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:3326
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:459
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:963
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:1825
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1420
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:325
void setCond(Expr *Cond)
Definition: StmtOpenMP.h:464
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:903
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3041
This represents &#39;#pragma omp teams distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3530
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:595
Expr * EUB
DistributeEnsureUpperBound - used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same construct...
Definition: StmtOpenMP.h:601
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:2660
void setCombinedInit(Expr *CombInit)
Definition: StmtOpenMP.h:563
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:2603
static OMPFlushDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:595
Expr * CalcLastIteration
Calculation of last iteration.
Definition: StmtOpenMP.h:627
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:3460
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:491
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:384
Expr * NUB
Update of UpperBound for statically sheduled &#39;omp for&#39; loops.
Definition: StmtOpenMP.h:649
Expr * Cond
Loop condition.
Definition: StmtOpenMP.h:631
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:724
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:787
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:700
Expr * PreCond
Loop pre-condition.
Definition: StmtOpenMP.h:629
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:3258
The expressions built for the OpenMP loop CodeGen for the whole collapsed loop nest.
Definition: StmtOpenMP.h:619
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:1913
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:282
static OMPCriticalDirective * Create(const ASTContext &C, const DeclarationNameInfo &Name, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:310
Expr * IterationVarRef
Loop iteration variable.
Definition: StmtOpenMP.h:621
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:605
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:856
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:2914
void setInits(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:39
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:111
Expr - This represents one expression.
Definition: Expr.h:106
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.
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:292
This represents &#39;#pragma omp target teams distribute parallel for simd&#39; combined directive.
Definition: StmtOpenMP.h:3890
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:674
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:3963
unsigned getNumClauses() const
Get number of clauses.
Definition: StmtOpenMP.h:184
Expr * PrevUB
PreviousUpperBound - local variable passed to runtime in the enclosing schedule or null if that does ...
Definition: StmtOpenMP.h:655
static OMPOrderedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:617
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1046
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:810
This represents &#39;#pragma omp target teams&#39; directive.
Definition: StmtOpenMP.h:3679
void setAssociatedStmt(Stmt *S)
Set the associated statement for the directive.
Definition: StmtOpenMP.h:85
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:422
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:2718
void setDistInc(Expr *DistInc)
Definition: StmtOpenMP.h:538
Expr * NLB
Update of LowerBound for statically sheduled omp loops for outer loop in combined constructs (e...
Definition: StmtOpenMP.h:611
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:20
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:1986
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1574
Expr * NumIterations
Loop number of iterations.
Definition: StmtOpenMP.h:625
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:123
Expr * ST
Stride - local variable passed to runtime.
Definition: StmtOpenMP.h:643
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:374
This represents &#39;#pragma omp target enter data&#39; directive.
Definition: StmtOpenMP.h:2346
void setUpdates(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:45
SmallVector< Expr *, 4 > PrivateCounters
PrivateCounters Loop counters.
Definition: StmtOpenMP.h:669
void setLowerBoundVariable(Expr *LB)
Definition: StmtOpenMP.h:479
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:259
SmallVector< Expr *, 4 > Counters
Counters Loop counters.
Definition: StmtOpenMP.h:667
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1318
Encodes a location in the source.
void setPrevLowerBoundVariable(Expr *PrevLB)
Definition: StmtOpenMP.h:528
void setIterationVariable(Expr *IV)
Definition: StmtOpenMP.h:452
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:473
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:573
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:335
OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:23
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:57
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:818
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:664
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:1869
Expr * PrevEUB
PrevEUB - expression similar to EUB but to be used when loop scheduling uses PrevLB and PrevUB (e...
Definition: StmtOpenMP.h:665
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:51
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:633
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2230
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:680
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:172
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2041
Expr * LB
LowerBound - local variable passed to runtime.
Definition: StmtOpenMP.h:639
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:2982
Expr * Init
Loop iteration variable init.
Definition: StmtOpenMP.h:633
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:266
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
Definition: Stmt.h:325
void * Allocate(size_t Size, unsigned Align=8) const
Definition: ASTContext.h:650
void setPrevUpperBoundVariable(Expr *PrevUB)
Definition: StmtOpenMP.h:533
void setCombinedEnsureUpperBound(Expr *CombEUB)
Definition: StmtOpenMP.h:558
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:160
void setCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:26
Dataflow Directional Tag Classes.
SmallVector< Expr *, 4 > Inits
Expressions for loop counters inits for CodeGen.
Definition: StmtOpenMP.h:671
void setCombinedUpperBoundVariable(Expr *CombUB)
Definition: StmtOpenMP.h:553
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:1256
This represents &#39;#pragma omp teams distribute&#39; directive.
Definition: StmtOpenMP.h:3392
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:433
This represents &#39;#pragma omp simd&#39; directive.
Definition: StmtOpenMP.h:981
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
This represents &#39;#pragma omp atomic&#39; directive.
Definition: StmtOpenMP.h:2096
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:209
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:505
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:221
Expr * Inc
Loop increment.
Definition: StmtOpenMP.h:635
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:866
Expr * UB
DistributeUpperBound - used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same construct...
Definition: StmtOpenMP.h:598
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
Definition: SemaDecl.cpp:13010
static OMPTaskyieldDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:482
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:774
Expr * UB
UpperBound - local variable passed to runtime.
Definition: StmtOpenMP.h:641
This represents &#39;#pragma omp target parallel&#39; directive.
Definition: StmtOpenMP.h:2463
void setStrideVariable(Expr *ST)
Definition: StmtOpenMP.h:493
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:449
static OMPBarrierDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:497
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:83
This represents &#39;#pragma omp taskloop simd&#39; directive.
Definition: StmtOpenMP.h:2848
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:236
void setPreCond(Expr *PC)
Definition: StmtOpenMP.h:461
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:585
static OMPTaskwaitDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:511
This represents &#39;#pragma omp sections&#39; directive.
Definition: StmtOpenMP.h:1188
Expr * Cond
Distribute Loop condition used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same construct...
Definition: StmtOpenMP.h:608
Stmt * PreInits
Init statement for all captured expressions.
Definition: StmtOpenMP.h:677
This represents &#39;#pragma omp target data&#39; directive.
Definition: StmtOpenMP.h:2288
void setNextUpperBound(Expr *NUB)
Definition: StmtOpenMP.h:514
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:468
static OMPCancelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, OpenMPDirectiveKind CancelRegion)
Creates directive.
Definition: StmtOpenMP.cpp:571
Expr * IL
IsLastIteration - local flag variable passed to runtime.
Definition: StmtOpenMP.h:637
This represents &#39;#pragma omp taskyield&#39; directive.
Definition: StmtOpenMP.h:1781
This represents &#39;#pragma omp distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3121
static OMPCancellationPointDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Creates directive.
Definition: StmtOpenMP.cpp:550
This represents &#39;#pragma omp parallel sections&#39; directive.
Definition: StmtOpenMP.h:1642
void setCalcLastIteration(Expr *CLI)
Definition: StmtOpenMP.h:458
void setCombinedNextUpperBound(Expr *CombNUB)
Definition: StmtOpenMP.h:578
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:915
void setFinals(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:51
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:2523
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:563
This represents &#39;#pragma omp taskloop&#39; directive.
Definition: StmtOpenMP.h:2783