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
37ArrayRef<Stmt *> OMPLoopBasedDirective::getStmtsBeforeNestedLoop(Stmt *Body) {
38 auto *CS = dyn_cast_or_null<CompoundStmt>(Body);
39 if (!CS || CS->size() < 2)
40 return {};
41 return ArrayRef(CS->body_begin(), CS->size() - 1);
42}
43
44/// Like `Stmt::IgnoreContainers`, but stops at (and preserves) an intra-tile
45/// hint wrapper so that the enclosing loop walker can deliver the hint to
46/// loop-associated analysis (e.g. `collapse`). Non-hint attributed statements
47/// and single-statement compounds are still skipped.
49 while (true) {
50 if (auto *AS = dyn_cast_or_null<AttributedStmt>(S)) {
52 break;
53 S = AS->getSubStmt();
54 continue;
55 }
56 if (auto *CS = dyn_cast_or_null<CompoundStmt>(S)) {
57 if (CS->size() != 1)
58 break;
59 S = CS->body_back();
60 continue;
61 }
62 break;
63 }
64 return S;
65}
66
67size_t OMPChildren::size(unsigned NumClauses, bool HasAssociatedStmt,
68 unsigned NumChildren) {
69 return llvm::alignTo(
70 totalSizeToAlloc<OMPClause *, Stmt *>(
71 NumClauses, NumChildren + (HasAssociatedStmt ? 1 : 0)),
72 alignof(OMPChildren));
73}
74
76 assert(Clauses.size() == NumClauses &&
77 "Number of clauses is not the same as the preallocated buffer");
78 llvm::copy(Clauses, getTrailingObjects<OMPClause *>());
79}
80
82 return getTrailingObjects<Stmt *>(NumChildren);
83}
84
85OMPChildren *OMPChildren::Create(void *Mem, ArrayRef<OMPClause *> Clauses) {
86 auto *Data = CreateEmpty(Mem, Clauses.size());
87 Data->setClauses(Clauses);
88 return Data;
89}
90
91OMPChildren *OMPChildren::Create(void *Mem, ArrayRef<OMPClause *> Clauses,
92 Stmt *S, unsigned NumChildren) {
93 auto *Data = CreateEmpty(Mem, Clauses.size(), S, NumChildren);
94 Data->setClauses(Clauses);
95 if (S)
96 Data->setAssociatedStmt(S);
97 return Data;
98}
99
100OMPChildren *OMPChildren::CreateEmpty(void *Mem, unsigned NumClauses,
101 bool HasAssociatedStmt,
102 unsigned NumChildren) {
103 return new (Mem) OMPChildren(NumClauses, NumChildren, HasAssociatedStmt);
104}
105
106bool OMPExecutableDirective::isStandaloneDirective() const {
107 // Special case: 'omp target enter data', 'omp target exit data',
108 // 'omp target update' are stand-alone directives, but for implementation
109 // reasons they have empty synthetic structured block, to simplify codegen.
113 return true;
114 return !hasAssociatedStmt();
115}
116
117Stmt *OMPExecutableDirective::getStructuredBlock() {
118 assert(!isStandaloneDirective() &&
119 "Standalone Executable Directives don't have Structured Blocks.");
120 // The loop body is unknwown while a loop transformation is deferred in
121 // a dependent context, so use the whole associated statement instead.
122 if (auto *LD = dyn_cast<OMPLoopDirective>(this))
123 if (Stmt *Body = LD->getBody())
124 return Body;
125 return getRawStmt();
126}
127
128Stmt *
129OMPLoopBasedDirective::tryToFindNextInnerLoop(Stmt *CurStmt,
130 bool TryImperfectlyNestedLoops) {
131 Stmt *OrigStmt = CurStmt;
132 CurStmt = ignoreContainersKeepingIntraTileHint(CurStmt);
133 // Additional work for imperfectly nested loops, introduced in OpenMP 5.0.
134 if (TryImperfectlyNestedLoops) {
135 if (auto *CS = dyn_cast<CompoundStmt>(CurStmt)) {
136 CurStmt = nullptr;
137 SmallVector<CompoundStmt *, 4> Statements(1, CS);
138 SmallVector<CompoundStmt *, 4> NextStatements;
139 while (!Statements.empty()) {
140 CS = Statements.pop_back_val();
141 if (!CS)
142 continue;
143 for (Stmt *S : CS->body()) {
144 if (!S)
145 continue;
146 // Peek past a single-child container so a nested loop or
147 // loop-transformation directive (e.g. `#pragma omp reverse` inside
148 // the body of an outer loop) is recognized here. Preserve any
149 // intra-tile hint wrapper so it still reaches the loop-analysis
150 // callback.
152 Stmt *Inner = S;
153 if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Inner))
154 Inner = CanonLoop->getLoopStmt();
155 Inner = OMPLoopBasedDirective::ignoreIntraTileHint(Inner);
156 if (isa<ForStmt>(Inner) || isa<CXXForRangeStmt>(Inner) ||
158 !isa<OMPLoopDirective>(Inner))) {
159 // Only single loop construct is allowed.
160 if (CurStmt) {
161 CurStmt = OrigStmt;
162 break;
163 }
164 CurStmt = S;
165 continue;
166 }
167 S = OMPLoopBasedDirective::ignoreIntraTileHint(S);
168 if (auto *InnerCS = dyn_cast_or_null<CompoundStmt>(S))
169 NextStatements.push_back(InnerCS);
170 }
171 if (Statements.empty()) {
172 // Found single inner loop or multiple loops - exit.
173 if (CurStmt)
174 break;
175 Statements.swap(NextStatements);
176 }
177 }
178 if (!CurStmt)
179 CurStmt = OrigStmt;
180 }
181 }
182 return CurStmt;
183}
184
185bool OMPLoopBasedDirective::doForAllLoops(
186 Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops,
187 llvm::function_ref<bool(unsigned, Stmt *, Stmt *)> Callback,
188 llvm::function_ref<void(OMPLoopTransformationDirective *)>
191 CurStmt = ignoreContainersKeepingIntraTileHint(CurStmt);
192 for (unsigned Cnt = 0; Cnt < NumLoops; ++Cnt) {
193 // A loop generated by a peeled transformation may hold statements before
194 // the next loop (e.g. `reverse` recomputes the user counter there). They
195 // are not intervening user code, so callers that re-emit them may look
196 // through them; the rest of the nest is still checked as usual.
197 bool PeeledTransformation = false;
198 while (true) {
199 auto *Dir = dyn_cast<OMPLoopTransformationDirective>(CurStmt);
200 if (!Dir)
201 break;
202
204
205 Stmt *TransformedStmt = Dir->getTransformedStmt();
206 if (!TransformedStmt) {
207 unsigned NumGeneratedTopLevelLoops =
208 Dir->getNumGeneratedTopLevelLoops();
209 if (NumGeneratedTopLevelLoops == 0) {
210 // May happen if the loop transformation does not result in a
211 // generated loop (such as full unrolling).
212 break;
213 }
214 if (NumGeneratedTopLevelLoops > 0) {
215 // The loop transformation construct has generated loops, but these
216 // may not have been generated yet due to being in a dependent
217 // context.
218 return true;
219 }
220 }
221
222 CurStmt = TransformedStmt;
223 PeeledTransformation = true;
224 }
225 if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(CurStmt))
226 CurStmt = CanonLoop->getLoopStmt();
227 // Always hand the real loop to the callback and pass the hint wrapper
228 // separately so the callee can read it.
229 Stmt *LoopStmt = ignoreIntraTileHint(CurStmt);
230 Stmt *HintWrapper = LoopStmt != CurStmt ? CurStmt : nullptr;
231 if (Callback(Cnt, LoopStmt, HintWrapper))
232 return false;
233 // Move on to the next nested for loop, or to the loop body.
234 // OpenMP [2.8.1, simd construct, Restrictions]
235 // All loops associated with the construct must be perfectly nested; that
236 // is, there must be no intervening code nor any OpenMP directive between
237 // any two loops.
238 if (auto *For = dyn_cast<ForStmt>(LoopStmt)) {
239 CurStmt = For->getBody();
240 } else {
241 assert(isa<CXXForRangeStmt>(LoopStmt) &&
242 "Expected canonical for or range-based for loops.");
243 CurStmt = cast<CXXForRangeStmt>(LoopStmt)->getBody();
244 }
245 if (RelaxNestForPeeledTransformation && PeeledTransformation &&
246 !getStmtsBeforeNestedLoop(CurStmt).empty())
247 CurStmt = cast<CompoundStmt>(CurStmt)->body_back();
248 CurStmt = OMPLoopBasedDirective::tryToFindNextInnerLoop(
249 CurStmt, TryImperfectlyNestedLoops);
250 }
251 return true;
252}
253
254void OMPLoopBasedDirective::doForAllLoopsBodies(
255 Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops,
256 llvm::function_ref<void(unsigned, Stmt *, Stmt *)> Callback) {
257 bool Res = OMPLoopBasedDirective::doForAllLoops(
258 CurStmt, TryImperfectlyNestedLoops, NumLoops,
259 [Callback](unsigned Cnt, Stmt *Loop) {
260 Stmt *Body = nullptr;
261 if (auto *For = dyn_cast<ForStmt>(Loop)) {
262 Body = For->getBody();
263 } else {
264 assert(isa<CXXForRangeStmt>(Loop) &&
265 "Expected canonical for or range-based for loops.");
266 Body = cast<CXXForRangeStmt>(Loop)->getBody();
267 }
268 if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Body))
269 Body = CanonLoop->getLoopStmt();
270 Callback(Cnt, Loop, Body);
271 return false;
272 });
273 assert(Res && "Expected only loops");
274 (void)Res;
275}
276
278 // This relies on the loop form is already checked by Sema.
279 Stmt *Body = nullptr;
280 OMPLoopBasedDirective::doForAllLoopsBodies(
281 Data->getRawStmt(), /*TryImperfectlyNestedLoops=*/true,
282 NumAssociatedLoops,
283 [&Body](unsigned, Stmt *, Stmt *BodyStmt) { Body = BodyStmt; });
284 return Body;
285}
286
288 assert(A.size() == getLoopsNumber() &&
289 "Number of loop counters is not the same as the collapsed number");
290 llvm::copy(A, getCounters().begin());
291}
292
294 assert(A.size() == getLoopsNumber() && "Number of loop private counters "
295 "is not the same as the collapsed "
296 "number");
297 llvm::copy(A, getPrivateCounters().begin());
298}
299
301 assert(A.size() == getLoopsNumber() &&
302 "Number of counter inits is not the same as the collapsed number");
303 llvm::copy(A, getInits().begin());
304}
305
307 assert(A.size() == getLoopsNumber() &&
308 "Number of counter updates is not the same as the collapsed number");
309 llvm::copy(A, getUpdates().begin());
310}
311
313 assert(A.size() == getLoopsNumber() &&
314 "Number of counter finals is not the same as the collapsed number");
315 llvm::copy(A, getFinals().begin());
316}
317
319 assert(
320 A.size() == getLoopsNumber() &&
321 "Number of dependent counters is not the same as the collapsed number");
322 llvm::copy(A, getDependentCounters().begin());
323}
324
326 assert(A.size() == getLoopsNumber() &&
327 "Number of dependent inits is not the same as the collapsed number");
328 llvm::copy(A, getDependentInits().begin());
329}
330
332 assert(A.size() == getLoopsNumber() &&
333 "Number of finals conditions is not the same as the collapsed number");
334 llvm::copy(A, getFinalsConditions().begin());
335}
336
337void OMPLoopDirective::setHelperExprs(const HelperExprs &Exprs) {
338 setIterationVariable(Exprs.IterationVarRef);
339 setLastIteration(Exprs.LastIteration);
340 setCalcLastIteration(Exprs.CalcLastIteration);
341 setPreCond(Exprs.PreCond);
342 setCond(Exprs.Cond);
343 setInit(Exprs.Init);
344 setInc(Exprs.Inc);
345 setCounters(Exprs.Counters);
346 setPrivateCounters(Exprs.PrivateCounters);
347 setInits(Exprs.Inits);
348 setUpdates(Exprs.Updates);
349 setFinals(Exprs.Finals);
350 setDependentCounters(Exprs.DependentCounters);
351 setDependentInits(Exprs.DependentInits);
352 setFinalsConditions(Exprs.FinalsConditions);
353 setPreInits(Exprs.PreInits);
354
355 const unsigned ArraysOffset = getArraysOffset(getDirectiveKind());
356 // Simd directives have no worksharing helpers.
357 if (ArraysOffset == DefaultEnd)
358 return;
359 setIsLastIterVariable(Exprs.IL);
360 setLowerBoundVariable(Exprs.LB);
361 setUpperBoundVariable(Exprs.UB);
362 setStrideVariable(Exprs.ST);
363 setEnsureUpperBound(Exprs.EUB);
364 setNextLowerBound(Exprs.NLB);
365 setNextUpperBound(Exprs.NUB);
366 setNumIterations(Exprs.NumIterations);
367
368 if (ArraysOffset == WorksharingEnd)
369 return;
370 setPrevLowerBoundVariable(Exprs.PrevLB);
371 setPrevUpperBoundVariable(Exprs.PrevUB);
372 setDistInc(Exprs.DistInc);
373 setPrevEnsureUpperBound(Exprs.PrevEUB);
374 setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
375 setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
376 setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
377 setCombinedInit(Exprs.DistCombinedFields.Init);
378 setCombinedCond(Exprs.DistCombinedFields.Cond);
379 setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
380 setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
381 setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
382 setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
383}
384
385OMPMetaDirective *OMPMetaDirective::allocate(const ASTContext &C,
386 unsigned NumVariants,
387 SourceLocation StartLoc,
388 SourceLocation EndLoc) {
389 void *Mem =
390 C.Allocate(sizeof(OMPMetaDirective) + getTraitInfosOffset(NumVariants) +
391 NumVariants * sizeof(OMPTraitInfo *),
392 alignof(OMPMetaDirective));
393 auto *Data = OMPChildren::CreateEmpty(
394 reinterpret_cast<OMPMetaDirective *>(Mem) + 1, /*NumClauses=*/0,
395 /*HasAssociatedStmt=*/false, 2 * NumVariants);
396 auto *Dir = new (Mem) OMPMetaDirective(StartLoc, EndLoc);
397 Dir->Data = Data;
398 return Dir;
399}
400
401OMPMetaDirective *OMPMetaDirective::Create(
402 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
403 ArrayRef<Stmt *> Variants, ArrayRef<Expr *> Conditions,
404 ArrayRef<OMPTraitInfo *> TraitInfos, bool HasImplicitOtherwise) {
405 assert(Variants.size() == Conditions.size() &&
406 Variants.size() == TraitInfos.size() &&
407 "Expected one condition and one trait info per variant");
408 OMPMetaDirective *Dir = allocate(C, Variants.size(), StartLoc, EndLoc);
409 llvm::copy(Variants, Dir->getTrailingVariants().begin());
410 llvm::copy(Conditions, Dir->getTrailingConditions().begin());
411 llvm::copy(TraitInfos, Dir->getTrailingTraitInfos().begin());
412 Dir->setHasImplicitOtherwise(HasImplicitOtherwise);
413 return Dir;
414}
415
417 unsigned NumVariants,
418 EmptyShell) {
419 return allocate(C, NumVariants, SourceLocation(), SourceLocation());
420}
421
422OMPParallelDirective *OMPParallelDirective::Create(
423 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
424 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
425 bool HasCancel) {
426 auto *Dir = createDirective<OMPParallelDirective>(
427 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
428 Dir->setTaskReductionRefExpr(TaskRedRef);
429 Dir->setHasCancel(HasCancel);
430 return Dir;
431}
432
433OMPParallelDirective *OMPParallelDirective::CreateEmpty(const ASTContext &C,
434 unsigned NumClauses,
435 EmptyShell) {
436 return createEmptyDirective<OMPParallelDirective>(C, NumClauses,
437 /*HasAssociatedStmt=*/true,
438 /*NumChildren=*/1);
439}
440
443 SourceLocation EndLoc, unsigned CollapsedNum,
444 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
445 const HelperExprs &Exprs) {
446 auto *Dir = createDirective<OMPSimdDirective>(
447 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_simd),
448 StartLoc, EndLoc, CollapsedNum);
449 Dir->setHelperExprs(Exprs);
450 return Dir;
451}
452
454 unsigned NumClauses,
455 unsigned CollapsedNum,
456 EmptyShell) {
457 return createEmptyDirective<OMPSimdDirective>(
458 C, NumClauses, /*HasAssociatedStmt=*/true,
459 numLoopChildren(CollapsedNum, OMPD_simd), CollapsedNum);
460}
461
462OMPForDirective *OMPForDirective::Create(
463 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
464 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
465 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
466 auto *Dir = createDirective<OMPForDirective>(
467 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for) + 1,
468 StartLoc, EndLoc, CollapsedNum);
469 Dir->setHelperExprs(Exprs);
470 Dir->setTaskReductionRefExpr(TaskRedRef);
471 Dir->setHasCancel(HasCancel);
472 return Dir;
473}
474
476 if (auto *D = dyn_cast<OMPCanonicalLoopNestTransformationDirective>(S))
477 return D->getTransformedStmt();
478 if (auto *D = dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S))
479 return D->getTransformedStmt();
480 llvm_unreachable("unexpected object type");
481}
482
484 if (auto *D = dyn_cast<OMPCanonicalLoopNestTransformationDirective>(S))
485 return D->getPreInits();
486 if (auto *D = dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S))
487 return D->getPreInits();
488 llvm_unreachable("unexpected object type");
489}
490
492 if (auto *D = dyn_cast<OMPCanonicalLoopNestTransformationDirective>(S))
493 return D->getFinals();
494 if (auto *D = dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S))
495 return D->getFinals();
496 llvm_unreachable("unexpected object type");
497}
498
500 switch (getStmtClass()) {
501#define STMT(CLASS, PARENT)
502#define ABSTRACT_STMT(CLASS)
503#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
504 case Stmt::CLASS##Class: \
505 return static_cast<const CLASS *>(this)->getTransformedStmt();
506#include "clang/AST/StmtNodes.inc"
507 default:
508 llvm_unreachable("Not a loop transformation for canonical loop nests");
509 }
510}
511
513 switch (getStmtClass()) {
514#define STMT(CLASS, PARENT)
515#define ABSTRACT_STMT(CLASS)
516#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
517 case Stmt::CLASS##Class: \
518 return static_cast<const CLASS *>(this)->getPreInits();
519#include "clang/AST/StmtNodes.inc"
520 default:
521 llvm_unreachable("Not a loop transformation for canonical loop nests");
522 }
523}
524
526 switch (getStmtClass()) {
527#define STMT(CLASS, PARENT)
528#define ABSTRACT_STMT(CLASS)
529#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
530 case Stmt::CLASS##Class: \
531 return static_cast<const CLASS *>(this)->getFinals();
532#include "clang/AST/StmtNodes.inc"
533 default:
534 llvm_unreachable("Not a loop transformation for canonical loop nests");
535 }
536}
537
538Stmt *
540 switch (getStmtClass()) {
541#define STMT(CLASS, PARENT)
542#define ABSTRACT_STMT(CLASS)
543#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
544 case Stmt::CLASS##Class: \
545 return static_cast<const CLASS *>(this)->getTransformedStmt();
546#include "clang/AST/StmtNodes.inc"
547 default:
548 llvm_unreachable("Not a loop transformation for canonical loop sequences");
549 }
550}
551
553 switch (getStmtClass()) {
554#define STMT(CLASS, PARENT)
555#define ABSTRACT_STMT(CLASS)
556#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
557 case Stmt::CLASS##Class: \
558 return static_cast<const CLASS *>(this)->getPreInits();
559#include "clang/AST/StmtNodes.inc"
560 default:
561 llvm_unreachable("Not a loop transformation for canonical loop sequences");
562 }
563}
564
566 switch (getStmtClass()) {
567#define STMT(CLASS, PARENT)
568#define ABSTRACT_STMT(CLASS)
569#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
570 case Stmt::CLASS##Class: \
571 return static_cast<const CLASS *>(this)->getFinals();
572#include "clang/AST/StmtNodes.inc"
573 default:
574 llvm_unreachable("Not a loop transformation for canonical loop sequences");
575 }
576}
577
579 unsigned NumClauses,
580 unsigned CollapsedNum,
581 EmptyShell) {
582 return createEmptyDirective<OMPForDirective>(
583 C, NumClauses, /*HasAssociatedStmt=*/true,
584 numLoopChildren(CollapsedNum, OMPD_for) + 1, CollapsedNum);
585}
586
590 unsigned NumLoops, Stmt *AssociatedStmt,
591 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals) {
592 OMPTileDirective *Dir = createDirective<OMPTileDirective>(
593 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
594 Dir->setTransformedStmt(TransformedStmt);
595 Dir->setPreInits(PreInits);
596 Dir->setFinals(Finals);
597 return Dir;
598}
599
601 unsigned NumClauses,
602 unsigned NumLoops) {
603 return createEmptyDirective<OMPTileDirective>(
604 C, NumClauses, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
605 SourceLocation(), SourceLocation(), NumLoops);
606}
607
608OMPStripeDirective *OMPStripeDirective::Create(
609 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
610 ArrayRef<OMPClause *> Clauses, unsigned NumLoops, Stmt *AssociatedStmt,
611 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals) {
612 OMPStripeDirective *Dir = createDirective<OMPStripeDirective>(
613 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
614 Dir->setTransformedStmt(TransformedStmt);
615 Dir->setPreInits(PreInits);
616 Dir->setFinals(Finals);
617 return Dir;
618}
619
621 unsigned NumClauses,
622 unsigned NumLoops) {
623 return createEmptyDirective<OMPStripeDirective>(
624 C, NumClauses, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
625 SourceLocation(), SourceLocation(), NumLoops);
626}
627
628OMPUnrollDirective *OMPUnrollDirective::Create(
629 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
630 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
631 unsigned NumGeneratedTopLevelLoops, Stmt *TransformedStmt, Stmt *PreInits,
632 Stmt *Finals) {
633 assert(NumGeneratedTopLevelLoops <= 1 &&
634 "Unrolling generates at most one loop");
635
636 auto *Dir = createDirective<OMPUnrollDirective>(
637 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc);
638 Dir->setNumGeneratedTopLevelLoops(NumGeneratedTopLevelLoops);
639 Dir->setTransformedStmt(TransformedStmt);
640 Dir->setPreInits(PreInits);
641 Dir->setFinals(Finals);
642 return Dir;
643}
644
646 unsigned NumClauses) {
647 return createEmptyDirective<OMPUnrollDirective>(
648 C, NumClauses, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
650}
651
654 SourceLocation EndLoc, Stmt *AssociatedStmt,
655 unsigned NumLoops, Stmt *TransformedStmt,
656 Stmt *PreInits, Stmt *Finals) {
657 OMPReverseDirective *Dir = createDirective<OMPReverseDirective>(
658 C, {}, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
659 Dir->setTransformedStmt(TransformedStmt);
660 Dir->setPreInits(PreInits);
661 Dir->setFinals(Finals);
662 return Dir;
663}
664
666 unsigned NumLoops) {
667 return createEmptyDirective<OMPReverseDirective>(
668 C, /*NumClauses=*/0, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
669 SourceLocation(), SourceLocation(), NumLoops);
670}
671
672OMPInterchangeDirective *OMPInterchangeDirective::Create(
673 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
674 ArrayRef<OMPClause *> Clauses, unsigned NumLoops, Stmt *AssociatedStmt,
675 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals) {
676 OMPInterchangeDirective *Dir = createDirective<OMPInterchangeDirective>(
677 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
678 Dir->setTransformedStmt(TransformedStmt);
679 Dir->setPreInits(PreInits);
680 Dir->setFinals(Finals);
681 return Dir;
682}
683
686 unsigned NumLoops) {
687 return createEmptyDirective<OMPInterchangeDirective>(
688 C, NumClauses, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
689 SourceLocation(), SourceLocation(), NumLoops);
690}
691
692OMPFlattenDirective *OMPFlattenDirective::Create(
693 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
694 ArrayRef<OMPClause *> Clauses, unsigned NumLoops, Stmt *AssociatedStmt,
695 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals) {
696 OMPFlattenDirective *Dir = createDirective<OMPFlattenDirective>(
697 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
698 Dir->setTransformedStmt(TransformedStmt);
699 Dir->setPreInits(PreInits);
700 Dir->setFinals(Finals);
701 return Dir;
702}
703
705 unsigned NumClauses,
706 unsigned NumLoops) {
707 return createEmptyDirective<OMPFlattenDirective>(
708 C, NumClauses, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
709 SourceLocation(), SourceLocation(), NumLoops);
710}
711
715 unsigned NumLoops, Stmt *AssociatedStmt,
716 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals) {
717 OMPSplitDirective *Dir = createDirective<OMPSplitDirective>(
718 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
719 Dir->setTransformedStmt(TransformedStmt);
720 Dir->setPreInits(PreInits);
721 Dir->setFinals(Finals);
722 return Dir;
723}
724
726 unsigned NumClauses,
727 unsigned NumLoops) {
728 return createEmptyDirective<OMPSplitDirective>(
729 C, NumClauses, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
730 SourceLocation(), SourceLocation(), NumLoops);
731}
732
733OMPFuseDirective *OMPFuseDirective::Create(
734 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
735 ArrayRef<OMPClause *> Clauses, unsigned NumGeneratedTopLevelLoops,
736 Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals) {
737
738 OMPFuseDirective *Dir = createDirective<OMPFuseDirective>(
739 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc);
740 Dir->setTransformedStmt(TransformedStmt);
741 Dir->setPreInits(PreInits);
742 Dir->setFinals(Finals);
743 Dir->setNumGeneratedTopLevelLoops(NumGeneratedTopLevelLoops);
744 return Dir;
745}
746
748 unsigned NumClauses) {
749 OMPFuseDirective *Dir = createEmptyDirective<OMPFuseDirective>(
750 C, NumClauses, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
752 return Dir;
753}
754
757 SourceLocation EndLoc, unsigned CollapsedNum,
758 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
759 const HelperExprs &Exprs) {
760 auto *Dir = createDirective<OMPForSimdDirective>(
761 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for_simd),
762 StartLoc, EndLoc, CollapsedNum);
763 Dir->setHelperExprs(Exprs);
764 return Dir;
765}
766
768 unsigned NumClauses,
769 unsigned CollapsedNum,
770 EmptyShell) {
771 return createEmptyDirective<OMPForSimdDirective>(
772 C, NumClauses, /*HasAssociatedStmt=*/true,
773 numLoopChildren(CollapsedNum, OMPD_for_simd), CollapsedNum);
774}
775
776OMPSectionsDirective *OMPSectionsDirective::Create(
777 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
778 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
779 bool HasCancel) {
780 auto *Dir = createDirective<OMPSectionsDirective>(C, Clauses, AssociatedStmt,
781 /*NumChildren=*/1, StartLoc,
782 EndLoc);
783 Dir->setTaskReductionRefExpr(TaskRedRef);
784 Dir->setHasCancel(HasCancel);
785 return Dir;
786}
787
788OMPSectionsDirective *OMPSectionsDirective::CreateEmpty(const ASTContext &C,
789 unsigned NumClauses,
790 EmptyShell) {
791 return createEmptyDirective<OMPSectionsDirective>(C, NumClauses,
792 /*HasAssociatedStmt=*/true,
793 /*NumChildren=*/1);
794}
795
796OMPSectionDirective *OMPSectionDirective::Create(const ASTContext &C,
797 SourceLocation StartLoc,
798 SourceLocation EndLoc,
799 Stmt *AssociatedStmt,
800 bool HasCancel) {
801 auto *Dir =
802 createDirective<OMPSectionDirective>(C, {}, AssociatedStmt,
803 /*NumChildren=*/0, StartLoc, EndLoc);
804 Dir->setHasCancel(HasCancel);
805 return Dir;
806}
807
809 EmptyShell) {
810 return createEmptyDirective<OMPSectionDirective>(C, /*NumClauses=*/0,
811 /*HasAssociatedStmt=*/true);
812}
813
814OMPScopeDirective *OMPScopeDirective::Create(const ASTContext &C,
815 SourceLocation StartLoc,
816 SourceLocation EndLoc,
817 ArrayRef<OMPClause *> Clauses,
818 Stmt *AssociatedStmt) {
819 return createDirective<OMPScopeDirective>(C, Clauses, AssociatedStmt,
820 /*NumChildren=*/0, StartLoc,
821 EndLoc);
822}
823
825 unsigned NumClauses,
826 EmptyShell) {
827 return createEmptyDirective<OMPScopeDirective>(C, NumClauses,
828 /*HasAssociatedStmt=*/true);
829}
830
831OMPSingleDirective *OMPSingleDirective::Create(const ASTContext &C,
832 SourceLocation StartLoc,
833 SourceLocation EndLoc,
834 ArrayRef<OMPClause *> Clauses,
835 Stmt *AssociatedStmt) {
836 return createDirective<OMPSingleDirective>(C, Clauses, AssociatedStmt,
837 /*NumChildren=*/0, StartLoc,
838 EndLoc);
839}
840
842 unsigned NumClauses,
843 EmptyShell) {
844 return createEmptyDirective<OMPSingleDirective>(C, NumClauses,
845 /*HasAssociatedStmt=*/true);
846}
847
848OMPMasterDirective *OMPMasterDirective::Create(const ASTContext &C,
849 SourceLocation StartLoc,
850 SourceLocation EndLoc,
851 Stmt *AssociatedStmt) {
852 return createDirective<OMPMasterDirective>(C, {}, AssociatedStmt,
853 /*NumChildren=*/0, StartLoc,
854 EndLoc);
855}
856
858 EmptyShell) {
859 return createEmptyDirective<OMPMasterDirective>(C, /*NumClauses=*/0,
860 /*HasAssociatedStmt=*/true);
861}
862
863OMPCriticalDirective *OMPCriticalDirective::Create(
864 const ASTContext &C, const DeclarationNameInfo &Name,
865 SourceLocation StartLoc, SourceLocation EndLoc,
866 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
867 return createDirective<OMPCriticalDirective>(C, Clauses, AssociatedStmt,
868 /*NumChildren=*/0, Name,
869 StartLoc, EndLoc);
870}
871
872OMPCriticalDirective *OMPCriticalDirective::CreateEmpty(const ASTContext &C,
873 unsigned NumClauses,
874 EmptyShell) {
875 return createEmptyDirective<OMPCriticalDirective>(C, NumClauses,
876 /*HasAssociatedStmt=*/true);
877}
878
879OMPParallelForDirective *OMPParallelForDirective::Create(
880 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
881 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
882 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
883 auto *Dir = createDirective<OMPParallelForDirective>(
884 C, Clauses, AssociatedStmt,
885 numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, StartLoc, EndLoc,
886 CollapsedNum);
887 Dir->setHelperExprs(Exprs);
888 Dir->setTaskReductionRefExpr(TaskRedRef);
889 Dir->setHasCancel(HasCancel);
890 return Dir;
891}
892
895 unsigned CollapsedNum, EmptyShell) {
896 return createEmptyDirective<OMPParallelForDirective>(
897 C, NumClauses, /*HasAssociatedStmt=*/true,
898 numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, CollapsedNum);
899}
900
901OMPParallelForSimdDirective *OMPParallelForSimdDirective::Create(
902 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
903 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
904 const HelperExprs &Exprs) {
905 auto *Dir = createDirective<OMPParallelForSimdDirective>(
906 C, Clauses, AssociatedStmt,
907 numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), StartLoc, EndLoc,
908 CollapsedNum);
909 Dir->setHelperExprs(Exprs);
910 return Dir;
911}
912
915 unsigned NumClauses,
916 unsigned CollapsedNum, EmptyShell) {
917 return createEmptyDirective<OMPParallelForSimdDirective>(
918 C, NumClauses, /*HasAssociatedStmt=*/true,
919 numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), CollapsedNum);
920}
921
922OMPParallelMasterDirective *OMPParallelMasterDirective::Create(
923 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
924 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) {
925 auto *Dir = createDirective<OMPParallelMasterDirective>(
926 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
927 Dir->setTaskReductionRefExpr(TaskRedRef);
928 return Dir;
929}
930
933 unsigned NumClauses, EmptyShell) {
934 return createEmptyDirective<OMPParallelMasterDirective>(
935 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
936}
937
938OMPParallelMaskedDirective *OMPParallelMaskedDirective::Create(
939 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
940 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) {
941 auto *Dir = createDirective<OMPParallelMaskedDirective>(
942 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
943 Dir->setTaskReductionRefExpr(TaskRedRef);
944 return Dir;
945}
946
949 unsigned NumClauses, EmptyShell) {
950 return createEmptyDirective<OMPParallelMaskedDirective>(
951 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
952}
953
954OMPParallelSectionsDirective *OMPParallelSectionsDirective::Create(
955 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
956 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
957 bool HasCancel) {
958 auto *Dir = createDirective<OMPParallelSectionsDirective>(
959 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
960 Dir->setTaskReductionRefExpr(TaskRedRef);
961 Dir->setHasCancel(HasCancel);
962 return Dir;
963}
964
967 unsigned NumClauses, EmptyShell) {
968 return createEmptyDirective<OMPParallelSectionsDirective>(
969 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
970}
971
975 Stmt *AssociatedStmt, bool HasCancel) {
976 auto *Dir = createDirective<OMPTaskDirective>(
977 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
978 Dir->setHasCancel(HasCancel);
979 return Dir;
980}
981
983 unsigned NumClauses,
984 EmptyShell) {
985 return createEmptyDirective<OMPTaskDirective>(C, NumClauses,
986 /*HasAssociatedStmt=*/true);
987}
988
989OMPTaskyieldDirective *OMPTaskyieldDirective::Create(const ASTContext &C,
990 SourceLocation StartLoc,
991 SourceLocation EndLoc) {
992 return new (C) OMPTaskyieldDirective(StartLoc, EndLoc);
993}
994
995OMPTaskyieldDirective *OMPTaskyieldDirective::CreateEmpty(const ASTContext &C,
996 EmptyShell) {
997 return new (C) OMPTaskyieldDirective();
998}
999
1000OMPAssumeDirective *OMPAssumeDirective::Create(const ASTContext &C,
1001 SourceLocation StartLoc,
1002 SourceLocation EndLoc,
1003 ArrayRef<OMPClause *> Clauses,
1004 Stmt *AStmt) {
1005 return createDirective<OMPAssumeDirective>(C, Clauses, AStmt,
1006 /*NumChildren=*/0, StartLoc,
1007 EndLoc);
1008}
1009
1011 unsigned NumClauses,
1012 EmptyShell) {
1013 return createEmptyDirective<OMPAssumeDirective>(C, NumClauses,
1014 /*HasAssociatedStmt=*/true);
1015}
1016
1017OMPErrorDirective *OMPErrorDirective::Create(const ASTContext &C,
1018 SourceLocation StartLoc,
1019 SourceLocation EndLoc,
1020 ArrayRef<OMPClause *> Clauses) {
1021 return createDirective<OMPErrorDirective>(
1022 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1023 EndLoc);
1024}
1025
1027 unsigned NumClauses,
1028 EmptyShell) {
1029 return createEmptyDirective<OMPErrorDirective>(C, NumClauses);
1030}
1031
1032OMPBarrierDirective *OMPBarrierDirective::Create(const ASTContext &C,
1033 SourceLocation StartLoc,
1034 SourceLocation EndLoc) {
1035 return new (C) OMPBarrierDirective(StartLoc, EndLoc);
1036}
1037
1039 EmptyShell) {
1040 return new (C) OMPBarrierDirective();
1041}
1042
1045 SourceLocation EndLoc,
1046 ArrayRef<OMPClause *> Clauses) {
1047 return createDirective<OMPTaskwaitDirective>(
1048 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1049 EndLoc);
1050}
1051
1053 unsigned NumClauses,
1054 EmptyShell) {
1055 return createEmptyDirective<OMPTaskwaitDirective>(C, NumClauses);
1056}
1057
1058OMPTaskgroupDirective *OMPTaskgroupDirective::Create(
1059 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1060 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) {
1061 auto *Dir = createDirective<OMPTaskgroupDirective>(
1062 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
1063 Dir->setReductionRef(ReductionRef);
1064 return Dir;
1065}
1066
1068 unsigned NumClauses,
1069 EmptyShell) {
1070 return createEmptyDirective<OMPTaskgroupDirective>(
1071 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
1072}
1073
1074OMPCancellationPointDirective *OMPCancellationPointDirective::Create(
1075 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1076 OpenMPDirectiveKind CancelRegion) {
1077 auto *Dir = new (C) OMPCancellationPointDirective(StartLoc, EndLoc);
1078 Dir->setCancelRegion(CancelRegion);
1079 return Dir;
1080}
1081
1084 return new (C) OMPCancellationPointDirective();
1085}
1086
1089 SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
1090 OpenMPDirectiveKind CancelRegion) {
1091 auto *Dir = createDirective<OMPCancelDirective>(
1092 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1093 EndLoc);
1094 Dir->setCancelRegion(CancelRegion);
1095 return Dir;
1096}
1097
1099 unsigned NumClauses,
1100 EmptyShell) {
1101 return createEmptyDirective<OMPCancelDirective>(C, NumClauses);
1102}
1103
1104OMPFlushDirective *OMPFlushDirective::Create(const ASTContext &C,
1105 SourceLocation StartLoc,
1106 SourceLocation EndLoc,
1107 ArrayRef<OMPClause *> Clauses) {
1108 return createDirective<OMPFlushDirective>(
1109 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1110 EndLoc);
1111}
1112
1114 unsigned NumClauses,
1115 EmptyShell) {
1116 return createEmptyDirective<OMPFlushDirective>(C, NumClauses);
1117}
1118
1119OMPDepobjDirective *OMPDepobjDirective::Create(const ASTContext &C,
1120 SourceLocation StartLoc,
1121 SourceLocation EndLoc,
1122 ArrayRef<OMPClause *> Clauses) {
1123 return createDirective<OMPDepobjDirective>(
1124 C, Clauses, /*AssociatedStmt=*/nullptr,
1125 /*NumChildren=*/0, StartLoc, EndLoc);
1126}
1127
1129 unsigned NumClauses,
1130 EmptyShell) {
1131 return createEmptyDirective<OMPDepobjDirective>(C, NumClauses);
1132}
1133
1134OMPScanDirective *OMPScanDirective::Create(const ASTContext &C,
1135 SourceLocation StartLoc,
1136 SourceLocation EndLoc,
1137 ArrayRef<OMPClause *> Clauses) {
1138 return createDirective<OMPScanDirective>(C, Clauses,
1139 /*AssociatedStmt=*/nullptr,
1140 /*NumChildren=*/0, StartLoc, EndLoc);
1141}
1142
1144 unsigned NumClauses,
1145 EmptyShell) {
1146 return createEmptyDirective<OMPScanDirective>(C, NumClauses);
1147}
1148
1149OMPOrderedStandaloneDirective *OMPOrderedStandaloneDirective::Create(
1150 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1151 ArrayRef<OMPClause *> Clauses) {
1152 return createDirective<OMPOrderedStandaloneDirective>(
1153 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1154 EndLoc);
1155}
1156
1159 unsigned NumClauses, EmptyShell) {
1160 return createEmptyDirective<OMPOrderedStandaloneDirective>(C, NumClauses);
1161}
1162
1163OMPOrderedBlockAssocDirective *OMPOrderedBlockAssocDirective::Create(
1164 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1165 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1166 return createDirective<OMPOrderedBlockAssocDirective>(
1167 C, Clauses, cast<CapturedStmt>(AssociatedStmt), /*NumChildren=*/0,
1168 StartLoc, EndLoc);
1169}
1170
1173 unsigned NumClauses, EmptyShell) {
1174 return createEmptyDirective<OMPOrderedBlockAssocDirective>(
1175 C, NumClauses, /*HasAssociatedStmt=*/true);
1176}
1177
1180 SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
1181 Stmt *AssociatedStmt, Expressions Exprs) {
1182 auto *Dir = createDirective<OMPAtomicDirective>(
1183 C, Clauses, AssociatedStmt, /*NumChildren=*/7, StartLoc, EndLoc);
1184 Dir->setX(Exprs.X);
1185 Dir->setV(Exprs.V);
1186 Dir->setR(Exprs.R);
1187 Dir->setExpr(Exprs.E);
1188 Dir->setUpdateExpr(Exprs.UE);
1189 Dir->setD(Exprs.D);
1190 Dir->setCond(Exprs.Cond);
1191 Dir->Flags.IsXLHSInRHSPart = Exprs.IsXLHSInRHSPart ? 1 : 0;
1192 Dir->Flags.IsPostfixUpdate = Exprs.IsPostfixUpdate ? 1 : 0;
1193 Dir->Flags.IsFailOnly = Exprs.IsFailOnly ? 1 : 0;
1194 return Dir;
1195}
1196
1198 unsigned NumClauses,
1199 EmptyShell) {
1200 return createEmptyDirective<OMPAtomicDirective>(
1201 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/7);
1202}
1203
1204OMPTargetDirective *OMPTargetDirective::Create(const ASTContext &C,
1205 SourceLocation StartLoc,
1206 SourceLocation EndLoc,
1207 ArrayRef<OMPClause *> Clauses,
1208 Stmt *AssociatedStmt) {
1209 return createDirective<OMPTargetDirective>(
1210 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1211}
1212
1214 unsigned NumClauses,
1215 EmptyShell) {
1216 return createEmptyDirective<OMPTargetDirective>(C, NumClauses,
1217 /*HasAssociatedStmt=*/true);
1218}
1219
1220OMPTargetParallelDirective *OMPTargetParallelDirective::Create(
1221 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1222 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
1223 bool HasCancel) {
1224 auto *Dir = createDirective<OMPTargetParallelDirective>(
1225 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
1226 Dir->setTaskReductionRefExpr(TaskRedRef);
1227 Dir->setHasCancel(HasCancel);
1228 return Dir;
1229}
1230
1233 unsigned NumClauses, EmptyShell) {
1234 return createEmptyDirective<OMPTargetParallelDirective>(
1235 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
1236}
1237
1238OMPTargetParallelForDirective *OMPTargetParallelForDirective::Create(
1239 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1240 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1241 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1242 auto *Dir = createDirective<OMPTargetParallelForDirective>(
1243 C, Clauses, AssociatedStmt,
1244 numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1, StartLoc,
1245 EndLoc, CollapsedNum);
1246 Dir->setHelperExprs(Exprs);
1247 Dir->setTaskReductionRefExpr(TaskRedRef);
1248 Dir->setHasCancel(HasCancel);
1249 return Dir;
1250}
1251
1254 unsigned NumClauses,
1255 unsigned CollapsedNum, EmptyShell) {
1256 return createEmptyDirective<OMPTargetParallelForDirective>(
1257 C, NumClauses, /*HasAssociatedStmt=*/true,
1258 numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1,
1259 CollapsedNum);
1260}
1261
1262OMPTargetDataDirective *OMPTargetDataDirective::Create(
1263 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1264 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1265 return createDirective<OMPTargetDataDirective>(
1266 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1267}
1268
1269OMPTargetDataDirective *OMPTargetDataDirective::CreateEmpty(const ASTContext &C,
1270 unsigned N,
1271 EmptyShell) {
1272 return createEmptyDirective<OMPTargetDataDirective>(
1273 C, N, /*HasAssociatedStmt=*/true);
1274}
1275
1276OMPTargetEnterDataDirective *OMPTargetEnterDataDirective::Create(
1277 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1278 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1279 return createDirective<OMPTargetEnterDataDirective>(
1280 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1281}
1282
1285 EmptyShell) {
1286 return createEmptyDirective<OMPTargetEnterDataDirective>(
1287 C, N, /*HasAssociatedStmt=*/true);
1288}
1289
1290OMPTargetExitDataDirective *OMPTargetExitDataDirective::Create(
1291 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1292 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1293 return createDirective<OMPTargetExitDataDirective>(
1294 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1295}
1296
1299 EmptyShell) {
1300 return createEmptyDirective<OMPTargetExitDataDirective>(
1301 C, N, /*HasAssociatedStmt=*/true);
1302}
1303
1304OMPTeamsDirective *OMPTeamsDirective::Create(const ASTContext &C,
1305 SourceLocation StartLoc,
1306 SourceLocation EndLoc,
1307 ArrayRef<OMPClause *> Clauses,
1308 Stmt *AssociatedStmt) {
1309 return createDirective<OMPTeamsDirective>(
1310 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1311}
1312
1314 unsigned NumClauses,
1315 EmptyShell) {
1316 return createEmptyDirective<OMPTeamsDirective>(C, NumClauses,
1317 /*HasAssociatedStmt=*/true);
1318}
1319
1320OMPTaskLoopDirective *OMPTaskLoopDirective::Create(
1321 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1322 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1323 const HelperExprs &Exprs, bool HasCancel) {
1324 auto *Dir = createDirective<OMPTaskLoopDirective>(
1325 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_taskloop),
1326 StartLoc, EndLoc, CollapsedNum);
1327 Dir->setHelperExprs(Exprs);
1328 Dir->setHasCancel(HasCancel);
1329 return Dir;
1330}
1331
1333 unsigned NumClauses,
1334 unsigned CollapsedNum,
1335 EmptyShell) {
1336 return createEmptyDirective<OMPTaskLoopDirective>(
1337 C, NumClauses, /*HasAssociatedStmt=*/true,
1338 numLoopChildren(CollapsedNum, OMPD_taskloop), CollapsedNum);
1339}
1340
1341OMPTaskLoopSimdDirective *OMPTaskLoopSimdDirective::Create(
1342 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1343 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1344 const HelperExprs &Exprs) {
1345 auto *Dir = createDirective<OMPTaskLoopSimdDirective>(
1346 C, Clauses, AssociatedStmt,
1347 numLoopChildren(CollapsedNum, OMPD_taskloop_simd), StartLoc, EndLoc,
1348 CollapsedNum);
1349 Dir->setHelperExprs(Exprs);
1350 return Dir;
1351}
1352
1355 unsigned CollapsedNum, EmptyShell) {
1356 return createEmptyDirective<OMPTaskLoopSimdDirective>(
1357 C, NumClauses, /*HasAssociatedStmt=*/true,
1358 numLoopChildren(CollapsedNum, OMPD_taskloop_simd), CollapsedNum);
1359}
1360
1361OMPMasterTaskLoopDirective *OMPMasterTaskLoopDirective::Create(
1362 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1363 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1364 const HelperExprs &Exprs, bool HasCancel) {
1365 auto *Dir = createDirective<OMPMasterTaskLoopDirective>(
1366 C, Clauses, AssociatedStmt,
1367 numLoopChildren(CollapsedNum, OMPD_master_taskloop), StartLoc, EndLoc,
1368 CollapsedNum);
1369 Dir->setHelperExprs(Exprs);
1370 Dir->setHasCancel(HasCancel);
1371 return Dir;
1372}
1373
1376 unsigned NumClauses,
1377 unsigned CollapsedNum, EmptyShell) {
1378 return createEmptyDirective<OMPMasterTaskLoopDirective>(
1379 C, NumClauses, /*HasAssociatedStmt=*/true,
1380 numLoopChildren(CollapsedNum, OMPD_master_taskloop), CollapsedNum);
1381}
1382
1383OMPMaskedTaskLoopDirective *OMPMaskedTaskLoopDirective::Create(
1384 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1385 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1386 const HelperExprs &Exprs, bool HasCancel) {
1387 auto *Dir = createDirective<OMPMaskedTaskLoopDirective>(
1388 C, Clauses, AssociatedStmt,
1389 numLoopChildren(CollapsedNum, OMPD_masked_taskloop), StartLoc, EndLoc,
1390 CollapsedNum);
1391 Dir->setHelperExprs(Exprs);
1392 Dir->setHasCancel(HasCancel);
1393 return Dir;
1394}
1395
1398 unsigned NumClauses,
1399 unsigned CollapsedNum, EmptyShell) {
1400 return createEmptyDirective<OMPMaskedTaskLoopDirective>(
1401 C, NumClauses, /*HasAssociatedStmt=*/true,
1402 numLoopChildren(CollapsedNum, OMPD_masked_taskloop), CollapsedNum);
1403}
1404
1405OMPMasterTaskLoopSimdDirective *OMPMasterTaskLoopSimdDirective::Create(
1406 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1407 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1408 const HelperExprs &Exprs) {
1409 auto *Dir = createDirective<OMPMasterTaskLoopSimdDirective>(
1410 C, Clauses, AssociatedStmt,
1411 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), StartLoc,
1412 EndLoc, CollapsedNum);
1413 Dir->setHelperExprs(Exprs);
1414 return Dir;
1415}
1416
1419 unsigned NumClauses,
1420 unsigned CollapsedNum, EmptyShell) {
1421 return createEmptyDirective<OMPMasterTaskLoopSimdDirective>(
1422 C, NumClauses, /*HasAssociatedStmt=*/true,
1423 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), CollapsedNum);
1424}
1425
1426OMPMaskedTaskLoopSimdDirective *OMPMaskedTaskLoopSimdDirective::Create(
1427 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1428 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1429 const HelperExprs &Exprs) {
1430 auto *Dir = createDirective<OMPMaskedTaskLoopSimdDirective>(
1431 C, Clauses, AssociatedStmt,
1432 numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), StartLoc,
1433 EndLoc, CollapsedNum);
1434 Dir->setHelperExprs(Exprs);
1435 return Dir;
1436}
1437
1440 unsigned NumClauses,
1441 unsigned CollapsedNum, EmptyShell) {
1442 return createEmptyDirective<OMPMaskedTaskLoopSimdDirective>(
1443 C, NumClauses, /*HasAssociatedStmt=*/true,
1444 numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), CollapsedNum);
1445}
1446
1447OMPParallelMasterTaskLoopDirective *OMPParallelMasterTaskLoopDirective::Create(
1448 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1449 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1450 const HelperExprs &Exprs, bool HasCancel) {
1451 auto *Dir = createDirective<OMPParallelMasterTaskLoopDirective>(
1452 C, Clauses, AssociatedStmt,
1453 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop), StartLoc,
1454 EndLoc, CollapsedNum);
1455 Dir->setHelperExprs(Exprs);
1456 Dir->setHasCancel(HasCancel);
1457 return Dir;
1458}
1459
1462 unsigned NumClauses,
1463 unsigned CollapsedNum,
1464 EmptyShell) {
1465 return createEmptyDirective<OMPParallelMasterTaskLoopDirective>(
1466 C, NumClauses, /*HasAssociatedStmt=*/true,
1467 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop),
1468 CollapsedNum);
1469}
1470
1471OMPParallelMaskedTaskLoopDirective *OMPParallelMaskedTaskLoopDirective::Create(
1472 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1473 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1474 const HelperExprs &Exprs, bool HasCancel) {
1475 auto *Dir = createDirective<OMPParallelMaskedTaskLoopDirective>(
1476 C, Clauses, AssociatedStmt,
1477 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop), StartLoc,
1478 EndLoc, CollapsedNum);
1479 Dir->setHelperExprs(Exprs);
1480 Dir->setHasCancel(HasCancel);
1481 return Dir;
1482}
1483
1486 unsigned NumClauses,
1487 unsigned CollapsedNum,
1488 EmptyShell) {
1489 return createEmptyDirective<OMPParallelMaskedTaskLoopDirective>(
1490 C, NumClauses, /*HasAssociatedStmt=*/true,
1491 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop),
1492 CollapsedNum);
1493}
1494
1497 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1498 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1499 const HelperExprs &Exprs) {
1500 auto *Dir = createDirective<OMPParallelMasterTaskLoopSimdDirective>(
1501 C, Clauses, AssociatedStmt,
1502 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),
1503 StartLoc, EndLoc, CollapsedNum);
1504 Dir->setHelperExprs(Exprs);
1505 return Dir;
1506}
1507
1510 unsigned NumClauses,
1511 unsigned CollapsedNum,
1512 EmptyShell) {
1513 return createEmptyDirective<OMPParallelMasterTaskLoopSimdDirective>(
1514 C, NumClauses, /*HasAssociatedStmt=*/true,
1515 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),
1516 CollapsedNum);
1517}
1518
1521 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1522 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1523 const HelperExprs &Exprs) {
1524 auto *Dir = createDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1525 C, Clauses, AssociatedStmt,
1526 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd),
1527 StartLoc, EndLoc, CollapsedNum);
1528 Dir->setHelperExprs(Exprs);
1529 return Dir;
1530}
1531
1534 unsigned NumClauses,
1535 unsigned CollapsedNum,
1536 EmptyShell) {
1537 return createEmptyDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1538 C, NumClauses, /*HasAssociatedStmt=*/true,
1539 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd),
1540 CollapsedNum);
1541}
1542
1545 SourceLocation EndLoc, unsigned CollapsedNum,
1546 ArrayRef<OMPClause *> Clauses,
1547 Stmt *AssociatedStmt, const HelperExprs &Exprs) {
1548 auto *Dir = createDirective<OMPDistributeDirective>(
1549 C, Clauses, AssociatedStmt,
1550 numLoopChildren(CollapsedNum, OMPD_distribute), StartLoc, EndLoc,
1551 CollapsedNum);
1552 Dir->setHelperExprs(Exprs);
1553 return Dir;
1554}
1555
1558 unsigned CollapsedNum, EmptyShell) {
1559 return createEmptyDirective<OMPDistributeDirective>(
1560 C, NumClauses, /*HasAssociatedStmt=*/true,
1561 numLoopChildren(CollapsedNum, OMPD_distribute), CollapsedNum);
1562}
1563
1564OMPTargetUpdateDirective *OMPTargetUpdateDirective::Create(
1565 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1566 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1567 return createDirective<OMPTargetUpdateDirective>(C, Clauses, AssociatedStmt,
1568 /*NumChildren=*/0, StartLoc,
1569 EndLoc);
1570}
1571
1574 EmptyShell) {
1575 return createEmptyDirective<OMPTargetUpdateDirective>(
1576 C, NumClauses, /*HasAssociatedStmt=*/true);
1577}
1578
1579OMPDistributeParallelForDirective *OMPDistributeParallelForDirective::Create(
1580 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1581 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1582 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1583 auto *Dir = createDirective<OMPDistributeParallelForDirective>(
1584 C, Clauses, AssociatedStmt,
1585 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1, StartLoc,
1586 EndLoc, CollapsedNum);
1587 Dir->setHelperExprs(Exprs);
1588 Dir->setTaskReductionRefExpr(TaskRedRef);
1589 Dir->HasCancel = HasCancel;
1590 return Dir;
1591}
1592
1595 unsigned NumClauses,
1596 unsigned CollapsedNum,
1597 EmptyShell) {
1598 return createEmptyDirective<OMPDistributeParallelForDirective>(
1599 C, NumClauses, /*HasAssociatedStmt=*/true,
1600 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1,
1601 CollapsedNum);
1602}
1603
1606 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1607 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1608 const HelperExprs &Exprs) {
1609 auto *Dir = createDirective<OMPDistributeParallelForSimdDirective>(
1610 C, Clauses, AssociatedStmt,
1611 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),
1612 StartLoc, EndLoc, CollapsedNum);
1613 Dir->setHelperExprs(Exprs);
1614 return Dir;
1615}
1616
1619 unsigned NumClauses,
1620 unsigned CollapsedNum,
1621 EmptyShell) {
1622 return createEmptyDirective<OMPDistributeParallelForSimdDirective>(
1623 C, NumClauses, /*HasAssociatedStmt=*/true,
1624 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),
1625 CollapsedNum);
1626}
1627
1628OMPDistributeSimdDirective *OMPDistributeSimdDirective::Create(
1629 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1630 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1631 const HelperExprs &Exprs) {
1632 auto *Dir = createDirective<OMPDistributeSimdDirective>(
1633 C, Clauses, AssociatedStmt,
1634 numLoopChildren(CollapsedNum, OMPD_distribute_simd), StartLoc, EndLoc,
1635 CollapsedNum);
1636 Dir->setHelperExprs(Exprs);
1637 return Dir;
1638}
1639
1642 unsigned NumClauses,
1643 unsigned CollapsedNum, EmptyShell) {
1644 return createEmptyDirective<OMPDistributeSimdDirective>(
1645 C, NumClauses, /*HasAssociatedStmt=*/true,
1646 numLoopChildren(CollapsedNum, OMPD_distribute_simd), CollapsedNum);
1647}
1648
1649OMPTargetParallelForSimdDirective *OMPTargetParallelForSimdDirective::Create(
1650 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1651 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1652 const HelperExprs &Exprs) {
1653 auto *Dir = createDirective<OMPTargetParallelForSimdDirective>(
1654 C, Clauses, AssociatedStmt,
1655 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd), StartLoc,
1656 EndLoc, CollapsedNum);
1657 Dir->setHelperExprs(Exprs);
1658 return Dir;
1659}
1660
1663 unsigned NumClauses,
1664 unsigned CollapsedNum,
1665 EmptyShell) {
1666 return createEmptyDirective<OMPTargetParallelForSimdDirective>(
1667 C, NumClauses, /*HasAssociatedStmt=*/true,
1668 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd),
1669 CollapsedNum);
1670}
1671
1674 SourceLocation EndLoc, unsigned CollapsedNum,
1675 ArrayRef<OMPClause *> Clauses,
1676 Stmt *AssociatedStmt, const HelperExprs &Exprs) {
1677 auto *Dir = createDirective<OMPTargetSimdDirective>(
1678 C, Clauses, AssociatedStmt,
1679 numLoopChildren(CollapsedNum, OMPD_target_simd), StartLoc, EndLoc,
1680 CollapsedNum);
1681 Dir->setHelperExprs(Exprs);
1682 return Dir;
1683}
1684
1687 unsigned CollapsedNum, EmptyShell) {
1688 return createEmptyDirective<OMPTargetSimdDirective>(
1689 C, NumClauses, /*HasAssociatedStmt=*/true,
1690 numLoopChildren(CollapsedNum, OMPD_target_simd), CollapsedNum);
1691}
1692
1693OMPTeamsDistributeDirective *OMPTeamsDistributeDirective::Create(
1694 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1695 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1696 const HelperExprs &Exprs) {
1697 auto *Dir = createDirective<OMPTeamsDistributeDirective>(
1698 C, Clauses, AssociatedStmt,
1699 numLoopChildren(CollapsedNum, OMPD_teams_distribute), StartLoc, EndLoc,
1700 CollapsedNum);
1701 Dir->setHelperExprs(Exprs);
1702 return Dir;
1703}
1704
1707 unsigned NumClauses,
1708 unsigned CollapsedNum, EmptyShell) {
1709 return createEmptyDirective<OMPTeamsDistributeDirective>(
1710 C, NumClauses, /*HasAssociatedStmt=*/true,
1711 numLoopChildren(CollapsedNum, OMPD_teams_distribute), CollapsedNum);
1712}
1713
1714OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::Create(
1715 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1716 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1717 const HelperExprs &Exprs) {
1718 auto *Dir = createDirective<OMPTeamsDistributeSimdDirective>(
1719 C, Clauses, AssociatedStmt,
1720 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), StartLoc,
1721 EndLoc, CollapsedNum);
1722 Dir->setHelperExprs(Exprs);
1723 return Dir;
1724}
1725
1726OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::CreateEmpty(
1727 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1728 EmptyShell) {
1729 return createEmptyDirective<OMPTeamsDistributeSimdDirective>(
1730 C, NumClauses, /*HasAssociatedStmt=*/true,
1731 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), CollapsedNum);
1732}
1733
1736 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1737 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1738 const HelperExprs &Exprs) {
1739 auto *Dir = createDirective<OMPTeamsDistributeParallelForSimdDirective>(
1740 C, Clauses, AssociatedStmt,
1741 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
1742 StartLoc, EndLoc, CollapsedNum);
1743 Dir->setHelperExprs(Exprs);
1744 return Dir;
1745}
1746
1749 unsigned NumClauses,
1750 unsigned CollapsedNum,
1751 EmptyShell) {
1752 return createEmptyDirective<OMPTeamsDistributeParallelForSimdDirective>(
1753 C, NumClauses, /*HasAssociatedStmt=*/true,
1754 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
1755 CollapsedNum);
1756}
1757
1760 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1761 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1762 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1763 auto *Dir = createDirective<OMPTeamsDistributeParallelForDirective>(
1764 C, Clauses, AssociatedStmt,
1765 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
1766 StartLoc, EndLoc, CollapsedNum);
1767 Dir->setHelperExprs(Exprs);
1768 Dir->setTaskReductionRefExpr(TaskRedRef);
1769 Dir->HasCancel = HasCancel;
1770 return Dir;
1771}
1772
1775 unsigned NumClauses,
1776 unsigned CollapsedNum,
1777 EmptyShell) {
1778 return createEmptyDirective<OMPTeamsDistributeParallelForDirective>(
1779 C, NumClauses, /*HasAssociatedStmt=*/true,
1780 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
1781 CollapsedNum);
1782}
1783
1784OMPTargetTeamsDirective *OMPTargetTeamsDirective::Create(
1785 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1786 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1787 return createDirective<OMPTargetTeamsDirective>(C, Clauses, AssociatedStmt,
1788 /*NumChildren=*/0, StartLoc,
1789 EndLoc);
1790}
1791
1794 EmptyShell) {
1795 return createEmptyDirective<OMPTargetTeamsDirective>(
1796 C, NumClauses, /*HasAssociatedStmt=*/true);
1797}
1798
1799OMPTargetTeamsDistributeDirective *OMPTargetTeamsDistributeDirective::Create(
1800 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1801 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1802 const HelperExprs &Exprs) {
1803 auto *Dir = createDirective<OMPTargetTeamsDistributeDirective>(
1804 C, Clauses, AssociatedStmt,
1805 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute), StartLoc,
1806 EndLoc, CollapsedNum);
1807 Dir->setHelperExprs(Exprs);
1808 return Dir;
1809}
1810
1813 unsigned NumClauses,
1814 unsigned CollapsedNum,
1815 EmptyShell) {
1816 return createEmptyDirective<OMPTargetTeamsDistributeDirective>(
1817 C, NumClauses, /*HasAssociatedStmt=*/true,
1818 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute),
1819 CollapsedNum);
1820}
1821
1824 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1825 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1826 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1827 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForDirective>(
1828 C, Clauses, AssociatedStmt,
1829 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
1830 1,
1831 StartLoc, EndLoc, CollapsedNum);
1832 Dir->setHelperExprs(Exprs);
1833 Dir->setTaskReductionRefExpr(TaskRedRef);
1834 Dir->HasCancel = HasCancel;
1835 return Dir;
1836}
1837
1840 unsigned NumClauses,
1841 unsigned CollapsedNum,
1842 EmptyShell) {
1843 return createEmptyDirective<OMPTargetTeamsDistributeParallelForDirective>(
1844 C, NumClauses, /*HasAssociatedStmt=*/true,
1845 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
1846 1,
1847 CollapsedNum);
1848}
1849
1852 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1853 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1854 const HelperExprs &Exprs) {
1855 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
1856 C, Clauses, AssociatedStmt,
1857 numLoopChildren(CollapsedNum,
1858 OMPD_target_teams_distribute_parallel_for_simd),
1859 StartLoc, EndLoc, CollapsedNum);
1860 Dir->setHelperExprs(Exprs);
1861 return Dir;
1862}
1863
1866 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1867 EmptyShell) {
1868 return createEmptyDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
1869 C, NumClauses, /*HasAssociatedStmt=*/true,
1870 numLoopChildren(CollapsedNum,
1871 OMPD_target_teams_distribute_parallel_for_simd),
1872 CollapsedNum);
1873}
1874
1877 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1878 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1879 const HelperExprs &Exprs) {
1880 auto *Dir = createDirective<OMPTargetTeamsDistributeSimdDirective>(
1881 C, Clauses, AssociatedStmt,
1882 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),
1883 StartLoc, EndLoc, CollapsedNum);
1884 Dir->setHelperExprs(Exprs);
1885 return Dir;
1886}
1887
1890 unsigned NumClauses,
1891 unsigned CollapsedNum,
1892 EmptyShell) {
1893 return createEmptyDirective<OMPTargetTeamsDistributeSimdDirective>(
1894 C, NumClauses, /*HasAssociatedStmt=*/true,
1895 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),
1896 CollapsedNum);
1897}
1898
1901 SourceLocation EndLoc,
1902 ArrayRef<OMPClause *> Clauses) {
1903 return createDirective<OMPInteropDirective>(
1904 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1905 EndLoc);
1906}
1907
1909 unsigned NumClauses,
1910 EmptyShell) {
1911 return createEmptyDirective<OMPInteropDirective>(C, NumClauses);
1912}
1913
1914OMPDispatchDirective *OMPDispatchDirective::Create(
1915 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1916 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1917 SourceLocation TargetCallLoc) {
1918 auto *Dir = createDirective<OMPDispatchDirective>(
1919 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1920 Dir->setTargetCallLoc(TargetCallLoc);
1921 return Dir;
1922}
1923
1925 unsigned NumClauses,
1926 EmptyShell) {
1927 return createEmptyDirective<OMPDispatchDirective>(C, NumClauses,
1928 /*HasAssociatedStmt=*/true,
1929 /*NumChildren=*/0);
1930}
1931
1932OMPMaskedDirective *OMPMaskedDirective::Create(const ASTContext &C,
1933 SourceLocation StartLoc,
1934 SourceLocation EndLoc,
1935 ArrayRef<OMPClause *> Clauses,
1936 Stmt *AssociatedStmt) {
1937 return createDirective<OMPMaskedDirective>(C, Clauses, AssociatedStmt,
1938 /*NumChildren=*/0, StartLoc,
1939 EndLoc);
1940}
1941
1943 unsigned NumClauses,
1944 EmptyShell) {
1945 return createEmptyDirective<OMPMaskedDirective>(C, NumClauses,
1946 /*HasAssociatedStmt=*/true);
1947}
1948
1949OMPGenericLoopDirective *OMPGenericLoopDirective::Create(
1950 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1951 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1952 const HelperExprs &Exprs) {
1953 auto *Dir = createDirective<OMPGenericLoopDirective>(
1954 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_loop),
1955 StartLoc, EndLoc, CollapsedNum);
1956 Dir->setHelperExprs(Exprs);
1957 return Dir;
1958}
1959
1962 unsigned CollapsedNum, EmptyShell) {
1963 return createEmptyDirective<OMPGenericLoopDirective>(
1964 C, NumClauses, /*HasAssociatedStmt=*/true,
1965 numLoopChildren(CollapsedNum, OMPD_loop), CollapsedNum);
1966}
1967
1968OMPTeamsGenericLoopDirective *OMPTeamsGenericLoopDirective::Create(
1969 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1970 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1971 const HelperExprs &Exprs) {
1972 auto *Dir = createDirective<OMPTeamsGenericLoopDirective>(
1973 C, Clauses, AssociatedStmt,
1974 numLoopChildren(CollapsedNum, OMPD_teams_loop), StartLoc, EndLoc,
1975 CollapsedNum);
1976 Dir->setHelperExprs(Exprs);
1977 return Dir;
1978}
1979
1982 unsigned NumClauses,
1983 unsigned CollapsedNum, EmptyShell) {
1984 return createEmptyDirective<OMPTeamsGenericLoopDirective>(
1985 C, NumClauses, /*HasAssociatedStmt=*/true,
1986 numLoopChildren(CollapsedNum, OMPD_teams_loop), CollapsedNum);
1987}
1988
1989OMPTargetTeamsGenericLoopDirective *OMPTargetTeamsGenericLoopDirective::Create(
1990 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1991 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1992 const HelperExprs &Exprs, bool CanBeParallelFor) {
1993 auto *Dir = createDirective<OMPTargetTeamsGenericLoopDirective>(
1994 C, Clauses, AssociatedStmt,
1995 numLoopChildren(CollapsedNum, OMPD_target_teams_loop), StartLoc, EndLoc,
1996 CollapsedNum);
1997 Dir->setHelperExprs(Exprs);
1998 Dir->setCanBeParallelFor(CanBeParallelFor);
1999 return Dir;
2000}
2001
2004 unsigned NumClauses,
2005 unsigned CollapsedNum,
2006 EmptyShell) {
2007 return createEmptyDirective<OMPTargetTeamsGenericLoopDirective>(
2008 C, NumClauses, /*HasAssociatedStmt=*/true,
2009 numLoopChildren(CollapsedNum, OMPD_target_teams_loop), CollapsedNum);
2010}
2011
2012OMPParallelGenericLoopDirective *OMPParallelGenericLoopDirective::Create(
2013 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2014 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2015 const HelperExprs &Exprs) {
2016 auto *Dir = createDirective<OMPParallelGenericLoopDirective>(
2017 C, Clauses, AssociatedStmt,
2018 numLoopChildren(CollapsedNum, OMPD_parallel_loop), StartLoc, EndLoc,
2019 CollapsedNum);
2020 Dir->setHelperExprs(Exprs);
2021 return Dir;
2022}
2023
2024OMPParallelGenericLoopDirective *OMPParallelGenericLoopDirective::CreateEmpty(
2025 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
2026 EmptyShell) {
2027 return createEmptyDirective<OMPParallelGenericLoopDirective>(
2028 C, NumClauses, /*HasAssociatedStmt=*/true,
2029 numLoopChildren(CollapsedNum, OMPD_parallel_loop), CollapsedNum);
2030}
2031
2034 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2035 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2036 const HelperExprs &Exprs) {
2037 auto *Dir = createDirective<OMPTargetParallelGenericLoopDirective>(
2038 C, Clauses, AssociatedStmt,
2039 numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), StartLoc,
2040 EndLoc, CollapsedNum);
2041 Dir->setHelperExprs(Exprs);
2042 return Dir;
2043}
2044
2047 unsigned NumClauses,
2048 unsigned CollapsedNum,
2049 EmptyShell) {
2050 return createEmptyDirective<OMPTargetParallelGenericLoopDirective>(
2051 C, NumClauses, /*HasAssociatedStmt=*/true,
2052 numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), CollapsedNum);
2053}
2054
2055OMPTargetGenericLoopDirective *OMPTargetGenericLoopDirective::Create(
2056 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2057 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2058 const HelperExprs &Exprs) {
2059 auto *Dir = createDirective<OMPTargetGenericLoopDirective>(
2060 C, Clauses, AssociatedStmt,
2061 numLoopChildren(CollapsedNum, OMPD_target_loop), StartLoc, EndLoc,
2062 CollapsedNum);
2063 Dir->setHelperExprs(Exprs);
2064 return Dir;
2065}
2066
2069 unsigned NumClauses,
2070 unsigned CollapsedNum, EmptyShell) {
2071 return createEmptyDirective<OMPTargetGenericLoopDirective>(
2072 C, NumClauses, /*HasAssociatedStmt=*/true,
2073 numLoopChildren(CollapsedNum, OMPD_target_loop), CollapsedNum);
2074}
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 * getFinals() const
Return loop variable finalization statement, or nullptr if the concrete transformation does not produ...
Stmt * getPreInits() const
Return preinits statement.
Stmt * getFinals() const
Return loop variable finalization statement, or nullptr if the concrete transformation does not produ...
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 * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Build an empty 'pragma omp fuse' AST node for deserialization.
static OMPFuseDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumGeneratedTopLevelLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals)
Create a new AST node representation for pragma omp fuse'.
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, Stmt *Finals)
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 setCombinedNextUpperBound(Expr *CombNUB)
void setInc(Expr *Inc)
void setNextUpperBound(Expr *NUB)
void setFinals(ArrayRef< Expr * > A)
static unsigned numLoopChildren(unsigned CollapsedNum, OpenMPDirectiveKind Kind)
Children number.
void setUpperBoundVariable(Expr *UB)
void setIsLastIterVariable(Expr *IL)
void setPrevEnsureUpperBound(Expr *PrevEUB)
void setCombinedLowerBoundVariable(Expr *CombLB)
void setPreInits(Stmt *PreInits)
void setDependentCounters(ArrayRef< Expr * > A)
void setInit(Expr *Init)
void setNextLowerBound(Expr *NLB)
void setCombinedParForInDistCond(Expr *CombParForInDistCond)
void setEnsureUpperBound(Expr *EUB)
void setCombinedNextLowerBound(Expr *CombNLB)
void setFinalsConditions(ArrayRef< Expr * > A)
void setPrevLowerBoundVariable(Expr *PrevLB)
void setCombinedCond(Expr *CombCond)
void setLowerBoundVariable(Expr *LB)
void setPrevUpperBoundVariable(Expr *PrevUB)
void setCombinedUpperBoundVariable(Expr *CombUB)
void setStrideVariable(Expr *ST)
void setCond(Expr *Cond)
void setCombinedDistCond(Expr *CombDistCond)
void setInits(ArrayRef< Expr * > A)
void setCalcLastIteration(Expr *CLI)
void setDistInc(Expr *DistInc)
void setCombinedEnsureUpperBound(Expr *CombEUB)
void setHelperExprs(const HelperExprs &Exprs)
Set the helper expressions used by this directive kind.
void setIterationVariable(Expr *IV)
void setCounters(ArrayRef< Expr * > A)
void setDependentInits(ArrayRef< Expr * > A)
void setPreCond(Expr *PC)
static unsigned getArraysOffset(OpenMPDirectiveKind Kind)
Offset to the start of children expression arrays.
void setNumIterations(Expr *NI)
void setLastIteration(Expr *LI)
void setCombinedInit(Expr *CombInit)
void setUpdates(ArrayRef< Expr * > A)
void setPrivateCounters(ArrayRef< Expr * > A)
Common class of data shared between OMPCanonicalLoopNestTransformationDirective and OMPCanonicalLoopS...
Stmt * getPreInits() const
Return preinits statement.
void setNumGeneratedTopLevelLoops(unsigned N)
Stmt * getFinals() const
Return loop variable finalization statement, or nullptr if the concrete transformation does not produ...
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.
This represents 'pragma omp metadirective' directive.
static OMPMetaDirective * CreateEmpty(const ASTContext &C, unsigned NumVariants, EmptyShell)
static OMPMetaDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< Stmt * > Variants, ArrayRef< Expr * > Conditions, ArrayRef< OMPTraitInfo * > TraitInfos, bool HasImplicitOtherwise)
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, Stmt *Finals)
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 * 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 split'.
static OMPSplitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp split' AST node for deserialization.
static OMPStripeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp stripe' AST node for deserialization.
static OMPStripeDirective * 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 stripe'.
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 loop' directive.
static OMPTargetGenericLoopDirective * 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 OMPTargetGenericLoopDirective * 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' 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, Stmt *Finals)
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, Stmt *Finals)
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:245
This represents one expression.
Definition Expr.h:114
Encodes a location in the source.
Stmt - This represents one statement.
Definition Stmt.h:85
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:934
Stmt Stmt llvm::function_ref< void(OMPLoopTransformationDirective *)> bool RelaxNestForPeeledTransformation
Definition StmtOpenMP.h:935
bool hasSpecificAttr(const Container &container)
Stmt Stmt * Callback
Definition StmtOpenMP.h:930
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...