clang  6.0.0svn
StmtOpenMP.cpp
Go to the documentation of this file.
1 //===--- StmtOpenMP.cpp - Classes for OpenMP directives -------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements the subclesses of Stmt class declared in StmtOpenMP.h
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "clang/AST/StmtOpenMP.h"
15 
16 #include "clang/AST/ASTContext.h"
17 
18 using namespace clang;
19 
21  assert(Clauses.size() == getNumClauses() &&
22  "Number of clauses is not the same as the preallocated buffer");
23  std::copy(Clauses.begin(), Clauses.end(), getClauses().begin());
24 }
25 
27  assert(A.size() == getCollapsedNumber() &&
28  "Number of loop counters is not the same as the collapsed number");
29  std::copy(A.begin(), A.end(), getCounters().begin());
30 }
31 
33  assert(A.size() == getCollapsedNumber() && "Number of loop private counters "
34  "is not the same as the collapsed "
35  "number");
36  std::copy(A.begin(), A.end(), getPrivateCounters().begin());
37 }
38 
40  assert(A.size() == getCollapsedNumber() &&
41  "Number of counter inits is not the same as the collapsed number");
42  std::copy(A.begin(), A.end(), getInits().begin());
43 }
44 
46  assert(A.size() == getCollapsedNumber() &&
47  "Number of counter updates is not the same as the collapsed number");
48  std::copy(A.begin(), A.end(), getUpdates().begin());
49 }
50 
52  assert(A.size() == getCollapsedNumber() &&
53  "Number of counter finals is not the same as the collapsed number");
54  std::copy(A.begin(), A.end(), getFinals().begin());
55 }
56 
58  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
59  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
60  unsigned Size =
61  llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *));
62  void *Mem =
63  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
65  new (Mem) OMPParallelDirective(StartLoc, EndLoc, Clauses.size());
66  Dir->setClauses(Clauses);
67  Dir->setAssociatedStmt(AssociatedStmt);
68  Dir->setHasCancel(HasCancel);
69  return Dir;
70 }
71 
73  unsigned NumClauses,
74  EmptyShell) {
75  unsigned Size =
76  llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *));
77  void *Mem =
78  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
79  return new (Mem) OMPParallelDirective(NumClauses);
80 }
81 
84  SourceLocation EndLoc, unsigned CollapsedNum,
85  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
86  const HelperExprs &Exprs) {
87  unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *));
88  void *Mem =
89  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
90  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
91  OMPSimdDirective *Dir = new (Mem)
92  OMPSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
93  Dir->setClauses(Clauses);
94  Dir->setAssociatedStmt(AssociatedStmt);
96  Dir->setLastIteration(Exprs.LastIteration);
98  Dir->setPreCond(Exprs.PreCond);
99  Dir->setCond(Exprs.Cond);
100  Dir->setInit(Exprs.Init);
101  Dir->setInc(Exprs.Inc);
102  Dir->setCounters(Exprs.Counters);
104  Dir->setInits(Exprs.Inits);
105  Dir->setUpdates(Exprs.Updates);
106  Dir->setFinals(Exprs.Finals);
107  Dir->setPreInits(Exprs.PreInits);
108  return Dir;
109 }
110 
112  unsigned NumClauses,
113  unsigned CollapsedNum,
114  EmptyShell) {
115  unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *));
116  void *Mem =
117  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
118  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
119  return new (Mem) OMPSimdDirective(CollapsedNum, NumClauses);
120 }
121 
124  SourceLocation EndLoc, unsigned CollapsedNum,
125  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
126  const HelperExprs &Exprs, bool HasCancel) {
127  unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *));
128  void *Mem =
129  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
130  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
131  OMPForDirective *Dir =
132  new (Mem) OMPForDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
133  Dir->setClauses(Clauses);
134  Dir->setAssociatedStmt(AssociatedStmt);
136  Dir->setLastIteration(Exprs.LastIteration);
138  Dir->setPreCond(Exprs.PreCond);
139  Dir->setCond(Exprs.Cond);
140  Dir->setInit(Exprs.Init);
141  Dir->setInc(Exprs.Inc);
142  Dir->setIsLastIterVariable(Exprs.IL);
143  Dir->setLowerBoundVariable(Exprs.LB);
144  Dir->setUpperBoundVariable(Exprs.UB);
145  Dir->setStrideVariable(Exprs.ST);
146  Dir->setEnsureUpperBound(Exprs.EUB);
147  Dir->setNextLowerBound(Exprs.NLB);
148  Dir->setNextUpperBound(Exprs.NUB);
149  Dir->setNumIterations(Exprs.NumIterations);
150  Dir->setCounters(Exprs.Counters);
152  Dir->setInits(Exprs.Inits);
153  Dir->setUpdates(Exprs.Updates);
154  Dir->setFinals(Exprs.Finals);
155  Dir->setPreInits(Exprs.PreInits);
156  Dir->setHasCancel(HasCancel);
157  return Dir;
158 }
159 
161  unsigned NumClauses,
162  unsigned CollapsedNum,
163  EmptyShell) {
164  unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *));
165  void *Mem =
166  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
167  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
168  return new (Mem) OMPForDirective(CollapsedNum, NumClauses);
169 }
170 
173  SourceLocation EndLoc, unsigned CollapsedNum,
174  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
175  const HelperExprs &Exprs) {
176  unsigned Size =
177  llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *));
178  void *Mem =
179  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
180  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
181  OMPForSimdDirective *Dir = new (Mem)
182  OMPForSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
183  Dir->setClauses(Clauses);
184  Dir->setAssociatedStmt(AssociatedStmt);
186  Dir->setLastIteration(Exprs.LastIteration);
188  Dir->setPreCond(Exprs.PreCond);
189  Dir->setCond(Exprs.Cond);
190  Dir->setInit(Exprs.Init);
191  Dir->setInc(Exprs.Inc);
192  Dir->setIsLastIterVariable(Exprs.IL);
193  Dir->setLowerBoundVariable(Exprs.LB);
194  Dir->setUpperBoundVariable(Exprs.UB);
195  Dir->setStrideVariable(Exprs.ST);
196  Dir->setEnsureUpperBound(Exprs.EUB);
197  Dir->setNextLowerBound(Exprs.NLB);
198  Dir->setNextUpperBound(Exprs.NUB);
199  Dir->setNumIterations(Exprs.NumIterations);
200  Dir->setCounters(Exprs.Counters);
202  Dir->setInits(Exprs.Inits);
203  Dir->setUpdates(Exprs.Updates);
204  Dir->setFinals(Exprs.Finals);
205  Dir->setPreInits(Exprs.PreInits);
206  return Dir;
207 }
208 
210  unsigned NumClauses,
211  unsigned CollapsedNum,
212  EmptyShell) {
213  unsigned Size =
214  llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *));
215  void *Mem =
216  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
217  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
218  return new (Mem) OMPForSimdDirective(CollapsedNum, NumClauses);
219 }
220 
222  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
223  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
224  unsigned Size =
225  llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *));
226  void *Mem =
227  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
228  OMPSectionsDirective *Dir =
229  new (Mem) OMPSectionsDirective(StartLoc, EndLoc, Clauses.size());
230  Dir->setClauses(Clauses);
231  Dir->setAssociatedStmt(AssociatedStmt);
232  Dir->setHasCancel(HasCancel);
233  return Dir;
234 }
235 
237  unsigned NumClauses,
238  EmptyShell) {
239  unsigned Size =
240  llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *));
241  void *Mem =
242  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
243  return new (Mem) OMPSectionsDirective(NumClauses);
244 }
245 
247  SourceLocation StartLoc,
248  SourceLocation EndLoc,
249  Stmt *AssociatedStmt,
250  bool HasCancel) {
251  unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *));
252  void *Mem = C.Allocate(Size + sizeof(Stmt *));
253  OMPSectionDirective *Dir = new (Mem) OMPSectionDirective(StartLoc, EndLoc);
254  Dir->setAssociatedStmt(AssociatedStmt);
255  Dir->setHasCancel(HasCancel);
256  return Dir;
257 }
258 
260  EmptyShell) {
261  unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *));
262  void *Mem = C.Allocate(Size + sizeof(Stmt *));
263  return new (Mem) OMPSectionDirective();
264 }
265 
267  SourceLocation StartLoc,
268  SourceLocation EndLoc,
269  ArrayRef<OMPClause *> Clauses,
270  Stmt *AssociatedStmt) {
271  unsigned Size =
272  llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *));
273  void *Mem =
274  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
275  OMPSingleDirective *Dir =
276  new (Mem) OMPSingleDirective(StartLoc, EndLoc, Clauses.size());
277  Dir->setClauses(Clauses);
278  Dir->setAssociatedStmt(AssociatedStmt);
279  return Dir;
280 }
281 
283  unsigned NumClauses,
284  EmptyShell) {
285  unsigned Size =
286  llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *));
287  void *Mem =
288  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
289  return new (Mem) OMPSingleDirective(NumClauses);
290 }
291 
293  SourceLocation StartLoc,
294  SourceLocation EndLoc,
295  Stmt *AssociatedStmt) {
296  unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *));
297  void *Mem = C.Allocate(Size + sizeof(Stmt *));
298  OMPMasterDirective *Dir = new (Mem) OMPMasterDirective(StartLoc, EndLoc);
299  Dir->setAssociatedStmt(AssociatedStmt);
300  return Dir;
301 }
302 
304  EmptyShell) {
305  unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *));
306  void *Mem = C.Allocate(Size + sizeof(Stmt *));
307  return new (Mem) OMPMasterDirective();
308 }
309 
311  const ASTContext &C, const DeclarationNameInfo &Name,
312  SourceLocation StartLoc, SourceLocation EndLoc,
313  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
314  unsigned Size =
315  llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *));
316  void *Mem =
317  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
318  OMPCriticalDirective *Dir =
319  new (Mem) OMPCriticalDirective(Name, StartLoc, EndLoc, Clauses.size());
320  Dir->setClauses(Clauses);
321  Dir->setAssociatedStmt(AssociatedStmt);
322  return Dir;
323 }
324 
326  unsigned NumClauses,
327  EmptyShell) {
328  unsigned Size =
329  llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *));
330  void *Mem =
331  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
332  return new (Mem) OMPCriticalDirective(NumClauses);
333 }
334 
336  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
337  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
338  const HelperExprs &Exprs, bool HasCancel) {
339  unsigned Size =
340  llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *));
341  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
342  sizeof(Stmt *) *
343  numLoopChildren(CollapsedNum, OMPD_parallel_for));
344  OMPParallelForDirective *Dir = new (Mem)
345  OMPParallelForDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
346  Dir->setClauses(Clauses);
347  Dir->setAssociatedStmt(AssociatedStmt);
349  Dir->setLastIteration(Exprs.LastIteration);
351  Dir->setPreCond(Exprs.PreCond);
352  Dir->setCond(Exprs.Cond);
353  Dir->setInit(Exprs.Init);
354  Dir->setInc(Exprs.Inc);
355  Dir->setIsLastIterVariable(Exprs.IL);
356  Dir->setLowerBoundVariable(Exprs.LB);
357  Dir->setUpperBoundVariable(Exprs.UB);
358  Dir->setStrideVariable(Exprs.ST);
359  Dir->setEnsureUpperBound(Exprs.EUB);
360  Dir->setNextLowerBound(Exprs.NLB);
361  Dir->setNextUpperBound(Exprs.NUB);
362  Dir->setNumIterations(Exprs.NumIterations);
363  Dir->setCounters(Exprs.Counters);
365  Dir->setInits(Exprs.Inits);
366  Dir->setUpdates(Exprs.Updates);
367  Dir->setFinals(Exprs.Finals);
368  Dir->setPreInits(Exprs.PreInits);
369  Dir->setHasCancel(HasCancel);
370  return Dir;
371 }
372 
375  unsigned CollapsedNum, EmptyShell) {
376  unsigned Size =
377  llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *));
378  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
379  sizeof(Stmt *) *
380  numLoopChildren(CollapsedNum, OMPD_parallel_for));
381  return new (Mem) OMPParallelForDirective(CollapsedNum, NumClauses);
382 }
383 
385  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
386  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
387  const HelperExprs &Exprs) {
388  unsigned Size =
389  llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *));
390  void *Mem = C.Allocate(
391  Size + sizeof(OMPClause *) * Clauses.size() +
392  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
394  StartLoc, EndLoc, CollapsedNum, Clauses.size());
395  Dir->setClauses(Clauses);
396  Dir->setAssociatedStmt(AssociatedStmt);
398  Dir->setLastIteration(Exprs.LastIteration);
400  Dir->setPreCond(Exprs.PreCond);
401  Dir->setCond(Exprs.Cond);
402  Dir->setInit(Exprs.Init);
403  Dir->setInc(Exprs.Inc);
404  Dir->setIsLastIterVariable(Exprs.IL);
405  Dir->setLowerBoundVariable(Exprs.LB);
406  Dir->setUpperBoundVariable(Exprs.UB);
407  Dir->setStrideVariable(Exprs.ST);
408  Dir->setEnsureUpperBound(Exprs.EUB);
409  Dir->setNextLowerBound(Exprs.NLB);
410  Dir->setNextUpperBound(Exprs.NUB);
411  Dir->setNumIterations(Exprs.NumIterations);
412  Dir->setCounters(Exprs.Counters);
414  Dir->setInits(Exprs.Inits);
415  Dir->setUpdates(Exprs.Updates);
416  Dir->setFinals(Exprs.Finals);
417  Dir->setPreInits(Exprs.PreInits);
418  return Dir;
419 }
420 
423  unsigned NumClauses,
424  unsigned CollapsedNum, EmptyShell) {
425  unsigned Size =
426  llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *));
427  void *Mem = C.Allocate(
428  Size + sizeof(OMPClause *) * NumClauses +
429  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
430  return new (Mem) OMPParallelForSimdDirective(CollapsedNum, NumClauses);
431 }
432 
434  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
435  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
436  unsigned Size =
437  llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *));
438  void *Mem =
439  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
441  new (Mem) OMPParallelSectionsDirective(StartLoc, EndLoc, Clauses.size());
442  Dir->setClauses(Clauses);
443  Dir->setAssociatedStmt(AssociatedStmt);
444  Dir->setHasCancel(HasCancel);
445  return Dir;
446 }
447 
450  unsigned NumClauses, EmptyShell) {
451  unsigned Size =
452  llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *));
453  void *Mem =
454  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
455  return new (Mem) OMPParallelSectionsDirective(NumClauses);
456 }
457 
460  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
461  Stmt *AssociatedStmt, bool HasCancel) {
462  unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *));
463  void *Mem =
464  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
465  OMPTaskDirective *Dir =
466  new (Mem) OMPTaskDirective(StartLoc, EndLoc, Clauses.size());
467  Dir->setClauses(Clauses);
468  Dir->setAssociatedStmt(AssociatedStmt);
469  Dir->setHasCancel(HasCancel);
470  return Dir;
471 }
472 
474  unsigned NumClauses,
475  EmptyShell) {
476  unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *));
477  void *Mem =
478  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
479  return new (Mem) OMPTaskDirective(NumClauses);
480 }
481 
483  SourceLocation StartLoc,
484  SourceLocation EndLoc) {
485  void *Mem = C.Allocate(sizeof(OMPTaskyieldDirective));
486  OMPTaskyieldDirective *Dir =
487  new (Mem) OMPTaskyieldDirective(StartLoc, EndLoc);
488  return Dir;
489 }
490 
492  EmptyShell) {
493  void *Mem = C.Allocate(sizeof(OMPTaskyieldDirective));
494  return new (Mem) OMPTaskyieldDirective();
495 }
496 
498  SourceLocation StartLoc,
499  SourceLocation EndLoc) {
500  void *Mem = C.Allocate(sizeof(OMPBarrierDirective));
501  OMPBarrierDirective *Dir = new (Mem) OMPBarrierDirective(StartLoc, EndLoc);
502  return Dir;
503 }
504 
506  EmptyShell) {
507  void *Mem = C.Allocate(sizeof(OMPBarrierDirective));
508  return new (Mem) OMPBarrierDirective();
509 }
510 
512  SourceLocation StartLoc,
513  SourceLocation EndLoc) {
514  void *Mem = C.Allocate(sizeof(OMPTaskwaitDirective));
515  OMPTaskwaitDirective *Dir = new (Mem) OMPTaskwaitDirective(StartLoc, EndLoc);
516  return Dir;
517 }
518 
520  EmptyShell) {
521  void *Mem = C.Allocate(sizeof(OMPTaskwaitDirective));
522  return new (Mem) OMPTaskwaitDirective();
523 }
524 
526  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
527  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) {
528  unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective) +
529  sizeof(OMPClause *) * Clauses.size(),
530  alignof(Stmt *));
531  void *Mem = C.Allocate(Size + sizeof(Stmt *) + sizeof(Expr *));
532  OMPTaskgroupDirective *Dir =
533  new (Mem) OMPTaskgroupDirective(StartLoc, EndLoc, Clauses.size());
534  Dir->setAssociatedStmt(AssociatedStmt);
535  Dir->setReductionRef(ReductionRef);
536  Dir->setClauses(Clauses);
537  return Dir;
538 }
539 
541  unsigned NumClauses,
542  EmptyShell) {
543  unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective) +
544  sizeof(OMPClause *) * NumClauses,
545  alignof(Stmt *));
546  void *Mem = C.Allocate(Size + sizeof(Stmt *) + sizeof(Expr *));
547  return new (Mem) OMPTaskgroupDirective(NumClauses);
548 }
549 
551  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
552  OpenMPDirectiveKind CancelRegion) {
553  unsigned Size =
554  llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *));
555  void *Mem = C.Allocate(Size);
557  new (Mem) OMPCancellationPointDirective(StartLoc, EndLoc);
558  Dir->setCancelRegion(CancelRegion);
559  return Dir;
560 }
561 
564  unsigned Size =
565  llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *));
566  void *Mem = C.Allocate(Size);
567  return new (Mem) OMPCancellationPointDirective();
568 }
569 
572  SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
573  OpenMPDirectiveKind CancelRegion) {
574  unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
575  sizeof(OMPClause *) * Clauses.size(),
576  alignof(Stmt *));
577  void *Mem = C.Allocate(Size);
578  OMPCancelDirective *Dir =
579  new (Mem) OMPCancelDirective(StartLoc, EndLoc, Clauses.size());
580  Dir->setClauses(Clauses);
581  Dir->setCancelRegion(CancelRegion);
582  return Dir;
583 }
584 
586  unsigned NumClauses,
587  EmptyShell) {
588  unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
589  sizeof(OMPClause *) * NumClauses,
590  alignof(Stmt *));
591  void *Mem = C.Allocate(Size);
592  return new (Mem) OMPCancelDirective(NumClauses);
593 }
594 
596  SourceLocation StartLoc,
597  SourceLocation EndLoc,
598  ArrayRef<OMPClause *> Clauses) {
599  unsigned Size =
600  llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *));
601  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size());
602  OMPFlushDirective *Dir =
603  new (Mem) OMPFlushDirective(StartLoc, EndLoc, Clauses.size());
604  Dir->setClauses(Clauses);
605  return Dir;
606 }
607 
609  unsigned NumClauses,
610  EmptyShell) {
611  unsigned Size =
612  llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *));
613  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses);
614  return new (Mem) OMPFlushDirective(NumClauses);
615 }
616 
618  SourceLocation StartLoc,
619  SourceLocation EndLoc,
620  ArrayRef<OMPClause *> Clauses,
621  Stmt *AssociatedStmt) {
622  unsigned Size =
623  llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *));
624  void *Mem =
625  C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * Clauses.size());
626  OMPOrderedDirective *Dir =
627  new (Mem) OMPOrderedDirective(StartLoc, EndLoc, Clauses.size());
628  Dir->setClauses(Clauses);
629  Dir->setAssociatedStmt(AssociatedStmt);
630  return Dir;
631 }
632 
634  unsigned NumClauses,
635  EmptyShell) {
636  unsigned Size =
637  llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *));
638  void *Mem =
639  C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * NumClauses);
640  return new (Mem) OMPOrderedDirective(NumClauses);
641 }
642 
644  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
645  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V,
646  Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate) {
647  unsigned Size =
648  llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *));
649  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
650  5 * sizeof(Stmt *));
651  OMPAtomicDirective *Dir =
652  new (Mem) OMPAtomicDirective(StartLoc, EndLoc, Clauses.size());
653  Dir->setClauses(Clauses);
654  Dir->setAssociatedStmt(AssociatedStmt);
655  Dir->setX(X);
656  Dir->setV(V);
657  Dir->setExpr(E);
658  Dir->setUpdateExpr(UE);
659  Dir->IsXLHSInRHSPart = IsXLHSInRHSPart;
660  Dir->IsPostfixUpdate = IsPostfixUpdate;
661  return Dir;
662 }
663 
665  unsigned NumClauses,
666  EmptyShell) {
667  unsigned Size =
668  llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *));
669  void *Mem =
670  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 5 * sizeof(Stmt *));
671  return new (Mem) OMPAtomicDirective(NumClauses);
672 }
673 
675  SourceLocation StartLoc,
676  SourceLocation EndLoc,
677  ArrayRef<OMPClause *> Clauses,
678  Stmt *AssociatedStmt) {
679  unsigned Size =
680  llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *));
681  void *Mem =
682  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
683  OMPTargetDirective *Dir =
684  new (Mem) OMPTargetDirective(StartLoc, EndLoc, Clauses.size());
685  Dir->setClauses(Clauses);
686  Dir->setAssociatedStmt(AssociatedStmt);
687  return Dir;
688 }
689 
691  unsigned NumClauses,
692  EmptyShell) {
693  unsigned Size =
694  llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *));
695  void *Mem =
696  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
697  return new (Mem) OMPTargetDirective(NumClauses);
698 }
699 
701  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
702  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
703  unsigned Size =
704  llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *));
705  void *Mem =
706  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
708  new (Mem) OMPTargetParallelDirective(StartLoc, EndLoc, Clauses.size());
709  Dir->setClauses(Clauses);
710  Dir->setAssociatedStmt(AssociatedStmt);
711  return Dir;
712 }
713 
716  unsigned NumClauses, EmptyShell) {
717  unsigned Size =
718  llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *));
719  void *Mem =
720  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
721  return new (Mem) OMPTargetParallelDirective(NumClauses);
722 }
723 
725  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
726  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
727  const HelperExprs &Exprs, bool HasCancel) {
728  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
729  alignof(OMPClause *));
730  void *Mem = C.Allocate(
731  Size + sizeof(OMPClause *) * Clauses.size() +
732  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
734  StartLoc, EndLoc, CollapsedNum, Clauses.size());
735  Dir->setClauses(Clauses);
736  Dir->setAssociatedStmt(AssociatedStmt);
738  Dir->setLastIteration(Exprs.LastIteration);
740  Dir->setPreCond(Exprs.PreCond);
741  Dir->setCond(Exprs.Cond);
742  Dir->setInit(Exprs.Init);
743  Dir->setInc(Exprs.Inc);
744  Dir->setIsLastIterVariable(Exprs.IL);
745  Dir->setLowerBoundVariable(Exprs.LB);
746  Dir->setUpperBoundVariable(Exprs.UB);
747  Dir->setStrideVariable(Exprs.ST);
748  Dir->setEnsureUpperBound(Exprs.EUB);
749  Dir->setNextLowerBound(Exprs.NLB);
750  Dir->setNextUpperBound(Exprs.NUB);
751  Dir->setNumIterations(Exprs.NumIterations);
752  Dir->setCounters(Exprs.Counters);
754  Dir->setInits(Exprs.Inits);
755  Dir->setUpdates(Exprs.Updates);
756  Dir->setFinals(Exprs.Finals);
757  Dir->setPreInits(Exprs.PreInits);
758  Dir->setHasCancel(HasCancel);
759  return Dir;
760 }
761 
764  unsigned NumClauses,
765  unsigned CollapsedNum, EmptyShell) {
766  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
767  alignof(OMPClause *));
768  void *Mem = C.Allocate(
769  Size + sizeof(OMPClause *) * NumClauses +
770  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
771  return new (Mem) OMPTargetParallelForDirective(CollapsedNum, NumClauses);
772 }
773 
775  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
776  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
777  void *Mem = C.Allocate(
778  llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) +
779  sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
781  new (Mem) OMPTargetDataDirective(StartLoc, EndLoc, Clauses.size());
782  Dir->setClauses(Clauses);
783  Dir->setAssociatedStmt(AssociatedStmt);
784  return Dir;
785 }
786 
788  unsigned N,
789  EmptyShell) {
790  void *Mem = C.Allocate(
791  llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) +
792  sizeof(OMPClause *) * N + sizeof(Stmt *));
793  return new (Mem) OMPTargetDataDirective(N);
794 }
795 
797  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
798  ArrayRef<OMPClause *> Clauses) {
799  void *Mem = C.Allocate(
800  llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) +
801  sizeof(OMPClause *) * Clauses.size());
803  new (Mem) OMPTargetEnterDataDirective(StartLoc, EndLoc, Clauses.size());
804  Dir->setClauses(Clauses);
805  return Dir;
806 }
807 
810  EmptyShell) {
811  void *Mem = C.Allocate(
812  llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) +
813  sizeof(OMPClause *) * N);
814  return new (Mem) OMPTargetEnterDataDirective(N);
815 }
816 
819  SourceLocation EndLoc,
820  ArrayRef<OMPClause *> Clauses) {
821  void *Mem = C.Allocate(
822  llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) +
823  sizeof(OMPClause *) * Clauses.size());
825  new (Mem) OMPTargetExitDataDirective(StartLoc, EndLoc, Clauses.size());
826  Dir->setClauses(Clauses);
827  return Dir;
828 }
829 
832  EmptyShell) {
833  void *Mem = C.Allocate(
834  llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) +
835  sizeof(OMPClause *) * N);
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 
1012  SourceLocation EndLoc,
1013  ArrayRef<OMPClause *> Clauses) {
1014  unsigned Size =
1015  llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *));
1016  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size());
1018  new (Mem) OMPTargetUpdateDirective(StartLoc, EndLoc, Clauses.size());
1019  Dir->setClauses(Clauses);
1020  return Dir;
1021 }
1022 
1025  EmptyShell) {
1026  unsigned Size =
1027  llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *));
1028  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses);
1029  return new (Mem) OMPTargetUpdateDirective(NumClauses);
1030 }
1031 
1033  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1034  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1035  const HelperExprs &Exprs) {
1036  unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
1037  alignof(OMPClause *));
1038  void *Mem = C.Allocate(
1039  Size + sizeof(OMPClause *) * Clauses.size() +
1040  sizeof(Stmt *) *
1041  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for));
1043  new (Mem) OMPDistributeParallelForDirective(StartLoc, EndLoc,
1044  CollapsedNum, Clauses.size());
1045  Dir->setClauses(Clauses);
1046  Dir->setAssociatedStmt(AssociatedStmt);
1048  Dir->setLastIteration(Exprs.LastIteration);
1050  Dir->setPreCond(Exprs.PreCond);
1051  Dir->setCond(Exprs.Cond);
1052  Dir->setInit(Exprs.Init);
1053  Dir->setInc(Exprs.Inc);
1054  Dir->setIsLastIterVariable(Exprs.IL);
1055  Dir->setLowerBoundVariable(Exprs.LB);
1056  Dir->setUpperBoundVariable(Exprs.UB);
1057  Dir->setStrideVariable(Exprs.ST);
1058  Dir->setEnsureUpperBound(Exprs.EUB);
1059  Dir->setNextLowerBound(Exprs.NLB);
1060  Dir->setNextUpperBound(Exprs.NUB);
1061  Dir->setNumIterations(Exprs.NumIterations);
1062  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1063  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1064  Dir->setDistInc(Exprs.DistInc);
1065  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1066  Dir->setCounters(Exprs.Counters);
1067  Dir->setPrivateCounters(Exprs.PrivateCounters);
1068  Dir->setInits(Exprs.Inits);
1069  Dir->setUpdates(Exprs.Updates);
1070  Dir->setFinals(Exprs.Finals);
1071  Dir->setPreInits(Exprs.PreInits);
1079  return Dir;
1080 }
1081 
1084  unsigned NumClauses,
1085  unsigned CollapsedNum,
1086  EmptyShell) {
1087  unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
1088  alignof(OMPClause *));
1089  void *Mem = C.Allocate(
1090  Size + sizeof(OMPClause *) * NumClauses +
1091  sizeof(Stmt *) *
1092  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for));
1093  return new (Mem) OMPDistributeParallelForDirective(CollapsedNum, NumClauses);
1094 }
1095 
1098  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1099  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1100  const HelperExprs &Exprs) {
1101  unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
1102  alignof(OMPClause *));
1103  void *Mem = C.Allocate(
1104  Size + sizeof(OMPClause *) * Clauses.size() +
1105  sizeof(Stmt *) *
1106  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd));
1107  OMPDistributeParallelForSimdDirective *Dir = new (Mem)
1108  OMPDistributeParallelForSimdDirective(StartLoc, EndLoc, CollapsedNum,
1109  Clauses.size());
1110  Dir->setClauses(Clauses);
1111  Dir->setAssociatedStmt(AssociatedStmt);
1113  Dir->setLastIteration(Exprs.LastIteration);
1115  Dir->setPreCond(Exprs.PreCond);
1116  Dir->setCond(Exprs.Cond);
1117  Dir->setInit(Exprs.Init);
1118  Dir->setInc(Exprs.Inc);
1119  Dir->setIsLastIterVariable(Exprs.IL);
1120  Dir->setLowerBoundVariable(Exprs.LB);
1121  Dir->setUpperBoundVariable(Exprs.UB);
1122  Dir->setStrideVariable(Exprs.ST);
1123  Dir->setEnsureUpperBound(Exprs.EUB);
1124  Dir->setNextLowerBound(Exprs.NLB);
1125  Dir->setNextUpperBound(Exprs.NUB);
1126  Dir->setNumIterations(Exprs.NumIterations);
1127  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1128  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1129  Dir->setDistInc(Exprs.DistInc);
1130  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1131  Dir->setCounters(Exprs.Counters);
1132  Dir->setPrivateCounters(Exprs.PrivateCounters);
1133  Dir->setInits(Exprs.Inits);
1134  Dir->setUpdates(Exprs.Updates);
1135  Dir->setFinals(Exprs.Finals);
1136  Dir->setPreInits(Exprs.PreInits);
1144  return Dir;
1145 }
1146 
1149  unsigned NumClauses,
1150  unsigned CollapsedNum,
1151  EmptyShell) {
1152  unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
1153  alignof(OMPClause *));
1154  void *Mem = C.Allocate(
1155  Size + sizeof(OMPClause *) * NumClauses +
1156  sizeof(Stmt *) *
1157  numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd));
1158  return new (Mem)
1159  OMPDistributeParallelForSimdDirective(CollapsedNum, NumClauses);
1160 }
1161 
1163  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1164  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1165  const HelperExprs &Exprs) {
1166  unsigned Size =
1167  llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *));
1168  void *Mem = C.Allocate(
1169  Size + sizeof(OMPClause *) * Clauses.size() +
1170  sizeof(Stmt *) *
1171  numLoopChildren(CollapsedNum, OMPD_distribute_simd));
1173  StartLoc, EndLoc, CollapsedNum, Clauses.size());
1174  Dir->setClauses(Clauses);
1175  Dir->setAssociatedStmt(AssociatedStmt);
1177  Dir->setLastIteration(Exprs.LastIteration);
1179  Dir->setPreCond(Exprs.PreCond);
1180  Dir->setCond(Exprs.Cond);
1181  Dir->setInit(Exprs.Init);
1182  Dir->setInc(Exprs.Inc);
1183  Dir->setIsLastIterVariable(Exprs.IL);
1184  Dir->setLowerBoundVariable(Exprs.LB);
1185  Dir->setUpperBoundVariable(Exprs.UB);
1186  Dir->setStrideVariable(Exprs.ST);
1187  Dir->setEnsureUpperBound(Exprs.EUB);
1188  Dir->setNextLowerBound(Exprs.NLB);
1189  Dir->setNextUpperBound(Exprs.NUB);
1190  Dir->setNumIterations(Exprs.NumIterations);
1191  Dir->setCounters(Exprs.Counters);
1192  Dir->setPrivateCounters(Exprs.PrivateCounters);
1193  Dir->setInits(Exprs.Inits);
1194  Dir->setUpdates(Exprs.Updates);
1195  Dir->setFinals(Exprs.Finals);
1196  Dir->setPreInits(Exprs.PreInits);
1197  return Dir;
1198 }
1199 
1202  unsigned NumClauses,
1203  unsigned CollapsedNum, EmptyShell) {
1204  unsigned Size =
1205  llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *));
1206  void *Mem = C.Allocate(
1207  Size + sizeof(OMPClause *) * NumClauses +
1208  sizeof(Stmt *) *
1209  numLoopChildren(CollapsedNum, OMPD_distribute_simd));
1210  return new (Mem) OMPDistributeSimdDirective(CollapsedNum, NumClauses);
1211 }
1212 
1214  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1215  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1216  const HelperExprs &Exprs) {
1217  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
1218  alignof(OMPClause *));
1219  void *Mem = C.Allocate(
1220  Size + sizeof(OMPClause *) * Clauses.size() +
1221  sizeof(Stmt *) *
1222  numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd));
1224  new (Mem) OMPTargetParallelForSimdDirective(StartLoc, EndLoc,
1225  CollapsedNum, Clauses.size());
1226  Dir->setClauses(Clauses);
1227  Dir->setAssociatedStmt(AssociatedStmt);
1229  Dir->setLastIteration(Exprs.LastIteration);
1231  Dir->setPreCond(Exprs.PreCond);
1232  Dir->setCond(Exprs.Cond);
1233  Dir->setInit(Exprs.Init);
1234  Dir->setInc(Exprs.Inc);
1235  Dir->setIsLastIterVariable(Exprs.IL);
1236  Dir->setLowerBoundVariable(Exprs.LB);
1237  Dir->setUpperBoundVariable(Exprs.UB);
1238  Dir->setStrideVariable(Exprs.ST);
1239  Dir->setEnsureUpperBound(Exprs.EUB);
1240  Dir->setNextLowerBound(Exprs.NLB);
1241  Dir->setNextUpperBound(Exprs.NUB);
1242  Dir->setNumIterations(Exprs.NumIterations);
1243  Dir->setCounters(Exprs.Counters);
1244  Dir->setPrivateCounters(Exprs.PrivateCounters);
1245  Dir->setInits(Exprs.Inits);
1246  Dir->setUpdates(Exprs.Updates);
1247  Dir->setFinals(Exprs.Finals);
1248  Dir->setPreInits(Exprs.PreInits);
1249  return Dir;
1250 }
1251 
1254  unsigned NumClauses,
1255  unsigned CollapsedNum,
1256  EmptyShell) {
1257  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
1258  alignof(OMPClause *));
1259  void *Mem = C.Allocate(
1260  Size + sizeof(OMPClause *) * NumClauses +
1261  sizeof(Stmt *) *
1262  numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd));
1263  return new (Mem) OMPTargetParallelForSimdDirective(CollapsedNum, NumClauses);
1264 }
1265 
1268  SourceLocation EndLoc, unsigned CollapsedNum,
1269  ArrayRef<OMPClause *> Clauses,
1270  Stmt *AssociatedStmt, const HelperExprs &Exprs) {
1271  unsigned Size =
1272  llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *));
1273  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1274  sizeof(Stmt *) *
1275  numLoopChildren(CollapsedNum, OMPD_target_simd));
1276  OMPTargetSimdDirective *Dir = new (Mem)
1277  OMPTargetSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
1278  Dir->setClauses(Clauses);
1279  Dir->setAssociatedStmt(AssociatedStmt);
1281  Dir->setLastIteration(Exprs.LastIteration);
1283  Dir->setPreCond(Exprs.PreCond);
1284  Dir->setCond(Exprs.Cond);
1285  Dir->setInit(Exprs.Init);
1286  Dir->setInc(Exprs.Inc);
1287  Dir->setCounters(Exprs.Counters);
1288  Dir->setPrivateCounters(Exprs.PrivateCounters);
1289  Dir->setInits(Exprs.Inits);
1290  Dir->setUpdates(Exprs.Updates);
1291  Dir->setFinals(Exprs.Finals);
1292  Dir->setPreInits(Exprs.PreInits);
1293  return Dir;
1294 }
1295 
1298  unsigned CollapsedNum, EmptyShell) {
1299  unsigned Size =
1300  llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *));
1301  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1302  sizeof(Stmt *) *
1303  numLoopChildren(CollapsedNum, OMPD_target_simd));
1304  return new (Mem) OMPTargetSimdDirective(CollapsedNum, NumClauses);
1305 }
1306 
1308  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1309  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1310  const HelperExprs &Exprs) {
1311  unsigned Size =
1312  llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *));
1313  void *Mem = C.Allocate(
1314  Size + sizeof(OMPClause *) * Clauses.size() +
1315  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
1317  StartLoc, EndLoc, CollapsedNum, Clauses.size());
1318  Dir->setClauses(Clauses);
1319  Dir->setAssociatedStmt(AssociatedStmt);
1321  Dir->setLastIteration(Exprs.LastIteration);
1323  Dir->setPreCond(Exprs.PreCond);
1324  Dir->setCond(Exprs.Cond);
1325  Dir->setInit(Exprs.Init);
1326  Dir->setInc(Exprs.Inc);
1327  Dir->setIsLastIterVariable(Exprs.IL);
1328  Dir->setLowerBoundVariable(Exprs.LB);
1329  Dir->setUpperBoundVariable(Exprs.UB);
1330  Dir->setStrideVariable(Exprs.ST);
1331  Dir->setEnsureUpperBound(Exprs.EUB);
1332  Dir->setNextLowerBound(Exprs.NLB);
1333  Dir->setNextUpperBound(Exprs.NUB);
1334  Dir->setNumIterations(Exprs.NumIterations);
1335  Dir->setCounters(Exprs.Counters);
1336  Dir->setPrivateCounters(Exprs.PrivateCounters);
1337  Dir->setInits(Exprs.Inits);
1338  Dir->setUpdates(Exprs.Updates);
1339  Dir->setFinals(Exprs.Finals);
1340  Dir->setPreInits(Exprs.PreInits);
1341  return Dir;
1342 }
1343 
1346  unsigned NumClauses,
1347  unsigned CollapsedNum, EmptyShell) {
1348  unsigned Size =
1349  llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *));
1350  void *Mem = C.Allocate(
1351  Size + sizeof(OMPClause *) * NumClauses +
1352  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
1353  return new (Mem) OMPTeamsDistributeDirective(CollapsedNum, NumClauses);
1354 }
1355 
1357  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1358  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1359  const HelperExprs &Exprs) {
1360  unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeSimdDirective),
1361  alignof(OMPClause *));
1362  void *Mem =
1363  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1364  sizeof(Stmt *) *
1365  numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd));
1367  new (Mem) OMPTeamsDistributeSimdDirective(StartLoc, EndLoc, CollapsedNum,
1368  Clauses.size());
1369  Dir->setClauses(Clauses);
1370  Dir->setAssociatedStmt(AssociatedStmt);
1372  Dir->setLastIteration(Exprs.LastIteration);
1374  Dir->setPreCond(Exprs.PreCond);
1375  Dir->setCond(Exprs.Cond);
1376  Dir->setInit(Exprs.Init);
1377  Dir->setInc(Exprs.Inc);
1378  Dir->setIsLastIterVariable(Exprs.IL);
1379  Dir->setLowerBoundVariable(Exprs.LB);
1380  Dir->setUpperBoundVariable(Exprs.UB);
1381  Dir->setStrideVariable(Exprs.ST);
1382  Dir->setEnsureUpperBound(Exprs.EUB);
1383  Dir->setNextLowerBound(Exprs.NLB);
1384  Dir->setNextUpperBound(Exprs.NUB);
1385  Dir->setNumIterations(Exprs.NumIterations);
1386  Dir->setCounters(Exprs.Counters);
1387  Dir->setPrivateCounters(Exprs.PrivateCounters);
1388  Dir->setInits(Exprs.Inits);
1389  Dir->setUpdates(Exprs.Updates);
1390  Dir->setFinals(Exprs.Finals);
1391  Dir->setPreInits(Exprs.PreInits);
1392  return Dir;
1393 }
1394 
1396  const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1397  EmptyShell) {
1398  unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeSimdDirective),
1399  alignof(OMPClause *));
1400  void *Mem =
1401  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1402  sizeof(Stmt *) *
1403  numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd));
1404  return new (Mem) OMPTeamsDistributeSimdDirective(CollapsedNum, NumClauses);
1405 }
1406 
1409  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1410  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1411  const HelperExprs &Exprs) {
1412  auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForSimdDirective),
1413  alignof(OMPClause *));
1414  void *Mem =
1415  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1416  sizeof(Stmt *) *
1417  numLoopChildren(CollapsedNum,
1418  OMPD_teams_distribute_parallel_for_simd));
1420  OMPTeamsDistributeParallelForSimdDirective(StartLoc, EndLoc, CollapsedNum,
1421  Clauses.size());
1422  Dir->setClauses(Clauses);
1423  Dir->setAssociatedStmt(AssociatedStmt);
1425  Dir->setLastIteration(Exprs.LastIteration);
1427  Dir->setPreCond(Exprs.PreCond);
1428  Dir->setCond(Exprs.Cond);
1429  Dir->setInit(Exprs.Init);
1430  Dir->setInc(Exprs.Inc);
1431  Dir->setIsLastIterVariable(Exprs.IL);
1432  Dir->setLowerBoundVariable(Exprs.LB);
1433  Dir->setUpperBoundVariable(Exprs.UB);
1434  Dir->setStrideVariable(Exprs.ST);
1435  Dir->setEnsureUpperBound(Exprs.EUB);
1436  Dir->setNextLowerBound(Exprs.NLB);
1437  Dir->setNextUpperBound(Exprs.NUB);
1438  Dir->setNumIterations(Exprs.NumIterations);
1439  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1440  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1441  Dir->setDistInc(Exprs.DistInc);
1442  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1443  Dir->setCounters(Exprs.Counters);
1444  Dir->setPrivateCounters(Exprs.PrivateCounters);
1445  Dir->setInits(Exprs.Inits);
1446  Dir->setUpdates(Exprs.Updates);
1447  Dir->setFinals(Exprs.Finals);
1448  Dir->setPreInits(Exprs.PreInits);
1456  return Dir;
1457 }
1458 
1461  unsigned NumClauses,
1462  unsigned CollapsedNum,
1463  EmptyShell) {
1464  auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForSimdDirective),
1465  alignof(OMPClause *));
1466  void *Mem =
1467  C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1468  sizeof(Stmt *) *
1469  numLoopChildren(CollapsedNum,
1470  OMPD_teams_distribute_parallel_for_simd));
1471  return new (Mem)
1472  OMPTeamsDistributeParallelForSimdDirective(CollapsedNum, NumClauses);
1473 }
1474 
1477  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1478  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1479  const HelperExprs &Exprs) {
1480  auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForDirective),
1481  alignof(OMPClause *));
1482  void *Mem = C.Allocate(
1483  Size + sizeof(OMPClause *) * Clauses.size() +
1484  sizeof(Stmt *) *
1485  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for));
1487  OMPTeamsDistributeParallelForDirective(StartLoc, EndLoc, CollapsedNum,
1488  Clauses.size());
1489  Dir->setClauses(Clauses);
1490  Dir->setAssociatedStmt(AssociatedStmt);
1492  Dir->setLastIteration(Exprs.LastIteration);
1494  Dir->setPreCond(Exprs.PreCond);
1495  Dir->setCond(Exprs.Cond);
1496  Dir->setInit(Exprs.Init);
1497  Dir->setInc(Exprs.Inc);
1498  Dir->setIsLastIterVariable(Exprs.IL);
1499  Dir->setLowerBoundVariable(Exprs.LB);
1500  Dir->setUpperBoundVariable(Exprs.UB);
1501  Dir->setStrideVariable(Exprs.ST);
1502  Dir->setEnsureUpperBound(Exprs.EUB);
1503  Dir->setNextLowerBound(Exprs.NLB);
1504  Dir->setNextUpperBound(Exprs.NUB);
1505  Dir->setNumIterations(Exprs.NumIterations);
1506  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1507  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1508  Dir->setDistInc(Exprs.DistInc);
1509  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1510  Dir->setCounters(Exprs.Counters);
1511  Dir->setPrivateCounters(Exprs.PrivateCounters);
1512  Dir->setInits(Exprs.Inits);
1513  Dir->setUpdates(Exprs.Updates);
1514  Dir->setFinals(Exprs.Finals);
1515  Dir->setPreInits(Exprs.PreInits);
1523  return Dir;
1524 }
1525 
1528  unsigned NumClauses,
1529  unsigned CollapsedNum,
1530  EmptyShell) {
1531  auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForDirective),
1532  alignof(OMPClause *));
1533  void *Mem = C.Allocate(
1534  Size + sizeof(OMPClause *) * NumClauses +
1535  sizeof(Stmt *) *
1536  numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for));
1537  return new (Mem)
1538  OMPTeamsDistributeParallelForDirective(CollapsedNum, NumClauses);
1539 }
1540 
1542  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1543  ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1544  auto Size =
1545  llvm::alignTo(sizeof(OMPTargetTeamsDirective), alignof(OMPClause *));
1546  void *Mem =
1547  C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
1549  new (Mem) OMPTargetTeamsDirective(StartLoc, EndLoc, Clauses.size());
1550  Dir->setClauses(Clauses);
1551  Dir->setAssociatedStmt(AssociatedStmt);
1552  return Dir;
1553 }
1554 
1557  EmptyShell) {
1558  auto Size =
1559  llvm::alignTo(sizeof(OMPTargetTeamsDirective), alignof(OMPClause *));
1560  void *Mem =
1561  C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
1562  return new (Mem) OMPTargetTeamsDirective(NumClauses);
1563 }
1564 
1566  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1567  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1568  const HelperExprs &Exprs) {
1569  auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeDirective),
1570  alignof(OMPClause *));
1571  void *Mem = C.Allocate(
1572  Size + sizeof(OMPClause *) * Clauses.size() +
1573  sizeof(Stmt *) *
1574  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute));
1576  new (Mem) OMPTargetTeamsDistributeDirective(StartLoc, EndLoc, CollapsedNum,
1577  Clauses.size());
1578  Dir->setClauses(Clauses);
1579  Dir->setAssociatedStmt(AssociatedStmt);
1581  Dir->setLastIteration(Exprs.LastIteration);
1583  Dir->setPreCond(Exprs.PreCond);
1584  Dir->setCond(Exprs.Cond);
1585  Dir->setInit(Exprs.Init);
1586  Dir->setInc(Exprs.Inc);
1587  Dir->setIsLastIterVariable(Exprs.IL);
1588  Dir->setLowerBoundVariable(Exprs.LB);
1589  Dir->setUpperBoundVariable(Exprs.UB);
1590  Dir->setStrideVariable(Exprs.ST);
1591  Dir->setEnsureUpperBound(Exprs.EUB);
1592  Dir->setNextLowerBound(Exprs.NLB);
1593  Dir->setNextUpperBound(Exprs.NUB);
1594  Dir->setNumIterations(Exprs.NumIterations);
1595  Dir->setCounters(Exprs.Counters);
1596  Dir->setPrivateCounters(Exprs.PrivateCounters);
1597  Dir->setInits(Exprs.Inits);
1598  Dir->setUpdates(Exprs.Updates);
1599  Dir->setFinals(Exprs.Finals);
1600  Dir->setPreInits(Exprs.PreInits);
1601  return Dir;
1602 }
1603 
1606  unsigned NumClauses,
1607  unsigned CollapsedNum,
1608  EmptyShell) {
1609  auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeDirective),
1610  alignof(OMPClause *));
1611  void *Mem = C.Allocate(
1612  Size + sizeof(OMPClause *) * NumClauses +
1613  sizeof(Stmt *) *
1614  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute));
1615  return new (Mem) OMPTargetTeamsDistributeDirective(CollapsedNum, NumClauses);
1616 }
1617 
1620  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1621  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1622  const HelperExprs &Exprs) {
1623  auto Size =
1624  llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForDirective),
1625  alignof(OMPClause *));
1626  void *Mem = C.Allocate(
1627  Size + sizeof(OMPClause *) * Clauses.size() +
1628  sizeof(Stmt *) *
1629  numLoopChildren(CollapsedNum,
1630  OMPD_target_teams_distribute_parallel_for));
1633  StartLoc, EndLoc, CollapsedNum, Clauses.size());
1634  Dir->setClauses(Clauses);
1635  Dir->setAssociatedStmt(AssociatedStmt);
1637  Dir->setLastIteration(Exprs.LastIteration);
1639  Dir->setPreCond(Exprs.PreCond);
1640  Dir->setCond(Exprs.Cond);
1641  Dir->setInit(Exprs.Init);
1642  Dir->setInc(Exprs.Inc);
1643  Dir->setIsLastIterVariable(Exprs.IL);
1644  Dir->setLowerBoundVariable(Exprs.LB);
1645  Dir->setUpperBoundVariable(Exprs.UB);
1646  Dir->setStrideVariable(Exprs.ST);
1647  Dir->setEnsureUpperBound(Exprs.EUB);
1648  Dir->setNextLowerBound(Exprs.NLB);
1649  Dir->setNextUpperBound(Exprs.NUB);
1650  Dir->setNumIterations(Exprs.NumIterations);
1651  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1652  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1653  Dir->setDistInc(Exprs.DistInc);
1654  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1655  Dir->setCounters(Exprs.Counters);
1656  Dir->setPrivateCounters(Exprs.PrivateCounters);
1657  Dir->setInits(Exprs.Inits);
1658  Dir->setUpdates(Exprs.Updates);
1659  Dir->setFinals(Exprs.Finals);
1660  Dir->setPreInits(Exprs.PreInits);
1668  return Dir;
1669 }
1670 
1673  unsigned NumClauses,
1674  unsigned CollapsedNum,
1675  EmptyShell) {
1676  auto Size =
1677  llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForDirective),
1678  alignof(OMPClause *));
1679  void *Mem = C.Allocate(
1680  Size + sizeof(OMPClause *) * NumClauses +
1681  sizeof(Stmt *) *
1682  numLoopChildren(CollapsedNum,
1683  OMPD_target_teams_distribute_parallel_for));
1684  return new (Mem)
1685  OMPTargetTeamsDistributeParallelForDirective(CollapsedNum, NumClauses);
1686 }
1687 
1690  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1691  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1692  const HelperExprs &Exprs) {
1693  auto Size =
1695  alignof(OMPClause *));
1696  void *Mem = C.Allocate(
1697  Size + sizeof(OMPClause *) * Clauses.size() +
1698  sizeof(Stmt *) *
1699  numLoopChildren(CollapsedNum,
1700  OMPD_target_teams_distribute_parallel_for_simd));
1703  StartLoc, EndLoc, CollapsedNum, Clauses.size());
1704  Dir->setClauses(Clauses);
1705  Dir->setAssociatedStmt(AssociatedStmt);
1707  Dir->setLastIteration(Exprs.LastIteration);
1709  Dir->setPreCond(Exprs.PreCond);
1710  Dir->setCond(Exprs.Cond);
1711  Dir->setInit(Exprs.Init);
1712  Dir->setInc(Exprs.Inc);
1713  Dir->setIsLastIterVariable(Exprs.IL);
1714  Dir->setLowerBoundVariable(Exprs.LB);
1715  Dir->setUpperBoundVariable(Exprs.UB);
1716  Dir->setStrideVariable(Exprs.ST);
1717  Dir->setEnsureUpperBound(Exprs.EUB);
1718  Dir->setNextLowerBound(Exprs.NLB);
1719  Dir->setNextUpperBound(Exprs.NUB);
1720  Dir->setNumIterations(Exprs.NumIterations);
1721  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1722  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1723  Dir->setDistInc(Exprs.DistInc);
1724  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1725  Dir->setCounters(Exprs.Counters);
1726  Dir->setPrivateCounters(Exprs.PrivateCounters);
1727  Dir->setInits(Exprs.Inits);
1728  Dir->setUpdates(Exprs.Updates);
1729  Dir->setFinals(Exprs.Finals);
1730  Dir->setPreInits(Exprs.PreInits);
1738  return Dir;
1739 }
1740 
1743  const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1744  EmptyShell) {
1745  auto Size =
1747  alignof(OMPClause *));
1748  void *Mem = C.Allocate(
1749  Size + sizeof(OMPClause *) * NumClauses +
1750  sizeof(Stmt *) *
1751  numLoopChildren(CollapsedNum,
1752  OMPD_target_teams_distribute_parallel_for_simd));
1754  CollapsedNum, NumClauses);
1755 }
1756 
1759  const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1760  unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1761  const HelperExprs &Exprs) {
1762  auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeSimdDirective),
1763  alignof(OMPClause *));
1764  void *Mem = C.Allocate(
1765  Size + sizeof(OMPClause *) * Clauses.size() +
1766  sizeof(Stmt *) *
1767  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd));
1768  OMPTargetTeamsDistributeSimdDirective *Dir = new (Mem)
1769  OMPTargetTeamsDistributeSimdDirective(StartLoc, EndLoc, CollapsedNum,
1770  Clauses.size());
1771  Dir->setClauses(Clauses);
1772  Dir->setAssociatedStmt(AssociatedStmt);
1774  Dir->setLastIteration(Exprs.LastIteration);
1776  Dir->setPreCond(Exprs.PreCond);
1777  Dir->setCond(Exprs.Cond);
1778  Dir->setInit(Exprs.Init);
1779  Dir->setInc(Exprs.Inc);
1780  Dir->setIsLastIterVariable(Exprs.IL);
1781  Dir->setLowerBoundVariable(Exprs.LB);
1782  Dir->setUpperBoundVariable(Exprs.UB);
1783  Dir->setStrideVariable(Exprs.ST);
1784  Dir->setEnsureUpperBound(Exprs.EUB);
1785  Dir->setNextLowerBound(Exprs.NLB);
1786  Dir->setNextUpperBound(Exprs.NUB);
1787  Dir->setNumIterations(Exprs.NumIterations);
1788  Dir->setCounters(Exprs.Counters);
1789  Dir->setPrivateCounters(Exprs.PrivateCounters);
1790  Dir->setInits(Exprs.Inits);
1791  Dir->setUpdates(Exprs.Updates);
1792  Dir->setFinals(Exprs.Finals);
1793  Dir->setPreInits(Exprs.PreInits);
1794  return Dir;
1795 }
1796 
1799  unsigned NumClauses,
1800  unsigned CollapsedNum,
1801  EmptyShell) {
1802  auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeSimdDirective),
1803  alignof(OMPClause *));
1804  void *Mem = C.Allocate(
1805  Size + sizeof(OMPClause *) * NumClauses +
1806  sizeof(Stmt *) *
1807  numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd));
1808  return new (Mem)
1809  OMPTargetTeamsDistributeSimdDirective(CollapsedNum, NumClauses);
1810 }
void setPreInits(Stmt *PreInits)
Definition: StmtOpenMP.h:469
Expr * NLB
Update of LowerBound for statically sheduled &#39;omp for&#39; loops.
Definition: StmtOpenMP.h:647
Defines the clang::ASTContext interface.
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3171
SmallVector< Expr *, 4 > Finals
Final loop counter values for GodeGen.
Definition: StmtOpenMP.h:675
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1364
Expr * NUB
Update of UpperBound for statically sheduled omp loops for outer loop in combined constructs (e...
Definition: StmtOpenMP.h:614
SmallVector< Expr *, 4 > Updates
Expressions for loop counters update for CodeGen.
Definition: StmtOpenMP.h:673
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:1704
void setEnsureUpperBound(Expr *EUB)
Definition: StmtOpenMP.h:500
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:303
static OMPAtomicDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V, Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate)
Creates directive with a list of Clauses and &#39;x&#39;, &#39;v&#39; and &#39;expr&#39; parts of the atomic construct (see S...
Definition: StmtOpenMP.cpp:643
void setCombinedCond(Expr *CombCond)
Definition: StmtOpenMP.h:568
static OMPTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:839
void setCombinedLowerBoundVariable(Expr *CombLB)
Definition: StmtOpenMP.h:548
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:519
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:715
void setHasCancel(bool Has)
Set cancel state.
Definition: StmtOpenMP.h:1291
Stmt - This represents one statement.
Definition: Stmt.h:60
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:540
void setLastIteration(Expr *LI)
Definition: StmtOpenMP.h:455
static OMPTargetEnterDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:796
static OMPTaskgroupDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef)
Creates directive.
Definition: StmtOpenMP.cpp:525
static OMPTeamsDistributeParallelForDirective * 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 setPrivateCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:32
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1114
Expr * EUB
EnsureUpperBound – expression UB = min(UB, NumIterations).
Definition: StmtOpenMP.h:645
static OMPDistributeParallelForDirective * 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 * DistInc
DistInc - increment expression for distribute loop when found combined with a further loop level (e...
Definition: StmtOpenMP.h:659
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3582
static OMPSectionDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, bool HasCancel)
Creates directive.
Definition: StmtOpenMP.cpp:246
void setPrevEnsureUpperBound(Expr *PrevEUB)
Definition: StmtOpenMP.h:543
void setUpperBoundVariable(Expr *UB)
Definition: StmtOpenMP.h:486
void setNumIterations(Expr *NI)
Definition: StmtOpenMP.h:521
This represents &#39;#pragma omp target teams distribute&#39; combined directive.
Definition: StmtOpenMP.h:3709
void setNextLowerBound(Expr *NLB)
Definition: StmtOpenMP.h:507
static OMPTargetUpdateDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses)
Creates directive with a list of Clauses.
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1485
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:3777
void setIsLastIterVariable(Expr *IL)
Definition: StmtOpenMP.h:472
Expr * PrevLB
PreviousLowerBound - local variable passed to runtime in the enclosing schedule or null if that does ...
Definition: StmtOpenMP.h:652
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2396
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:72
static OMPTeamsDistributeParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
void setInit(Expr *Init)
Definition: StmtOpenMP.h:467
Expr * LastIteration
Loop last iteration number.
Definition: StmtOpenMP.h:623
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp: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:690
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:251
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:128
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 OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:763
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:608
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:3307
static OMPTaskDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:459
static OMPDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:962
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:1816
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1411
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:325
void setCond(Expr *Cond)
Definition: StmtOpenMP.h:464
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:902
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3032
This represents &#39;#pragma omp teams distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3511
static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Expr * LB
DistributeLowerBound - used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same construct...
Definition: StmtOpenMP.h:595
Expr * EUB
DistributeEnsureUpperBound - used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same construct...
Definition: StmtOpenMP.h:601
static OMPTeamsDistributeSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents &#39;#pragma omp cancellation point&#39; directive.
Definition: StmtOpenMP.h:2651
void setCombinedInit(Expr *CombInit)
Definition: StmtOpenMP.h:563
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:2594
static OMPFlushDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:595
Expr * CalcLastIteration
Calculation of last iteration.
Definition: StmtOpenMP.h:627
static OMPTargetTeamsDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
This represents &#39;#pragma omp teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:3441
static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:491
static OMPParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:384
Expr * NUB
Update of UpperBound for statically sheduled &#39;omp for&#39; loops.
Definition: StmtOpenMP.h:649
Expr * Cond
Loop condition.
Definition: StmtOpenMP.h:631
static OMPDistributeSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTargetParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:724
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:787
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetParallelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:700
Expr * PreCond
Loop pre-condition.
Definition: StmtOpenMP.h:629
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:3239
The expressions built for the OpenMP loop CodeGen for the whole collapsed loop nest.
Definition: StmtOpenMP.h:619
static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents &#39;#pragma omp taskgroup&#39; directive.
Definition: StmtOpenMP.h:1904
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:282
static OMPCriticalDirective * Create(const ASTContext &C, const DeclarationNameInfo &Name, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:310
Expr * IterationVarRef
Loop iteration variable.
Definition: StmtOpenMP.h:621
static OMPDistributeParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Expr * Init
Distribute loop iteration variable init used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same...
Definition: StmtOpenMP.h:605
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:855
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:2905
void setInits(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:39
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:111
Expr - This represents one expression.
Definition: Expr.h:106
static OMPTargetTeamsDistributeParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:292
This represents &#39;#pragma omp target teams distribute parallel for simd&#39; combined directive.
Definition: StmtOpenMP.h:3850
static OMPTargetSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTargetDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:674
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:3923
unsigned getNumClauses() const
Get number of clauses.
Definition: StmtOpenMP.h:184
Expr * PrevUB
PreviousUpperBound - local variable passed to runtime in the enclosing schedule or null if that does ...
Definition: StmtOpenMP.h:655
static OMPOrderedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:617
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1037
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:3650
void setAssociatedStmt(Stmt *S)
Set the associated statement for the directive.
Definition: StmtOpenMP.h:85
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:422
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:2709
void setDistInc(Expr *DistInc)
Definition: StmtOpenMP.h:538
Expr * NLB
Update of LowerBound for statically sheduled omp loops for outer loop in combined constructs (e...
Definition: StmtOpenMP.h:611
static OMPDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setClauses(ArrayRef< OMPClause *> Clauses)
Sets the list of variables for this clause.
Definition: StmtOpenMP.cpp:20
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:1977
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1565
Expr * NumIterations
Loop number of iterations.
Definition: StmtOpenMP.h:625
static OMPForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:123
Expr * ST
Stride - local variable passed to runtime.
Definition: StmtOpenMP.h:643
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:374
This represents &#39;#pragma omp target enter data&#39; directive.
Definition: StmtOpenMP.h:2337
void setUpdates(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:45
SmallVector< Expr *, 4 > PrivateCounters
PrivateCounters Loop counters.
Definition: StmtOpenMP.h:669
void setLowerBoundVariable(Expr *LB)
Definition: StmtOpenMP.h:479
static OMPTargetExitDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:818
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:259
SmallVector< Expr *, 4 > Counters
Counters Loop counters.
Definition: StmtOpenMP.h:667
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1309
Encodes a location in the source.
void setPrevLowerBoundVariable(Expr *PrevLB)
Definition: StmtOpenMP.h:528
void setIterationVariable(Expr *IV)
Definition: StmtOpenMP.h:452
MutableArrayRef< Expr * > getInits()
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:473
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setCombinedNextLowerBound(Expr *CombNLB)
Definition: StmtOpenMP.h:573
static OMPParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:335
OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:23
static OMPParallelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:57
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:664
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:1860
Expr * PrevEUB
PrevEUB - expression similar to EUB but to be used when loop scheduling uses PrevLB and PrevUB (e...
Definition: StmtOpenMP.h:665
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:33
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:633
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2221
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
DistCombinedHelperExprs DistCombinedFields
Expressions used when combining OpenMP loop pragmas.
Definition: StmtOpenMP.h:680
static OMPForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:172
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2032
Expr * LB
LowerBound - local variable passed to runtime.
Definition: StmtOpenMP.h:639
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:2973
Expr * Init
Loop iteration variable init.
Definition: StmtOpenMP.h:633
static OMPSingleDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:266
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
Definition: Stmt.h:308
void * Allocate(size_t Size, unsigned Align=8) const
Definition: ASTContext.h:625
void setPrevUpperBoundVariable(Expr *PrevUB)
Definition: StmtOpenMP.h:533
void setCombinedEnsureUpperBound(Expr *CombEUB)
Definition: StmtOpenMP.h:558
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:160
void setCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:26
Dataflow Directional Tag Classes.
SmallVector< Expr *, 4 > Inits
Expressions for loop counters inits for CodeGen.
Definition: StmtOpenMP.h:671
void setCombinedUpperBoundVariable(Expr *CombUB)
Definition: StmtOpenMP.h:553
static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents &#39;#pragma omp section&#39; directive.
Definition: StmtOpenMP.h:1247
This represents &#39;#pragma omp teams distribute&#39; directive.
Definition: StmtOpenMP.h:3373
static OMPParallelSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:433
This represents &#39;#pragma omp simd&#39; directive.
Definition: StmtOpenMP.h:972
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
This represents &#39;#pragma omp atomic&#39; directive.
Definition: StmtOpenMP.h:2087
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:209
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:505
This file defines OpenMP AST classes for executable directives and clauses.
static OMPSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:221
Expr * Inc
Loop increment.
Definition: StmtOpenMP.h:635
static OMPTargetTeamsDistributeParallelForDirective * 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 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:598
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
Definition: SemaDecl.cpp:13161
static OMPTaskyieldDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:482
static OMPTargetDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:774
Expr * UB
UpperBound - local variable passed to runtime.
Definition: StmtOpenMP.h:641
This represents &#39;#pragma omp target parallel&#39; directive.
Definition: StmtOpenMP.h:2454
void setStrideVariable(Expr *ST)
Definition: StmtOpenMP.h:493
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:449
static OMPBarrierDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:497
static OMPSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:83
This represents &#39;#pragma omp taskloop simd&#39; directive.
Definition: StmtOpenMP.h:2839
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:236
void setPreCond(Expr *PC)
Definition: StmtOpenMP.h:461
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:585
static OMPTaskwaitDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:511
This represents &#39;#pragma omp sections&#39; directive.
Definition: StmtOpenMP.h:1179
Expr * Cond
Distribute Loop condition used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same construct...
Definition: StmtOpenMP.h:608
Stmt * PreInits
Init statement for all captured expressions.
Definition: StmtOpenMP.h:677
This represents &#39;#pragma omp target data&#39; directive.
Definition: StmtOpenMP.h:2279
void setNextUpperBound(Expr *NUB)
Definition: StmtOpenMP.h:514
static OMPTargetTeamsDistributeSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
void setInc(Expr *Inc)
Definition: StmtOpenMP.h:468
static OMPCancelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, OpenMPDirectiveKind CancelRegion)
Creates directive.
Definition: StmtOpenMP.cpp:571
Expr * IL
IsLastIteration - local flag variable passed to runtime.
Definition: StmtOpenMP.h:637
This represents &#39;#pragma omp taskyield&#39; directive.
Definition: StmtOpenMP.h:1772
This represents &#39;#pragma omp distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3102
static OMPCancellationPointDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Creates directive.
Definition: StmtOpenMP.cpp:550
This represents &#39;#pragma omp parallel sections&#39; directive.
Definition: StmtOpenMP.h:1633
void setCalcLastIteration(Expr *CLI)
Definition: StmtOpenMP.h:458
void setCombinedNextUpperBound(Expr *CombNUB)
Definition: StmtOpenMP.h:578
static OMPTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:914
void setFinals(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:51
static OMPTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents &#39;#pragma omp target parallel for&#39; directive.
Definition: StmtOpenMP.h:2514
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:563
This represents &#39;#pragma omp taskloop&#39; directive.
Definition: StmtOpenMP.h:2774