clang 20.0.0git
StmtOpenMP.cpp
Go to the documentation of this file.
1//===--- StmtOpenMP.cpp - Classes for OpenMP directives -------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements the subclasses of Stmt class declared in StmtOpenMP.h
10//
11//===----------------------------------------------------------------------===//
12
15
16using namespace clang;
17using namespace llvm::omp;
18
19size_t OMPChildren::size(unsigned NumClauses, bool HasAssociatedStmt,
20 unsigned NumChildren) {
21 return llvm::alignTo(
22 totalSizeToAlloc<OMPClause *, Stmt *>(
23 NumClauses, NumChildren + (HasAssociatedStmt ? 1 : 0)),
24 alignof(OMPChildren));
25}
26
28 assert(Clauses.size() == NumClauses &&
29 "Number of clauses is not the same as the preallocated buffer");
30 llvm::copy(Clauses, getTrailingObjects<OMPClause *>());
31}
32
34 return llvm::MutableArrayRef(getTrailingObjects<Stmt *>(), NumChildren);
35}
36
37OMPChildren *OMPChildren::Create(void *Mem, ArrayRef<OMPClause *> Clauses) {
38 auto *Data = CreateEmpty(Mem, Clauses.size());
39 Data->setClauses(Clauses);
40 return Data;
41}
42
43OMPChildren *OMPChildren::Create(void *Mem, ArrayRef<OMPClause *> Clauses,
44 Stmt *S, unsigned NumChildren) {
45 auto *Data = CreateEmpty(Mem, Clauses.size(), S, NumChildren);
46 Data->setClauses(Clauses);
47 if (S)
48 Data->setAssociatedStmt(S);
49 return Data;
50}
51
52OMPChildren *OMPChildren::CreateEmpty(void *Mem, unsigned NumClauses,
53 bool HasAssociatedStmt,
54 unsigned NumChildren) {
55 return new (Mem) OMPChildren(NumClauses, NumChildren, HasAssociatedStmt);
56}
57
59 // Special case: 'omp target enter data', 'omp target exit data',
60 // 'omp target update' are stand-alone directives, but for implementation
61 // reasons they have empty synthetic structured block, to simplify codegen.
62 if (isa<OMPTargetEnterDataDirective>(this) ||
63 isa<OMPTargetExitDataDirective>(this) ||
64 isa<OMPTargetUpdateDirective>(this))
65 return true;
66 return !hasAssociatedStmt();
67}
68
70 assert(!isStandaloneDirective() &&
71 "Standalone Executable Directives don't have Structured Blocks.");
72 if (auto *LD = dyn_cast<OMPLoopDirective>(this))
73 return LD->getBody();
74 return getRawStmt();
75}
76
77Stmt *
79 bool TryImperfectlyNestedLoops) {
80 Stmt *OrigStmt = CurStmt;
81 CurStmt = CurStmt->IgnoreContainers();
82 // Additional work for imperfectly nested loops, introduced in OpenMP 5.0.
83 if (TryImperfectlyNestedLoops) {
84 if (auto *CS = dyn_cast<CompoundStmt>(CurStmt)) {
85 CurStmt = nullptr;
86 SmallVector<CompoundStmt *, 4> Statements(1, CS);
87 SmallVector<CompoundStmt *, 4> NextStatements;
88 while (!Statements.empty()) {
89 CS = Statements.pop_back_val();
90 if (!CS)
91 continue;
92 for (Stmt *S : CS->body()) {
93 if (!S)
94 continue;
95 if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(S))
96 S = CanonLoop->getLoopStmt();
97 if (isa<ForStmt>(S) || isa<CXXForRangeStmt>(S) ||
98 (isa<OMPLoopBasedDirective>(S) && !isa<OMPLoopDirective>(S))) {
99 // Only single loop construct is allowed.
100 if (CurStmt) {
101 CurStmt = OrigStmt;
102 break;
103 }
104 CurStmt = S;
105 continue;
106 }
107 S = S->IgnoreContainers();
108 if (auto *InnerCS = dyn_cast_or_null<CompoundStmt>(S))
109 NextStatements.push_back(InnerCS);
110 }
111 if (Statements.empty()) {
112 // Found single inner loop or multiple loops - exit.
113 if (CurStmt)
114 break;
115 Statements.swap(NextStatements);
116 }
117 }
118 if (!CurStmt)
119 CurStmt = OrigStmt;
120 }
121 }
122 return CurStmt;
123}
124
126 Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops,
127 llvm::function_ref<bool(unsigned, Stmt *)> Callback,
128 llvm::function_ref<void(OMPLoopTransformationDirective *)>
129 OnTransformationCallback) {
130 CurStmt = CurStmt->IgnoreContainers();
131 for (unsigned Cnt = 0; Cnt < NumLoops; ++Cnt) {
132 while (true) {
133 auto *Dir = dyn_cast<OMPLoopTransformationDirective>(CurStmt);
134 if (!Dir)
135 break;
136
137 OnTransformationCallback(Dir);
138
139 Stmt *TransformedStmt = Dir->getTransformedStmt();
140 if (!TransformedStmt) {
141 unsigned NumGeneratedLoops = Dir->getNumGeneratedLoops();
142 if (NumGeneratedLoops == 0) {
143 // May happen if the loop transformation does not result in a
144 // generated loop (such as full unrolling).
145 break;
146 }
147 if (NumGeneratedLoops > 0) {
148 // The loop transformation construct has generated loops, but these
149 // may not have been generated yet due to being in a dependent
150 // context.
151 return true;
152 }
153 }
154
155 CurStmt = TransformedStmt;
156 }
157 if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(CurStmt))
158 CurStmt = CanonLoop->getLoopStmt();
159 if (Callback(Cnt, CurStmt))
160 return false;
161 // Move on to the next nested for loop, or to the loop body.
162 // OpenMP [2.8.1, simd construct, Restrictions]
163 // All loops associated with the construct must be perfectly nested; that
164 // is, there must be no intervening code nor any OpenMP directive between
165 // any two loops.
166 if (auto *For = dyn_cast<ForStmt>(CurStmt)) {
167 CurStmt = For->getBody();
168 } else {
169 assert(isa<CXXForRangeStmt>(CurStmt) &&
170 "Expected canonical for or range-based for loops.");
171 CurStmt = cast<CXXForRangeStmt>(CurStmt)->getBody();
172 }
174 CurStmt, TryImperfectlyNestedLoops);
175 }
176 return true;
177}
178
180 Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops,
181 llvm::function_ref<void(unsigned, Stmt *, Stmt *)> Callback) {
183 CurStmt, TryImperfectlyNestedLoops, NumLoops,
184 [Callback](unsigned Cnt, Stmt *Loop) {
185 Stmt *Body = nullptr;
186 if (auto *For = dyn_cast<ForStmt>(Loop)) {
187 Body = For->getBody();
188 } else {
189 assert(isa<CXXForRangeStmt>(Loop) &&
190 "Expected canonical for or range-based for loops.");
191 Body = cast<CXXForRangeStmt>(Loop)->getBody();
192 }
193 if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Body))
194 Body = CanonLoop->getLoopStmt();
195 Callback(Cnt, Loop, Body);
196 return false;
197 });
198 assert(Res && "Expected only loops");
199 (void)Res;
200}
201
203 // This relies on the loop form is already checked by Sema.
204 Stmt *Body = nullptr;
206 Data->getRawStmt(), /*TryImperfectlyNestedLoops=*/true,
208 [&Body](unsigned, Stmt *, Stmt *BodyStmt) { Body = BodyStmt; });
209 return Body;
210}
211
213 assert(A.size() == getLoopsNumber() &&
214 "Number of loop counters is not the same as the collapsed number");
215 llvm::copy(A, getCounters().begin());
216}
217
219 assert(A.size() == getLoopsNumber() && "Number of loop private counters "
220 "is not the same as the collapsed "
221 "number");
222 llvm::copy(A, getPrivateCounters().begin());
223}
224
226 assert(A.size() == getLoopsNumber() &&
227 "Number of counter inits is not the same as the collapsed number");
228 llvm::copy(A, getInits().begin());
229}
230
232 assert(A.size() == getLoopsNumber() &&
233 "Number of counter updates is not the same as the collapsed number");
234 llvm::copy(A, getUpdates().begin());
235}
236
238 assert(A.size() == getLoopsNumber() &&
239 "Number of counter finals is not the same as the collapsed number");
240 llvm::copy(A, getFinals().begin());
241}
242
244 assert(
245 A.size() == getLoopsNumber() &&
246 "Number of dependent counters is not the same as the collapsed number");
247 llvm::copy(A, getDependentCounters().begin());
248}
249
251 assert(A.size() == getLoopsNumber() &&
252 "Number of dependent inits is not the same as the collapsed number");
253 llvm::copy(A, getDependentInits().begin());
254}
255
257 assert(A.size() == getLoopsNumber() &&
258 "Number of finals conditions is not the same as the collapsed number");
259 llvm::copy(A, getFinalsConditions().begin());
260}
261
263 SourceLocation StartLoc,
264 SourceLocation EndLoc,
265 ArrayRef<OMPClause *> Clauses,
266 Stmt *AssociatedStmt, Stmt *IfStmt) {
267 auto *Dir = createDirective<OMPMetaDirective>(
268 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
269 Dir->setIfStmt(IfStmt);
270 return Dir;
271}
272
274 unsigned NumClauses,
275 EmptyShell) {
276 return createEmptyDirective<OMPMetaDirective>(C, NumClauses,
277 /*HasAssociatedStmt=*/true,
278 /*NumChildren=*/1);
279}
280
282 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
283 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
284 bool HasCancel) {
285 auto *Dir = createDirective<OMPParallelDirective>(
286 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
287 Dir->setTaskReductionRefExpr(TaskRedRef);
288 Dir->setHasCancel(HasCancel);
289 return Dir;
290}
291
293 unsigned NumClauses,
294 EmptyShell) {
295 return createEmptyDirective<OMPParallelDirective>(C, NumClauses,
296 /*HasAssociatedStmt=*/true,
297 /*NumChildren=*/1);
298}
299
302 SourceLocation EndLoc, unsigned CollapsedNum,
303 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
304 const HelperExprs &Exprs) {
305 auto *Dir = createDirective<OMPSimdDirective>(
306 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_simd),
307 StartLoc, EndLoc, CollapsedNum);
308 Dir->setIterationVariable(Exprs.IterationVarRef);
309 Dir->setLastIteration(Exprs.LastIteration);
310 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
311 Dir->setPreCond(Exprs.PreCond);
312 Dir->setCond(Exprs.Cond);
313 Dir->setInit(Exprs.Init);
314 Dir->setInc(Exprs.Inc);
315 Dir->setCounters(Exprs.Counters);
316 Dir->setPrivateCounters(Exprs.PrivateCounters);
317 Dir->setInits(Exprs.Inits);
318 Dir->setUpdates(Exprs.Updates);
319 Dir->setFinals(Exprs.Finals);
320 Dir->setDependentCounters(Exprs.DependentCounters);
321 Dir->setDependentInits(Exprs.DependentInits);
322 Dir->setFinalsConditions(Exprs.FinalsConditions);
323 Dir->setPreInits(Exprs.PreInits);
324 return Dir;
325}
326
328 unsigned NumClauses,
329 unsigned CollapsedNum,
330 EmptyShell) {
331 return createEmptyDirective<OMPSimdDirective>(
332 C, NumClauses, /*HasAssociatedStmt=*/true,
333 numLoopChildren(CollapsedNum, OMPD_simd), CollapsedNum);
334}
335
337 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
338 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
339 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
340 auto *Dir = createDirective<OMPForDirective>(
341 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for) + 1,
342 StartLoc, EndLoc, CollapsedNum);
343 Dir->setIterationVariable(Exprs.IterationVarRef);
344 Dir->setLastIteration(Exprs.LastIteration);
345 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
346 Dir->setPreCond(Exprs.PreCond);
347 Dir->setCond(Exprs.Cond);
348 Dir->setInit(Exprs.Init);
349 Dir->setInc(Exprs.Inc);
350 Dir->setIsLastIterVariable(Exprs.IL);
351 Dir->setLowerBoundVariable(Exprs.LB);
352 Dir->setUpperBoundVariable(Exprs.UB);
353 Dir->setStrideVariable(Exprs.ST);
354 Dir->setEnsureUpperBound(Exprs.EUB);
355 Dir->setNextLowerBound(Exprs.NLB);
356 Dir->setNextUpperBound(Exprs.NUB);
357 Dir->setNumIterations(Exprs.NumIterations);
358 Dir->setCounters(Exprs.Counters);
359 Dir->setPrivateCounters(Exprs.PrivateCounters);
360 Dir->setInits(Exprs.Inits);
361 Dir->setUpdates(Exprs.Updates);
362 Dir->setFinals(Exprs.Finals);
363 Dir->setDependentCounters(Exprs.DependentCounters);
364 Dir->setDependentInits(Exprs.DependentInits);
365 Dir->setFinalsConditions(Exprs.FinalsConditions);
366 Dir->setPreInits(Exprs.PreInits);
367 Dir->setTaskReductionRefExpr(TaskRedRef);
368 Dir->setHasCancel(HasCancel);
369 return Dir;
370}
371
373 switch (getStmtClass()) {
374#define STMT(CLASS, PARENT)
375#define ABSTRACT_STMT(CLASS)
376#define OMPLOOPTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
377 case Stmt::CLASS##Class: \
378 return static_cast<const CLASS *>(this)->getTransformedStmt();
379#include "clang/AST/StmtNodes.inc"
380 default:
381 llvm_unreachable("Not a loop transformation");
382 }
383}
384
386 switch (getStmtClass()) {
387#define STMT(CLASS, PARENT)
388#define ABSTRACT_STMT(CLASS)
389#define OMPLOOPTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
390 case Stmt::CLASS##Class: \
391 return static_cast<const CLASS *>(this)->getPreInits();
392#include "clang/AST/StmtNodes.inc"
393 default:
394 llvm_unreachable("Not a loop transformation");
395 }
396}
397
399 unsigned NumClauses,
400 unsigned CollapsedNum,
401 EmptyShell) {
402 return createEmptyDirective<OMPForDirective>(
403 C, NumClauses, /*HasAssociatedStmt=*/true,
404 numLoopChildren(CollapsedNum, OMPD_for) + 1, CollapsedNum);
405}
406
410 unsigned NumLoops, Stmt *AssociatedStmt,
411 Stmt *TransformedStmt, Stmt *PreInits) {
412 OMPTileDirective *Dir = createDirective<OMPTileDirective>(
413 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
414 NumLoops);
415 Dir->setTransformedStmt(TransformedStmt);
416 Dir->setPreInits(PreInits);
417 return Dir;
418}
419
421 unsigned NumClauses,
422 unsigned NumLoops) {
423 return createEmptyDirective<OMPTileDirective>(
424 C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1,
425 SourceLocation(), SourceLocation(), NumLoops);
426}
427
431 Stmt *AssociatedStmt, unsigned NumGeneratedLoops,
432 Stmt *TransformedStmt, Stmt *PreInits) {
433 assert(NumGeneratedLoops <= 1 && "Unrolling generates at most one loop");
434
435 auto *Dir = createDirective<OMPUnrollDirective>(
436 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc);
437 Dir->setNumGeneratedLoops(NumGeneratedLoops);
438 Dir->setTransformedStmt(TransformedStmt);
439 Dir->setPreInits(PreInits);
440 return Dir;
441}
442
444 unsigned NumClauses) {
445 return createEmptyDirective<OMPUnrollDirective>(
446 C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1,
448}
449
452 SourceLocation EndLoc, Stmt *AssociatedStmt,
453 Stmt *TransformedStmt, Stmt *PreInits) {
454 OMPReverseDirective *Dir = createDirective<OMPReverseDirective>(
455 C, std::nullopt, AssociatedStmt, TransformedStmtOffset + 1, StartLoc,
456 EndLoc);
457 Dir->setTransformedStmt(TransformedStmt);
458 Dir->setPreInits(PreInits);
459 return Dir;
460}
461
463 return createEmptyDirective<OMPReverseDirective>(
464 C, /*NumClauses=*/0, /*HasAssociatedStmt=*/true,
465 TransformedStmtOffset + 1, SourceLocation(), SourceLocation());
466}
467
469 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
470 ArrayRef<OMPClause *> Clauses, unsigned NumLoops, Stmt *AssociatedStmt,
471 Stmt *TransformedStmt, Stmt *PreInits) {
472 OMPInterchangeDirective *Dir = createDirective<OMPInterchangeDirective>(
473 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
474 NumLoops);
475 Dir->setTransformedStmt(TransformedStmt);
476 Dir->setPreInits(PreInits);
477 return Dir;
478}
479
482 unsigned NumLoops) {
483 return createEmptyDirective<OMPInterchangeDirective>(
484 C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1,
485 SourceLocation(), SourceLocation(), NumLoops);
486}
487
490 SourceLocation EndLoc, unsigned CollapsedNum,
491 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
492 const HelperExprs &Exprs) {
493 auto *Dir = createDirective<OMPForSimdDirective>(
494 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for_simd),
495 StartLoc, EndLoc, CollapsedNum);
496 Dir->setIterationVariable(Exprs.IterationVarRef);
497 Dir->setLastIteration(Exprs.LastIteration);
498 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
499 Dir->setPreCond(Exprs.PreCond);
500 Dir->setCond(Exprs.Cond);
501 Dir->setInit(Exprs.Init);
502 Dir->setInc(Exprs.Inc);
503 Dir->setIsLastIterVariable(Exprs.IL);
504 Dir->setLowerBoundVariable(Exprs.LB);
505 Dir->setUpperBoundVariable(Exprs.UB);
506 Dir->setStrideVariable(Exprs.ST);
507 Dir->setEnsureUpperBound(Exprs.EUB);
508 Dir->setNextLowerBound(Exprs.NLB);
509 Dir->setNextUpperBound(Exprs.NUB);
510 Dir->setNumIterations(Exprs.NumIterations);
511 Dir->setCounters(Exprs.Counters);
512 Dir->setPrivateCounters(Exprs.PrivateCounters);
513 Dir->setInits(Exprs.Inits);
514 Dir->setUpdates(Exprs.Updates);
515 Dir->setFinals(Exprs.Finals);
516 Dir->setDependentCounters(Exprs.DependentCounters);
517 Dir->setDependentInits(Exprs.DependentInits);
518 Dir->setFinalsConditions(Exprs.FinalsConditions);
519 Dir->setPreInits(Exprs.PreInits);
520 return Dir;
521}
522
524 unsigned NumClauses,
525 unsigned CollapsedNum,
526 EmptyShell) {
527 return createEmptyDirective<OMPForSimdDirective>(
528 C, NumClauses, /*HasAssociatedStmt=*/true,
529 numLoopChildren(CollapsedNum, OMPD_for_simd), CollapsedNum);
530}
531
533 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
534 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
535 bool HasCancel) {
536 auto *Dir = createDirective<OMPSectionsDirective>(C, Clauses, AssociatedStmt,
537 /*NumChildren=*/1, StartLoc,
538 EndLoc);
539 Dir->setTaskReductionRefExpr(TaskRedRef);
540 Dir->setHasCancel(HasCancel);
541 return Dir;
542}
543
545 unsigned NumClauses,
546 EmptyShell) {
547 return createEmptyDirective<OMPSectionsDirective>(C, NumClauses,
548 /*HasAssociatedStmt=*/true,
549 /*NumChildren=*/1);
550}
551
553 SourceLocation StartLoc,
554 SourceLocation EndLoc,
555 Stmt *AssociatedStmt,
556 bool HasCancel) {
557 auto *Dir =
558 createDirective<OMPSectionDirective>(C, std::nullopt, AssociatedStmt,
559 /*NumChildren=*/0, StartLoc, EndLoc);
560 Dir->setHasCancel(HasCancel);
561 return Dir;
562}
563
565 EmptyShell) {
566 return createEmptyDirective<OMPSectionDirective>(C, /*NumClauses=*/0,
567 /*HasAssociatedStmt=*/true);
568}
569
571 SourceLocation StartLoc,
572 SourceLocation EndLoc,
573 ArrayRef<OMPClause *> Clauses,
574 Stmt *AssociatedStmt) {
575 return createDirective<OMPScopeDirective>(C, Clauses, AssociatedStmt,
576 /*NumChildren=*/0, StartLoc,
577 EndLoc);
578}
579
581 unsigned NumClauses,
582 EmptyShell) {
583 return createEmptyDirective<OMPScopeDirective>(C, NumClauses,
584 /*HasAssociatedStmt=*/true);
585}
586
588 SourceLocation StartLoc,
589 SourceLocation EndLoc,
590 ArrayRef<OMPClause *> Clauses,
591 Stmt *AssociatedStmt) {
592 return createDirective<OMPSingleDirective>(C, Clauses, AssociatedStmt,
593 /*NumChildren=*/0, StartLoc,
594 EndLoc);
595}
596
598 unsigned NumClauses,
599 EmptyShell) {
600 return createEmptyDirective<OMPSingleDirective>(C, NumClauses,
601 /*HasAssociatedStmt=*/true);
602}
603
605 SourceLocation StartLoc,
606 SourceLocation EndLoc,
607 Stmt *AssociatedStmt) {
608 return createDirective<OMPMasterDirective>(C, std::nullopt, AssociatedStmt,
609 /*NumChildren=*/0, StartLoc,
610 EndLoc);
611}
612
614 EmptyShell) {
615 return createEmptyDirective<OMPMasterDirective>(C, /*NumClauses=*/0,
616 /*HasAssociatedStmt=*/true);
617}
618
620 const ASTContext &C, const DeclarationNameInfo &Name,
621 SourceLocation StartLoc, SourceLocation EndLoc,
622 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
623 return createDirective<OMPCriticalDirective>(C, Clauses, AssociatedStmt,
624 /*NumChildren=*/0, Name,
625 StartLoc, EndLoc);
626}
627
629 unsigned NumClauses,
630 EmptyShell) {
631 return createEmptyDirective<OMPCriticalDirective>(C, NumClauses,
632 /*HasAssociatedStmt=*/true);
633}
634
636 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
637 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
638 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
639 auto *Dir = createDirective<OMPParallelForDirective>(
640 C, Clauses, AssociatedStmt,
641 numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, StartLoc, EndLoc,
642 CollapsedNum);
643 Dir->setIterationVariable(Exprs.IterationVarRef);
644 Dir->setLastIteration(Exprs.LastIteration);
645 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
646 Dir->setPreCond(Exprs.PreCond);
647 Dir->setCond(Exprs.Cond);
648 Dir->setInit(Exprs.Init);
649 Dir->setInc(Exprs.Inc);
650 Dir->setIsLastIterVariable(Exprs.IL);
651 Dir->setLowerBoundVariable(Exprs.LB);
652 Dir->setUpperBoundVariable(Exprs.UB);
653 Dir->setStrideVariable(Exprs.ST);
654 Dir->setEnsureUpperBound(Exprs.EUB);
655 Dir->setNextLowerBound(Exprs.NLB);
656 Dir->setNextUpperBound(Exprs.NUB);
657 Dir->setNumIterations(Exprs.NumIterations);
658 Dir->setCounters(Exprs.Counters);
659 Dir->setPrivateCounters(Exprs.PrivateCounters);
660 Dir->setInits(Exprs.Inits);
661 Dir->setUpdates(Exprs.Updates);
662 Dir->setFinals(Exprs.Finals);
663 Dir->setDependentCounters(Exprs.DependentCounters);
664 Dir->setDependentInits(Exprs.DependentInits);
665 Dir->setFinalsConditions(Exprs.FinalsConditions);
666 Dir->setPreInits(Exprs.PreInits);
667 Dir->setTaskReductionRefExpr(TaskRedRef);
668 Dir->setHasCancel(HasCancel);
669 return Dir;
670}
671
674 unsigned CollapsedNum, EmptyShell) {
675 return createEmptyDirective<OMPParallelForDirective>(
676 C, NumClauses, /*HasAssociatedStmt=*/true,
677 numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, CollapsedNum);
678}
679
681 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
682 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
683 const HelperExprs &Exprs) {
684 auto *Dir = createDirective<OMPParallelForSimdDirective>(
685 C, Clauses, AssociatedStmt,
686 numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), StartLoc, EndLoc,
687 CollapsedNum);
688 Dir->setIterationVariable(Exprs.IterationVarRef);
689 Dir->setLastIteration(Exprs.LastIteration);
690 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
691 Dir->setPreCond(Exprs.PreCond);
692 Dir->setCond(Exprs.Cond);
693 Dir->setInit(Exprs.Init);
694 Dir->setInc(Exprs.Inc);
695 Dir->setIsLastIterVariable(Exprs.IL);
696 Dir->setLowerBoundVariable(Exprs.LB);
697 Dir->setUpperBoundVariable(Exprs.UB);
698 Dir->setStrideVariable(Exprs.ST);
699 Dir->setEnsureUpperBound(Exprs.EUB);
700 Dir->setNextLowerBound(Exprs.NLB);
701 Dir->setNextUpperBound(Exprs.NUB);
702 Dir->setNumIterations(Exprs.NumIterations);
703 Dir->setCounters(Exprs.Counters);
704 Dir->setPrivateCounters(Exprs.PrivateCounters);
705 Dir->setInits(Exprs.Inits);
706 Dir->setUpdates(Exprs.Updates);
707 Dir->setFinals(Exprs.Finals);
708 Dir->setDependentCounters(Exprs.DependentCounters);
709 Dir->setDependentInits(Exprs.DependentInits);
710 Dir->setFinalsConditions(Exprs.FinalsConditions);
711 Dir->setPreInits(Exprs.PreInits);
712 return Dir;
713}
714
717 unsigned NumClauses,
718 unsigned CollapsedNum, EmptyShell) {
719 return createEmptyDirective<OMPParallelForSimdDirective>(
720 C, NumClauses, /*HasAssociatedStmt=*/true,
721 numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), CollapsedNum);
722}
723
725 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
726 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) {
727 auto *Dir = createDirective<OMPParallelMasterDirective>(
728 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
729 Dir->setTaskReductionRefExpr(TaskRedRef);
730 return Dir;
731}
732
735 unsigned NumClauses, EmptyShell) {
736 return createEmptyDirective<OMPParallelMasterDirective>(
737 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
738}
739
741 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
742 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) {
743 auto *Dir = createDirective<OMPParallelMaskedDirective>(
744 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
745 Dir->setTaskReductionRefExpr(TaskRedRef);
746 return Dir;
747}
748
751 unsigned NumClauses, EmptyShell) {
752 return createEmptyDirective<OMPParallelMaskedDirective>(
753 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
754}
755
757 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
758 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
759 bool HasCancel) {
760 auto *Dir = createDirective<OMPParallelSectionsDirective>(
761 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
762 Dir->setTaskReductionRefExpr(TaskRedRef);
763 Dir->setHasCancel(HasCancel);
764 return Dir;
765}
766
769 unsigned NumClauses, EmptyShell) {
770 return createEmptyDirective<OMPParallelSectionsDirective>(
771 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
772}
773
777 Stmt *AssociatedStmt, bool HasCancel) {
778 auto *Dir = createDirective<OMPTaskDirective>(
779 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
780 Dir->setHasCancel(HasCancel);
781 return Dir;
782}
783
785 unsigned NumClauses,
786 EmptyShell) {
787 return createEmptyDirective<OMPTaskDirective>(C, NumClauses,
788 /*HasAssociatedStmt=*/true);
789}
790
792 SourceLocation StartLoc,
793 SourceLocation EndLoc) {
794 return new (C) OMPTaskyieldDirective(StartLoc, EndLoc);
795}
796
798 EmptyShell) {
799 return new (C) OMPTaskyieldDirective();
800}
801
803 SourceLocation StartLoc,
804 SourceLocation EndLoc,
805 ArrayRef<OMPClause *> Clauses,
806 Stmt *AStmt) {
807 return createDirective<OMPAssumeDirective>(C, Clauses, AStmt,
808 /*NumChildren=*/0, StartLoc,
809 EndLoc);
810}
811
813 unsigned NumClauses,
814 EmptyShell) {
815 return createEmptyDirective<OMPAssumeDirective>(C, NumClauses,
816 /*HasAssociatedStmt=*/true);
817}
818
820 SourceLocation StartLoc,
821 SourceLocation EndLoc,
822 ArrayRef<OMPClause *> Clauses) {
823 return createDirective<OMPErrorDirective>(
824 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
825 EndLoc);
826}
827
829 unsigned NumClauses,
830 EmptyShell) {
831 return createEmptyDirective<OMPErrorDirective>(C, NumClauses);
832}
833
835 SourceLocation StartLoc,
836 SourceLocation EndLoc) {
837 return new (C) OMPBarrierDirective(StartLoc, EndLoc);
838}
839
841 EmptyShell) {
842 return new (C) OMPBarrierDirective();
843}
844
847 SourceLocation EndLoc,
848 ArrayRef<OMPClause *> Clauses) {
849 return createDirective<OMPTaskwaitDirective>(
850 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
851 EndLoc);
852}
853
855 unsigned NumClauses,
856 EmptyShell) {
857 return createEmptyDirective<OMPTaskwaitDirective>(C, NumClauses);
858}
859
861 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
862 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) {
863 auto *Dir = createDirective<OMPTaskgroupDirective>(
864 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
865 Dir->setReductionRef(ReductionRef);
866 return Dir;
867}
868
870 unsigned NumClauses,
871 EmptyShell) {
872 return createEmptyDirective<OMPTaskgroupDirective>(
873 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
874}
875
877 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
878 OpenMPDirectiveKind CancelRegion) {
879 auto *Dir = new (C) OMPCancellationPointDirective(StartLoc, EndLoc);
880 Dir->setCancelRegion(CancelRegion);
881 return Dir;
882}
883
886 return new (C) OMPCancellationPointDirective();
887}
888
892 OpenMPDirectiveKind CancelRegion) {
893 auto *Dir = createDirective<OMPCancelDirective>(
894 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
895 EndLoc);
896 Dir->setCancelRegion(CancelRegion);
897 return Dir;
898}
899
901 unsigned NumClauses,
902 EmptyShell) {
903 return createEmptyDirective<OMPCancelDirective>(C, NumClauses);
904}
905
907 SourceLocation StartLoc,
908 SourceLocation EndLoc,
909 ArrayRef<OMPClause *> Clauses) {
910 return createDirective<OMPFlushDirective>(
911 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
912 EndLoc);
913}
914
916 unsigned NumClauses,
917 EmptyShell) {
918 return createEmptyDirective<OMPFlushDirective>(C, NumClauses);
919}
920
922 SourceLocation StartLoc,
923 SourceLocation EndLoc,
924 ArrayRef<OMPClause *> Clauses) {
925 return createDirective<OMPDepobjDirective>(
926 C, Clauses, /*AssociatedStmt=*/nullptr,
927 /*NumChildren=*/0, StartLoc, EndLoc);
928}
929
931 unsigned NumClauses,
932 EmptyShell) {
933 return createEmptyDirective<OMPDepobjDirective>(C, NumClauses);
934}
935
937 SourceLocation StartLoc,
938 SourceLocation EndLoc,
939 ArrayRef<OMPClause *> Clauses) {
940 return createDirective<OMPScanDirective>(C, Clauses,
941 /*AssociatedStmt=*/nullptr,
942 /*NumChildren=*/0, StartLoc, EndLoc);
943}
944
946 unsigned NumClauses,
947 EmptyShell) {
948 return createEmptyDirective<OMPScanDirective>(C, NumClauses);
949}
950
952 SourceLocation StartLoc,
953 SourceLocation EndLoc,
954 ArrayRef<OMPClause *> Clauses,
955 Stmt *AssociatedStmt) {
956 return createDirective<OMPOrderedDirective>(
957 C, Clauses, cast_or_null<CapturedStmt>(AssociatedStmt),
958 /*NumChildren=*/0, StartLoc, EndLoc);
959}
960
962 unsigned NumClauses,
963 bool IsStandalone,
964 EmptyShell) {
965 return createEmptyDirective<OMPOrderedDirective>(C, NumClauses,
966 !IsStandalone);
967}
968
972 Stmt *AssociatedStmt, Expressions Exprs) {
973 auto *Dir = createDirective<OMPAtomicDirective>(
974 C, Clauses, AssociatedStmt, /*NumChildren=*/7, StartLoc, EndLoc);
975 Dir->setX(Exprs.X);
976 Dir->setV(Exprs.V);
977 Dir->setR(Exprs.R);
978 Dir->setExpr(Exprs.E);
979 Dir->setUpdateExpr(Exprs.UE);
980 Dir->setD(Exprs.D);
981 Dir->setCond(Exprs.Cond);
982 Dir->Flags.IsXLHSInRHSPart = Exprs.IsXLHSInRHSPart ? 1 : 0;
983 Dir->Flags.IsPostfixUpdate = Exprs.IsPostfixUpdate ? 1 : 0;
984 Dir->Flags.IsFailOnly = Exprs.IsFailOnly ? 1 : 0;
985 return Dir;
986}
987
989 unsigned NumClauses,
990 EmptyShell) {
991 return createEmptyDirective<OMPAtomicDirective>(
992 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/7);
993}
994
996 SourceLocation StartLoc,
997 SourceLocation EndLoc,
998 ArrayRef<OMPClause *> Clauses,
999 Stmt *AssociatedStmt) {
1000 return createDirective<OMPTargetDirective>(
1001 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1002}
1003
1005 unsigned NumClauses,
1006 EmptyShell) {
1007 return createEmptyDirective<OMPTargetDirective>(C, NumClauses,
1008 /*HasAssociatedStmt=*/true);
1009}
1010
1012 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1013 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
1014 bool HasCancel) {
1015 auto *Dir = createDirective<OMPTargetParallelDirective>(
1016 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
1017 Dir->setTaskReductionRefExpr(TaskRedRef);
1018 Dir->setHasCancel(HasCancel);
1019 return Dir;
1020}
1021
1024 unsigned NumClauses, EmptyShell) {
1025 return createEmptyDirective<OMPTargetParallelDirective>(
1026 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
1027}
1028
1030 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1031 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1032 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1033 auto *Dir = createDirective<OMPTargetParallelForDirective>(
1034 C, Clauses, AssociatedStmt,
1035 numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1, StartLoc,
1036 EndLoc, CollapsedNum);
1037 Dir->setIterationVariable(Exprs.IterationVarRef);
1038 Dir->setLastIteration(Exprs.LastIteration);
1039 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1040 Dir->setPreCond(Exprs.PreCond);
1041 Dir->setCond(Exprs.Cond);
1042 Dir->setInit(Exprs.Init);
1043 Dir->setInc(Exprs.Inc);
1044 Dir->setIsLastIterVariable(Exprs.IL);
1045 Dir->setLowerBoundVariable(Exprs.LB);
1046 Dir->setUpperBoundVariable(Exprs.UB);
1047 Dir->setStrideVariable(Exprs.ST);
1048 Dir->setEnsureUpperBound(Exprs.EUB);
1049 Dir->setNextLowerBound(Exprs.NLB);
1050 Dir->setNextUpperBound(Exprs.NUB);
1051 Dir->setNumIterations(Exprs.NumIterations);
1052 Dir->setCounters(Exprs.Counters);
1053 Dir->setPrivateCounters(Exprs.PrivateCounters);
1054 Dir->setInits(Exprs.Inits);
1055 Dir->setUpdates(Exprs.Updates);
1056 Dir->setFinals(Exprs.Finals);
1057 Dir->setDependentCounters(Exprs.DependentCounters);
1058 Dir->setDependentInits(Exprs.DependentInits);
1059 Dir->setFinalsConditions(Exprs.FinalsConditions);
1060 Dir->setPreInits(Exprs.PreInits);
1061 Dir->setTaskReductionRefExpr(TaskRedRef);
1062 Dir->setHasCancel(HasCancel);
1063 return Dir;
1064}
1065
1068 unsigned NumClauses,
1069 unsigned CollapsedNum, EmptyShell) {
1070 return createEmptyDirective<OMPTargetParallelForDirective>(
1071 C, NumClauses, /*HasAssociatedStmt=*/true,
1072 numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1,
1073 CollapsedNum);
1074}
1075
1077 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1078 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1079 return createDirective<OMPTargetDataDirective>(
1080 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1081}
1082
1084 unsigned N,
1085 EmptyShell) {
1086 return createEmptyDirective<OMPTargetDataDirective>(
1087 C, N, /*HasAssociatedStmt=*/true);
1088}
1089
1091 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1092 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1093 return createDirective<OMPTargetEnterDataDirective>(
1094 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1095}
1096
1099 EmptyShell) {
1100 return createEmptyDirective<OMPTargetEnterDataDirective>(
1101 C, N, /*HasAssociatedStmt=*/true);
1102}
1103
1105 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1106 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1107 return createDirective<OMPTargetExitDataDirective>(
1108 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1109}
1110
1113 EmptyShell) {
1114 return createEmptyDirective<OMPTargetExitDataDirective>(
1115 C, N, /*HasAssociatedStmt=*/true);
1116}
1117
1119 SourceLocation StartLoc,
1120 SourceLocation EndLoc,
1121 ArrayRef<OMPClause *> Clauses,
1122 Stmt *AssociatedStmt) {
1123 return createDirective<OMPTeamsDirective>(
1124 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1125}
1126
1128 unsigned NumClauses,
1129 EmptyShell) {
1130 return createEmptyDirective<OMPTeamsDirective>(C, NumClauses,
1131 /*HasAssociatedStmt=*/true);
1132}
1133
1135 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1136 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1137 const HelperExprs &Exprs, bool HasCancel) {
1138 auto *Dir = createDirective<OMPTaskLoopDirective>(
1139 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_taskloop),
1140 StartLoc, EndLoc, CollapsedNum);
1141 Dir->setIterationVariable(Exprs.IterationVarRef);
1142 Dir->setLastIteration(Exprs.LastIteration);
1143 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1144 Dir->setPreCond(Exprs.PreCond);
1145 Dir->setCond(Exprs.Cond);
1146 Dir->setInit(Exprs.Init);
1147 Dir->setInc(Exprs.Inc);
1148 Dir->setIsLastIterVariable(Exprs.IL);
1149 Dir->setLowerBoundVariable(Exprs.LB);
1150 Dir->setUpperBoundVariable(Exprs.UB);
1151 Dir->setStrideVariable(Exprs.ST);
1152 Dir->setEnsureUpperBound(Exprs.EUB);
1153 Dir->setNextLowerBound(Exprs.NLB);
1154 Dir->setNextUpperBound(Exprs.NUB);
1155 Dir->setNumIterations(Exprs.NumIterations);
1156 Dir->setCounters(Exprs.Counters);
1157 Dir->setPrivateCounters(Exprs.PrivateCounters);
1158 Dir->setInits(Exprs.Inits);
1159 Dir->setUpdates(Exprs.Updates);
1160 Dir->setFinals(Exprs.Finals);
1161 Dir->setDependentCounters(Exprs.DependentCounters);
1162 Dir->setDependentInits(Exprs.DependentInits);
1163 Dir->setFinalsConditions(Exprs.FinalsConditions);
1164 Dir->setPreInits(Exprs.PreInits);
1165 Dir->setHasCancel(HasCancel);
1166 return Dir;
1167}
1168
1170 unsigned NumClauses,
1171 unsigned CollapsedNum,
1172 EmptyShell) {
1173 return createEmptyDirective<OMPTaskLoopDirective>(
1174 C, NumClauses, /*HasAssociatedStmt=*/true,
1175 numLoopChildren(CollapsedNum, OMPD_taskloop), CollapsedNum);
1176}
1177
1179 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1180 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1181 const HelperExprs &Exprs) {
1182 auto *Dir = createDirective<OMPTaskLoopSimdDirective>(
1183 C, Clauses, AssociatedStmt,
1184 numLoopChildren(CollapsedNum, OMPD_taskloop_simd), StartLoc, EndLoc,
1185 CollapsedNum);
1186 Dir->setIterationVariable(Exprs.IterationVarRef);
1187 Dir->setLastIteration(Exprs.LastIteration);
1188 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1189 Dir->setPreCond(Exprs.PreCond);
1190 Dir->setCond(Exprs.Cond);
1191 Dir->setInit(Exprs.Init);
1192 Dir->setInc(Exprs.Inc);
1193 Dir->setIsLastIterVariable(Exprs.IL);
1194 Dir->setLowerBoundVariable(Exprs.LB);
1195 Dir->setUpperBoundVariable(Exprs.UB);
1196 Dir->setStrideVariable(Exprs.ST);
1197 Dir->setEnsureUpperBound(Exprs.EUB);
1198 Dir->setNextLowerBound(Exprs.NLB);
1199 Dir->setNextUpperBound(Exprs.NUB);
1200 Dir->setNumIterations(Exprs.NumIterations);
1201 Dir->setCounters(Exprs.Counters);
1202 Dir->setPrivateCounters(Exprs.PrivateCounters);
1203 Dir->setInits(Exprs.Inits);
1204 Dir->setUpdates(Exprs.Updates);
1205 Dir->setFinals(Exprs.Finals);
1206 Dir->setDependentCounters(Exprs.DependentCounters);
1207 Dir->setDependentInits(Exprs.DependentInits);
1208 Dir->setFinalsConditions(Exprs.FinalsConditions);
1209 Dir->setPreInits(Exprs.PreInits);
1210 return Dir;
1211}
1212
1215 unsigned CollapsedNum, EmptyShell) {
1216 return createEmptyDirective<OMPTaskLoopSimdDirective>(
1217 C, NumClauses, /*HasAssociatedStmt=*/true,
1218 numLoopChildren(CollapsedNum, OMPD_taskloop_simd), CollapsedNum);
1219}
1220
1222 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1223 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1224 const HelperExprs &Exprs, bool HasCancel) {
1225 auto *Dir = createDirective<OMPMasterTaskLoopDirective>(
1226 C, Clauses, AssociatedStmt,
1227 numLoopChildren(CollapsedNum, OMPD_master_taskloop), StartLoc, EndLoc,
1228 CollapsedNum);
1229 Dir->setIterationVariable(Exprs.IterationVarRef);
1230 Dir->setLastIteration(Exprs.LastIteration);
1231 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1232 Dir->setPreCond(Exprs.PreCond);
1233 Dir->setCond(Exprs.Cond);
1234 Dir->setInit(Exprs.Init);
1235 Dir->setInc(Exprs.Inc);
1236 Dir->setIsLastIterVariable(Exprs.IL);
1237 Dir->setLowerBoundVariable(Exprs.LB);
1238 Dir->setUpperBoundVariable(Exprs.UB);
1239 Dir->setStrideVariable(Exprs.ST);
1240 Dir->setEnsureUpperBound(Exprs.EUB);
1241 Dir->setNextLowerBound(Exprs.NLB);
1242 Dir->setNextUpperBound(Exprs.NUB);
1243 Dir->setNumIterations(Exprs.NumIterations);
1244 Dir->setCounters(Exprs.Counters);
1245 Dir->setPrivateCounters(Exprs.PrivateCounters);
1246 Dir->setInits(Exprs.Inits);
1247 Dir->setUpdates(Exprs.Updates);
1248 Dir->setFinals(Exprs.Finals);
1249 Dir->setDependentCounters(Exprs.DependentCounters);
1250 Dir->setDependentInits(Exprs.DependentInits);
1251 Dir->setFinalsConditions(Exprs.FinalsConditions);
1252 Dir->setPreInits(Exprs.PreInits);
1253 Dir->setHasCancel(HasCancel);
1254 return Dir;
1255}
1256
1259 unsigned NumClauses,
1260 unsigned CollapsedNum, EmptyShell) {
1261 return createEmptyDirective<OMPMasterTaskLoopDirective>(
1262 C, NumClauses, /*HasAssociatedStmt=*/true,
1263 numLoopChildren(CollapsedNum, OMPD_master_taskloop), CollapsedNum);
1264}
1265
1267 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1268 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1269 const HelperExprs &Exprs, bool HasCancel) {
1270 auto *Dir = createDirective<OMPMaskedTaskLoopDirective>(
1271 C, Clauses, AssociatedStmt,
1272 numLoopChildren(CollapsedNum, OMPD_masked_taskloop), StartLoc, EndLoc,
1273 CollapsedNum);
1274 Dir->setIterationVariable(Exprs.IterationVarRef);
1275 Dir->setLastIteration(Exprs.LastIteration);
1276 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1277 Dir->setPreCond(Exprs.PreCond);
1278 Dir->setCond(Exprs.Cond);
1279 Dir->setInit(Exprs.Init);
1280 Dir->setInc(Exprs.Inc);
1281 Dir->setIsLastIterVariable(Exprs.IL);
1282 Dir->setLowerBoundVariable(Exprs.LB);
1283 Dir->setUpperBoundVariable(Exprs.UB);
1284 Dir->setStrideVariable(Exprs.ST);
1285 Dir->setEnsureUpperBound(Exprs.EUB);
1286 Dir->setNextLowerBound(Exprs.NLB);
1287 Dir->setNextUpperBound(Exprs.NUB);
1288 Dir->setNumIterations(Exprs.NumIterations);
1289 Dir->setCounters(Exprs.Counters);
1290 Dir->setPrivateCounters(Exprs.PrivateCounters);
1291 Dir->setInits(Exprs.Inits);
1292 Dir->setUpdates(Exprs.Updates);
1293 Dir->setFinals(Exprs.Finals);
1294 Dir->setDependentCounters(Exprs.DependentCounters);
1295 Dir->setDependentInits(Exprs.DependentInits);
1296 Dir->setFinalsConditions(Exprs.FinalsConditions);
1297 Dir->setPreInits(Exprs.PreInits);
1298 Dir->setHasCancel(HasCancel);
1299 return Dir;
1300}
1301
1304 unsigned NumClauses,
1305 unsigned CollapsedNum, EmptyShell) {
1306 return createEmptyDirective<OMPMaskedTaskLoopDirective>(
1307 C, NumClauses, /*HasAssociatedStmt=*/true,
1308 numLoopChildren(CollapsedNum, OMPD_masked_taskloop), CollapsedNum);
1309}
1310
1312 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1313 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1314 const HelperExprs &Exprs) {
1315 auto *Dir = createDirective<OMPMasterTaskLoopSimdDirective>(
1316 C, Clauses, AssociatedStmt,
1317 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), StartLoc,
1318 EndLoc, CollapsedNum);
1319 Dir->setIterationVariable(Exprs.IterationVarRef);
1320 Dir->setLastIteration(Exprs.LastIteration);
1321 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1322 Dir->setPreCond(Exprs.PreCond);
1323 Dir->setCond(Exprs.Cond);
1324 Dir->setInit(Exprs.Init);
1325 Dir->setInc(Exprs.Inc);
1326 Dir->setIsLastIterVariable(Exprs.IL);
1327 Dir->setLowerBoundVariable(Exprs.LB);
1328 Dir->setUpperBoundVariable(Exprs.UB);
1329 Dir->setStrideVariable(Exprs.ST);
1330 Dir->setEnsureUpperBound(Exprs.EUB);
1331 Dir->setNextLowerBound(Exprs.NLB);
1332 Dir->setNextUpperBound(Exprs.NUB);
1333 Dir->setNumIterations(Exprs.NumIterations);
1334 Dir->setCounters(Exprs.Counters);
1335 Dir->setPrivateCounters(Exprs.PrivateCounters);
1336 Dir->setInits(Exprs.Inits);
1337 Dir->setUpdates(Exprs.Updates);
1338 Dir->setFinals(Exprs.Finals);
1339 Dir->setDependentCounters(Exprs.DependentCounters);
1340 Dir->setDependentInits(Exprs.DependentInits);
1341 Dir->setFinalsConditions(Exprs.FinalsConditions);
1342 Dir->setPreInits(Exprs.PreInits);
1343 return Dir;
1344}
1345
1348 unsigned NumClauses,
1349 unsigned CollapsedNum, EmptyShell) {
1350 return createEmptyDirective<OMPMasterTaskLoopSimdDirective>(
1351 C, NumClauses, /*HasAssociatedStmt=*/true,
1352 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), CollapsedNum);
1353}
1354
1356 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1357 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1358 const HelperExprs &Exprs) {
1359 auto *Dir = createDirective<OMPMaskedTaskLoopSimdDirective>(
1360 C, Clauses, AssociatedStmt,
1361 numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), StartLoc,
1362 EndLoc, CollapsedNum);
1363 Dir->setIterationVariable(Exprs.IterationVarRef);
1364 Dir->setLastIteration(Exprs.LastIteration);
1365 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1366 Dir->setPreCond(Exprs.PreCond);
1367 Dir->setCond(Exprs.Cond);
1368 Dir->setInit(Exprs.Init);
1369 Dir->setInc(Exprs.Inc);
1370 Dir->setIsLastIterVariable(Exprs.IL);
1371 Dir->setLowerBoundVariable(Exprs.LB);
1372 Dir->setUpperBoundVariable(Exprs.UB);
1373 Dir->setStrideVariable(Exprs.ST);
1374 Dir->setEnsureUpperBound(Exprs.EUB);
1375 Dir->setNextLowerBound(Exprs.NLB);
1376 Dir->setNextUpperBound(Exprs.NUB);
1377 Dir->setNumIterations(Exprs.NumIterations);
1378 Dir->setCounters(Exprs.Counters);
1379 Dir->setPrivateCounters(Exprs.PrivateCounters);
1380 Dir->setInits(Exprs.Inits);
1381 Dir->setUpdates(Exprs.Updates);
1382 Dir->setFinals(Exprs.Finals);
1383 Dir->setDependentCounters(Exprs.DependentCounters);
1384 Dir->setDependentInits(Exprs.DependentInits);
1385 Dir->setFinalsConditions(Exprs.FinalsConditions);
1386 Dir->setPreInits(Exprs.PreInits);
1387 return Dir;
1388}
1389
1392 unsigned NumClauses,
1393 unsigned CollapsedNum, EmptyShell) {
1394 return createEmptyDirective<OMPMaskedTaskLoopSimdDirective>(
1395 C, NumClauses, /*HasAssociatedStmt=*/true,
1396 numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), CollapsedNum);
1397}
1398
1400 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1401 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1402 const HelperExprs &Exprs, bool HasCancel) {
1403 auto *Dir = createDirective<OMPParallelMasterTaskLoopDirective>(
1404 C, Clauses, AssociatedStmt,
1405 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop), StartLoc,
1406 EndLoc, CollapsedNum);
1407 Dir->setIterationVariable(Exprs.IterationVarRef);
1408 Dir->setLastIteration(Exprs.LastIteration);
1409 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1410 Dir->setPreCond(Exprs.PreCond);
1411 Dir->setCond(Exprs.Cond);
1412 Dir->setInit(Exprs.Init);
1413 Dir->setInc(Exprs.Inc);
1414 Dir->setIsLastIterVariable(Exprs.IL);
1415 Dir->setLowerBoundVariable(Exprs.LB);
1416 Dir->setUpperBoundVariable(Exprs.UB);
1417 Dir->setStrideVariable(Exprs.ST);
1418 Dir->setEnsureUpperBound(Exprs.EUB);
1419 Dir->setNextLowerBound(Exprs.NLB);
1420 Dir->setNextUpperBound(Exprs.NUB);
1421 Dir->setNumIterations(Exprs.NumIterations);
1422 Dir->setCounters(Exprs.Counters);
1423 Dir->setPrivateCounters(Exprs.PrivateCounters);
1424 Dir->setInits(Exprs.Inits);
1425 Dir->setUpdates(Exprs.Updates);
1426 Dir->setFinals(Exprs.Finals);
1427 Dir->setDependentCounters(Exprs.DependentCounters);
1428 Dir->setDependentInits(Exprs.DependentInits);
1429 Dir->setFinalsConditions(Exprs.FinalsConditions);
1430 Dir->setPreInits(Exprs.PreInits);
1431 Dir->setHasCancel(HasCancel);
1432 return Dir;
1433}
1434
1437 unsigned NumClauses,
1438 unsigned CollapsedNum,
1439 EmptyShell) {
1440 return createEmptyDirective<OMPParallelMasterTaskLoopDirective>(
1441 C, NumClauses, /*HasAssociatedStmt=*/true,
1442 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop),
1443 CollapsedNum);
1444}
1445
1447 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1448 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1449 const HelperExprs &Exprs, bool HasCancel) {
1450 auto *Dir = createDirective<OMPParallelMaskedTaskLoopDirective>(
1451 C, Clauses, AssociatedStmt,
1452 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop), StartLoc,
1453 EndLoc, CollapsedNum);
1454 Dir->setIterationVariable(Exprs.IterationVarRef);
1455 Dir->setLastIteration(Exprs.LastIteration);
1456 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1457 Dir->setPreCond(Exprs.PreCond);
1458 Dir->setCond(Exprs.Cond);
1459 Dir->setInit(Exprs.Init);
1460 Dir->setInc(Exprs.Inc);
1461 Dir->setIsLastIterVariable(Exprs.IL);
1462 Dir->setLowerBoundVariable(Exprs.LB);
1463 Dir->setUpperBoundVariable(Exprs.UB);
1464 Dir->setStrideVariable(Exprs.ST);
1465 Dir->setEnsureUpperBound(Exprs.EUB);
1466 Dir->setNextLowerBound(Exprs.NLB);
1467 Dir->setNextUpperBound(Exprs.NUB);
1468 Dir->setNumIterations(Exprs.NumIterations);
1469 Dir->setCounters(Exprs.Counters);
1470 Dir->setPrivateCounters(Exprs.PrivateCounters);
1471 Dir->setInits(Exprs.Inits);
1472 Dir->setUpdates(Exprs.Updates);
1473 Dir->setFinals(Exprs.Finals);
1474 Dir->setDependentCounters(Exprs.DependentCounters);
1475 Dir->setDependentInits(Exprs.DependentInits);
1476 Dir->setFinalsConditions(Exprs.FinalsConditions);
1477 Dir->setPreInits(Exprs.PreInits);
1478 Dir->setHasCancel(HasCancel);
1479 return Dir;
1480}
1481
1484 unsigned NumClauses,
1485 unsigned CollapsedNum,
1486 EmptyShell) {
1487 return createEmptyDirective<OMPParallelMaskedTaskLoopDirective>(
1488 C, NumClauses, /*HasAssociatedStmt=*/true,
1489 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop),
1490 CollapsedNum);
1491}
1492
1495 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1496 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1497 const HelperExprs &Exprs) {
1498 auto *Dir = createDirective<OMPParallelMasterTaskLoopSimdDirective>(
1499 C, Clauses, AssociatedStmt,
1500 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),
1501 StartLoc, EndLoc, CollapsedNum);
1502 Dir->setIterationVariable(Exprs.IterationVarRef);
1503 Dir->setLastIteration(Exprs.LastIteration);
1504 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1505 Dir->setPreCond(Exprs.PreCond);
1506 Dir->setCond(Exprs.Cond);
1507 Dir->setInit(Exprs.Init);
1508 Dir->setInc(Exprs.Inc);
1509 Dir->setIsLastIterVariable(Exprs.IL);
1510 Dir->setLowerBoundVariable(Exprs.LB);
1511 Dir->setUpperBoundVariable(Exprs.UB);
1512 Dir->setStrideVariable(Exprs.ST);
1513 Dir->setEnsureUpperBound(Exprs.EUB);
1514 Dir->setNextLowerBound(Exprs.NLB);
1515 Dir->setNextUpperBound(Exprs.NUB);
1516 Dir->setNumIterations(Exprs.NumIterations);
1517 Dir->setCounters(Exprs.Counters);
1518 Dir->setPrivateCounters(Exprs.PrivateCounters);
1519 Dir->setInits(Exprs.Inits);
1520 Dir->setUpdates(Exprs.Updates);
1521 Dir->setFinals(Exprs.Finals);
1522 Dir->setDependentCounters(Exprs.DependentCounters);
1523 Dir->setDependentInits(Exprs.DependentInits);
1524 Dir->setFinalsConditions(Exprs.FinalsConditions);
1525 Dir->setPreInits(Exprs.PreInits);
1526 return Dir;
1527}
1528
1531 unsigned NumClauses,
1532 unsigned CollapsedNum,
1533 EmptyShell) {
1534 return createEmptyDirective<OMPParallelMasterTaskLoopSimdDirective>(
1535 C, NumClauses, /*HasAssociatedStmt=*/true,
1536 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),
1537 CollapsedNum);
1538}
1539
1542 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1543 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1544 const HelperExprs &Exprs) {
1545 auto *Dir = createDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1546 C, Clauses, AssociatedStmt,
1547 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd),
1548 StartLoc, EndLoc, CollapsedNum);
1549 Dir->setIterationVariable(Exprs.IterationVarRef);
1550 Dir->setLastIteration(Exprs.LastIteration);
1551 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1552 Dir->setPreCond(Exprs.PreCond);
1553 Dir->setCond(Exprs.Cond);
1554 Dir->setInit(Exprs.Init);
1555 Dir->setInc(Exprs.Inc);
1556 Dir->setIsLastIterVariable(Exprs.IL);
1557 Dir->setLowerBoundVariable(Exprs.LB);
1558 Dir->setUpperBoundVariable(Exprs.UB);
1559 Dir->setStrideVariable(Exprs.ST);
1560 Dir->setEnsureUpperBound(Exprs.EUB);
1561 Dir->setNextLowerBound(Exprs.NLB);
1562 Dir->setNextUpperBound(Exprs.NUB);
1563 Dir->setNumIterations(Exprs.NumIterations);
1564 Dir->setCounters(Exprs.Counters);
1565 Dir->setPrivateCounters(Exprs.PrivateCounters);
1566 Dir->setInits(Exprs.Inits);
1567 Dir->setUpdates(Exprs.Updates);
1568 Dir->setFinals(Exprs.Finals);
1569 Dir->setDependentCounters(Exprs.DependentCounters);
1570 Dir->setDependentInits(Exprs.DependentInits);
1571 Dir->setFinalsConditions(Exprs.FinalsConditions);
1572 Dir->setPreInits(Exprs.PreInits);
1573 return Dir;
1574}
1575
1578 unsigned NumClauses,
1579 unsigned CollapsedNum,
1580 EmptyShell) {
1581 return createEmptyDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1582 C, NumClauses, /*HasAssociatedStmt=*/true,
1583 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd),
1584 CollapsedNum);
1585}
1586
1589 SourceLocation EndLoc, unsigned CollapsedNum,
1590 ArrayRef<OMPClause *> Clauses,
1591 Stmt *AssociatedStmt, const HelperExprs &Exprs) {
1592 auto *Dir = createDirective<OMPDistributeDirective>(
1593 C, Clauses, AssociatedStmt,
1594 numLoopChildren(CollapsedNum, OMPD_distribute), StartLoc, EndLoc,
1595 CollapsedNum);
1596 Dir->setIterationVariable(Exprs.IterationVarRef);
1597 Dir->setLastIteration(Exprs.LastIteration);
1598 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1599 Dir->setPreCond(Exprs.PreCond);
1600 Dir->setCond(Exprs.Cond);
1601 Dir->setInit(Exprs.Init);
1602 Dir->setInc(Exprs.Inc);
1603 Dir->setIsLastIterVariable(Exprs.IL);
1604 Dir->setLowerBoundVariable(Exprs.LB);
1605 Dir->setUpperBoundVariable(Exprs.UB);
1606 Dir->setStrideVariable(Exprs.ST);
1607 Dir->setEnsureUpperBound(Exprs.EUB);
1608 Dir->setNextLowerBound(Exprs.NLB);
1609 Dir->setNextUpperBound(Exprs.NUB);
1610 Dir->setNumIterations(Exprs.NumIterations);
1611 Dir->setCounters(Exprs.Counters);
1612 Dir->setPrivateCounters(Exprs.PrivateCounters);
1613 Dir->setInits(Exprs.Inits);
1614 Dir->setUpdates(Exprs.Updates);
1615 Dir->setFinals(Exprs.Finals);
1616 Dir->setDependentCounters(Exprs.DependentCounters);
1617 Dir->setDependentInits(Exprs.DependentInits);
1618 Dir->setFinalsConditions(Exprs.FinalsConditions);
1619 Dir->setPreInits(Exprs.PreInits);
1620 return Dir;
1621}
1622
1625 unsigned CollapsedNum, EmptyShell) {
1626 return createEmptyDirective<OMPDistributeDirective>(
1627 C, NumClauses, /*HasAssociatedStmt=*/true,
1628 numLoopChildren(CollapsedNum, OMPD_distribute), CollapsedNum);
1629}
1630
1632 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1633 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1634 return createDirective<OMPTargetUpdateDirective>(C, Clauses, AssociatedStmt,
1635 /*NumChildren=*/0, StartLoc,
1636 EndLoc);
1637}
1638
1641 EmptyShell) {
1642 return createEmptyDirective<OMPTargetUpdateDirective>(
1643 C, NumClauses, /*HasAssociatedStmt=*/true);
1644}
1645
1647 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1648 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1649 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1650 auto *Dir = createDirective<OMPDistributeParallelForDirective>(
1651 C, Clauses, AssociatedStmt,
1652 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1, StartLoc,
1653 EndLoc, CollapsedNum);
1654 Dir->setIterationVariable(Exprs.IterationVarRef);
1655 Dir->setLastIteration(Exprs.LastIteration);
1656 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1657 Dir->setPreCond(Exprs.PreCond);
1658 Dir->setCond(Exprs.Cond);
1659 Dir->setInit(Exprs.Init);
1660 Dir->setInc(Exprs.Inc);
1661 Dir->setIsLastIterVariable(Exprs.IL);
1662 Dir->setLowerBoundVariable(Exprs.LB);
1663 Dir->setUpperBoundVariable(Exprs.UB);
1664 Dir->setStrideVariable(Exprs.ST);
1665 Dir->setEnsureUpperBound(Exprs.EUB);
1666 Dir->setNextLowerBound(Exprs.NLB);
1667 Dir->setNextUpperBound(Exprs.NUB);
1668 Dir->setNumIterations(Exprs.NumIterations);
1669 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1670 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1671 Dir->setDistInc(Exprs.DistInc);
1672 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1673 Dir->setCounters(Exprs.Counters);
1674 Dir->setPrivateCounters(Exprs.PrivateCounters);
1675 Dir->setInits(Exprs.Inits);
1676 Dir->setUpdates(Exprs.Updates);
1677 Dir->setFinals(Exprs.Finals);
1678 Dir->setDependentCounters(Exprs.DependentCounters);
1679 Dir->setDependentInits(Exprs.DependentInits);
1680 Dir->setFinalsConditions(Exprs.FinalsConditions);
1681 Dir->setPreInits(Exprs.PreInits);
1682 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1683 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1684 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1685 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1686 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1687 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1688 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1689 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1690 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1691 Dir->setTaskReductionRefExpr(TaskRedRef);
1692 Dir->HasCancel = HasCancel;
1693 return Dir;
1694}
1695
1698 unsigned NumClauses,
1699 unsigned CollapsedNum,
1700 EmptyShell) {
1701 return createEmptyDirective<OMPDistributeParallelForDirective>(
1702 C, NumClauses, /*HasAssociatedStmt=*/true,
1703 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1,
1704 CollapsedNum);
1705}
1706
1709 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1710 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1711 const HelperExprs &Exprs) {
1712 auto *Dir = createDirective<OMPDistributeParallelForSimdDirective>(
1713 C, Clauses, AssociatedStmt,
1714 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),
1715 StartLoc, EndLoc, CollapsedNum);
1716 Dir->setIterationVariable(Exprs.IterationVarRef);
1717 Dir->setLastIteration(Exprs.LastIteration);
1718 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1719 Dir->setPreCond(Exprs.PreCond);
1720 Dir->setCond(Exprs.Cond);
1721 Dir->setInit(Exprs.Init);
1722 Dir->setInc(Exprs.Inc);
1723 Dir->setIsLastIterVariable(Exprs.IL);
1724 Dir->setLowerBoundVariable(Exprs.LB);
1725 Dir->setUpperBoundVariable(Exprs.UB);
1726 Dir->setStrideVariable(Exprs.ST);
1727 Dir->setEnsureUpperBound(Exprs.EUB);
1728 Dir->setNextLowerBound(Exprs.NLB);
1729 Dir->setNextUpperBound(Exprs.NUB);
1730 Dir->setNumIterations(Exprs.NumIterations);
1731 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1732 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1733 Dir->setDistInc(Exprs.DistInc);
1734 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1735 Dir->setCounters(Exprs.Counters);
1736 Dir->setPrivateCounters(Exprs.PrivateCounters);
1737 Dir->setInits(Exprs.Inits);
1738 Dir->setUpdates(Exprs.Updates);
1739 Dir->setFinals(Exprs.Finals);
1740 Dir->setDependentCounters(Exprs.DependentCounters);
1741 Dir->setDependentInits(Exprs.DependentInits);
1742 Dir->setFinalsConditions(Exprs.FinalsConditions);
1743 Dir->setPreInits(Exprs.PreInits);
1744 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1745 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1746 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1747 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1748 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1749 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1750 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1751 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1752 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1753 return Dir;
1754}
1755
1758 unsigned NumClauses,
1759 unsigned CollapsedNum,
1760 EmptyShell) {
1761 return createEmptyDirective<OMPDistributeParallelForSimdDirective>(
1762 C, NumClauses, /*HasAssociatedStmt=*/true,
1763 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),
1764 CollapsedNum);
1765}
1766
1768 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1769 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1770 const HelperExprs &Exprs) {
1771 auto *Dir = createDirective<OMPDistributeSimdDirective>(
1772 C, Clauses, AssociatedStmt,
1773 numLoopChildren(CollapsedNum, OMPD_distribute_simd), StartLoc, EndLoc,
1774 CollapsedNum);
1775 Dir->setIterationVariable(Exprs.IterationVarRef);
1776 Dir->setLastIteration(Exprs.LastIteration);
1777 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1778 Dir->setPreCond(Exprs.PreCond);
1779 Dir->setCond(Exprs.Cond);
1780 Dir->setInit(Exprs.Init);
1781 Dir->setInc(Exprs.Inc);
1782 Dir->setIsLastIterVariable(Exprs.IL);
1783 Dir->setLowerBoundVariable(Exprs.LB);
1784 Dir->setUpperBoundVariable(Exprs.UB);
1785 Dir->setStrideVariable(Exprs.ST);
1786 Dir->setEnsureUpperBound(Exprs.EUB);
1787 Dir->setNextLowerBound(Exprs.NLB);
1788 Dir->setNextUpperBound(Exprs.NUB);
1789 Dir->setNumIterations(Exprs.NumIterations);
1790 Dir->setCounters(Exprs.Counters);
1791 Dir->setPrivateCounters(Exprs.PrivateCounters);
1792 Dir->setInits(Exprs.Inits);
1793 Dir->setUpdates(Exprs.Updates);
1794 Dir->setFinals(Exprs.Finals);
1795 Dir->setDependentCounters(Exprs.DependentCounters);
1796 Dir->setDependentInits(Exprs.DependentInits);
1797 Dir->setFinalsConditions(Exprs.FinalsConditions);
1798 Dir->setPreInits(Exprs.PreInits);
1799 return Dir;
1800}
1801
1804 unsigned NumClauses,
1805 unsigned CollapsedNum, EmptyShell) {
1806 return createEmptyDirective<OMPDistributeSimdDirective>(
1807 C, NumClauses, /*HasAssociatedStmt=*/true,
1808 numLoopChildren(CollapsedNum, OMPD_distribute_simd), CollapsedNum);
1809}
1810
1812 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1813 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1814 const HelperExprs &Exprs) {
1815 auto *Dir = createDirective<OMPTargetParallelForSimdDirective>(
1816 C, Clauses, AssociatedStmt,
1817 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd), StartLoc,
1818 EndLoc, CollapsedNum);
1819 Dir->setIterationVariable(Exprs.IterationVarRef);
1820 Dir->setLastIteration(Exprs.LastIteration);
1821 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1822 Dir->setPreCond(Exprs.PreCond);
1823 Dir->setCond(Exprs.Cond);
1824 Dir->setInit(Exprs.Init);
1825 Dir->setInc(Exprs.Inc);
1826 Dir->setIsLastIterVariable(Exprs.IL);
1827 Dir->setLowerBoundVariable(Exprs.LB);
1828 Dir->setUpperBoundVariable(Exprs.UB);
1829 Dir->setStrideVariable(Exprs.ST);
1830 Dir->setEnsureUpperBound(Exprs.EUB);
1831 Dir->setNextLowerBound(Exprs.NLB);
1832 Dir->setNextUpperBound(Exprs.NUB);
1833 Dir->setNumIterations(Exprs.NumIterations);
1834 Dir->setCounters(Exprs.Counters);
1835 Dir->setPrivateCounters(Exprs.PrivateCounters);
1836 Dir->setInits(Exprs.Inits);
1837 Dir->setUpdates(Exprs.Updates);
1838 Dir->setFinals(Exprs.Finals);
1839 Dir->setDependentCounters(Exprs.DependentCounters);
1840 Dir->setDependentInits(Exprs.DependentInits);
1841 Dir->setFinalsConditions(Exprs.FinalsConditions);
1842 Dir->setPreInits(Exprs.PreInits);
1843 return Dir;
1844}
1845
1848 unsigned NumClauses,
1849 unsigned CollapsedNum,
1850 EmptyShell) {
1851 return createEmptyDirective<OMPTargetParallelForSimdDirective>(
1852 C, NumClauses, /*HasAssociatedStmt=*/true,
1853 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd),
1854 CollapsedNum);
1855}
1856
1859 SourceLocation EndLoc, unsigned CollapsedNum,
1860 ArrayRef<OMPClause *> Clauses,
1861 Stmt *AssociatedStmt, const HelperExprs &Exprs) {
1862 auto *Dir = createDirective<OMPTargetSimdDirective>(
1863 C, Clauses, AssociatedStmt,
1864 numLoopChildren(CollapsedNum, OMPD_target_simd), StartLoc, EndLoc,
1865 CollapsedNum);
1866 Dir->setIterationVariable(Exprs.IterationVarRef);
1867 Dir->setLastIteration(Exprs.LastIteration);
1868 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1869 Dir->setPreCond(Exprs.PreCond);
1870 Dir->setCond(Exprs.Cond);
1871 Dir->setInit(Exprs.Init);
1872 Dir->setInc(Exprs.Inc);
1873 Dir->setCounters(Exprs.Counters);
1874 Dir->setPrivateCounters(Exprs.PrivateCounters);
1875 Dir->setInits(Exprs.Inits);
1876 Dir->setUpdates(Exprs.Updates);
1877 Dir->setFinals(Exprs.Finals);
1878 Dir->setDependentCounters(Exprs.DependentCounters);
1879 Dir->setDependentInits(Exprs.DependentInits);
1880 Dir->setFinalsConditions(Exprs.FinalsConditions);
1881 Dir->setPreInits(Exprs.PreInits);
1882 return Dir;
1883}
1884
1887 unsigned CollapsedNum, EmptyShell) {
1888 return createEmptyDirective<OMPTargetSimdDirective>(
1889 C, NumClauses, /*HasAssociatedStmt=*/true,
1890 numLoopChildren(CollapsedNum, OMPD_target_simd), CollapsedNum);
1891}
1892
1894 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1895 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1896 const HelperExprs &Exprs) {
1897 auto *Dir = createDirective<OMPTeamsDistributeDirective>(
1898 C, Clauses, AssociatedStmt,
1899 numLoopChildren(CollapsedNum, OMPD_teams_distribute), StartLoc, EndLoc,
1900 CollapsedNum);
1901 Dir->setIterationVariable(Exprs.IterationVarRef);
1902 Dir->setLastIteration(Exprs.LastIteration);
1903 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1904 Dir->setPreCond(Exprs.PreCond);
1905 Dir->setCond(Exprs.Cond);
1906 Dir->setInit(Exprs.Init);
1907 Dir->setInc(Exprs.Inc);
1908 Dir->setIsLastIterVariable(Exprs.IL);
1909 Dir->setLowerBoundVariable(Exprs.LB);
1910 Dir->setUpperBoundVariable(Exprs.UB);
1911 Dir->setStrideVariable(Exprs.ST);
1912 Dir->setEnsureUpperBound(Exprs.EUB);
1913 Dir->setNextLowerBound(Exprs.NLB);
1914 Dir->setNextUpperBound(Exprs.NUB);
1915 Dir->setNumIterations(Exprs.NumIterations);
1916 Dir->setCounters(Exprs.Counters);
1917 Dir->setPrivateCounters(Exprs.PrivateCounters);
1918 Dir->setInits(Exprs.Inits);
1919 Dir->setUpdates(Exprs.Updates);
1920 Dir->setFinals(Exprs.Finals);
1921 Dir->setDependentCounters(Exprs.DependentCounters);
1922 Dir->setDependentInits(Exprs.DependentInits);
1923 Dir->setFinalsConditions(Exprs.FinalsConditions);
1924 Dir->setPreInits(Exprs.PreInits);
1925 return Dir;
1926}
1927
1930 unsigned NumClauses,
1931 unsigned CollapsedNum, EmptyShell) {
1932 return createEmptyDirective<OMPTeamsDistributeDirective>(
1933 C, NumClauses, /*HasAssociatedStmt=*/true,
1934 numLoopChildren(CollapsedNum, OMPD_teams_distribute), CollapsedNum);
1935}
1936
1938 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1939 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1940 const HelperExprs &Exprs) {
1941 auto *Dir = createDirective<OMPTeamsDistributeSimdDirective>(
1942 C, Clauses, AssociatedStmt,
1943 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), StartLoc,
1944 EndLoc, CollapsedNum);
1945 Dir->setIterationVariable(Exprs.IterationVarRef);
1946 Dir->setLastIteration(Exprs.LastIteration);
1947 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1948 Dir->setPreCond(Exprs.PreCond);
1949 Dir->setCond(Exprs.Cond);
1950 Dir->setInit(Exprs.Init);
1951 Dir->setInc(Exprs.Inc);
1952 Dir->setIsLastIterVariable(Exprs.IL);
1953 Dir->setLowerBoundVariable(Exprs.LB);
1954 Dir->setUpperBoundVariable(Exprs.UB);
1955 Dir->setStrideVariable(Exprs.ST);
1956 Dir->setEnsureUpperBound(Exprs.EUB);
1957 Dir->setNextLowerBound(Exprs.NLB);
1958 Dir->setNextUpperBound(Exprs.NUB);
1959 Dir->setNumIterations(Exprs.NumIterations);
1960 Dir->setCounters(Exprs.Counters);
1961 Dir->setPrivateCounters(Exprs.PrivateCounters);
1962 Dir->setInits(Exprs.Inits);
1963 Dir->setUpdates(Exprs.Updates);
1964 Dir->setFinals(Exprs.Finals);
1965 Dir->setDependentCounters(Exprs.DependentCounters);
1966 Dir->setDependentInits(Exprs.DependentInits);
1967 Dir->setFinalsConditions(Exprs.FinalsConditions);
1968 Dir->setPreInits(Exprs.PreInits);
1969 return Dir;
1970}
1971
1973 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1974 EmptyShell) {
1975 return createEmptyDirective<OMPTeamsDistributeSimdDirective>(
1976 C, NumClauses, /*HasAssociatedStmt=*/true,
1977 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), CollapsedNum);
1978}
1979
1982 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1983 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1984 const HelperExprs &Exprs) {
1985 auto *Dir = createDirective<OMPTeamsDistributeParallelForSimdDirective>(
1986 C, Clauses, AssociatedStmt,
1987 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
1988 StartLoc, EndLoc, CollapsedNum);
1989 Dir->setIterationVariable(Exprs.IterationVarRef);
1990 Dir->setLastIteration(Exprs.LastIteration);
1991 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1992 Dir->setPreCond(Exprs.PreCond);
1993 Dir->setCond(Exprs.Cond);
1994 Dir->setInit(Exprs.Init);
1995 Dir->setInc(Exprs.Inc);
1996 Dir->setIsLastIterVariable(Exprs.IL);
1997 Dir->setLowerBoundVariable(Exprs.LB);
1998 Dir->setUpperBoundVariable(Exprs.UB);
1999 Dir->setStrideVariable(Exprs.ST);
2000 Dir->setEnsureUpperBound(Exprs.EUB);
2001 Dir->setNextLowerBound(Exprs.NLB);
2002 Dir->setNextUpperBound(Exprs.NUB);
2003 Dir->setNumIterations(Exprs.NumIterations);
2004 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2005 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2006 Dir->setDistInc(Exprs.DistInc);
2007 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2008 Dir->setCounters(Exprs.Counters);
2009 Dir->setPrivateCounters(Exprs.PrivateCounters);
2010 Dir->setInits(Exprs.Inits);
2011 Dir->setUpdates(Exprs.Updates);
2012 Dir->setFinals(Exprs.Finals);
2013 Dir->setDependentCounters(Exprs.DependentCounters);
2014 Dir->setDependentInits(Exprs.DependentInits);
2015 Dir->setFinalsConditions(Exprs.FinalsConditions);
2016 Dir->setPreInits(Exprs.PreInits);
2017 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2018 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2019 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2020 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2021 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2022 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2023 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2024 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2025 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2026 return Dir;
2027}
2028
2031 unsigned NumClauses,
2032 unsigned CollapsedNum,
2033 EmptyShell) {
2034 return createEmptyDirective<OMPTeamsDistributeParallelForSimdDirective>(
2035 C, NumClauses, /*HasAssociatedStmt=*/true,
2036 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
2037 CollapsedNum);
2038}
2039
2042 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2043 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2044 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
2045 auto *Dir = createDirective<OMPTeamsDistributeParallelForDirective>(
2046 C, Clauses, AssociatedStmt,
2047 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
2048 StartLoc, EndLoc, CollapsedNum);
2049 Dir->setIterationVariable(Exprs.IterationVarRef);
2050 Dir->setLastIteration(Exprs.LastIteration);
2051 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2052 Dir->setPreCond(Exprs.PreCond);
2053 Dir->setCond(Exprs.Cond);
2054 Dir->setInit(Exprs.Init);
2055 Dir->setInc(Exprs.Inc);
2056 Dir->setIsLastIterVariable(Exprs.IL);
2057 Dir->setLowerBoundVariable(Exprs.LB);
2058 Dir->setUpperBoundVariable(Exprs.UB);
2059 Dir->setStrideVariable(Exprs.ST);
2060 Dir->setEnsureUpperBound(Exprs.EUB);
2061 Dir->setNextLowerBound(Exprs.NLB);
2062 Dir->setNextUpperBound(Exprs.NUB);
2063 Dir->setNumIterations(Exprs.NumIterations);
2064 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2065 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2066 Dir->setDistInc(Exprs.DistInc);
2067 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2068 Dir->setCounters(Exprs.Counters);
2069 Dir->setPrivateCounters(Exprs.PrivateCounters);
2070 Dir->setInits(Exprs.Inits);
2071 Dir->setUpdates(Exprs.Updates);
2072 Dir->setFinals(Exprs.Finals);
2073 Dir->setDependentCounters(Exprs.DependentCounters);
2074 Dir->setDependentInits(Exprs.DependentInits);
2075 Dir->setFinalsConditions(Exprs.FinalsConditions);
2076 Dir->setPreInits(Exprs.PreInits);
2077 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2078 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2079 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2080 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2081 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2082 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2083 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2084 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2085 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2086 Dir->setTaskReductionRefExpr(TaskRedRef);
2087 Dir->HasCancel = HasCancel;
2088 return Dir;
2089}
2090
2093 unsigned NumClauses,
2094 unsigned CollapsedNum,
2095 EmptyShell) {
2096 return createEmptyDirective<OMPTeamsDistributeParallelForDirective>(
2097 C, NumClauses, /*HasAssociatedStmt=*/true,
2098 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
2099 CollapsedNum);
2100}
2101
2103 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2104 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
2105 return createDirective<OMPTargetTeamsDirective>(C, Clauses, AssociatedStmt,
2106 /*NumChildren=*/0, StartLoc,
2107 EndLoc);
2108}
2109
2112 EmptyShell) {
2113 return createEmptyDirective<OMPTargetTeamsDirective>(
2114 C, NumClauses, /*HasAssociatedStmt=*/true);
2115}
2116
2118 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2119 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2120 const HelperExprs &Exprs) {
2121 auto *Dir = createDirective<OMPTargetTeamsDistributeDirective>(
2122 C, Clauses, AssociatedStmt,
2123 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute), StartLoc,
2124 EndLoc, CollapsedNum);
2125 Dir->setIterationVariable(Exprs.IterationVarRef);
2126 Dir->setLastIteration(Exprs.LastIteration);
2127 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2128 Dir->setPreCond(Exprs.PreCond);
2129 Dir->setCond(Exprs.Cond);
2130 Dir->setInit(Exprs.Init);
2131 Dir->setInc(Exprs.Inc);
2132 Dir->setIsLastIterVariable(Exprs.IL);
2133 Dir->setLowerBoundVariable(Exprs.LB);
2134 Dir->setUpperBoundVariable(Exprs.UB);
2135 Dir->setStrideVariable(Exprs.ST);
2136 Dir->setEnsureUpperBound(Exprs.EUB);
2137 Dir->setNextLowerBound(Exprs.NLB);
2138 Dir->setNextUpperBound(Exprs.NUB);
2139 Dir->setNumIterations(Exprs.NumIterations);
2140 Dir->setCounters(Exprs.Counters);
2141 Dir->setPrivateCounters(Exprs.PrivateCounters);
2142 Dir->setInits(Exprs.Inits);
2143 Dir->setUpdates(Exprs.Updates);
2144 Dir->setFinals(Exprs.Finals);
2145 Dir->setDependentCounters(Exprs.DependentCounters);
2146 Dir->setDependentInits(Exprs.DependentInits);
2147 Dir->setFinalsConditions(Exprs.FinalsConditions);
2148 Dir->setPreInits(Exprs.PreInits);
2149 return Dir;
2150}
2151
2154 unsigned NumClauses,
2155 unsigned CollapsedNum,
2156 EmptyShell) {
2157 return createEmptyDirective<OMPTargetTeamsDistributeDirective>(
2158 C, NumClauses, /*HasAssociatedStmt=*/true,
2159 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute),
2160 CollapsedNum);
2161}
2162
2165 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2166 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2167 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
2168 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForDirective>(
2169 C, Clauses, AssociatedStmt,
2170 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
2171 1,
2172 StartLoc, EndLoc, CollapsedNum);
2173 Dir->setIterationVariable(Exprs.IterationVarRef);
2174 Dir->setLastIteration(Exprs.LastIteration);
2175 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2176 Dir->setPreCond(Exprs.PreCond);
2177 Dir->setCond(Exprs.Cond);
2178 Dir->setInit(Exprs.Init);
2179 Dir->setInc(Exprs.Inc);
2180 Dir->setIsLastIterVariable(Exprs.IL);
2181 Dir->setLowerBoundVariable(Exprs.LB);
2182 Dir->setUpperBoundVariable(Exprs.UB);
2183 Dir->setStrideVariable(Exprs.ST);
2184 Dir->setEnsureUpperBound(Exprs.EUB);
2185 Dir->setNextLowerBound(Exprs.NLB);
2186 Dir->setNextUpperBound(Exprs.NUB);
2187 Dir->setNumIterations(Exprs.NumIterations);
2188 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2189 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2190 Dir->setDistInc(Exprs.DistInc);
2191 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2192 Dir->setCounters(Exprs.Counters);
2193 Dir->setPrivateCounters(Exprs.PrivateCounters);
2194 Dir->setInits(Exprs.Inits);
2195 Dir->setUpdates(Exprs.Updates);
2196 Dir->setFinals(Exprs.Finals);
2197 Dir->setDependentCounters(Exprs.DependentCounters);
2198 Dir->setDependentInits(Exprs.DependentInits);
2199 Dir->setFinalsConditions(Exprs.FinalsConditions);
2200 Dir->setPreInits(Exprs.PreInits);
2201 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2202 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2203 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2204 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2205 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2206 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2207 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2208 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2209 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2210 Dir->setTaskReductionRefExpr(TaskRedRef);
2211 Dir->HasCancel = HasCancel;
2212 return Dir;
2213}
2214
2217 unsigned NumClauses,
2218 unsigned CollapsedNum,
2219 EmptyShell) {
2220 return createEmptyDirective<OMPTargetTeamsDistributeParallelForDirective>(
2221 C, NumClauses, /*HasAssociatedStmt=*/true,
2222 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
2223 1,
2224 CollapsedNum);
2225}
2226
2229 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2230 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2231 const HelperExprs &Exprs) {
2232 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
2233 C, Clauses, AssociatedStmt,
2234 numLoopChildren(CollapsedNum,
2235 OMPD_target_teams_distribute_parallel_for_simd),
2236 StartLoc, EndLoc, CollapsedNum);
2237 Dir->setIterationVariable(Exprs.IterationVarRef);
2238 Dir->setLastIteration(Exprs.LastIteration);
2239 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2240 Dir->setPreCond(Exprs.PreCond);
2241 Dir->setCond(Exprs.Cond);
2242 Dir->setInit(Exprs.Init);
2243 Dir->setInc(Exprs.Inc);
2244 Dir->setIsLastIterVariable(Exprs.IL);
2245 Dir->setLowerBoundVariable(Exprs.LB);
2246 Dir->setUpperBoundVariable(Exprs.UB);
2247 Dir->setStrideVariable(Exprs.ST);
2248 Dir->setEnsureUpperBound(Exprs.EUB);
2249 Dir->setNextLowerBound(Exprs.NLB);
2250 Dir->setNextUpperBound(Exprs.NUB);
2251 Dir->setNumIterations(Exprs.NumIterations);
2252 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2253 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2254 Dir->setDistInc(Exprs.DistInc);
2255 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2256 Dir->setCounters(Exprs.Counters);
2257 Dir->setPrivateCounters(Exprs.PrivateCounters);
2258 Dir->setInits(Exprs.Inits);
2259 Dir->setUpdates(Exprs.Updates);
2260 Dir->setFinals(Exprs.Finals);
2261 Dir->setDependentCounters(Exprs.DependentCounters);
2262 Dir->setDependentInits(Exprs.DependentInits);
2263 Dir->setFinalsConditions(Exprs.FinalsConditions);
2264 Dir->setPreInits(Exprs.PreInits);
2265 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2266 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2267 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2268 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2269 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2270 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2271 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2272 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2273 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2274 return Dir;
2275}
2276
2279 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
2280 EmptyShell) {
2281 return createEmptyDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
2282 C, NumClauses, /*HasAssociatedStmt=*/true,
2283 numLoopChildren(CollapsedNum,
2284 OMPD_target_teams_distribute_parallel_for_simd),
2285 CollapsedNum);
2286}
2287
2290 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2291 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2292 const HelperExprs &Exprs) {
2293 auto *Dir = createDirective<OMPTargetTeamsDistributeSimdDirective>(
2294 C, Clauses, AssociatedStmt,
2295 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),
2296 StartLoc, EndLoc, CollapsedNum);
2297 Dir->setIterationVariable(Exprs.IterationVarRef);
2298 Dir->setLastIteration(Exprs.LastIteration);
2299 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2300 Dir->setPreCond(Exprs.PreCond);
2301 Dir->setCond(Exprs.Cond);
2302 Dir->setInit(Exprs.Init);
2303 Dir->setInc(Exprs.Inc);
2304 Dir->setIsLastIterVariable(Exprs.IL);
2305 Dir->setLowerBoundVariable(Exprs.LB);
2306 Dir->setUpperBoundVariable(Exprs.UB);
2307 Dir->setStrideVariable(Exprs.ST);
2308 Dir->setEnsureUpperBound(Exprs.EUB);
2309 Dir->setNextLowerBound(Exprs.NLB);
2310 Dir->setNextUpperBound(Exprs.NUB);
2311 Dir->setNumIterations(Exprs.NumIterations);
2312 Dir->setCounters(Exprs.Counters);
2313 Dir->setPrivateCounters(Exprs.PrivateCounters);
2314 Dir->setInits(Exprs.Inits);
2315 Dir->setUpdates(Exprs.Updates);
2316 Dir->setFinals(Exprs.Finals);
2317 Dir->setDependentCounters(Exprs.DependentCounters);
2318 Dir->setDependentInits(Exprs.DependentInits);
2319 Dir->setFinalsConditions(Exprs.FinalsConditions);
2320 Dir->setPreInits(Exprs.PreInits);
2321 return Dir;
2322}
2323
2326 unsigned NumClauses,
2327 unsigned CollapsedNum,
2328 EmptyShell) {
2329 return createEmptyDirective<OMPTargetTeamsDistributeSimdDirective>(
2330 C, NumClauses, /*HasAssociatedStmt=*/true,
2331 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),
2332 CollapsedNum);
2333}
2334
2337 SourceLocation EndLoc,
2338 ArrayRef<OMPClause *> Clauses) {
2339 return createDirective<OMPInteropDirective>(
2340 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
2341 EndLoc);
2342}
2343
2345 unsigned NumClauses,
2346 EmptyShell) {
2347 return createEmptyDirective<OMPInteropDirective>(C, NumClauses);
2348}
2349
2351 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2352 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2353 SourceLocation TargetCallLoc) {
2354 auto *Dir = createDirective<OMPDispatchDirective>(
2355 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
2356 Dir->setTargetCallLoc(TargetCallLoc);
2357 return Dir;
2358}
2359
2361 unsigned NumClauses,
2362 EmptyShell) {
2363 return createEmptyDirective<OMPDispatchDirective>(C, NumClauses,
2364 /*HasAssociatedStmt=*/true,
2365 /*NumChildren=*/0);
2366}
2367
2369 SourceLocation StartLoc,
2370 SourceLocation EndLoc,
2371 ArrayRef<OMPClause *> Clauses,
2372 Stmt *AssociatedStmt) {
2373 return createDirective<OMPMaskedDirective>(C, Clauses, AssociatedStmt,
2374 /*NumChildren=*/0, StartLoc,
2375 EndLoc);
2376}
2377
2379 unsigned NumClauses,
2380 EmptyShell) {
2381 return createEmptyDirective<OMPMaskedDirective>(C, NumClauses,
2382 /*HasAssociatedStmt=*/true);
2383}
2384
2386 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2387 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2388 const HelperExprs &Exprs) {
2389 auto *Dir = createDirective<OMPGenericLoopDirective>(
2390 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_loop),
2391 StartLoc, EndLoc, CollapsedNum);
2392 Dir->setIterationVariable(Exprs.IterationVarRef);
2393 Dir->setLastIteration(Exprs.LastIteration);
2394 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2395 Dir->setPreCond(Exprs.PreCond);
2396 Dir->setCond(Exprs.Cond);
2397 Dir->setInit(Exprs.Init);
2398 Dir->setInc(Exprs.Inc);
2399 Dir->setIsLastIterVariable(Exprs.IL);
2400 Dir->setLowerBoundVariable(Exprs.LB);
2401 Dir->setUpperBoundVariable(Exprs.UB);
2402 Dir->setStrideVariable(Exprs.ST);
2403 Dir->setEnsureUpperBound(Exprs.EUB);
2404 Dir->setNextLowerBound(Exprs.NLB);
2405 Dir->setNextUpperBound(Exprs.NUB);
2406 Dir->setNumIterations(Exprs.NumIterations);
2407 Dir->setCounters(Exprs.Counters);
2408 Dir->setPrivateCounters(Exprs.PrivateCounters);
2409 Dir->setInits(Exprs.Inits);
2410 Dir->setUpdates(Exprs.Updates);
2411 Dir->setFinals(Exprs.Finals);
2412 Dir->setDependentCounters(Exprs.DependentCounters);
2413 Dir->setDependentInits(Exprs.DependentInits);
2414 Dir->setFinalsConditions(Exprs.FinalsConditions);
2415 Dir->setPreInits(Exprs.PreInits);
2416 return Dir;
2417}
2418
2421 unsigned CollapsedNum, EmptyShell) {
2422 return createEmptyDirective<OMPGenericLoopDirective>(
2423 C, NumClauses, /*HasAssociatedStmt=*/true,
2424 numLoopChildren(CollapsedNum, OMPD_loop), CollapsedNum);
2425}
2426
2428 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2429 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2430 const HelperExprs &Exprs) {
2431 auto *Dir = createDirective<OMPTeamsGenericLoopDirective>(
2432 C, Clauses, AssociatedStmt,
2433 numLoopChildren(CollapsedNum, OMPD_teams_loop), StartLoc, EndLoc,
2434 CollapsedNum);
2435 Dir->setIterationVariable(Exprs.IterationVarRef);
2436 Dir->setLastIteration(Exprs.LastIteration);
2437 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2438 Dir->setPreCond(Exprs.PreCond);
2439 Dir->setCond(Exprs.Cond);
2440 Dir->setInit(Exprs.Init);
2441 Dir->setInc(Exprs.Inc);
2442 Dir->setIsLastIterVariable(Exprs.IL);
2443 Dir->setLowerBoundVariable(Exprs.LB);
2444 Dir->setUpperBoundVariable(Exprs.UB);
2445 Dir->setStrideVariable(Exprs.ST);
2446 Dir->setEnsureUpperBound(Exprs.EUB);
2447 Dir->setNextLowerBound(Exprs.NLB);
2448 Dir->setNextUpperBound(Exprs.NUB);
2449 Dir->setNumIterations(Exprs.NumIterations);
2450 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2451 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2452 Dir->setDistInc(Exprs.DistInc);
2453 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2454 Dir->setCounters(Exprs.Counters);
2455 Dir->setPrivateCounters(Exprs.PrivateCounters);
2456 Dir->setInits(Exprs.Inits);
2457 Dir->setUpdates(Exprs.Updates);
2458 Dir->setFinals(Exprs.Finals);
2459 Dir->setDependentCounters(Exprs.DependentCounters);
2460 Dir->setDependentInits(Exprs.DependentInits);
2461 Dir->setFinalsConditions(Exprs.FinalsConditions);
2462 Dir->setPreInits(Exprs.PreInits);
2463 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2464 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2465 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2466 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2467 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2468 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2469 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2470 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2471 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2472 return Dir;
2473}
2474
2477 unsigned NumClauses,
2478 unsigned CollapsedNum, EmptyShell) {
2479 return createEmptyDirective<OMPTeamsGenericLoopDirective>(
2480 C, NumClauses, /*HasAssociatedStmt=*/true,
2481 numLoopChildren(CollapsedNum, OMPD_teams_loop), CollapsedNum);
2482}
2483
2485 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2486 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2487 const HelperExprs &Exprs, bool CanBeParallelFor) {
2488 auto *Dir = createDirective<OMPTargetTeamsGenericLoopDirective>(
2489 C, Clauses, AssociatedStmt,
2490 numLoopChildren(CollapsedNum, OMPD_target_teams_loop), StartLoc, EndLoc,
2491 CollapsedNum);
2492 Dir->setIterationVariable(Exprs.IterationVarRef);
2493 Dir->setLastIteration(Exprs.LastIteration);
2494 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2495 Dir->setPreCond(Exprs.PreCond);
2496 Dir->setCond(Exprs.Cond);
2497 Dir->setInit(Exprs.Init);
2498 Dir->setInc(Exprs.Inc);
2499 Dir->setIsLastIterVariable(Exprs.IL);
2500 Dir->setLowerBoundVariable(Exprs.LB);
2501 Dir->setUpperBoundVariable(Exprs.UB);
2502 Dir->setStrideVariable(Exprs.ST);
2503 Dir->setEnsureUpperBound(Exprs.EUB);
2504 Dir->setNextLowerBound(Exprs.NLB);
2505 Dir->setNextUpperBound(Exprs.NUB);
2506 Dir->setNumIterations(Exprs.NumIterations);
2507 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2508 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2509 Dir->setDistInc(Exprs.DistInc);
2510 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2511 Dir->setCounters(Exprs.Counters);
2512 Dir->setPrivateCounters(Exprs.PrivateCounters);
2513 Dir->setInits(Exprs.Inits);
2514 Dir->setUpdates(Exprs.Updates);
2515 Dir->setFinals(Exprs.Finals);
2516 Dir->setDependentCounters(Exprs.DependentCounters);
2517 Dir->setDependentInits(Exprs.DependentInits);
2518 Dir->setFinalsConditions(Exprs.FinalsConditions);
2519 Dir->setPreInits(Exprs.PreInits);
2520 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2521 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2522 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2523 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2524 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2525 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2526 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2527 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2528 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2529 Dir->setCanBeParallelFor(CanBeParallelFor);
2530 return Dir;
2531}
2532
2535 unsigned NumClauses,
2536 unsigned CollapsedNum,
2537 EmptyShell) {
2538 return createEmptyDirective<OMPTargetTeamsGenericLoopDirective>(
2539 C, NumClauses, /*HasAssociatedStmt=*/true,
2540 numLoopChildren(CollapsedNum, OMPD_target_teams_loop), CollapsedNum);
2541}
2542
2544 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2545 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2546 const HelperExprs &Exprs) {
2547 auto *Dir = createDirective<OMPParallelGenericLoopDirective>(
2548 C, Clauses, AssociatedStmt,
2549 numLoopChildren(CollapsedNum, OMPD_parallel_loop), StartLoc, EndLoc,
2550 CollapsedNum);
2551 Dir->setIterationVariable(Exprs.IterationVarRef);
2552 Dir->setLastIteration(Exprs.LastIteration);
2553 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2554 Dir->setPreCond(Exprs.PreCond);
2555 Dir->setCond(Exprs.Cond);
2556 Dir->setInit(Exprs.Init);
2557 Dir->setInc(Exprs.Inc);
2558 Dir->setIsLastIterVariable(Exprs.IL);
2559 Dir->setLowerBoundVariable(Exprs.LB);
2560 Dir->setUpperBoundVariable(Exprs.UB);
2561 Dir->setStrideVariable(Exprs.ST);
2562 Dir->setEnsureUpperBound(Exprs.EUB);
2563 Dir->setNextLowerBound(Exprs.NLB);
2564 Dir->setNextUpperBound(Exprs.NUB);
2565 Dir->setNumIterations(Exprs.NumIterations);
2566 Dir->setCounters(Exprs.Counters);
2567 Dir->setPrivateCounters(Exprs.PrivateCounters);
2568 Dir->setInits(Exprs.Inits);
2569 Dir->setUpdates(Exprs.Updates);
2570 Dir->setFinals(Exprs.Finals);
2571 Dir->setDependentCounters(Exprs.DependentCounters);
2572 Dir->setDependentInits(Exprs.DependentInits);
2573 Dir->setFinalsConditions(Exprs.FinalsConditions);
2574 Dir->setPreInits(Exprs.PreInits);
2575 return Dir;
2576}
2577
2579 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
2580 EmptyShell) {
2581 return createEmptyDirective<OMPParallelGenericLoopDirective>(
2582 C, NumClauses, /*HasAssociatedStmt=*/true,
2583 numLoopChildren(CollapsedNum, OMPD_parallel_loop), CollapsedNum);
2584}
2585
2588 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2589 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2590 const HelperExprs &Exprs) {
2591 auto *Dir = createDirective<OMPTargetParallelGenericLoopDirective>(
2592 C, Clauses, AssociatedStmt,
2593 numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), StartLoc,
2594 EndLoc, CollapsedNum);
2595 Dir->setIterationVariable(Exprs.IterationVarRef);
2596 Dir->setLastIteration(Exprs.LastIteration);
2597 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2598 Dir->setPreCond(Exprs.PreCond);
2599 Dir->setCond(Exprs.Cond);
2600 Dir->setInit(Exprs.Init);
2601 Dir->setInc(Exprs.Inc);
2602 Dir->setIsLastIterVariable(Exprs.IL);
2603 Dir->setLowerBoundVariable(Exprs.LB);
2604 Dir->setUpperBoundVariable(Exprs.UB);
2605 Dir->setStrideVariable(Exprs.ST);
2606 Dir->setEnsureUpperBound(Exprs.EUB);
2607 Dir->setNextLowerBound(Exprs.NLB);
2608 Dir->setNextUpperBound(Exprs.NUB);
2609 Dir->setNumIterations(Exprs.NumIterations);
2610 Dir->setCounters(Exprs.Counters);
2611 Dir->setPrivateCounters(Exprs.PrivateCounters);
2612 Dir->setInits(Exprs.Inits);
2613 Dir->setUpdates(Exprs.Updates);
2614 Dir->setFinals(Exprs.Finals);
2615 Dir->setDependentCounters(Exprs.DependentCounters);
2616 Dir->setDependentInits(Exprs.DependentInits);
2617 Dir->setFinalsConditions(Exprs.FinalsConditions);
2618 Dir->setPreInits(Exprs.PreInits);
2619 return Dir;
2620}
2621
2624 unsigned NumClauses,
2625 unsigned CollapsedNum,
2626 EmptyShell) {
2627 return createEmptyDirective<OMPTargetParallelGenericLoopDirective>(
2628 C, NumClauses, /*HasAssociatedStmt=*/true,
2629 numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), CollapsedNum);
2630}
Defines the clang::ASTContext interface.
This file defines OpenMP AST classes for executable directives and clauses.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:187
This represents one expression.
Definition: Expr.h:110
IfStmt - This represents an if/then/else.
Definition: Stmt.h:2148
static OMPAssumeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Definition: StmtOpenMP.cpp:812
static OMPAssumeDirective * Create(const ASTContext &Ctx, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AStmt)
Definition: StmtOpenMP.cpp:802
This represents '#pragma omp atomic' directive.
Definition: StmtOpenMP.h:2947
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:988
static OMPAtomicDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expressions Exprs)
Creates directive with a list of Clauses and 'x', 'v' and 'expr' parts of the atomic construct (see S...
Definition: StmtOpenMP.cpp:970
This represents '#pragma omp barrier' directive.
Definition: StmtOpenMP.h:2625
static OMPBarrierDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:834
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:840
This represents '#pragma omp cancel' directive.
Definition: StmtOpenMP.h:3655
static OMPCancelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, OpenMPDirectiveKind CancelRegion)
Creates directive.
Definition: StmtOpenMP.cpp:890
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:900
This represents '#pragma omp cancellation point' directive.
Definition: StmtOpenMP.h:3597
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:885
static OMPCancellationPointDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Creates directive.
Definition: StmtOpenMP.cpp:876
Contains data for OpenMP directives: clauses, children expressions/statements (helpers for codegen) a...
void setClauses(ArrayRef< OMPClause * > Clauses)
Sets the list of variables for this clause.
Definition: StmtOpenMP.cpp:27
MutableArrayRef< Stmt * > getChildren()
Definition: StmtOpenMP.cpp:33
This represents '#pragma omp critical' directive.
Definition: StmtOpenMP.h:2076
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:628
static OMPCriticalDirective * Create(const ASTContext &C, const DeclarationNameInfo &Name, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:619
This represents '#pragma omp depobj' directive.
Definition: StmtOpenMP.h:2841
static OMPDepobjDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:930
static OMPDepobjDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:921
This represents '#pragma omp dispatch' directive.
Definition: StmtOpenMP.h:5948
static OMPDispatchDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, SourceLocation TargetCallLoc)
Creates directive with a list of Clauses.
static OMPDispatchDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp distribute' directive.
Definition: StmtOpenMP.h:4425
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.
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp distribute parallel for' composite directive.
Definition: StmtOpenMP.h:4547
static OMPDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDistributeParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
This represents '#pragma omp distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:4643
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.
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp distribute simd' composite directive.
Definition: StmtOpenMP.h:4708
static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
This represents '#pragma omp error' directive.
Definition: StmtOpenMP.h:6432
static OMPErrorDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Definition: StmtOpenMP.cpp:819
static OMPErrorDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:828
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
Definition: StmtOpenMP.h:518
const Stmt * getRawStmt() const
Definition: StmtOpenMP.h:593
OMPChildren * Data
Data, associated with the directive.
Definition: StmtOpenMP.h:286
const Stmt * getStructuredBlock() const
Returns the AST node representing OpenMP structured-block of this OpenMP executable directive,...
Definition: StmtOpenMP.h:588
bool isStandaloneDirective() const
Returns whether or not this is a Standalone directive.
Definition: StmtOpenMP.cpp:58
This represents '#pragma omp flush' directive.
Definition: StmtOpenMP.h:2789
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:915
static OMPFlushDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:906
This represents '#pragma omp for' directive.
Definition: StmtOpenMP.h:1634
static OMPForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:336
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:398
This represents '#pragma omp for simd' directive.
Definition: StmtOpenMP.h:1724
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:523
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:489
This represents '#pragma omp loop' directive.
Definition: StmtOpenMP.h:6103
static OMPGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with a place for NumClauses clauses.
static OMPGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Represents the '#pragma omp interchange' loop transformation directive.
Definition: StmtOpenMP.h:5769
static OMPInterchangeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty '#pragma omp interchange' AST node for deserialization.
Definition: StmtOpenMP.cpp:481
static OMPInterchangeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits)
Create a new AST node representation for '#pragma omp interchange'.
Definition: StmtOpenMP.cpp:468
This represents '#pragma omp interop' directive.
Definition: StmtOpenMP.h:5895
static OMPInteropDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPInteropDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive.
static void doForAllLoopsBodies(Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops, llvm::function_ref< void(unsigned, Stmt *, Stmt *)> Callback)
Calls the specified callback function for all the loop bodies in CurStmt, from the outermost loop to ...
Definition: StmtOpenMP.cpp:179
unsigned NumAssociatedLoops
Number of collapsed loops as specified by 'collapse' clause.
Definition: StmtOpenMP.h:688
static Stmt * tryToFindNextInnerLoop(Stmt *CurStmt, bool TryImperfectlyNestedLoops)
Try to find the next loop sub-statement in the specified statement CurStmt.
Definition: StmtOpenMP.cpp:78
static bool doForAllLoops(Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops, llvm::function_ref< bool(unsigned, Stmt *)> Callback, llvm::function_ref< void(OMPLoopTransformationDirective *)> OnTransformationCallback)
Calls the specified callback function for all the loops in CurStmt, from the outermost to the innermo...
Definition: StmtOpenMP.cpp:125
unsigned getLoopsNumber() const
Get number of collapsed loops.
Definition: StmtOpenMP.h:877
void setFinals(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:237
void setDependentCounters(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:243
void setFinalsConditions(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:256
void setInits(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:225
static unsigned numLoopChildren(unsigned CollapsedNum, OpenMPDirectiveKind Kind)
Children number.
Definition: StmtOpenMP.h:1155
void setCounters(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:212
void setDependentInits(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:250
void setUpdates(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:231
void setPrivateCounters(ArrayRef< Expr * > A)
Definition: StmtOpenMP.cpp:218
The base class for all loop transformation directives.
Definition: StmtOpenMP.h:960
Stmt * getPreInits() const
Return preinits statement.
Definition: StmtOpenMP.cpp:385
Stmt * getTransformedStmt() const
Get the de-sugared statements after the loop transformation.
Definition: StmtOpenMP.cpp:372
This represents '#pragma omp masked' directive.
Definition: StmtOpenMP.h:6013
static OMPMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPMaskedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
This represents '#pragma omp masked taskloop' directive.
Definition: StmtOpenMP.h:3930
static OMPMaskedTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
static OMPMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp masked taskloop simd' directive.
Definition: StmtOpenMP.h:4071
static OMPMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMaskedTaskLoopSimdDirective * 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 '#pragma omp master' directive.
Definition: StmtOpenMP.h:2028
static OMPMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:604
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:613
This represents '#pragma omp master taskloop' directive.
Definition: StmtOpenMP.h:3854
static OMPMasterTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
static OMPMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp master taskloop simd' directive.
Definition: StmtOpenMP.h:4006
static OMPMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMasterTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
This represents '#pragma omp metadirective' directive.
Definition: StmtOpenMP.h:6064
static OMPMetaDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Definition: StmtOpenMP.cpp:273
static OMPMetaDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Stmt *IfStmt)
Definition: StmtOpenMP.cpp:262
This represents '#pragma omp ordered' directive.
Definition: StmtOpenMP.h:2893
static OMPOrderedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:951
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, bool IsStandalone, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:961
This represents '#pragma omp parallel' directive.
Definition: StmtOpenMP.h:612
static OMPParallelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:281
static OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:292
This represents '#pragma omp parallel for' directive.
Definition: StmtOpenMP.h:2147
static OMPParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:635
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:673
This represents '#pragma omp parallel for simd' directive.
Definition: StmtOpenMP.h:2244
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:716
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:680
This represents '#pragma omp parallel loop' directive.
Definition: StmtOpenMP.h:6305
static OMPParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelGenericLoopDirective * 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 '#pragma omp parallel masked' directive.
Definition: StmtOpenMP.h:2372
static OMPParallelMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:750
static OMPParallelMaskedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:740
This represents '#pragma omp parallel masked taskloop' directive.
Definition: StmtOpenMP.h:4215
static OMPParallelMaskedTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
static OMPParallelMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel masked taskloop simd' directive.
Definition: StmtOpenMP.h:4360
static OMPParallelMaskedTaskLoopSimdDirective * 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 OMPParallelMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel master' directive.
Definition: StmtOpenMP.h:2309
static OMPParallelMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:724
static OMPParallelMasterDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:734
This represents '#pragma omp parallel master taskloop' directive.
Definition: StmtOpenMP.h:4137
static OMPParallelMasterTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
static OMPParallelMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel master taskloop simd' directive.
Definition: StmtOpenMP.h:4293
static OMPParallelMasterTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPParallelMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel sections' directive.
Definition: StmtOpenMP.h:2436
static OMPParallelSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:756
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:768
Represents the '#pragma omp reverse' loop transformation directive.
Definition: StmtOpenMP.h:5704
static OMPReverseDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits)
Create a new AST node representation for '#pragma omp reverse'.
Definition: StmtOpenMP.cpp:451
static OMPReverseDirective * CreateEmpty(const ASTContext &C)
Build an empty '#pragma omp reverse' AST node for deserialization.
Definition: StmtOpenMP.cpp:462
This represents '#pragma omp scan' directive.
Definition: StmtOpenMP.h:5842
static OMPScanDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:945
static OMPScanDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:936
This represents '#pragma omp scope' directive.
Definition: StmtOpenMP.h:1925
static OMPScopeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:570
static OMPScopeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:580
This represents '#pragma omp section' directive.
Definition: StmtOpenMP.h:1864
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:564
static OMPSectionDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, bool HasCancel)
Creates directive.
Definition: StmtOpenMP.cpp:552
This represents '#pragma omp sections' directive.
Definition: StmtOpenMP.h:1787
static OMPSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:532
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:544
This represents '#pragma omp simd' directive.
Definition: StmtOpenMP.h:1571
static OMPSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:301
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:327
This represents '#pragma omp single' directive.
Definition: StmtOpenMP.h:1977
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:587
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:597
This represents '#pragma omp target data' directive.
Definition: StmtOpenMP.h:3206
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
static OMPTargetDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
This represents '#pragma omp target' directive.
Definition: StmtOpenMP.h:3152
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:995
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target enter data' directive.
Definition: StmtOpenMP.h:3260
static OMPTargetEnterDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents '#pragma omp target exit data' directive.
Definition: StmtOpenMP.h:3315
static OMPTargetExitDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents '#pragma omp target parallel' directive.
Definition: StmtOpenMP.h:3369
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, 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, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
This represents '#pragma omp target parallel for' directive.
Definition: StmtOpenMP.h:3449
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
This represents '#pragma omp target parallel for simd' directive.
Definition: StmtOpenMP.h:4774
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 OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target parallel loop' directive.
Definition: StmtOpenMP.h:6370
static OMPTargetParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetParallelGenericLoopDirective * 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 '#pragma omp target simd' directive.
Definition: StmtOpenMP.h:4841
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 OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams' directive.
Definition: StmtOpenMP.h:5199
static OMPTargetTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams distribute' combined directive.
Definition: StmtOpenMP.h:5255
static OMPTargetTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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 '#pragma omp target teams distribute parallel for' combined directive.
Definition: StmtOpenMP.h:5322
static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsDistributeParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
Definition: StmtOpenMP.h:5420
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.
static OMPTargetTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams distribute simd' combined directive.
Definition: StmtOpenMP.h:5490
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.
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams loop' directive.
Definition: StmtOpenMP.h:6230
static OMPTargetTeamsGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool CanBeParallelFor)
Creates directive with a list of Clauses.
static OMPTargetTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target update' directive.
Definition: StmtOpenMP.h:4491
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetUpdateDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
This represents '#pragma omp task' directive.
Definition: StmtOpenMP.h:2517
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:784
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:775
This represents '#pragma omp taskloop' directive.
Definition: StmtOpenMP.h:3715
static OMPTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp taskloop simd' directive.
Definition: StmtOpenMP.h:3788
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
This represents '#pragma omp taskgroup' directive.
Definition: StmtOpenMP.h:2722
static OMPTaskgroupDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *ReductionRef)
Creates directive.
Definition: StmtOpenMP.cpp:860
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:869
This represents '#pragma omp taskwait' directive.
Definition: StmtOpenMP.h:2671
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:854
static OMPTaskwaitDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive.
Definition: StmtOpenMP.cpp:846
This represents '#pragma omp taskyield' directive.
Definition: StmtOpenMP.h:2579
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:797
static OMPTaskyieldDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:791
This represents '#pragma omp teams' directive.
Definition: StmtOpenMP.h:3544
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
This represents '#pragma omp teams distribute' directive.
Definition: StmtOpenMP.h:4906
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 OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams distribute parallel for' composite directive.
Definition: StmtOpenMP.h:5106
static OMPTeamsDistributeParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:5040
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.
static OMPTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams distribute simd' combined directive.
Definition: StmtOpenMP.h:4972
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 OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams loop' directive.
Definition: StmtOpenMP.h:6165
static OMPTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsGenericLoopDirective * 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 the '#pragma omp tile' loop transformation directive.
Definition: StmtOpenMP.h:5548
static OMPTileDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty '#pragma omp tile' AST node for deserialization.
Definition: StmtOpenMP.cpp:420
static OMPTileDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits)
Create a new AST node representation for '#pragma omp tile'.
Definition: StmtOpenMP.cpp:408
This represents the '#pragma omp unroll' loop transformation directive.
Definition: StmtOpenMP.h:5630
static OMPUnrollDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, unsigned NumGeneratedLoops, Stmt *TransformedStmt, Stmt *PreInits)
Create a new AST node representation for '#pragma omp unroll'.
Definition: StmtOpenMP.cpp:429
static OMPUnrollDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Build an empty '#pragma omp unroll' AST node for deserialization.
Definition: StmtOpenMP.cpp:443
Encodes a location in the source.
Stmt - This represents one statement.
Definition: Stmt.h:84
StmtClass getStmtClass() const
Definition: Stmt.h:1363
Stmt * IgnoreContainers(bool IgnoreCaptured=false)
Skip no-op (attributed, compound) container stmts and skip captured stmt at the top,...
Definition: Stmt.cpp:197
The JSON file list parser is used to communicate input to InstallAPI.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:24
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
Expr * E
'expr' part of the associated expression/statement.
Definition: StmtOpenMP.h:3032
Expr * D
'd' part of the associated expression/statement.
Definition: StmtOpenMP.h:3038
Expr * UE
UE Helper expression of the form: 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExp...
Definition: StmtOpenMP.h:3036
bool IsFailOnly
True if 'v' is updated only when the condition is false (compare capture only).
Definition: StmtOpenMP.h:3047
Expr * X
'x' part of the associated expression/statement.
Definition: StmtOpenMP.h:3026
Expr * Cond
Conditional expression in atomic compare construct.
Definition: StmtOpenMP.h:3040
Expr * V
'v' part of the associated expression/statement.
Definition: StmtOpenMP.h:3028
bool IsPostfixUpdate
True if original value of 'x' must be stored in 'v', not an updated one.
Definition: StmtOpenMP.h:3044
bool IsXLHSInRHSPart
True if UE has the first form and false if the second.
Definition: StmtOpenMP.h:3042
Expr * ParForInDistCond
'omp parallel for' loop condition used when composed with 'omp distribute' in the same construct and ...
Definition: StmtOpenMP.h:736
Expr * LB
DistributeLowerBound - used when composing 'omp distribute' with 'omp for' in a same construct.
Definition: StmtOpenMP.h:710
Expr * Init
Distribute loop iteration variable init used when composing 'omp distribute' with 'omp for' in a same...
Definition: StmtOpenMP.h:720
Expr * NUB
Update of UpperBound for statically scheduled omp loops for outer loop in combined constructs (e....
Definition: StmtOpenMP.h:729
Expr * EUB
DistributeEnsureUpperBound - used when composing 'omp distribute' with 'omp for' in a same construct,...
Definition: StmtOpenMP.h:716
Expr * UB
DistributeUpperBound - used when composing 'omp distribute' with 'omp for' in a same construct.
Definition: StmtOpenMP.h:713
Expr * NLB
Update of LowerBound for statically scheduled omp loops for outer loop in combined constructs (e....
Definition: StmtOpenMP.h:726
Expr * DistCond
Distribute Loop condition used when composing 'omp distribute' with 'omp for' in a same construct whe...
Definition: StmtOpenMP.h:732
Expr * Cond
Distribute Loop condition used when composing 'omp distribute' with 'omp for' in a same construct.
Definition: StmtOpenMP.h:723
The expressions built for the OpenMP loop CodeGen for the whole collapsed loop nest.
Definition: StmtOpenMP.h:741
Expr * LastIteration
Loop last iteration number.
Definition: StmtOpenMP.h:745
SmallVector< Expr *, 4 > DependentInits
List of initializers required for the generation of the non-rectangular loops.
Definition: StmtOpenMP.h:803
SmallVector< Expr *, 4 > Inits
Expressions for loop counters inits for CodeGen.
Definition: StmtOpenMP.h:793
Expr * PrevEUB
PrevEUB - expression similar to EUB but to be used when loop scheduling uses PrevLB and PrevUB (e....
Definition: StmtOpenMP.h:787
Expr * DistInc
DistInc - increment expression for distribute loop when found combined with a further loop level (e....
Definition: StmtOpenMP.h:781
Expr * IL
IsLastIteration - local flag variable passed to runtime.
Definition: StmtOpenMP.h:759
SmallVector< Expr *, 4 > PrivateCounters
PrivateCounters Loop counters.
Definition: StmtOpenMP.h:791
Expr * CalcLastIteration
Calculation of last iteration.
Definition: StmtOpenMP.h:749
SmallVector< Expr *, 4 > Updates
Expressions for loop counters update for CodeGen.
Definition: StmtOpenMP.h:795
Expr * ST
Stride - local variable passed to runtime.
Definition: StmtOpenMP.h:765
SmallVector< Expr *, 4 > Finals
Final loop counter values for GodeGen.
Definition: StmtOpenMP.h:797
SmallVector< Expr *, 4 > FinalsConditions
List of final conditions required for the generation of the non-rectangular loops.
Definition: StmtOpenMP.h:806
Expr * PreCond
Loop pre-condition.
Definition: StmtOpenMP.h:751
Stmt * PreInits
Init statement for all captured expressions.
Definition: StmtOpenMP.h:808
Expr * IterationVarRef
Loop iteration variable.
Definition: StmtOpenMP.h:743
Expr * NumIterations
Loop number of iterations.
Definition: StmtOpenMP.h:747
SmallVector< Expr *, 4 > Counters
Counters Loop counters.
Definition: StmtOpenMP.h:789
Expr * NLB
Update of LowerBound for statically scheduled 'omp for' loops.
Definition: StmtOpenMP.h:769
Expr * PrevUB
PreviousUpperBound - local variable passed to runtime in the enclosing schedule or null if that does ...
Definition: StmtOpenMP.h:777
DistCombinedHelperExprs DistCombinedFields
Expressions used when combining OpenMP loop pragmas.
Definition: StmtOpenMP.h:811
Expr * EUB
EnsureUpperBound – expression UB = min(UB, NumIterations).
Definition: StmtOpenMP.h:767
Expr * UB
UpperBound - local variable passed to runtime.
Definition: StmtOpenMP.h:763
Expr * NUB
Update of UpperBound for statically scheduled 'omp for' loops.
Definition: StmtOpenMP.h:771
Expr * LB
LowerBound - local variable passed to runtime.
Definition: StmtOpenMP.h:761
Expr * PrevLB
PreviousLowerBound - local variable passed to runtime in the enclosing schedule or null if that does ...
Definition: StmtOpenMP.h:774
SmallVector< Expr *, 4 > DependentCounters
List of counters required for the generation of the non-rectangular loops.
Definition: StmtOpenMP.h:800
Expr * Init
Loop iteration variable init.
Definition: StmtOpenMP.h:755
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....
Definition: Stmt.h:1303