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