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