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