14#ifndef LLVM_CLANG_AST_STMTOPENMP_H
15#define LLVM_CLANG_AST_STMTOPENMP_H
142class OMPCanonicalLoop :
public Stmt {
143 friend class ASTStmtReader;
144 friend class ASTStmtWriter;
152 LastSubStmt = LOOPVAR_REF
157 Stmt *SubStmts[LastSubStmt + 1] = {};
159 OMPCanonicalLoop() : Stmt(StmtClass::OMPCanonicalLoopClass) {}
163 static OMPCanonicalLoop *
create(
const ASTContext &Ctx, Stmt *LoopStmt,
164 CapturedStmt *DistanceFunc,
165 CapturedStmt *LoopVarFunc,
166 DeclRefExpr *LoopVarRef) {
167 OMPCanonicalLoop *S =
new (Ctx) OMPCanonicalLoop();
168 S->setLoopStmt(LoopStmt);
169 S->setDistanceFunc(DistanceFunc);
170 S->setLoopVarFunc(LoopVarFunc);
171 S->setLoopVarRef(LoopVarRef);
176 static OMPCanonicalLoop *createEmpty(
const ASTContext &Ctx) {
177 return new (Ctx) OMPCanonicalLoop();
180 static bool classof(
const Stmt *S) {
181 return S->getStmtClass() == StmtClass::OMPCanonicalLoopClass;
184 SourceLocation getBeginLoc()
const {
return getLoopStmt()->getBeginLoc(); }
185 SourceLocation getEndLoc()
const {
return getLoopStmt()->getEndLoc(); }
189 child_range children() {
190 return child_range(&SubStmts[0], &SubStmts[0] + LastSubStmt + 1);
192 const_child_range children()
const {
193 return const_child_range(&SubStmts[0], &SubStmts[0] + LastSubStmt + 1);
199 Stmt *getLoopStmt() {
return SubStmts[LOOP_STMT]; }
200 const Stmt *getLoopStmt()
const {
return SubStmts[LOOP_STMT]; }
201 void setLoopStmt(Stmt *S) {
202 assert((isa<ForStmt>(S) || isa<CXXForRangeStmt>(S)) &&
203 "Canonical loop must be a for loop (range-based or otherwise)");
204 SubStmts[LOOP_STMT] = S;
215 CapturedStmt *getDistanceFunc() {
216 return cast<CapturedStmt>(SubStmts[DISTANCE_FUNC]);
218 const CapturedStmt *getDistanceFunc()
const {
219 return cast<CapturedStmt>(SubStmts[DISTANCE_FUNC]);
221 void setDistanceFunc(CapturedStmt *S) {
222 assert(S &&
"Expected non-null captured statement");
223 SubStmts[DISTANCE_FUNC] = S;
236 CapturedStmt *getLoopVarFunc() {
237 return cast<CapturedStmt>(SubStmts[LOOPVAR_FUNC]);
239 const CapturedStmt *getLoopVarFunc()
const {
240 return cast<CapturedStmt>(SubStmts[LOOPVAR_FUNC]);
242 void setLoopVarFunc(CapturedStmt *S) {
243 assert(S &&
"Expected non-null captured statement");
244 SubStmts[LOOPVAR_FUNC] = S;
250 DeclRefExpr *getLoopVarRef() {
251 return cast<DeclRefExpr>(SubStmts[LOOPVAR_REF]);
253 const DeclRefExpr *getLoopVarRef()
const {
254 return cast<DeclRefExpr>(SubStmts[LOOPVAR_REF]);
256 void setLoopVarRef(DeclRefExpr *E) {
257 assert(E &&
"Expected non-null loop variable");
258 SubStmts[LOOPVAR_REF] = E;
266class OMPExecutableDirective :
public Stmt {
267 friend class ASTStmtReader;
268 friend class ASTStmtWriter;
273 SourceLocation StartLoc;
275 SourceLocation EndLoc;
278 MutableArrayRef<OMPClause *> getClauses() {
281 return Data->getClauses();
286 OMPChildren *
Data =
nullptr;
295 OMPExecutableDirective(StmtClass SC, OpenMPDirectiveKind K,
296 SourceLocation StartLoc, SourceLocation EndLoc)
297 : Stmt(SC),
Kind(K), StartLoc(std::move(StartLoc)),
298 EndLoc(std::move(EndLoc)) {}
300 template <
typename T,
typename... Params>
301 static T *createDirective(
const ASTContext &C, ArrayRef<OMPClause *> Clauses,
302 Stmt *AssociatedStmt,
unsigned NumChildren,
305 C.Allocate(
sizeof(T) + OMPChildren::size(Clauses.size(), AssociatedStmt,
309 auto *
Data = OMPChildren::Create(
reinterpret_cast<T *
>(Mem) + 1, Clauses,
310 AssociatedStmt, NumChildren);
311 auto *Inst =
new (Mem)
T(std::forward<Params>(P)...);
316 template <
typename T,
typename... Params>
317 static T *createEmptyDirective(
const ASTContext &C,
unsigned NumClauses,
318 bool HasAssociatedStmt,
unsigned NumChildren,
321 C.Allocate(
sizeof(T) + OMPChildren::size(NumClauses, HasAssociatedStmt,
325 OMPChildren::CreateEmpty(
reinterpret_cast<T *
>(Mem) + 1, NumClauses,
326 HasAssociatedStmt, NumChildren);
327 auto *Inst =
new (Mem)
T(std::forward<Params>(P)...);
332 template <
typename T>
333 static T *createEmptyDirective(
const ASTContext &C,
unsigned NumClauses,
334 bool HasAssociatedStmt =
false,
335 unsigned NumChildren = 0) {
337 C.Allocate(
sizeof(T) + OMPChildren::size(NumClauses, HasAssociatedStmt,
341 OMPChildren::CreateEmpty(
reinterpret_cast<T *
>(Mem) + 1, NumClauses,
342 HasAssociatedStmt, NumChildren);
343 auto *Inst =
new (Mem) T;
350 class used_clauses_child_iterator
351 :
public llvm::iterator_adaptor_base<
352 used_clauses_child_iterator, ArrayRef<OMPClause *>::iterator,
353 std::forward_iterator_tag, Stmt *, ptrdiff_t, Stmt *, Stmt *> {
354 ArrayRef<OMPClause *>::iterator End;
355 OMPClause::child_iterator ChildI, ChildEnd;
358 if (ChildI != ChildEnd)
360 while (this->I != End) {
362 if (this->I != End) {
363 ChildI = (*this->I)->used_children().begin();
364 ChildEnd = (*this->I)->used_children().end();
365 if (ChildI != ChildEnd)
372 explicit used_clauses_child_iterator(ArrayRef<OMPClause *> Clauses)
373 : used_clauses_child_iterator::iterator_adaptor_base(Clauses.begin()),
375 if (this->I != End) {
376 ChildI = (*this->I)->used_children().begin();
377 ChildEnd = (*this->I)->used_children().end();
381 Stmt *
operator*()
const {
return *ChildI; }
382 Stmt *operator->()
const {
return **
this; }
384 used_clauses_child_iterator &operator++() {
386 if (ChildI != ChildEnd)
388 if (this->I != End) {
390 if (this->I != End) {
391 ChildI = (*this->I)->used_children().begin();
392 ChildEnd = (*this->I)->used_children().end();
400 static llvm::iterator_range<used_clauses_child_iterator>
401 used_clauses_children(ArrayRef<OMPClause *> Clauses) {
402 return {used_clauses_child_iterator(Clauses),
403 used_clauses_child_iterator(ArrayRef(Clauses.end(), (
size_t)0))};
410 template <
typename SpecificClause>
411 class specific_clause_iterator
412 :
public llvm::iterator_adaptor_base<
413 specific_clause_iterator<SpecificClause>,
414 ArrayRef<OMPClause *>::const_iterator, std::forward_iterator_tag,
415 const SpecificClause *, ptrdiff_t, const SpecificClause *,
416 const SpecificClause *> {
417 ArrayRef<OMPClause *>::const_iterator End;
419 void SkipToNextClause() {
420 while (this->I != End && !isa<SpecificClause>(*this->I))
425 explicit specific_clause_iterator(ArrayRef<OMPClause *> Clauses)
426 : specific_clause_iterator::iterator_adaptor_base(Clauses.begin()),
431 const SpecificClause *
operator*()
const {
432 return cast<SpecificClause>(*this->I);
434 const SpecificClause *operator->()
const {
return **
this; }
436 specific_clause_iterator &operator++() {
443 template <
typename SpecificClause>
444 static llvm::iterator_range<specific_clause_iterator<SpecificClause>>
445 getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
446 return {specific_clause_iterator<SpecificClause>(Clauses),
447 specific_clause_iterator<SpecificClause>(
448 ArrayRef(Clauses.end(), (
size_t)0))};
451 template <
typename SpecificClause>
452 llvm::iterator_range<specific_clause_iterator<SpecificClause>>
453 getClausesOfKind()
const {
454 return getClausesOfKind<SpecificClause>(clauses());
462 template <
typename SpecificClause>
463 static const SpecificClause *getSingleClause(ArrayRef<OMPClause *> Clauses) {
464 auto ClausesOfKind = getClausesOfKind<SpecificClause>(Clauses);
466 if (ClausesOfKind.begin() != ClausesOfKind.end()) {
467 assert(std::next(ClausesOfKind.begin()) == ClausesOfKind.end() &&
468 "There are at least 2 clauses of the specified kind");
469 return *ClausesOfKind.begin();
474 template <
typename SpecificClause>
475 const SpecificClause *getSingleClause()
const {
476 return getSingleClause<SpecificClause>(clauses());
481 template <
typename SpecificClause>
482 bool hasClausesOfKind()
const {
483 auto Clauses = getClausesOfKind<SpecificClause>();
484 return Clauses.begin() != Clauses.end();
488 SourceLocation getBeginLoc()
const {
return StartLoc; }
490 SourceLocation getEndLoc()
const {
return EndLoc; }
496 void setLocStart(SourceLocation Loc) { StartLoc = Loc; }
501 void setLocEnd(SourceLocation Loc) { EndLoc = Loc; }
504 unsigned getNumClauses()
const {
507 return Data->getNumClauses();
514 OMPClause *getClause(
unsigned I)
const {
return clauses()[I]; }
517 bool hasAssociatedStmt()
const {
return Data &&
Data->hasAssociatedStmt(); }
520 const Stmt *getAssociatedStmt()
const {
521 return const_cast<OMPExecutableDirective *
>(
this)->getAssociatedStmt();
523 Stmt *getAssociatedStmt() {
524 assert(hasAssociatedStmt() &&
525 "Expected directive with the associated statement.");
526 return Data->getAssociatedStmt();
533 const CapturedStmt *getCapturedStmt(OpenMPDirectiveKind RegionKind)
const {
534 assert(hasAssociatedStmt() &&
535 "Expected directive with the associated statement.");
536 SmallVector<OpenMPDirectiveKind, 4> CaptureRegions;
538 return Data->getCapturedStmt(RegionKind, CaptureRegions);
542 CapturedStmt *getInnermostCapturedStmt() {
543 assert(hasAssociatedStmt() &&
544 "Expected directive with the associated statement.");
545 SmallVector<OpenMPDirectiveKind, 4> CaptureRegions;
547 return Data->getInnermostCapturedStmt(CaptureRegions);
550 const CapturedStmt *getInnermostCapturedStmt()
const {
551 return const_cast<OMPExecutableDirective *
>(
this)
552 ->getInnermostCapturedStmt();
557 static bool classof(
const Stmt *S) {
558 return S->getStmtClass() >= firstOMPExecutableDirectiveConstant &&
559 S->getStmtClass() <= lastOMPExecutableDirectiveConstant;
562 child_range children() {
564 return child_range(child_iterator(), child_iterator());
565 return Data->getAssociatedStmtAsRange();
568 const_child_range children()
const {
569 return const_cast<OMPExecutableDirective *
>(
this)->children();
572 ArrayRef<OMPClause *> clauses()
const {
575 return Data->getClauses();
582 bool isStandaloneDirective()
const;
592 const Stmt *getRawStmt()
const {
593 return const_cast<OMPExecutableDirective *
>(
this)->getRawStmt();
596 assert(hasAssociatedStmt() &&
597 "Expected directive with the associated statement.");
598 return Data->getRawStmt();
611class OMPParallelDirective :
public OMPExecutableDirective {
612 friend class ASTStmtReader;
613 friend class OMPExecutableDirective;
615 bool HasCancel =
false;
622 OMPParallelDirective(SourceLocation StartLoc, SourceLocation EndLoc)
623 : OMPExecutableDirective(OMPParallelDirectiveClass,
624 llvm::omp::OMPD_parallel, StartLoc, EndLoc) {}
628 explicit OMPParallelDirective()
629 : OMPExecutableDirective(OMPParallelDirectiveClass,
630 llvm::omp::OMPD_parallel, SourceLocation(),
634 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
637 void setHasCancel(
bool Has) { HasCancel = Has; }
651 static OMPParallelDirective *
652 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
653 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
661 static OMPParallelDirective *
CreateEmpty(
const ASTContext &C,
662 unsigned NumClauses, EmptyShell);
665 Expr *getTaskReductionRefExpr() {
666 return cast_or_null<Expr>(
Data->getChildren()[0]);
668 const Expr *getTaskReductionRefExpr()
const {
669 return const_cast<OMPParallelDirective *
>(
this)->getTaskReductionRefExpr();
673 bool hasCancel()
const {
return HasCancel; }
675 static bool classof(
const Stmt *T) {
676 return T->getStmtClass() == OMPParallelDirectiveClass;
682class OMPLoopBasedDirective :
public OMPExecutableDirective {
683 friend class ASTStmtReader;
687 unsigned NumAssociatedLoops = 0;
697 OMPLoopBasedDirective(StmtClass SC, OpenMPDirectiveKind Kind,
698 SourceLocation StartLoc, SourceLocation EndLoc,
699 unsigned NumAssociatedLoops)
700 : OMPExecutableDirective(SC,
Kind, StartLoc, EndLoc),
701 NumAssociatedLoops(NumAssociatedLoops) {}
706 struct DistCombinedHelperExprs {
735 Expr *ParForInDistCond;
742 Expr *IterationVarRef;
748 Expr *CalcLastIteration;
788 SmallVector<Expr *, 4> Counters;
790 SmallVector<Expr *, 4> PrivateCounters;
792 SmallVector<Expr *, 4> Inits;
794 SmallVector<Expr *, 4> Updates;
796 SmallVector<Expr *, 4> Finals;
799 SmallVector<Expr *, 4> DependentCounters;
802 SmallVector<Expr *, 4> DependentInits;
805 SmallVector<Expr *, 4> FinalsConditions;
810 DistCombinedHelperExprs DistCombinedFields;
815 return IterationVarRef !=
nullptr && LastIteration !=
nullptr &&
816 NumIterations !=
nullptr && PreCond !=
nullptr &&
817 Cond !=
nullptr &&
Init !=
nullptr &&
Inc !=
nullptr;
824 void clear(
unsigned Size) {
825 IterationVarRef =
nullptr;
826 LastIteration =
nullptr;
827 CalcLastIteration =
nullptr;
839 NumIterations =
nullptr;
844 Counters.resize(Size);
845 PrivateCounters.resize(Size);
847 Updates.resize(Size);
849 DependentCounters.resize(Size);
850 DependentInits.resize(Size);
851 FinalsConditions.resize(Size);
852 for (
unsigned I = 0; I <
Size; ++I) {
853 Counters[I] =
nullptr;
854 PrivateCounters[I] =
nullptr;
856 Updates[I] =
nullptr;
858 DependentCounters[I] =
nullptr;
859 DependentInits[I] =
nullptr;
860 FinalsConditions[I] =
nullptr;
863 DistCombinedFields.LB =
nullptr;
864 DistCombinedFields.UB =
nullptr;
865 DistCombinedFields.EUB =
nullptr;
866 DistCombinedFields.Init =
nullptr;
867 DistCombinedFields.Cond =
nullptr;
868 DistCombinedFields.NLB =
nullptr;
869 DistCombinedFields.NUB =
nullptr;
870 DistCombinedFields.DistCond =
nullptr;
871 DistCombinedFields.ParForInDistCond =
nullptr;
876 unsigned getLoopsNumber()
const {
return NumAssociatedLoops; }
882 static Stmt *tryToFindNextInnerLoop(Stmt *CurStmt,
883 bool TryImperfectlyNestedLoops);
884 static const Stmt *tryToFindNextInnerLoop(
const Stmt *CurStmt,
885 bool TryImperfectlyNestedLoops) {
886 return tryToFindNextInnerLoop(
const_cast<Stmt *
>(CurStmt),
887 TryImperfectlyNestedLoops);
892 static bool doForAllLoops(
893 Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
894 llvm::function_ref<
bool(
unsigned, Stmt *)> Callback,
895 llvm::function_ref<
void(OMPCanonicalLoopNestTransformationDirective *)>
896 OnTransformationCallback);
898 doForAllLoops(
const Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
900 llvm::function_ref<
bool(
unsigned,
const Stmt *)> Callback,
902 void(
const OMPCanonicalLoopNestTransformationDirective *)>
903 OnTransformationCallback) {
904 auto &&NewCallback = [Callback](
unsigned Cnt, Stmt *CurStmt) {
905 return Callback(Cnt, CurStmt);
907 auto &&NewTransformCb =
908 [OnTransformationCallback](
909 OMPCanonicalLoopNestTransformationDirective *A) {
910 OnTransformationCallback(A);
912 return doForAllLoops(
const_cast<Stmt *
>(CurStmt), TryImperfectlyNestedLoops,
913 NumLoops, NewCallback, NewTransformCb);
919 doForAllLoops(Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
921 llvm::function_ref<
bool(
unsigned, Stmt *)> Callback) {
922 auto &&TransformCb = [](OMPCanonicalLoopNestTransformationDirective *) {};
923 return doForAllLoops(CurStmt, TryImperfectlyNestedLoops, NumLoops, Callback,
927 doForAllLoops(
const Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
929 llvm::function_ref<
bool(
unsigned,
const Stmt *)> Callback) {
930 auto &&NewCallback = [Callback](
unsigned Cnt,
const Stmt *CurStmt) {
931 return Callback(Cnt, CurStmt);
933 return doForAllLoops(
const_cast<Stmt *
>(CurStmt), TryImperfectlyNestedLoops,
934 NumLoops, NewCallback);
939 static void doForAllLoopsBodies(
940 Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
941 llvm::function_ref<
void(
unsigned, Stmt *, Stmt *)> Callback);
942 static void doForAllLoopsBodies(
943 const Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
944 llvm::function_ref<
void(
unsigned,
const Stmt *,
const Stmt *)> Callback) {
945 auto &&NewCallback = [Callback](
unsigned Cnt, Stmt *
Loop, Stmt *Body) {
946 Callback(Cnt, Loop, Body);
948 doForAllLoopsBodies(
const_cast<Stmt *
>(CurStmt), TryImperfectlyNestedLoops,
949 NumLoops, NewCallback);
952 static bool classof(
const Stmt *T) {
953 if (
auto *D = dyn_cast<OMPExecutableDirective>(T))
962class OMPLoopTransformationDirective {
970 unsigned NumGeneratedTopLevelLoops = 1;
973 void setNumGeneratedTopLevelLoops(
unsigned N) {
974 NumGeneratedTopLevelLoops = N;
978 unsigned getNumGeneratedTopLevelLoops()
const {
979 return NumGeneratedTopLevelLoops;
984class OMPCanonicalLoopNestTransformationDirective
985 :
public OMPLoopBasedDirective,
986 public OMPLoopTransformationDirective {
987 friend class ASTStmtReader;
990 explicit OMPCanonicalLoopNestTransformationDirective(
991 StmtClass SC, OpenMPDirectiveKind Kind, SourceLocation StartLoc,
992 SourceLocation EndLoc,
unsigned NumAssociatedLoops)
993 : OMPLoopBasedDirective(SC,
Kind, StartLoc, EndLoc, NumAssociatedLoops) {}
997 unsigned getNumAssociatedLoops()
const {
return getLoopsNumber(); }
1004 Stmt *getTransformedStmt()
const;
1007 Stmt *getPreInits()
const;
1009 static bool classof(
const Stmt *T) {
1010 Stmt::StmtClass
C =
T->getStmtClass();
1011 return C == OMPTileDirectiveClass ||
C == OMPUnrollDirectiveClass ||
1012 C == OMPReverseDirectiveClass ||
C == OMPInterchangeDirectiveClass ||
1013 C == OMPStripeDirectiveClass;
1020class OMPLoopDirective :
public OMPLoopBasedDirective {
1021 friend class ASTStmtReader;
1040 IterationVariableOffset = 0,
1041 LastIterationOffset = 1,
1042 CalcLastIterationOffset = 2,
1043 PreConditionOffset = 3,
1054 IsLastIterVariableOffset = 8,
1055 LowerBoundVariableOffset = 9,
1056 UpperBoundVariableOffset = 10,
1057 StrideVariableOffset = 11,
1058 EnsureUpperBoundOffset = 12,
1059 NextLowerBoundOffset = 13,
1060 NextUpperBoundOffset = 14,
1061 NumIterationsOffset = 15,
1063 WorksharingEnd = 16,
1064 PrevLowerBoundVariableOffset = 16,
1065 PrevUpperBoundVariableOffset = 17,
1067 PrevEnsureUpperBoundOffset = 19,
1068 CombinedLowerBoundVariableOffset = 20,
1069 CombinedUpperBoundVariableOffset = 21,
1070 CombinedEnsureUpperBoundOffset = 22,
1071 CombinedInitOffset = 23,
1072 CombinedConditionOffset = 24,
1073 CombinedNextLowerBoundOffset = 25,
1074 CombinedNextUpperBoundOffset = 26,
1075 CombinedDistConditionOffset = 27,
1076 CombinedParForInDistConditionOffset = 28,
1080 CombinedDistributeEnd = 29,
1084 MutableArrayRef<Expr *> getCounters() {
1085 auto **
Storage =
reinterpret_cast<Expr **
>(
1086 &
Data->getChildren()[getArraysOffset(getDirectiveKind())]);
1087 return {
Storage, getLoopsNumber()};
1091 MutableArrayRef<Expr *> getPrivateCounters() {
1092 auto **
Storage =
reinterpret_cast<Expr **
>(
1093 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1095 return {
Storage, getLoopsNumber()};
1099 MutableArrayRef<Expr *> getInits() {
1100 auto **
Storage =
reinterpret_cast<Expr **
>(
1101 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1102 2 * getLoopsNumber()]);
1103 return {
Storage, getLoopsNumber()};
1107 MutableArrayRef<Expr *> getUpdates() {
1108 auto **
Storage =
reinterpret_cast<Expr **
>(
1109 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1110 3 * getLoopsNumber()]);
1111 return {
Storage, getLoopsNumber()};
1115 MutableArrayRef<Expr *> getFinals() {
1116 auto **
Storage =
reinterpret_cast<Expr **
>(
1117 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1118 4 * getLoopsNumber()]);
1119 return {
Storage, getLoopsNumber()};
1123 MutableArrayRef<Expr *> getDependentCounters() {
1124 auto **
Storage =
reinterpret_cast<Expr **
>(
1125 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1126 5 * getLoopsNumber()]);
1127 return {
Storage, getLoopsNumber()};
1131 MutableArrayRef<Expr *> getDependentInits() {
1132 auto **
Storage =
reinterpret_cast<Expr **
>(
1133 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1134 6 * getLoopsNumber()]);
1135 return {
Storage, getLoopsNumber()};
1139 MutableArrayRef<Expr *> getFinalsConditions() {
1140 auto **
Storage =
reinterpret_cast<Expr **
>(
1141 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1142 7 * getLoopsNumber()]);
1143 return {
Storage, getLoopsNumber()};
1155 OMPLoopDirective(StmtClass SC, OpenMPDirectiveKind Kind,
1156 SourceLocation StartLoc, SourceLocation EndLoc,
1157 unsigned CollapsedNum)
1158 : OMPLoopBasedDirective(SC,
Kind, StartLoc, EndLoc, CollapsedNum) {}
1161 static unsigned getArraysOffset(OpenMPDirectiveKind Kind) {
1163 return CombinedDistributeEnd;
1166 return WorksharingEnd;
1171 static unsigned numLoopChildren(
unsigned CollapsedNum,
1172 OpenMPDirectiveKind Kind) {
1173 return getArraysOffset(Kind) +
1179 void setIterationVariable(Expr *IV) {
1180 Data->getChildren()[IterationVariableOffset] = IV;
1182 void setLastIteration(Expr *LI) {
1183 Data->getChildren()[LastIterationOffset] = LI;
1185 void setCalcLastIteration(Expr *CLI) {
1186 Data->getChildren()[CalcLastIterationOffset] = CLI;
1188 void setPreCond(Expr *PC) {
Data->getChildren()[PreConditionOffset] = PC; }
1189 void setCond(Expr *Cond) {
Data->getChildren()[CondOffset] =
Cond; }
1190 void setInit(Expr *Init) {
Data->getChildren()[InitOffset] =
Init; }
1191 void setInc(Expr *Inc) {
Data->getChildren()[IncOffset] =
Inc; }
1192 void setPreInits(Stmt *PreInits) {
1193 Data->getChildren()[PreInitsOffset] = PreInits;
1195 void setIsLastIterVariable(Expr *IL) {
1200 "expected worksharing loop directive");
1201 Data->getChildren()[IsLastIterVariableOffset] = IL;
1203 void setLowerBoundVariable(Expr *LB) {
1208 "expected worksharing loop directive");
1209 Data->getChildren()[LowerBoundVariableOffset] = LB;
1211 void setUpperBoundVariable(Expr *UB) {
1216 "expected worksharing loop directive");
1217 Data->getChildren()[UpperBoundVariableOffset] = UB;
1219 void setStrideVariable(Expr *ST) {
1224 "expected worksharing loop directive");
1225 Data->getChildren()[StrideVariableOffset] = ST;
1227 void setEnsureUpperBound(Expr *EUB) {
1232 "expected worksharing loop directive");
1233 Data->getChildren()[EnsureUpperBoundOffset] = EUB;
1235 void setNextLowerBound(Expr *NLB) {
1240 "expected worksharing loop directive");
1241 Data->getChildren()[NextLowerBoundOffset] = NLB;
1243 void setNextUpperBound(Expr *NUB) {
1248 "expected worksharing loop directive");
1249 Data->getChildren()[NextUpperBoundOffset] = NUB;
1251 void setNumIterations(Expr *NI) {
1256 "expected worksharing loop directive");
1257 Data->getChildren()[NumIterationsOffset] = NI;
1259 void setPrevLowerBoundVariable(Expr *PrevLB) {
1261 "expected loop bound sharing directive");
1262 Data->getChildren()[PrevLowerBoundVariableOffset] = PrevLB;
1264 void setPrevUpperBoundVariable(Expr *PrevUB) {
1266 "expected loop bound sharing directive");
1267 Data->getChildren()[PrevUpperBoundVariableOffset] = PrevUB;
1269 void setDistInc(Expr *DistInc) {
1271 "expected loop bound sharing directive");
1272 Data->getChildren()[DistIncOffset] = DistInc;
1274 void setPrevEnsureUpperBound(Expr *PrevEUB) {
1276 "expected loop bound sharing directive");
1277 Data->getChildren()[PrevEnsureUpperBoundOffset] = PrevEUB;
1279 void setCombinedLowerBoundVariable(Expr *CombLB) {
1281 "expected loop bound sharing directive");
1282 Data->getChildren()[CombinedLowerBoundVariableOffset] = CombLB;
1284 void setCombinedUpperBoundVariable(Expr *CombUB) {
1286 "expected loop bound sharing directive");
1287 Data->getChildren()[CombinedUpperBoundVariableOffset] = CombUB;
1289 void setCombinedEnsureUpperBound(Expr *CombEUB) {
1291 "expected loop bound sharing directive");
1292 Data->getChildren()[CombinedEnsureUpperBoundOffset] = CombEUB;
1294 void setCombinedInit(Expr *CombInit) {
1296 "expected loop bound sharing directive");
1297 Data->getChildren()[CombinedInitOffset] = CombInit;
1299 void setCombinedCond(Expr *CombCond) {
1301 "expected loop bound sharing directive");
1302 Data->getChildren()[CombinedConditionOffset] = CombCond;
1304 void setCombinedNextLowerBound(Expr *CombNLB) {
1306 "expected loop bound sharing directive");
1307 Data->getChildren()[CombinedNextLowerBoundOffset] = CombNLB;
1309 void setCombinedNextUpperBound(Expr *CombNUB) {
1311 "expected loop bound sharing directive");
1312 Data->getChildren()[CombinedNextUpperBoundOffset] = CombNUB;
1314 void setCombinedDistCond(Expr *CombDistCond) {
1316 "expected loop bound distribute sharing directive");
1317 Data->getChildren()[CombinedDistConditionOffset] = CombDistCond;
1319 void setCombinedParForInDistCond(Expr *CombParForInDistCond) {
1321 "expected loop bound distribute sharing directive");
1322 Data->getChildren()[CombinedParForInDistConditionOffset] =
1323 CombParForInDistCond;
1325 void setCounters(ArrayRef<Expr *> A);
1326 void setPrivateCounters(ArrayRef<Expr *> A);
1327 void setInits(ArrayRef<Expr *> A);
1328 void setUpdates(ArrayRef<Expr *> A);
1329 void setFinals(ArrayRef<Expr *> A);
1330 void setDependentCounters(ArrayRef<Expr *> A);
1331 void setDependentInits(ArrayRef<Expr *> A);
1332 void setFinalsConditions(ArrayRef<Expr *> A);
1335 Expr *getIterationVariable()
const {
1336 return cast<Expr>(
Data->getChildren()[IterationVariableOffset]);
1338 Expr *getLastIteration()
const {
1339 return cast<Expr>(
Data->getChildren()[LastIterationOffset]);
1341 Expr *getCalcLastIteration()
const {
1342 return cast<Expr>(
Data->getChildren()[CalcLastIterationOffset]);
1344 Expr *getPreCond()
const {
1345 return cast<Expr>(
Data->getChildren()[PreConditionOffset]);
1347 Expr *getCond()
const {
return cast<Expr>(
Data->getChildren()[CondOffset]); }
1348 Expr *getInit()
const {
return cast<Expr>(
Data->getChildren()[InitOffset]); }
1349 Expr *getInc()
const {
return cast<Expr>(
Data->getChildren()[IncOffset]); }
1350 const Stmt *getPreInits()
const {
1351 return Data->getChildren()[PreInitsOffset];
1353 Stmt *getPreInits() {
return Data->getChildren()[PreInitsOffset]; }
1354 Expr *getIsLastIterVariable()
const {
1359 "expected worksharing loop directive");
1360 return cast<Expr>(
Data->getChildren()[IsLastIterVariableOffset]);
1362 Expr *getLowerBoundVariable()
const {
1367 "expected worksharing loop directive");
1368 return cast<Expr>(
Data->getChildren()[LowerBoundVariableOffset]);
1370 Expr *getUpperBoundVariable()
const {
1375 "expected worksharing loop directive");
1376 return cast<Expr>(
Data->getChildren()[UpperBoundVariableOffset]);
1378 Expr *getStrideVariable()
const {
1383 "expected worksharing loop directive");
1384 return cast<Expr>(
Data->getChildren()[StrideVariableOffset]);
1386 Expr *getEnsureUpperBound()
const {
1391 "expected worksharing loop directive");
1392 return cast<Expr>(
Data->getChildren()[EnsureUpperBoundOffset]);
1394 Expr *getNextLowerBound()
const {
1399 "expected worksharing loop directive");
1400 return cast<Expr>(
Data->getChildren()[NextLowerBoundOffset]);
1402 Expr *getNextUpperBound()
const {
1407 "expected worksharing loop directive");
1408 return cast<Expr>(
Data->getChildren()[NextUpperBoundOffset]);
1410 Expr *getNumIterations()
const {
1415 "expected worksharing loop directive");
1416 return cast<Expr>(
Data->getChildren()[NumIterationsOffset]);
1418 Expr *getPrevLowerBoundVariable()
const {
1420 "expected loop bound sharing directive");
1421 return cast<Expr>(
Data->getChildren()[PrevLowerBoundVariableOffset]);
1423 Expr *getPrevUpperBoundVariable()
const {
1425 "expected loop bound sharing directive");
1426 return cast<Expr>(
Data->getChildren()[PrevUpperBoundVariableOffset]);
1428 Expr *getDistInc()
const {
1430 "expected loop bound sharing directive");
1431 return cast<Expr>(
Data->getChildren()[DistIncOffset]);
1433 Expr *getPrevEnsureUpperBound()
const {
1435 "expected loop bound sharing directive");
1436 return cast<Expr>(
Data->getChildren()[PrevEnsureUpperBoundOffset]);
1438 Expr *getCombinedLowerBoundVariable()
const {
1440 "expected loop bound sharing directive");
1441 return cast<Expr>(
Data->getChildren()[CombinedLowerBoundVariableOffset]);
1443 Expr *getCombinedUpperBoundVariable()
const {
1445 "expected loop bound sharing directive");
1446 return cast<Expr>(
Data->getChildren()[CombinedUpperBoundVariableOffset]);
1448 Expr *getCombinedEnsureUpperBound()
const {
1450 "expected loop bound sharing directive");
1451 return cast<Expr>(
Data->getChildren()[CombinedEnsureUpperBoundOffset]);
1453 Expr *getCombinedInit()
const {
1455 "expected loop bound sharing directive");
1456 return cast<Expr>(
Data->getChildren()[CombinedInitOffset]);
1458 Expr *getCombinedCond()
const {
1460 "expected loop bound sharing directive");
1461 return cast<Expr>(
Data->getChildren()[CombinedConditionOffset]);
1463 Expr *getCombinedNextLowerBound()
const {
1465 "expected loop bound sharing directive");
1466 return cast<Expr>(
Data->getChildren()[CombinedNextLowerBoundOffset]);
1468 Expr *getCombinedNextUpperBound()
const {
1470 "expected loop bound sharing directive");
1471 return cast<Expr>(
Data->getChildren()[CombinedNextUpperBoundOffset]);
1473 Expr *getCombinedDistCond()
const {
1475 "expected loop bound distribute sharing directive");
1476 return cast<Expr>(
Data->getChildren()[CombinedDistConditionOffset]);
1478 Expr *getCombinedParForInDistCond()
const {
1480 "expected loop bound distribute sharing directive");
1481 return cast<Expr>(
Data->getChildren()[CombinedParForInDistConditionOffset]);
1484 const Stmt *getBody()
const {
1485 return const_cast<OMPLoopDirective *
>(
this)->getBody();
1488 ArrayRef<Expr *> counters() {
return getCounters(); }
1490 ArrayRef<Expr *> counters()
const {
1491 return const_cast<OMPLoopDirective *
>(
this)->getCounters();
1494 ArrayRef<Expr *> private_counters() {
return getPrivateCounters(); }
1496 ArrayRef<Expr *> private_counters()
const {
1497 return const_cast<OMPLoopDirective *
>(
this)->getPrivateCounters();
1500 ArrayRef<Expr *> inits() {
return getInits(); }
1502 ArrayRef<Expr *> inits()
const {
1503 return const_cast<OMPLoopDirective *
>(
this)->getInits();
1506 ArrayRef<Expr *> updates() {
return getUpdates(); }
1508 ArrayRef<Expr *> updates()
const {
1509 return const_cast<OMPLoopDirective *
>(
this)->getUpdates();
1512 ArrayRef<Expr *> finals() {
return getFinals(); }
1514 ArrayRef<Expr *> finals()
const {
1515 return const_cast<OMPLoopDirective *
>(
this)->getFinals();
1518 ArrayRef<Expr *> dependent_counters() {
return getDependentCounters(); }
1520 ArrayRef<Expr *> dependent_counters()
const {
1521 return const_cast<OMPLoopDirective *
>(
this)->getDependentCounters();
1524 ArrayRef<Expr *> dependent_inits() {
return getDependentInits(); }
1526 ArrayRef<Expr *> dependent_inits()
const {
1527 return const_cast<OMPLoopDirective *
>(
this)->getDependentInits();
1530 ArrayRef<Expr *> finals_conditions() {
return getFinalsConditions(); }
1532 ArrayRef<Expr *> finals_conditions()
const {
1533 return const_cast<OMPLoopDirective *
>(
this)->getFinalsConditions();
1536 static bool classof(
const Stmt *T) {
1537 return T->getStmtClass() == OMPSimdDirectiveClass ||
1538 T->getStmtClass() == OMPForDirectiveClass ||
1539 T->getStmtClass() == OMPForSimdDirectiveClass ||
1540 T->getStmtClass() == OMPParallelForDirectiveClass ||
1541 T->getStmtClass() == OMPParallelForSimdDirectiveClass ||
1542 T->getStmtClass() == OMPTaskLoopDirectiveClass ||
1543 T->getStmtClass() == OMPTaskLoopSimdDirectiveClass ||
1544 T->getStmtClass() == OMPMaskedTaskLoopDirectiveClass ||
1545 T->getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass ||
1546 T->getStmtClass() == OMPMasterTaskLoopDirectiveClass ||
1547 T->getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass ||
1548 T->getStmtClass() == OMPGenericLoopDirectiveClass ||
1549 T->getStmtClass() == OMPTeamsGenericLoopDirectiveClass ||
1550 T->getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass ||
1551 T->getStmtClass() == OMPParallelGenericLoopDirectiveClass ||
1552 T->getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass ||
1553 T->getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass ||
1554 T->getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass ||
1555 T->getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass ||
1556 T->getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass ||
1557 T->getStmtClass() == OMPDistributeDirectiveClass ||
1558 T->getStmtClass() == OMPTargetParallelForDirectiveClass ||
1559 T->getStmtClass() == OMPDistributeParallelForDirectiveClass ||
1560 T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass ||
1561 T->getStmtClass() == OMPDistributeSimdDirectiveClass ||
1562 T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass ||
1563 T->getStmtClass() == OMPTargetSimdDirectiveClass ||
1564 T->getStmtClass() == OMPTeamsDistributeDirectiveClass ||
1565 T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass ||
1566 T->getStmtClass() ==
1567 OMPTeamsDistributeParallelForSimdDirectiveClass ||
1568 T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass ||
1569 T->getStmtClass() ==
1570 OMPTargetTeamsDistributeParallelForDirectiveClass ||
1571 T->getStmtClass() ==
1572 OMPTargetTeamsDistributeParallelForSimdDirectiveClass ||
1573 T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass ||
1574 T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
1587class OMPSimdDirective :
public OMPLoopDirective {
1588 friend class ASTStmtReader;
1589 friend class OMPExecutableDirective;
1596 OMPSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1597 unsigned CollapsedNum)
1598 : OMPLoopDirective(OMPSimdDirectiveClass, llvm::omp::OMPD_simd, StartLoc,
1599 EndLoc, CollapsedNum) {}
1605 explicit OMPSimdDirective(
unsigned CollapsedNum)
1606 : OMPLoopDirective(OMPSimdDirectiveClass, llvm::omp::OMPD_simd,
1607 SourceLocation(), SourceLocation(), CollapsedNum) {}
1620 static OMPSimdDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
1621 SourceLocation EndLoc,
unsigned CollapsedNum,
1622 ArrayRef<OMPClause *> Clauses,
1623 Stmt *AssociatedStmt,
1624 const HelperExprs &Exprs);
1633 static OMPSimdDirective *
CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
1634 unsigned CollapsedNum, EmptyShell);
1636 static bool classof(
const Stmt *T) {
1637 return T->getStmtClass() == OMPSimdDirectiveClass;
1650class OMPForDirective :
public OMPLoopDirective {
1651 friend class ASTStmtReader;
1652 friend class OMPExecutableDirective;
1654 bool HasCancel =
false;
1662 OMPForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1663 unsigned CollapsedNum)
1664 : OMPLoopDirective(OMPForDirectiveClass, llvm::omp::OMPD_for, StartLoc,
1665 EndLoc, CollapsedNum) {}
1671 explicit OMPForDirective(
unsigned CollapsedNum)
1672 : OMPLoopDirective(OMPForDirectiveClass, llvm::omp::OMPD_for,
1673 SourceLocation(), SourceLocation(), CollapsedNum) {}
1676 void setTaskReductionRefExpr(Expr *E) {
1677 Data->getChildren()[numLoopChildren(getLoopsNumber(),
1678 llvm::omp::OMPD_for)] = E;
1682 void setHasCancel(
bool Has) { HasCancel = Has; }
1698 static OMPForDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
1699 SourceLocation EndLoc,
unsigned CollapsedNum,
1700 ArrayRef<OMPClause *> Clauses,
1701 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
1702 Expr *TaskRedRef,
bool HasCancel);
1711 static OMPForDirective *
CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
1712 unsigned CollapsedNum, EmptyShell);
1715 Expr *getTaskReductionRefExpr() {
1716 return cast_or_null<Expr>(
Data->getChildren()[numLoopChildren(
1717 getLoopsNumber(), llvm::omp::OMPD_for)]);
1719 const Expr *getTaskReductionRefExpr()
const {
1720 return const_cast<OMPForDirective *
>(
this)->getTaskReductionRefExpr();
1724 bool hasCancel()
const {
return HasCancel; }
1726 static bool classof(
const Stmt *T) {
1727 return T->getStmtClass() == OMPForDirectiveClass;
1740class OMPForSimdDirective :
public OMPLoopDirective {
1741 friend class ASTStmtReader;
1742 friend class OMPExecutableDirective;
1749 OMPForSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1750 unsigned CollapsedNum)
1751 : OMPLoopDirective(OMPForSimdDirectiveClass, llvm::omp::OMPD_for_simd,
1752 StartLoc, EndLoc, CollapsedNum) {}
1758 explicit OMPForSimdDirective(
unsigned CollapsedNum)
1759 : OMPLoopDirective(OMPForSimdDirectiveClass, llvm::omp::OMPD_for_simd,
1760 SourceLocation(), SourceLocation(), CollapsedNum) {}
1773 static OMPForSimdDirective *
1774 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1775 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
1776 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
1785 static OMPForSimdDirective *
CreateEmpty(
const ASTContext &C,
1786 unsigned NumClauses,
1787 unsigned CollapsedNum, EmptyShell);
1789 static bool classof(
const Stmt *T) {
1790 return T->getStmtClass() == OMPForSimdDirectiveClass;
1803class OMPSectionsDirective :
public OMPExecutableDirective {
1804 friend class ASTStmtReader;
1805 friend class OMPExecutableDirective;
1808 bool HasCancel =
false;
1815 OMPSectionsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1816 : OMPExecutableDirective(OMPSectionsDirectiveClass,
1817 llvm::omp::OMPD_sections, StartLoc, EndLoc) {}
1821 explicit OMPSectionsDirective()
1822 : OMPExecutableDirective(OMPSectionsDirectiveClass,
1823 llvm::omp::OMPD_sections, SourceLocation(),
1824 SourceLocation()) {}
1827 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
1830 void setHasCancel(
bool Has) { HasCancel = Has; }
1844 static OMPSectionsDirective *
1845 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1846 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
1855 static OMPSectionsDirective *
CreateEmpty(
const ASTContext &C,
1856 unsigned NumClauses, EmptyShell);
1859 Expr *getTaskReductionRefExpr() {
1860 return cast_or_null<Expr>(
Data->getChildren()[0]);
1862 const Expr *getTaskReductionRefExpr()
const {
1863 return const_cast<OMPSectionsDirective *
>(
this)->getTaskReductionRefExpr();
1867 bool hasCancel()
const {
return HasCancel; }
1869 static bool classof(
const Stmt *T) {
1870 return T->getStmtClass() == OMPSectionsDirectiveClass;
1880class OMPSectionDirective :
public OMPExecutableDirective {
1881 friend class ASTStmtReader;
1882 friend class OMPExecutableDirective;
1885 bool HasCancel =
false;
1892 OMPSectionDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1893 : OMPExecutableDirective(OMPSectionDirectiveClass,
1894 llvm::omp::OMPD_section, StartLoc, EndLoc) {}
1898 explicit OMPSectionDirective()
1899 : OMPExecutableDirective(OMPSectionDirectiveClass,
1900 llvm::omp::OMPD_section, SourceLocation(),
1901 SourceLocation()) {}
1912 static OMPSectionDirective *
Create(
const ASTContext &C,
1913 SourceLocation StartLoc,
1914 SourceLocation EndLoc,
1915 Stmt *AssociatedStmt,
bool HasCancel);
1921 static OMPSectionDirective *
CreateEmpty(
const ASTContext &C, EmptyShell);
1924 void setHasCancel(
bool Has) { HasCancel = Has; }
1927 bool hasCancel()
const {
return HasCancel; }
1929 static bool classof(
const Stmt *T) {
1930 return T->getStmtClass() == OMPSectionDirectiveClass;
1941class OMPScopeDirective final :
public OMPExecutableDirective {
1942 friend class ASTStmtReader;
1943 friend class OMPExecutableDirective;
1950 OMPScopeDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1951 : OMPExecutableDirective(OMPScopeDirectiveClass, llvm::omp::OMPD_scope,
1952 StartLoc, EndLoc) {}
1956 explicit OMPScopeDirective()
1957 : OMPExecutableDirective(OMPScopeDirectiveClass, llvm::omp::OMPD_scope,
1958 SourceLocation(), SourceLocation()) {}
1968 static OMPScopeDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
1969 SourceLocation EndLoc,
1970 ArrayRef<OMPClause *> Clauses,
1971 Stmt *AssociatedStmt);
1977 static OMPScopeDirective *
CreateEmpty(
const ASTContext &C,
1978 unsigned NumClauses, EmptyShell);
1980 static bool classof(
const Stmt *T) {
1981 return T->getStmtClass() == OMPScopeDirectiveClass;
1993class OMPSingleDirective :
public OMPExecutableDirective {
1994 friend class ASTStmtReader;
1995 friend class OMPExecutableDirective;
2001 OMPSingleDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2002 : OMPExecutableDirective(OMPSingleDirectiveClass, llvm::omp::OMPD_single,
2003 StartLoc, EndLoc) {}
2007 explicit OMPSingleDirective()
2008 : OMPExecutableDirective(OMPSingleDirectiveClass, llvm::omp::OMPD_single,
2009 SourceLocation(), SourceLocation()) {}
2020 static OMPSingleDirective *
2021 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2022 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2030 static OMPSingleDirective *
CreateEmpty(
const ASTContext &C,
2031 unsigned NumClauses, EmptyShell);
2033 static bool classof(
const Stmt *T) {
2034 return T->getStmtClass() == OMPSingleDirectiveClass;
2044class OMPMasterDirective :
public OMPExecutableDirective {
2045 friend class ASTStmtReader;
2046 friend class OMPExecutableDirective;
2052 OMPMasterDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2053 : OMPExecutableDirective(OMPMasterDirectiveClass, llvm::omp::OMPD_master,
2054 StartLoc, EndLoc) {}
2058 explicit OMPMasterDirective()
2059 : OMPExecutableDirective(OMPMasterDirectiveClass, llvm::omp::OMPD_master,
2060 SourceLocation(), SourceLocation()) {}
2070 static OMPMasterDirective *
Create(
const ASTContext &C,
2071 SourceLocation StartLoc,
2072 SourceLocation EndLoc,
2073 Stmt *AssociatedStmt);
2079 static OMPMasterDirective *
CreateEmpty(
const ASTContext &C, EmptyShell);
2081 static bool classof(
const Stmt *T) {
2082 return T->getStmtClass() == OMPMasterDirectiveClass;
2092class OMPCriticalDirective :
public OMPExecutableDirective {
2093 friend class ASTStmtReader;
2094 friend class OMPExecutableDirective;
2096 DeclarationNameInfo DirName;
2103 OMPCriticalDirective(
const DeclarationNameInfo &Name, SourceLocation StartLoc,
2104 SourceLocation EndLoc)
2105 : OMPExecutableDirective(OMPCriticalDirectiveClass,
2106 llvm::omp::OMPD_critical, StartLoc, EndLoc),
2111 explicit OMPCriticalDirective()
2112 : OMPExecutableDirective(OMPCriticalDirectiveClass,
2113 llvm::omp::OMPD_critical, SourceLocation(),
2114 SourceLocation()) {}
2120 void setDirectiveName(
const DeclarationNameInfo &Name) { DirName = Name; }
2132 static OMPCriticalDirective *
2133 Create(
const ASTContext &C,
const DeclarationNameInfo &Name,
2134 SourceLocation StartLoc, SourceLocation EndLoc,
2135 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2142 static OMPCriticalDirective *
CreateEmpty(
const ASTContext &C,
2143 unsigned NumClauses, EmptyShell);
2147 DeclarationNameInfo getDirectiveName()
const {
return DirName; }
2149 static bool classof(
const Stmt *T) {
2150 return T->getStmtClass() == OMPCriticalDirectiveClass;
2163class OMPParallelForDirective :
public OMPLoopDirective {
2164 friend class ASTStmtReader;
2165 friend class OMPExecutableDirective;
2168 bool HasCancel =
false;
2176 OMPParallelForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2177 unsigned CollapsedNum)
2178 : OMPLoopDirective(OMPParallelForDirectiveClass,
2179 llvm::omp::OMPD_parallel_for, StartLoc, EndLoc,
2186 explicit OMPParallelForDirective(
unsigned CollapsedNum)
2187 : OMPLoopDirective(OMPParallelForDirectiveClass,
2188 llvm::omp::OMPD_parallel_for, SourceLocation(),
2189 SourceLocation(), CollapsedNum) {}
2192 void setTaskReductionRefExpr(Expr *E) {
2193 Data->getChildren()[numLoopChildren(getLoopsNumber(),
2194 llvm::omp::OMPD_parallel_for)] = E;
2198 void setHasCancel(
bool Has) { HasCancel = Has; }
2214 static OMPParallelForDirective *
2215 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2216 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2217 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
2227 static OMPParallelForDirective *
CreateEmpty(
const ASTContext &C,
2228 unsigned NumClauses,
2229 unsigned CollapsedNum,
2233 Expr *getTaskReductionRefExpr() {
2234 return cast_or_null<Expr>(
Data->getChildren()[numLoopChildren(
2235 getLoopsNumber(), llvm::omp::OMPD_parallel_for)]);
2237 const Expr *getTaskReductionRefExpr()
const {
2238 return const_cast<OMPParallelForDirective *
>(
this)
2239 ->getTaskReductionRefExpr();
2243 bool hasCancel()
const {
return HasCancel; }
2245 static bool classof(
const Stmt *T) {
2246 return T->getStmtClass() == OMPParallelForDirectiveClass;
2260class OMPParallelForSimdDirective :
public OMPLoopDirective {
2261 friend class ASTStmtReader;
2262 friend class OMPExecutableDirective;
2269 OMPParallelForSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2270 unsigned CollapsedNum)
2271 : OMPLoopDirective(OMPParallelForSimdDirectiveClass,
2272 llvm::omp::OMPD_parallel_for_simd, StartLoc, EndLoc,
2279 explicit OMPParallelForSimdDirective(
unsigned CollapsedNum)
2280 : OMPLoopDirective(OMPParallelForSimdDirectiveClass,
2281 llvm::omp::OMPD_parallel_for_simd, SourceLocation(),
2282 SourceLocation(), CollapsedNum) {}
2295 static OMPParallelForSimdDirective *
2296 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2297 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2298 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
2307 static OMPParallelForSimdDirective *
CreateEmpty(
const ASTContext &C,
2308 unsigned NumClauses,
2309 unsigned CollapsedNum,
2312 static bool classof(
const Stmt *T) {
2313 return T->getStmtClass() == OMPParallelForSimdDirectiveClass;
2325class OMPParallelMasterDirective :
public OMPExecutableDirective {
2326 friend class ASTStmtReader;
2327 friend class OMPExecutableDirective;
2329 OMPParallelMasterDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2330 : OMPExecutableDirective(OMPParallelMasterDirectiveClass,
2331 llvm::omp::OMPD_parallel_master, StartLoc,
2334 explicit OMPParallelMasterDirective()
2335 : OMPExecutableDirective(OMPParallelMasterDirectiveClass,
2336 llvm::omp::OMPD_parallel_master,
2337 SourceLocation(), SourceLocation()) {}
2340 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2353 static OMPParallelMasterDirective *
2354 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2355 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);
2363 static OMPParallelMasterDirective *
2364 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2367 Expr *getTaskReductionRefExpr() {
2368 return cast_or_null<Expr>(
Data->getChildren()[0]);
2370 const Expr *getTaskReductionRefExpr()
const {
2371 return const_cast<OMPParallelMasterDirective *
>(
this)
2372 ->getTaskReductionRefExpr();
2375 static bool classof(
const Stmt *T) {
2376 return T->getStmtClass() == OMPParallelMasterDirectiveClass;
2388class OMPParallelMaskedDirective final :
public OMPExecutableDirective {
2389 friend class ASTStmtReader;
2390 friend class OMPExecutableDirective;
2392 OMPParallelMaskedDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2393 : OMPExecutableDirective(OMPParallelMaskedDirectiveClass,
2394 llvm::omp::OMPD_parallel_masked, StartLoc,
2397 explicit OMPParallelMaskedDirective()
2398 : OMPExecutableDirective(OMPParallelMaskedDirectiveClass,
2399 llvm::omp::OMPD_parallel_masked,
2400 SourceLocation(), SourceLocation()) {}
2403 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2416 static OMPParallelMaskedDirective *
2417 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2418 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);
2426 static OMPParallelMaskedDirective *
2427 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2430 Expr *getTaskReductionRefExpr() {
2431 return cast_or_null<Expr>(
Data->getChildren()[0]);
2433 const Expr *getTaskReductionRefExpr()
const {
2434 return const_cast<OMPParallelMaskedDirective *
>(
this)
2435 ->getTaskReductionRefExpr();
2438 static bool classof(
const Stmt *T) {
2439 return T->getStmtClass() == OMPParallelMaskedDirectiveClass;
2452class OMPParallelSectionsDirective :
public OMPExecutableDirective {
2453 friend class ASTStmtReader;
2454 friend class OMPExecutableDirective;
2457 bool HasCancel =
false;
2464 OMPParallelSectionsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2465 : OMPExecutableDirective(OMPParallelSectionsDirectiveClass,
2466 llvm::omp::OMPD_parallel_sections, StartLoc,
2471 explicit OMPParallelSectionsDirective()
2472 : OMPExecutableDirective(OMPParallelSectionsDirectiveClass,
2473 llvm::omp::OMPD_parallel_sections,
2474 SourceLocation(), SourceLocation()) {}
2477 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2480 void setHasCancel(
bool Has) { HasCancel = Has; }
2494 static OMPParallelSectionsDirective *
2495 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2496 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
2505 static OMPParallelSectionsDirective *
2506 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2509 Expr *getTaskReductionRefExpr() {
2510 return cast_or_null<Expr>(
Data->getChildren()[0]);
2512 const Expr *getTaskReductionRefExpr()
const {
2513 return const_cast<OMPParallelSectionsDirective *
>(
this)
2514 ->getTaskReductionRefExpr();
2518 bool hasCancel()
const {
return HasCancel; }
2520 static bool classof(
const Stmt *T) {
2521 return T->getStmtClass() == OMPParallelSectionsDirectiveClass;
2533class OMPTaskDirective :
public OMPExecutableDirective {
2534 friend class ASTStmtReader;
2535 friend class OMPExecutableDirective;
2537 bool HasCancel =
false;
2544 OMPTaskDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2545 : OMPExecutableDirective(OMPTaskDirectiveClass, llvm::omp::OMPD_task,
2546 StartLoc, EndLoc) {}
2550 explicit OMPTaskDirective()
2551 : OMPExecutableDirective(OMPTaskDirectiveClass, llvm::omp::OMPD_task,
2552 SourceLocation(), SourceLocation()) {}
2555 void setHasCancel(
bool Has) { HasCancel = Has; }
2567 static OMPTaskDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
2568 SourceLocation EndLoc,
2569 ArrayRef<OMPClause *> Clauses,
2570 Stmt *AssociatedStmt,
bool HasCancel);
2578 static OMPTaskDirective *
CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
2582 bool hasCancel()
const {
return HasCancel; }
2584 static bool classof(
const Stmt *T) {
2585 return T->getStmtClass() == OMPTaskDirectiveClass;
2595class OMPTaskyieldDirective :
public OMPExecutableDirective {
2596 friend class ASTStmtReader;
2597 friend class OMPExecutableDirective;
2603 OMPTaskyieldDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2604 : OMPExecutableDirective(OMPTaskyieldDirectiveClass,
2605 llvm::omp::OMPD_taskyield, StartLoc, EndLoc) {}
2609 explicit OMPTaskyieldDirective()
2610 : OMPExecutableDirective(OMPTaskyieldDirectiveClass,
2611 llvm::omp::OMPD_taskyield, SourceLocation(),
2612 SourceLocation()) {}
2621 static OMPTaskyieldDirective *
2622 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc);
2628 static OMPTaskyieldDirective *
CreateEmpty(
const ASTContext &C, EmptyShell);
2630 static bool classof(
const Stmt *T) {
2631 return T->getStmtClass() == OMPTaskyieldDirectiveClass;
2641class OMPBarrierDirective :
public OMPExecutableDirective {
2642 friend class ASTStmtReader;
2643 friend class OMPExecutableDirective;
2649 OMPBarrierDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2650 : OMPExecutableDirective(OMPBarrierDirectiveClass,
2651 llvm::omp::OMPD_barrier, StartLoc, EndLoc) {}
2655 explicit OMPBarrierDirective()
2656 : OMPExecutableDirective(OMPBarrierDirectiveClass,
2657 llvm::omp::OMPD_barrier, SourceLocation(),
2658 SourceLocation()) {}
2667 static OMPBarrierDirective *
2668 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc);
2674 static OMPBarrierDirective *
CreateEmpty(
const ASTContext &C, EmptyShell);
2676 static bool classof(
const Stmt *T) {
2677 return T->getStmtClass() == OMPBarrierDirectiveClass;
2687class OMPTaskwaitDirective :
public OMPExecutableDirective {
2688 friend class ASTStmtReader;
2689 friend class OMPExecutableDirective;
2695 OMPTaskwaitDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2696 : OMPExecutableDirective(OMPTaskwaitDirectiveClass,
2697 llvm::omp::OMPD_taskwait, StartLoc, EndLoc) {}
2701 explicit OMPTaskwaitDirective()
2702 : OMPExecutableDirective(OMPTaskwaitDirectiveClass,
2703 llvm::omp::OMPD_taskwait, SourceLocation(),
2704 SourceLocation()) {}
2714 static OMPTaskwaitDirective *
Create(
const ASTContext &C,
2715 SourceLocation StartLoc,
2716 SourceLocation EndLoc,
2717 ArrayRef<OMPClause *> Clauses);
2724 static OMPTaskwaitDirective *
CreateEmpty(
const ASTContext &C,
2725 unsigned NumClauses, EmptyShell);
2727 static bool classof(
const Stmt *T) {
2728 return T->getStmtClass() == OMPTaskwaitDirectiveClass;
2738class OMPTaskgroupDirective :
public OMPExecutableDirective {
2739 friend class ASTStmtReader;
2740 friend class OMPExecutableDirective;
2746 OMPTaskgroupDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2747 : OMPExecutableDirective(OMPTaskgroupDirectiveClass,
2748 llvm::omp::OMPD_taskgroup, StartLoc, EndLoc) {}
2752 explicit OMPTaskgroupDirective()
2753 : OMPExecutableDirective(OMPTaskgroupDirectiveClass,
2754 llvm::omp::OMPD_taskgroup, SourceLocation(),
2755 SourceLocation()) {}
2758 void setReductionRef(Expr *RR) {
Data->getChildren()[0] = RR; }
2770 static OMPTaskgroupDirective *
2771 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2772 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2773 Expr *ReductionRef);
2780 static OMPTaskgroupDirective *
CreateEmpty(
const ASTContext &C,
2781 unsigned NumClauses, EmptyShell);
2785 const Expr *getReductionRef()
const {
2786 return const_cast<OMPTaskgroupDirective *
>(
this)->getReductionRef();
2788 Expr *getReductionRef() {
return cast_or_null<Expr>(
Data->getChildren()[0]); }
2790 static bool classof(
const Stmt *T) {
2791 return T->getStmtClass() == OMPTaskgroupDirectiveClass;
2805class OMPFlushDirective :
public OMPExecutableDirective {
2806 friend class ASTStmtReader;
2807 friend class OMPExecutableDirective;
2813 OMPFlushDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2814 : OMPExecutableDirective(OMPFlushDirectiveClass, llvm::omp::OMPD_flush,
2815 StartLoc, EndLoc) {}
2819 explicit OMPFlushDirective()
2820 : OMPExecutableDirective(OMPFlushDirectiveClass, llvm::omp::OMPD_flush,
2821 SourceLocation(), SourceLocation()) {}
2832 static OMPFlushDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
2833 SourceLocation EndLoc,
2834 ArrayRef<OMPClause *> Clauses);
2842 static OMPFlushDirective *
CreateEmpty(
const ASTContext &C,
2843 unsigned NumClauses, EmptyShell);
2845 static bool classof(
const Stmt *T) {
2846 return T->getStmtClass() == OMPFlushDirectiveClass;
2857class OMPDepobjDirective final :
public OMPExecutableDirective {
2858 friend class ASTStmtReader;
2859 friend class OMPExecutableDirective;
2866 OMPDepobjDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2867 : OMPExecutableDirective(OMPDepobjDirectiveClass, llvm::omp::OMPD_depobj,
2868 StartLoc, EndLoc) {}
2872 explicit OMPDepobjDirective()
2873 : OMPExecutableDirective(OMPDepobjDirectiveClass, llvm::omp::OMPD_depobj,
2874 SourceLocation(), SourceLocation()) {}
2884 static OMPDepobjDirective *
Create(
const ASTContext &C,
2885 SourceLocation StartLoc,
2886 SourceLocation EndLoc,
2887 ArrayRef<OMPClause *> Clauses);
2895 static OMPDepobjDirective *
CreateEmpty(
const ASTContext &C,
2896 unsigned NumClauses, EmptyShell);
2898 static bool classof(
const Stmt *T) {
2899 return T->getStmtClass() == OMPDepobjDirectiveClass;
2909class OMPOrderedDirective :
public OMPExecutableDirective {
2910 friend class ASTStmtReader;
2911 friend class OMPExecutableDirective;
2917 OMPOrderedDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2918 : OMPExecutableDirective(OMPOrderedDirectiveClass,
2919 llvm::omp::OMPD_ordered, StartLoc, EndLoc) {}
2923 explicit OMPOrderedDirective()
2924 : OMPExecutableDirective(OMPOrderedDirectiveClass,
2925 llvm::omp::OMPD_ordered, SourceLocation(),
2926 SourceLocation()) {}
2937 static OMPOrderedDirective *
2938 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2939 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2947 static OMPOrderedDirective *
CreateEmpty(
const ASTContext &C,
2948 unsigned NumClauses,
2949 bool IsStandalone, EmptyShell);
2951 static bool classof(
const Stmt *T) {
2952 return T->getStmtClass() == OMPOrderedDirectiveClass;
2963class OMPAtomicDirective :
public OMPExecutableDirective {
2964 friend class ASTStmtReader;
2965 friend class OMPExecutableDirective;
2977 LLVM_PREFERRED_TYPE(
bool)
2987 LLVM_PREFERRED_TYPE(
bool)
2991 LLVM_PREFERRED_TYPE(
bool)
3000 OMPAtomicDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3001 : OMPExecutableDirective(OMPAtomicDirectiveClass, llvm::omp::OMPD_atomic,
3002 StartLoc, EndLoc) {}
3006 explicit OMPAtomicDirective()
3007 : OMPExecutableDirective(OMPAtomicDirectiveClass, llvm::omp::OMPD_atomic,
3008 SourceLocation(), SourceLocation()) {}
3010 enum DataPositionTy :
size_t {
3021 void setX(Expr *
X) {
Data->getChildren()[DataPositionTy::POS_X] =
X; }
3025 void setUpdateExpr(Expr *UE) {
3026 Data->getChildren()[DataPositionTy::POS_UpdateExpr] = UE;
3029 void setV(Expr *
V) {
Data->getChildren()[DataPositionTy::POS_V] =
V; }
3031 void setR(Expr *R) {
Data->getChildren()[DataPositionTy::POS_R] = R; }
3033 void setExpr(Expr *E) {
Data->getChildren()[DataPositionTy::POS_E] = E; }
3035 void setD(Expr *D) {
Data->getChildren()[DataPositionTy::POS_D] = D; }
3037 void setCond(Expr *C) {
Data->getChildren()[DataPositionTy::POS_Cond] =
C; }
3040 struct Expressions {
3077 SourceLocation StartLoc,
3078 SourceLocation EndLoc,
3080 Stmt *AssociatedStmt, Expressions Exprs);
3089 unsigned NumClauses, EmptyShell);
3093 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_X]);
3095 const Expr *
getX()
const {
3096 return cast_or_null<Expr>(
Data->getChildren()[DataPositionTy::POS_X]);
3102 return cast_or_null<Expr>(
3103 Data->getChildren()[DataPositionTy::POS_UpdateExpr]);
3106 return cast_or_null<Expr>(
3107 Data->getChildren()[DataPositionTy::POS_UpdateExpr]);
3121 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_V]);
3123 const Expr *
getV()
const {
3124 return cast_or_null<Expr>(
Data->getChildren()[DataPositionTy::POS_V]);
3128 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_R]);
3130 const Expr *
getR()
const {
3131 return cast_or_null<Expr>(
Data->getChildren()[DataPositionTy::POS_R]);
3135 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_E]);
3138 return cast_or_null<Expr>(
Data->getChildren()[DataPositionTy::POS_E]);
3142 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_D]);
3144 Expr *
getD()
const {
3145 return cast_or_null<Expr>(
Data->getChildren()[DataPositionTy::POS_D]);
3149 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_Cond]);
3152 return cast_or_null<Expr>(
Data->getChildren()[DataPositionTy::POS_Cond]);
3156 return T->getStmtClass() == OMPAtomicDirectiveClass;
3176 OMPTargetDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3178 StartLoc, EndLoc) {}
3184 SourceLocation(), SourceLocation()) {}
3195 static OMPTargetDirective *
3196 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3197 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3205 static OMPTargetDirective *
CreateEmpty(
const ASTContext &C,
3206 unsigned NumClauses, EmptyShell);
3209 return T->getStmtClass() == OMPTargetDirectiveClass;
3230 OMPTargetDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3232 llvm::omp::OMPD_target_data, StartLoc, EndLoc) {}
3238 llvm::omp::OMPD_target_data, SourceLocation(),
3239 SourceLocation()) {}
3250 static OMPTargetDataDirective *
3251 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3252 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3259 static OMPTargetDataDirective *
CreateEmpty(
const ASTContext &C,
unsigned N,
3263 return T->getStmtClass() == OMPTargetDataDirectiveClass;
3284 OMPTargetEnterDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3286 llvm::omp::OMPD_target_enter_data, StartLoc,
3293 llvm::omp::OMPD_target_enter_data,
3294 SourceLocation(), SourceLocation()) {}
3305 static OMPTargetEnterDataDirective *
3306 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3307 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3314 static OMPTargetEnterDataDirective *
CreateEmpty(
const ASTContext &C,
3315 unsigned N, EmptyShell);
3318 return T->getStmtClass() == OMPTargetEnterDataDirectiveClass;
3339 OMPTargetExitDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3341 llvm::omp::OMPD_target_exit_data, StartLoc,
3348 llvm::omp::OMPD_target_exit_data,
3349 SourceLocation(), SourceLocation()) {}
3360 static OMPTargetExitDataDirective *
3361 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3362 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3369 static OMPTargetExitDataDirective *
CreateEmpty(
const ASTContext &C,
3370 unsigned N, EmptyShell);
3373 return T->getStmtClass() == OMPTargetExitDataDirectiveClass;
3389 bool HasCancel =
false;
3396 OMPTargetParallelDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3398 llvm::omp::OMPD_target_parallel, StartLoc,
3405 llvm::omp::OMPD_target_parallel,
3406 SourceLocation(), SourceLocation()) {}
3409 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
3411 void setHasCancel(
bool Has) { HasCancel = Has; }
3425 static OMPTargetParallelDirective *
3426 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3427 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
3436 static OMPTargetParallelDirective *
3437 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
3441 return cast_or_null<Expr>(Data->getChildren()[0]);
3444 return const_cast<OMPTargetParallelDirective *
>(
this)
3452 return T->getStmtClass() == OMPTargetParallelDirectiveClass;
3470 bool HasCancel =
false;
3478 OMPTargetParallelForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3479 unsigned CollapsedNum)
3481 llvm::omp::OMPD_target_parallel_for, StartLoc, EndLoc,
3490 llvm::omp::OMPD_target_parallel_for, SourceLocation(),
3491 SourceLocation(), CollapsedNum) {}
3494 void setTaskReductionRefExpr(Expr *E) {
3495 Data->getChildren()[numLoopChildren(
3496 getLoopsNumber(), llvm::omp::OMPD_target_parallel_for)] = E;
3500 void setHasCancel(
bool Has) { HasCancel = Has; }
3516 static OMPTargetParallelForDirective *
3517 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3518 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3519 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
3529 static OMPTargetParallelForDirective *
CreateEmpty(
const ASTContext &C,
3530 unsigned NumClauses,
3531 unsigned CollapsedNum,
3536 return cast_or_null<Expr>(Data->getChildren()[numLoopChildren(
3537 getLoopsNumber(), llvm::omp::OMPD_target_parallel_for)]);
3540 return const_cast<OMPTargetParallelForDirective *
>(
this)
3548 return T->getStmtClass() == OMPTargetParallelForDirectiveClass;
3568 OMPTeamsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3570 StartLoc, EndLoc) {}
3576 SourceLocation(), SourceLocation()) {}
3587 static OMPTeamsDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
3588 SourceLocation EndLoc,
3589 ArrayRef<OMPClause *> Clauses,
3590 Stmt *AssociatedStmt);
3598 static OMPTeamsDirective *
CreateEmpty(
const ASTContext &C,
3599 unsigned NumClauses, EmptyShell);
3602 return T->getStmtClass() == OMPTeamsDirectiveClass;
3616 OpenMPDirectiveKind CancelRegion = llvm::omp::OMPD_unknown;
3623 OMPCancellationPointDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3625 llvm::omp::OMPD_cancellation_point, StartLoc,
3631 llvm::omp::OMPD_cancellation_point,
3632 SourceLocation(), SourceLocation()) {}
3636 void setCancelRegion(OpenMPDirectiveKind CR) { CancelRegion = CR; }
3645 static OMPCancellationPointDirective *
3646 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3647 OpenMPDirectiveKind CancelRegion);
3653 static OMPCancellationPointDirective *
CreateEmpty(
const ASTContext &C,
3660 return T->getStmtClass() == OMPCancellationPointDirectiveClass;
3674 OpenMPDirectiveKind CancelRegion = llvm::omp::OMPD_unknown;
3680 OMPCancelDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3682 StartLoc, EndLoc) {}
3688 SourceLocation(), SourceLocation()) {}
3692 void setCancelRegion(OpenMPDirectiveKind CR) { CancelRegion = CR; }
3702 static OMPCancelDirective *
3703 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3704 ArrayRef<OMPClause *> Clauses, OpenMPDirectiveKind CancelRegion);
3711 static OMPCancelDirective *
CreateEmpty(
const ASTContext &C,
3712 unsigned NumClauses, EmptyShell);
3718 return T->getStmtClass() == OMPCancelDirectiveClass;
3735 bool HasCancel =
false;
3743 OMPTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3744 unsigned CollapsedNum)
3746 StartLoc, EndLoc, CollapsedNum) {}
3754 SourceLocation(), SourceLocation(), CollapsedNum) {}
3757 void setHasCancel(
bool Has) { HasCancel = Has; }
3771 static OMPTaskLoopDirective *
3772 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3773 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3774 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
3783 static OMPTaskLoopDirective *
CreateEmpty(
const ASTContext &C,
3784 unsigned NumClauses,
3785 unsigned CollapsedNum, EmptyShell);
3791 return T->getStmtClass() == OMPTaskLoopDirectiveClass;
3813 OMPTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3814 unsigned CollapsedNum)
3816 llvm::omp::OMPD_taskloop_simd, StartLoc, EndLoc,
3825 llvm::omp::OMPD_taskloop_simd, SourceLocation(),
3826 SourceLocation(), CollapsedNum) {}
3839 static OMPTaskLoopSimdDirective *
3840 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3841 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3842 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
3851 static OMPTaskLoopSimdDirective *
CreateEmpty(
const ASTContext &C,
3852 unsigned NumClauses,
3853 unsigned CollapsedNum,
3857 return T->getStmtClass() == OMPTaskLoopSimdDirectiveClass;
3874 bool HasCancel =
false;
3882 OMPMasterTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3883 unsigned CollapsedNum)
3885 llvm::omp::OMPD_master_taskloop, StartLoc, EndLoc,
3894 llvm::omp::OMPD_master_taskloop, SourceLocation(),
3895 SourceLocation(), CollapsedNum) {}
3898 void setHasCancel(
bool Has) { HasCancel = Has; }
3912 static OMPMasterTaskLoopDirective *
3913 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3914 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3915 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
3924 static OMPMasterTaskLoopDirective *
CreateEmpty(
const ASTContext &C,
3925 unsigned NumClauses,
3926 unsigned CollapsedNum,
3933 return T->getStmtClass() == OMPMasterTaskLoopDirectiveClass;
3950 bool HasCancel =
false;
3958 OMPMaskedTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3959 unsigned CollapsedNum)
3961 llvm::omp::OMPD_masked_taskloop, StartLoc, EndLoc,
3970 llvm::omp::OMPD_masked_taskloop, SourceLocation(),
3971 SourceLocation(), CollapsedNum) {}
3974 void setHasCancel(
bool Has) { HasCancel = Has; }
3988 static OMPMaskedTaskLoopDirective *
3989 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3990 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3991 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4000 static OMPMaskedTaskLoopDirective *
CreateEmpty(
const ASTContext &C,
4001 unsigned NumClauses,
4002 unsigned CollapsedNum,
4009 return T->getStmtClass() == OMPMaskedTaskLoopDirectiveClass;
4031 OMPMasterTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4032 unsigned CollapsedNum)
4034 llvm::omp::OMPD_master_taskloop_simd, StartLoc, EndLoc,
4043 llvm::omp::OMPD_master_taskloop_simd, SourceLocation(),
4044 SourceLocation(), CollapsedNum) {}
4057 static OMPMasterTaskLoopSimdDirective *
4058 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4059 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4060 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4068 static OMPMasterTaskLoopSimdDirective *
CreateEmpty(
const ASTContext &C,
4069 unsigned NumClauses,
4070 unsigned CollapsedNum,
4074 return T->getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass;
4096 OMPMaskedTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4097 unsigned CollapsedNum)
4099 llvm::omp::OMPD_masked_taskloop_simd, StartLoc, EndLoc,
4108 llvm::omp::OMPD_masked_taskloop_simd, SourceLocation(),
4109 SourceLocation(), CollapsedNum) {}
4122 static OMPMaskedTaskLoopSimdDirective *
4123 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4124 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4125 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4133 static OMPMaskedTaskLoopSimdDirective *
CreateEmpty(
const ASTContext &C,
4134 unsigned NumClauses,
4135 unsigned CollapsedNum,
4139 return T->getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass;
4157 bool HasCancel =
false;
4165 OMPParallelMasterTaskLoopDirective(SourceLocation StartLoc,
4166 SourceLocation EndLoc,
4167 unsigned CollapsedNum)
4169 llvm::omp::OMPD_parallel_master_taskloop, StartLoc,
4170 EndLoc, CollapsedNum) {}
4178 llvm::omp::OMPD_parallel_master_taskloop,
4179 SourceLocation(), SourceLocation(), CollapsedNum) {}
4182 void setHasCancel(
bool Has) { HasCancel = Has; }
4196 static OMPParallelMasterTaskLoopDirective *
4197 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4198 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4199 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4208 static OMPParallelMasterTaskLoopDirective *
CreateEmpty(
const ASTContext &C,
4209 unsigned NumClauses,
4210 unsigned CollapsedNum,
4217 return T->getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass;
4235 bool HasCancel =
false;
4243 OMPParallelMaskedTaskLoopDirective(SourceLocation StartLoc,
4244 SourceLocation EndLoc,
4245 unsigned CollapsedNum)
4247 llvm::omp::OMPD_parallel_masked_taskloop, StartLoc,
4248 EndLoc, CollapsedNum) {}
4256 llvm::omp::OMPD_parallel_masked_taskloop,
4257 SourceLocation(), SourceLocation(), CollapsedNum) {}
4260 void setHasCancel(
bool Has) { HasCancel = Has; }
4274 static OMPParallelMaskedTaskLoopDirective *
4275 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4276 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4277 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4286 static OMPParallelMaskedTaskLoopDirective *
CreateEmpty(
const ASTContext &C,
4287 unsigned NumClauses,
4288 unsigned CollapsedNum,
4295 return T->getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass;
4318 OMPParallelMasterTaskLoopSimdDirective(SourceLocation StartLoc,
4319 SourceLocation EndLoc,
4320 unsigned CollapsedNum)
4322 llvm::omp::OMPD_parallel_master_taskloop_simd,
4323 StartLoc, EndLoc, CollapsedNum) {}
4331 llvm::omp::OMPD_parallel_master_taskloop_simd,
4332 SourceLocation(), SourceLocation(), CollapsedNum) {}
4345 static OMPParallelMasterTaskLoopSimdDirective *
4346 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4347 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4348 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4357 static OMPParallelMasterTaskLoopSimdDirective *
4358 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4362 return T->getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass;
4385 OMPParallelMaskedTaskLoopSimdDirective(SourceLocation StartLoc,
4386 SourceLocation EndLoc,
4387 unsigned CollapsedNum)
4389 llvm::omp::OMPD_parallel_masked_taskloop_simd,
4390 StartLoc, EndLoc, CollapsedNum) {}
4398 llvm::omp::OMPD_parallel_masked_taskloop_simd,
4399 SourceLocation(), SourceLocation(), CollapsedNum) {}
4412 static OMPParallelMaskedTaskLoopSimdDirective *
4413 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4414 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4415 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4424 static OMPParallelMaskedTaskLoopSimdDirective *
4425 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4429 return T->getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass;
4451 OMPDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4452 unsigned CollapsedNum)
4454 llvm::omp::OMPD_distribute, StartLoc, EndLoc,
4463 llvm::omp::OMPD_distribute, SourceLocation(),
4464 SourceLocation(), CollapsedNum) {}
4477 static OMPDistributeDirective *
4478 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4479 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4480 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4489 static OMPDistributeDirective *
CreateEmpty(
const ASTContext &C,
4490 unsigned NumClauses,
4491 unsigned CollapsedNum, EmptyShell);
4494 return T->getStmtClass() == OMPDistributeDirectiveClass;
4515 OMPTargetUpdateDirective(SourceLocation StartLoc, SourceLocation EndLoc)
4517 llvm::omp::OMPD_target_update, StartLoc,
4524 llvm::omp::OMPD_target_update, SourceLocation(),
4525 SourceLocation()) {}
4536 static OMPTargetUpdateDirective *
4537 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4538 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
4546 static OMPTargetUpdateDirective *
CreateEmpty(
const ASTContext &C,
4547 unsigned NumClauses, EmptyShell);
4550 return T->getStmtClass() == OMPTargetUpdateDirectiveClass;
4567 bool HasCancel =
false;
4575 OMPDistributeParallelForDirective(SourceLocation StartLoc,
4576 SourceLocation EndLoc,
4577 unsigned CollapsedNum)
4579 llvm::omp::OMPD_distribute_parallel_for, StartLoc,
4580 EndLoc, CollapsedNum) {}
4588 llvm::omp::OMPD_distribute_parallel_for,
4589 SourceLocation(), SourceLocation(), CollapsedNum) {}
4592 void setTaskReductionRefExpr(Expr *E) {
4593 Data->getChildren()[numLoopChildren(
4594 getLoopsNumber(), llvm::omp::OMPD_distribute_parallel_for)] = E;
4598 void setHasCancel(
bool Has) { HasCancel = Has; }
4614 static OMPDistributeParallelForDirective *
4615 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4616 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4617 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
4627 static OMPDistributeParallelForDirective *
CreateEmpty(
const ASTContext &C,
4628 unsigned NumClauses,
4629 unsigned CollapsedNum,
4634 return cast_or_null<Expr>(Data->getChildren()[numLoopChildren(
4635 getLoopsNumber(), llvm::omp::OMPD_distribute_parallel_for)]);
4638 return const_cast<OMPDistributeParallelForDirective *
>(
this)
4646 return T->getStmtClass() == OMPDistributeParallelForDirectiveClass;
4669 OMPDistributeParallelForSimdDirective(SourceLocation StartLoc,
4670 SourceLocation EndLoc,
4671 unsigned CollapsedNum)
4673 llvm::omp::OMPD_distribute_parallel_for_simd, StartLoc,
4674 EndLoc, CollapsedNum) {}
4682 llvm::omp::OMPD_distribute_parallel_for_simd,
4683 SourceLocation(), SourceLocation(), CollapsedNum) {}
4696 static OMPDistributeParallelForSimdDirective *
Create(
4697 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4698 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4699 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4707 static OMPDistributeParallelForSimdDirective *
CreateEmpty(
4708 const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4712 return T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass;
4734 OMPDistributeSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4735 unsigned CollapsedNum)
4737 llvm::omp::OMPD_distribute_simd, StartLoc, EndLoc,
4746 llvm::omp::OMPD_distribute_simd, SourceLocation(),
4747 SourceLocation(), CollapsedNum) {}
4760 static OMPDistributeSimdDirective *
4761 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4762 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4763 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4771 static OMPDistributeSimdDirective *
CreateEmpty(
const ASTContext &C,
4772 unsigned NumClauses,
4773 unsigned CollapsedNum,
4777 return T->getStmtClass() == OMPDistributeSimdDirectiveClass;
4800 OMPTargetParallelForSimdDirective(SourceLocation StartLoc,
4801 SourceLocation EndLoc,
4802 unsigned CollapsedNum)
4804 llvm::omp::OMPD_target_parallel_for_simd, StartLoc,
4805 EndLoc, CollapsedNum) {}
4813 llvm::omp::OMPD_target_parallel_for_simd,
4814 SourceLocation(), SourceLocation(), CollapsedNum) {}
4827 static OMPTargetParallelForSimdDirective *
4828 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4829 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4830 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4838 static OMPTargetParallelForSimdDirective *
CreateEmpty(
const ASTContext &C,
4839 unsigned NumClauses,
4840 unsigned CollapsedNum,
4844 return T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass;
4867 OMPTargetSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4868 unsigned CollapsedNum)
4870 llvm::omp::OMPD_target_simd, StartLoc, EndLoc,
4879 llvm::omp::OMPD_target_simd, SourceLocation(),
4880 SourceLocation(), CollapsedNum) {}
4893 static OMPTargetSimdDirective *
4894 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4895 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4896 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4904 static OMPTargetSimdDirective *
CreateEmpty(
const ASTContext &C,
4905 unsigned NumClauses,
4906 unsigned CollapsedNum,
4910 return T->getStmtClass() == OMPTargetSimdDirectiveClass;
4932 OMPTeamsDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4933 unsigned CollapsedNum)
4935 llvm::omp::OMPD_teams_distribute, StartLoc, EndLoc,
4944 llvm::omp::OMPD_teams_distribute, SourceLocation(),
4945 SourceLocation(), CollapsedNum) {}
4958 static OMPTeamsDistributeDirective *
4959 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4960 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4961 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4969 static OMPTeamsDistributeDirective *
CreateEmpty(
const ASTContext &C,
4970 unsigned NumClauses,
4971 unsigned CollapsedNum,
4975 return T->getStmtClass() == OMPTeamsDistributeDirectiveClass;
4998 OMPTeamsDistributeSimdDirective(SourceLocation StartLoc,
4999 SourceLocation EndLoc,
unsigned CollapsedNum)
5001 llvm::omp::OMPD_teams_distribute_simd, StartLoc,
5002 EndLoc, CollapsedNum) {}
5010 llvm::omp::OMPD_teams_distribute_simd,
5011 SourceLocation(), SourceLocation(), CollapsedNum) {}
5024 static OMPTeamsDistributeSimdDirective *
5025 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5026 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5027 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5036 static OMPTeamsDistributeSimdDirective *
CreateEmpty(
const ASTContext &C,
5037 unsigned NumClauses,
5038 unsigned CollapsedNum,
5042 return T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass;
5055class OMPTeamsDistributeParallelForSimdDirective final
5066 OMPTeamsDistributeParallelForSimdDirective(SourceLocation StartLoc,
5067 SourceLocation EndLoc,
5068 unsigned CollapsedNum)
5070 llvm::omp::OMPD_teams_distribute_parallel_for_simd,
5071 StartLoc, EndLoc, CollapsedNum) {}
5079 llvm::omp::OMPD_teams_distribute_parallel_for_simd,
5080 SourceLocation(), SourceLocation(), CollapsedNum) {}
5093 static OMPTeamsDistributeParallelForSimdDirective *
5094 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5095 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5096 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5104 static OMPTeamsDistributeParallelForSimdDirective *
5105 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5109 return T->getStmtClass() == OMPTeamsDistributeParallelForSimdDirectiveClass;
5126 bool HasCancel =
false;
5134 OMPTeamsDistributeParallelForDirective(SourceLocation StartLoc,
5135 SourceLocation EndLoc,
5136 unsigned CollapsedNum)
5138 llvm::omp::OMPD_teams_distribute_parallel_for,
5139 StartLoc, EndLoc, CollapsedNum) {}
5147 llvm::omp::OMPD_teams_distribute_parallel_for,
5148 SourceLocation(), SourceLocation(), CollapsedNum) {}
5151 void setTaskReductionRefExpr(Expr *E) {
5152 Data->getChildren()[numLoopChildren(
5153 getLoopsNumber(), llvm::omp::OMPD_teams_distribute_parallel_for)] = E;
5157 void setHasCancel(
bool Has) { HasCancel = Has; }
5173 static OMPTeamsDistributeParallelForDirective *
5174 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5175 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5176 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
5185 static OMPTeamsDistributeParallelForDirective *
5186 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5191 return cast_or_null<Expr>(Data->getChildren()[numLoopChildren(
5192 getLoopsNumber(), llvm::omp::OMPD_teams_distribute_parallel_for)]);
5195 return const_cast<OMPTeamsDistributeParallelForDirective *
>(
this)
5203 return T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass;
5223 OMPTargetTeamsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
5225 llvm::omp::OMPD_target_teams, StartLoc, EndLoc) {
5232 llvm::omp::OMPD_target_teams, SourceLocation(),
5233 SourceLocation()) {}
5244 static OMPTargetTeamsDirective *
Create(
const ASTContext &C,
5245 SourceLocation StartLoc,
5246 SourceLocation EndLoc,
5247 ArrayRef<OMPClause *> Clauses,
5248 Stmt *AssociatedStmt);
5255 static OMPTargetTeamsDirective *
CreateEmpty(
const ASTContext &C,
5256 unsigned NumClauses, EmptyShell);
5259 return T->getStmtClass() == OMPTargetTeamsDirectiveClass;
5281 OMPTargetTeamsDistributeDirective(SourceLocation StartLoc,
5282 SourceLocation EndLoc,
5283 unsigned CollapsedNum)
5285 llvm::omp::OMPD_target_teams_distribute, StartLoc,
5286 EndLoc, CollapsedNum) {}
5294 llvm::omp::OMPD_target_teams_distribute,
5295 SourceLocation(), SourceLocation(), CollapsedNum) {}
5308 static OMPTargetTeamsDistributeDirective *
5309 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5310 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5311 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5319 static OMPTargetTeamsDistributeDirective *
5320 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5324 return T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass;
5337class OMPTargetTeamsDistributeParallelForDirective final
5342 bool HasCancel =
false;
5350 OMPTargetTeamsDistributeParallelForDirective(SourceLocation StartLoc,
5351 SourceLocation EndLoc,
5352 unsigned CollapsedNum)
5354 llvm::omp::OMPD_target_teams_distribute_parallel_for,
5355 StartLoc, EndLoc, CollapsedNum) {}
5363 llvm::omp::OMPD_target_teams_distribute_parallel_for,
5364 SourceLocation(), SourceLocation(), CollapsedNum) {}
5367 void setTaskReductionRefExpr(Expr *E) {
5368 Data->getChildren()[numLoopChildren(
5370 llvm::omp::OMPD_target_teams_distribute_parallel_for)] = E;
5374 void setHasCancel(
bool Has) { HasCancel = Has; }
5390 static OMPTargetTeamsDistributeParallelForDirective *
5391 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5392 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5393 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
5402 static OMPTargetTeamsDistributeParallelForDirective *
5403 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5408 return cast_or_null<Expr>(Data->getChildren()[numLoopChildren(
5410 llvm::omp::OMPD_target_teams_distribute_parallel_for)]);
5413 return const_cast<OMPTargetTeamsDistributeParallelForDirective *
>(
this)
5421 return T->getStmtClass() ==
5422 OMPTargetTeamsDistributeParallelForDirectiveClass;
5435class OMPTargetTeamsDistributeParallelForSimdDirective final
5446 OMPTargetTeamsDistributeParallelForSimdDirective(SourceLocation StartLoc,
5447 SourceLocation EndLoc,
5448 unsigned CollapsedNum)
5450 OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
5451 llvm::omp::OMPD_target_teams_distribute_parallel_for_simd, StartLoc,
5452 EndLoc, CollapsedNum) {}
5459 unsigned CollapsedNum)
5461 OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
5462 llvm::omp::OMPD_target_teams_distribute_parallel_for_simd,
5463 SourceLocation(), SourceLocation(), CollapsedNum) {}
5476 static OMPTargetTeamsDistributeParallelForSimdDirective *
5477 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5478 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5479 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5487 static OMPTargetTeamsDistributeParallelForSimdDirective *
5488 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5492 return T->getStmtClass() ==
5493 OMPTargetTeamsDistributeParallelForSimdDirectiveClass;
5516 OMPTargetTeamsDistributeSimdDirective(SourceLocation StartLoc,
5517 SourceLocation EndLoc,
5518 unsigned CollapsedNum)
5520 llvm::omp::OMPD_target_teams_distribute_simd, StartLoc,
5521 EndLoc, CollapsedNum) {}
5529 llvm::omp::OMPD_target_teams_distribute_simd,
5530 SourceLocation(), SourceLocation(), CollapsedNum) {}
5543 static OMPTargetTeamsDistributeSimdDirective *
5544 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5545 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5546 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5554 static OMPTargetTeamsDistributeSimdDirective *
5555 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5559 return T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
5564class OMPTileDirective final
5572 TransformedStmtOffset,
5578 OMPTileDirectiveClass,
llvm::omp::OMPD_tile, StartLoc, EndLoc,
5581 void setPreInits(Stmt *PreInits) {
5582 Data->getChildren()[PreInitsOffset] = PreInits;
5585 void setTransformedStmt(Stmt *S) {
5586 Data->getChildren()[TransformedStmtOffset] = S;
5602 static OMPTileDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
5603 SourceLocation EndLoc,
5604 ArrayRef<OMPClause *> Clauses,
5605 unsigned NumLoops, Stmt *AssociatedStmt,
5606 Stmt *TransformedStmt, Stmt *PreInits);
5613 static OMPTileDirective *
CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
5628 return Data->getChildren()[TransformedStmtOffset];
5632 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5635 return T->getStmtClass() == OMPTileDirectiveClass;
5640class OMPStripeDirective final
5648 TransformedStmtOffset,
5654 OMPStripeDirectiveClass,
llvm::omp::OMPD_stripe, StartLoc, EndLoc,
5657 void setPreInits(Stmt *PreInits) {
5658 Data->getChildren()[PreInitsOffset] = PreInits;
5661 void setTransformedStmt(Stmt *S) {
5662 Data->getChildren()[TransformedStmtOffset] = S;
5678 static OMPStripeDirective *
5679 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5680 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
5681 Stmt *TransformedStmt, Stmt *PreInits);
5688 static OMPStripeDirective *
5689 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned NumLoops);
5702 return Data->getChildren()[TransformedStmtOffset];
5706 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5709 return T->getStmtClass() == OMPStripeDirectiveClass;
5719class OMPUnrollDirective final
5727 TransformedStmtOffset,
5732 llvm::omp::OMPD_unroll,
5733 StartLoc, EndLoc, 1) {}
5736 void setPreInits(Stmt *PreInits) {
5737 Data->getChildren()[PreInitsOffset] = PreInits;
5741 void setTransformedStmt(Stmt *S) {
5742 Data->getChildren()[TransformedStmtOffset] = S;
5756 static OMPUnrollDirective *
5757 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5758 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
5759 unsigned NumGeneratedTopLevelLoops, Stmt *TransformedStmt,
5766 static OMPUnrollDirective *
CreateEmpty(
const ASTContext &C,
5767 unsigned NumClauses);
5777 return Data->getChildren()[TransformedStmtOffset];
5781 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5784 return T->getStmtClass() == OMPUnrollDirectiveClass;
5795class OMPReverseDirective final
5803 TransformedStmtOffset,
5809 OMPReverseDirectiveClass,
llvm::omp::OMPD_reverse, StartLoc, EndLoc,
5812 void setPreInits(Stmt *PreInits) {
5813 Data->getChildren()[PreInitsOffset] = PreInits;
5816 void setTransformedStmt(Stmt *S) {
5817 Data->getChildren()[TransformedStmtOffset] = S;
5831 static OMPReverseDirective *
Create(
const ASTContext &C,
5832 SourceLocation StartLoc,
5833 SourceLocation EndLoc,
5834 Stmt *AssociatedStmt,
unsigned NumLoops,
5835 Stmt *TransformedStmt, Stmt *PreInits);
5841 static OMPReverseDirective *
CreateEmpty(
const ASTContext &C,
5847 return Data->getChildren()[TransformedStmtOffset];
5851 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5854 return T->getStmtClass() == OMPReverseDirectiveClass;
5866class OMPInterchangeDirective final
5874 TransformedStmtOffset,
5878 SourceLocation EndLoc,
unsigned NumLoops)
5880 OMPInterchangeDirectiveClass,
llvm::omp::OMPD_interchange, StartLoc,
5881 EndLoc, NumLoops) {}
5883 void setPreInits(Stmt *PreInits) {
5884 Data->getChildren()[PreInitsOffset] = PreInits;
5887 void setTransformedStmt(Stmt *S) {
5888 Data->getChildren()[TransformedStmtOffset] = S;
5904 static OMPInterchangeDirective *
5905 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5906 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
5907 Stmt *TransformedStmt, Stmt *PreInits);
5914 static OMPInterchangeDirective *
5915 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned NumLoops);
5920 return Data->getChildren()[TransformedStmtOffset];
5924 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5927 return T->getStmtClass() == OMPInterchangeDirectiveClass;
5946 OMPScanDirective(SourceLocation StartLoc, SourceLocation EndLoc)
5948 StartLoc, EndLoc) {}
5954 SourceLocation(), SourceLocation()) {}
5965 static OMPScanDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
5966 SourceLocation EndLoc,
5967 ArrayRef<OMPClause *> Clauses);
5975 static OMPScanDirective *
CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
5979 return T->getStmtClass() == OMPScanDirectiveClass;
6000 OMPInteropDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6002 llvm::omp::OMPD_interop, StartLoc, EndLoc) {}
6008 llvm::omp::OMPD_interop, SourceLocation(),
6009 SourceLocation()) {}
6019 static OMPInteropDirective *
Create(
const ASTContext &C,
6020 SourceLocation StartLoc,
6021 SourceLocation EndLoc,
6022 ArrayRef<OMPClause *> Clauses);
6028 static OMPInteropDirective *
CreateEmpty(
const ASTContext &C,
6029 unsigned NumClauses, EmptyShell);
6032 return T->getStmtClass() == OMPInteropDirectiveClass;
6049 SourceLocation TargetCallLoc;
6052 void setTargetCallLoc(SourceLocation Loc) { TargetCallLoc = Loc; }
6061 llvm::omp::OMPD_dispatch, StartLoc, EndLoc) {}
6065 explicit OMPDispatchDirective()
6066 : OMPExecutableDirective(OMPDispatchDirectiveClass,
6067 llvm::omp::OMPD_dispatch, SourceLocation(),
6068 SourceLocation()) {}
6080 static OMPDispatchDirective *
6081 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6082 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
6083 SourceLocation TargetCallLoc);
6091 static OMPDispatchDirective *
CreateEmpty(
const ASTContext &C,
6092 unsigned NumClauses, EmptyShell);
6098 return T->getStmtClass() == OMPDispatchDirectiveClass;
6118 OMPMaskedDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6120 StartLoc, EndLoc) {}
6126 SourceLocation(), SourceLocation()) {}
6136 static OMPMaskedDirective *
6137 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6138 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
6144 static OMPMaskedDirective *
CreateEmpty(
const ASTContext &C,
6145 unsigned NumClauses, EmptyShell);
6148 return T->getStmtClass() == OMPMaskedDirectiveClass;
6165 OMPMetaDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6167 llvm::omp::OMPD_metadirective, StartLoc,
6171 llvm::omp::OMPD_metadirective, SourceLocation(),
6172 SourceLocation()) {}
6174 void setIfStmt(Stmt *S) { IfStmt = S; }
6177 static OMPMetaDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
6178 SourceLocation EndLoc,
6179 ArrayRef<OMPClause *> Clauses,
6180 Stmt *AssociatedStmt, Stmt *IfStmt);
6181 static OMPMetaDirective *
CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
6186 return T->getStmtClass() == OMPMetaDirectiveClass;
6208 OMPGenericLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
6209 unsigned CollapsedNum)
6211 StartLoc, EndLoc, CollapsedNum) {}
6219 SourceLocation(), SourceLocation(), CollapsedNum) {}
6232 static OMPGenericLoopDirective *
6233 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6234 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6235 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6243 static OMPGenericLoopDirective *
CreateEmpty(
const ASTContext &C,
6244 unsigned NumClauses,
6245 unsigned CollapsedNum,
6249 return T->getStmtClass() == OMPGenericLoopDirectiveClass;
6270 OMPTeamsGenericLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
6271 unsigned CollapsedNum)
6273 llvm::omp::OMPD_teams_loop, StartLoc, EndLoc,
6282 llvm::omp::OMPD_teams_loop, SourceLocation(),
6283 SourceLocation(), CollapsedNum) {}
6296 static OMPTeamsGenericLoopDirective *
6297 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6298 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6299 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6308 static OMPTeamsGenericLoopDirective *
CreateEmpty(
const ASTContext &C,
6309 unsigned NumClauses,
6310 unsigned CollapsedNum,
6314 return T->getStmtClass() == OMPTeamsGenericLoopDirectiveClass;
6330 bool CanBeParallelFor =
false;
6337 OMPTargetTeamsGenericLoopDirective(SourceLocation StartLoc,
6338 SourceLocation EndLoc,
6339 unsigned CollapsedNum)
6341 llvm::omp::OMPD_target_teams_loop, StartLoc, EndLoc,
6350 llvm::omp::OMPD_target_teams_loop, SourceLocation(),
6351 SourceLocation(), CollapsedNum) {}
6354 void setCanBeParallelFor(
bool ParFor) { CanBeParallelFor = ParFor; }
6367 static OMPTargetTeamsGenericLoopDirective *
6368 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6369 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6370 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool CanBeParallelFor);
6379 static OMPTargetTeamsGenericLoopDirective *
CreateEmpty(
const ASTContext &C,
6380 unsigned NumClauses,
6381 unsigned CollapsedNum,
6389 return T->getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass;
6410 OMPParallelGenericLoopDirective(SourceLocation StartLoc,
6411 SourceLocation EndLoc,
unsigned CollapsedNum)
6413 llvm::omp::OMPD_parallel_loop, StartLoc, EndLoc,
6422 llvm::omp::OMPD_parallel_loop, SourceLocation(),
6423 SourceLocation(), CollapsedNum) {}
6436 static OMPParallelGenericLoopDirective *
6437 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6438 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6439 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6448 static OMPParallelGenericLoopDirective *
CreateEmpty(
const ASTContext &C,
6449 unsigned NumClauses,
6450 unsigned CollapsedNum,
6454 return T->getStmtClass() == OMPParallelGenericLoopDirectiveClass;
6475 OMPTargetParallelGenericLoopDirective(SourceLocation StartLoc,
6476 SourceLocation EndLoc,
6477 unsigned CollapsedNum)
6479 llvm::omp::OMPD_target_parallel_loop, StartLoc, EndLoc,
6488 llvm::omp::OMPD_target_parallel_loop, SourceLocation(),
6489 SourceLocation(), CollapsedNum) {}
6502 static OMPTargetParallelGenericLoopDirective *
6503 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6504 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6505 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6514 static OMPTargetParallelGenericLoopDirective *
6515 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
6519 return T->getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass;
6536 OMPErrorDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6538 StartLoc, EndLoc) {}
6543 SourceLocation(), SourceLocation()) {}
6552 static OMPErrorDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
6553 SourceLocation EndLoc,
6554 ArrayRef<OMPClause *> Clauses);
6560 static OMPErrorDirective *
CreateEmpty(
const ASTContext &C,
6561 unsigned NumClauses, EmptyShell);
6564 return T->getStmtClass() == OMPErrorDirectiveClass;
6575 OMPAssumeDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6577 StartLoc, EndLoc) {}
6581 SourceLocation(), SourceLocation()) {}
6584 static OMPAssumeDirective *
Create(
const ASTContext &Ctx,
6585 SourceLocation StartLoc,
6586 SourceLocation EndLoc,
6587 ArrayRef<OMPClause *> Clauses, Stmt *AStmt);
6589 static OMPAssumeDirective *
CreateEmpty(
const ASTContext &C,
6590 unsigned NumClauses, EmptyShell);
6593 return T->getStmtClass() == OMPAssumeDirectiveClass;
Defines the clang::ASTContext interface.
clang::CharUnits operator*(clang::CharUnits::QuantityType Scale, const clang::CharUnits &CU)
This file defines OpenMP AST classes for clauses.
Defines some OpenMP-specific enums and functions.
Defines the clang::SourceLocation class and associated facilities.
Expr * getUpdateExpr()
Get helper expression of the form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExp...
Expr * getV()
Get 'v' part of the associated expression/statement.
Expr * getR()
Get 'r' part of the associated expression/statement.
Expr * getD()
Get 'd' part of the associated expression/statement.
Expr * getX()
Get 'x' part of the associated expression/statement.
bool isFailOnly() const
Return true if 'v' is updated only when the condition is evaluated false (compare capture only).
bool isPostfixUpdate() const
Return true if 'v' expression must be updated to original value of 'x', false if 'v' must be updated ...
Expr * getExpr()
Get 'expr' part of the associated expression/statement.
bool isXLHSInRHSPart() const
Return true if helper update expression has form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' and...
Expr * getCondExpr()
Get the 'cond' part of the source atomic expression.
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 bool classof(const Stmt *T)
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp cancel' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
This represents 'pragma omp cancellation point' directive.
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp dispatch' directive.
SourceLocation getTargetCallLoc() const
Return location of target-call.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp distribute' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp distribute parallel for' composite directive.
static bool classof(const Stmt *T)
bool hasCancel() const
Return true if current directive has inner cancel directive.
const Expr * getTaskReductionRefExpr() const
friend class OMPExecutableDirective
friend class ASTStmtReader
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
This represents 'pragma omp distribute parallel for simd' composite directive.
friend class OMPExecutableDirective
friend class ASTStmtReader
static bool classof(const Stmt *T)
This represents 'pragma omp distribute simd' composite directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp error' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp loop' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
Represents the 'pragma omp interchange' loop transformation directive.
Stmt * getTransformedStmt() const
Gets the associated loops after the transformation.
Stmt * getPreInits() const
Return preinits statement.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp interop' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp masked' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp masked taskloop' directive.
static bool classof(const Stmt *T)
bool hasCancel() const
Return true if current directive has inner cancel directive.
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp masked taskloop simd' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp master taskloop' directive.
static bool classof(const Stmt *T)
bool hasCancel() const
Return true if current directive has inner cancel directive.
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp master taskloop simd' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp parallel loop' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp parallel masked taskloop' directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
friend class OMPExecutableDirective
friend class ASTStmtReader
static bool classof(const Stmt *T)
This represents 'pragma omp parallel masked taskloop simd' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp parallel master taskloop' directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp parallel master taskloop simd' directive.
friend class OMPExecutableDirective
static bool classof(const Stmt *T)
friend class ASTStmtReader
Represents the 'pragma omp reverse' loop transformation directive.
Stmt * getPreInits() const
Return preinits statement.
Stmt * getTransformedStmt() const
Gets/sets the associated loops after the transformation, i.e.
friend class OMPExecutableDirective
static bool classof(const Stmt *T)
friend class ASTStmtReader
This represents 'pragma omp scan' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents the 'pragma omp stripe' loop transformation directive.
static bool classof(const Stmt *T)
Stmt * getPreInits() const
Return preinits statement.
Stmt * getTransformedStmt() const
Gets/sets the associated loops after striping.
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp target data' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp target' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp target enter data' directive.
friend class OMPExecutableDirective
friend class ASTStmtReader
static bool classof(const Stmt *T)
This represents 'pragma omp target exit data' directive.
friend class OMPExecutableDirective
friend class ASTStmtReader
static bool classof(const Stmt *T)
This represents 'pragma omp target parallel' directive.
static bool classof(const Stmt *T)
bool hasCancel() const
Return true if current directive has inner cancel directive.
const Expr * getTaskReductionRefExpr() const
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp target parallel for' directive.
const Expr * getTaskReductionRefExpr() const
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
bool hasCancel() const
Return true if current directive has inner cancel directive.
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
This represents 'pragma omp target parallel for simd' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp target parallel loop' directive.
friend class OMPExecutableDirective
friend class ASTStmtReader
static bool classof(const Stmt *T)
This represents 'pragma omp target simd' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp target teams' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp target teams distribute' combined directive.
friend class OMPExecutableDirective
static bool classof(const Stmt *T)
friend class ASTStmtReader
This represents 'pragma omp target teams distribute parallel for' combined directive.
static bool classof(const Stmt *T)
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
bool hasCancel() const
Return true if current directive has inner cancel directive.
const Expr * getTaskReductionRefExpr() const
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp target teams distribute parallel for simd' combined directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp target teams distribute simd' combined directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp target teams loop' directive.
friend class OMPExecutableDirective
friend class ASTStmtReader
static bool classof(const Stmt *T)
bool canBeParallelFor() const
Return true if current loop directive's associated loop can be a parallel for.
This represents 'pragma omp target update' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp taskloop' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
bool hasCancel() const
Return true if current directive has inner cancel directive.
This represents 'pragma omp taskloop simd' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp teams' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp teams distribute' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp teams distribute parallel for' composite directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
static bool classof(const Stmt *T)
const Expr * getTaskReductionRefExpr() const
friend class OMPExecutableDirective
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
friend class ASTStmtReader
This represents 'pragma omp teams distribute parallel for simd' composite directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp teams distribute simd' combined directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp teams loop' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents the 'pragma omp tile' loop transformation directive.
static bool classof(const Stmt *T)
Stmt * getPreInits() const
Return preinits statement.
Stmt * getTransformedStmt() const
Gets/sets the associated loops after tiling.
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents the 'pragma omp unroll' loop transformation directive.
Stmt * getPreInits() const
Return the pre-init statements.
static bool classof(const Stmt *T)
Stmt * getTransformedStmt() const
Get the de-sugared associated loops after unrolling.
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents one expression.
Stmt - This represents one statement.
bool Init(InterpState &S, CodePtr OpPC)
bool Inc(InterpState &S, CodePtr OpPC, bool CanOverflow)
1) Pops a pointer from the stack 2) Load the value from the pointer 3) Writes the value increased by ...
std::unique_ptr< DiagnosticConsumer > create(StringRef OutputFile, DiagnosticOptions &DiagOpts, bool MergeChildRecords=false)
Returns a DiagnosticConsumer that serializes diagnostics to a bitcode file.
The JSON file list parser is used to communicate input to InstallAPI.
bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a worksharing directive.
Stmt * getStructuredBlock()
bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a distribute directive.
bool isOpenMPGenericLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive constitutes a 'loop' directive in the outermost nest.
const FunctionProtoType * T
bool IsXLHSInRHSPart
True if UE has the first form and false if the second.
bool IsPostfixUpdate
True if original value of 'x' must be stored in 'v', not an updated one.
bool isOpenMPLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a directive with an associated loop construct.
bool isOpenMPLoopBoundSharingDirective(OpenMPDirectiveKind Kind)
Checks if the specified directive kind is one of the composite or combined directives that need loop ...
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
void getOpenMPCaptureRegions(llvm::SmallVectorImpl< OpenMPDirectiveKind > &CaptureRegions, OpenMPDirectiveKind DKind)
Return the captured regions of an OpenMP directive.
bool IsFailOnly
True if 'v' is updated only when the condition is false (compare capture only).
bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a taskloop directive.
Diagnostic wrappers for TextAPI types for error reporting.