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 if (auto *LD = dyn_cast<OMPLoopDirective>(this))
121 return LD->getBody();
122 return getRawStmt();
123}
124
125Stmt *
126OMPLoopBasedDirective::tryToFindNextInnerLoop(Stmt *CurStmt,
127 bool TryImperfectlyNestedLoops) {
128 Stmt *OrigStmt = CurStmt;
129 CurStmt = ignoreContainersKeepingIntraTileHint(CurStmt);
130 // Additional work for imperfectly nested loops, introduced in OpenMP 5.0.
131 if (TryImperfectlyNestedLoops) {
132 if (auto *CS = dyn_cast<CompoundStmt>(CurStmt)) {
133 CurStmt = nullptr;
134 SmallVector<CompoundStmt *, 4> Statements(1, CS);
135 SmallVector<CompoundStmt *, 4> NextStatements;
136 while (!Statements.empty()) {
137 CS = Statements.pop_back_val();
138 if (!CS)
139 continue;
140 for (Stmt *S : CS->body()) {
141 if (!S)
142 continue;
143 // Peek past a single-child container so a nested loop or
144 // loop-transformation directive (e.g. `#pragma omp reverse` inside
145 // the body of an outer loop) is recognized here. Preserve any
146 // intra-tile hint wrapper so it still reaches the loop-analysis
147 // callback.
149 Stmt *Inner = S;
150 if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Inner))
151 Inner = CanonLoop->getLoopStmt();
152 Inner = OMPLoopBasedDirective::ignoreIntraTileHint(Inner);
153 if (isa<ForStmt>(Inner) || isa<CXXForRangeStmt>(Inner) ||
155 !isa<OMPLoopDirective>(Inner))) {
156 // Only single loop construct is allowed.
157 if (CurStmt) {
158 CurStmt = OrigStmt;
159 break;
160 }
161 CurStmt = S;
162 continue;
163 }
164 S = OMPLoopBasedDirective::ignoreIntraTileHint(S);
165 if (auto *InnerCS = dyn_cast_or_null<CompoundStmt>(S))
166 NextStatements.push_back(InnerCS);
167 }
168 if (Statements.empty()) {
169 // Found single inner loop or multiple loops - exit.
170 if (CurStmt)
171 break;
172 Statements.swap(NextStatements);
173 }
174 }
175 if (!CurStmt)
176 CurStmt = OrigStmt;
177 }
178 }
179 return CurStmt;
180}
181
182bool OMPLoopBasedDirective::doForAllLoops(
183 Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops,
184 llvm::function_ref<bool(unsigned, Stmt *, Stmt *)> Callback,
185 llvm::function_ref<void(OMPLoopTransformationDirective *)>
188 CurStmt = ignoreContainersKeepingIntraTileHint(CurStmt);
189 for (unsigned Cnt = 0; Cnt < NumLoops; ++Cnt) {
190 // A loop generated by a peeled transformation may hold statements before
191 // the next loop (e.g. `reverse` recomputes the user counter there). They
192 // are not intervening user code, so callers that re-emit them may look
193 // through them; the rest of the nest is still checked as usual.
194 bool PeeledTransformation = false;
195 while (true) {
196 auto *Dir = dyn_cast<OMPLoopTransformationDirective>(CurStmt);
197 if (!Dir)
198 break;
199
201
202 Stmt *TransformedStmt = Dir->getTransformedStmt();
203 if (!TransformedStmt) {
204 unsigned NumGeneratedTopLevelLoops =
205 Dir->getNumGeneratedTopLevelLoops();
206 if (NumGeneratedTopLevelLoops == 0) {
207 // May happen if the loop transformation does not result in a
208 // generated loop (such as full unrolling).
209 break;
210 }
211 if (NumGeneratedTopLevelLoops > 0) {
212 // The loop transformation construct has generated loops, but these
213 // may not have been generated yet due to being in a dependent
214 // context.
215 return true;
216 }
217 }
218
219 CurStmt = TransformedStmt;
220 PeeledTransformation = true;
221 }
222 if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(CurStmt))
223 CurStmt = CanonLoop->getLoopStmt();
224 // Always hand the real loop to the callback and pass the hint wrapper
225 // separately so the callee can read it.
226 Stmt *LoopStmt = ignoreIntraTileHint(CurStmt);
227 Stmt *HintWrapper = LoopStmt != CurStmt ? CurStmt : nullptr;
228 if (Callback(Cnt, LoopStmt, HintWrapper))
229 return false;
230 // Move on to the next nested for loop, or to the loop body.
231 // OpenMP [2.8.1, simd construct, Restrictions]
232 // All loops associated with the construct must be perfectly nested; that
233 // is, there must be no intervening code nor any OpenMP directive between
234 // any two loops.
235 if (auto *For = dyn_cast<ForStmt>(LoopStmt)) {
236 CurStmt = For->getBody();
237 } else {
238 assert(isa<CXXForRangeStmt>(LoopStmt) &&
239 "Expected canonical for or range-based for loops.");
240 CurStmt = cast<CXXForRangeStmt>(LoopStmt)->getBody();
241 }
242 if (RelaxNestForPeeledTransformation && PeeledTransformation &&
243 !getStmtsBeforeNestedLoop(CurStmt).empty())
244 CurStmt = cast<CompoundStmt>(CurStmt)->body_back();
245 CurStmt = OMPLoopBasedDirective::tryToFindNextInnerLoop(
246 CurStmt, TryImperfectlyNestedLoops);
247 }
248 return true;
249}
250
251void OMPLoopBasedDirective::doForAllLoopsBodies(
252 Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops,
253 llvm::function_ref<void(unsigned, Stmt *, Stmt *)> Callback) {
254 bool Res = OMPLoopBasedDirective::doForAllLoops(
255 CurStmt, TryImperfectlyNestedLoops, NumLoops,
256 [Callback](unsigned Cnt, Stmt *Loop) {
257 Stmt *Body = nullptr;
258 if (auto *For = dyn_cast<ForStmt>(Loop)) {
259 Body = For->getBody();
260 } else {
261 assert(isa<CXXForRangeStmt>(Loop) &&
262 "Expected canonical for or range-based for loops.");
263 Body = cast<CXXForRangeStmt>(Loop)->getBody();
264 }
265 if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Body))
266 Body = CanonLoop->getLoopStmt();
267 Callback(Cnt, Loop, Body);
268 return false;
269 });
270 assert(Res && "Expected only loops");
271 (void)Res;
272}
273
275 // This relies on the loop form is already checked by Sema.
276 Stmt *Body = nullptr;
277 OMPLoopBasedDirective::doForAllLoopsBodies(
278 Data->getRawStmt(), /*TryImperfectlyNestedLoops=*/true,
279 NumAssociatedLoops,
280 [&Body](unsigned, Stmt *, Stmt *BodyStmt) { Body = BodyStmt; });
281 return Body;
282}
283
285 assert(A.size() == getLoopsNumber() &&
286 "Number of loop counters is not the same as the collapsed number");
287 llvm::copy(A, getCounters().begin());
288}
289
291 assert(A.size() == getLoopsNumber() && "Number of loop private counters "
292 "is not the same as the collapsed "
293 "number");
294 llvm::copy(A, getPrivateCounters().begin());
295}
296
298 assert(A.size() == getLoopsNumber() &&
299 "Number of counter inits is not the same as the collapsed number");
300 llvm::copy(A, getInits().begin());
301}
302
304 assert(A.size() == getLoopsNumber() &&
305 "Number of counter updates is not the same as the collapsed number");
306 llvm::copy(A, getUpdates().begin());
307}
308
310 assert(A.size() == getLoopsNumber() &&
311 "Number of counter finals is not the same as the collapsed number");
312 llvm::copy(A, getFinals().begin());
313}
314
316 assert(
317 A.size() == getLoopsNumber() &&
318 "Number of dependent counters is not the same as the collapsed number");
319 llvm::copy(A, getDependentCounters().begin());
320}
321
323 assert(A.size() == getLoopsNumber() &&
324 "Number of dependent inits is not the same as the collapsed number");
325 llvm::copy(A, getDependentInits().begin());
326}
327
329 assert(A.size() == getLoopsNumber() &&
330 "Number of finals conditions is not the same as the collapsed number");
331 llvm::copy(A, getFinalsConditions().begin());
332}
333
334void OMPLoopDirective::setHelperExprs(const HelperExprs &Exprs) {
335 setIterationVariable(Exprs.IterationVarRef);
336 setLastIteration(Exprs.LastIteration);
337 setCalcLastIteration(Exprs.CalcLastIteration);
338 setPreCond(Exprs.PreCond);
339 setCond(Exprs.Cond);
340 setInit(Exprs.Init);
341 setInc(Exprs.Inc);
342 setCounters(Exprs.Counters);
343 setPrivateCounters(Exprs.PrivateCounters);
344 setInits(Exprs.Inits);
345 setUpdates(Exprs.Updates);
346 setFinals(Exprs.Finals);
347 setDependentCounters(Exprs.DependentCounters);
348 setDependentInits(Exprs.DependentInits);
349 setFinalsConditions(Exprs.FinalsConditions);
350 setPreInits(Exprs.PreInits);
351
352 const unsigned ArraysOffset = getArraysOffset(getDirectiveKind());
353 // Simd directives have no worksharing helpers.
354 if (ArraysOffset == DefaultEnd)
355 return;
356 setIsLastIterVariable(Exprs.IL);
357 setLowerBoundVariable(Exprs.LB);
358 setUpperBoundVariable(Exprs.UB);
359 setStrideVariable(Exprs.ST);
360 setEnsureUpperBound(Exprs.EUB);
361 setNextLowerBound(Exprs.NLB);
362 setNextUpperBound(Exprs.NUB);
363 setNumIterations(Exprs.NumIterations);
364
365 if (ArraysOffset == WorksharingEnd)
366 return;
367 setPrevLowerBoundVariable(Exprs.PrevLB);
368 setPrevUpperBoundVariable(Exprs.PrevUB);
369 setDistInc(Exprs.DistInc);
370 setPrevEnsureUpperBound(Exprs.PrevEUB);
371 setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
372 setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
373 setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
374 setCombinedInit(Exprs.DistCombinedFields.Init);
375 setCombinedCond(Exprs.DistCombinedFields.Cond);
376 setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
377 setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
378 setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
379 setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
380}
381
382OMPMetaDirective *OMPMetaDirective::allocate(const ASTContext &C,
383 unsigned NumVariants,
384 SourceLocation StartLoc,
385 SourceLocation EndLoc) {
386 void *Mem =
387 C.Allocate(sizeof(OMPMetaDirective) + getTraitInfosOffset(NumVariants) +
388 NumVariants * sizeof(OMPTraitInfo *),
389 alignof(OMPMetaDirective));
390 auto *Data = OMPChildren::CreateEmpty(
391 reinterpret_cast<OMPMetaDirective *>(Mem) + 1, /*NumClauses=*/0,
392 /*HasAssociatedStmt=*/false, 2 * NumVariants);
393 auto *Dir = new (Mem) OMPMetaDirective(StartLoc, EndLoc);
394 Dir->Data = Data;
395 return Dir;
396}
397
398OMPMetaDirective *OMPMetaDirective::Create(
399 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
400 ArrayRef<Stmt *> Variants, ArrayRef<Expr *> Conditions,
401 ArrayRef<OMPTraitInfo *> TraitInfos, bool HasImplicitOtherwise) {
402 assert(Variants.size() == Conditions.size() &&
403 Variants.size() == TraitInfos.size() &&
404 "Expected one condition and one trait info per variant");
405 OMPMetaDirective *Dir = allocate(C, Variants.size(), StartLoc, EndLoc);
406 llvm::copy(Variants, Dir->getTrailingVariants().begin());
407 llvm::copy(Conditions, Dir->getTrailingConditions().begin());
408 llvm::copy(TraitInfos, Dir->getTrailingTraitInfos().begin());
409 Dir->setHasImplicitOtherwise(HasImplicitOtherwise);
410 return Dir;
411}
412
414 unsigned NumVariants,
415 EmptyShell) {
416 return allocate(C, NumVariants, SourceLocation(), SourceLocation());
417}
418
419OMPParallelDirective *OMPParallelDirective::Create(
420 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
421 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
422 bool HasCancel) {
423 auto *Dir = createDirective<OMPParallelDirective>(
424 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
425 Dir->setTaskReductionRefExpr(TaskRedRef);
426 Dir->setHasCancel(HasCancel);
427 return Dir;
428}
429
430OMPParallelDirective *OMPParallelDirective::CreateEmpty(const ASTContext &C,
431 unsigned NumClauses,
432 EmptyShell) {
433 return createEmptyDirective<OMPParallelDirective>(C, NumClauses,
434 /*HasAssociatedStmt=*/true,
435 /*NumChildren=*/1);
436}
437
440 SourceLocation EndLoc, unsigned CollapsedNum,
441 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
442 const HelperExprs &Exprs) {
443 auto *Dir = createDirective<OMPSimdDirective>(
444 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_simd),
445 StartLoc, EndLoc, CollapsedNum);
446 Dir->setHelperExprs(Exprs);
447 return Dir;
448}
449
451 unsigned NumClauses,
452 unsigned CollapsedNum,
453 EmptyShell) {
454 return createEmptyDirective<OMPSimdDirective>(
455 C, NumClauses, /*HasAssociatedStmt=*/true,
456 numLoopChildren(CollapsedNum, OMPD_simd), CollapsedNum);
457}
458
459OMPForDirective *OMPForDirective::Create(
460 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
461 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
462 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
463 auto *Dir = createDirective<OMPForDirective>(
464 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for) + 1,
465 StartLoc, EndLoc, CollapsedNum);
466 Dir->setHelperExprs(Exprs);
467 Dir->setTaskReductionRefExpr(TaskRedRef);
468 Dir->setHasCancel(HasCancel);
469 return Dir;
470}
471
473 if (auto *D = dyn_cast<OMPCanonicalLoopNestTransformationDirective>(S))
474 return D->getTransformedStmt();
475 if (auto *D = dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S))
476 return D->getTransformedStmt();
477 llvm_unreachable("unexpected object type");
478}
479
481 if (auto *D = dyn_cast<OMPCanonicalLoopNestTransformationDirective>(S))
482 return D->getPreInits();
483 if (auto *D = dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S))
484 return D->getPreInits();
485 llvm_unreachable("unexpected object type");
486}
487
489 if (auto *D = dyn_cast<OMPCanonicalLoopNestTransformationDirective>(S))
490 return D->getFinals();
491 if (auto *D = dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S))
492 return D->getFinals();
493 llvm_unreachable("unexpected object type");
494}
495
497 switch (getStmtClass()) {
498#define STMT(CLASS, PARENT)
499#define ABSTRACT_STMT(CLASS)
500#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
501 case Stmt::CLASS##Class: \
502 return static_cast<const CLASS *>(this)->getTransformedStmt();
503#include "clang/AST/StmtNodes.inc"
504 default:
505 llvm_unreachable("Not a loop transformation for canonical loop nests");
506 }
507}
508
510 switch (getStmtClass()) {
511#define STMT(CLASS, PARENT)
512#define ABSTRACT_STMT(CLASS)
513#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
514 case Stmt::CLASS##Class: \
515 return static_cast<const CLASS *>(this)->getPreInits();
516#include "clang/AST/StmtNodes.inc"
517 default:
518 llvm_unreachable("Not a loop transformation for canonical loop nests");
519 }
520}
521
523 switch (getStmtClass()) {
524#define STMT(CLASS, PARENT)
525#define ABSTRACT_STMT(CLASS)
526#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
527 case Stmt::CLASS##Class: \
528 return static_cast<const CLASS *>(this)->getFinals();
529#include "clang/AST/StmtNodes.inc"
530 default:
531 llvm_unreachable("Not a loop transformation for canonical loop nests");
532 }
533}
534
535Stmt *
537 switch (getStmtClass()) {
538#define STMT(CLASS, PARENT)
539#define ABSTRACT_STMT(CLASS)
540#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
541 case Stmt::CLASS##Class: \
542 return static_cast<const CLASS *>(this)->getTransformedStmt();
543#include "clang/AST/StmtNodes.inc"
544 default:
545 llvm_unreachable("Not a loop transformation for canonical loop sequences");
546 }
547}
548
550 switch (getStmtClass()) {
551#define STMT(CLASS, PARENT)
552#define ABSTRACT_STMT(CLASS)
553#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
554 case Stmt::CLASS##Class: \
555 return static_cast<const CLASS *>(this)->getPreInits();
556#include "clang/AST/StmtNodes.inc"
557 default:
558 llvm_unreachable("Not a loop transformation for canonical loop sequences");
559 }
560}
561
563 switch (getStmtClass()) {
564#define STMT(CLASS, PARENT)
565#define ABSTRACT_STMT(CLASS)
566#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
567 case Stmt::CLASS##Class: \
568 return static_cast<const CLASS *>(this)->getFinals();
569#include "clang/AST/StmtNodes.inc"
570 default:
571 llvm_unreachable("Not a loop transformation for canonical loop sequences");
572 }
573}
574
576 unsigned NumClauses,
577 unsigned CollapsedNum,
578 EmptyShell) {
579 return createEmptyDirective<OMPForDirective>(
580 C, NumClauses, /*HasAssociatedStmt=*/true,
581 numLoopChildren(CollapsedNum, OMPD_for) + 1, CollapsedNum);
582}
583
587 unsigned NumLoops, Stmt *AssociatedStmt,
588 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals) {
589 OMPTileDirective *Dir = createDirective<OMPTileDirective>(
590 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
591 Dir->setTransformedStmt(TransformedStmt);
592 Dir->setPreInits(PreInits);
593 Dir->setFinals(Finals);
594 return Dir;
595}
596
598 unsigned NumClauses,
599 unsigned NumLoops) {
600 return createEmptyDirective<OMPTileDirective>(
601 C, NumClauses, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
602 SourceLocation(), SourceLocation(), NumLoops);
603}
604
605OMPStripeDirective *OMPStripeDirective::Create(
606 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
607 ArrayRef<OMPClause *> Clauses, unsigned NumLoops, Stmt *AssociatedStmt,
608 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals) {
609 OMPStripeDirective *Dir = createDirective<OMPStripeDirective>(
610 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
611 Dir->setTransformedStmt(TransformedStmt);
612 Dir->setPreInits(PreInits);
613 Dir->setFinals(Finals);
614 return Dir;
615}
616
618 unsigned NumClauses,
619 unsigned NumLoops) {
620 return createEmptyDirective<OMPStripeDirective>(
621 C, NumClauses, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
622 SourceLocation(), SourceLocation(), NumLoops);
623}
624
625OMPUnrollDirective *OMPUnrollDirective::Create(
626 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
627 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
628 unsigned NumGeneratedTopLevelLoops, Stmt *TransformedStmt, Stmt *PreInits,
629 Stmt *Finals) {
630 assert(NumGeneratedTopLevelLoops <= 1 &&
631 "Unrolling generates at most one loop");
632
633 auto *Dir = createDirective<OMPUnrollDirective>(
634 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc);
635 Dir->setNumGeneratedTopLevelLoops(NumGeneratedTopLevelLoops);
636 Dir->setTransformedStmt(TransformedStmt);
637 Dir->setPreInits(PreInits);
638 Dir->setFinals(Finals);
639 return Dir;
640}
641
643 unsigned NumClauses) {
644 return createEmptyDirective<OMPUnrollDirective>(
645 C, NumClauses, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
647}
648
651 SourceLocation EndLoc, Stmt *AssociatedStmt,
652 unsigned NumLoops, Stmt *TransformedStmt,
653 Stmt *PreInits, Stmt *Finals) {
654 OMPReverseDirective *Dir = createDirective<OMPReverseDirective>(
655 C, {}, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
656 Dir->setTransformedStmt(TransformedStmt);
657 Dir->setPreInits(PreInits);
658 Dir->setFinals(Finals);
659 return Dir;
660}
661
663 unsigned NumLoops) {
664 return createEmptyDirective<OMPReverseDirective>(
665 C, /*NumClauses=*/0, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
666 SourceLocation(), SourceLocation(), NumLoops);
667}
668
669OMPInterchangeDirective *OMPInterchangeDirective::Create(
670 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
671 ArrayRef<OMPClause *> Clauses, unsigned NumLoops, Stmt *AssociatedStmt,
672 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals) {
673 OMPInterchangeDirective *Dir = createDirective<OMPInterchangeDirective>(
674 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
675 Dir->setTransformedStmt(TransformedStmt);
676 Dir->setPreInits(PreInits);
677 Dir->setFinals(Finals);
678 return Dir;
679}
680
683 unsigned NumLoops) {
684 return createEmptyDirective<OMPInterchangeDirective>(
685 C, NumClauses, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
686 SourceLocation(), SourceLocation(), NumLoops);
687}
688
689OMPFlattenDirective *OMPFlattenDirective::Create(
690 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
691 ArrayRef<OMPClause *> Clauses, unsigned NumLoops, Stmt *AssociatedStmt,
692 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals) {
693 OMPFlattenDirective *Dir = createDirective<OMPFlattenDirective>(
694 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
695 Dir->setTransformedStmt(TransformedStmt);
696 Dir->setPreInits(PreInits);
697 Dir->setFinals(Finals);
698 return Dir;
699}
700
702 unsigned NumClauses,
703 unsigned NumLoops) {
704 return createEmptyDirective<OMPFlattenDirective>(
705 C, NumClauses, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
706 SourceLocation(), SourceLocation(), NumLoops);
707}
708
712 unsigned NumLoops, Stmt *AssociatedStmt,
713 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals) {
714 OMPSplitDirective *Dir = createDirective<OMPSplitDirective>(
715 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
716 Dir->setTransformedStmt(TransformedStmt);
717 Dir->setPreInits(PreInits);
718 Dir->setFinals(Finals);
719 return Dir;
720}
721
723 unsigned NumClauses,
724 unsigned NumLoops) {
725 return createEmptyDirective<OMPSplitDirective>(
726 C, NumClauses, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
727 SourceLocation(), SourceLocation(), NumLoops);
728}
729
730OMPFuseDirective *OMPFuseDirective::Create(
731 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
732 ArrayRef<OMPClause *> Clauses, unsigned NumGeneratedTopLevelLoops,
733 Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals) {
734
735 OMPFuseDirective *Dir = createDirective<OMPFuseDirective>(
736 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc);
737 Dir->setTransformedStmt(TransformedStmt);
738 Dir->setPreInits(PreInits);
739 Dir->setFinals(Finals);
740 Dir->setNumGeneratedTopLevelLoops(NumGeneratedTopLevelLoops);
741 return Dir;
742}
743
745 unsigned NumClauses) {
746 OMPFuseDirective *Dir = createEmptyDirective<OMPFuseDirective>(
747 C, NumClauses, /*HasAssociatedStmt=*/true, FinalsOffset + 1,
749 return Dir;
750}
751
754 SourceLocation EndLoc, unsigned CollapsedNum,
755 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
756 const HelperExprs &Exprs) {
757 auto *Dir = createDirective<OMPForSimdDirective>(
758 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for_simd),
759 StartLoc, EndLoc, CollapsedNum);
760 Dir->setHelperExprs(Exprs);
761 return Dir;
762}
763
765 unsigned NumClauses,
766 unsigned CollapsedNum,
767 EmptyShell) {
768 return createEmptyDirective<OMPForSimdDirective>(
769 C, NumClauses, /*HasAssociatedStmt=*/true,
770 numLoopChildren(CollapsedNum, OMPD_for_simd), CollapsedNum);
771}
772
773OMPSectionsDirective *OMPSectionsDirective::Create(
774 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
775 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
776 bool HasCancel) {
777 auto *Dir = createDirective<OMPSectionsDirective>(C, Clauses, AssociatedStmt,
778 /*NumChildren=*/1, StartLoc,
779 EndLoc);
780 Dir->setTaskReductionRefExpr(TaskRedRef);
781 Dir->setHasCancel(HasCancel);
782 return Dir;
783}
784
785OMPSectionsDirective *OMPSectionsDirective::CreateEmpty(const ASTContext &C,
786 unsigned NumClauses,
787 EmptyShell) {
788 return createEmptyDirective<OMPSectionsDirective>(C, NumClauses,
789 /*HasAssociatedStmt=*/true,
790 /*NumChildren=*/1);
791}
792
793OMPSectionDirective *OMPSectionDirective::Create(const ASTContext &C,
794 SourceLocation StartLoc,
795 SourceLocation EndLoc,
796 Stmt *AssociatedStmt,
797 bool HasCancel) {
798 auto *Dir =
799 createDirective<OMPSectionDirective>(C, {}, AssociatedStmt,
800 /*NumChildren=*/0, StartLoc, EndLoc);
801 Dir->setHasCancel(HasCancel);
802 return Dir;
803}
804
806 EmptyShell) {
807 return createEmptyDirective<OMPSectionDirective>(C, /*NumClauses=*/0,
808 /*HasAssociatedStmt=*/true);
809}
810
811OMPScopeDirective *OMPScopeDirective::Create(const ASTContext &C,
812 SourceLocation StartLoc,
813 SourceLocation EndLoc,
814 ArrayRef<OMPClause *> Clauses,
815 Stmt *AssociatedStmt) {
816 return createDirective<OMPScopeDirective>(C, Clauses, AssociatedStmt,
817 /*NumChildren=*/0, StartLoc,
818 EndLoc);
819}
820
822 unsigned NumClauses,
823 EmptyShell) {
824 return createEmptyDirective<OMPScopeDirective>(C, NumClauses,
825 /*HasAssociatedStmt=*/true);
826}
827
828OMPSingleDirective *OMPSingleDirective::Create(const ASTContext &C,
829 SourceLocation StartLoc,
830 SourceLocation EndLoc,
831 ArrayRef<OMPClause *> Clauses,
832 Stmt *AssociatedStmt) {
833 return createDirective<OMPSingleDirective>(C, Clauses, AssociatedStmt,
834 /*NumChildren=*/0, StartLoc,
835 EndLoc);
836}
837
839 unsigned NumClauses,
840 EmptyShell) {
841 return createEmptyDirective<OMPSingleDirective>(C, NumClauses,
842 /*HasAssociatedStmt=*/true);
843}
844
845OMPMasterDirective *OMPMasterDirective::Create(const ASTContext &C,
846 SourceLocation StartLoc,
847 SourceLocation EndLoc,
848 Stmt *AssociatedStmt) {
849 return createDirective<OMPMasterDirective>(C, {}, AssociatedStmt,
850 /*NumChildren=*/0, StartLoc,
851 EndLoc);
852}
853
855 EmptyShell) {
856 return createEmptyDirective<OMPMasterDirective>(C, /*NumClauses=*/0,
857 /*HasAssociatedStmt=*/true);
858}
859
860OMPCriticalDirective *OMPCriticalDirective::Create(
861 const ASTContext &C, const DeclarationNameInfo &Name,
862 SourceLocation StartLoc, SourceLocation EndLoc,
863 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
864 return createDirective<OMPCriticalDirective>(C, Clauses, AssociatedStmt,
865 /*NumChildren=*/0, Name,
866 StartLoc, EndLoc);
867}
868
869OMPCriticalDirective *OMPCriticalDirective::CreateEmpty(const ASTContext &C,
870 unsigned NumClauses,
871 EmptyShell) {
872 return createEmptyDirective<OMPCriticalDirective>(C, NumClauses,
873 /*HasAssociatedStmt=*/true);
874}
875
876OMPParallelForDirective *OMPParallelForDirective::Create(
877 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
878 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
879 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
880 auto *Dir = createDirective<OMPParallelForDirective>(
881 C, Clauses, AssociatedStmt,
882 numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, StartLoc, EndLoc,
883 CollapsedNum);
884 Dir->setHelperExprs(Exprs);
885 Dir->setTaskReductionRefExpr(TaskRedRef);
886 Dir->setHasCancel(HasCancel);
887 return Dir;
888}
889
892 unsigned CollapsedNum, EmptyShell) {
893 return createEmptyDirective<OMPParallelForDirective>(
894 C, NumClauses, /*HasAssociatedStmt=*/true,
895 numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, CollapsedNum);
896}
897
898OMPParallelForSimdDirective *OMPParallelForSimdDirective::Create(
899 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
900 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
901 const HelperExprs &Exprs) {
902 auto *Dir = createDirective<OMPParallelForSimdDirective>(
903 C, Clauses, AssociatedStmt,
904 numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), StartLoc, EndLoc,
905 CollapsedNum);
906 Dir->setHelperExprs(Exprs);
907 return Dir;
908}
909
912 unsigned NumClauses,
913 unsigned CollapsedNum, EmptyShell) {
914 return createEmptyDirective<OMPParallelForSimdDirective>(
915 C, NumClauses, /*HasAssociatedStmt=*/true,
916 numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), CollapsedNum);
917}
918
919OMPParallelMasterDirective *OMPParallelMasterDirective::Create(
920 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
921 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) {
922 auto *Dir = createDirective<OMPParallelMasterDirective>(
923 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
924 Dir->setTaskReductionRefExpr(TaskRedRef);
925 return Dir;
926}
927
930 unsigned NumClauses, EmptyShell) {
931 return createEmptyDirective<OMPParallelMasterDirective>(
932 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
933}
934
935OMPParallelMaskedDirective *OMPParallelMaskedDirective::Create(
936 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
937 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) {
938 auto *Dir = createDirective<OMPParallelMaskedDirective>(
939 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
940 Dir->setTaskReductionRefExpr(TaskRedRef);
941 return Dir;
942}
943
946 unsigned NumClauses, EmptyShell) {
947 return createEmptyDirective<OMPParallelMaskedDirective>(
948 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
949}
950
951OMPParallelSectionsDirective *OMPParallelSectionsDirective::Create(
952 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
953 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
954 bool HasCancel) {
955 auto *Dir = createDirective<OMPParallelSectionsDirective>(
956 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
957 Dir->setTaskReductionRefExpr(TaskRedRef);
958 Dir->setHasCancel(HasCancel);
959 return Dir;
960}
961
964 unsigned NumClauses, EmptyShell) {
965 return createEmptyDirective<OMPParallelSectionsDirective>(
966 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
967}
968
972 Stmt *AssociatedStmt, bool HasCancel) {
973 auto *Dir = createDirective<OMPTaskDirective>(
974 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
975 Dir->setHasCancel(HasCancel);
976 return Dir;
977}
978
980 unsigned NumClauses,
981 EmptyShell) {
982 return createEmptyDirective<OMPTaskDirective>(C, NumClauses,
983 /*HasAssociatedStmt=*/true);
984}
985
986OMPTaskyieldDirective *OMPTaskyieldDirective::Create(const ASTContext &C,
987 SourceLocation StartLoc,
988 SourceLocation EndLoc) {
989 return new (C) OMPTaskyieldDirective(StartLoc, EndLoc);
990}
991
992OMPTaskyieldDirective *OMPTaskyieldDirective::CreateEmpty(const ASTContext &C,
993 EmptyShell) {
994 return new (C) OMPTaskyieldDirective();
995}
996
997OMPAssumeDirective *OMPAssumeDirective::Create(const ASTContext &C,
998 SourceLocation StartLoc,
999 SourceLocation EndLoc,
1000 ArrayRef<OMPClause *> Clauses,
1001 Stmt *AStmt) {
1002 return createDirective<OMPAssumeDirective>(C, Clauses, AStmt,
1003 /*NumChildren=*/0, StartLoc,
1004 EndLoc);
1005}
1006
1008 unsigned NumClauses,
1009 EmptyShell) {
1010 return createEmptyDirective<OMPAssumeDirective>(C, NumClauses,
1011 /*HasAssociatedStmt=*/true);
1012}
1013
1014OMPErrorDirective *OMPErrorDirective::Create(const ASTContext &C,
1015 SourceLocation StartLoc,
1016 SourceLocation EndLoc,
1017 ArrayRef<OMPClause *> Clauses) {
1018 return createDirective<OMPErrorDirective>(
1019 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1020 EndLoc);
1021}
1022
1024 unsigned NumClauses,
1025 EmptyShell) {
1026 return createEmptyDirective<OMPErrorDirective>(C, NumClauses);
1027}
1028
1029OMPBarrierDirective *OMPBarrierDirective::Create(const ASTContext &C,
1030 SourceLocation StartLoc,
1031 SourceLocation EndLoc) {
1032 return new (C) OMPBarrierDirective(StartLoc, EndLoc);
1033}
1034
1036 EmptyShell) {
1037 return new (C) OMPBarrierDirective();
1038}
1039
1042 SourceLocation EndLoc,
1043 ArrayRef<OMPClause *> Clauses) {
1044 return createDirective<OMPTaskwaitDirective>(
1045 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1046 EndLoc);
1047}
1048
1050 unsigned NumClauses,
1051 EmptyShell) {
1052 return createEmptyDirective<OMPTaskwaitDirective>(C, NumClauses);
1053}
1054
1055OMPTaskgroupDirective *OMPTaskgroupDirective::Create(
1056 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1057 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) {
1058 auto *Dir = createDirective<OMPTaskgroupDirective>(
1059 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
1060 Dir->setReductionRef(ReductionRef);
1061 return Dir;
1062}
1063
1065 unsigned NumClauses,
1066 EmptyShell) {
1067 return createEmptyDirective<OMPTaskgroupDirective>(
1068 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
1069}
1070
1071OMPCancellationPointDirective *OMPCancellationPointDirective::Create(
1072 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1073 OpenMPDirectiveKind CancelRegion) {
1074 auto *Dir = new (C) OMPCancellationPointDirective(StartLoc, EndLoc);
1075 Dir->setCancelRegion(CancelRegion);
1076 return Dir;
1077}
1078
1081 return new (C) OMPCancellationPointDirective();
1082}
1083
1086 SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
1087 OpenMPDirectiveKind CancelRegion) {
1088 auto *Dir = createDirective<OMPCancelDirective>(
1089 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1090 EndLoc);
1091 Dir->setCancelRegion(CancelRegion);
1092 return Dir;
1093}
1094
1096 unsigned NumClauses,
1097 EmptyShell) {
1098 return createEmptyDirective<OMPCancelDirective>(C, NumClauses);
1099}
1100
1101OMPFlushDirective *OMPFlushDirective::Create(const ASTContext &C,
1102 SourceLocation StartLoc,
1103 SourceLocation EndLoc,
1104 ArrayRef<OMPClause *> Clauses) {
1105 return createDirective<OMPFlushDirective>(
1106 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1107 EndLoc);
1108}
1109
1111 unsigned NumClauses,
1112 EmptyShell) {
1113 return createEmptyDirective<OMPFlushDirective>(C, NumClauses);
1114}
1115
1116OMPDepobjDirective *OMPDepobjDirective::Create(const ASTContext &C,
1117 SourceLocation StartLoc,
1118 SourceLocation EndLoc,
1119 ArrayRef<OMPClause *> Clauses) {
1120 return createDirective<OMPDepobjDirective>(
1121 C, Clauses, /*AssociatedStmt=*/nullptr,
1122 /*NumChildren=*/0, StartLoc, EndLoc);
1123}
1124
1126 unsigned NumClauses,
1127 EmptyShell) {
1128 return createEmptyDirective<OMPDepobjDirective>(C, NumClauses);
1129}
1130
1131OMPScanDirective *OMPScanDirective::Create(const ASTContext &C,
1132 SourceLocation StartLoc,
1133 SourceLocation EndLoc,
1134 ArrayRef<OMPClause *> Clauses) {
1135 return createDirective<OMPScanDirective>(C, Clauses,
1136 /*AssociatedStmt=*/nullptr,
1137 /*NumChildren=*/0, StartLoc, EndLoc);
1138}
1139
1141 unsigned NumClauses,
1142 EmptyShell) {
1143 return createEmptyDirective<OMPScanDirective>(C, NumClauses);
1144}
1145
1146OMPOrderedStandaloneDirective *OMPOrderedStandaloneDirective::Create(
1147 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1148 ArrayRef<OMPClause *> Clauses) {
1149 return createDirective<OMPOrderedStandaloneDirective>(
1150 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1151 EndLoc);
1152}
1153
1156 unsigned NumClauses, EmptyShell) {
1157 return createEmptyDirective<OMPOrderedStandaloneDirective>(C, NumClauses);
1158}
1159
1160OMPOrderedBlockAssocDirective *OMPOrderedBlockAssocDirective::Create(
1161 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1162 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1163 return createDirective<OMPOrderedBlockAssocDirective>(
1164 C, Clauses, cast<CapturedStmt>(AssociatedStmt), /*NumChildren=*/0,
1165 StartLoc, EndLoc);
1166}
1167
1170 unsigned NumClauses, EmptyShell) {
1171 return createEmptyDirective<OMPOrderedBlockAssocDirective>(
1172 C, NumClauses, /*HasAssociatedStmt=*/true);
1173}
1174
1177 SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
1178 Stmt *AssociatedStmt, Expressions Exprs) {
1179 auto *Dir = createDirective<OMPAtomicDirective>(
1180 C, Clauses, AssociatedStmt, /*NumChildren=*/7, StartLoc, EndLoc);
1181 Dir->setX(Exprs.X);
1182 Dir->setV(Exprs.V);
1183 Dir->setR(Exprs.R);
1184 Dir->setExpr(Exprs.E);
1185 Dir->setUpdateExpr(Exprs.UE);
1186 Dir->setD(Exprs.D);
1187 Dir->setCond(Exprs.Cond);
1188 Dir->Flags.IsXLHSInRHSPart = Exprs.IsXLHSInRHSPart ? 1 : 0;
1189 Dir->Flags.IsPostfixUpdate = Exprs.IsPostfixUpdate ? 1 : 0;
1190 Dir->Flags.IsFailOnly = Exprs.IsFailOnly ? 1 : 0;
1191 return Dir;
1192}
1193
1195 unsigned NumClauses,
1196 EmptyShell) {
1197 return createEmptyDirective<OMPAtomicDirective>(
1198 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/7);
1199}
1200
1201OMPTargetDirective *OMPTargetDirective::Create(const ASTContext &C,
1202 SourceLocation StartLoc,
1203 SourceLocation EndLoc,
1204 ArrayRef<OMPClause *> Clauses,
1205 Stmt *AssociatedStmt) {
1206 return createDirective<OMPTargetDirective>(
1207 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1208}
1209
1211 unsigned NumClauses,
1212 EmptyShell) {
1213 return createEmptyDirective<OMPTargetDirective>(C, NumClauses,
1214 /*HasAssociatedStmt=*/true);
1215}
1216
1217OMPTargetParallelDirective *OMPTargetParallelDirective::Create(
1218 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1219 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
1220 bool HasCancel) {
1221 auto *Dir = createDirective<OMPTargetParallelDirective>(
1222 C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
1223 Dir->setTaskReductionRefExpr(TaskRedRef);
1224 Dir->setHasCancel(HasCancel);
1225 return Dir;
1226}
1227
1230 unsigned NumClauses, EmptyShell) {
1231 return createEmptyDirective<OMPTargetParallelDirective>(
1232 C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);
1233}
1234
1235OMPTargetParallelForDirective *OMPTargetParallelForDirective::Create(
1236 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1237 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1238 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1239 auto *Dir = createDirective<OMPTargetParallelForDirective>(
1240 C, Clauses, AssociatedStmt,
1241 numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1, StartLoc,
1242 EndLoc, CollapsedNum);
1243 Dir->setHelperExprs(Exprs);
1244 Dir->setTaskReductionRefExpr(TaskRedRef);
1245 Dir->setHasCancel(HasCancel);
1246 return Dir;
1247}
1248
1251 unsigned NumClauses,
1252 unsigned CollapsedNum, EmptyShell) {
1253 return createEmptyDirective<OMPTargetParallelForDirective>(
1254 C, NumClauses, /*HasAssociatedStmt=*/true,
1255 numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1,
1256 CollapsedNum);
1257}
1258
1259OMPTargetDataDirective *OMPTargetDataDirective::Create(
1260 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1261 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1262 return createDirective<OMPTargetDataDirective>(
1263 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1264}
1265
1266OMPTargetDataDirective *OMPTargetDataDirective::CreateEmpty(const ASTContext &C,
1267 unsigned N,
1268 EmptyShell) {
1269 return createEmptyDirective<OMPTargetDataDirective>(
1270 C, N, /*HasAssociatedStmt=*/true);
1271}
1272
1273OMPTargetEnterDataDirective *OMPTargetEnterDataDirective::Create(
1274 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1275 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1276 return createDirective<OMPTargetEnterDataDirective>(
1277 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1278}
1279
1282 EmptyShell) {
1283 return createEmptyDirective<OMPTargetEnterDataDirective>(
1284 C, N, /*HasAssociatedStmt=*/true);
1285}
1286
1287OMPTargetExitDataDirective *OMPTargetExitDataDirective::Create(
1288 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1289 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1290 return createDirective<OMPTargetExitDataDirective>(
1291 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1292}
1293
1296 EmptyShell) {
1297 return createEmptyDirective<OMPTargetExitDataDirective>(
1298 C, N, /*HasAssociatedStmt=*/true);
1299}
1300
1301OMPTeamsDirective *OMPTeamsDirective::Create(const ASTContext &C,
1302 SourceLocation StartLoc,
1303 SourceLocation EndLoc,
1304 ArrayRef<OMPClause *> Clauses,
1305 Stmt *AssociatedStmt) {
1306 return createDirective<OMPTeamsDirective>(
1307 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1308}
1309
1311 unsigned NumClauses,
1312 EmptyShell) {
1313 return createEmptyDirective<OMPTeamsDirective>(C, NumClauses,
1314 /*HasAssociatedStmt=*/true);
1315}
1316
1317OMPTaskLoopDirective *OMPTaskLoopDirective::Create(
1318 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1319 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1320 const HelperExprs &Exprs, bool HasCancel) {
1321 auto *Dir = createDirective<OMPTaskLoopDirective>(
1322 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_taskloop),
1323 StartLoc, EndLoc, CollapsedNum);
1324 Dir->setHelperExprs(Exprs);
1325 Dir->setHasCancel(HasCancel);
1326 return Dir;
1327}
1328
1330 unsigned NumClauses,
1331 unsigned CollapsedNum,
1332 EmptyShell) {
1333 return createEmptyDirective<OMPTaskLoopDirective>(
1334 C, NumClauses, /*HasAssociatedStmt=*/true,
1335 numLoopChildren(CollapsedNum, OMPD_taskloop), CollapsedNum);
1336}
1337
1338OMPTaskLoopSimdDirective *OMPTaskLoopSimdDirective::Create(
1339 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1340 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1341 const HelperExprs &Exprs) {
1342 auto *Dir = createDirective<OMPTaskLoopSimdDirective>(
1343 C, Clauses, AssociatedStmt,
1344 numLoopChildren(CollapsedNum, OMPD_taskloop_simd), StartLoc, EndLoc,
1345 CollapsedNum);
1346 Dir->setHelperExprs(Exprs);
1347 return Dir;
1348}
1349
1352 unsigned CollapsedNum, EmptyShell) {
1353 return createEmptyDirective<OMPTaskLoopSimdDirective>(
1354 C, NumClauses, /*HasAssociatedStmt=*/true,
1355 numLoopChildren(CollapsedNum, OMPD_taskloop_simd), CollapsedNum);
1356}
1357
1358OMPMasterTaskLoopDirective *OMPMasterTaskLoopDirective::Create(
1359 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1360 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1361 const HelperExprs &Exprs, bool HasCancel) {
1362 auto *Dir = createDirective<OMPMasterTaskLoopDirective>(
1363 C, Clauses, AssociatedStmt,
1364 numLoopChildren(CollapsedNum, OMPD_master_taskloop), StartLoc, EndLoc,
1365 CollapsedNum);
1366 Dir->setHelperExprs(Exprs);
1367 Dir->setHasCancel(HasCancel);
1368 return Dir;
1369}
1370
1373 unsigned NumClauses,
1374 unsigned CollapsedNum, EmptyShell) {
1375 return createEmptyDirective<OMPMasterTaskLoopDirective>(
1376 C, NumClauses, /*HasAssociatedStmt=*/true,
1377 numLoopChildren(CollapsedNum, OMPD_master_taskloop), CollapsedNum);
1378}
1379
1380OMPMaskedTaskLoopDirective *OMPMaskedTaskLoopDirective::Create(
1381 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1382 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1383 const HelperExprs &Exprs, bool HasCancel) {
1384 auto *Dir = createDirective<OMPMaskedTaskLoopDirective>(
1385 C, Clauses, AssociatedStmt,
1386 numLoopChildren(CollapsedNum, OMPD_masked_taskloop), StartLoc, EndLoc,
1387 CollapsedNum);
1388 Dir->setHelperExprs(Exprs);
1389 Dir->setHasCancel(HasCancel);
1390 return Dir;
1391}
1392
1395 unsigned NumClauses,
1396 unsigned CollapsedNum, EmptyShell) {
1397 return createEmptyDirective<OMPMaskedTaskLoopDirective>(
1398 C, NumClauses, /*HasAssociatedStmt=*/true,
1399 numLoopChildren(CollapsedNum, OMPD_masked_taskloop), CollapsedNum);
1400}
1401
1402OMPMasterTaskLoopSimdDirective *OMPMasterTaskLoopSimdDirective::Create(
1403 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1404 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1405 const HelperExprs &Exprs) {
1406 auto *Dir = createDirective<OMPMasterTaskLoopSimdDirective>(
1407 C, Clauses, AssociatedStmt,
1408 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), StartLoc,
1409 EndLoc, CollapsedNum);
1410 Dir->setHelperExprs(Exprs);
1411 return Dir;
1412}
1413
1416 unsigned NumClauses,
1417 unsigned CollapsedNum, EmptyShell) {
1418 return createEmptyDirective<OMPMasterTaskLoopSimdDirective>(
1419 C, NumClauses, /*HasAssociatedStmt=*/true,
1420 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), CollapsedNum);
1421}
1422
1423OMPMaskedTaskLoopSimdDirective *OMPMaskedTaskLoopSimdDirective::Create(
1424 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1425 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1426 const HelperExprs &Exprs) {
1427 auto *Dir = createDirective<OMPMaskedTaskLoopSimdDirective>(
1428 C, Clauses, AssociatedStmt,
1429 numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), StartLoc,
1430 EndLoc, CollapsedNum);
1431 Dir->setHelperExprs(Exprs);
1432 return Dir;
1433}
1434
1437 unsigned NumClauses,
1438 unsigned CollapsedNum, EmptyShell) {
1439 return createEmptyDirective<OMPMaskedTaskLoopSimdDirective>(
1440 C, NumClauses, /*HasAssociatedStmt=*/true,
1441 numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), CollapsedNum);
1442}
1443
1444OMPParallelMasterTaskLoopDirective *OMPParallelMasterTaskLoopDirective::Create(
1445 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1446 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1447 const HelperExprs &Exprs, bool HasCancel) {
1448 auto *Dir = createDirective<OMPParallelMasterTaskLoopDirective>(
1449 C, Clauses, AssociatedStmt,
1450 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop), StartLoc,
1451 EndLoc, CollapsedNum);
1452 Dir->setHelperExprs(Exprs);
1453 Dir->setHasCancel(HasCancel);
1454 return Dir;
1455}
1456
1459 unsigned NumClauses,
1460 unsigned CollapsedNum,
1461 EmptyShell) {
1462 return createEmptyDirective<OMPParallelMasterTaskLoopDirective>(
1463 C, NumClauses, /*HasAssociatedStmt=*/true,
1464 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop),
1465 CollapsedNum);
1466}
1467
1468OMPParallelMaskedTaskLoopDirective *OMPParallelMaskedTaskLoopDirective::Create(
1469 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1470 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1471 const HelperExprs &Exprs, bool HasCancel) {
1472 auto *Dir = createDirective<OMPParallelMaskedTaskLoopDirective>(
1473 C, Clauses, AssociatedStmt,
1474 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop), StartLoc,
1475 EndLoc, CollapsedNum);
1476 Dir->setHelperExprs(Exprs);
1477 Dir->setHasCancel(HasCancel);
1478 return Dir;
1479}
1480
1483 unsigned NumClauses,
1484 unsigned CollapsedNum,
1485 EmptyShell) {
1486 return createEmptyDirective<OMPParallelMaskedTaskLoopDirective>(
1487 C, NumClauses, /*HasAssociatedStmt=*/true,
1488 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop),
1489 CollapsedNum);
1490}
1491
1494 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1495 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1496 const HelperExprs &Exprs) {
1497 auto *Dir = createDirective<OMPParallelMasterTaskLoopSimdDirective>(
1498 C, Clauses, AssociatedStmt,
1499 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),
1500 StartLoc, EndLoc, CollapsedNum);
1501 Dir->setHelperExprs(Exprs);
1502 return Dir;
1503}
1504
1507 unsigned NumClauses,
1508 unsigned CollapsedNum,
1509 EmptyShell) {
1510 return createEmptyDirective<OMPParallelMasterTaskLoopSimdDirective>(
1511 C, NumClauses, /*HasAssociatedStmt=*/true,
1512 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),
1513 CollapsedNum);
1514}
1515
1518 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1519 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1520 const HelperExprs &Exprs) {
1521 auto *Dir = createDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1522 C, Clauses, AssociatedStmt,
1523 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd),
1524 StartLoc, EndLoc, CollapsedNum);
1525 Dir->setHelperExprs(Exprs);
1526 return Dir;
1527}
1528
1531 unsigned NumClauses,
1532 unsigned CollapsedNum,
1533 EmptyShell) {
1534 return createEmptyDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1535 C, NumClauses, /*HasAssociatedStmt=*/true,
1536 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd),
1537 CollapsedNum);
1538}
1539
1542 SourceLocation EndLoc, unsigned CollapsedNum,
1543 ArrayRef<OMPClause *> Clauses,
1544 Stmt *AssociatedStmt, const HelperExprs &Exprs) {
1545 auto *Dir = createDirective<OMPDistributeDirective>(
1546 C, Clauses, AssociatedStmt,
1547 numLoopChildren(CollapsedNum, OMPD_distribute), StartLoc, EndLoc,
1548 CollapsedNum);
1549 Dir->setHelperExprs(Exprs);
1550 return Dir;
1551}
1552
1555 unsigned CollapsedNum, EmptyShell) {
1556 return createEmptyDirective<OMPDistributeDirective>(
1557 C, NumClauses, /*HasAssociatedStmt=*/true,
1558 numLoopChildren(CollapsedNum, OMPD_distribute), CollapsedNum);
1559}
1560
1561OMPTargetUpdateDirective *OMPTargetUpdateDirective::Create(
1562 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1563 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1564 return createDirective<OMPTargetUpdateDirective>(C, Clauses, AssociatedStmt,
1565 /*NumChildren=*/0, StartLoc,
1566 EndLoc);
1567}
1568
1571 EmptyShell) {
1572 return createEmptyDirective<OMPTargetUpdateDirective>(
1573 C, NumClauses, /*HasAssociatedStmt=*/true);
1574}
1575
1576OMPDistributeParallelForDirective *OMPDistributeParallelForDirective::Create(
1577 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1578 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1579 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1580 auto *Dir = createDirective<OMPDistributeParallelForDirective>(
1581 C, Clauses, AssociatedStmt,
1582 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1, StartLoc,
1583 EndLoc, CollapsedNum);
1584 Dir->setHelperExprs(Exprs);
1585 Dir->setTaskReductionRefExpr(TaskRedRef);
1586 Dir->HasCancel = HasCancel;
1587 return Dir;
1588}
1589
1592 unsigned NumClauses,
1593 unsigned CollapsedNum,
1594 EmptyShell) {
1595 return createEmptyDirective<OMPDistributeParallelForDirective>(
1596 C, NumClauses, /*HasAssociatedStmt=*/true,
1597 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1,
1598 CollapsedNum);
1599}
1600
1603 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1604 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1605 const HelperExprs &Exprs) {
1606 auto *Dir = createDirective<OMPDistributeParallelForSimdDirective>(
1607 C, Clauses, AssociatedStmt,
1608 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),
1609 StartLoc, EndLoc, CollapsedNum);
1610 Dir->setHelperExprs(Exprs);
1611 return Dir;
1612}
1613
1616 unsigned NumClauses,
1617 unsigned CollapsedNum,
1618 EmptyShell) {
1619 return createEmptyDirective<OMPDistributeParallelForSimdDirective>(
1620 C, NumClauses, /*HasAssociatedStmt=*/true,
1621 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),
1622 CollapsedNum);
1623}
1624
1625OMPDistributeSimdDirective *OMPDistributeSimdDirective::Create(
1626 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1627 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1628 const HelperExprs &Exprs) {
1629 auto *Dir = createDirective<OMPDistributeSimdDirective>(
1630 C, Clauses, AssociatedStmt,
1631 numLoopChildren(CollapsedNum, OMPD_distribute_simd), StartLoc, EndLoc,
1632 CollapsedNum);
1633 Dir->setHelperExprs(Exprs);
1634 return Dir;
1635}
1636
1639 unsigned NumClauses,
1640 unsigned CollapsedNum, EmptyShell) {
1641 return createEmptyDirective<OMPDistributeSimdDirective>(
1642 C, NumClauses, /*HasAssociatedStmt=*/true,
1643 numLoopChildren(CollapsedNum, OMPD_distribute_simd), CollapsedNum);
1644}
1645
1646OMPTargetParallelForSimdDirective *OMPTargetParallelForSimdDirective::Create(
1647 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1648 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1649 const HelperExprs &Exprs) {
1650 auto *Dir = createDirective<OMPTargetParallelForSimdDirective>(
1651 C, Clauses, AssociatedStmt,
1652 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd), StartLoc,
1653 EndLoc, CollapsedNum);
1654 Dir->setHelperExprs(Exprs);
1655 return Dir;
1656}
1657
1660 unsigned NumClauses,
1661 unsigned CollapsedNum,
1662 EmptyShell) {
1663 return createEmptyDirective<OMPTargetParallelForSimdDirective>(
1664 C, NumClauses, /*HasAssociatedStmt=*/true,
1665 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd),
1666 CollapsedNum);
1667}
1668
1671 SourceLocation EndLoc, unsigned CollapsedNum,
1672 ArrayRef<OMPClause *> Clauses,
1673 Stmt *AssociatedStmt, const HelperExprs &Exprs) {
1674 auto *Dir = createDirective<OMPTargetSimdDirective>(
1675 C, Clauses, AssociatedStmt,
1676 numLoopChildren(CollapsedNum, OMPD_target_simd), StartLoc, EndLoc,
1677 CollapsedNum);
1678 Dir->setHelperExprs(Exprs);
1679 return Dir;
1680}
1681
1684 unsigned CollapsedNum, EmptyShell) {
1685 return createEmptyDirective<OMPTargetSimdDirective>(
1686 C, NumClauses, /*HasAssociatedStmt=*/true,
1687 numLoopChildren(CollapsedNum, OMPD_target_simd), CollapsedNum);
1688}
1689
1690OMPTeamsDistributeDirective *OMPTeamsDistributeDirective::Create(
1691 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1692 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1693 const HelperExprs &Exprs) {
1694 auto *Dir = createDirective<OMPTeamsDistributeDirective>(
1695 C, Clauses, AssociatedStmt,
1696 numLoopChildren(CollapsedNum, OMPD_teams_distribute), StartLoc, EndLoc,
1697 CollapsedNum);
1698 Dir->setHelperExprs(Exprs);
1699 return Dir;
1700}
1701
1704 unsigned NumClauses,
1705 unsigned CollapsedNum, EmptyShell) {
1706 return createEmptyDirective<OMPTeamsDistributeDirective>(
1707 C, NumClauses, /*HasAssociatedStmt=*/true,
1708 numLoopChildren(CollapsedNum, OMPD_teams_distribute), CollapsedNum);
1709}
1710
1711OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::Create(
1712 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1713 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1714 const HelperExprs &Exprs) {
1715 auto *Dir = createDirective<OMPTeamsDistributeSimdDirective>(
1716 C, Clauses, AssociatedStmt,
1717 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), StartLoc,
1718 EndLoc, CollapsedNum);
1719 Dir->setHelperExprs(Exprs);
1720 return Dir;
1721}
1722
1723OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::CreateEmpty(
1724 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1725 EmptyShell) {
1726 return createEmptyDirective<OMPTeamsDistributeSimdDirective>(
1727 C, NumClauses, /*HasAssociatedStmt=*/true,
1728 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), CollapsedNum);
1729}
1730
1733 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1734 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1735 const HelperExprs &Exprs) {
1736 auto *Dir = createDirective<OMPTeamsDistributeParallelForSimdDirective>(
1737 C, Clauses, AssociatedStmt,
1738 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
1739 StartLoc, EndLoc, CollapsedNum);
1740 Dir->setHelperExprs(Exprs);
1741 return Dir;
1742}
1743
1746 unsigned NumClauses,
1747 unsigned CollapsedNum,
1748 EmptyShell) {
1749 return createEmptyDirective<OMPTeamsDistributeParallelForSimdDirective>(
1750 C, NumClauses, /*HasAssociatedStmt=*/true,
1751 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
1752 CollapsedNum);
1753}
1754
1757 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1758 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1759 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1760 auto *Dir = createDirective<OMPTeamsDistributeParallelForDirective>(
1761 C, Clauses, AssociatedStmt,
1762 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
1763 StartLoc, EndLoc, CollapsedNum);
1764 Dir->setHelperExprs(Exprs);
1765 Dir->setTaskReductionRefExpr(TaskRedRef);
1766 Dir->HasCancel = HasCancel;
1767 return Dir;
1768}
1769
1772 unsigned NumClauses,
1773 unsigned CollapsedNum,
1774 EmptyShell) {
1775 return createEmptyDirective<OMPTeamsDistributeParallelForDirective>(
1776 C, NumClauses, /*HasAssociatedStmt=*/true,
1777 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
1778 CollapsedNum);
1779}
1780
1781OMPTargetTeamsDirective *OMPTargetTeamsDirective::Create(
1782 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1783 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1784 return createDirective<OMPTargetTeamsDirective>(C, Clauses, AssociatedStmt,
1785 /*NumChildren=*/0, StartLoc,
1786 EndLoc);
1787}
1788
1791 EmptyShell) {
1792 return createEmptyDirective<OMPTargetTeamsDirective>(
1793 C, NumClauses, /*HasAssociatedStmt=*/true);
1794}
1795
1796OMPTargetTeamsDistributeDirective *OMPTargetTeamsDistributeDirective::Create(
1797 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1798 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1799 const HelperExprs &Exprs) {
1800 auto *Dir = createDirective<OMPTargetTeamsDistributeDirective>(
1801 C, Clauses, AssociatedStmt,
1802 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute), StartLoc,
1803 EndLoc, CollapsedNum);
1804 Dir->setHelperExprs(Exprs);
1805 return Dir;
1806}
1807
1810 unsigned NumClauses,
1811 unsigned CollapsedNum,
1812 EmptyShell) {
1813 return createEmptyDirective<OMPTargetTeamsDistributeDirective>(
1814 C, NumClauses, /*HasAssociatedStmt=*/true,
1815 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute),
1816 CollapsedNum);
1817}
1818
1821 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1822 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1823 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
1824 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForDirective>(
1825 C, Clauses, AssociatedStmt,
1826 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
1827 1,
1828 StartLoc, EndLoc, CollapsedNum);
1829 Dir->setHelperExprs(Exprs);
1830 Dir->setTaskReductionRefExpr(TaskRedRef);
1831 Dir->HasCancel = HasCancel;
1832 return Dir;
1833}
1834
1837 unsigned NumClauses,
1838 unsigned CollapsedNum,
1839 EmptyShell) {
1840 return createEmptyDirective<OMPTargetTeamsDistributeParallelForDirective>(
1841 C, NumClauses, /*HasAssociatedStmt=*/true,
1842 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
1843 1,
1844 CollapsedNum);
1845}
1846
1849 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1850 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1851 const HelperExprs &Exprs) {
1852 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
1853 C, Clauses, AssociatedStmt,
1854 numLoopChildren(CollapsedNum,
1855 OMPD_target_teams_distribute_parallel_for_simd),
1856 StartLoc, EndLoc, CollapsedNum);
1857 Dir->setHelperExprs(Exprs);
1858 return Dir;
1859}
1860
1863 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1864 EmptyShell) {
1865 return createEmptyDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
1866 C, NumClauses, /*HasAssociatedStmt=*/true,
1867 numLoopChildren(CollapsedNum,
1868 OMPD_target_teams_distribute_parallel_for_simd),
1869 CollapsedNum);
1870}
1871
1874 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1875 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1876 const HelperExprs &Exprs) {
1877 auto *Dir = createDirective<OMPTargetTeamsDistributeSimdDirective>(
1878 C, Clauses, AssociatedStmt,
1879 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),
1880 StartLoc, EndLoc, CollapsedNum);
1881 Dir->setHelperExprs(Exprs);
1882 return Dir;
1883}
1884
1887 unsigned NumClauses,
1888 unsigned CollapsedNum,
1889 EmptyShell) {
1890 return createEmptyDirective<OMPTargetTeamsDistributeSimdDirective>(
1891 C, NumClauses, /*HasAssociatedStmt=*/true,
1892 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),
1893 CollapsedNum);
1894}
1895
1898 SourceLocation EndLoc,
1899 ArrayRef<OMPClause *> Clauses) {
1900 return createDirective<OMPInteropDirective>(
1901 C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc,
1902 EndLoc);
1903}
1904
1906 unsigned NumClauses,
1907 EmptyShell) {
1908 return createEmptyDirective<OMPInteropDirective>(C, NumClauses);
1909}
1910
1911OMPDispatchDirective *OMPDispatchDirective::Create(
1912 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1913 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1914 SourceLocation TargetCallLoc) {
1915 auto *Dir = createDirective<OMPDispatchDirective>(
1916 C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc);
1917 Dir->setTargetCallLoc(TargetCallLoc);
1918 return Dir;
1919}
1920
1922 unsigned NumClauses,
1923 EmptyShell) {
1924 return createEmptyDirective<OMPDispatchDirective>(C, NumClauses,
1925 /*HasAssociatedStmt=*/true,
1926 /*NumChildren=*/0);
1927}
1928
1929OMPMaskedDirective *OMPMaskedDirective::Create(const ASTContext &C,
1930 SourceLocation StartLoc,
1931 SourceLocation EndLoc,
1932 ArrayRef<OMPClause *> Clauses,
1933 Stmt *AssociatedStmt) {
1934 return createDirective<OMPMaskedDirective>(C, Clauses, AssociatedStmt,
1935 /*NumChildren=*/0, StartLoc,
1936 EndLoc);
1937}
1938
1940 unsigned NumClauses,
1941 EmptyShell) {
1942 return createEmptyDirective<OMPMaskedDirective>(C, NumClauses,
1943 /*HasAssociatedStmt=*/true);
1944}
1945
1946OMPGenericLoopDirective *OMPGenericLoopDirective::Create(
1947 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1948 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1949 const HelperExprs &Exprs) {
1950 auto *Dir = createDirective<OMPGenericLoopDirective>(
1951 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_loop),
1952 StartLoc, EndLoc, CollapsedNum);
1953 Dir->setHelperExprs(Exprs);
1954 return Dir;
1955}
1956
1959 unsigned CollapsedNum, EmptyShell) {
1960 return createEmptyDirective<OMPGenericLoopDirective>(
1961 C, NumClauses, /*HasAssociatedStmt=*/true,
1962 numLoopChildren(CollapsedNum, OMPD_loop), CollapsedNum);
1963}
1964
1965OMPTeamsGenericLoopDirective *OMPTeamsGenericLoopDirective::Create(
1966 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1967 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1968 const HelperExprs &Exprs) {
1969 auto *Dir = createDirective<OMPTeamsGenericLoopDirective>(
1970 C, Clauses, AssociatedStmt,
1971 numLoopChildren(CollapsedNum, OMPD_teams_loop), StartLoc, EndLoc,
1972 CollapsedNum);
1973 Dir->setHelperExprs(Exprs);
1974 return Dir;
1975}
1976
1979 unsigned NumClauses,
1980 unsigned CollapsedNum, EmptyShell) {
1981 return createEmptyDirective<OMPTeamsGenericLoopDirective>(
1982 C, NumClauses, /*HasAssociatedStmt=*/true,
1983 numLoopChildren(CollapsedNum, OMPD_teams_loop), CollapsedNum);
1984}
1985
1986OMPTargetTeamsGenericLoopDirective *OMPTargetTeamsGenericLoopDirective::Create(
1987 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1988 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1989 const HelperExprs &Exprs, bool CanBeParallelFor) {
1990 auto *Dir = createDirective<OMPTargetTeamsGenericLoopDirective>(
1991 C, Clauses, AssociatedStmt,
1992 numLoopChildren(CollapsedNum, OMPD_target_teams_loop), StartLoc, EndLoc,
1993 CollapsedNum);
1994 Dir->setHelperExprs(Exprs);
1995 Dir->setCanBeParallelFor(CanBeParallelFor);
1996 return Dir;
1997}
1998
2001 unsigned NumClauses,
2002 unsigned CollapsedNum,
2003 EmptyShell) {
2004 return createEmptyDirective<OMPTargetTeamsGenericLoopDirective>(
2005 C, NumClauses, /*HasAssociatedStmt=*/true,
2006 numLoopChildren(CollapsedNum, OMPD_target_teams_loop), CollapsedNum);
2007}
2008
2009OMPParallelGenericLoopDirective *OMPParallelGenericLoopDirective::Create(
2010 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2011 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2012 const HelperExprs &Exprs) {
2013 auto *Dir = createDirective<OMPParallelGenericLoopDirective>(
2014 C, Clauses, AssociatedStmt,
2015 numLoopChildren(CollapsedNum, OMPD_parallel_loop), StartLoc, EndLoc,
2016 CollapsedNum);
2017 Dir->setHelperExprs(Exprs);
2018 return Dir;
2019}
2020
2021OMPParallelGenericLoopDirective *OMPParallelGenericLoopDirective::CreateEmpty(
2022 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
2023 EmptyShell) {
2024 return createEmptyDirective<OMPParallelGenericLoopDirective>(
2025 C, NumClauses, /*HasAssociatedStmt=*/true,
2026 numLoopChildren(CollapsedNum, OMPD_parallel_loop), CollapsedNum);
2027}
2028
2031 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2032 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2033 const HelperExprs &Exprs) {
2034 auto *Dir = createDirective<OMPTargetParallelGenericLoopDirective>(
2035 C, Clauses, AssociatedStmt,
2036 numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), StartLoc,
2037 EndLoc, CollapsedNum);
2038 Dir->setHelperExprs(Exprs);
2039 return Dir;
2040}
2041
2044 unsigned NumClauses,
2045 unsigned CollapsedNum,
2046 EmptyShell) {
2047 return createEmptyDirective<OMPTargetParallelGenericLoopDirective>(
2048 C, NumClauses, /*HasAssociatedStmt=*/true,
2049 numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), CollapsedNum);
2050}
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 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...