clang 24.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#include "clang/AST/Attr.h"
16#include "clang/AST/Stmt.h"
17
18using namespace clang;
19using namespace llvm::omp;
20
21/// Returns the intra-tile hint attribute for the given statement.
22const OMPInvariantPredicateBoundAttr *
23OMPLoopBasedDirective::getIntraTileHint(const Stmt *S) {
24 if (const auto *AS = dyn_cast_or_null<AttributedStmt>(S))
26 return nullptr;
27}
28
29/// Peek through an intra-tile hint wrapper to return the underlying loop.
30Stmt *OMPLoopBasedDirective::ignoreIntraTileHint(Stmt *S) {
31 if (auto *AS = dyn_cast_or_null<AttributedStmt>(S))
33 return AS->getSubStmt();
34 return S;
35}
36
37/// Like `Stmt::IgnoreContainers`, but stops at (and preserves) an intra-tile
38/// hint wrapper so that the enclosing loop walker can deliver the hint to
39/// loop-associated analysis (e.g. `collapse`). Non-hint attributed statements
40/// and single-statement compounds are still skipped.
42 while (true) {
43 if (auto *AS = dyn_cast_or_null<AttributedStmt>(S)) {
45 break;
46 S = AS->getSubStmt();
47 continue;
48 }
49 if (auto *CS = dyn_cast_or_null<CompoundStmt>(S)) {
50 if (CS->size() != 1)
51 break;
52 S = CS->body_back();
53 continue;
54 }
55 break;
56 }
57 return S;
58}
59
60size_t OMPChildren::size(unsigned NumClauses, bool HasAssociatedStmt,
61 unsigned NumChildren) {
62 return llvm::alignTo(
63 totalSizeToAlloc<OMPClause *, Stmt *>(
64 NumClauses, NumChildren + (HasAssociatedStmt ? 1 : 0)),
65 alignof(OMPChildren));
66}
67
69 assert(Clauses.size() == NumClauses &&
70 "Number of clauses is not the same as the preallocated buffer");
71 llvm::copy(Clauses, getTrailingObjects<OMPClause *>());
72}
73
75 return getTrailingObjects<Stmt *>(NumChildren);
76}
77
78OMPChildren *OMPChildren::Create(void *Mem, ArrayRef<OMPClause *> Clauses) {
79 auto *Data = CreateEmpty(Mem, Clauses.size());
80 Data->setClauses(Clauses);
81 return Data;
82}
83
84OMPChildren *OMPChildren::Create(void *Mem, ArrayRef<OMPClause *> Clauses,
85 Stmt *S, unsigned NumChildren) {
86 auto *Data = CreateEmpty(Mem, Clauses.size(), S, NumChildren);
87 Data->setClauses(Clauses);
88 if (S)
89 Data->setAssociatedStmt(S);
90 return Data;
91}
92
93OMPChildren *OMPChildren::CreateEmpty(void *Mem, unsigned NumClauses,
94 bool HasAssociatedStmt,
95 unsigned NumChildren) {
96 return new (Mem) OMPChildren(NumClauses, NumChildren, HasAssociatedStmt);
97}
98
99bool OMPExecutableDirective::isStandaloneDirective() const {
100 // Special case: 'omp target enter data', 'omp target exit data',
101 // 'omp target update' are stand-alone directives, but for implementation
102 // reasons they have empty synthetic structured block, to simplify codegen.
106 return true;
107 return !hasAssociatedStmt();
108}
109
110Stmt *OMPExecutableDirective::getStructuredBlock() {
111 assert(!isStandaloneDirective() &&
112 "Standalone Executable Directives don't have Structured Blocks.");
113 if (auto *LD = dyn_cast<OMPLoopDirective>(this))
114 return LD->getBody();
115 return getRawStmt();
116}
117
118Stmt *
119OMPLoopBasedDirective::tryToFindNextInnerLoop(Stmt *CurStmt,
120 bool TryImperfectlyNestedLoops) {
121 Stmt *OrigStmt = CurStmt;
122 CurStmt = ignoreContainersKeepingIntraTileHint(CurStmt);
123 // Additional work for imperfectly nested loops, introduced in OpenMP 5.0.
124 if (TryImperfectlyNestedLoops) {
125 if (auto *CS = dyn_cast<CompoundStmt>(CurStmt)) {
126 CurStmt = nullptr;
127 SmallVector<CompoundStmt *, 4> Statements(1, CS);
128 SmallVector<CompoundStmt *, 4> NextStatements;
129 while (!Statements.empty()) {
130 CS = Statements.pop_back_val();
131 if (!CS)
132 continue;
133 for (Stmt *S : CS->body()) {
134 if (!S)
135 continue;
136 // Peek past an OMPCanonicalLoop wrapper and/or an intra-tile hint to
137 // check whether this child is loop-like; keep the original (wrapped)
138 // node in CurStmt so the hint still reaches the loop-analysis
139 // callback.
140 Stmt *Inner = S;
141 if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Inner))
142 Inner = CanonLoop->getLoopStmt();
143 Inner = OMPLoopBasedDirective::ignoreIntraTileHint(Inner);
144 if (isa<ForStmt>(Inner) || isa<CXXForRangeStmt>(Inner) ||
146 !isa<OMPLoopDirective>(Inner))) {
147 // Only single loop construct is allowed.
148 if (CurStmt) {
149 CurStmt = OrigStmt;
150 break;
151 }
152 CurStmt = S;
153 continue;
154 }
155 S = S->IgnoreContainers();
156 if (auto *InnerCS = dyn_cast_or_null<CompoundStmt>(S))
157 NextStatements.push_back(InnerCS);
158 }
159 if (Statements.empty()) {
160 // Found single inner loop or multiple loops - exit.
161 if (CurStmt)
162 break;
163 Statements.swap(NextStatements);
164 }
165 }
166 if (!CurStmt)
167 CurStmt = OrigStmt;
168 }
169 }
170 return CurStmt;
171}
172
173bool OMPLoopBasedDirective::doForAllLoops(
174 Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops,
175 llvm::function_ref<bool(unsigned, Stmt *, Stmt *)> Callback,
176 llvm::function_ref<void(OMPLoopTransformationDirective *)>
178 CurStmt = ignoreContainersKeepingIntraTileHint(CurStmt);
179 for (unsigned Cnt = 0; Cnt < NumLoops; ++Cnt) {
180 while (true) {
181 auto *Dir = dyn_cast<OMPLoopTransformationDirective>(CurStmt);
182 if (!Dir)
183 break;
184
186
187 Stmt *TransformedStmt = Dir->getTransformedStmt();
188 if (!TransformedStmt) {
189 unsigned NumGeneratedTopLevelLoops =
190 Dir->getNumGeneratedTopLevelLoops();
191 if (NumGeneratedTopLevelLoops == 0) {
192 // May happen if the loop transformation does not result in a
193 // generated loop (such as full unrolling).
194 break;
195 }
196 if (NumGeneratedTopLevelLoops > 0) {
197 // The loop transformation construct has generated loops, but these
198 // may not have been generated yet due to being in a dependent
199 // context.
200 return true;
201 }
202 }
203
204 CurStmt = TransformedStmt;
205 }
206 if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(CurStmt))
207 CurStmt = CanonLoop->getLoopStmt();
208 // Always hand the real loop to the callback and pass the hint wrapper
209 // separately so the callee can read it.
210 Stmt *LoopStmt = ignoreIntraTileHint(CurStmt);
211 Stmt *HintWrapper = LoopStmt != CurStmt ? CurStmt : nullptr;
212 if (Callback(Cnt, LoopStmt, HintWrapper))
213 return false;
214 // Move on to the next nested for loop, or to the loop body.
215 // OpenMP [2.8.1, simd construct, Restrictions]
216 // All loops associated with the construct must be perfectly nested; that
217 // is, there must be no intervening code nor any OpenMP directive between
218 // any two loops.
219 if (auto *For = dyn_cast<ForStmt>(LoopStmt)) {
220 CurStmt = For->getBody();
221 } else {
222 assert(isa<CXXForRangeStmt>(LoopStmt) &&
223 "Expected canonical for or range-based for loops.");
224 CurStmt = cast<CXXForRangeStmt>(LoopStmt)->getBody();
225 }
226 CurStmt = OMPLoopBasedDirective::tryToFindNextInnerLoop(
227 CurStmt, TryImperfectlyNestedLoops);
228 }
229 return true;
230}
231
232void OMPLoopBasedDirective::doForAllLoopsBodies(
233 Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops,
234 llvm::function_ref<void(unsigned, Stmt *, Stmt *)> Callback) {
235 bool Res = OMPLoopBasedDirective::doForAllLoops(
236 CurStmt, TryImperfectlyNestedLoops, NumLoops,
237 [Callback](unsigned Cnt, Stmt *Loop) {
238 Stmt *Body = nullptr;
239 if (auto *For = dyn_cast<ForStmt>(Loop)) {
240 Body = For->getBody();
241 } else {
242 assert(isa<CXXForRangeStmt>(Loop) &&
243 "Expected canonical for or range-based for loops.");
244 Body = cast<CXXForRangeStmt>(Loop)->getBody();
245 }
246 if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Body))
247 Body = CanonLoop->getLoopStmt();
248 Callback(Cnt, Loop, Body);
249 return false;
250 });
251 assert(Res && "Expected only loops");
252 (void)Res;
253}
254
256 // This relies on the loop form is already checked by Sema.
257 Stmt *Body = nullptr;
258 OMPLoopBasedDirective::doForAllLoopsBodies(
259 Data->getRawStmt(), /*TryImperfectlyNestedLoops=*/true,
260 NumAssociatedLoops,
261 [&Body](unsigned, Stmt *, Stmt *BodyStmt) { Body = BodyStmt; });
262 return Body;
263}
264
266 assert(A.size() == getLoopsNumber() &&
267 "Number of loop counters is not the same as the collapsed number");
268 llvm::copy(A, getCounters().begin());
269}
270
272 assert(A.size() == getLoopsNumber() && "Number of loop private counters "
273 "is not the same as the collapsed "
274 "number");
275 llvm::copy(A, getPrivateCounters().begin());
276}
277
279 assert(A.size() == getLoopsNumber() &&
280 "Number of counter inits is not the same as the collapsed number");
281 llvm::copy(A, getInits().begin());
282}
283
285 assert(A.size() == getLoopsNumber() &&
286 "Number of counter updates is not the same as the collapsed number");
287 llvm::copy(A, getUpdates().begin());
288}
289
291 assert(A.size() == getLoopsNumber() &&
292 "Number of counter finals is not the same as the collapsed number");
293 llvm::copy(A, getFinals().begin());
294}
295
297 assert(
298 A.size() == getLoopsNumber() &&
299 "Number of dependent counters is not the same as the collapsed number");
300 llvm::copy(A, getDependentCounters().begin());
301}
302
304 assert(A.size() == getLoopsNumber() &&
305 "Number of dependent inits is not the same as the collapsed number");
306 llvm::copy(A, getDependentInits().begin());
307}
308
310 assert(A.size() == getLoopsNumber() &&
311 "Number of finals conditions is not the same as the collapsed number");
312 llvm::copy(A, getFinalsConditions().begin());
313}
314
315OMPMetaDirective *OMPMetaDirective::Create(const ASTContext &C,
316 SourceLocation StartLoc,
317 SourceLocation EndLoc,
318 ArrayRef<OMPClause *> Clauses,
319 Stmt *AssociatedStmt, Stmt *IfStmt) {
320 auto *Dir = createDirective<OMPMetaDirective>(
321 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
322 Dir->setIfStmt(IfStmt);
323 return Dir;
324}
325
327 unsigned NumClauses,
328 EmptyShell) {
329 return createEmptyDirective<OMPMetaDirective>(C, NumClauses,
330 /*HasAssociatedStmt=*/true,
331 /*NumChildren=*/1);
332}
333
334OMPParallelDirective *OMPParallelDirective::Create(
335 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
336 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
337 bool HasCancel) {
338 auto *Dir = createDirective<OMPParallelDirective>(
339 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
340 Dir->setTaskReductionRefExpr(TaskRedRef);
341 Dir->setHasCancel(HasCancel);
342 return Dir;
343}
344
345OMPParallelDirective *OMPParallelDirective::CreateEmpty(const ASTContext &C,
346 unsigned NumClauses,
347 EmptyShell) {
348 return createEmptyDirective<OMPParallelDirective>(C, NumClauses,
349 /*HasAssociatedStmt=*/true,
350 /*NumChildren=*/1);
351}
352
355 SourceLocation EndLoc, unsigned CollapsedNum,
356 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
357 const HelperExprs &Exprs) {
358 auto *Dir = createDirective<OMPSimdDirective>(
359 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_simd),
360 StartLoc, EndLoc, CollapsedNum);
361 Dir->setIterationVariable(Exprs.IterationVarRef);
362 Dir->setLastIteration(Exprs.LastIteration);
363 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
364 Dir->setPreCond(Exprs.PreCond);
365 Dir->setCond(Exprs.Cond);
366 Dir->setInit(Exprs.Init);
367 Dir->setInc(Exprs.Inc);
368 Dir->setCounters(Exprs.Counters);
369 Dir->setPrivateCounters(Exprs.PrivateCounters);
370 Dir->setInits(Exprs.Inits);
371 Dir->setUpdates(Exprs.Updates);
372 Dir->setFinals(Exprs.Finals);
373 Dir->setDependentCounters(Exprs.DependentCounters);
374 Dir->setDependentInits(Exprs.DependentInits);
375 Dir->setFinalsConditions(Exprs.FinalsConditions);
376 Dir->setPreInits(Exprs.PreInits);
377 return Dir;
378}
379
381 unsigned NumClauses,
382 unsigned CollapsedNum,
383 EmptyShell) {
384 return createEmptyDirective<OMPSimdDirective>(
385 C, NumClauses, /*HasAssociatedStmt=*/true,
386 numLoopChildren(CollapsedNum, OMPD_simd), CollapsedNum);
387}
388
389OMPForDirective *OMPForDirective::Create(
390 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
391 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
392 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
393 auto *Dir = createDirective<OMPForDirective>(
394 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for) + 1,
395 StartLoc, EndLoc, CollapsedNum);
396 Dir->setIterationVariable(Exprs.IterationVarRef);
397 Dir->setLastIteration(Exprs.LastIteration);
398 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
399 Dir->setPreCond(Exprs.PreCond);
400 Dir->setCond(Exprs.Cond);
401 Dir->setInit(Exprs.Init);
402 Dir->setInc(Exprs.Inc);
403 Dir->setIsLastIterVariable(Exprs.IL);
404 Dir->setLowerBoundVariable(Exprs.LB);
405 Dir->setUpperBoundVariable(Exprs.UB);
406 Dir->setStrideVariable(Exprs.ST);
407 Dir->setEnsureUpperBound(Exprs.EUB);
408 Dir->setNextLowerBound(Exprs.NLB);
409 Dir->setNextUpperBound(Exprs.NUB);
410 Dir->setNumIterations(Exprs.NumIterations);
411 Dir->setCounters(Exprs.Counters);
412 Dir->setPrivateCounters(Exprs.PrivateCounters);
413 Dir->setInits(Exprs.Inits);
414 Dir->setUpdates(Exprs.Updates);
415 Dir->setFinals(Exprs.Finals);
416 Dir->setDependentCounters(Exprs.DependentCounters);
417 Dir->setDependentInits(Exprs.DependentInits);
418 Dir->setFinalsConditions(Exprs.FinalsConditions);
419 Dir->setPreInits(Exprs.PreInits);
420 Dir->setTaskReductionRefExpr(TaskRedRef);
421 Dir->setHasCancel(HasCancel);
422 return Dir;
423}
424
426 if (auto *D = dyn_cast<OMPCanonicalLoopNestTransformationDirective>(S))
427 return D->getTransformedStmt();
428 if (auto *D = dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S))
429 return D->getTransformedStmt();
430 llvm_unreachable("unexpected object type");
431}
432
434 if (auto *D = dyn_cast<OMPCanonicalLoopNestTransformationDirective>(S))
435 return D->getPreInits();
436 if (auto *D = dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S))
437 return D->getPreInits();
438 llvm_unreachable("unexpected object type");
439}
440
442 switch (getStmtClass()) {
443#define STMT(CLASS, PARENT)
444#define ABSTRACT_STMT(CLASS)
445#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
446 case Stmt::CLASS##Class: \
447 return static_cast<const CLASS *>(this)->getTransformedStmt();
448#include "clang/AST/StmtNodes.inc"
449 default:
450 llvm_unreachable("Not a loop transformation for canonical loop nests");
451 }
452}
453
455 switch (getStmtClass()) {
456#define STMT(CLASS, PARENT)
457#define ABSTRACT_STMT(CLASS)
458#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
459 case Stmt::CLASS##Class: \
460 return static_cast<const CLASS *>(this)->getPreInits();
461#include "clang/AST/StmtNodes.inc"
462 default:
463 llvm_unreachable("Not a loop transformation for canonical loop nests");
464 }
465}
466
467Stmt *
469 switch (getStmtClass()) {
470#define STMT(CLASS, PARENT)
471#define ABSTRACT_STMT(CLASS)
472#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
473 case Stmt::CLASS##Class: \
474 return static_cast<const CLASS *>(this)->getTransformedStmt();
475#include "clang/AST/StmtNodes.inc"
476 default:
477 llvm_unreachable("Not a loop transformation for canonical loop sequences");
478 }
479}
480
482 switch (getStmtClass()) {
483#define STMT(CLASS, PARENT)
484#define ABSTRACT_STMT(CLASS)
485#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
486 case Stmt::CLASS##Class: \
487 return static_cast<const CLASS *>(this)->getPreInits();
488#include "clang/AST/StmtNodes.inc"
489 default:
490 llvm_unreachable("Not a loop transformation for canonical loop sequences");
491 }
492}
493
495 unsigned NumClauses,
496 unsigned CollapsedNum,
497 EmptyShell) {
498 return createEmptyDirective<OMPForDirective>(
499 C, NumClauses, /*HasAssociatedStmt=*/true,
500 numLoopChildren(CollapsedNum, OMPD_for) + 1, CollapsedNum);
501}
502
506 unsigned NumLoops, Stmt *AssociatedStmt,
507 Stmt *TransformedStmt, Stmt *PreInits) {
508 OMPTileDirective *Dir = createDirective<OMPTileDirective>(
509 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
510 NumLoops);
511 Dir->setTransformedStmt(TransformedStmt);
512 Dir->setPreInits(PreInits);
513 return Dir;
514}
515
517 unsigned NumClauses,
518 unsigned NumLoops) {
519 return createEmptyDirective<OMPTileDirective>(
520 C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1,
521 SourceLocation(), SourceLocation(), NumLoops);
522}
523
527 unsigned NumLoops, Stmt *AssociatedStmt,
528 Stmt *TransformedStmt, Stmt *PreInits) {
529 OMPStripeDirective *Dir = createDirective<OMPStripeDirective>(
530 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
531 NumLoops);
532 Dir->setTransformedStmt(TransformedStmt);
533 Dir->setPreInits(PreInits);
534 return Dir;
535}
536
538 unsigned NumClauses,
539 unsigned NumLoops) {
540 return createEmptyDirective<OMPStripeDirective>(
541 C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1,
542 SourceLocation(), SourceLocation(), NumLoops);
543}
544
545OMPUnrollDirective *OMPUnrollDirective::Create(
546 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
547 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
548 unsigned NumGeneratedTopLevelLoops, Stmt *TransformedStmt, Stmt *PreInits) {
549 assert(NumGeneratedTopLevelLoops <= 1 &&
550 "Unrolling generates at most one loop");
551
552 auto *Dir = createDirective<OMPUnrollDirective>(
553 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc);
554 Dir->setNumGeneratedTopLevelLoops(NumGeneratedTopLevelLoops);
555 Dir->setTransformedStmt(TransformedStmt);
556 Dir->setPreInits(PreInits);
557 return Dir;
558}
559
561 unsigned NumClauses) {
562 return createEmptyDirective<OMPUnrollDirective>(
563 C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1,
565}
566
569 SourceLocation EndLoc, Stmt *AssociatedStmt,
570 unsigned NumLoops, Stmt *TransformedStmt,
571 Stmt *PreInits) {
572 OMPReverseDirective *Dir = createDirective<OMPReverseDirective>(
573 C, {}, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
574 NumLoops);
575 Dir->setTransformedStmt(TransformedStmt);
576 Dir->setPreInits(PreInits);
577 return Dir;
578}
579
581 unsigned NumLoops) {
582 return createEmptyDirective<OMPReverseDirective>(
583 C, /*NumClauses=*/0, /*HasAssociatedStmt=*/true,
584 TransformedStmtOffset + 1, SourceLocation(), SourceLocation(), NumLoops);
585}
586
587OMPInterchangeDirective *OMPInterchangeDirective::Create(
588 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
589 ArrayRef<OMPClause *> Clauses, unsigned NumLoops, Stmt *AssociatedStmt,
590 Stmt *TransformedStmt, Stmt *PreInits) {
591 OMPInterchangeDirective *Dir = createDirective<OMPInterchangeDirective>(
592 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
593 NumLoops);
594 Dir->setTransformedStmt(TransformedStmt);
595 Dir->setPreInits(PreInits);
596 return Dir;
597}
598
601 unsigned NumLoops) {
602 return createEmptyDirective<OMPInterchangeDirective>(
603 C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1,
604 SourceLocation(), SourceLocation(), NumLoops);
605}
606
610 unsigned NumLoops, Stmt *AssociatedStmt,
611 Stmt *TransformedStmt, Stmt *PreInits) {
612 OMPSplitDirective *Dir = createDirective<OMPSplitDirective>(
613 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
614 NumLoops);
615 Dir->setTransformedStmt(TransformedStmt);
616 Dir->setPreInits(PreInits);
617 return Dir;
618}
619
621 unsigned NumClauses,
622 unsigned NumLoops) {
623 return createEmptyDirective<OMPSplitDirective>(
624 C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1,
625 SourceLocation(), SourceLocation(), NumLoops);
626}
627
628OMPFuseDirective *OMPFuseDirective::Create(
629 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
630 ArrayRef<OMPClause *> Clauses, unsigned NumGeneratedTopLevelLoops,
631 Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits) {
632
633 OMPFuseDirective *Dir = createDirective<OMPFuseDirective>(
634 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc);
635 Dir->setTransformedStmt(TransformedStmt);
636 Dir->setPreInits(PreInits);
637 Dir->setNumGeneratedTopLevelLoops(NumGeneratedTopLevelLoops);
638 return Dir;
639}
640
642 unsigned NumClauses) {
643 OMPFuseDirective *Dir = createEmptyDirective<OMPFuseDirective>(
644 C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1,
646 return Dir;
647}
648
651 SourceLocation EndLoc, unsigned CollapsedNum,
652 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
653 const HelperExprs &Exprs) {
654 auto *Dir = createDirective<OMPForSimdDirective>(
655 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for_simd),
656 StartLoc, EndLoc, CollapsedNum);
657 Dir->setIterationVariable(Exprs.IterationVarRef);
658 Dir->setLastIteration(Exprs.LastIteration);
659 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
660 Dir->setPreCond(Exprs.PreCond);
661 Dir->setCond(Exprs.Cond);
662 Dir->setInit(Exprs.Init);
663 Dir->setInc(Exprs.Inc);
664 Dir->setIsLastIterVariable(Exprs.IL);
665 Dir->setLowerBoundVariable(Exprs.LB);
666 Dir->setUpperBoundVariable(Exprs.UB);
667 Dir->setStrideVariable(Exprs.ST);
668 Dir->setEnsureUpperBound(Exprs.EUB);
669 Dir->setNextLowerBound(Exprs.NLB);
670 Dir->setNextUpperBound(Exprs.NUB);
671 Dir->setNumIterations(Exprs.NumIterations);
672 Dir->setCounters(Exprs.Counters);
673 Dir->setPrivateCounters(Exprs.PrivateCounters);
674 Dir->setInits(Exprs.Inits);
675 Dir->setUpdates(Exprs.Updates);
676 Dir->setFinals(Exprs.Finals);
677 Dir->setDependentCounters(Exprs.DependentCounters);
678 Dir->setDependentInits(Exprs.DependentInits);
679 Dir->setFinalsConditions(Exprs.FinalsConditions);
680 Dir->setPreInits(Exprs.PreInits);
681 return Dir;
682}
683
685 unsigned NumClauses,
686 unsigned CollapsedNum,
687 EmptyShell) {
688 return createEmptyDirective<OMPForSimdDirective>(
689 C, NumClauses, /*HasAssociatedStmt=*/true,
690 numLoopChildren(CollapsedNum, OMPD_for_simd), CollapsedNum);
691}
692
693OMPSectionsDirective *OMPSectionsDirective::Create(
694 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
695 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
696 bool HasCancel) {
697 auto *Dir = createDirective<OMPSectionsDirective>(C, Clauses, AssociatedStmt,
698 /*NumChildren=*/1, StartLoc,
699 EndLoc);
700 Dir->setTaskReductionRefExpr(TaskRedRef);
701 Dir->setHasCancel(HasCancel);
702 return Dir;
703}
704
705OMPSectionsDirective *OMPSectionsDirective::CreateEmpty(const ASTContext &C,
706 unsigned NumClauses,
707 EmptyShell) {
708 return createEmptyDirective<OMPSectionsDirective>(C, NumClauses,
709 /*HasAssociatedStmt=*/true,
710 /*NumChildren=*/1);
711}
712
713OMPSectionDirective *OMPSectionDirective::Create(const ASTContext &C,
714 SourceLocation StartLoc,
715 SourceLocation EndLoc,
716 Stmt *AssociatedStmt,
717 bool HasCancel) {
718 auto *Dir =
719 createDirective<OMPSectionDirective>(C, {}, AssociatedStmt,
720 /*NumChildren=*/0, StartLoc, EndLoc);
721 Dir->setHasCancel(HasCancel);
722 return Dir;
723}
724
726 EmptyShell) {
727 return createEmptyDirective<OMPSectionDirective>(C, /*NumClauses=*/0,
728 /*HasAssociatedStmt=*/true);
729}
730
731OMPScopeDirective *OMPScopeDirective::Create(const ASTContext &C,
732 SourceLocation StartLoc,
733 SourceLocation EndLoc,
734 ArrayRef<OMPClause *> Clauses,
735 Stmt *AssociatedStmt) {
736 return createDirective<OMPScopeDirective>(C, Clauses, AssociatedStmt,
737 /*NumChildren=*/0, StartLoc,
738 EndLoc);
739}
740
742 unsigned NumClauses,
743 EmptyShell) {
744 return createEmptyDirective<OMPScopeDirective>(C, NumClauses,
745 /*HasAssociatedStmt=*/true);
746}
747
748OMPSingleDirective *OMPSingleDirective::Create(const ASTContext &C,
749 SourceLocation StartLoc,
750 SourceLocation EndLoc,
751 ArrayRef<OMPClause *> Clauses,
752 Stmt *AssociatedStmt) {
753 return createDirective<OMPSingleDirective>(C, Clauses, AssociatedStmt,
754 /*NumChildren=*/0, StartLoc,
755 EndLoc);
756}
757
759 unsigned NumClauses,
760 EmptyShell) {
761 return createEmptyDirective<OMPSingleDirective>(C, NumClauses,
762 /*HasAssociatedStmt=*/true);
763}
764
765OMPMasterDirective *OMPMasterDirective::Create(const ASTContext &C,
766 SourceLocation StartLoc,
767 SourceLocation EndLoc,
768 Stmt *AssociatedStmt) {
769 return createDirective<OMPMasterDirective>(C, {}, AssociatedStmt,
770 /*NumChildren=*/0, StartLoc,
771 EndLoc);
772}
773
775 EmptyShell) {
776 return createEmptyDirective<OMPMasterDirective>(C, /*NumClauses=*/0,
777 /*HasAssociatedStmt=*/true);
778}
779
780OMPCriticalDirective *OMPCriticalDirective::Create(
781 const ASTContext &C, const DeclarationNameInfo &Name,
782 SourceLocation StartLoc, SourceLocation EndLoc,
783 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
784 return createDirective<OMPCriticalDirective>(C, Clauses, AssociatedStmt,
785 /*NumChildren=*/0, Name,
786 StartLoc, EndLoc);
787}
788
789OMPCriticalDirective *OMPCriticalDirective::CreateEmpty(const ASTContext &C,
790 unsigned NumClauses,
791 EmptyShell) {
792 return createEmptyDirective<OMPCriticalDirective>(C, NumClauses,
793 /*HasAssociatedStmt=*/true);
794}
795
796OMPParallelForDirective *OMPParallelForDirective::Create(
797 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
798 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
799 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
800 auto *Dir = createDirective<OMPParallelForDirective>(
801 C, Clauses, AssociatedStmt,
802 numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, StartLoc, EndLoc,
803 CollapsedNum);
804 Dir->setIterationVariable(Exprs.IterationVarRef);
805 Dir->setLastIteration(Exprs.LastIteration);
806 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
807 Dir->setPreCond(Exprs.PreCond);
808 Dir->setCond(Exprs.Cond);
809 Dir->setInit(Exprs.Init);
810 Dir->setInc(Exprs.Inc);
811 Dir->setIsLastIterVariable(Exprs.IL);
812 Dir->setLowerBoundVariable(Exprs.LB);
813 Dir->setUpperBoundVariable(Exprs.UB);
814 Dir->setStrideVariable(Exprs.ST);
815 Dir->setEnsureUpperBound(Exprs.EUB);
816 Dir->setNextLowerBound(Exprs.NLB);
817 Dir->setNextUpperBound(Exprs.NUB);
818 Dir->setNumIterations(Exprs.NumIterations);
819 Dir->setCounters(Exprs.Counters);
820 Dir->setPrivateCounters(Exprs.PrivateCounters);
821 Dir->setInits(Exprs.Inits);
822 Dir->setUpdates(Exprs.Updates);
823 Dir->setFinals(Exprs.Finals);
824 Dir->setDependentCounters(Exprs.DependentCounters);
825 Dir->setDependentInits(Exprs.DependentInits);
826 Dir->setFinalsConditions(Exprs.FinalsConditions);
827 Dir->setPreInits(Exprs.PreInits);
828 Dir->setTaskReductionRefExpr(TaskRedRef);
829 Dir->setHasCancel(HasCancel);
830 return Dir;
831}
832
835 unsigned CollapsedNum, EmptyShell) {
836 return createEmptyDirective<OMPParallelForDirective>(
837 C, NumClauses, /*HasAssociatedStmt=*/true,
838 numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, CollapsedNum);
839}
840
841OMPParallelForSimdDirective *OMPParallelForSimdDirective::Create(
842 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
843 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
844 const HelperExprs &Exprs) {
845 auto *Dir = createDirective<OMPParallelForSimdDirective>(
846 C, Clauses, AssociatedStmt,
847 numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), StartLoc, EndLoc,
848 CollapsedNum);
849 Dir->setIterationVariable(Exprs.IterationVarRef);
850 Dir->setLastIteration(Exprs.LastIteration);
851 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
852 Dir->setPreCond(Exprs.PreCond);
853 Dir->setCond(Exprs.Cond);
854 Dir->setInit(Exprs.Init);
855 Dir->setInc(Exprs.Inc);
856 Dir->setIsLastIterVariable(Exprs.IL);
857 Dir->setLowerBoundVariable(Exprs.LB);
858 Dir->setUpperBoundVariable(Exprs.UB);
859 Dir->setStrideVariable(Exprs.ST);
860 Dir->setEnsureUpperBound(Exprs.EUB);
861 Dir->setNextLowerBound(Exprs.NLB);
862 Dir->setNextUpperBound(Exprs.NUB);
863 Dir->setNumIterations(Exprs.NumIterations);
864 Dir->setCounters(Exprs.Counters);
865 Dir->setPrivateCounters(Exprs.PrivateCounters);
866 Dir->setInits(Exprs.Inits);
867 Dir->setUpdates(Exprs.Updates);
868 Dir->setFinals(Exprs.Finals);
869 Dir->setDependentCounters(Exprs.DependentCounters);
870 Dir->setDependentInits(Exprs.DependentInits);
871 Dir->setFinalsConditions(Exprs.FinalsConditions);
872 Dir->setPreInits(Exprs.PreInits);
873 return Dir;
874}
875
878 unsigned NumClauses,
879 unsigned CollapsedNum, EmptyShell) {
880 return createEmptyDirective<OMPParallelForSimdDirective>(
881 C, NumClauses, /*HasAssociatedStmt=*/true,
882 numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), CollapsedNum);
883}
884
885OMPParallelMasterDirective *OMPParallelMasterDirective::Create(
886 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
887 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) {
888 auto *Dir = createDirective<OMPParallelMasterDirective>(
889 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
890 Dir->setTaskReductionRefExpr(TaskRedRef);
891 return Dir;
892}
893
896 unsigned NumClauses, EmptyShell) {
897 return createEmptyDirective<OMPParallelMasterDirective>(
898 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
899}
900
901OMPParallelMaskedDirective *OMPParallelMaskedDirective::Create(
902 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
903 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) {
904 auto *Dir = createDirective<OMPParallelMaskedDirective>(
905 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
906 Dir->setTaskReductionRefExpr(TaskRedRef);
907 return Dir;
908}
909
912 unsigned NumClauses, EmptyShell) {
913 return createEmptyDirective<OMPParallelMaskedDirective>(
914 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
915}
916
917OMPParallelSectionsDirective *OMPParallelSectionsDirective::Create(
918 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
919 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
920 bool HasCancel) {
921 auto *Dir = createDirective<OMPParallelSectionsDirective>(
922 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
923 Dir->setTaskReductionRefExpr(TaskRedRef);
924 Dir->setHasCancel(HasCancel);
925 return Dir;
926}
927
930 unsigned NumClauses, EmptyShell) {
931 return createEmptyDirective<OMPParallelSectionsDirective>(
932 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
933}
934
938 Stmt *AssociatedStmt, bool HasCancel) {
939 auto *Dir = createDirective<OMPTaskDirective>(
940 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
941 Dir->setHasCancel(HasCancel);
942 return Dir;
943}
944
946 unsigned NumClauses,
947 EmptyShell) {
948 return createEmptyDirective<OMPTaskDirective>(C, NumClauses,
949 /*HasAssociatedStmt=*/true);
950}
951
952OMPTaskyieldDirective *OMPTaskyieldDirective::Create(const ASTContext &C,
953 SourceLocation StartLoc,
954 SourceLocation EndLoc) {
955 return new (C) OMPTaskyieldDirective(StartLoc, EndLoc);
956}
957
958OMPTaskyieldDirective *OMPTaskyieldDirective::CreateEmpty(const ASTContext &C,
959 EmptyShell) {
960 return new (C) OMPTaskyieldDirective();
961}
962
963OMPAssumeDirective *OMPAssumeDirective::Create(const ASTContext &C,
964 SourceLocation StartLoc,
965 SourceLocation EndLoc,
966 ArrayRef<OMPClause *> Clauses,
967 Stmt *AStmt) {
968 return createDirective<OMPAssumeDirective>(C, Clauses, AStmt,
969 /*NumChildren=*/0, StartLoc,
970 EndLoc);
971}
972
974 unsigned NumClauses,
975 EmptyShell) {
976 return createEmptyDirective<OMPAssumeDirective>(C, NumClauses,
977 /*HasAssociatedStmt=*/true);
978}
979
980OMPErrorDirective *OMPErrorDirective::Create(const ASTContext &C,
981 SourceLocation StartLoc,
982 SourceLocation EndLoc,
983 ArrayRef<OMPClause *> Clauses) {
984 return createDirective<OMPErrorDirective>(
985 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
986 EndLoc);
987}
988
990 unsigned NumClauses,
991 EmptyShell) {
992 return createEmptyDirective<OMPErrorDirective>(C, NumClauses);
993}
994
995OMPBarrierDirective *OMPBarrierDirective::Create(const ASTContext &C,
996 SourceLocation StartLoc,
997 SourceLocation EndLoc) {
998 return new (C) OMPBarrierDirective(StartLoc, EndLoc);
999}
1000
1002 EmptyShell) {
1003 return new (C) OMPBarrierDirective();
1004}
1005
1008 SourceLocation EndLoc,
1009 ArrayRef<OMPClause *> Clauses) {
1010 return createDirective<OMPTaskwaitDirective>(
1011 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1012 EndLoc);
1013}
1014
1016 unsigned NumClauses,
1017 EmptyShell) {
1018 return createEmptyDirective<OMPTaskwaitDirective>(C, NumClauses);
1019}
1020
1021OMPTaskgroupDirective *OMPTaskgroupDirective::Create(
1022 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1023 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) {
1024 auto *Dir = createDirective<OMPTaskgroupDirective>(
1025 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
1026 Dir->setReductionRef(ReductionRef);
1027 return Dir;
1028}
1029
1031 unsigned NumClauses,
1032 EmptyShell) {
1033 return createEmptyDirective<OMPTaskgroupDirective>(
1034 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
1035}
1036
1037OMPCancellationPointDirective *OMPCancellationPointDirective::Create(
1038 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1039 OpenMPDirectiveKind CancelRegion) {
1040 auto *Dir = new (C) OMPCancellationPointDirective(StartLoc, EndLoc);
1041 Dir->setCancelRegion(CancelRegion);
1042 return Dir;
1043}
1044
1047 return new (C) OMPCancellationPointDirective();
1048}
1049
1052 SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
1053 OpenMPDirectiveKind CancelRegion) {
1054 auto *Dir = createDirective<OMPCancelDirective>(
1055 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1056 EndLoc);
1057 Dir->setCancelRegion(CancelRegion);
1058 return Dir;
1059}
1060
1062 unsigned NumClauses,
1063 EmptyShell) {
1064 return createEmptyDirective<OMPCancelDirective>(C, NumClauses);
1065}
1066
1067OMPFlushDirective *OMPFlushDirective::Create(const ASTContext &C,
1068 SourceLocation StartLoc,
1069 SourceLocation EndLoc,
1070 ArrayRef<OMPClause *> Clauses) {
1071 return createDirective<OMPFlushDirective>(
1072 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1073 EndLoc);
1074}
1075
1077 unsigned NumClauses,
1078 EmptyShell) {
1079 return createEmptyDirective<OMPFlushDirective>(C, NumClauses);
1080}
1081
1082OMPDepobjDirective *OMPDepobjDirective::Create(const ASTContext &C,
1083 SourceLocation StartLoc,
1084 SourceLocation EndLoc,
1085 ArrayRef<OMPClause *> Clauses) {
1086 return createDirective<OMPDepobjDirective>(
1087 C, Clauses, /*AssociatedStmt=*/nullptr,
1088 /*NumChildren=*/0, StartLoc, EndLoc);
1089}
1090
1092 unsigned NumClauses,
1093 EmptyShell) {
1094 return createEmptyDirective<OMPDepobjDirective>(C, NumClauses);
1095}
1096
1097OMPScanDirective *OMPScanDirective::Create(const ASTContext &C,
1098 SourceLocation StartLoc,
1099 SourceLocation EndLoc,
1100 ArrayRef<OMPClause *> Clauses) {
1101 return createDirective<OMPScanDirective>(C, Clauses,
1102 /*AssociatedStmt=*/nullptr,
1103 /*NumChildren=*/0, StartLoc, EndLoc);
1104}
1105
1107 unsigned NumClauses,
1108 EmptyShell) {
1109 return createEmptyDirective<OMPScanDirective>(C, NumClauses);
1110}
1111
1112OMPOrderedStandaloneDirective *OMPOrderedStandaloneDirective::Create(
1113 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1114 ArrayRef<OMPClause *> Clauses) {
1115 return createDirective<OMPOrderedStandaloneDirective>(
1116 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1117 EndLoc);
1118}
1119
1122 unsigned NumClauses, EmptyShell) {
1123 return createEmptyDirective<OMPOrderedStandaloneDirective>(C, NumClauses);
1124}
1125
1126OMPOrderedBlockAssocDirective *OMPOrderedBlockAssocDirective::Create(
1127 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1128 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1129 return createDirective<OMPOrderedBlockAssocDirective>(
1130 C, Clauses, cast<CapturedStmt>(AssociatedStmt), /*NumChildren=*/0,
1131 StartLoc, EndLoc);
1132}
1133
1136 unsigned NumClauses, EmptyShell) {
1137 return createEmptyDirective<OMPOrderedBlockAssocDirective>(
1138 C, NumClauses, /*HasAssociatedStmt=*/true);
1139}
1140
1143 SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
1144 Stmt *AssociatedStmt, Expressions Exprs) {
1145 auto *Dir = createDirective<OMPAtomicDirective>(
1146 C, Clauses, AssociatedStmt, /*NumChildren=*/7, StartLoc, EndLoc);
1147 Dir->setX(Exprs.X);
1148 Dir->setV(Exprs.V);
1149 Dir->setR(Exprs.R);
1150 Dir->setExpr(Exprs.E);
1151 Dir->setUpdateExpr(Exprs.UE);
1152 Dir->setD(Exprs.D);
1153 Dir->setCond(Exprs.Cond);
1154 Dir->Flags.IsXLHSInRHSPart = Exprs.IsXLHSInRHSPart ? 1 : 0;
1155 Dir->Flags.IsPostfixUpdate = Exprs.IsPostfixUpdate ? 1 : 0;
1156 Dir->Flags.IsFailOnly = Exprs.IsFailOnly ? 1 : 0;
1157 return Dir;
1158}
1159
1161 unsigned NumClauses,
1162 EmptyShell) {
1163 return createEmptyDirective<OMPAtomicDirective>(
1164 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/7);
1165}
1166
1167OMPTargetDirective *OMPTargetDirective::Create(const ASTContext &C,
1168 SourceLocation StartLoc,
1169 SourceLocation EndLoc,
1170 ArrayRef<OMPClause *> Clauses,
1171 Stmt *AssociatedStmt) {
1172 return createDirective<OMPTargetDirective>(
1173 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1174}
1175
1177 unsigned NumClauses,
1178 EmptyShell) {
1179 return createEmptyDirective<OMPTargetDirective>(C, NumClauses,
1180 /*HasAssociatedStmt=*/true);
1181}
1182
1183OMPTargetParallelDirective *OMPTargetParallelDirective::Create(
1184 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1185 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
1186 bool HasCancel) {
1187 auto *Dir = createDirective<OMPTargetParallelDirective>(
1188 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
1189 Dir->setTaskReductionRefExpr(TaskRedRef);
1190 Dir->setHasCancel(HasCancel);
1191 return Dir;
1192}
1193
1196 unsigned NumClauses, EmptyShell) {
1197 return createEmptyDirective<OMPTargetParallelDirective>(
1198 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
1199}
1200
1201OMPTargetParallelForDirective *OMPTargetParallelForDirective::Create(
1202 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1203 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1204 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1205 auto *Dir = createDirective<OMPTargetParallelForDirective>(
1206 C, Clauses, AssociatedStmt,
1207 numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1, StartLoc,
1208 EndLoc, CollapsedNum);
1209 Dir->setIterationVariable(Exprs.IterationVarRef);
1210 Dir->setLastIteration(Exprs.LastIteration);
1211 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1212 Dir->setPreCond(Exprs.PreCond);
1213 Dir->setCond(Exprs.Cond);
1214 Dir->setInit(Exprs.Init);
1215 Dir->setInc(Exprs.Inc);
1216 Dir->setIsLastIterVariable(Exprs.IL);
1217 Dir->setLowerBoundVariable(Exprs.LB);
1218 Dir->setUpperBoundVariable(Exprs.UB);
1219 Dir->setStrideVariable(Exprs.ST);
1220 Dir->setEnsureUpperBound(Exprs.EUB);
1221 Dir->setNextLowerBound(Exprs.NLB);
1222 Dir->setNextUpperBound(Exprs.NUB);
1223 Dir->setNumIterations(Exprs.NumIterations);
1224 Dir->setCounters(Exprs.Counters);
1225 Dir->setPrivateCounters(Exprs.PrivateCounters);
1226 Dir->setInits(Exprs.Inits);
1227 Dir->setUpdates(Exprs.Updates);
1228 Dir->setFinals(Exprs.Finals);
1229 Dir->setDependentCounters(Exprs.DependentCounters);
1230 Dir->setDependentInits(Exprs.DependentInits);
1231 Dir->setFinalsConditions(Exprs.FinalsConditions);
1232 Dir->setPreInits(Exprs.PreInits);
1233 Dir->setTaskReductionRefExpr(TaskRedRef);
1234 Dir->setHasCancel(HasCancel);
1235 return Dir;
1236}
1237
1240 unsigned NumClauses,
1241 unsigned CollapsedNum, EmptyShell) {
1242 return createEmptyDirective<OMPTargetParallelForDirective>(
1243 C, NumClauses, /*HasAssociatedStmt=*/true,
1244 numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1,
1245 CollapsedNum);
1246}
1247
1248OMPTargetDataDirective *OMPTargetDataDirective::Create(
1249 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1250 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1251 return createDirective<OMPTargetDataDirective>(
1252 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1253}
1254
1255OMPTargetDataDirective *OMPTargetDataDirective::CreateEmpty(const ASTContext &C,
1256 unsigned N,
1257 EmptyShell) {
1258 return createEmptyDirective<OMPTargetDataDirective>(
1259 C, N, /*HasAssociatedStmt=*/true);
1260}
1261
1262OMPTargetEnterDataDirective *OMPTargetEnterDataDirective::Create(
1263 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1264 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1265 return createDirective<OMPTargetEnterDataDirective>(
1266 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1267}
1268
1271 EmptyShell) {
1272 return createEmptyDirective<OMPTargetEnterDataDirective>(
1273 C, N, /*HasAssociatedStmt=*/true);
1274}
1275
1276OMPTargetExitDataDirective *OMPTargetExitDataDirective::Create(
1277 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1278 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1279 return createDirective<OMPTargetExitDataDirective>(
1280 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1281}
1282
1285 EmptyShell) {
1286 return createEmptyDirective<OMPTargetExitDataDirective>(
1287 C, N, /*HasAssociatedStmt=*/true);
1288}
1289
1290OMPTeamsDirective *OMPTeamsDirective::Create(const ASTContext &C,
1291 SourceLocation StartLoc,
1292 SourceLocation EndLoc,
1293 ArrayRef<OMPClause *> Clauses,
1294 Stmt *AssociatedStmt) {
1295 return createDirective<OMPTeamsDirective>(
1296 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1297}
1298
1300 unsigned NumClauses,
1301 EmptyShell) {
1302 return createEmptyDirective<OMPTeamsDirective>(C, NumClauses,
1303 /*HasAssociatedStmt=*/true);
1304}
1305
1306OMPTaskLoopDirective *OMPTaskLoopDirective::Create(
1307 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1308 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1309 const HelperExprs &Exprs, bool HasCancel) {
1310 auto *Dir = createDirective<OMPTaskLoopDirective>(
1311 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_taskloop),
1312 StartLoc, EndLoc, CollapsedNum);
1313 Dir->setIterationVariable(Exprs.IterationVarRef);
1314 Dir->setLastIteration(Exprs.LastIteration);
1315 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1316 Dir->setPreCond(Exprs.PreCond);
1317 Dir->setCond(Exprs.Cond);
1318 Dir->setInit(Exprs.Init);
1319 Dir->setInc(Exprs.Inc);
1320 Dir->setIsLastIterVariable(Exprs.IL);
1321 Dir->setLowerBoundVariable(Exprs.LB);
1322 Dir->setUpperBoundVariable(Exprs.UB);
1323 Dir->setStrideVariable(Exprs.ST);
1324 Dir->setEnsureUpperBound(Exprs.EUB);
1325 Dir->setNextLowerBound(Exprs.NLB);
1326 Dir->setNextUpperBound(Exprs.NUB);
1327 Dir->setNumIterations(Exprs.NumIterations);
1328 Dir->setCounters(Exprs.Counters);
1329 Dir->setPrivateCounters(Exprs.PrivateCounters);
1330 Dir->setInits(Exprs.Inits);
1331 Dir->setUpdates(Exprs.Updates);
1332 Dir->setFinals(Exprs.Finals);
1333 Dir->setDependentCounters(Exprs.DependentCounters);
1334 Dir->setDependentInits(Exprs.DependentInits);
1335 Dir->setFinalsConditions(Exprs.FinalsConditions);
1336 Dir->setPreInits(Exprs.PreInits);
1337 Dir->setHasCancel(HasCancel);
1338 return Dir;
1339}
1340
1342 unsigned NumClauses,
1343 unsigned CollapsedNum,
1344 EmptyShell) {
1345 return createEmptyDirective<OMPTaskLoopDirective>(
1346 C, NumClauses, /*HasAssociatedStmt=*/true,
1347 numLoopChildren(CollapsedNum, OMPD_taskloop), CollapsedNum);
1348}
1349
1350OMPTaskLoopSimdDirective *OMPTaskLoopSimdDirective::Create(
1351 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1352 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1353 const HelperExprs &Exprs) {
1354 auto *Dir = createDirective<OMPTaskLoopSimdDirective>(
1355 C, Clauses, AssociatedStmt,
1356 numLoopChildren(CollapsedNum, OMPD_taskloop_simd), StartLoc, EndLoc,
1357 CollapsedNum);
1358 Dir->setIterationVariable(Exprs.IterationVarRef);
1359 Dir->setLastIteration(Exprs.LastIteration);
1360 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1361 Dir->setPreCond(Exprs.PreCond);
1362 Dir->setCond(Exprs.Cond);
1363 Dir->setInit(Exprs.Init);
1364 Dir->setInc(Exprs.Inc);
1365 Dir->setIsLastIterVariable(Exprs.IL);
1366 Dir->setLowerBoundVariable(Exprs.LB);
1367 Dir->setUpperBoundVariable(Exprs.UB);
1368 Dir->setStrideVariable(Exprs.ST);
1369 Dir->setEnsureUpperBound(Exprs.EUB);
1370 Dir->setNextLowerBound(Exprs.NLB);
1371 Dir->setNextUpperBound(Exprs.NUB);
1372 Dir->setNumIterations(Exprs.NumIterations);
1373 Dir->setCounters(Exprs.Counters);
1374 Dir->setPrivateCounters(Exprs.PrivateCounters);
1375 Dir->setInits(Exprs.Inits);
1376 Dir->setUpdates(Exprs.Updates);
1377 Dir->setFinals(Exprs.Finals);
1378 Dir->setDependentCounters(Exprs.DependentCounters);
1379 Dir->setDependentInits(Exprs.DependentInits);
1380 Dir->setFinalsConditions(Exprs.FinalsConditions);
1381 Dir->setPreInits(Exprs.PreInits);
1382 return Dir;
1383}
1384
1387 unsigned CollapsedNum, EmptyShell) {
1388 return createEmptyDirective<OMPTaskLoopSimdDirective>(
1389 C, NumClauses, /*HasAssociatedStmt=*/true,
1390 numLoopChildren(CollapsedNum, OMPD_taskloop_simd), CollapsedNum);
1391}
1392
1393OMPMasterTaskLoopDirective *OMPMasterTaskLoopDirective::Create(
1394 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1395 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1396 const HelperExprs &Exprs, bool HasCancel) {
1397 auto *Dir = createDirective<OMPMasterTaskLoopDirective>(
1398 C, Clauses, AssociatedStmt,
1399 numLoopChildren(CollapsedNum, OMPD_master_taskloop), StartLoc, EndLoc,
1400 CollapsedNum);
1401 Dir->setIterationVariable(Exprs.IterationVarRef);
1402 Dir->setLastIteration(Exprs.LastIteration);
1403 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1404 Dir->setPreCond(Exprs.PreCond);
1405 Dir->setCond(Exprs.Cond);
1406 Dir->setInit(Exprs.Init);
1407 Dir->setInc(Exprs.Inc);
1408 Dir->setIsLastIterVariable(Exprs.IL);
1409 Dir->setLowerBoundVariable(Exprs.LB);
1410 Dir->setUpperBoundVariable(Exprs.UB);
1411 Dir->setStrideVariable(Exprs.ST);
1412 Dir->setEnsureUpperBound(Exprs.EUB);
1413 Dir->setNextLowerBound(Exprs.NLB);
1414 Dir->setNextUpperBound(Exprs.NUB);
1415 Dir->setNumIterations(Exprs.NumIterations);
1416 Dir->setCounters(Exprs.Counters);
1417 Dir->setPrivateCounters(Exprs.PrivateCounters);
1418 Dir->setInits(Exprs.Inits);
1419 Dir->setUpdates(Exprs.Updates);
1420 Dir->setFinals(Exprs.Finals);
1421 Dir->setDependentCounters(Exprs.DependentCounters);
1422 Dir->setDependentInits(Exprs.DependentInits);
1423 Dir->setFinalsConditions(Exprs.FinalsConditions);
1424 Dir->setPreInits(Exprs.PreInits);
1425 Dir->setHasCancel(HasCancel);
1426 return Dir;
1427}
1428
1431 unsigned NumClauses,
1432 unsigned CollapsedNum, EmptyShell) {
1433 return createEmptyDirective<OMPMasterTaskLoopDirective>(
1434 C, NumClauses, /*HasAssociatedStmt=*/true,
1435 numLoopChildren(CollapsedNum, OMPD_master_taskloop), CollapsedNum);
1436}
1437
1438OMPMaskedTaskLoopDirective *OMPMaskedTaskLoopDirective::Create(
1439 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1440 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1441 const HelperExprs &Exprs, bool HasCancel) {
1442 auto *Dir = createDirective<OMPMaskedTaskLoopDirective>(
1443 C, Clauses, AssociatedStmt,
1444 numLoopChildren(CollapsedNum, OMPD_masked_taskloop), StartLoc, EndLoc,
1445 CollapsedNum);
1446 Dir->setIterationVariable(Exprs.IterationVarRef);
1447 Dir->setLastIteration(Exprs.LastIteration);
1448 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1449 Dir->setPreCond(Exprs.PreCond);
1450 Dir->setCond(Exprs.Cond);
1451 Dir->setInit(Exprs.Init);
1452 Dir->setInc(Exprs.Inc);
1453 Dir->setIsLastIterVariable(Exprs.IL);
1454 Dir->setLowerBoundVariable(Exprs.LB);
1455 Dir->setUpperBoundVariable(Exprs.UB);
1456 Dir->setStrideVariable(Exprs.ST);
1457 Dir->setEnsureUpperBound(Exprs.EUB);
1458 Dir->setNextLowerBound(Exprs.NLB);
1459 Dir->setNextUpperBound(Exprs.NUB);
1460 Dir->setNumIterations(Exprs.NumIterations);
1461 Dir->setCounters(Exprs.Counters);
1462 Dir->setPrivateCounters(Exprs.PrivateCounters);
1463 Dir->setInits(Exprs.Inits);
1464 Dir->setUpdates(Exprs.Updates);
1465 Dir->setFinals(Exprs.Finals);
1466 Dir->setDependentCounters(Exprs.DependentCounters);
1467 Dir->setDependentInits(Exprs.DependentInits);
1468 Dir->setFinalsConditions(Exprs.FinalsConditions);
1469 Dir->setPreInits(Exprs.PreInits);
1470 Dir->setHasCancel(HasCancel);
1471 return Dir;
1472}
1473
1476 unsigned NumClauses,
1477 unsigned CollapsedNum, EmptyShell) {
1478 return createEmptyDirective<OMPMaskedTaskLoopDirective>(
1479 C, NumClauses, /*HasAssociatedStmt=*/true,
1480 numLoopChildren(CollapsedNum, OMPD_masked_taskloop), CollapsedNum);
1481}
1482
1483OMPMasterTaskLoopSimdDirective *OMPMasterTaskLoopSimdDirective::Create(
1484 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1485 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1486 const HelperExprs &Exprs) {
1487 auto *Dir = createDirective<OMPMasterTaskLoopSimdDirective>(
1488 C, Clauses, AssociatedStmt,
1489 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), StartLoc,
1490 EndLoc, CollapsedNum);
1491 Dir->setIterationVariable(Exprs.IterationVarRef);
1492 Dir->setLastIteration(Exprs.LastIteration);
1493 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1494 Dir->setPreCond(Exprs.PreCond);
1495 Dir->setCond(Exprs.Cond);
1496 Dir->setInit(Exprs.Init);
1497 Dir->setInc(Exprs.Inc);
1498 Dir->setIsLastIterVariable(Exprs.IL);
1499 Dir->setLowerBoundVariable(Exprs.LB);
1500 Dir->setUpperBoundVariable(Exprs.UB);
1501 Dir->setStrideVariable(Exprs.ST);
1502 Dir->setEnsureUpperBound(Exprs.EUB);
1503 Dir->setNextLowerBound(Exprs.NLB);
1504 Dir->setNextUpperBound(Exprs.NUB);
1505 Dir->setNumIterations(Exprs.NumIterations);
1506 Dir->setCounters(Exprs.Counters);
1507 Dir->setPrivateCounters(Exprs.PrivateCounters);
1508 Dir->setInits(Exprs.Inits);
1509 Dir->setUpdates(Exprs.Updates);
1510 Dir->setFinals(Exprs.Finals);
1511 Dir->setDependentCounters(Exprs.DependentCounters);
1512 Dir->setDependentInits(Exprs.DependentInits);
1513 Dir->setFinalsConditions(Exprs.FinalsConditions);
1514 Dir->setPreInits(Exprs.PreInits);
1515 return Dir;
1516}
1517
1520 unsigned NumClauses,
1521 unsigned CollapsedNum, EmptyShell) {
1522 return createEmptyDirective<OMPMasterTaskLoopSimdDirective>(
1523 C, NumClauses, /*HasAssociatedStmt=*/true,
1524 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), CollapsedNum);
1525}
1526
1527OMPMaskedTaskLoopSimdDirective *OMPMaskedTaskLoopSimdDirective::Create(
1528 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1529 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1530 const HelperExprs &Exprs) {
1531 auto *Dir = createDirective<OMPMaskedTaskLoopSimdDirective>(
1532 C, Clauses, AssociatedStmt,
1533 numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), StartLoc,
1534 EndLoc, CollapsedNum);
1535 Dir->setIterationVariable(Exprs.IterationVarRef);
1536 Dir->setLastIteration(Exprs.LastIteration);
1537 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1538 Dir->setPreCond(Exprs.PreCond);
1539 Dir->setCond(Exprs.Cond);
1540 Dir->setInit(Exprs.Init);
1541 Dir->setInc(Exprs.Inc);
1542 Dir->setIsLastIterVariable(Exprs.IL);
1543 Dir->setLowerBoundVariable(Exprs.LB);
1544 Dir->setUpperBoundVariable(Exprs.UB);
1545 Dir->setStrideVariable(Exprs.ST);
1546 Dir->setEnsureUpperBound(Exprs.EUB);
1547 Dir->setNextLowerBound(Exprs.NLB);
1548 Dir->setNextUpperBound(Exprs.NUB);
1549 Dir->setNumIterations(Exprs.NumIterations);
1550 Dir->setCounters(Exprs.Counters);
1551 Dir->setPrivateCounters(Exprs.PrivateCounters);
1552 Dir->setInits(Exprs.Inits);
1553 Dir->setUpdates(Exprs.Updates);
1554 Dir->setFinals(Exprs.Finals);
1555 Dir->setDependentCounters(Exprs.DependentCounters);
1556 Dir->setDependentInits(Exprs.DependentInits);
1557 Dir->setFinalsConditions(Exprs.FinalsConditions);
1558 Dir->setPreInits(Exprs.PreInits);
1559 return Dir;
1560}
1561
1564 unsigned NumClauses,
1565 unsigned CollapsedNum, EmptyShell) {
1566 return createEmptyDirective<OMPMaskedTaskLoopSimdDirective>(
1567 C, NumClauses, /*HasAssociatedStmt=*/true,
1568 numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), CollapsedNum);
1569}
1570
1571OMPParallelMasterTaskLoopDirective *OMPParallelMasterTaskLoopDirective::Create(
1572 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1573 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1574 const HelperExprs &Exprs, bool HasCancel) {
1575 auto *Dir = createDirective<OMPParallelMasterTaskLoopDirective>(
1576 C, Clauses, AssociatedStmt,
1577 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop), StartLoc,
1578 EndLoc, CollapsedNum);
1579 Dir->setIterationVariable(Exprs.IterationVarRef);
1580 Dir->setLastIteration(Exprs.LastIteration);
1581 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1582 Dir->setPreCond(Exprs.PreCond);
1583 Dir->setCond(Exprs.Cond);
1584 Dir->setInit(Exprs.Init);
1585 Dir->setInc(Exprs.Inc);
1586 Dir->setIsLastIterVariable(Exprs.IL);
1587 Dir->setLowerBoundVariable(Exprs.LB);
1588 Dir->setUpperBoundVariable(Exprs.UB);
1589 Dir->setStrideVariable(Exprs.ST);
1590 Dir->setEnsureUpperBound(Exprs.EUB);
1591 Dir->setNextLowerBound(Exprs.NLB);
1592 Dir->setNextUpperBound(Exprs.NUB);
1593 Dir->setNumIterations(Exprs.NumIterations);
1594 Dir->setCounters(Exprs.Counters);
1595 Dir->setPrivateCounters(Exprs.PrivateCounters);
1596 Dir->setInits(Exprs.Inits);
1597 Dir->setUpdates(Exprs.Updates);
1598 Dir->setFinals(Exprs.Finals);
1599 Dir->setDependentCounters(Exprs.DependentCounters);
1600 Dir->setDependentInits(Exprs.DependentInits);
1601 Dir->setFinalsConditions(Exprs.FinalsConditions);
1602 Dir->setPreInits(Exprs.PreInits);
1603 Dir->setHasCancel(HasCancel);
1604 return Dir;
1605}
1606
1609 unsigned NumClauses,
1610 unsigned CollapsedNum,
1611 EmptyShell) {
1612 return createEmptyDirective<OMPParallelMasterTaskLoopDirective>(
1613 C, NumClauses, /*HasAssociatedStmt=*/true,
1614 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop),
1615 CollapsedNum);
1616}
1617
1618OMPParallelMaskedTaskLoopDirective *OMPParallelMaskedTaskLoopDirective::Create(
1619 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1620 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1621 const HelperExprs &Exprs, bool HasCancel) {
1622 auto *Dir = createDirective<OMPParallelMaskedTaskLoopDirective>(
1623 C, Clauses, AssociatedStmt,
1624 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop), StartLoc,
1625 EndLoc, CollapsedNum);
1626 Dir->setIterationVariable(Exprs.IterationVarRef);
1627 Dir->setLastIteration(Exprs.LastIteration);
1628 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1629 Dir->setPreCond(Exprs.PreCond);
1630 Dir->setCond(Exprs.Cond);
1631 Dir->setInit(Exprs.Init);
1632 Dir->setInc(Exprs.Inc);
1633 Dir->setIsLastIterVariable(Exprs.IL);
1634 Dir->setLowerBoundVariable(Exprs.LB);
1635 Dir->setUpperBoundVariable(Exprs.UB);
1636 Dir->setStrideVariable(Exprs.ST);
1637 Dir->setEnsureUpperBound(Exprs.EUB);
1638 Dir->setNextLowerBound(Exprs.NLB);
1639 Dir->setNextUpperBound(Exprs.NUB);
1640 Dir->setNumIterations(Exprs.NumIterations);
1641 Dir->setCounters(Exprs.Counters);
1642 Dir->setPrivateCounters(Exprs.PrivateCounters);
1643 Dir->setInits(Exprs.Inits);
1644 Dir->setUpdates(Exprs.Updates);
1645 Dir->setFinals(Exprs.Finals);
1646 Dir->setDependentCounters(Exprs.DependentCounters);
1647 Dir->setDependentInits(Exprs.DependentInits);
1648 Dir->setFinalsConditions(Exprs.FinalsConditions);
1649 Dir->setPreInits(Exprs.PreInits);
1650 Dir->setHasCancel(HasCancel);
1651 return Dir;
1652}
1653
1656 unsigned NumClauses,
1657 unsigned CollapsedNum,
1658 EmptyShell) {
1659 return createEmptyDirective<OMPParallelMaskedTaskLoopDirective>(
1660 C, NumClauses, /*HasAssociatedStmt=*/true,
1661 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop),
1662 CollapsedNum);
1663}
1664
1667 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1668 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1669 const HelperExprs &Exprs) {
1670 auto *Dir = createDirective<OMPParallelMasterTaskLoopSimdDirective>(
1671 C, Clauses, AssociatedStmt,
1672 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),
1673 StartLoc, EndLoc, CollapsedNum);
1674 Dir->setIterationVariable(Exprs.IterationVarRef);
1675 Dir->setLastIteration(Exprs.LastIteration);
1676 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1677 Dir->setPreCond(Exprs.PreCond);
1678 Dir->setCond(Exprs.Cond);
1679 Dir->setInit(Exprs.Init);
1680 Dir->setInc(Exprs.Inc);
1681 Dir->setIsLastIterVariable(Exprs.IL);
1682 Dir->setLowerBoundVariable(Exprs.LB);
1683 Dir->setUpperBoundVariable(Exprs.UB);
1684 Dir->setStrideVariable(Exprs.ST);
1685 Dir->setEnsureUpperBound(Exprs.EUB);
1686 Dir->setNextLowerBound(Exprs.NLB);
1687 Dir->setNextUpperBound(Exprs.NUB);
1688 Dir->setNumIterations(Exprs.NumIterations);
1689 Dir->setCounters(Exprs.Counters);
1690 Dir->setPrivateCounters(Exprs.PrivateCounters);
1691 Dir->setInits(Exprs.Inits);
1692 Dir->setUpdates(Exprs.Updates);
1693 Dir->setFinals(Exprs.Finals);
1694 Dir->setDependentCounters(Exprs.DependentCounters);
1695 Dir->setDependentInits(Exprs.DependentInits);
1696 Dir->setFinalsConditions(Exprs.FinalsConditions);
1697 Dir->setPreInits(Exprs.PreInits);
1698 return Dir;
1699}
1700
1703 unsigned NumClauses,
1704 unsigned CollapsedNum,
1705 EmptyShell) {
1706 return createEmptyDirective<OMPParallelMasterTaskLoopSimdDirective>(
1707 C, NumClauses, /*HasAssociatedStmt=*/true,
1708 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),
1709 CollapsedNum);
1710}
1711
1714 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1715 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1716 const HelperExprs &Exprs) {
1717 auto *Dir = createDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1718 C, Clauses, AssociatedStmt,
1719 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd),
1720 StartLoc, EndLoc, CollapsedNum);
1721 Dir->setIterationVariable(Exprs.IterationVarRef);
1722 Dir->setLastIteration(Exprs.LastIteration);
1723 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1724 Dir->setPreCond(Exprs.PreCond);
1725 Dir->setCond(Exprs.Cond);
1726 Dir->setInit(Exprs.Init);
1727 Dir->setInc(Exprs.Inc);
1728 Dir->setIsLastIterVariable(Exprs.IL);
1729 Dir->setLowerBoundVariable(Exprs.LB);
1730 Dir->setUpperBoundVariable(Exprs.UB);
1731 Dir->setStrideVariable(Exprs.ST);
1732 Dir->setEnsureUpperBound(Exprs.EUB);
1733 Dir->setNextLowerBound(Exprs.NLB);
1734 Dir->setNextUpperBound(Exprs.NUB);
1735 Dir->setNumIterations(Exprs.NumIterations);
1736 Dir->setCounters(Exprs.Counters);
1737 Dir->setPrivateCounters(Exprs.PrivateCounters);
1738 Dir->setInits(Exprs.Inits);
1739 Dir->setUpdates(Exprs.Updates);
1740 Dir->setFinals(Exprs.Finals);
1741 Dir->setDependentCounters(Exprs.DependentCounters);
1742 Dir->setDependentInits(Exprs.DependentInits);
1743 Dir->setFinalsConditions(Exprs.FinalsConditions);
1744 Dir->setPreInits(Exprs.PreInits);
1745 return Dir;
1746}
1747
1750 unsigned NumClauses,
1751 unsigned CollapsedNum,
1752 EmptyShell) {
1753 return createEmptyDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1754 C, NumClauses, /*HasAssociatedStmt=*/true,
1755 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd),
1756 CollapsedNum);
1757}
1758
1761 SourceLocation EndLoc, unsigned CollapsedNum,
1762 ArrayRef<OMPClause *> Clauses,
1763 Stmt *AssociatedStmt, const HelperExprs &Exprs) {
1764 auto *Dir = createDirective<OMPDistributeDirective>(
1765 C, Clauses, AssociatedStmt,
1766 numLoopChildren(CollapsedNum, OMPD_distribute), StartLoc, EndLoc,
1767 CollapsedNum);
1768 Dir->setIterationVariable(Exprs.IterationVarRef);
1769 Dir->setLastIteration(Exprs.LastIteration);
1770 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1771 Dir->setPreCond(Exprs.PreCond);
1772 Dir->setCond(Exprs.Cond);
1773 Dir->setInit(Exprs.Init);
1774 Dir->setInc(Exprs.Inc);
1775 Dir->setIsLastIterVariable(Exprs.IL);
1776 Dir->setLowerBoundVariable(Exprs.LB);
1777 Dir->setUpperBoundVariable(Exprs.UB);
1778 Dir->setStrideVariable(Exprs.ST);
1779 Dir->setEnsureUpperBound(Exprs.EUB);
1780 Dir->setNextLowerBound(Exprs.NLB);
1781 Dir->setNextUpperBound(Exprs.NUB);
1782 Dir->setNumIterations(Exprs.NumIterations);
1783 Dir->setCounters(Exprs.Counters);
1784 Dir->setPrivateCounters(Exprs.PrivateCounters);
1785 Dir->setInits(Exprs.Inits);
1786 Dir->setUpdates(Exprs.Updates);
1787 Dir->setFinals(Exprs.Finals);
1788 Dir->setDependentCounters(Exprs.DependentCounters);
1789 Dir->setDependentInits(Exprs.DependentInits);
1790 Dir->setFinalsConditions(Exprs.FinalsConditions);
1791 Dir->setPreInits(Exprs.PreInits);
1792 return Dir;
1793}
1794
1797 unsigned CollapsedNum, EmptyShell) {
1798 return createEmptyDirective<OMPDistributeDirective>(
1799 C, NumClauses, /*HasAssociatedStmt=*/true,
1800 numLoopChildren(CollapsedNum, OMPD_distribute), CollapsedNum);
1801}
1802
1803OMPTargetUpdateDirective *OMPTargetUpdateDirective::Create(
1804 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1805 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1806 return createDirective<OMPTargetUpdateDirective>(C, Clauses, AssociatedStmt,
1807 /*NumChildren=*/0, StartLoc,
1808 EndLoc);
1809}
1810
1813 EmptyShell) {
1814 return createEmptyDirective<OMPTargetUpdateDirective>(
1815 C, NumClauses, /*HasAssociatedStmt=*/true);
1816}
1817
1818OMPDistributeParallelForDirective *OMPDistributeParallelForDirective::Create(
1819 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1820 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1821 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1822 auto *Dir = createDirective<OMPDistributeParallelForDirective>(
1823 C, Clauses, AssociatedStmt,
1824 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1, StartLoc,
1825 EndLoc, CollapsedNum);
1826 Dir->setIterationVariable(Exprs.IterationVarRef);
1827 Dir->setLastIteration(Exprs.LastIteration);
1828 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1829 Dir->setPreCond(Exprs.PreCond);
1830 Dir->setCond(Exprs.Cond);
1831 Dir->setInit(Exprs.Init);
1832 Dir->setInc(Exprs.Inc);
1833 Dir->setIsLastIterVariable(Exprs.IL);
1834 Dir->setLowerBoundVariable(Exprs.LB);
1835 Dir->setUpperBoundVariable(Exprs.UB);
1836 Dir->setStrideVariable(Exprs.ST);
1837 Dir->setEnsureUpperBound(Exprs.EUB);
1838 Dir->setNextLowerBound(Exprs.NLB);
1839 Dir->setNextUpperBound(Exprs.NUB);
1840 Dir->setNumIterations(Exprs.NumIterations);
1841 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1842 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1843 Dir->setDistInc(Exprs.DistInc);
1844 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1845 Dir->setCounters(Exprs.Counters);
1846 Dir->setPrivateCounters(Exprs.PrivateCounters);
1847 Dir->setInits(Exprs.Inits);
1848 Dir->setUpdates(Exprs.Updates);
1849 Dir->setFinals(Exprs.Finals);
1850 Dir->setDependentCounters(Exprs.DependentCounters);
1851 Dir->setDependentInits(Exprs.DependentInits);
1852 Dir->setFinalsConditions(Exprs.FinalsConditions);
1853 Dir->setPreInits(Exprs.PreInits);
1854 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1855 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1856 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1857 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1858 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1859 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1860 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1861 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1862 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1863 Dir->setTaskReductionRefExpr(TaskRedRef);
1864 Dir->HasCancel = HasCancel;
1865 return Dir;
1866}
1867
1870 unsigned NumClauses,
1871 unsigned CollapsedNum,
1872 EmptyShell) {
1873 return createEmptyDirective<OMPDistributeParallelForDirective>(
1874 C, NumClauses, /*HasAssociatedStmt=*/true,
1875 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1,
1876 CollapsedNum);
1877}
1878
1881 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1882 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1883 const HelperExprs &Exprs) {
1884 auto *Dir = createDirective<OMPDistributeParallelForSimdDirective>(
1885 C, Clauses, AssociatedStmt,
1886 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),
1887 StartLoc, EndLoc, CollapsedNum);
1888 Dir->setIterationVariable(Exprs.IterationVarRef);
1889 Dir->setLastIteration(Exprs.LastIteration);
1890 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1891 Dir->setPreCond(Exprs.PreCond);
1892 Dir->setCond(Exprs.Cond);
1893 Dir->setInit(Exprs.Init);
1894 Dir->setInc(Exprs.Inc);
1895 Dir->setIsLastIterVariable(Exprs.IL);
1896 Dir->setLowerBoundVariable(Exprs.LB);
1897 Dir->setUpperBoundVariable(Exprs.UB);
1898 Dir->setStrideVariable(Exprs.ST);
1899 Dir->setEnsureUpperBound(Exprs.EUB);
1900 Dir->setNextLowerBound(Exprs.NLB);
1901 Dir->setNextUpperBound(Exprs.NUB);
1902 Dir->setNumIterations(Exprs.NumIterations);
1903 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1904 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1905 Dir->setDistInc(Exprs.DistInc);
1906 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1907 Dir->setCounters(Exprs.Counters);
1908 Dir->setPrivateCounters(Exprs.PrivateCounters);
1909 Dir->setInits(Exprs.Inits);
1910 Dir->setUpdates(Exprs.Updates);
1911 Dir->setFinals(Exprs.Finals);
1912 Dir->setDependentCounters(Exprs.DependentCounters);
1913 Dir->setDependentInits(Exprs.DependentInits);
1914 Dir->setFinalsConditions(Exprs.FinalsConditions);
1915 Dir->setPreInits(Exprs.PreInits);
1916 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1917 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1918 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1919 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1920 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1921 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1922 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1923 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1924 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1925 return Dir;
1926}
1927
1930 unsigned NumClauses,
1931 unsigned CollapsedNum,
1932 EmptyShell) {
1933 return createEmptyDirective<OMPDistributeParallelForSimdDirective>(
1934 C, NumClauses, /*HasAssociatedStmt=*/true,
1935 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),
1936 CollapsedNum);
1937}
1938
1939OMPDistributeSimdDirective *OMPDistributeSimdDirective::Create(
1940 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1941 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1942 const HelperExprs &Exprs) {
1943 auto *Dir = createDirective<OMPDistributeSimdDirective>(
1944 C, Clauses, AssociatedStmt,
1945 numLoopChildren(CollapsedNum, OMPD_distribute_simd), StartLoc, EndLoc,
1946 CollapsedNum);
1947 Dir->setIterationVariable(Exprs.IterationVarRef);
1948 Dir->setLastIteration(Exprs.LastIteration);
1949 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1950 Dir->setPreCond(Exprs.PreCond);
1951 Dir->setCond(Exprs.Cond);
1952 Dir->setInit(Exprs.Init);
1953 Dir->setInc(Exprs.Inc);
1954 Dir->setIsLastIterVariable(Exprs.IL);
1955 Dir->setLowerBoundVariable(Exprs.LB);
1956 Dir->setUpperBoundVariable(Exprs.UB);
1957 Dir->setStrideVariable(Exprs.ST);
1958 Dir->setEnsureUpperBound(Exprs.EUB);
1959 Dir->setNextLowerBound(Exprs.NLB);
1960 Dir->setNextUpperBound(Exprs.NUB);
1961 Dir->setNumIterations(Exprs.NumIterations);
1962 Dir->setCounters(Exprs.Counters);
1963 Dir->setPrivateCounters(Exprs.PrivateCounters);
1964 Dir->setInits(Exprs.Inits);
1965 Dir->setUpdates(Exprs.Updates);
1966 Dir->setFinals(Exprs.Finals);
1967 Dir->setDependentCounters(Exprs.DependentCounters);
1968 Dir->setDependentInits(Exprs.DependentInits);
1969 Dir->setFinalsConditions(Exprs.FinalsConditions);
1970 Dir->setPreInits(Exprs.PreInits);
1971 return Dir;
1972}
1973
1976 unsigned NumClauses,
1977 unsigned CollapsedNum, EmptyShell) {
1978 return createEmptyDirective<OMPDistributeSimdDirective>(
1979 C, NumClauses, /*HasAssociatedStmt=*/true,
1980 numLoopChildren(CollapsedNum, OMPD_distribute_simd), CollapsedNum);
1981}
1982
1983OMPTargetParallelForSimdDirective *OMPTargetParallelForSimdDirective::Create(
1984 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1985 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1986 const HelperExprs &Exprs) {
1987 auto *Dir = createDirective<OMPTargetParallelForSimdDirective>(
1988 C, Clauses, AssociatedStmt,
1989 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd), StartLoc,
1990 EndLoc, CollapsedNum);
1991 Dir->setIterationVariable(Exprs.IterationVarRef);
1992 Dir->setLastIteration(Exprs.LastIteration);
1993 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1994 Dir->setPreCond(Exprs.PreCond);
1995 Dir->setCond(Exprs.Cond);
1996 Dir->setInit(Exprs.Init);
1997 Dir->setInc(Exprs.Inc);
1998 Dir->setIsLastIterVariable(Exprs.IL);
1999 Dir->setLowerBoundVariable(Exprs.LB);
2000 Dir->setUpperBoundVariable(Exprs.UB);
2001 Dir->setStrideVariable(Exprs.ST);
2002 Dir->setEnsureUpperBound(Exprs.EUB);
2003 Dir->setNextLowerBound(Exprs.NLB);
2004 Dir->setNextUpperBound(Exprs.NUB);
2005 Dir->setNumIterations(Exprs.NumIterations);
2006 Dir->setCounters(Exprs.Counters);
2007 Dir->setPrivateCounters(Exprs.PrivateCounters);
2008 Dir->setInits(Exprs.Inits);
2009 Dir->setUpdates(Exprs.Updates);
2010 Dir->setFinals(Exprs.Finals);
2011 Dir->setDependentCounters(Exprs.DependentCounters);
2012 Dir->setDependentInits(Exprs.DependentInits);
2013 Dir->setFinalsConditions(Exprs.FinalsConditions);
2014 Dir->setPreInits(Exprs.PreInits);
2015 return Dir;
2016}
2017
2020 unsigned NumClauses,
2021 unsigned CollapsedNum,
2022 EmptyShell) {
2023 return createEmptyDirective<OMPTargetParallelForSimdDirective>(
2024 C, NumClauses, /*HasAssociatedStmt=*/true,
2025 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd),
2026 CollapsedNum);
2027}
2028
2031 SourceLocation EndLoc, unsigned CollapsedNum,
2032 ArrayRef<OMPClause *> Clauses,
2033 Stmt *AssociatedStmt, const HelperExprs &Exprs) {
2034 auto *Dir = createDirective<OMPTargetSimdDirective>(
2035 C, Clauses, AssociatedStmt,
2036 numLoopChildren(CollapsedNum, OMPD_target_simd), StartLoc, EndLoc,
2037 CollapsedNum);
2038 Dir->setIterationVariable(Exprs.IterationVarRef);
2039 Dir->setLastIteration(Exprs.LastIteration);
2040 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2041 Dir->setPreCond(Exprs.PreCond);
2042 Dir->setCond(Exprs.Cond);
2043 Dir->setInit(Exprs.Init);
2044 Dir->setInc(Exprs.Inc);
2045 Dir->setCounters(Exprs.Counters);
2046 Dir->setPrivateCounters(Exprs.PrivateCounters);
2047 Dir->setInits(Exprs.Inits);
2048 Dir->setUpdates(Exprs.Updates);
2049 Dir->setFinals(Exprs.Finals);
2050 Dir->setDependentCounters(Exprs.DependentCounters);
2051 Dir->setDependentInits(Exprs.DependentInits);
2052 Dir->setFinalsConditions(Exprs.FinalsConditions);
2053 Dir->setPreInits(Exprs.PreInits);
2054 return Dir;
2055}
2056
2059 unsigned CollapsedNum, EmptyShell) {
2060 return createEmptyDirective<OMPTargetSimdDirective>(
2061 C, NumClauses, /*HasAssociatedStmt=*/true,
2062 numLoopChildren(CollapsedNum, OMPD_target_simd), CollapsedNum);
2063}
2064
2065OMPTeamsDistributeDirective *OMPTeamsDistributeDirective::Create(
2066 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2067 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2068 const HelperExprs &Exprs) {
2069 auto *Dir = createDirective<OMPTeamsDistributeDirective>(
2070 C, Clauses, AssociatedStmt,
2071 numLoopChildren(CollapsedNum, OMPD_teams_distribute), StartLoc, EndLoc,
2072 CollapsedNum);
2073 Dir->setIterationVariable(Exprs.IterationVarRef);
2074 Dir->setLastIteration(Exprs.LastIteration);
2075 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2076 Dir->setPreCond(Exprs.PreCond);
2077 Dir->setCond(Exprs.Cond);
2078 Dir->setInit(Exprs.Init);
2079 Dir->setInc(Exprs.Inc);
2080 Dir->setIsLastIterVariable(Exprs.IL);
2081 Dir->setLowerBoundVariable(Exprs.LB);
2082 Dir->setUpperBoundVariable(Exprs.UB);
2083 Dir->setStrideVariable(Exprs.ST);
2084 Dir->setEnsureUpperBound(Exprs.EUB);
2085 Dir->setNextLowerBound(Exprs.NLB);
2086 Dir->setNextUpperBound(Exprs.NUB);
2087 Dir->setNumIterations(Exprs.NumIterations);
2088 Dir->setCounters(Exprs.Counters);
2089 Dir->setPrivateCounters(Exprs.PrivateCounters);
2090 Dir->setInits(Exprs.Inits);
2091 Dir->setUpdates(Exprs.Updates);
2092 Dir->setFinals(Exprs.Finals);
2093 Dir->setDependentCounters(Exprs.DependentCounters);
2094 Dir->setDependentInits(Exprs.DependentInits);
2095 Dir->setFinalsConditions(Exprs.FinalsConditions);
2096 Dir->setPreInits(Exprs.PreInits);
2097 return Dir;
2098}
2099
2102 unsigned NumClauses,
2103 unsigned CollapsedNum, EmptyShell) {
2104 return createEmptyDirective<OMPTeamsDistributeDirective>(
2105 C, NumClauses, /*HasAssociatedStmt=*/true,
2106 numLoopChildren(CollapsedNum, OMPD_teams_distribute), CollapsedNum);
2107}
2108
2109OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::Create(
2110 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2111 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2112 const HelperExprs &Exprs) {
2113 auto *Dir = createDirective<OMPTeamsDistributeSimdDirective>(
2114 C, Clauses, AssociatedStmt,
2115 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), StartLoc,
2116 EndLoc, CollapsedNum);
2117 Dir->setIterationVariable(Exprs.IterationVarRef);
2118 Dir->setLastIteration(Exprs.LastIteration);
2119 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2120 Dir->setPreCond(Exprs.PreCond);
2121 Dir->setCond(Exprs.Cond);
2122 Dir->setInit(Exprs.Init);
2123 Dir->setInc(Exprs.Inc);
2124 Dir->setIsLastIterVariable(Exprs.IL);
2125 Dir->setLowerBoundVariable(Exprs.LB);
2126 Dir->setUpperBoundVariable(Exprs.UB);
2127 Dir->setStrideVariable(Exprs.ST);
2128 Dir->setEnsureUpperBound(Exprs.EUB);
2129 Dir->setNextLowerBound(Exprs.NLB);
2130 Dir->setNextUpperBound(Exprs.NUB);
2131 Dir->setNumIterations(Exprs.NumIterations);
2132 Dir->setCounters(Exprs.Counters);
2133 Dir->setPrivateCounters(Exprs.PrivateCounters);
2134 Dir->setInits(Exprs.Inits);
2135 Dir->setUpdates(Exprs.Updates);
2136 Dir->setFinals(Exprs.Finals);
2137 Dir->setDependentCounters(Exprs.DependentCounters);
2138 Dir->setDependentInits(Exprs.DependentInits);
2139 Dir->setFinalsConditions(Exprs.FinalsConditions);
2140 Dir->setPreInits(Exprs.PreInits);
2141 return Dir;
2142}
2143
2144OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::CreateEmpty(
2145 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
2146 EmptyShell) {
2147 return createEmptyDirective<OMPTeamsDistributeSimdDirective>(
2148 C, NumClauses, /*HasAssociatedStmt=*/true,
2149 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), CollapsedNum);
2150}
2151
2154 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2155 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2156 const HelperExprs &Exprs) {
2157 auto *Dir = createDirective<OMPTeamsDistributeParallelForSimdDirective>(
2158 C, Clauses, AssociatedStmt,
2159 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
2160 StartLoc, EndLoc, CollapsedNum);
2161 Dir->setIterationVariable(Exprs.IterationVarRef);
2162 Dir->setLastIteration(Exprs.LastIteration);
2163 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2164 Dir->setPreCond(Exprs.PreCond);
2165 Dir->setCond(Exprs.Cond);
2166 Dir->setInit(Exprs.Init);
2167 Dir->setInc(Exprs.Inc);
2168 Dir->setIsLastIterVariable(Exprs.IL);
2169 Dir->setLowerBoundVariable(Exprs.LB);
2170 Dir->setUpperBoundVariable(Exprs.UB);
2171 Dir->setStrideVariable(Exprs.ST);
2172 Dir->setEnsureUpperBound(Exprs.EUB);
2173 Dir->setNextLowerBound(Exprs.NLB);
2174 Dir->setNextUpperBound(Exprs.NUB);
2175 Dir->setNumIterations(Exprs.NumIterations);
2176 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2177 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2178 Dir->setDistInc(Exprs.DistInc);
2179 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2180 Dir->setCounters(Exprs.Counters);
2181 Dir->setPrivateCounters(Exprs.PrivateCounters);
2182 Dir->setInits(Exprs.Inits);
2183 Dir->setUpdates(Exprs.Updates);
2184 Dir->setFinals(Exprs.Finals);
2185 Dir->setDependentCounters(Exprs.DependentCounters);
2186 Dir->setDependentInits(Exprs.DependentInits);
2187 Dir->setFinalsConditions(Exprs.FinalsConditions);
2188 Dir->setPreInits(Exprs.PreInits);
2189 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2190 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2191 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2192 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2193 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2194 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2195 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2196 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2197 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2198 return Dir;
2199}
2200
2203 unsigned NumClauses,
2204 unsigned CollapsedNum,
2205 EmptyShell) {
2206 return createEmptyDirective<OMPTeamsDistributeParallelForSimdDirective>(
2207 C, NumClauses, /*HasAssociatedStmt=*/true,
2208 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
2209 CollapsedNum);
2210}
2211
2214 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2215 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2216 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
2217 auto *Dir = createDirective<OMPTeamsDistributeParallelForDirective>(
2218 C, Clauses, AssociatedStmt,
2219 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
2220 StartLoc, EndLoc, CollapsedNum);
2221 Dir->setIterationVariable(Exprs.IterationVarRef);
2222 Dir->setLastIteration(Exprs.LastIteration);
2223 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2224 Dir->setPreCond(Exprs.PreCond);
2225 Dir->setCond(Exprs.Cond);
2226 Dir->setInit(Exprs.Init);
2227 Dir->setInc(Exprs.Inc);
2228 Dir->setIsLastIterVariable(Exprs.IL);
2229 Dir->setLowerBoundVariable(Exprs.LB);
2230 Dir->setUpperBoundVariable(Exprs.UB);
2231 Dir->setStrideVariable(Exprs.ST);
2232 Dir->setEnsureUpperBound(Exprs.EUB);
2233 Dir->setNextLowerBound(Exprs.NLB);
2234 Dir->setNextUpperBound(Exprs.NUB);
2235 Dir->setNumIterations(Exprs.NumIterations);
2236 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2237 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2238 Dir->setDistInc(Exprs.DistInc);
2239 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2240 Dir->setCounters(Exprs.Counters);
2241 Dir->setPrivateCounters(Exprs.PrivateCounters);
2242 Dir->setInits(Exprs.Inits);
2243 Dir->setUpdates(Exprs.Updates);
2244 Dir->setFinals(Exprs.Finals);
2245 Dir->setDependentCounters(Exprs.DependentCounters);
2246 Dir->setDependentInits(Exprs.DependentInits);
2247 Dir->setFinalsConditions(Exprs.FinalsConditions);
2248 Dir->setPreInits(Exprs.PreInits);
2249 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2250 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2251 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2252 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2253 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2254 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2255 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2256 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2257 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2258 Dir->setTaskReductionRefExpr(TaskRedRef);
2259 Dir->HasCancel = HasCancel;
2260 return Dir;
2261}
2262
2265 unsigned NumClauses,
2266 unsigned CollapsedNum,
2267 EmptyShell) {
2268 return createEmptyDirective<OMPTeamsDistributeParallelForDirective>(
2269 C, NumClauses, /*HasAssociatedStmt=*/true,
2270 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
2271 CollapsedNum);
2272}
2273
2274OMPTargetTeamsDirective *OMPTargetTeamsDirective::Create(
2275 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2276 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
2277 return createDirective<OMPTargetTeamsDirective>(C, Clauses, AssociatedStmt,
2278 /*NumChildren=*/0, StartLoc,
2279 EndLoc);
2280}
2281
2284 EmptyShell) {
2285 return createEmptyDirective<OMPTargetTeamsDirective>(
2286 C, NumClauses, /*HasAssociatedStmt=*/true);
2287}
2288
2289OMPTargetTeamsDistributeDirective *OMPTargetTeamsDistributeDirective::Create(
2290 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2291 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2292 const HelperExprs &Exprs) {
2293 auto *Dir = createDirective<OMPTargetTeamsDistributeDirective>(
2294 C, Clauses, AssociatedStmt,
2295 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute), StartLoc,
2296 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<OMPTargetTeamsDistributeDirective>(
2330 C, NumClauses, /*HasAssociatedStmt=*/true,
2331 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute),
2332 CollapsedNum);
2333}
2334
2337 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2338 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2339 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
2340 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForDirective>(
2341 C, Clauses, AssociatedStmt,
2342 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
2343 1,
2344 StartLoc, EndLoc, CollapsedNum);
2345 Dir->setIterationVariable(Exprs.IterationVarRef);
2346 Dir->setLastIteration(Exprs.LastIteration);
2347 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2348 Dir->setPreCond(Exprs.PreCond);
2349 Dir->setCond(Exprs.Cond);
2350 Dir->setInit(Exprs.Init);
2351 Dir->setInc(Exprs.Inc);
2352 Dir->setIsLastIterVariable(Exprs.IL);
2353 Dir->setLowerBoundVariable(Exprs.LB);
2354 Dir->setUpperBoundVariable(Exprs.UB);
2355 Dir->setStrideVariable(Exprs.ST);
2356 Dir->setEnsureUpperBound(Exprs.EUB);
2357 Dir->setNextLowerBound(Exprs.NLB);
2358 Dir->setNextUpperBound(Exprs.NUB);
2359 Dir->setNumIterations(Exprs.NumIterations);
2360 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2361 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2362 Dir->setDistInc(Exprs.DistInc);
2363 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2364 Dir->setCounters(Exprs.Counters);
2365 Dir->setPrivateCounters(Exprs.PrivateCounters);
2366 Dir->setInits(Exprs.Inits);
2367 Dir->setUpdates(Exprs.Updates);
2368 Dir->setFinals(Exprs.Finals);
2369 Dir->setDependentCounters(Exprs.DependentCounters);
2370 Dir->setDependentInits(Exprs.DependentInits);
2371 Dir->setFinalsConditions(Exprs.FinalsConditions);
2372 Dir->setPreInits(Exprs.PreInits);
2373 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2374 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2375 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2376 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2377 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2378 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2379 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2380 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2381 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2382 Dir->setTaskReductionRefExpr(TaskRedRef);
2383 Dir->HasCancel = HasCancel;
2384 return Dir;
2385}
2386
2389 unsigned NumClauses,
2390 unsigned CollapsedNum,
2391 EmptyShell) {
2392 return createEmptyDirective<OMPTargetTeamsDistributeParallelForDirective>(
2393 C, NumClauses, /*HasAssociatedStmt=*/true,
2394 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
2395 1,
2396 CollapsedNum);
2397}
2398
2401 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2402 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2403 const HelperExprs &Exprs) {
2404 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
2405 C, Clauses, AssociatedStmt,
2406 numLoopChildren(CollapsedNum,
2407 OMPD_target_teams_distribute_parallel_for_simd),
2408 StartLoc, EndLoc, CollapsedNum);
2409 Dir->setIterationVariable(Exprs.IterationVarRef);
2410 Dir->setLastIteration(Exprs.LastIteration);
2411 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2412 Dir->setPreCond(Exprs.PreCond);
2413 Dir->setCond(Exprs.Cond);
2414 Dir->setInit(Exprs.Init);
2415 Dir->setInc(Exprs.Inc);
2416 Dir->setIsLastIterVariable(Exprs.IL);
2417 Dir->setLowerBoundVariable(Exprs.LB);
2418 Dir->setUpperBoundVariable(Exprs.UB);
2419 Dir->setStrideVariable(Exprs.ST);
2420 Dir->setEnsureUpperBound(Exprs.EUB);
2421 Dir->setNextLowerBound(Exprs.NLB);
2422 Dir->setNextUpperBound(Exprs.NUB);
2423 Dir->setNumIterations(Exprs.NumIterations);
2424 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2425 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2426 Dir->setDistInc(Exprs.DistInc);
2427 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2428 Dir->setCounters(Exprs.Counters);
2429 Dir->setPrivateCounters(Exprs.PrivateCounters);
2430 Dir->setInits(Exprs.Inits);
2431 Dir->setUpdates(Exprs.Updates);
2432 Dir->setFinals(Exprs.Finals);
2433 Dir->setDependentCounters(Exprs.DependentCounters);
2434 Dir->setDependentInits(Exprs.DependentInits);
2435 Dir->setFinalsConditions(Exprs.FinalsConditions);
2436 Dir->setPreInits(Exprs.PreInits);
2437 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2438 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2439 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2440 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2441 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2442 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2443 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2444 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2445 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2446 return Dir;
2447}
2448
2451 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
2452 EmptyShell) {
2453 return createEmptyDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
2454 C, NumClauses, /*HasAssociatedStmt=*/true,
2455 numLoopChildren(CollapsedNum,
2456 OMPD_target_teams_distribute_parallel_for_simd),
2457 CollapsedNum);
2458}
2459
2462 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2463 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2464 const HelperExprs &Exprs) {
2465 auto *Dir = createDirective<OMPTargetTeamsDistributeSimdDirective>(
2466 C, Clauses, AssociatedStmt,
2467 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),
2468 StartLoc, EndLoc, CollapsedNum);
2469 Dir->setIterationVariable(Exprs.IterationVarRef);
2470 Dir->setLastIteration(Exprs.LastIteration);
2471 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2472 Dir->setPreCond(Exprs.PreCond);
2473 Dir->setCond(Exprs.Cond);
2474 Dir->setInit(Exprs.Init);
2475 Dir->setInc(Exprs.Inc);
2476 Dir->setIsLastIterVariable(Exprs.IL);
2477 Dir->setLowerBoundVariable(Exprs.LB);
2478 Dir->setUpperBoundVariable(Exprs.UB);
2479 Dir->setStrideVariable(Exprs.ST);
2480 Dir->setEnsureUpperBound(Exprs.EUB);
2481 Dir->setNextLowerBound(Exprs.NLB);
2482 Dir->setNextUpperBound(Exprs.NUB);
2483 Dir->setNumIterations(Exprs.NumIterations);
2484 Dir->setCounters(Exprs.Counters);
2485 Dir->setPrivateCounters(Exprs.PrivateCounters);
2486 Dir->setInits(Exprs.Inits);
2487 Dir->setUpdates(Exprs.Updates);
2488 Dir->setFinals(Exprs.Finals);
2489 Dir->setDependentCounters(Exprs.DependentCounters);
2490 Dir->setDependentInits(Exprs.DependentInits);
2491 Dir->setFinalsConditions(Exprs.FinalsConditions);
2492 Dir->setPreInits(Exprs.PreInits);
2493 return Dir;
2494}
2495
2498 unsigned NumClauses,
2499 unsigned CollapsedNum,
2500 EmptyShell) {
2501 return createEmptyDirective<OMPTargetTeamsDistributeSimdDirective>(
2502 C, NumClauses, /*HasAssociatedStmt=*/true,
2503 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),
2504 CollapsedNum);
2505}
2506
2509 SourceLocation EndLoc,
2510 ArrayRef<OMPClause *> Clauses) {
2511 return createDirective<OMPInteropDirective>(
2512 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
2513 EndLoc);
2514}
2515
2517 unsigned NumClauses,
2518 EmptyShell) {
2519 return createEmptyDirective<OMPInteropDirective>(C, NumClauses);
2520}
2521
2522OMPDispatchDirective *OMPDispatchDirective::Create(
2523 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2524 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2525 SourceLocation TargetCallLoc) {
2526 auto *Dir = createDirective<OMPDispatchDirective>(
2527 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
2528 Dir->setTargetCallLoc(TargetCallLoc);
2529 return Dir;
2530}
2531
2533 unsigned NumClauses,
2534 EmptyShell) {
2535 return createEmptyDirective<OMPDispatchDirective>(C, NumClauses,
2536 /*HasAssociatedStmt=*/true,
2537 /*NumChildren=*/0);
2538}
2539
2540OMPMaskedDirective *OMPMaskedDirective::Create(const ASTContext &C,
2541 SourceLocation StartLoc,
2542 SourceLocation EndLoc,
2543 ArrayRef<OMPClause *> Clauses,
2544 Stmt *AssociatedStmt) {
2545 return createDirective<OMPMaskedDirective>(C, Clauses, AssociatedStmt,
2546 /*NumChildren=*/0, StartLoc,
2547 EndLoc);
2548}
2549
2551 unsigned NumClauses,
2552 EmptyShell) {
2553 return createEmptyDirective<OMPMaskedDirective>(C, NumClauses,
2554 /*HasAssociatedStmt=*/true);
2555}
2556
2557OMPGenericLoopDirective *OMPGenericLoopDirective::Create(
2558 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2559 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2560 const HelperExprs &Exprs) {
2561 auto *Dir = createDirective<OMPGenericLoopDirective>(
2562 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_loop),
2563 StartLoc, EndLoc, CollapsedNum);
2564 Dir->setIterationVariable(Exprs.IterationVarRef);
2565 Dir->setLastIteration(Exprs.LastIteration);
2566 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2567 Dir->setPreCond(Exprs.PreCond);
2568 Dir->setCond(Exprs.Cond);
2569 Dir->setInit(Exprs.Init);
2570 Dir->setInc(Exprs.Inc);
2571 Dir->setIsLastIterVariable(Exprs.IL);
2572 Dir->setLowerBoundVariable(Exprs.LB);
2573 Dir->setUpperBoundVariable(Exprs.UB);
2574 Dir->setStrideVariable(Exprs.ST);
2575 Dir->setEnsureUpperBound(Exprs.EUB);
2576 Dir->setNextLowerBound(Exprs.NLB);
2577 Dir->setNextUpperBound(Exprs.NUB);
2578 Dir->setNumIterations(Exprs.NumIterations);
2579 Dir->setCounters(Exprs.Counters);
2580 Dir->setPrivateCounters(Exprs.PrivateCounters);
2581 Dir->setInits(Exprs.Inits);
2582 Dir->setUpdates(Exprs.Updates);
2583 Dir->setFinals(Exprs.Finals);
2584 Dir->setDependentCounters(Exprs.DependentCounters);
2585 Dir->setDependentInits(Exprs.DependentInits);
2586 Dir->setFinalsConditions(Exprs.FinalsConditions);
2587 Dir->setPreInits(Exprs.PreInits);
2588 return Dir;
2589}
2590
2593 unsigned CollapsedNum, EmptyShell) {
2594 return createEmptyDirective<OMPGenericLoopDirective>(
2595 C, NumClauses, /*HasAssociatedStmt=*/true,
2596 numLoopChildren(CollapsedNum, OMPD_loop), CollapsedNum);
2597}
2598
2599OMPTeamsGenericLoopDirective *OMPTeamsGenericLoopDirective::Create(
2600 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2601 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2602 const HelperExprs &Exprs) {
2603 auto *Dir = createDirective<OMPTeamsGenericLoopDirective>(
2604 C, Clauses, AssociatedStmt,
2605 numLoopChildren(CollapsedNum, OMPD_teams_loop), StartLoc, EndLoc,
2606 CollapsedNum);
2607 Dir->setIterationVariable(Exprs.IterationVarRef);
2608 Dir->setLastIteration(Exprs.LastIteration);
2609 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2610 Dir->setPreCond(Exprs.PreCond);
2611 Dir->setCond(Exprs.Cond);
2612 Dir->setInit(Exprs.Init);
2613 Dir->setInc(Exprs.Inc);
2614 Dir->setIsLastIterVariable(Exprs.IL);
2615 Dir->setLowerBoundVariable(Exprs.LB);
2616 Dir->setUpperBoundVariable(Exprs.UB);
2617 Dir->setStrideVariable(Exprs.ST);
2618 Dir->setEnsureUpperBound(Exprs.EUB);
2619 Dir->setNextLowerBound(Exprs.NLB);
2620 Dir->setNextUpperBound(Exprs.NUB);
2621 Dir->setNumIterations(Exprs.NumIterations);
2622 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2623 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2624 Dir->setDistInc(Exprs.DistInc);
2625 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2626 Dir->setCounters(Exprs.Counters);
2627 Dir->setPrivateCounters(Exprs.PrivateCounters);
2628 Dir->setInits(Exprs.Inits);
2629 Dir->setUpdates(Exprs.Updates);
2630 Dir->setFinals(Exprs.Finals);
2631 Dir->setDependentCounters(Exprs.DependentCounters);
2632 Dir->setDependentInits(Exprs.DependentInits);
2633 Dir->setFinalsConditions(Exprs.FinalsConditions);
2634 Dir->setPreInits(Exprs.PreInits);
2635 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2636 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2637 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2638 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2639 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2640 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2641 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2642 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2643 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2644 return Dir;
2645}
2646
2649 unsigned NumClauses,
2650 unsigned CollapsedNum, EmptyShell) {
2651 return createEmptyDirective<OMPTeamsGenericLoopDirective>(
2652 C, NumClauses, /*HasAssociatedStmt=*/true,
2653 numLoopChildren(CollapsedNum, OMPD_teams_loop), CollapsedNum);
2654}
2655
2656OMPTargetTeamsGenericLoopDirective *OMPTargetTeamsGenericLoopDirective::Create(
2657 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2658 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2659 const HelperExprs &Exprs, bool CanBeParallelFor) {
2660 auto *Dir = createDirective<OMPTargetTeamsGenericLoopDirective>(
2661 C, Clauses, AssociatedStmt,
2662 numLoopChildren(CollapsedNum, OMPD_target_teams_loop), StartLoc, EndLoc,
2663 CollapsedNum);
2664 Dir->setIterationVariable(Exprs.IterationVarRef);
2665 Dir->setLastIteration(Exprs.LastIteration);
2666 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2667 Dir->setPreCond(Exprs.PreCond);
2668 Dir->setCond(Exprs.Cond);
2669 Dir->setInit(Exprs.Init);
2670 Dir->setInc(Exprs.Inc);
2671 Dir->setIsLastIterVariable(Exprs.IL);
2672 Dir->setLowerBoundVariable(Exprs.LB);
2673 Dir->setUpperBoundVariable(Exprs.UB);
2674 Dir->setStrideVariable(Exprs.ST);
2675 Dir->setEnsureUpperBound(Exprs.EUB);
2676 Dir->setNextLowerBound(Exprs.NLB);
2677 Dir->setNextUpperBound(Exprs.NUB);
2678 Dir->setNumIterations(Exprs.NumIterations);
2679 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2680 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2681 Dir->setDistInc(Exprs.DistInc);
2682 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2683 Dir->setCounters(Exprs.Counters);
2684 Dir->setPrivateCounters(Exprs.PrivateCounters);
2685 Dir->setInits(Exprs.Inits);
2686 Dir->setUpdates(Exprs.Updates);
2687 Dir->setFinals(Exprs.Finals);
2688 Dir->setDependentCounters(Exprs.DependentCounters);
2689 Dir->setDependentInits(Exprs.DependentInits);
2690 Dir->setFinalsConditions(Exprs.FinalsConditions);
2691 Dir->setPreInits(Exprs.PreInits);
2692 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2693 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2694 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2695 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2696 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2697 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2698 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2699 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2700 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2701 Dir->setCanBeParallelFor(CanBeParallelFor);
2702 return Dir;
2703}
2704
2707 unsigned NumClauses,
2708 unsigned CollapsedNum,
2709 EmptyShell) {
2710 return createEmptyDirective<OMPTargetTeamsGenericLoopDirective>(
2711 C, NumClauses, /*HasAssociatedStmt=*/true,
2712 numLoopChildren(CollapsedNum, OMPD_target_teams_loop), CollapsedNum);
2713}
2714
2715OMPParallelGenericLoopDirective *OMPParallelGenericLoopDirective::Create(
2716 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2717 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2718 const HelperExprs &Exprs) {
2719 auto *Dir = createDirective<OMPParallelGenericLoopDirective>(
2720 C, Clauses, AssociatedStmt,
2721 numLoopChildren(CollapsedNum, OMPD_parallel_loop), StartLoc, EndLoc,
2722 CollapsedNum);
2723 Dir->setIterationVariable(Exprs.IterationVarRef);
2724 Dir->setLastIteration(Exprs.LastIteration);
2725 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2726 Dir->setPreCond(Exprs.PreCond);
2727 Dir->setCond(Exprs.Cond);
2728 Dir->setInit(Exprs.Init);
2729 Dir->setInc(Exprs.Inc);
2730 Dir->setIsLastIterVariable(Exprs.IL);
2731 Dir->setLowerBoundVariable(Exprs.LB);
2732 Dir->setUpperBoundVariable(Exprs.UB);
2733 Dir->setStrideVariable(Exprs.ST);
2734 Dir->setEnsureUpperBound(Exprs.EUB);
2735 Dir->setNextLowerBound(Exprs.NLB);
2736 Dir->setNextUpperBound(Exprs.NUB);
2737 Dir->setNumIterations(Exprs.NumIterations);
2738 Dir->setCounters(Exprs.Counters);
2739 Dir->setPrivateCounters(Exprs.PrivateCounters);
2740 Dir->setInits(Exprs.Inits);
2741 Dir->setUpdates(Exprs.Updates);
2742 Dir->setFinals(Exprs.Finals);
2743 Dir->setDependentCounters(Exprs.DependentCounters);
2744 Dir->setDependentInits(Exprs.DependentInits);
2745 Dir->setFinalsConditions(Exprs.FinalsConditions);
2746 Dir->setPreInits(Exprs.PreInits);
2747 return Dir;
2748}
2749
2750OMPParallelGenericLoopDirective *OMPParallelGenericLoopDirective::CreateEmpty(
2751 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
2752 EmptyShell) {
2753 return createEmptyDirective<OMPParallelGenericLoopDirective>(
2754 C, NumClauses, /*HasAssociatedStmt=*/true,
2755 numLoopChildren(CollapsedNum, OMPD_parallel_loop), CollapsedNum);
2756}
2757
2760 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2761 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2762 const HelperExprs &Exprs) {
2763 auto *Dir = createDirective<OMPTargetParallelGenericLoopDirective>(
2764 C, Clauses, AssociatedStmt,
2765 numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), StartLoc,
2766 EndLoc, CollapsedNum);
2767 Dir->setIterationVariable(Exprs.IterationVarRef);
2768 Dir->setLastIteration(Exprs.LastIteration);
2769 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2770 Dir->setPreCond(Exprs.PreCond);
2771 Dir->setCond(Exprs.Cond);
2772 Dir->setInit(Exprs.Init);
2773 Dir->setInc(Exprs.Inc);
2774 Dir->setIsLastIterVariable(Exprs.IL);
2775 Dir->setLowerBoundVariable(Exprs.LB);
2776 Dir->setUpperBoundVariable(Exprs.UB);
2777 Dir->setStrideVariable(Exprs.ST);
2778 Dir->setEnsureUpperBound(Exprs.EUB);
2779 Dir->setNextLowerBound(Exprs.NLB);
2780 Dir->setNextUpperBound(Exprs.NUB);
2781 Dir->setNumIterations(Exprs.NumIterations);
2782 Dir->setCounters(Exprs.Counters);
2783 Dir->setPrivateCounters(Exprs.PrivateCounters);
2784 Dir->setInits(Exprs.Inits);
2785 Dir->setUpdates(Exprs.Updates);
2786 Dir->setFinals(Exprs.Finals);
2787 Dir->setDependentCounters(Exprs.DependentCounters);
2788 Dir->setDependentInits(Exprs.DependentInits);
2789 Dir->setFinalsConditions(Exprs.FinalsConditions);
2790 Dir->setPreInits(Exprs.PreInits);
2791 return Dir;
2792}
2793
2796 unsigned NumClauses,
2797 unsigned CollapsedNum,
2798 EmptyShell) {
2799 return createEmptyDirective<OMPTargetParallelGenericLoopDirective>(
2800 C, NumClauses, /*HasAssociatedStmt=*/true,
2801 numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), CollapsedNum);
2802}
Defines the clang::ASTContext interface.
static Stmt * ignoreContainersKeepingIntraTileHint(Stmt *S)
Like Stmt::IgnoreContainers, but stops at (and preserves) an intra-tile hint wrapper so that the encl...
This file defines OpenMP AST classes for executable directives and clauses.
static OMPAssumeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
static OMPAssumeDirective * Create(const ASTContext &Ctx, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AStmt)
This represents 'pragma omp atomic' directive.
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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...
static OMPBarrierDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
This represents 'pragma omp cancel' directive.
static OMPCancelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, OpenMPDirectiveKind CancelRegion)
Creates directive.
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents 'pragma omp cancellation point' directive.
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPCancellationPointDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Creates directive.
Stmt * getTransformedStmt() const
Get the de-sugared statements after the loop transformation.
Stmt * getPreInits() const
Return preinits statement.
Stmt * getPreInits() const
Return preinits statement.
Stmt * getTransformedStmt() const
Get the de-sugared statements after the loop transformation.
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.
MutableArrayRef< Stmt * > getChildren()
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPCriticalDirective * Create(const ASTContext &C, const DeclarationNameInfo &Name, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
static OMPDepobjDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDepobjDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
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.
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.
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.
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.
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.
static OMPErrorDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
static OMPErrorDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPFlushDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
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.
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp for simd' directive.
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
static OMPFuseDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumGeneratedTopLevelLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits)
Create a new AST node representation for pragma omp fuse'.
static OMPFuseDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Build an empty 'pragma omp fuse' AST node for deserialization.
This represents 'pragma omp loop' directive.
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.
static OMPInterchangeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp interchange' AST node for deserialization.
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'.
This represents 'pragma omp interop' directive.
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.
void setFinals(ArrayRef< Expr * > A)
static unsigned numLoopChildren(unsigned CollapsedNum, OpenMPDirectiveKind Kind)
Children number.
void setDependentCounters(ArrayRef< Expr * > A)
void setFinalsConditions(ArrayRef< Expr * > A)
void setInits(ArrayRef< Expr * > A)
void setCounters(ArrayRef< Expr * > A)
void setDependentInits(ArrayRef< Expr * > A)
void setUpdates(ArrayRef< Expr * > A)
void setPrivateCounters(ArrayRef< Expr * > A)
Common class of data shared between OMPCanonicalLoopNestTransformationDirective and OMPCanonicalLoopS...
Definition StmtOpenMP.h:999
Stmt * getPreInits() const
Return preinits statement.
void setNumGeneratedTopLevelLoops(unsigned N)
Stmt * getTransformedStmt() const
Get the de-sugared statements after the loop transformation.
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.
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.
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.
static OMPMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
This represents 'pragma omp master taskloop' directive.
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.
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.
static OMPMetaDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
static OMPMetaDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Stmt *IfStmt)
This represents block-associated 'pragma omp ordered' directive.
static OMPOrderedBlockAssocDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
static OMPOrderedBlockAssocDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents standalone 'pragma omp ordered' directive.
static OMPOrderedStandaloneDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPOrderedStandaloneDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive.
This represents 'pragma omp parallel for' directive.
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.
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp parallel for simd' directive.
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
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.
static OMPParallelMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelMaskedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef)
Creates directive with a list of Clauses.
This represents 'pragma omp parallel masked taskloop' directive.
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.
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.
static OMPParallelMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef)
Creates directive with a list of Clauses.
static OMPParallelMasterDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp parallel master taskloop' directive.
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.
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.
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.
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents the 'pragma omp reverse' loop transformation directive.
static OMPReverseDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, unsigned NumLoops, Stmt *TransformedStmt, Stmt *PreInits)
Create a new AST node representation for 'pragma omp reverse'.
static OMPReverseDirective * CreateEmpty(const ASTContext &C, unsigned NumLoops)
Build an empty 'pragma omp reverse' AST node for deserialization.
static OMPScanDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPScanDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
static OMPScopeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
static OMPScopeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
void setHasCancel(bool Has)
Set cancel state.
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPSectionDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, bool HasCancel)
Creates directive.
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.
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp simd' directive.
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.
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPSingleDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents the 'pragma omp split' loop transformation directive.
static OMPSplitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp split' AST node for deserialization.
static OMPSplitDirective * 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 split'.
This represents the 'pragma omp stripe' loop transformation directive.
static OMPStripeDirective * 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 stripe'.
static OMPStripeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp stripe' AST node for deserialization.
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.
static OMPTargetDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTaskDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
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.
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.
static OMPTaskgroupDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *ReductionRef)
Creates directive.
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents 'pragma omp taskwait' directive.
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPTaskwaitDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive.
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPTaskyieldDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
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.
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.
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.
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.
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.
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.
static OMPTileDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp tile' AST node for deserialization.
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'.
static OMPUnrollDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, unsigned NumGeneratedTopLevelLoops, Stmt *TransformedStmt, Stmt *PreInits)
Create a new AST node representation for 'pragma omp unroll'.
static OMPUnrollDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Build an empty 'pragma omp unroll' AST node for deserialization.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition ASTContext.h:239
This represents one expression.
Definition Expr.h:113
Encodes a location in the source.
Stmt - This represents one statement.
Definition Stmt.h:85
Stmt * IgnoreContainers(bool IgnoreCaptured=false)
Skip no-op (attributed, compound) container stmts and skip captured stmt at the top,...
Definition Stmt.cpp:210
Top level wrappers for InstallAPI frontend operations.
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
bool isa(CodeGen::Address addr)
Definition Address.h:330
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
Stmt Stmt llvm::function_ref< void(OMPLoopTransformationDirective *)> OnTransformationCallback
Definition StmtOpenMP.h:923
bool hasSpecificAttr(const Container &container)
Stmt Stmt * Callback
Definition StmtOpenMP.h:919
auto * getSpecificAttr(const Container &container)
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
Definition OpenMPKinds.h:25
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
MutableArrayRef< Expr * > getInits()
U cast(CodeGen::Address addr)
Definition Address.h:327
Expr * Cond
Conditional expression in atomic compare construct. */.
Expr * X
'x' part of the associated expression/statement.
bool IsXLHSInRHSPart
True if UE has the first form and false if the second.
Expr * E
'expr' part of the associated expression/statement.
Expr * D
'd' part of the associated expression/statement.
Expr * V
'v' part of the associated expression/statement.
bool IsFailOnly
True if 'v' is updated only when the condition is false (compare capture only).
Expr * UE
UE Helper expression of the form: 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExp...
bool IsPostfixUpdate
True if original value of 'x' must be stored in 'v', not an updated one.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...