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