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
607OMPFlattenDirective *OMPFlattenDirective::Create(
608 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
609 ArrayRef<OMPClause *> Clauses, unsigned NumLoops, Stmt *AssociatedStmt,
610 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals) {
611 OMPFlattenDirective *Dir = createDirective<OMPFlattenDirective>(
612 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
613 Dir->setTransformedStmt(TransformedStmt);
614 Dir->setPreInits(PreInits);
615 Dir->setFinals(Finals);
616 return Dir;
617}
618
620 unsigned NumClauses,
621 unsigned NumLoops) {
622 return createEmptyDirective<OMPFlattenDirective>(
623 C, NumClauses, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
624 SourceLocation(), SourceLocation(), NumLoops);
625}
626
630 unsigned NumLoops, Stmt *AssociatedStmt,
631 Stmt *TransformedStmt, Stmt *PreInits) {
632 OMPSplitDirective *Dir = createDirective<OMPSplitDirective>(
633 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
634 NumLoops);
635 Dir->setTransformedStmt(TransformedStmt);
636 Dir->setPreInits(PreInits);
637 return Dir;
638}
639
641 unsigned NumClauses,
642 unsigned NumLoops) {
643 return createEmptyDirective<OMPSplitDirective>(
644 C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1,
645 SourceLocation(), SourceLocation(), NumLoops);
646}
647
648OMPFuseDirective *OMPFuseDirective::Create(
649 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
650 ArrayRef<OMPClause *> Clauses, unsigned NumGeneratedTopLevelLoops,
651 Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits) {
652
653 OMPFuseDirective *Dir = createDirective<OMPFuseDirective>(
654 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc);
655 Dir->setTransformedStmt(TransformedStmt);
656 Dir->setPreInits(PreInits);
657 Dir->setNumGeneratedTopLevelLoops(NumGeneratedTopLevelLoops);
658 return Dir;
659}
660
662 unsigned NumClauses) {
663 OMPFuseDirective *Dir = createEmptyDirective<OMPFuseDirective>(
664 C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1,
666 return Dir;
667}
668
671 SourceLocation EndLoc, unsigned CollapsedNum,
672 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
673 const HelperExprs &Exprs) {
674 auto *Dir = createDirective<OMPForSimdDirective>(
675 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for_simd),
676 StartLoc, EndLoc, CollapsedNum);
677 Dir->setIterationVariable(Exprs.IterationVarRef);
678 Dir->setLastIteration(Exprs.LastIteration);
679 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
680 Dir->setPreCond(Exprs.PreCond);
681 Dir->setCond(Exprs.Cond);
682 Dir->setInit(Exprs.Init);
683 Dir->setInc(Exprs.Inc);
684 Dir->setIsLastIterVariable(Exprs.IL);
685 Dir->setLowerBoundVariable(Exprs.LB);
686 Dir->setUpperBoundVariable(Exprs.UB);
687 Dir->setStrideVariable(Exprs.ST);
688 Dir->setEnsureUpperBound(Exprs.EUB);
689 Dir->setNextLowerBound(Exprs.NLB);
690 Dir->setNextUpperBound(Exprs.NUB);
691 Dir->setNumIterations(Exprs.NumIterations);
692 Dir->setCounters(Exprs.Counters);
693 Dir->setPrivateCounters(Exprs.PrivateCounters);
694 Dir->setInits(Exprs.Inits);
695 Dir->setUpdates(Exprs.Updates);
696 Dir->setFinals(Exprs.Finals);
697 Dir->setDependentCounters(Exprs.DependentCounters);
698 Dir->setDependentInits(Exprs.DependentInits);
699 Dir->setFinalsConditions(Exprs.FinalsConditions);
700 Dir->setPreInits(Exprs.PreInits);
701 return Dir;
702}
703
705 unsigned NumClauses,
706 unsigned CollapsedNum,
707 EmptyShell) {
708 return createEmptyDirective<OMPForSimdDirective>(
709 C, NumClauses, /*HasAssociatedStmt=*/true,
710 numLoopChildren(CollapsedNum, OMPD_for_simd), CollapsedNum);
711}
712
713OMPSectionsDirective *OMPSectionsDirective::Create(
714 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
715 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
716 bool HasCancel) {
717 auto *Dir = createDirective<OMPSectionsDirective>(C, Clauses, AssociatedStmt,
718 /*NumChildren=*/1, StartLoc,
719 EndLoc);
720 Dir->setTaskReductionRefExpr(TaskRedRef);
721 Dir->setHasCancel(HasCancel);
722 return Dir;
723}
724
725OMPSectionsDirective *OMPSectionsDirective::CreateEmpty(const ASTContext &C,
726 unsigned NumClauses,
727 EmptyShell) {
728 return createEmptyDirective<OMPSectionsDirective>(C, NumClauses,
729 /*HasAssociatedStmt=*/true,
730 /*NumChildren=*/1);
731}
732
733OMPSectionDirective *OMPSectionDirective::Create(const ASTContext &C,
734 SourceLocation StartLoc,
735 SourceLocation EndLoc,
736 Stmt *AssociatedStmt,
737 bool HasCancel) {
738 auto *Dir =
739 createDirective<OMPSectionDirective>(C, {}, AssociatedStmt,
740 /*NumChildren=*/0, StartLoc, EndLoc);
741 Dir->setHasCancel(HasCancel);
742 return Dir;
743}
744
746 EmptyShell) {
747 return createEmptyDirective<OMPSectionDirective>(C, /*NumClauses=*/0,
748 /*HasAssociatedStmt=*/true);
749}
750
751OMPScopeDirective *OMPScopeDirective::Create(const ASTContext &C,
752 SourceLocation StartLoc,
753 SourceLocation EndLoc,
754 ArrayRef<OMPClause *> Clauses,
755 Stmt *AssociatedStmt) {
756 return createDirective<OMPScopeDirective>(C, Clauses, AssociatedStmt,
757 /*NumChildren=*/0, StartLoc,
758 EndLoc);
759}
760
762 unsigned NumClauses,
763 EmptyShell) {
764 return createEmptyDirective<OMPScopeDirective>(C, NumClauses,
765 /*HasAssociatedStmt=*/true);
766}
767
768OMPSingleDirective *OMPSingleDirective::Create(const ASTContext &C,
769 SourceLocation StartLoc,
770 SourceLocation EndLoc,
771 ArrayRef<OMPClause *> Clauses,
772 Stmt *AssociatedStmt) {
773 return createDirective<OMPSingleDirective>(C, Clauses, AssociatedStmt,
774 /*NumChildren=*/0, StartLoc,
775 EndLoc);
776}
777
779 unsigned NumClauses,
780 EmptyShell) {
781 return createEmptyDirective<OMPSingleDirective>(C, NumClauses,
782 /*HasAssociatedStmt=*/true);
783}
784
785OMPMasterDirective *OMPMasterDirective::Create(const ASTContext &C,
786 SourceLocation StartLoc,
787 SourceLocation EndLoc,
788 Stmt *AssociatedStmt) {
789 return createDirective<OMPMasterDirective>(C, {}, AssociatedStmt,
790 /*NumChildren=*/0, StartLoc,
791 EndLoc);
792}
793
795 EmptyShell) {
796 return createEmptyDirective<OMPMasterDirective>(C, /*NumClauses=*/0,
797 /*HasAssociatedStmt=*/true);
798}
799
800OMPCriticalDirective *OMPCriticalDirective::Create(
801 const ASTContext &C, const DeclarationNameInfo &Name,
802 SourceLocation StartLoc, SourceLocation EndLoc,
803 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
804 return createDirective<OMPCriticalDirective>(C, Clauses, AssociatedStmt,
805 /*NumChildren=*/0, Name,
806 StartLoc, EndLoc);
807}
808
809OMPCriticalDirective *OMPCriticalDirective::CreateEmpty(const ASTContext &C,
810 unsigned NumClauses,
811 EmptyShell) {
812 return createEmptyDirective<OMPCriticalDirective>(C, NumClauses,
813 /*HasAssociatedStmt=*/true);
814}
815
816OMPParallelForDirective *OMPParallelForDirective::Create(
817 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
818 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
819 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
820 auto *Dir = createDirective<OMPParallelForDirective>(
821 C, Clauses, AssociatedStmt,
822 numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, StartLoc, EndLoc,
823 CollapsedNum);
824 Dir->setIterationVariable(Exprs.IterationVarRef);
825 Dir->setLastIteration(Exprs.LastIteration);
826 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
827 Dir->setPreCond(Exprs.PreCond);
828 Dir->setCond(Exprs.Cond);
829 Dir->setInit(Exprs.Init);
830 Dir->setInc(Exprs.Inc);
831 Dir->setIsLastIterVariable(Exprs.IL);
832 Dir->setLowerBoundVariable(Exprs.LB);
833 Dir->setUpperBoundVariable(Exprs.UB);
834 Dir->setStrideVariable(Exprs.ST);
835 Dir->setEnsureUpperBound(Exprs.EUB);
836 Dir->setNextLowerBound(Exprs.NLB);
837 Dir->setNextUpperBound(Exprs.NUB);
838 Dir->setNumIterations(Exprs.NumIterations);
839 Dir->setCounters(Exprs.Counters);
840 Dir->setPrivateCounters(Exprs.PrivateCounters);
841 Dir->setInits(Exprs.Inits);
842 Dir->setUpdates(Exprs.Updates);
843 Dir->setFinals(Exprs.Finals);
844 Dir->setDependentCounters(Exprs.DependentCounters);
845 Dir->setDependentInits(Exprs.DependentInits);
846 Dir->setFinalsConditions(Exprs.FinalsConditions);
847 Dir->setPreInits(Exprs.PreInits);
848 Dir->setTaskReductionRefExpr(TaskRedRef);
849 Dir->setHasCancel(HasCancel);
850 return Dir;
851}
852
855 unsigned CollapsedNum, EmptyShell) {
856 return createEmptyDirective<OMPParallelForDirective>(
857 C, NumClauses, /*HasAssociatedStmt=*/true,
858 numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, CollapsedNum);
859}
860
861OMPParallelForSimdDirective *OMPParallelForSimdDirective::Create(
862 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
863 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
864 const HelperExprs &Exprs) {
865 auto *Dir = createDirective<OMPParallelForSimdDirective>(
866 C, Clauses, AssociatedStmt,
867 numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), StartLoc, EndLoc,
868 CollapsedNum);
869 Dir->setIterationVariable(Exprs.IterationVarRef);
870 Dir->setLastIteration(Exprs.LastIteration);
871 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
872 Dir->setPreCond(Exprs.PreCond);
873 Dir->setCond(Exprs.Cond);
874 Dir->setInit(Exprs.Init);
875 Dir->setInc(Exprs.Inc);
876 Dir->setIsLastIterVariable(Exprs.IL);
877 Dir->setLowerBoundVariable(Exprs.LB);
878 Dir->setUpperBoundVariable(Exprs.UB);
879 Dir->setStrideVariable(Exprs.ST);
880 Dir->setEnsureUpperBound(Exprs.EUB);
881 Dir->setNextLowerBound(Exprs.NLB);
882 Dir->setNextUpperBound(Exprs.NUB);
883 Dir->setNumIterations(Exprs.NumIterations);
884 Dir->setCounters(Exprs.Counters);
885 Dir->setPrivateCounters(Exprs.PrivateCounters);
886 Dir->setInits(Exprs.Inits);
887 Dir->setUpdates(Exprs.Updates);
888 Dir->setFinals(Exprs.Finals);
889 Dir->setDependentCounters(Exprs.DependentCounters);
890 Dir->setDependentInits(Exprs.DependentInits);
891 Dir->setFinalsConditions(Exprs.FinalsConditions);
892 Dir->setPreInits(Exprs.PreInits);
893 return Dir;
894}
895
898 unsigned NumClauses,
899 unsigned CollapsedNum, EmptyShell) {
900 return createEmptyDirective<OMPParallelForSimdDirective>(
901 C, NumClauses, /*HasAssociatedStmt=*/true,
902 numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), CollapsedNum);
903}
904
905OMPParallelMasterDirective *OMPParallelMasterDirective::Create(
906 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
907 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) {
908 auto *Dir = createDirective<OMPParallelMasterDirective>(
909 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
910 Dir->setTaskReductionRefExpr(TaskRedRef);
911 return Dir;
912}
913
916 unsigned NumClauses, EmptyShell) {
917 return createEmptyDirective<OMPParallelMasterDirective>(
918 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
919}
920
921OMPParallelMaskedDirective *OMPParallelMaskedDirective::Create(
922 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
923 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) {
924 auto *Dir = createDirective<OMPParallelMaskedDirective>(
925 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
926 Dir->setTaskReductionRefExpr(TaskRedRef);
927 return Dir;
928}
929
932 unsigned NumClauses, EmptyShell) {
933 return createEmptyDirective<OMPParallelMaskedDirective>(
934 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
935}
936
937OMPParallelSectionsDirective *OMPParallelSectionsDirective::Create(
938 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
939 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
940 bool HasCancel) {
941 auto *Dir = createDirective<OMPParallelSectionsDirective>(
942 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
943 Dir->setTaskReductionRefExpr(TaskRedRef);
944 Dir->setHasCancel(HasCancel);
945 return Dir;
946}
947
950 unsigned NumClauses, EmptyShell) {
951 return createEmptyDirective<OMPParallelSectionsDirective>(
952 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
953}
954
958 Stmt *AssociatedStmt, bool HasCancel) {
959 auto *Dir = createDirective<OMPTaskDirective>(
960 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
961 Dir->setHasCancel(HasCancel);
962 return Dir;
963}
964
966 unsigned NumClauses,
967 EmptyShell) {
968 return createEmptyDirective<OMPTaskDirective>(C, NumClauses,
969 /*HasAssociatedStmt=*/true);
970}
971
972OMPTaskyieldDirective *OMPTaskyieldDirective::Create(const ASTContext &C,
973 SourceLocation StartLoc,
974 SourceLocation EndLoc) {
975 return new (C) OMPTaskyieldDirective(StartLoc, EndLoc);
976}
977
978OMPTaskyieldDirective *OMPTaskyieldDirective::CreateEmpty(const ASTContext &C,
979 EmptyShell) {
980 return new (C) OMPTaskyieldDirective();
981}
982
983OMPAssumeDirective *OMPAssumeDirective::Create(const ASTContext &C,
984 SourceLocation StartLoc,
985 SourceLocation EndLoc,
986 ArrayRef<OMPClause *> Clauses,
987 Stmt *AStmt) {
988 return createDirective<OMPAssumeDirective>(C, Clauses, AStmt,
989 /*NumChildren=*/0, StartLoc,
990 EndLoc);
991}
992
994 unsigned NumClauses,
995 EmptyShell) {
996 return createEmptyDirective<OMPAssumeDirective>(C, NumClauses,
997 /*HasAssociatedStmt=*/true);
998}
999
1000OMPErrorDirective *OMPErrorDirective::Create(const ASTContext &C,
1001 SourceLocation StartLoc,
1002 SourceLocation EndLoc,
1003 ArrayRef<OMPClause *> Clauses) {
1004 return createDirective<OMPErrorDirective>(
1005 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1006 EndLoc);
1007}
1008
1010 unsigned NumClauses,
1011 EmptyShell) {
1012 return createEmptyDirective<OMPErrorDirective>(C, NumClauses);
1013}
1014
1015OMPBarrierDirective *OMPBarrierDirective::Create(const ASTContext &C,
1016 SourceLocation StartLoc,
1017 SourceLocation EndLoc) {
1018 return new (C) OMPBarrierDirective(StartLoc, EndLoc);
1019}
1020
1022 EmptyShell) {
1023 return new (C) OMPBarrierDirective();
1024}
1025
1028 SourceLocation EndLoc,
1029 ArrayRef<OMPClause *> Clauses) {
1030 return createDirective<OMPTaskwaitDirective>(
1031 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1032 EndLoc);
1033}
1034
1036 unsigned NumClauses,
1037 EmptyShell) {
1038 return createEmptyDirective<OMPTaskwaitDirective>(C, NumClauses);
1039}
1040
1041OMPTaskgroupDirective *OMPTaskgroupDirective::Create(
1042 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1043 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) {
1044 auto *Dir = createDirective<OMPTaskgroupDirective>(
1045 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
1046 Dir->setReductionRef(ReductionRef);
1047 return Dir;
1048}
1049
1051 unsigned NumClauses,
1052 EmptyShell) {
1053 return createEmptyDirective<OMPTaskgroupDirective>(
1054 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
1055}
1056
1057OMPCancellationPointDirective *OMPCancellationPointDirective::Create(
1058 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1059 OpenMPDirectiveKind CancelRegion) {
1060 auto *Dir = new (C) OMPCancellationPointDirective(StartLoc, EndLoc);
1061 Dir->setCancelRegion(CancelRegion);
1062 return Dir;
1063}
1064
1067 return new (C) OMPCancellationPointDirective();
1068}
1069
1072 SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
1073 OpenMPDirectiveKind CancelRegion) {
1074 auto *Dir = createDirective<OMPCancelDirective>(
1075 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1076 EndLoc);
1077 Dir->setCancelRegion(CancelRegion);
1078 return Dir;
1079}
1080
1082 unsigned NumClauses,
1083 EmptyShell) {
1084 return createEmptyDirective<OMPCancelDirective>(C, NumClauses);
1085}
1086
1087OMPFlushDirective *OMPFlushDirective::Create(const ASTContext &C,
1088 SourceLocation StartLoc,
1089 SourceLocation EndLoc,
1090 ArrayRef<OMPClause *> Clauses) {
1091 return createDirective<OMPFlushDirective>(
1092 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1093 EndLoc);
1094}
1095
1097 unsigned NumClauses,
1098 EmptyShell) {
1099 return createEmptyDirective<OMPFlushDirective>(C, NumClauses);
1100}
1101
1102OMPDepobjDirective *OMPDepobjDirective::Create(const ASTContext &C,
1103 SourceLocation StartLoc,
1104 SourceLocation EndLoc,
1105 ArrayRef<OMPClause *> Clauses) {
1106 return createDirective<OMPDepobjDirective>(
1107 C, Clauses, /*AssociatedStmt=*/nullptr,
1108 /*NumChildren=*/0, StartLoc, EndLoc);
1109}
1110
1112 unsigned NumClauses,
1113 EmptyShell) {
1114 return createEmptyDirective<OMPDepobjDirective>(C, NumClauses);
1115}
1116
1117OMPScanDirective *OMPScanDirective::Create(const ASTContext &C,
1118 SourceLocation StartLoc,
1119 SourceLocation EndLoc,
1120 ArrayRef<OMPClause *> Clauses) {
1121 return createDirective<OMPScanDirective>(C, Clauses,
1122 /*AssociatedStmt=*/nullptr,
1123 /*NumChildren=*/0, StartLoc, EndLoc);
1124}
1125
1127 unsigned NumClauses,
1128 EmptyShell) {
1129 return createEmptyDirective<OMPScanDirective>(C, NumClauses);
1130}
1131
1132OMPOrderedStandaloneDirective *OMPOrderedStandaloneDirective::Create(
1133 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1134 ArrayRef<OMPClause *> Clauses) {
1135 return createDirective<OMPOrderedStandaloneDirective>(
1136 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1137 EndLoc);
1138}
1139
1142 unsigned NumClauses, EmptyShell) {
1143 return createEmptyDirective<OMPOrderedStandaloneDirective>(C, NumClauses);
1144}
1145
1146OMPOrderedBlockAssocDirective *OMPOrderedBlockAssocDirective::Create(
1147 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1148 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1149 return createDirective<OMPOrderedBlockAssocDirective>(
1150 C, Clauses, cast<CapturedStmt>(AssociatedStmt), /*NumChildren=*/0,
1151 StartLoc, EndLoc);
1152}
1153
1156 unsigned NumClauses, EmptyShell) {
1157 return createEmptyDirective<OMPOrderedBlockAssocDirective>(
1158 C, NumClauses, /*HasAssociatedStmt=*/true);
1159}
1160
1163 SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
1164 Stmt *AssociatedStmt, Expressions Exprs) {
1165 auto *Dir = createDirective<OMPAtomicDirective>(
1166 C, Clauses, AssociatedStmt, /*NumChildren=*/7, StartLoc, EndLoc);
1167 Dir->setX(Exprs.X);
1168 Dir->setV(Exprs.V);
1169 Dir->setR(Exprs.R);
1170 Dir->setExpr(Exprs.E);
1171 Dir->setUpdateExpr(Exprs.UE);
1172 Dir->setD(Exprs.D);
1173 Dir->setCond(Exprs.Cond);
1174 Dir->Flags.IsXLHSInRHSPart = Exprs.IsXLHSInRHSPart ? 1 : 0;
1175 Dir->Flags.IsPostfixUpdate = Exprs.IsPostfixUpdate ? 1 : 0;
1176 Dir->Flags.IsFailOnly = Exprs.IsFailOnly ? 1 : 0;
1177 return Dir;
1178}
1179
1181 unsigned NumClauses,
1182 EmptyShell) {
1183 return createEmptyDirective<OMPAtomicDirective>(
1184 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/7);
1185}
1186
1187OMPTargetDirective *OMPTargetDirective::Create(const ASTContext &C,
1188 SourceLocation StartLoc,
1189 SourceLocation EndLoc,
1190 ArrayRef<OMPClause *> Clauses,
1191 Stmt *AssociatedStmt) {
1192 return createDirective<OMPTargetDirective>(
1193 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1194}
1195
1197 unsigned NumClauses,
1198 EmptyShell) {
1199 return createEmptyDirective<OMPTargetDirective>(C, NumClauses,
1200 /*HasAssociatedStmt=*/true);
1201}
1202
1203OMPTargetParallelDirective *OMPTargetParallelDirective::Create(
1204 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1205 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
1206 bool HasCancel) {
1207 auto *Dir = createDirective<OMPTargetParallelDirective>(
1208 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
1209 Dir->setTaskReductionRefExpr(TaskRedRef);
1210 Dir->setHasCancel(HasCancel);
1211 return Dir;
1212}
1213
1216 unsigned NumClauses, EmptyShell) {
1217 return createEmptyDirective<OMPTargetParallelDirective>(
1218 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
1219}
1220
1221OMPTargetParallelForDirective *OMPTargetParallelForDirective::Create(
1222 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1223 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1224 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1225 auto *Dir = createDirective<OMPTargetParallelForDirective>(
1226 C, Clauses, AssociatedStmt,
1227 numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1, StartLoc,
1228 EndLoc, CollapsedNum);
1229 Dir->setIterationVariable(Exprs.IterationVarRef);
1230 Dir->setLastIteration(Exprs.LastIteration);
1231 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1232 Dir->setPreCond(Exprs.PreCond);
1233 Dir->setCond(Exprs.Cond);
1234 Dir->setInit(Exprs.Init);
1235 Dir->setInc(Exprs.Inc);
1236 Dir->setIsLastIterVariable(Exprs.IL);
1237 Dir->setLowerBoundVariable(Exprs.LB);
1238 Dir->setUpperBoundVariable(Exprs.UB);
1239 Dir->setStrideVariable(Exprs.ST);
1240 Dir->setEnsureUpperBound(Exprs.EUB);
1241 Dir->setNextLowerBound(Exprs.NLB);
1242 Dir->setNextUpperBound(Exprs.NUB);
1243 Dir->setNumIterations(Exprs.NumIterations);
1244 Dir->setCounters(Exprs.Counters);
1245 Dir->setPrivateCounters(Exprs.PrivateCounters);
1246 Dir->setInits(Exprs.Inits);
1247 Dir->setUpdates(Exprs.Updates);
1248 Dir->setFinals(Exprs.Finals);
1249 Dir->setDependentCounters(Exprs.DependentCounters);
1250 Dir->setDependentInits(Exprs.DependentInits);
1251 Dir->setFinalsConditions(Exprs.FinalsConditions);
1252 Dir->setPreInits(Exprs.PreInits);
1253 Dir->setTaskReductionRefExpr(TaskRedRef);
1254 Dir->setHasCancel(HasCancel);
1255 return Dir;
1256}
1257
1260 unsigned NumClauses,
1261 unsigned CollapsedNum, EmptyShell) {
1262 return createEmptyDirective<OMPTargetParallelForDirective>(
1263 C, NumClauses, /*HasAssociatedStmt=*/true,
1264 numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1,
1265 CollapsedNum);
1266}
1267
1268OMPTargetDataDirective *OMPTargetDataDirective::Create(
1269 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1270 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1271 return createDirective<OMPTargetDataDirective>(
1272 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1273}
1274
1275OMPTargetDataDirective *OMPTargetDataDirective::CreateEmpty(const ASTContext &C,
1276 unsigned N,
1277 EmptyShell) {
1278 return createEmptyDirective<OMPTargetDataDirective>(
1279 C, N, /*HasAssociatedStmt=*/true);
1280}
1281
1282OMPTargetEnterDataDirective *OMPTargetEnterDataDirective::Create(
1283 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1284 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1285 return createDirective<OMPTargetEnterDataDirective>(
1286 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1287}
1288
1291 EmptyShell) {
1292 return createEmptyDirective<OMPTargetEnterDataDirective>(
1293 C, N, /*HasAssociatedStmt=*/true);
1294}
1295
1296OMPTargetExitDataDirective *OMPTargetExitDataDirective::Create(
1297 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1298 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1299 return createDirective<OMPTargetExitDataDirective>(
1300 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1301}
1302
1305 EmptyShell) {
1306 return createEmptyDirective<OMPTargetExitDataDirective>(
1307 C, N, /*HasAssociatedStmt=*/true);
1308}
1309
1310OMPTeamsDirective *OMPTeamsDirective::Create(const ASTContext &C,
1311 SourceLocation StartLoc,
1312 SourceLocation EndLoc,
1313 ArrayRef<OMPClause *> Clauses,
1314 Stmt *AssociatedStmt) {
1315 return createDirective<OMPTeamsDirective>(
1316 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1317}
1318
1320 unsigned NumClauses,
1321 EmptyShell) {
1322 return createEmptyDirective<OMPTeamsDirective>(C, NumClauses,
1323 /*HasAssociatedStmt=*/true);
1324}
1325
1326OMPTaskLoopDirective *OMPTaskLoopDirective::Create(
1327 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1328 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1329 const HelperExprs &Exprs, bool HasCancel) {
1330 auto *Dir = createDirective<OMPTaskLoopDirective>(
1331 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_taskloop),
1332 StartLoc, EndLoc, CollapsedNum);
1333 Dir->setIterationVariable(Exprs.IterationVarRef);
1334 Dir->setLastIteration(Exprs.LastIteration);
1335 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1336 Dir->setPreCond(Exprs.PreCond);
1337 Dir->setCond(Exprs.Cond);
1338 Dir->setInit(Exprs.Init);
1339 Dir->setInc(Exprs.Inc);
1340 Dir->setIsLastIterVariable(Exprs.IL);
1341 Dir->setLowerBoundVariable(Exprs.LB);
1342 Dir->setUpperBoundVariable(Exprs.UB);
1343 Dir->setStrideVariable(Exprs.ST);
1344 Dir->setEnsureUpperBound(Exprs.EUB);
1345 Dir->setNextLowerBound(Exprs.NLB);
1346 Dir->setNextUpperBound(Exprs.NUB);
1347 Dir->setNumIterations(Exprs.NumIterations);
1348 Dir->setCounters(Exprs.Counters);
1349 Dir->setPrivateCounters(Exprs.PrivateCounters);
1350 Dir->setInits(Exprs.Inits);
1351 Dir->setUpdates(Exprs.Updates);
1352 Dir->setFinals(Exprs.Finals);
1353 Dir->setDependentCounters(Exprs.DependentCounters);
1354 Dir->setDependentInits(Exprs.DependentInits);
1355 Dir->setFinalsConditions(Exprs.FinalsConditions);
1356 Dir->setPreInits(Exprs.PreInits);
1357 Dir->setHasCancel(HasCancel);
1358 return Dir;
1359}
1360
1362 unsigned NumClauses,
1363 unsigned CollapsedNum,
1364 EmptyShell) {
1365 return createEmptyDirective<OMPTaskLoopDirective>(
1366 C, NumClauses, /*HasAssociatedStmt=*/true,
1367 numLoopChildren(CollapsedNum, OMPD_taskloop), CollapsedNum);
1368}
1369
1370OMPTaskLoopSimdDirective *OMPTaskLoopSimdDirective::Create(
1371 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1372 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1373 const HelperExprs &Exprs) {
1374 auto *Dir = createDirective<OMPTaskLoopSimdDirective>(
1375 C, Clauses, AssociatedStmt,
1376 numLoopChildren(CollapsedNum, OMPD_taskloop_simd), StartLoc, EndLoc,
1377 CollapsedNum);
1378 Dir->setIterationVariable(Exprs.IterationVarRef);
1379 Dir->setLastIteration(Exprs.LastIteration);
1380 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1381 Dir->setPreCond(Exprs.PreCond);
1382 Dir->setCond(Exprs.Cond);
1383 Dir->setInit(Exprs.Init);
1384 Dir->setInc(Exprs.Inc);
1385 Dir->setIsLastIterVariable(Exprs.IL);
1386 Dir->setLowerBoundVariable(Exprs.LB);
1387 Dir->setUpperBoundVariable(Exprs.UB);
1388 Dir->setStrideVariable(Exprs.ST);
1389 Dir->setEnsureUpperBound(Exprs.EUB);
1390 Dir->setNextLowerBound(Exprs.NLB);
1391 Dir->setNextUpperBound(Exprs.NUB);
1392 Dir->setNumIterations(Exprs.NumIterations);
1393 Dir->setCounters(Exprs.Counters);
1394 Dir->setPrivateCounters(Exprs.PrivateCounters);
1395 Dir->setInits(Exprs.Inits);
1396 Dir->setUpdates(Exprs.Updates);
1397 Dir->setFinals(Exprs.Finals);
1398 Dir->setDependentCounters(Exprs.DependentCounters);
1399 Dir->setDependentInits(Exprs.DependentInits);
1400 Dir->setFinalsConditions(Exprs.FinalsConditions);
1401 Dir->setPreInits(Exprs.PreInits);
1402 return Dir;
1403}
1404
1407 unsigned CollapsedNum, EmptyShell) {
1408 return createEmptyDirective<OMPTaskLoopSimdDirective>(
1409 C, NumClauses, /*HasAssociatedStmt=*/true,
1410 numLoopChildren(CollapsedNum, OMPD_taskloop_simd), CollapsedNum);
1411}
1412
1413OMPMasterTaskLoopDirective *OMPMasterTaskLoopDirective::Create(
1414 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1415 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1416 const HelperExprs &Exprs, bool HasCancel) {
1417 auto *Dir = createDirective<OMPMasterTaskLoopDirective>(
1418 C, Clauses, AssociatedStmt,
1419 numLoopChildren(CollapsedNum, OMPD_master_taskloop), StartLoc, EndLoc,
1420 CollapsedNum);
1421 Dir->setIterationVariable(Exprs.IterationVarRef);
1422 Dir->setLastIteration(Exprs.LastIteration);
1423 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1424 Dir->setPreCond(Exprs.PreCond);
1425 Dir->setCond(Exprs.Cond);
1426 Dir->setInit(Exprs.Init);
1427 Dir->setInc(Exprs.Inc);
1428 Dir->setIsLastIterVariable(Exprs.IL);
1429 Dir->setLowerBoundVariable(Exprs.LB);
1430 Dir->setUpperBoundVariable(Exprs.UB);
1431 Dir->setStrideVariable(Exprs.ST);
1432 Dir->setEnsureUpperBound(Exprs.EUB);
1433 Dir->setNextLowerBound(Exprs.NLB);
1434 Dir->setNextUpperBound(Exprs.NUB);
1435 Dir->setNumIterations(Exprs.NumIterations);
1436 Dir->setCounters(Exprs.Counters);
1437 Dir->setPrivateCounters(Exprs.PrivateCounters);
1438 Dir->setInits(Exprs.Inits);
1439 Dir->setUpdates(Exprs.Updates);
1440 Dir->setFinals(Exprs.Finals);
1441 Dir->setDependentCounters(Exprs.DependentCounters);
1442 Dir->setDependentInits(Exprs.DependentInits);
1443 Dir->setFinalsConditions(Exprs.FinalsConditions);
1444 Dir->setPreInits(Exprs.PreInits);
1445 Dir->setHasCancel(HasCancel);
1446 return Dir;
1447}
1448
1451 unsigned NumClauses,
1452 unsigned CollapsedNum, EmptyShell) {
1453 return createEmptyDirective<OMPMasterTaskLoopDirective>(
1454 C, NumClauses, /*HasAssociatedStmt=*/true,
1455 numLoopChildren(CollapsedNum, OMPD_master_taskloop), CollapsedNum);
1456}
1457
1458OMPMaskedTaskLoopDirective *OMPMaskedTaskLoopDirective::Create(
1459 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1460 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1461 const HelperExprs &Exprs, bool HasCancel) {
1462 auto *Dir = createDirective<OMPMaskedTaskLoopDirective>(
1463 C, Clauses, AssociatedStmt,
1464 numLoopChildren(CollapsedNum, OMPD_masked_taskloop), StartLoc, EndLoc,
1465 CollapsedNum);
1466 Dir->setIterationVariable(Exprs.IterationVarRef);
1467 Dir->setLastIteration(Exprs.LastIteration);
1468 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1469 Dir->setPreCond(Exprs.PreCond);
1470 Dir->setCond(Exprs.Cond);
1471 Dir->setInit(Exprs.Init);
1472 Dir->setInc(Exprs.Inc);
1473 Dir->setIsLastIterVariable(Exprs.IL);
1474 Dir->setLowerBoundVariable(Exprs.LB);
1475 Dir->setUpperBoundVariable(Exprs.UB);
1476 Dir->setStrideVariable(Exprs.ST);
1477 Dir->setEnsureUpperBound(Exprs.EUB);
1478 Dir->setNextLowerBound(Exprs.NLB);
1479 Dir->setNextUpperBound(Exprs.NUB);
1480 Dir->setNumIterations(Exprs.NumIterations);
1481 Dir->setCounters(Exprs.Counters);
1482 Dir->setPrivateCounters(Exprs.PrivateCounters);
1483 Dir->setInits(Exprs.Inits);
1484 Dir->setUpdates(Exprs.Updates);
1485 Dir->setFinals(Exprs.Finals);
1486 Dir->setDependentCounters(Exprs.DependentCounters);
1487 Dir->setDependentInits(Exprs.DependentInits);
1488 Dir->setFinalsConditions(Exprs.FinalsConditions);
1489 Dir->setPreInits(Exprs.PreInits);
1490 Dir->setHasCancel(HasCancel);
1491 return Dir;
1492}
1493
1496 unsigned NumClauses,
1497 unsigned CollapsedNum, EmptyShell) {
1498 return createEmptyDirective<OMPMaskedTaskLoopDirective>(
1499 C, NumClauses, /*HasAssociatedStmt=*/true,
1500 numLoopChildren(CollapsedNum, OMPD_masked_taskloop), CollapsedNum);
1501}
1502
1503OMPMasterTaskLoopSimdDirective *OMPMasterTaskLoopSimdDirective::Create(
1504 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1505 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1506 const HelperExprs &Exprs) {
1507 auto *Dir = createDirective<OMPMasterTaskLoopSimdDirective>(
1508 C, Clauses, AssociatedStmt,
1509 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), StartLoc,
1510 EndLoc, CollapsedNum);
1511 Dir->setIterationVariable(Exprs.IterationVarRef);
1512 Dir->setLastIteration(Exprs.LastIteration);
1513 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1514 Dir->setPreCond(Exprs.PreCond);
1515 Dir->setCond(Exprs.Cond);
1516 Dir->setInit(Exprs.Init);
1517 Dir->setInc(Exprs.Inc);
1518 Dir->setIsLastIterVariable(Exprs.IL);
1519 Dir->setLowerBoundVariable(Exprs.LB);
1520 Dir->setUpperBoundVariable(Exprs.UB);
1521 Dir->setStrideVariable(Exprs.ST);
1522 Dir->setEnsureUpperBound(Exprs.EUB);
1523 Dir->setNextLowerBound(Exprs.NLB);
1524 Dir->setNextUpperBound(Exprs.NUB);
1525 Dir->setNumIterations(Exprs.NumIterations);
1526 Dir->setCounters(Exprs.Counters);
1527 Dir->setPrivateCounters(Exprs.PrivateCounters);
1528 Dir->setInits(Exprs.Inits);
1529 Dir->setUpdates(Exprs.Updates);
1530 Dir->setFinals(Exprs.Finals);
1531 Dir->setDependentCounters(Exprs.DependentCounters);
1532 Dir->setDependentInits(Exprs.DependentInits);
1533 Dir->setFinalsConditions(Exprs.FinalsConditions);
1534 Dir->setPreInits(Exprs.PreInits);
1535 return Dir;
1536}
1537
1540 unsigned NumClauses,
1541 unsigned CollapsedNum, EmptyShell) {
1542 return createEmptyDirective<OMPMasterTaskLoopSimdDirective>(
1543 C, NumClauses, /*HasAssociatedStmt=*/true,
1544 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), CollapsedNum);
1545}
1546
1547OMPMaskedTaskLoopSimdDirective *OMPMaskedTaskLoopSimdDirective::Create(
1548 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1549 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1550 const HelperExprs &Exprs) {
1551 auto *Dir = createDirective<OMPMaskedTaskLoopSimdDirective>(
1552 C, Clauses, AssociatedStmt,
1553 numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), StartLoc,
1554 EndLoc, CollapsedNum);
1555 Dir->setIterationVariable(Exprs.IterationVarRef);
1556 Dir->setLastIteration(Exprs.LastIteration);
1557 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1558 Dir->setPreCond(Exprs.PreCond);
1559 Dir->setCond(Exprs.Cond);
1560 Dir->setInit(Exprs.Init);
1561 Dir->setInc(Exprs.Inc);
1562 Dir->setIsLastIterVariable(Exprs.IL);
1563 Dir->setLowerBoundVariable(Exprs.LB);
1564 Dir->setUpperBoundVariable(Exprs.UB);
1565 Dir->setStrideVariable(Exprs.ST);
1566 Dir->setEnsureUpperBound(Exprs.EUB);
1567 Dir->setNextLowerBound(Exprs.NLB);
1568 Dir->setNextUpperBound(Exprs.NUB);
1569 Dir->setNumIterations(Exprs.NumIterations);
1570 Dir->setCounters(Exprs.Counters);
1571 Dir->setPrivateCounters(Exprs.PrivateCounters);
1572 Dir->setInits(Exprs.Inits);
1573 Dir->setUpdates(Exprs.Updates);
1574 Dir->setFinals(Exprs.Finals);
1575 Dir->setDependentCounters(Exprs.DependentCounters);
1576 Dir->setDependentInits(Exprs.DependentInits);
1577 Dir->setFinalsConditions(Exprs.FinalsConditions);
1578 Dir->setPreInits(Exprs.PreInits);
1579 return Dir;
1580}
1581
1584 unsigned NumClauses,
1585 unsigned CollapsedNum, EmptyShell) {
1586 return createEmptyDirective<OMPMaskedTaskLoopSimdDirective>(
1587 C, NumClauses, /*HasAssociatedStmt=*/true,
1588 numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), CollapsedNum);
1589}
1590
1591OMPParallelMasterTaskLoopDirective *OMPParallelMasterTaskLoopDirective::Create(
1592 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1593 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1594 const HelperExprs &Exprs, bool HasCancel) {
1595 auto *Dir = createDirective<OMPParallelMasterTaskLoopDirective>(
1596 C, Clauses, AssociatedStmt,
1597 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop), StartLoc,
1598 EndLoc, CollapsedNum);
1599 Dir->setIterationVariable(Exprs.IterationVarRef);
1600 Dir->setLastIteration(Exprs.LastIteration);
1601 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1602 Dir->setPreCond(Exprs.PreCond);
1603 Dir->setCond(Exprs.Cond);
1604 Dir->setInit(Exprs.Init);
1605 Dir->setInc(Exprs.Inc);
1606 Dir->setIsLastIterVariable(Exprs.IL);
1607 Dir->setLowerBoundVariable(Exprs.LB);
1608 Dir->setUpperBoundVariable(Exprs.UB);
1609 Dir->setStrideVariable(Exprs.ST);
1610 Dir->setEnsureUpperBound(Exprs.EUB);
1611 Dir->setNextLowerBound(Exprs.NLB);
1612 Dir->setNextUpperBound(Exprs.NUB);
1613 Dir->setNumIterations(Exprs.NumIterations);
1614 Dir->setCounters(Exprs.Counters);
1615 Dir->setPrivateCounters(Exprs.PrivateCounters);
1616 Dir->setInits(Exprs.Inits);
1617 Dir->setUpdates(Exprs.Updates);
1618 Dir->setFinals(Exprs.Finals);
1619 Dir->setDependentCounters(Exprs.DependentCounters);
1620 Dir->setDependentInits(Exprs.DependentInits);
1621 Dir->setFinalsConditions(Exprs.FinalsConditions);
1622 Dir->setPreInits(Exprs.PreInits);
1623 Dir->setHasCancel(HasCancel);
1624 return Dir;
1625}
1626
1629 unsigned NumClauses,
1630 unsigned CollapsedNum,
1631 EmptyShell) {
1632 return createEmptyDirective<OMPParallelMasterTaskLoopDirective>(
1633 C, NumClauses, /*HasAssociatedStmt=*/true,
1634 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop),
1635 CollapsedNum);
1636}
1637
1638OMPParallelMaskedTaskLoopDirective *OMPParallelMaskedTaskLoopDirective::Create(
1639 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1640 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1641 const HelperExprs &Exprs, bool HasCancel) {
1642 auto *Dir = createDirective<OMPParallelMaskedTaskLoopDirective>(
1643 C, Clauses, AssociatedStmt,
1644 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop), StartLoc,
1645 EndLoc, CollapsedNum);
1646 Dir->setIterationVariable(Exprs.IterationVarRef);
1647 Dir->setLastIteration(Exprs.LastIteration);
1648 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1649 Dir->setPreCond(Exprs.PreCond);
1650 Dir->setCond(Exprs.Cond);
1651 Dir->setInit(Exprs.Init);
1652 Dir->setInc(Exprs.Inc);
1653 Dir->setIsLastIterVariable(Exprs.IL);
1654 Dir->setLowerBoundVariable(Exprs.LB);
1655 Dir->setUpperBoundVariable(Exprs.UB);
1656 Dir->setStrideVariable(Exprs.ST);
1657 Dir->setEnsureUpperBound(Exprs.EUB);
1658 Dir->setNextLowerBound(Exprs.NLB);
1659 Dir->setNextUpperBound(Exprs.NUB);
1660 Dir->setNumIterations(Exprs.NumIterations);
1661 Dir->setCounters(Exprs.Counters);
1662 Dir->setPrivateCounters(Exprs.PrivateCounters);
1663 Dir->setInits(Exprs.Inits);
1664 Dir->setUpdates(Exprs.Updates);
1665 Dir->setFinals(Exprs.Finals);
1666 Dir->setDependentCounters(Exprs.DependentCounters);
1667 Dir->setDependentInits(Exprs.DependentInits);
1668 Dir->setFinalsConditions(Exprs.FinalsConditions);
1669 Dir->setPreInits(Exprs.PreInits);
1670 Dir->setHasCancel(HasCancel);
1671 return Dir;
1672}
1673
1676 unsigned NumClauses,
1677 unsigned CollapsedNum,
1678 EmptyShell) {
1679 return createEmptyDirective<OMPParallelMaskedTaskLoopDirective>(
1680 C, NumClauses, /*HasAssociatedStmt=*/true,
1681 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop),
1682 CollapsedNum);
1683}
1684
1687 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1688 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1689 const HelperExprs &Exprs) {
1690 auto *Dir = createDirective<OMPParallelMasterTaskLoopSimdDirective>(
1691 C, Clauses, AssociatedStmt,
1692 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),
1693 StartLoc, EndLoc, CollapsedNum);
1694 Dir->setIterationVariable(Exprs.IterationVarRef);
1695 Dir->setLastIteration(Exprs.LastIteration);
1696 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1697 Dir->setPreCond(Exprs.PreCond);
1698 Dir->setCond(Exprs.Cond);
1699 Dir->setInit(Exprs.Init);
1700 Dir->setInc(Exprs.Inc);
1701 Dir->setIsLastIterVariable(Exprs.IL);
1702 Dir->setLowerBoundVariable(Exprs.LB);
1703 Dir->setUpperBoundVariable(Exprs.UB);
1704 Dir->setStrideVariable(Exprs.ST);
1705 Dir->setEnsureUpperBound(Exprs.EUB);
1706 Dir->setNextLowerBound(Exprs.NLB);
1707 Dir->setNextUpperBound(Exprs.NUB);
1708 Dir->setNumIterations(Exprs.NumIterations);
1709 Dir->setCounters(Exprs.Counters);
1710 Dir->setPrivateCounters(Exprs.PrivateCounters);
1711 Dir->setInits(Exprs.Inits);
1712 Dir->setUpdates(Exprs.Updates);
1713 Dir->setFinals(Exprs.Finals);
1714 Dir->setDependentCounters(Exprs.DependentCounters);
1715 Dir->setDependentInits(Exprs.DependentInits);
1716 Dir->setFinalsConditions(Exprs.FinalsConditions);
1717 Dir->setPreInits(Exprs.PreInits);
1718 return Dir;
1719}
1720
1723 unsigned NumClauses,
1724 unsigned CollapsedNum,
1725 EmptyShell) {
1726 return createEmptyDirective<OMPParallelMasterTaskLoopSimdDirective>(
1727 C, NumClauses, /*HasAssociatedStmt=*/true,
1728 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),
1729 CollapsedNum);
1730}
1731
1734 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1735 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1736 const HelperExprs &Exprs) {
1737 auto *Dir = createDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1738 C, Clauses, AssociatedStmt,
1739 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd),
1740 StartLoc, EndLoc, CollapsedNum);
1741 Dir->setIterationVariable(Exprs.IterationVarRef);
1742 Dir->setLastIteration(Exprs.LastIteration);
1743 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1744 Dir->setPreCond(Exprs.PreCond);
1745 Dir->setCond(Exprs.Cond);
1746 Dir->setInit(Exprs.Init);
1747 Dir->setInc(Exprs.Inc);
1748 Dir->setIsLastIterVariable(Exprs.IL);
1749 Dir->setLowerBoundVariable(Exprs.LB);
1750 Dir->setUpperBoundVariable(Exprs.UB);
1751 Dir->setStrideVariable(Exprs.ST);
1752 Dir->setEnsureUpperBound(Exprs.EUB);
1753 Dir->setNextLowerBound(Exprs.NLB);
1754 Dir->setNextUpperBound(Exprs.NUB);
1755 Dir->setNumIterations(Exprs.NumIterations);
1756 Dir->setCounters(Exprs.Counters);
1757 Dir->setPrivateCounters(Exprs.PrivateCounters);
1758 Dir->setInits(Exprs.Inits);
1759 Dir->setUpdates(Exprs.Updates);
1760 Dir->setFinals(Exprs.Finals);
1761 Dir->setDependentCounters(Exprs.DependentCounters);
1762 Dir->setDependentInits(Exprs.DependentInits);
1763 Dir->setFinalsConditions(Exprs.FinalsConditions);
1764 Dir->setPreInits(Exprs.PreInits);
1765 return Dir;
1766}
1767
1770 unsigned NumClauses,
1771 unsigned CollapsedNum,
1772 EmptyShell) {
1773 return createEmptyDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1774 C, NumClauses, /*HasAssociatedStmt=*/true,
1775 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd),
1776 CollapsedNum);
1777}
1778
1781 SourceLocation EndLoc, unsigned CollapsedNum,
1782 ArrayRef<OMPClause *> Clauses,
1783 Stmt *AssociatedStmt, const HelperExprs &Exprs) {
1784 auto *Dir = createDirective<OMPDistributeDirective>(
1785 C, Clauses, AssociatedStmt,
1786 numLoopChildren(CollapsedNum, OMPD_distribute), StartLoc, EndLoc,
1787 CollapsedNum);
1788 Dir->setIterationVariable(Exprs.IterationVarRef);
1789 Dir->setLastIteration(Exprs.LastIteration);
1790 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1791 Dir->setPreCond(Exprs.PreCond);
1792 Dir->setCond(Exprs.Cond);
1793 Dir->setInit(Exprs.Init);
1794 Dir->setInc(Exprs.Inc);
1795 Dir->setIsLastIterVariable(Exprs.IL);
1796 Dir->setLowerBoundVariable(Exprs.LB);
1797 Dir->setUpperBoundVariable(Exprs.UB);
1798 Dir->setStrideVariable(Exprs.ST);
1799 Dir->setEnsureUpperBound(Exprs.EUB);
1800 Dir->setNextLowerBound(Exprs.NLB);
1801 Dir->setNextUpperBound(Exprs.NUB);
1802 Dir->setNumIterations(Exprs.NumIterations);
1803 Dir->setCounters(Exprs.Counters);
1804 Dir->setPrivateCounters(Exprs.PrivateCounters);
1805 Dir->setInits(Exprs.Inits);
1806 Dir->setUpdates(Exprs.Updates);
1807 Dir->setFinals(Exprs.Finals);
1808 Dir->setDependentCounters(Exprs.DependentCounters);
1809 Dir->setDependentInits(Exprs.DependentInits);
1810 Dir->setFinalsConditions(Exprs.FinalsConditions);
1811 Dir->setPreInits(Exprs.PreInits);
1812 return Dir;
1813}
1814
1817 unsigned CollapsedNum, EmptyShell) {
1818 return createEmptyDirective<OMPDistributeDirective>(
1819 C, NumClauses, /*HasAssociatedStmt=*/true,
1820 numLoopChildren(CollapsedNum, OMPD_distribute), CollapsedNum);
1821}
1822
1823OMPTargetUpdateDirective *OMPTargetUpdateDirective::Create(
1824 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1825 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1826 return createDirective<OMPTargetUpdateDirective>(C, Clauses, AssociatedStmt,
1827 /*NumChildren=*/0, StartLoc,
1828 EndLoc);
1829}
1830
1833 EmptyShell) {
1834 return createEmptyDirective<OMPTargetUpdateDirective>(
1835 C, NumClauses, /*HasAssociatedStmt=*/true);
1836}
1837
1838OMPDistributeParallelForDirective *OMPDistributeParallelForDirective::Create(
1839 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1840 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1841 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1842 auto *Dir = createDirective<OMPDistributeParallelForDirective>(
1843 C, Clauses, AssociatedStmt,
1844 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1, StartLoc,
1845 EndLoc, CollapsedNum);
1846 Dir->setIterationVariable(Exprs.IterationVarRef);
1847 Dir->setLastIteration(Exprs.LastIteration);
1848 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1849 Dir->setPreCond(Exprs.PreCond);
1850 Dir->setCond(Exprs.Cond);
1851 Dir->setInit(Exprs.Init);
1852 Dir->setInc(Exprs.Inc);
1853 Dir->setIsLastIterVariable(Exprs.IL);
1854 Dir->setLowerBoundVariable(Exprs.LB);
1855 Dir->setUpperBoundVariable(Exprs.UB);
1856 Dir->setStrideVariable(Exprs.ST);
1857 Dir->setEnsureUpperBound(Exprs.EUB);
1858 Dir->setNextLowerBound(Exprs.NLB);
1859 Dir->setNextUpperBound(Exprs.NUB);
1860 Dir->setNumIterations(Exprs.NumIterations);
1861 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1862 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1863 Dir->setDistInc(Exprs.DistInc);
1864 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1865 Dir->setCounters(Exprs.Counters);
1866 Dir->setPrivateCounters(Exprs.PrivateCounters);
1867 Dir->setInits(Exprs.Inits);
1868 Dir->setUpdates(Exprs.Updates);
1869 Dir->setFinals(Exprs.Finals);
1870 Dir->setDependentCounters(Exprs.DependentCounters);
1871 Dir->setDependentInits(Exprs.DependentInits);
1872 Dir->setFinalsConditions(Exprs.FinalsConditions);
1873 Dir->setPreInits(Exprs.PreInits);
1874 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1875 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1876 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1877 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1878 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1879 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1880 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1881 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1882 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1883 Dir->setTaskReductionRefExpr(TaskRedRef);
1884 Dir->HasCancel = HasCancel;
1885 return Dir;
1886}
1887
1890 unsigned NumClauses,
1891 unsigned CollapsedNum,
1892 EmptyShell) {
1893 return createEmptyDirective<OMPDistributeParallelForDirective>(
1894 C, NumClauses, /*HasAssociatedStmt=*/true,
1895 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1,
1896 CollapsedNum);
1897}
1898
1901 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1902 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1903 const HelperExprs &Exprs) {
1904 auto *Dir = createDirective<OMPDistributeParallelForSimdDirective>(
1905 C, Clauses, AssociatedStmt,
1906 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),
1907 StartLoc, EndLoc, CollapsedNum);
1908 Dir->setIterationVariable(Exprs.IterationVarRef);
1909 Dir->setLastIteration(Exprs.LastIteration);
1910 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1911 Dir->setPreCond(Exprs.PreCond);
1912 Dir->setCond(Exprs.Cond);
1913 Dir->setInit(Exprs.Init);
1914 Dir->setInc(Exprs.Inc);
1915 Dir->setIsLastIterVariable(Exprs.IL);
1916 Dir->setLowerBoundVariable(Exprs.LB);
1917 Dir->setUpperBoundVariable(Exprs.UB);
1918 Dir->setStrideVariable(Exprs.ST);
1919 Dir->setEnsureUpperBound(Exprs.EUB);
1920 Dir->setNextLowerBound(Exprs.NLB);
1921 Dir->setNextUpperBound(Exprs.NUB);
1922 Dir->setNumIterations(Exprs.NumIterations);
1923 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1924 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1925 Dir->setDistInc(Exprs.DistInc);
1926 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1927 Dir->setCounters(Exprs.Counters);
1928 Dir->setPrivateCounters(Exprs.PrivateCounters);
1929 Dir->setInits(Exprs.Inits);
1930 Dir->setUpdates(Exprs.Updates);
1931 Dir->setFinals(Exprs.Finals);
1932 Dir->setDependentCounters(Exprs.DependentCounters);
1933 Dir->setDependentInits(Exprs.DependentInits);
1934 Dir->setFinalsConditions(Exprs.FinalsConditions);
1935 Dir->setPreInits(Exprs.PreInits);
1936 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1937 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1938 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1939 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1940 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1941 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1942 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1943 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1944 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1945 return Dir;
1946}
1947
1950 unsigned NumClauses,
1951 unsigned CollapsedNum,
1952 EmptyShell) {
1953 return createEmptyDirective<OMPDistributeParallelForSimdDirective>(
1954 C, NumClauses, /*HasAssociatedStmt=*/true,
1955 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),
1956 CollapsedNum);
1957}
1958
1959OMPDistributeSimdDirective *OMPDistributeSimdDirective::Create(
1960 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1961 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1962 const HelperExprs &Exprs) {
1963 auto *Dir = createDirective<OMPDistributeSimdDirective>(
1964 C, Clauses, AssociatedStmt,
1965 numLoopChildren(CollapsedNum, OMPD_distribute_simd), StartLoc, EndLoc,
1966 CollapsedNum);
1967 Dir->setIterationVariable(Exprs.IterationVarRef);
1968 Dir->setLastIteration(Exprs.LastIteration);
1969 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1970 Dir->setPreCond(Exprs.PreCond);
1971 Dir->setCond(Exprs.Cond);
1972 Dir->setInit(Exprs.Init);
1973 Dir->setInc(Exprs.Inc);
1974 Dir->setIsLastIterVariable(Exprs.IL);
1975 Dir->setLowerBoundVariable(Exprs.LB);
1976 Dir->setUpperBoundVariable(Exprs.UB);
1977 Dir->setStrideVariable(Exprs.ST);
1978 Dir->setEnsureUpperBound(Exprs.EUB);
1979 Dir->setNextLowerBound(Exprs.NLB);
1980 Dir->setNextUpperBound(Exprs.NUB);
1981 Dir->setNumIterations(Exprs.NumIterations);
1982 Dir->setCounters(Exprs.Counters);
1983 Dir->setPrivateCounters(Exprs.PrivateCounters);
1984 Dir->setInits(Exprs.Inits);
1985 Dir->setUpdates(Exprs.Updates);
1986 Dir->setFinals(Exprs.Finals);
1987 Dir->setDependentCounters(Exprs.DependentCounters);
1988 Dir->setDependentInits(Exprs.DependentInits);
1989 Dir->setFinalsConditions(Exprs.FinalsConditions);
1990 Dir->setPreInits(Exprs.PreInits);
1991 return Dir;
1992}
1993
1996 unsigned NumClauses,
1997 unsigned CollapsedNum, EmptyShell) {
1998 return createEmptyDirective<OMPDistributeSimdDirective>(
1999 C, NumClauses, /*HasAssociatedStmt=*/true,
2000 numLoopChildren(CollapsedNum, OMPD_distribute_simd), CollapsedNum);
2001}
2002
2003OMPTargetParallelForSimdDirective *OMPTargetParallelForSimdDirective::Create(
2004 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2005 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2006 const HelperExprs &Exprs) {
2007 auto *Dir = createDirective<OMPTargetParallelForSimdDirective>(
2008 C, Clauses, AssociatedStmt,
2009 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd), StartLoc,
2010 EndLoc, CollapsedNum);
2011 Dir->setIterationVariable(Exprs.IterationVarRef);
2012 Dir->setLastIteration(Exprs.LastIteration);
2013 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2014 Dir->setPreCond(Exprs.PreCond);
2015 Dir->setCond(Exprs.Cond);
2016 Dir->setInit(Exprs.Init);
2017 Dir->setInc(Exprs.Inc);
2018 Dir->setIsLastIterVariable(Exprs.IL);
2019 Dir->setLowerBoundVariable(Exprs.LB);
2020 Dir->setUpperBoundVariable(Exprs.UB);
2021 Dir->setStrideVariable(Exprs.ST);
2022 Dir->setEnsureUpperBound(Exprs.EUB);
2023 Dir->setNextLowerBound(Exprs.NLB);
2024 Dir->setNextUpperBound(Exprs.NUB);
2025 Dir->setNumIterations(Exprs.NumIterations);
2026 Dir->setCounters(Exprs.Counters);
2027 Dir->setPrivateCounters(Exprs.PrivateCounters);
2028 Dir->setInits(Exprs.Inits);
2029 Dir->setUpdates(Exprs.Updates);
2030 Dir->setFinals(Exprs.Finals);
2031 Dir->setDependentCounters(Exprs.DependentCounters);
2032 Dir->setDependentInits(Exprs.DependentInits);
2033 Dir->setFinalsConditions(Exprs.FinalsConditions);
2034 Dir->setPreInits(Exprs.PreInits);
2035 return Dir;
2036}
2037
2040 unsigned NumClauses,
2041 unsigned CollapsedNum,
2042 EmptyShell) {
2043 return createEmptyDirective<OMPTargetParallelForSimdDirective>(
2044 C, NumClauses, /*HasAssociatedStmt=*/true,
2045 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd),
2046 CollapsedNum);
2047}
2048
2051 SourceLocation EndLoc, unsigned CollapsedNum,
2052 ArrayRef<OMPClause *> Clauses,
2053 Stmt *AssociatedStmt, const HelperExprs &Exprs) {
2054 auto *Dir = createDirective<OMPTargetSimdDirective>(
2055 C, Clauses, AssociatedStmt,
2056 numLoopChildren(CollapsedNum, OMPD_target_simd), StartLoc, EndLoc,
2057 CollapsedNum);
2058 Dir->setIterationVariable(Exprs.IterationVarRef);
2059 Dir->setLastIteration(Exprs.LastIteration);
2060 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2061 Dir->setPreCond(Exprs.PreCond);
2062 Dir->setCond(Exprs.Cond);
2063 Dir->setInit(Exprs.Init);
2064 Dir->setInc(Exprs.Inc);
2065 Dir->setCounters(Exprs.Counters);
2066 Dir->setPrivateCounters(Exprs.PrivateCounters);
2067 Dir->setInits(Exprs.Inits);
2068 Dir->setUpdates(Exprs.Updates);
2069 Dir->setFinals(Exprs.Finals);
2070 Dir->setDependentCounters(Exprs.DependentCounters);
2071 Dir->setDependentInits(Exprs.DependentInits);
2072 Dir->setFinalsConditions(Exprs.FinalsConditions);
2073 Dir->setPreInits(Exprs.PreInits);
2074 return Dir;
2075}
2076
2079 unsigned CollapsedNum, EmptyShell) {
2080 return createEmptyDirective<OMPTargetSimdDirective>(
2081 C, NumClauses, /*HasAssociatedStmt=*/true,
2082 numLoopChildren(CollapsedNum, OMPD_target_simd), CollapsedNum);
2083}
2084
2085OMPTeamsDistributeDirective *OMPTeamsDistributeDirective::Create(
2086 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2087 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2088 const HelperExprs &Exprs) {
2089 auto *Dir = createDirective<OMPTeamsDistributeDirective>(
2090 C, Clauses, AssociatedStmt,
2091 numLoopChildren(CollapsedNum, OMPD_teams_distribute), StartLoc, EndLoc,
2092 CollapsedNum);
2093 Dir->setIterationVariable(Exprs.IterationVarRef);
2094 Dir->setLastIteration(Exprs.LastIteration);
2095 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2096 Dir->setPreCond(Exprs.PreCond);
2097 Dir->setCond(Exprs.Cond);
2098 Dir->setInit(Exprs.Init);
2099 Dir->setInc(Exprs.Inc);
2100 Dir->setIsLastIterVariable(Exprs.IL);
2101 Dir->setLowerBoundVariable(Exprs.LB);
2102 Dir->setUpperBoundVariable(Exprs.UB);
2103 Dir->setStrideVariable(Exprs.ST);
2104 Dir->setEnsureUpperBound(Exprs.EUB);
2105 Dir->setNextLowerBound(Exprs.NLB);
2106 Dir->setNextUpperBound(Exprs.NUB);
2107 Dir->setNumIterations(Exprs.NumIterations);
2108 Dir->setCounters(Exprs.Counters);
2109 Dir->setPrivateCounters(Exprs.PrivateCounters);
2110 Dir->setInits(Exprs.Inits);
2111 Dir->setUpdates(Exprs.Updates);
2112 Dir->setFinals(Exprs.Finals);
2113 Dir->setDependentCounters(Exprs.DependentCounters);
2114 Dir->setDependentInits(Exprs.DependentInits);
2115 Dir->setFinalsConditions(Exprs.FinalsConditions);
2116 Dir->setPreInits(Exprs.PreInits);
2117 return Dir;
2118}
2119
2122 unsigned NumClauses,
2123 unsigned CollapsedNum, EmptyShell) {
2124 return createEmptyDirective<OMPTeamsDistributeDirective>(
2125 C, NumClauses, /*HasAssociatedStmt=*/true,
2126 numLoopChildren(CollapsedNum, OMPD_teams_distribute), CollapsedNum);
2127}
2128
2129OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::Create(
2130 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2131 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2132 const HelperExprs &Exprs) {
2133 auto *Dir = createDirective<OMPTeamsDistributeSimdDirective>(
2134 C, Clauses, AssociatedStmt,
2135 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), StartLoc,
2136 EndLoc, CollapsedNum);
2137 Dir->setIterationVariable(Exprs.IterationVarRef);
2138 Dir->setLastIteration(Exprs.LastIteration);
2139 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2140 Dir->setPreCond(Exprs.PreCond);
2141 Dir->setCond(Exprs.Cond);
2142 Dir->setInit(Exprs.Init);
2143 Dir->setInc(Exprs.Inc);
2144 Dir->setIsLastIterVariable(Exprs.IL);
2145 Dir->setLowerBoundVariable(Exprs.LB);
2146 Dir->setUpperBoundVariable(Exprs.UB);
2147 Dir->setStrideVariable(Exprs.ST);
2148 Dir->setEnsureUpperBound(Exprs.EUB);
2149 Dir->setNextLowerBound(Exprs.NLB);
2150 Dir->setNextUpperBound(Exprs.NUB);
2151 Dir->setNumIterations(Exprs.NumIterations);
2152 Dir->setCounters(Exprs.Counters);
2153 Dir->setPrivateCounters(Exprs.PrivateCounters);
2154 Dir->setInits(Exprs.Inits);
2155 Dir->setUpdates(Exprs.Updates);
2156 Dir->setFinals(Exprs.Finals);
2157 Dir->setDependentCounters(Exprs.DependentCounters);
2158 Dir->setDependentInits(Exprs.DependentInits);
2159 Dir->setFinalsConditions(Exprs.FinalsConditions);
2160 Dir->setPreInits(Exprs.PreInits);
2161 return Dir;
2162}
2163
2164OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::CreateEmpty(
2165 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
2166 EmptyShell) {
2167 return createEmptyDirective<OMPTeamsDistributeSimdDirective>(
2168 C, NumClauses, /*HasAssociatedStmt=*/true,
2169 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), CollapsedNum);
2170}
2171
2174 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2175 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2176 const HelperExprs &Exprs) {
2177 auto *Dir = createDirective<OMPTeamsDistributeParallelForSimdDirective>(
2178 C, Clauses, AssociatedStmt,
2179 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
2180 StartLoc, EndLoc, CollapsedNum);
2181 Dir->setIterationVariable(Exprs.IterationVarRef);
2182 Dir->setLastIteration(Exprs.LastIteration);
2183 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2184 Dir->setPreCond(Exprs.PreCond);
2185 Dir->setCond(Exprs.Cond);
2186 Dir->setInit(Exprs.Init);
2187 Dir->setInc(Exprs.Inc);
2188 Dir->setIsLastIterVariable(Exprs.IL);
2189 Dir->setLowerBoundVariable(Exprs.LB);
2190 Dir->setUpperBoundVariable(Exprs.UB);
2191 Dir->setStrideVariable(Exprs.ST);
2192 Dir->setEnsureUpperBound(Exprs.EUB);
2193 Dir->setNextLowerBound(Exprs.NLB);
2194 Dir->setNextUpperBound(Exprs.NUB);
2195 Dir->setNumIterations(Exprs.NumIterations);
2196 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2197 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2198 Dir->setDistInc(Exprs.DistInc);
2199 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2200 Dir->setCounters(Exprs.Counters);
2201 Dir->setPrivateCounters(Exprs.PrivateCounters);
2202 Dir->setInits(Exprs.Inits);
2203 Dir->setUpdates(Exprs.Updates);
2204 Dir->setFinals(Exprs.Finals);
2205 Dir->setDependentCounters(Exprs.DependentCounters);
2206 Dir->setDependentInits(Exprs.DependentInits);
2207 Dir->setFinalsConditions(Exprs.FinalsConditions);
2208 Dir->setPreInits(Exprs.PreInits);
2209 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2210 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2211 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2212 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2213 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2214 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2215 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2216 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2217 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2218 return Dir;
2219}
2220
2223 unsigned NumClauses,
2224 unsigned CollapsedNum,
2225 EmptyShell) {
2226 return createEmptyDirective<OMPTeamsDistributeParallelForSimdDirective>(
2227 C, NumClauses, /*HasAssociatedStmt=*/true,
2228 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
2229 CollapsedNum);
2230}
2231
2234 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2235 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2236 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
2237 auto *Dir = createDirective<OMPTeamsDistributeParallelForDirective>(
2238 C, Clauses, AssociatedStmt,
2239 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
2240 StartLoc, EndLoc, CollapsedNum);
2241 Dir->setIterationVariable(Exprs.IterationVarRef);
2242 Dir->setLastIteration(Exprs.LastIteration);
2243 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2244 Dir->setPreCond(Exprs.PreCond);
2245 Dir->setCond(Exprs.Cond);
2246 Dir->setInit(Exprs.Init);
2247 Dir->setInc(Exprs.Inc);
2248 Dir->setIsLastIterVariable(Exprs.IL);
2249 Dir->setLowerBoundVariable(Exprs.LB);
2250 Dir->setUpperBoundVariable(Exprs.UB);
2251 Dir->setStrideVariable(Exprs.ST);
2252 Dir->setEnsureUpperBound(Exprs.EUB);
2253 Dir->setNextLowerBound(Exprs.NLB);
2254 Dir->setNextUpperBound(Exprs.NUB);
2255 Dir->setNumIterations(Exprs.NumIterations);
2256 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2257 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2258 Dir->setDistInc(Exprs.DistInc);
2259 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2260 Dir->setCounters(Exprs.Counters);
2261 Dir->setPrivateCounters(Exprs.PrivateCounters);
2262 Dir->setInits(Exprs.Inits);
2263 Dir->setUpdates(Exprs.Updates);
2264 Dir->setFinals(Exprs.Finals);
2265 Dir->setDependentCounters(Exprs.DependentCounters);
2266 Dir->setDependentInits(Exprs.DependentInits);
2267 Dir->setFinalsConditions(Exprs.FinalsConditions);
2268 Dir->setPreInits(Exprs.PreInits);
2269 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2270 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2271 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2272 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2273 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2274 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2275 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2276 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2277 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2278 Dir->setTaskReductionRefExpr(TaskRedRef);
2279 Dir->HasCancel = HasCancel;
2280 return Dir;
2281}
2282
2285 unsigned NumClauses,
2286 unsigned CollapsedNum,
2287 EmptyShell) {
2288 return createEmptyDirective<OMPTeamsDistributeParallelForDirective>(
2289 C, NumClauses, /*HasAssociatedStmt=*/true,
2290 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
2291 CollapsedNum);
2292}
2293
2294OMPTargetTeamsDirective *OMPTargetTeamsDirective::Create(
2295 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2296 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
2297 return createDirective<OMPTargetTeamsDirective>(C, Clauses, AssociatedStmt,
2298 /*NumChildren=*/0, StartLoc,
2299 EndLoc);
2300}
2301
2304 EmptyShell) {
2305 return createEmptyDirective<OMPTargetTeamsDirective>(
2306 C, NumClauses, /*HasAssociatedStmt=*/true);
2307}
2308
2309OMPTargetTeamsDistributeDirective *OMPTargetTeamsDistributeDirective::Create(
2310 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2311 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2312 const HelperExprs &Exprs) {
2313 auto *Dir = createDirective<OMPTargetTeamsDistributeDirective>(
2314 C, Clauses, AssociatedStmt,
2315 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute), StartLoc,
2316 EndLoc, CollapsedNum);
2317 Dir->setIterationVariable(Exprs.IterationVarRef);
2318 Dir->setLastIteration(Exprs.LastIteration);
2319 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2320 Dir->setPreCond(Exprs.PreCond);
2321 Dir->setCond(Exprs.Cond);
2322 Dir->setInit(Exprs.Init);
2323 Dir->setInc(Exprs.Inc);
2324 Dir->setIsLastIterVariable(Exprs.IL);
2325 Dir->setLowerBoundVariable(Exprs.LB);
2326 Dir->setUpperBoundVariable(Exprs.UB);
2327 Dir->setStrideVariable(Exprs.ST);
2328 Dir->setEnsureUpperBound(Exprs.EUB);
2329 Dir->setNextLowerBound(Exprs.NLB);
2330 Dir->setNextUpperBound(Exprs.NUB);
2331 Dir->setNumIterations(Exprs.NumIterations);
2332 Dir->setCounters(Exprs.Counters);
2333 Dir->setPrivateCounters(Exprs.PrivateCounters);
2334 Dir->setInits(Exprs.Inits);
2335 Dir->setUpdates(Exprs.Updates);
2336 Dir->setFinals(Exprs.Finals);
2337 Dir->setDependentCounters(Exprs.DependentCounters);
2338 Dir->setDependentInits(Exprs.DependentInits);
2339 Dir->setFinalsConditions(Exprs.FinalsConditions);
2340 Dir->setPreInits(Exprs.PreInits);
2341 return Dir;
2342}
2343
2346 unsigned NumClauses,
2347 unsigned CollapsedNum,
2348 EmptyShell) {
2349 return createEmptyDirective<OMPTargetTeamsDistributeDirective>(
2350 C, NumClauses, /*HasAssociatedStmt=*/true,
2351 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute),
2352 CollapsedNum);
2353}
2354
2357 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2358 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2359 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
2360 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForDirective>(
2361 C, Clauses, AssociatedStmt,
2362 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
2363 1,
2364 StartLoc, EndLoc, CollapsedNum);
2365 Dir->setIterationVariable(Exprs.IterationVarRef);
2366 Dir->setLastIteration(Exprs.LastIteration);
2367 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2368 Dir->setPreCond(Exprs.PreCond);
2369 Dir->setCond(Exprs.Cond);
2370 Dir->setInit(Exprs.Init);
2371 Dir->setInc(Exprs.Inc);
2372 Dir->setIsLastIterVariable(Exprs.IL);
2373 Dir->setLowerBoundVariable(Exprs.LB);
2374 Dir->setUpperBoundVariable(Exprs.UB);
2375 Dir->setStrideVariable(Exprs.ST);
2376 Dir->setEnsureUpperBound(Exprs.EUB);
2377 Dir->setNextLowerBound(Exprs.NLB);
2378 Dir->setNextUpperBound(Exprs.NUB);
2379 Dir->setNumIterations(Exprs.NumIterations);
2380 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2381 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2382 Dir->setDistInc(Exprs.DistInc);
2383 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2384 Dir->setCounters(Exprs.Counters);
2385 Dir->setPrivateCounters(Exprs.PrivateCounters);
2386 Dir->setInits(Exprs.Inits);
2387 Dir->setUpdates(Exprs.Updates);
2388 Dir->setFinals(Exprs.Finals);
2389 Dir->setDependentCounters(Exprs.DependentCounters);
2390 Dir->setDependentInits(Exprs.DependentInits);
2391 Dir->setFinalsConditions(Exprs.FinalsConditions);
2392 Dir->setPreInits(Exprs.PreInits);
2393 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2394 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2395 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2396 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2397 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2398 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2399 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2400 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2401 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2402 Dir->setTaskReductionRefExpr(TaskRedRef);
2403 Dir->HasCancel = HasCancel;
2404 return Dir;
2405}
2406
2409 unsigned NumClauses,
2410 unsigned CollapsedNum,
2411 EmptyShell) {
2412 return createEmptyDirective<OMPTargetTeamsDistributeParallelForDirective>(
2413 C, NumClauses, /*HasAssociatedStmt=*/true,
2414 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
2415 1,
2416 CollapsedNum);
2417}
2418
2421 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2422 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2423 const HelperExprs &Exprs) {
2424 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
2425 C, Clauses, AssociatedStmt,
2426 numLoopChildren(CollapsedNum,
2427 OMPD_target_teams_distribute_parallel_for_simd),
2428 StartLoc, EndLoc, CollapsedNum);
2429 Dir->setIterationVariable(Exprs.IterationVarRef);
2430 Dir->setLastIteration(Exprs.LastIteration);
2431 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2432 Dir->setPreCond(Exprs.PreCond);
2433 Dir->setCond(Exprs.Cond);
2434 Dir->setInit(Exprs.Init);
2435 Dir->setInc(Exprs.Inc);
2436 Dir->setIsLastIterVariable(Exprs.IL);
2437 Dir->setLowerBoundVariable(Exprs.LB);
2438 Dir->setUpperBoundVariable(Exprs.UB);
2439 Dir->setStrideVariable(Exprs.ST);
2440 Dir->setEnsureUpperBound(Exprs.EUB);
2441 Dir->setNextLowerBound(Exprs.NLB);
2442 Dir->setNextUpperBound(Exprs.NUB);
2443 Dir->setNumIterations(Exprs.NumIterations);
2444 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2445 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2446 Dir->setDistInc(Exprs.DistInc);
2447 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2448 Dir->setCounters(Exprs.Counters);
2449 Dir->setPrivateCounters(Exprs.PrivateCounters);
2450 Dir->setInits(Exprs.Inits);
2451 Dir->setUpdates(Exprs.Updates);
2452 Dir->setFinals(Exprs.Finals);
2453 Dir->setDependentCounters(Exprs.DependentCounters);
2454 Dir->setDependentInits(Exprs.DependentInits);
2455 Dir->setFinalsConditions(Exprs.FinalsConditions);
2456 Dir->setPreInits(Exprs.PreInits);
2457 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2458 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2459 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2460 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2461 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2462 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2463 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2464 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2465 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2466 return Dir;
2467}
2468
2471 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
2472 EmptyShell) {
2473 return createEmptyDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
2474 C, NumClauses, /*HasAssociatedStmt=*/true,
2475 numLoopChildren(CollapsedNum,
2476 OMPD_target_teams_distribute_parallel_for_simd),
2477 CollapsedNum);
2478}
2479
2482 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2483 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2484 const HelperExprs &Exprs) {
2485 auto *Dir = createDirective<OMPTargetTeamsDistributeSimdDirective>(
2486 C, Clauses, AssociatedStmt,
2487 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),
2488 StartLoc, EndLoc, CollapsedNum);
2489 Dir->setIterationVariable(Exprs.IterationVarRef);
2490 Dir->setLastIteration(Exprs.LastIteration);
2491 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2492 Dir->setPreCond(Exprs.PreCond);
2493 Dir->setCond(Exprs.Cond);
2494 Dir->setInit(Exprs.Init);
2495 Dir->setInc(Exprs.Inc);
2496 Dir->setIsLastIterVariable(Exprs.IL);
2497 Dir->setLowerBoundVariable(Exprs.LB);
2498 Dir->setUpperBoundVariable(Exprs.UB);
2499 Dir->setStrideVariable(Exprs.ST);
2500 Dir->setEnsureUpperBound(Exprs.EUB);
2501 Dir->setNextLowerBound(Exprs.NLB);
2502 Dir->setNextUpperBound(Exprs.NUB);
2503 Dir->setNumIterations(Exprs.NumIterations);
2504 Dir->setCounters(Exprs.Counters);
2505 Dir->setPrivateCounters(Exprs.PrivateCounters);
2506 Dir->setInits(Exprs.Inits);
2507 Dir->setUpdates(Exprs.Updates);
2508 Dir->setFinals(Exprs.Finals);
2509 Dir->setDependentCounters(Exprs.DependentCounters);
2510 Dir->setDependentInits(Exprs.DependentInits);
2511 Dir->setFinalsConditions(Exprs.FinalsConditions);
2512 Dir->setPreInits(Exprs.PreInits);
2513 return Dir;
2514}
2515
2518 unsigned NumClauses,
2519 unsigned CollapsedNum,
2520 EmptyShell) {
2521 return createEmptyDirective<OMPTargetTeamsDistributeSimdDirective>(
2522 C, NumClauses, /*HasAssociatedStmt=*/true,
2523 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),
2524 CollapsedNum);
2525}
2526
2529 SourceLocation EndLoc,
2530 ArrayRef<OMPClause *> Clauses) {
2531 return createDirective<OMPInteropDirective>(
2532 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
2533 EndLoc);
2534}
2535
2537 unsigned NumClauses,
2538 EmptyShell) {
2539 return createEmptyDirective<OMPInteropDirective>(C, NumClauses);
2540}
2541
2542OMPDispatchDirective *OMPDispatchDirective::Create(
2543 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2544 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2545 SourceLocation TargetCallLoc) {
2546 auto *Dir = createDirective<OMPDispatchDirective>(
2547 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
2548 Dir->setTargetCallLoc(TargetCallLoc);
2549 return Dir;
2550}
2551
2553 unsigned NumClauses,
2554 EmptyShell) {
2555 return createEmptyDirective<OMPDispatchDirective>(C, NumClauses,
2556 /*HasAssociatedStmt=*/true,
2557 /*NumChildren=*/0);
2558}
2559
2560OMPMaskedDirective *OMPMaskedDirective::Create(const ASTContext &C,
2561 SourceLocation StartLoc,
2562 SourceLocation EndLoc,
2563 ArrayRef<OMPClause *> Clauses,
2564 Stmt *AssociatedStmt) {
2565 return createDirective<OMPMaskedDirective>(C, Clauses, AssociatedStmt,
2566 /*NumChildren=*/0, StartLoc,
2567 EndLoc);
2568}
2569
2571 unsigned NumClauses,
2572 EmptyShell) {
2573 return createEmptyDirective<OMPMaskedDirective>(C, NumClauses,
2574 /*HasAssociatedStmt=*/true);
2575}
2576
2577OMPGenericLoopDirective *OMPGenericLoopDirective::Create(
2578 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2579 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2580 const HelperExprs &Exprs) {
2581 auto *Dir = createDirective<OMPGenericLoopDirective>(
2582 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_loop),
2583 StartLoc, EndLoc, CollapsedNum);
2584 Dir->setIterationVariable(Exprs.IterationVarRef);
2585 Dir->setLastIteration(Exprs.LastIteration);
2586 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2587 Dir->setPreCond(Exprs.PreCond);
2588 Dir->setCond(Exprs.Cond);
2589 Dir->setInit(Exprs.Init);
2590 Dir->setInc(Exprs.Inc);
2591 Dir->setIsLastIterVariable(Exprs.IL);
2592 Dir->setLowerBoundVariable(Exprs.LB);
2593 Dir->setUpperBoundVariable(Exprs.UB);
2594 Dir->setStrideVariable(Exprs.ST);
2595 Dir->setEnsureUpperBound(Exprs.EUB);
2596 Dir->setNextLowerBound(Exprs.NLB);
2597 Dir->setNextUpperBound(Exprs.NUB);
2598 Dir->setNumIterations(Exprs.NumIterations);
2599 Dir->setCounters(Exprs.Counters);
2600 Dir->setPrivateCounters(Exprs.PrivateCounters);
2601 Dir->setInits(Exprs.Inits);
2602 Dir->setUpdates(Exprs.Updates);
2603 Dir->setFinals(Exprs.Finals);
2604 Dir->setDependentCounters(Exprs.DependentCounters);
2605 Dir->setDependentInits(Exprs.DependentInits);
2606 Dir->setFinalsConditions(Exprs.FinalsConditions);
2607 Dir->setPreInits(Exprs.PreInits);
2608 return Dir;
2609}
2610
2613 unsigned CollapsedNum, EmptyShell) {
2614 return createEmptyDirective<OMPGenericLoopDirective>(
2615 C, NumClauses, /*HasAssociatedStmt=*/true,
2616 numLoopChildren(CollapsedNum, OMPD_loop), CollapsedNum);
2617}
2618
2619OMPTeamsGenericLoopDirective *OMPTeamsGenericLoopDirective::Create(
2620 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2621 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2622 const HelperExprs &Exprs) {
2623 auto *Dir = createDirective<OMPTeamsGenericLoopDirective>(
2624 C, Clauses, AssociatedStmt,
2625 numLoopChildren(CollapsedNum, OMPD_teams_loop), StartLoc, EndLoc,
2626 CollapsedNum);
2627 Dir->setIterationVariable(Exprs.IterationVarRef);
2628 Dir->setLastIteration(Exprs.LastIteration);
2629 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2630 Dir->setPreCond(Exprs.PreCond);
2631 Dir->setCond(Exprs.Cond);
2632 Dir->setInit(Exprs.Init);
2633 Dir->setInc(Exprs.Inc);
2634 Dir->setIsLastIterVariable(Exprs.IL);
2635 Dir->setLowerBoundVariable(Exprs.LB);
2636 Dir->setUpperBoundVariable(Exprs.UB);
2637 Dir->setStrideVariable(Exprs.ST);
2638 Dir->setEnsureUpperBound(Exprs.EUB);
2639 Dir->setNextLowerBound(Exprs.NLB);
2640 Dir->setNextUpperBound(Exprs.NUB);
2641 Dir->setNumIterations(Exprs.NumIterations);
2642 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2643 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2644 Dir->setDistInc(Exprs.DistInc);
2645 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2646 Dir->setCounters(Exprs.Counters);
2647 Dir->setPrivateCounters(Exprs.PrivateCounters);
2648 Dir->setInits(Exprs.Inits);
2649 Dir->setUpdates(Exprs.Updates);
2650 Dir->setFinals(Exprs.Finals);
2651 Dir->setDependentCounters(Exprs.DependentCounters);
2652 Dir->setDependentInits(Exprs.DependentInits);
2653 Dir->setFinalsConditions(Exprs.FinalsConditions);
2654 Dir->setPreInits(Exprs.PreInits);
2655 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2656 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2657 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2658 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2659 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2660 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2661 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2662 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2663 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2664 return Dir;
2665}
2666
2669 unsigned NumClauses,
2670 unsigned CollapsedNum, EmptyShell) {
2671 return createEmptyDirective<OMPTeamsGenericLoopDirective>(
2672 C, NumClauses, /*HasAssociatedStmt=*/true,
2673 numLoopChildren(CollapsedNum, OMPD_teams_loop), CollapsedNum);
2674}
2675
2676OMPTargetTeamsGenericLoopDirective *OMPTargetTeamsGenericLoopDirective::Create(
2677 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2678 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2679 const HelperExprs &Exprs, bool CanBeParallelFor) {
2680 auto *Dir = createDirective<OMPTargetTeamsGenericLoopDirective>(
2681 C, Clauses, AssociatedStmt,
2682 numLoopChildren(CollapsedNum, OMPD_target_teams_loop), StartLoc, EndLoc,
2683 CollapsedNum);
2684 Dir->setIterationVariable(Exprs.IterationVarRef);
2685 Dir->setLastIteration(Exprs.LastIteration);
2686 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2687 Dir->setPreCond(Exprs.PreCond);
2688 Dir->setCond(Exprs.Cond);
2689 Dir->setInit(Exprs.Init);
2690 Dir->setInc(Exprs.Inc);
2691 Dir->setIsLastIterVariable(Exprs.IL);
2692 Dir->setLowerBoundVariable(Exprs.LB);
2693 Dir->setUpperBoundVariable(Exprs.UB);
2694 Dir->setStrideVariable(Exprs.ST);
2695 Dir->setEnsureUpperBound(Exprs.EUB);
2696 Dir->setNextLowerBound(Exprs.NLB);
2697 Dir->setNextUpperBound(Exprs.NUB);
2698 Dir->setNumIterations(Exprs.NumIterations);
2699 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2700 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2701 Dir->setDistInc(Exprs.DistInc);
2702 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2703 Dir->setCounters(Exprs.Counters);
2704 Dir->setPrivateCounters(Exprs.PrivateCounters);
2705 Dir->setInits(Exprs.Inits);
2706 Dir->setUpdates(Exprs.Updates);
2707 Dir->setFinals(Exprs.Finals);
2708 Dir->setDependentCounters(Exprs.DependentCounters);
2709 Dir->setDependentInits(Exprs.DependentInits);
2710 Dir->setFinalsConditions(Exprs.FinalsConditions);
2711 Dir->setPreInits(Exprs.PreInits);
2712 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2713 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2714 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2715 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2716 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2717 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2718 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2719 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2720 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2721 Dir->setCanBeParallelFor(CanBeParallelFor);
2722 return Dir;
2723}
2724
2727 unsigned NumClauses,
2728 unsigned CollapsedNum,
2729 EmptyShell) {
2730 return createEmptyDirective<OMPTargetTeamsGenericLoopDirective>(
2731 C, NumClauses, /*HasAssociatedStmt=*/true,
2732 numLoopChildren(CollapsedNum, OMPD_target_teams_loop), CollapsedNum);
2733}
2734
2735OMPParallelGenericLoopDirective *OMPParallelGenericLoopDirective::Create(
2736 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2737 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2738 const HelperExprs &Exprs) {
2739 auto *Dir = createDirective<OMPParallelGenericLoopDirective>(
2740 C, Clauses, AssociatedStmt,
2741 numLoopChildren(CollapsedNum, OMPD_parallel_loop), StartLoc, EndLoc,
2742 CollapsedNum);
2743 Dir->setIterationVariable(Exprs.IterationVarRef);
2744 Dir->setLastIteration(Exprs.LastIteration);
2745 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2746 Dir->setPreCond(Exprs.PreCond);
2747 Dir->setCond(Exprs.Cond);
2748 Dir->setInit(Exprs.Init);
2749 Dir->setInc(Exprs.Inc);
2750 Dir->setIsLastIterVariable(Exprs.IL);
2751 Dir->setLowerBoundVariable(Exprs.LB);
2752 Dir->setUpperBoundVariable(Exprs.UB);
2753 Dir->setStrideVariable(Exprs.ST);
2754 Dir->setEnsureUpperBound(Exprs.EUB);
2755 Dir->setNextLowerBound(Exprs.NLB);
2756 Dir->setNextUpperBound(Exprs.NUB);
2757 Dir->setNumIterations(Exprs.NumIterations);
2758 Dir->setCounters(Exprs.Counters);
2759 Dir->setPrivateCounters(Exprs.PrivateCounters);
2760 Dir->setInits(Exprs.Inits);
2761 Dir->setUpdates(Exprs.Updates);
2762 Dir->setFinals(Exprs.Finals);
2763 Dir->setDependentCounters(Exprs.DependentCounters);
2764 Dir->setDependentInits(Exprs.DependentInits);
2765 Dir->setFinalsConditions(Exprs.FinalsConditions);
2766 Dir->setPreInits(Exprs.PreInits);
2767 return Dir;
2768}
2769
2770OMPParallelGenericLoopDirective *OMPParallelGenericLoopDirective::CreateEmpty(
2771 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
2772 EmptyShell) {
2773 return createEmptyDirective<OMPParallelGenericLoopDirective>(
2774 C, NumClauses, /*HasAssociatedStmt=*/true,
2775 numLoopChildren(CollapsedNum, OMPD_parallel_loop), CollapsedNum);
2776}
2777
2780 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2781 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2782 const HelperExprs &Exprs) {
2783 auto *Dir = createDirective<OMPTargetParallelGenericLoopDirective>(
2784 C, Clauses, AssociatedStmt,
2785 numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), StartLoc,
2786 EndLoc, CollapsedNum);
2787 Dir->setIterationVariable(Exprs.IterationVarRef);
2788 Dir->setLastIteration(Exprs.LastIteration);
2789 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2790 Dir->setPreCond(Exprs.PreCond);
2791 Dir->setCond(Exprs.Cond);
2792 Dir->setInit(Exprs.Init);
2793 Dir->setInc(Exprs.Inc);
2794 Dir->setIsLastIterVariable(Exprs.IL);
2795 Dir->setLowerBoundVariable(Exprs.LB);
2796 Dir->setUpperBoundVariable(Exprs.UB);
2797 Dir->setStrideVariable(Exprs.ST);
2798 Dir->setEnsureUpperBound(Exprs.EUB);
2799 Dir->setNextLowerBound(Exprs.NLB);
2800 Dir->setNextUpperBound(Exprs.NUB);
2801 Dir->setNumIterations(Exprs.NumIterations);
2802 Dir->setCounters(Exprs.Counters);
2803 Dir->setPrivateCounters(Exprs.PrivateCounters);
2804 Dir->setInits(Exprs.Inits);
2805 Dir->setUpdates(Exprs.Updates);
2806 Dir->setFinals(Exprs.Finals);
2807 Dir->setDependentCounters(Exprs.DependentCounters);
2808 Dir->setDependentInits(Exprs.DependentInits);
2809 Dir->setFinalsConditions(Exprs.FinalsConditions);
2810 Dir->setPreInits(Exprs.PreInits);
2811 return Dir;
2812}
2813
2816 unsigned NumClauses,
2817 unsigned CollapsedNum,
2818 EmptyShell) {
2819 return createEmptyDirective<OMPTargetParallelGenericLoopDirective>(
2820 C, NumClauses, /*HasAssociatedStmt=*/true,
2821 numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), CollapsedNum);
2822}
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 OMPFlattenDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals)
Create a new AST node representation for 'pragma omp flatten'.
static OMPFlattenDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp flatten' AST node for deserialization.
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...