19using namespace llvm::omp;
22const OMPInvariantPredicateBoundAttr *
23OMPLoopBasedDirective::getIntraTileHint(
const Stmt *S) {
24 if (
const auto *AS = dyn_cast_or_null<AttributedStmt>(S))
30Stmt *OMPLoopBasedDirective::ignoreIntraTileHint(
Stmt *S) {
31 if (
auto *AS = dyn_cast_or_null<AttributedStmt>(S))
33 return AS->getSubStmt();
38 auto *CS = dyn_cast_or_null<CompoundStmt>(Body);
39 if (!CS || CS->size() < 2)
41 return ArrayRef(CS->body_begin(), CS->size() - 1);
50 if (
auto *AS = dyn_cast_or_null<AttributedStmt>(S)) {
56 if (
auto *CS = dyn_cast_or_null<CompoundStmt>(S)) {
67size_t OMPChildren::size(
unsigned NumClauses,
bool HasAssociatedStmt,
68 unsigned NumChildren) {
70 totalSizeToAlloc<OMPClause *, Stmt *>(
71 NumClauses, NumChildren + (HasAssociatedStmt ? 1 : 0)),
72 alignof(OMPChildren));
76 assert(Clauses.size() == NumClauses &&
77 "Number of clauses is not the same as the preallocated buffer");
78 llvm::copy(Clauses, getTrailingObjects<OMPClause *>());
82 return getTrailingObjects<Stmt *>(NumChildren);
87 Data->setClauses(Clauses);
92 Stmt *S,
unsigned NumChildren) {
93 auto *
Data = CreateEmpty(Mem, Clauses.size(), S, NumChildren);
94 Data->setClauses(Clauses);
96 Data->setAssociatedStmt(S);
100OMPChildren *OMPChildren::CreateEmpty(
void *Mem,
unsigned NumClauses,
101 bool HasAssociatedStmt,
102 unsigned NumChildren) {
103 return new (Mem) OMPChildren(NumClauses, NumChildren, HasAssociatedStmt);
106bool OMPExecutableDirective::isStandaloneDirective()
const {
114 return !hasAssociatedStmt();
117Stmt *OMPExecutableDirective::getStructuredBlock() {
118 assert(!isStandaloneDirective() &&
119 "Standalone Executable Directives don't have Structured Blocks.");
120 if (
auto *LD = dyn_cast<OMPLoopDirective>(
this))
121 return LD->getBody();
126OMPLoopBasedDirective::tryToFindNextInnerLoop(
Stmt *CurStmt,
127 bool TryImperfectlyNestedLoops) {
128 Stmt *OrigStmt = CurStmt;
131 if (TryImperfectlyNestedLoops) {
132 if (
auto *CS = dyn_cast<CompoundStmt>(CurStmt)) {
134 SmallVector<CompoundStmt *, 4> Statements(1, CS);
135 SmallVector<CompoundStmt *, 4> NextStatements;
136 while (!Statements.empty()) {
137 CS = Statements.pop_back_val();
140 for (Stmt *S : CS->body()) {
150 if (
auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Inner))
151 Inner = CanonLoop->getLoopStmt();
152 Inner = OMPLoopBasedDirective::ignoreIntraTileHint(Inner);
164 S = OMPLoopBasedDirective::ignoreIntraTileHint(S);
165 if (
auto *InnerCS = dyn_cast_or_null<CompoundStmt>(S))
166 NextStatements.push_back(InnerCS);
168 if (Statements.empty()) {
172 Statements.swap(NextStatements);
182bool OMPLoopBasedDirective::doForAllLoops(
183 Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
184 llvm::function_ref<
bool(
unsigned,
Stmt *,
Stmt *)> Callback,
189 for (
unsigned Cnt = 0; Cnt < NumLoops; ++Cnt) {
194 bool PeeledTransformation =
false;
196 auto *Dir = dyn_cast<OMPLoopTransformationDirective>(CurStmt);
202 Stmt *TransformedStmt = Dir->getTransformedStmt();
203 if (!TransformedStmt) {
204 unsigned NumGeneratedTopLevelLoops =
205 Dir->getNumGeneratedTopLevelLoops();
206 if (NumGeneratedTopLevelLoops == 0) {
211 if (NumGeneratedTopLevelLoops > 0) {
219 CurStmt = TransformedStmt;
220 PeeledTransformation =
true;
222 if (
auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(CurStmt))
223 CurStmt = CanonLoop->getLoopStmt();
226 Stmt *LoopStmt = ignoreIntraTileHint(CurStmt);
227 Stmt *HintWrapper = LoopStmt != CurStmt ? CurStmt :
nullptr;
228 if (
Callback(Cnt, LoopStmt, HintWrapper))
235 if (
auto *For = dyn_cast<ForStmt>(LoopStmt)) {
236 CurStmt = For->getBody();
239 "Expected canonical for or range-based for loops.");
243 !getStmtsBeforeNestedLoop(CurStmt).empty())
245 CurStmt = OMPLoopBasedDirective::tryToFindNextInnerLoop(
246 CurStmt, TryImperfectlyNestedLoops);
251void OMPLoopBasedDirective::doForAllLoopsBodies(
252 Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
253 llvm::function_ref<
void(
unsigned,
Stmt *,
Stmt *)> Callback) {
254 bool Res = OMPLoopBasedDirective::doForAllLoops(
255 CurStmt, TryImperfectlyNestedLoops, NumLoops,
257 Stmt *Body =
nullptr;
258 if (
auto *For = dyn_cast<ForStmt>(
Loop)) {
259 Body = For->getBody();
262 "Expected canonical for or range-based for loops.");
265 if (
auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Body))
266 Body = CanonLoop->getLoopStmt();
270 assert(Res &&
"Expected only loops");
276 Stmt *Body =
nullptr;
277 OMPLoopBasedDirective::doForAllLoopsBodies(
278 Data->getRawStmt(),
true,
280 [&Body](
unsigned,
Stmt *,
Stmt *BodyStmt) { Body = BodyStmt; });
285 assert(A.size() == getLoopsNumber() &&
286 "Number of loop counters is not the same as the collapsed number");
287 llvm::copy(A, getCounters().begin());
291 assert(A.size() == getLoopsNumber() &&
"Number of loop private counters "
292 "is not the same as the collapsed "
294 llvm::copy(A, getPrivateCounters().begin());
298 assert(A.size() == getLoopsNumber() &&
299 "Number of counter inits is not the same as the collapsed number");
304 assert(A.size() == getLoopsNumber() &&
305 "Number of counter updates is not the same as the collapsed number");
310 assert(A.size() == getLoopsNumber() &&
311 "Number of counter finals is not the same as the collapsed number");
317 A.size() == getLoopsNumber() &&
318 "Number of dependent counters is not the same as the collapsed number");
319 llvm::copy(A, getDependentCounters().begin());
323 assert(A.size() == getLoopsNumber() &&
324 "Number of dependent inits is not the same as the collapsed number");
325 llvm::copy(A, getDependentInits().begin());
329 assert(A.size() == getLoopsNumber() &&
330 "Number of finals conditions is not the same as the collapsed number");
331 llvm::copy(A, getFinalsConditions().begin());
354 if (ArraysOffset == DefaultEnd)
365 if (ArraysOffset == WorksharingEnd)
383 unsigned NumVariants,
390 auto *
Data = OMPChildren::CreateEmpty(
392 false, 2 * NumVariants);
402 assert(Variants.size() == Conditions.size() &&
403 Variants.size() == TraitInfos.size() &&
404 "Expected one condition and one trait info per variant");
405 OMPMetaDirective *Dir = allocate(
C, Variants.size(), StartLoc, EndLoc);
406 llvm::copy(Variants, Dir->getTrailingVariants().begin());
407 llvm::copy(Conditions, Dir->getTrailingConditions().begin());
408 llvm::copy(TraitInfos, Dir->getTrailingTraitInfos().begin());
409 Dir->setHasImplicitOtherwise(HasImplicitOtherwise);
414 unsigned NumVariants,
419OMPParallelDirective *OMPParallelDirective::Create(
423 auto *Dir = createDirective<OMPParallelDirective>(
424 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
425 Dir->setTaskReductionRefExpr(TaskRedRef);
426 Dir->setHasCancel(HasCancel);
430OMPParallelDirective *OMPParallelDirective::CreateEmpty(
const ASTContext &
C,
433 return createEmptyDirective<OMPParallelDirective>(
C, NumClauses,
442 const HelperExprs &Exprs) {
443 auto *Dir = createDirective<OMPSimdDirective>(
445 StartLoc, EndLoc, CollapsedNum);
446 Dir->setHelperExprs(Exprs);
452 unsigned CollapsedNum,
454 return createEmptyDirective<OMPSimdDirective>(
462 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
463 auto *Dir = createDirective<OMPForDirective>(
465 StartLoc, EndLoc, CollapsedNum);
466 Dir->setHelperExprs(Exprs);
467 Dir->setTaskReductionRefExpr(TaskRedRef);
468 Dir->setHasCancel(HasCancel);
473 if (
auto *D = dyn_cast<OMPCanonicalLoopNestTransformationDirective>(S))
474 return D->getTransformedStmt();
475 if (
auto *D = dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S))
476 return D->getTransformedStmt();
477 llvm_unreachable(
"unexpected object type");
481 if (
auto *D = dyn_cast<OMPCanonicalLoopNestTransformationDirective>(S))
482 return D->getPreInits();
483 if (
auto *D = dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S))
484 return D->getPreInits();
485 llvm_unreachable(
"unexpected object type");
489 if (
auto *D = dyn_cast<OMPCanonicalLoopNestTransformationDirective>(S))
490 return D->getFinals();
491 if (
auto *D = dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S))
492 return D->getFinals();
493 llvm_unreachable(
"unexpected object type");
497 switch (getStmtClass()) {
498#define STMT(CLASS, PARENT)
499#define ABSTRACT_STMT(CLASS)
500#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
501 case Stmt::CLASS##Class: \
502 return static_cast<const CLASS *>(this)->getTransformedStmt();
503#include "clang/AST/StmtNodes.inc"
505 llvm_unreachable(
"Not a loop transformation for canonical loop nests");
510 switch (getStmtClass()) {
511#define STMT(CLASS, PARENT)
512#define ABSTRACT_STMT(CLASS)
513#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
514 case Stmt::CLASS##Class: \
515 return static_cast<const CLASS *>(this)->getPreInits();
516#include "clang/AST/StmtNodes.inc"
518 llvm_unreachable(
"Not a loop transformation for canonical loop nests");
523 switch (getStmtClass()) {
524#define STMT(CLASS, PARENT)
525#define ABSTRACT_STMT(CLASS)
526#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
527 case Stmt::CLASS##Class: \
528 return static_cast<const CLASS *>(this)->getFinals();
529#include "clang/AST/StmtNodes.inc"
531 llvm_unreachable(
"Not a loop transformation for canonical loop nests");
537 switch (getStmtClass()) {
538#define STMT(CLASS, PARENT)
539#define ABSTRACT_STMT(CLASS)
540#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
541 case Stmt::CLASS##Class: \
542 return static_cast<const CLASS *>(this)->getTransformedStmt();
543#include "clang/AST/StmtNodes.inc"
545 llvm_unreachable(
"Not a loop transformation for canonical loop sequences");
550 switch (getStmtClass()) {
551#define STMT(CLASS, PARENT)
552#define ABSTRACT_STMT(CLASS)
553#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
554 case Stmt::CLASS##Class: \
555 return static_cast<const CLASS *>(this)->getPreInits();
556#include "clang/AST/StmtNodes.inc"
558 llvm_unreachable(
"Not a loop transformation for canonical loop sequences");
563 switch (getStmtClass()) {
564#define STMT(CLASS, PARENT)
565#define ABSTRACT_STMT(CLASS)
566#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
567 case Stmt::CLASS##Class: \
568 return static_cast<const CLASS *>(this)->getFinals();
569#include "clang/AST/StmtNodes.inc"
571 llvm_unreachable(
"Not a loop transformation for canonical loop sequences");
577 unsigned CollapsedNum,
579 return createEmptyDirective<OMPForDirective>(
587 unsigned NumLoops,
Stmt *AssociatedStmt,
589 OMPTileDirective *Dir = createDirective<OMPTileDirective>(
590 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
591 Dir->setTransformedStmt(TransformedStmt);
592 Dir->setPreInits(PreInits);
593 Dir->setFinals(Finals);
600 return createEmptyDirective<OMPTileDirective>(
601 C, NumClauses,
true, FinalsOffset + 1,
609 OMPStripeDirective *Dir = createDirective<OMPStripeDirective>(
610 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
611 Dir->setTransformedStmt(TransformedStmt);
612 Dir->setPreInits(PreInits);
613 Dir->setFinals(Finals);
620 return createEmptyDirective<OMPStripeDirective>(
621 C, NumClauses,
true, FinalsOffset + 1,
628 unsigned NumGeneratedTopLevelLoops,
Stmt *TransformedStmt,
Stmt *PreInits,
630 assert(NumGeneratedTopLevelLoops <= 1 &&
631 "Unrolling generates at most one loop");
633 auto *Dir = createDirective<OMPUnrollDirective>(
634 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc);
635 Dir->setNumGeneratedTopLevelLoops(NumGeneratedTopLevelLoops);
636 Dir->setTransformedStmt(TransformedStmt);
637 Dir->setPreInits(PreInits);
638 Dir->setFinals(Finals);
643 unsigned NumClauses) {
644 return createEmptyDirective<OMPUnrollDirective>(
645 C, NumClauses,
true, FinalsOffset + 1,
652 unsigned NumLoops,
Stmt *TransformedStmt,
654 OMPReverseDirective *Dir = createDirective<OMPReverseDirective>(
655 C, {}, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
656 Dir->setTransformedStmt(TransformedStmt);
657 Dir->setPreInits(PreInits);
658 Dir->setFinals(Finals);
664 return createEmptyDirective<OMPReverseDirective>(
665 C, 0,
true, FinalsOffset + 1,
673 OMPInterchangeDirective *Dir = createDirective<OMPInterchangeDirective>(
674 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
675 Dir->setTransformedStmt(TransformedStmt);
676 Dir->setPreInits(PreInits);
677 Dir->setFinals(Finals);
684 return createEmptyDirective<OMPInterchangeDirective>(
685 C, NumClauses,
true, FinalsOffset + 1,
693 OMPFlattenDirective *Dir = createDirective<OMPFlattenDirective>(
694 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
695 Dir->setTransformedStmt(TransformedStmt);
696 Dir->setPreInits(PreInits);
697 Dir->setFinals(Finals);
704 return createEmptyDirective<OMPFlattenDirective>(
705 C, NumClauses,
true, FinalsOffset + 1,
712 unsigned NumLoops,
Stmt *AssociatedStmt,
714 OMPSplitDirective *Dir = createDirective<OMPSplitDirective>(
715 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
716 Dir->setTransformedStmt(TransformedStmt);
717 Dir->setPreInits(PreInits);
718 Dir->setFinals(Finals);
725 return createEmptyDirective<OMPSplitDirective>(
726 C, NumClauses,
true, FinalsOffset + 1,
733 Stmt *AssociatedStmt,
Stmt *TransformedStmt,
Stmt *PreInits,
Stmt *Finals) {
735 OMPFuseDirective *Dir = createDirective<OMPFuseDirective>(
736 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc);
737 Dir->setTransformedStmt(TransformedStmt);
738 Dir->setPreInits(PreInits);
739 Dir->setFinals(Finals);
745 unsigned NumClauses) {
746 OMPFuseDirective *Dir = createEmptyDirective<OMPFuseDirective>(
747 C, NumClauses,
true, FinalsOffset + 1,
756 const HelperExprs &Exprs) {
757 auto *Dir = createDirective<OMPForSimdDirective>(
759 StartLoc, EndLoc, CollapsedNum);
760 Dir->setHelperExprs(Exprs);
766 unsigned CollapsedNum,
768 return createEmptyDirective<OMPForSimdDirective>(
777 auto *Dir = createDirective<OMPSectionsDirective>(
C, Clauses, AssociatedStmt,
780 Dir->setTaskReductionRefExpr(TaskRedRef);
781 Dir->setHasCancel(HasCancel);
788 return createEmptyDirective<OMPSectionsDirective>(
C, NumClauses,
796 Stmt *AssociatedStmt,
799 createDirective<OMPSectionDirective>(
C, {}, AssociatedStmt,
800 0, StartLoc, EndLoc);
807 return createEmptyDirective<OMPSectionDirective>(
C, 0,
815 Stmt *AssociatedStmt) {
816 return createDirective<OMPScopeDirective>(
C, Clauses, AssociatedStmt,
824 return createEmptyDirective<OMPScopeDirective>(
C, NumClauses,
832 Stmt *AssociatedStmt) {
833 return createDirective<OMPSingleDirective>(
C, Clauses, AssociatedStmt,
841 return createEmptyDirective<OMPSingleDirective>(
C, NumClauses,
848 Stmt *AssociatedStmt) {
849 return createDirective<OMPMasterDirective>(
C, {}, AssociatedStmt,
856 return createEmptyDirective<OMPMasterDirective>(
C, 0,
864 return createDirective<OMPCriticalDirective>(
C, Clauses, AssociatedStmt,
872 return createEmptyDirective<OMPCriticalDirective>(
C, NumClauses,
879 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
880 auto *Dir = createDirective<OMPParallelForDirective>(
881 C, Clauses, AssociatedStmt,
882 numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, StartLoc, EndLoc,
884 Dir->setHelperExprs(Exprs);
885 Dir->setTaskReductionRefExpr(TaskRedRef);
886 Dir->setHasCancel(HasCancel);
892 unsigned CollapsedNum, EmptyShell) {
893 return createEmptyDirective<OMPParallelForDirective>(
901 const HelperExprs &Exprs) {
902 auto *Dir = createDirective<OMPParallelForSimdDirective>(
903 C, Clauses, AssociatedStmt,
904 numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), StartLoc, EndLoc,
906 Dir->setHelperExprs(Exprs);
913 unsigned CollapsedNum, EmptyShell) {
914 return createEmptyDirective<OMPParallelForSimdDirective>(
922 auto *Dir = createDirective<OMPParallelMasterDirective>(
923 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
924 Dir->setTaskReductionRefExpr(TaskRedRef);
930 unsigned NumClauses, EmptyShell) {
931 return createEmptyDirective<OMPParallelMasterDirective>(
932 C, NumClauses,
true, 1);
938 auto *Dir = createDirective<OMPParallelMaskedDirective>(
939 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
940 Dir->setTaskReductionRefExpr(TaskRedRef);
946 unsigned NumClauses, EmptyShell) {
947 return createEmptyDirective<OMPParallelMaskedDirective>(
948 C, NumClauses,
true, 1);
955 auto *Dir = createDirective<OMPParallelSectionsDirective>(
956 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
957 Dir->setTaskReductionRefExpr(TaskRedRef);
958 Dir->setHasCancel(HasCancel);
964 unsigned NumClauses, EmptyShell) {
965 return createEmptyDirective<OMPParallelSectionsDirective>(
966 C, NumClauses,
true, 1);
972 Stmt *AssociatedStmt,
bool HasCancel) {
973 auto *Dir = createDirective<OMPTaskDirective>(
974 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
975 Dir->setHasCancel(HasCancel);
982 return createEmptyDirective<OMPTaskDirective>(
C, NumClauses,
989 return new (
C) OMPTaskyieldDirective(StartLoc, EndLoc);
994 return new (
C) OMPTaskyieldDirective();
1002 return createDirective<OMPAssumeDirective>(
C, Clauses, AStmt,
1008 unsigned NumClauses,
1010 return createEmptyDirective<OMPAssumeDirective>(
C, NumClauses,
1018 return createDirective<OMPErrorDirective>(
1019 C, Clauses,
nullptr, 0, StartLoc,
1024 unsigned NumClauses,
1026 return createEmptyDirective<OMPErrorDirective>(
C, NumClauses);
1032 return new (
C) OMPBarrierDirective(StartLoc, EndLoc);
1037 return new (
C) OMPBarrierDirective();
1044 return createDirective<OMPTaskwaitDirective>(
1045 C, Clauses,
nullptr, 0, StartLoc,
1050 unsigned NumClauses,
1052 return createEmptyDirective<OMPTaskwaitDirective>(
C, NumClauses);
1058 auto *Dir = createDirective<OMPTaskgroupDirective>(
1059 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
1060 Dir->setReductionRef(ReductionRef);
1065 unsigned NumClauses,
1067 return createEmptyDirective<OMPTaskgroupDirective>(
1068 C, NumClauses,
true, 1);
1074 auto *Dir =
new (
C) OMPCancellationPointDirective(StartLoc, EndLoc);
1075 Dir->setCancelRegion(CancelRegion);
1081 return new (
C) OMPCancellationPointDirective();
1088 auto *Dir = createDirective<OMPCancelDirective>(
1089 C, Clauses,
nullptr, 0, StartLoc,
1091 Dir->setCancelRegion(CancelRegion);
1096 unsigned NumClauses,
1098 return createEmptyDirective<OMPCancelDirective>(
C, NumClauses);
1105 return createDirective<OMPFlushDirective>(
1106 C, Clauses,
nullptr, 0, StartLoc,
1111 unsigned NumClauses,
1113 return createEmptyDirective<OMPFlushDirective>(
C, NumClauses);
1120 return createDirective<OMPDepobjDirective>(
1121 C, Clauses,
nullptr,
1122 0, StartLoc, EndLoc);
1126 unsigned NumClauses,
1128 return createEmptyDirective<OMPDepobjDirective>(
C, NumClauses);
1135 return createDirective<OMPScanDirective>(
C, Clauses,
1137 0, StartLoc, EndLoc);
1141 unsigned NumClauses,
1143 return createEmptyDirective<OMPScanDirective>(
C, NumClauses);
1149 return createDirective<OMPOrderedStandaloneDirective>(
1150 C, Clauses,
nullptr, 0, StartLoc,
1156 unsigned NumClauses, EmptyShell) {
1157 return createEmptyDirective<OMPOrderedStandaloneDirective>(
C, NumClauses);
1163 return createDirective<OMPOrderedBlockAssocDirective>(
1170 unsigned NumClauses, EmptyShell) {
1171 return createEmptyDirective<OMPOrderedBlockAssocDirective>(
1172 C, NumClauses,
true);
1179 auto *Dir = createDirective<OMPAtomicDirective>(
1180 C, Clauses, AssociatedStmt, 7, StartLoc, EndLoc);
1184 Dir->setExpr(Exprs.
E);
1185 Dir->setUpdateExpr(Exprs.
UE);
1187 Dir->setCond(Exprs.
Cond);
1190 Dir->Flags.IsFailOnly = Exprs.
IsFailOnly ? 1 : 0;
1195 unsigned NumClauses,
1197 return createEmptyDirective<OMPAtomicDirective>(
1198 C, NumClauses,
true, 7);
1205 Stmt *AssociatedStmt) {
1206 return createDirective<OMPTargetDirective>(
1207 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1211 unsigned NumClauses,
1213 return createEmptyDirective<OMPTargetDirective>(
C, NumClauses,
1221 auto *Dir = createDirective<OMPTargetParallelDirective>(
1222 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
1223 Dir->setTaskReductionRefExpr(TaskRedRef);
1224 Dir->setHasCancel(HasCancel);
1230 unsigned NumClauses, EmptyShell) {
1231 return createEmptyDirective<OMPTargetParallelDirective>(
1232 C, NumClauses,
true, 1);
1238 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
1239 auto *Dir = createDirective<OMPTargetParallelForDirective>(
1240 C, Clauses, AssociatedStmt,
1241 numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1, StartLoc,
1242 EndLoc, CollapsedNum);
1243 Dir->setHelperExprs(Exprs);
1244 Dir->setTaskReductionRefExpr(TaskRedRef);
1245 Dir->setHasCancel(HasCancel);
1251 unsigned NumClauses,
1252 unsigned CollapsedNum, EmptyShell) {
1253 return createEmptyDirective<OMPTargetParallelForDirective>(
1254 C, NumClauses,
true,
1262 return createDirective<OMPTargetDataDirective>(
1263 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1269 return createEmptyDirective<OMPTargetDataDirective>(
1276 return createDirective<OMPTargetEnterDataDirective>(
1277 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1283 return createEmptyDirective<OMPTargetEnterDataDirective>(
1290 return createDirective<OMPTargetExitDataDirective>(
1291 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1297 return createEmptyDirective<OMPTargetExitDataDirective>(
1305 Stmt *AssociatedStmt) {
1306 return createDirective<OMPTeamsDirective>(
1307 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1311 unsigned NumClauses,
1313 return createEmptyDirective<OMPTeamsDirective>(
C, NumClauses,
1320 const HelperExprs &Exprs,
bool HasCancel) {
1321 auto *Dir = createDirective<OMPTaskLoopDirective>(
1323 StartLoc, EndLoc, CollapsedNum);
1324 Dir->setHelperExprs(Exprs);
1325 Dir->setHasCancel(HasCancel);
1330 unsigned NumClauses,
1331 unsigned CollapsedNum,
1333 return createEmptyDirective<OMPTaskLoopDirective>(
1334 C, NumClauses,
true,
1341 const HelperExprs &Exprs) {
1342 auto *Dir = createDirective<OMPTaskLoopSimdDirective>(
1343 C, Clauses, AssociatedStmt,
1346 Dir->setHelperExprs(Exprs);
1352 unsigned CollapsedNum, EmptyShell) {
1353 return createEmptyDirective<OMPTaskLoopSimdDirective>(
1354 C, NumClauses,
true,
1361 const HelperExprs &Exprs,
bool HasCancel) {
1362 auto *Dir = createDirective<OMPMasterTaskLoopDirective>(
1363 C, Clauses, AssociatedStmt,
1364 numLoopChildren(CollapsedNum, OMPD_master_taskloop), StartLoc, EndLoc,
1366 Dir->setHelperExprs(Exprs);
1367 Dir->setHasCancel(HasCancel);
1373 unsigned NumClauses,
1374 unsigned CollapsedNum, EmptyShell) {
1375 return createEmptyDirective<OMPMasterTaskLoopDirective>(
1376 C, NumClauses,
true,
1383 const HelperExprs &Exprs,
bool HasCancel) {
1384 auto *Dir = createDirective<OMPMaskedTaskLoopDirective>(
1385 C, Clauses, AssociatedStmt,
1386 numLoopChildren(CollapsedNum, OMPD_masked_taskloop), StartLoc, EndLoc,
1388 Dir->setHelperExprs(Exprs);
1389 Dir->setHasCancel(HasCancel);
1395 unsigned NumClauses,
1396 unsigned CollapsedNum, EmptyShell) {
1397 return createEmptyDirective<OMPMaskedTaskLoopDirective>(
1398 C, NumClauses,
true,
1405 const HelperExprs &Exprs) {
1406 auto *Dir = createDirective<OMPMasterTaskLoopSimdDirective>(
1407 C, Clauses, AssociatedStmt,
1409 EndLoc, CollapsedNum);
1410 Dir->setHelperExprs(Exprs);
1416 unsigned NumClauses,
1417 unsigned CollapsedNum, EmptyShell) {
1418 return createEmptyDirective<OMPMasterTaskLoopSimdDirective>(
1419 C, NumClauses,
true,
1420 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), CollapsedNum);
1426 const HelperExprs &Exprs) {
1427 auto *Dir = createDirective<OMPMaskedTaskLoopSimdDirective>(
1428 C, Clauses, AssociatedStmt,
1430 EndLoc, CollapsedNum);
1431 Dir->setHelperExprs(Exprs);
1437 unsigned NumClauses,
1438 unsigned CollapsedNum, EmptyShell) {
1439 return createEmptyDirective<OMPMaskedTaskLoopSimdDirective>(
1440 C, NumClauses,
true,
1441 numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), CollapsedNum);
1447 const HelperExprs &Exprs,
bool HasCancel) {
1448 auto *Dir = createDirective<OMPParallelMasterTaskLoopDirective>(
1449 C, Clauses, AssociatedStmt,
1450 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop), StartLoc,
1451 EndLoc, CollapsedNum);
1452 Dir->setHelperExprs(Exprs);
1453 Dir->setHasCancel(HasCancel);
1459 unsigned NumClauses,
1460 unsigned CollapsedNum,
1462 return createEmptyDirective<OMPParallelMasterTaskLoopDirective>(
1463 C, NumClauses,
true,
1471 const HelperExprs &Exprs,
bool HasCancel) {
1472 auto *Dir = createDirective<OMPParallelMaskedTaskLoopDirective>(
1473 C, Clauses, AssociatedStmt,
1474 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop), StartLoc,
1475 EndLoc, CollapsedNum);
1476 Dir->setHelperExprs(Exprs);
1477 Dir->setHasCancel(HasCancel);
1483 unsigned NumClauses,
1484 unsigned CollapsedNum,
1486 return createEmptyDirective<OMPParallelMaskedTaskLoopDirective>(
1487 C, NumClauses,
true,
1496 const HelperExprs &Exprs) {
1497 auto *Dir = createDirective<OMPParallelMasterTaskLoopSimdDirective>(
1498 C, Clauses, AssociatedStmt,
1500 StartLoc, EndLoc, CollapsedNum);
1501 Dir->setHelperExprs(Exprs);
1507 unsigned NumClauses,
1508 unsigned CollapsedNum,
1510 return createEmptyDirective<OMPParallelMasterTaskLoopSimdDirective>(
1511 C, NumClauses,
true,
1520 const HelperExprs &Exprs) {
1521 auto *Dir = createDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1522 C, Clauses, AssociatedStmt,
1524 StartLoc, EndLoc, CollapsedNum);
1525 Dir->setHelperExprs(Exprs);
1531 unsigned NumClauses,
1532 unsigned CollapsedNum,
1534 return createEmptyDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1535 C, NumClauses,
true,
1544 Stmt *AssociatedStmt,
const HelperExprs &Exprs) {
1545 auto *Dir = createDirective<OMPDistributeDirective>(
1546 C, Clauses, AssociatedStmt,
1549 Dir->setHelperExprs(Exprs);
1555 unsigned CollapsedNum, EmptyShell) {
1556 return createEmptyDirective<OMPDistributeDirective>(
1557 C, NumClauses,
true,
1564 return createDirective<OMPTargetUpdateDirective>(
C, Clauses, AssociatedStmt,
1572 return createEmptyDirective<OMPTargetUpdateDirective>(
1573 C, NumClauses,
true);
1579 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
1580 auto *Dir = createDirective<OMPDistributeParallelForDirective>(
1581 C, Clauses, AssociatedStmt,
1582 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1, StartLoc,
1583 EndLoc, CollapsedNum);
1584 Dir->setHelperExprs(Exprs);
1585 Dir->setTaskReductionRefExpr(TaskRedRef);
1586 Dir->HasCancel = HasCancel;
1592 unsigned NumClauses,
1593 unsigned CollapsedNum,
1595 return createEmptyDirective<OMPDistributeParallelForDirective>(
1596 C, NumClauses,
true,
1605 const HelperExprs &Exprs) {
1606 auto *Dir = createDirective<OMPDistributeParallelForSimdDirective>(
1607 C, Clauses, AssociatedStmt,
1609 StartLoc, EndLoc, CollapsedNum);
1610 Dir->setHelperExprs(Exprs);
1616 unsigned NumClauses,
1617 unsigned CollapsedNum,
1619 return createEmptyDirective<OMPDistributeParallelForSimdDirective>(
1620 C, NumClauses,
true,
1628 const HelperExprs &Exprs) {
1629 auto *Dir = createDirective<OMPDistributeSimdDirective>(
1630 C, Clauses, AssociatedStmt,
1631 numLoopChildren(CollapsedNum, OMPD_distribute_simd), StartLoc, EndLoc,
1633 Dir->setHelperExprs(Exprs);
1639 unsigned NumClauses,
1640 unsigned CollapsedNum, EmptyShell) {
1641 return createEmptyDirective<OMPDistributeSimdDirective>(
1642 C, NumClauses,
true,
1649 const HelperExprs &Exprs) {
1650 auto *Dir = createDirective<OMPTargetParallelForSimdDirective>(
1651 C, Clauses, AssociatedStmt,
1652 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd), StartLoc,
1653 EndLoc, CollapsedNum);
1654 Dir->setHelperExprs(Exprs);
1660 unsigned NumClauses,
1661 unsigned CollapsedNum,
1663 return createEmptyDirective<OMPTargetParallelForSimdDirective>(
1664 C, NumClauses,
true,
1673 Stmt *AssociatedStmt,
const HelperExprs &Exprs) {
1674 auto *Dir = createDirective<OMPTargetSimdDirective>(
1675 C, Clauses, AssociatedStmt,
1678 Dir->setHelperExprs(Exprs);
1684 unsigned CollapsedNum, EmptyShell) {
1685 return createEmptyDirective<OMPTargetSimdDirective>(
1686 C, NumClauses,
true,
1693 const HelperExprs &Exprs) {
1694 auto *Dir = createDirective<OMPTeamsDistributeDirective>(
1695 C, Clauses, AssociatedStmt,
1696 numLoopChildren(CollapsedNum, OMPD_teams_distribute), StartLoc, EndLoc,
1698 Dir->setHelperExprs(Exprs);
1704 unsigned NumClauses,
1705 unsigned CollapsedNum, EmptyShell) {
1706 return createEmptyDirective<OMPTeamsDistributeDirective>(
1707 C, NumClauses,
true,
1714 const HelperExprs &Exprs) {
1715 auto *Dir = createDirective<OMPTeamsDistributeSimdDirective>(
1716 C, Clauses, AssociatedStmt,
1718 EndLoc, CollapsedNum);
1719 Dir->setHelperExprs(Exprs);
1724 const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
1726 return createEmptyDirective<OMPTeamsDistributeSimdDirective>(
1727 C, NumClauses,
true,
1728 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), CollapsedNum);
1735 const HelperExprs &Exprs) {
1736 auto *Dir = createDirective<OMPTeamsDistributeParallelForSimdDirective>(
1737 C, Clauses, AssociatedStmt,
1738 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
1739 StartLoc, EndLoc, CollapsedNum);
1740 Dir->setHelperExprs(Exprs);
1746 unsigned NumClauses,
1747 unsigned CollapsedNum,
1749 return createEmptyDirective<OMPTeamsDistributeParallelForSimdDirective>(
1750 C, NumClauses,
true,
1751 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
1759 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
1760 auto *Dir = createDirective<OMPTeamsDistributeParallelForDirective>(
1761 C, Clauses, AssociatedStmt,
1762 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
1763 StartLoc, EndLoc, CollapsedNum);
1764 Dir->setHelperExprs(Exprs);
1765 Dir->setTaskReductionRefExpr(TaskRedRef);
1766 Dir->HasCancel = HasCancel;
1772 unsigned NumClauses,
1773 unsigned CollapsedNum,
1775 return createEmptyDirective<OMPTeamsDistributeParallelForDirective>(
1776 C, NumClauses,
true,
1777 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
1784 return createDirective<OMPTargetTeamsDirective>(
C, Clauses, AssociatedStmt,
1792 return createEmptyDirective<OMPTargetTeamsDirective>(
1793 C, NumClauses,
true);
1799 const HelperExprs &Exprs) {
1800 auto *Dir = createDirective<OMPTargetTeamsDistributeDirective>(
1801 C, Clauses, AssociatedStmt,
1802 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute), StartLoc,
1803 EndLoc, CollapsedNum);
1804 Dir->setHelperExprs(Exprs);
1810 unsigned NumClauses,
1811 unsigned CollapsedNum,
1813 return createEmptyDirective<OMPTargetTeamsDistributeDirective>(
1814 C, NumClauses,
true,
1823 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
1824 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForDirective>(
1825 C, Clauses, AssociatedStmt,
1826 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
1828 StartLoc, EndLoc, CollapsedNum);
1829 Dir->setHelperExprs(Exprs);
1830 Dir->setTaskReductionRefExpr(TaskRedRef);
1831 Dir->HasCancel = HasCancel;
1837 unsigned NumClauses,
1838 unsigned CollapsedNum,
1840 return createEmptyDirective<OMPTargetTeamsDistributeParallelForDirective>(
1841 C, NumClauses,
true,
1842 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
1851 const HelperExprs &Exprs) {
1852 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
1853 C, Clauses, AssociatedStmt,
1855 OMPD_target_teams_distribute_parallel_for_simd),
1856 StartLoc, EndLoc, CollapsedNum);
1857 Dir->setHelperExprs(Exprs);
1863 const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
1865 return createEmptyDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
1866 C, NumClauses,
true,
1868 OMPD_target_teams_distribute_parallel_for_simd),
1876 const HelperExprs &Exprs) {
1877 auto *Dir = createDirective<OMPTargetTeamsDistributeSimdDirective>(
1878 C, Clauses, AssociatedStmt,
1880 StartLoc, EndLoc, CollapsedNum);
1881 Dir->setHelperExprs(Exprs);
1887 unsigned NumClauses,
1888 unsigned CollapsedNum,
1890 return createEmptyDirective<OMPTargetTeamsDistributeSimdDirective>(
1891 C, NumClauses,
true,
1900 return createDirective<OMPInteropDirective>(
1901 C, Clauses,
nullptr, 0, StartLoc,
1906 unsigned NumClauses,
1908 return createEmptyDirective<OMPInteropDirective>(
C, NumClauses);
1915 auto *Dir = createDirective<OMPDispatchDirective>(
1916 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1917 Dir->setTargetCallLoc(TargetCallLoc);
1922 unsigned NumClauses,
1924 return createEmptyDirective<OMPDispatchDirective>(
C, NumClauses,
1933 Stmt *AssociatedStmt) {
1934 return createDirective<OMPMaskedDirective>(
C, Clauses, AssociatedStmt,
1940 unsigned NumClauses,
1942 return createEmptyDirective<OMPMaskedDirective>(
C, NumClauses,
1949 const HelperExprs &Exprs) {
1950 auto *Dir = createDirective<OMPGenericLoopDirective>(
1952 StartLoc, EndLoc, CollapsedNum);
1953 Dir->setHelperExprs(Exprs);
1959 unsigned CollapsedNum, EmptyShell) {
1960 return createEmptyDirective<OMPGenericLoopDirective>(
1961 C, NumClauses,
true,
1968 const HelperExprs &Exprs) {
1969 auto *Dir = createDirective<OMPTeamsGenericLoopDirective>(
1970 C, Clauses, AssociatedStmt,
1973 Dir->setHelperExprs(Exprs);
1979 unsigned NumClauses,
1980 unsigned CollapsedNum, EmptyShell) {
1981 return createEmptyDirective<OMPTeamsGenericLoopDirective>(
1982 C, NumClauses,
true,
1989 const HelperExprs &Exprs,
bool CanBeParallelFor) {
1990 auto *Dir = createDirective<OMPTargetTeamsGenericLoopDirective>(
1991 C, Clauses, AssociatedStmt,
1992 numLoopChildren(CollapsedNum, OMPD_target_teams_loop), StartLoc, EndLoc,
1994 Dir->setHelperExprs(Exprs);
1995 Dir->setCanBeParallelFor(CanBeParallelFor);
2001 unsigned NumClauses,
2002 unsigned CollapsedNum,
2004 return createEmptyDirective<OMPTargetTeamsGenericLoopDirective>(
2005 C, NumClauses,
true,
2012 const HelperExprs &Exprs) {
2013 auto *Dir = createDirective<OMPParallelGenericLoopDirective>(
2014 C, Clauses, AssociatedStmt,
2017 Dir->setHelperExprs(Exprs);
2022 const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
2024 return createEmptyDirective<OMPParallelGenericLoopDirective>(
2025 C, NumClauses,
true,
2033 const HelperExprs &Exprs) {
2034 auto *Dir = createDirective<OMPTargetParallelGenericLoopDirective>(
2035 C, Clauses, AssociatedStmt,
2037 EndLoc, CollapsedNum);
2038 Dir->setHelperExprs(Exprs);
2044 unsigned NumClauses,
2045 unsigned CollapsedNum,
2047 return createEmptyDirective<OMPTargetParallelGenericLoopDirective>(
2048 C, NumClauses,
true,
2049 numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), CollapsedNum);
Defines the clang::ASTContext interface.
static Stmt * ignoreContainersKeepingIntraTileHint(Stmt *S)
Like Stmt::IgnoreContainers, but stops at (and preserves) an intra-tile hint wrapper so that the encl...
This file defines OpenMP AST classes for executable directives and clauses.
static OMPAssumeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
static OMPAssumeDirective * Create(const ASTContext &Ctx, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AStmt)
This represents 'pragma omp atomic' directive.
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPAtomicDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expressions Exprs)
Creates directive with a list of Clauses and 'x', 'v' and 'expr' parts of the atomic construct (see S...
static OMPBarrierDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
This represents 'pragma omp cancel' directive.
static OMPCancelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, OpenMPDirectiveKind CancelRegion)
Creates directive.
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents 'pragma omp cancellation point' directive.
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPCancellationPointDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Creates directive.
Contains data for OpenMP directives: clauses, children expressions/statements (helpers for codegen) a...
void setClauses(ArrayRef< OMPClause * > Clauses)
Sets the list of variables for this clause.
MutableArrayRef< Stmt * > getChildren()
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPCriticalDirective * Create(const ASTContext &C, const DeclarationNameInfo &Name, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
static OMPDepobjDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDepobjDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
static OMPDispatchDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, SourceLocation TargetCallLoc)
Creates directive with a list of Clauses.
static OMPDispatchDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp distribute' directive.
static OMPDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp distribute parallel for' composite directive.
static OMPDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDistributeParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
This represents 'pragma omp distribute parallel for simd' composite directive.
static OMPDistributeParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp distribute simd' composite directive.
static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDistributeSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPErrorDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
static OMPErrorDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPFlattenDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals)
Create a new AST node representation for 'pragma omp flatten'.
static OMPFlattenDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp flatten' AST node for deserialization.
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPFlushDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
static OMPForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp for simd' directive.
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPFuseDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Build an empty 'pragma omp fuse' AST node for deserialization.
static OMPFuseDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumGeneratedTopLevelLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals)
Create a new AST node representation for pragma omp fuse'.
This represents 'pragma omp loop' directive.
static OMPGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with a place for NumClauses clauses.
static OMPGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Represents the 'pragma omp interchange' loop transformation directive.
static OMPInterchangeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp interchange' AST node for deserialization.
static OMPInterchangeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals)
Create a new AST node representation for 'pragma omp interchange'.
This represents 'pragma omp interop' directive.
static OMPInteropDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPInteropDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive.
void setCombinedNextUpperBound(Expr *CombNUB)
void setNextUpperBound(Expr *NUB)
void setFinals(ArrayRef< Expr * > A)
static unsigned numLoopChildren(unsigned CollapsedNum, OpenMPDirectiveKind Kind)
Children number.
void setUpperBoundVariable(Expr *UB)
void setIsLastIterVariable(Expr *IL)
void setPrevEnsureUpperBound(Expr *PrevEUB)
void setCombinedLowerBoundVariable(Expr *CombLB)
void setPreInits(Stmt *PreInits)
void setDependentCounters(ArrayRef< Expr * > A)
void setNextLowerBound(Expr *NLB)
void setCombinedParForInDistCond(Expr *CombParForInDistCond)
void setEnsureUpperBound(Expr *EUB)
void setCombinedNextLowerBound(Expr *CombNLB)
void setFinalsConditions(ArrayRef< Expr * > A)
void setPrevLowerBoundVariable(Expr *PrevLB)
void setCombinedCond(Expr *CombCond)
void setLowerBoundVariable(Expr *LB)
void setPrevUpperBoundVariable(Expr *PrevUB)
void setCombinedUpperBoundVariable(Expr *CombUB)
void setStrideVariable(Expr *ST)
void setCombinedDistCond(Expr *CombDistCond)
void setInits(ArrayRef< Expr * > A)
void setCalcLastIteration(Expr *CLI)
void setDistInc(Expr *DistInc)
void setCombinedEnsureUpperBound(Expr *CombEUB)
void setHelperExprs(const HelperExprs &Exprs)
Set the helper expressions used by this directive kind.
void setIterationVariable(Expr *IV)
void setCounters(ArrayRef< Expr * > A)
void setDependentInits(ArrayRef< Expr * > A)
void setPreCond(Expr *PC)
static unsigned getArraysOffset(OpenMPDirectiveKind Kind)
Offset to the start of children expression arrays.
void setNumIterations(Expr *NI)
void setLastIteration(Expr *LI)
void setCombinedInit(Expr *CombInit)
void setUpdates(ArrayRef< Expr * > A)
void setPrivateCounters(ArrayRef< Expr * > A)
static OMPMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPMaskedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
This represents 'pragma omp masked taskloop' directive.
static OMPMaskedTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
static OMPMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp masked taskloop simd' directive.
static OMPMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMaskedTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
This represents 'pragma omp master taskloop' directive.
static OMPMasterTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
static OMPMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp master taskloop simd' directive.
static OMPMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMasterTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
This represents block-associated 'pragma omp ordered' directive.
static OMPOrderedBlockAssocDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
static OMPOrderedBlockAssocDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents standalone 'pragma omp ordered' directive.
static OMPOrderedStandaloneDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPOrderedStandaloneDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive.
This represents 'pragma omp parallel for' directive.
static OMPParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp parallel for simd' directive.
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
This represents 'pragma omp parallel masked' directive.
static OMPParallelMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelMaskedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef)
Creates directive with a list of Clauses.
This represents 'pragma omp parallel masked taskloop' directive.
static OMPParallelMaskedTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
static OMPParallelMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp parallel masked taskloop simd' directive.
static OMPParallelMaskedTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPParallelMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp parallel master' directive.
static OMPParallelMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef)
Creates directive with a list of Clauses.
static OMPParallelMasterDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp parallel master taskloop' directive.
static OMPParallelMasterTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
static OMPParallelMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp parallel master taskloop simd' directive.
static OMPParallelMasterTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPParallelMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp parallel sections' directive.
static OMPParallelSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents the 'pragma omp reverse' loop transformation directive.
static OMPReverseDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, unsigned NumLoops, Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals)
Create a new AST node representation for 'pragma omp reverse'.
static OMPReverseDirective * CreateEmpty(const ASTContext &C, unsigned NumLoops)
Build an empty 'pragma omp reverse' AST node for deserialization.
static OMPScanDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPScanDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
static OMPScopeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
static OMPScopeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
void setHasCancel(bool Has)
Set cancel state.
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPSectionDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, bool HasCancel)
Creates directive.
static OMPSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp simd' directive.
static OMPSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPSingleDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents the 'pragma omp split' loop transformation directive.
static OMPSplitDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals)
Create a new AST node representation for 'pragma omp split'.
static OMPSplitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp split' AST node for deserialization.
static OMPStripeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp stripe' AST node for deserialization.
static OMPStripeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals)
Create a new AST node representation for 'pragma omp stripe'.
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
static OMPTargetDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp target enter data' directive.
static OMPTargetEnterDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents 'pragma omp target exit data' directive.
static OMPTargetExitDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents 'pragma omp target parallel' directive.
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetParallelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
This represents 'pragma omp target parallel for' directive.
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
This represents 'pragma omp target parallel for simd' directive.
static OMPTargetParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp target parallel loop' directive.
static OMPTargetParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetParallelGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
This represents 'pragma omp target simd' directive.
static OMPTargetSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp target teams' directive.
static OMPTargetTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp target teams distribute' combined directive.
static OMPTargetTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
This represents 'pragma omp target teams distribute parallel for' combined directive.
static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsDistributeParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
This represents 'pragma omp target teams distribute parallel for simd' combined directive.
static OMPTargetTeamsDistributeParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTargetTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp target teams distribute simd' combined directive.
static OMPTargetTeamsDistributeSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp target teams loop' directive.
static OMPTargetTeamsGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool CanBeParallelFor)
Creates directive with a list of Clauses.
static OMPTargetTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp target update' directive.
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetUpdateDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
This represents 'pragma omp task' directive.
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTaskDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
static OMPTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp taskloop simd' directive.
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTaskgroupDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *ReductionRef)
Creates directive.
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents 'pragma omp taskwait' directive.
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPTaskwaitDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive.
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPTaskyieldDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
This represents 'pragma omp teams distribute' directive.
static OMPTeamsDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp teams distribute parallel for' composite directive.
static OMPTeamsDistributeParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp teams distribute parallel for simd' composite directive.
static OMPTeamsDistributeParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDistributeSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp teams loop' directive.
static OMPTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
This represents the 'pragma omp tile' loop transformation directive.
static OMPTileDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp tile' AST node for deserialization.
static OMPTileDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals)
Create a new AST node representation for 'pragma omp tile'.
static OMPUnrollDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, unsigned NumGeneratedTopLevelLoops, Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals)
Create a new AST node representation for 'pragma omp unroll'.
static OMPUnrollDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Build an empty 'pragma omp unroll' AST node for deserialization.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
This represents one expression.
Encodes a location in the source.
Stmt - This represents one statement.
Top level wrappers for InstallAPI frontend operations.
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
bool isa(CodeGen::Address addr)
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
Stmt Stmt llvm::function_ref< void(OMPLoopTransformationDirective *)> OnTransformationCallback
Stmt Stmt llvm::function_ref< void(OMPLoopTransformationDirective *)> bool RelaxNestForPeeledTransformation
bool hasSpecificAttr(const Container &container)
auto * getSpecificAttr(const Container &container)
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
MutableArrayRef< Expr * > getInits()
U cast(CodeGen::Address addr)
Expr * Cond
Conditional expression in atomic compare construct. */.
Expr * X
'x' part of the associated expression/statement.
bool IsXLHSInRHSPart
True if UE has the first form and false if the second.
Expr * E
'expr' part of the associated expression/statement.
Expr * D
'd' part of the associated expression/statement.
Expr * V
'v' part of the associated expression/statement.
bool IsFailOnly
True if 'v' is updated only when the condition is false (compare capture only).
Expr * UE
UE Helper expression of the form: 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExp...
bool IsPostfixUpdate
True if original value of 'x' must be stored in 'v', not an updated one.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...