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))
960class OMPCanonicalLoopNestTransformationDirective
961 :
public OMPLoopBasedDirective {
962 friend class ASTStmtReader;
965 unsigned NumGeneratedLoops = 0;
968 explicit OMPCanonicalLoopNestTransformationDirective(
969 StmtClass SC, OpenMPDirectiveKind Kind, SourceLocation StartLoc,
970 SourceLocation EndLoc,
unsigned NumAssociatedLoops)
971 : OMPLoopBasedDirective(SC,
Kind, StartLoc, EndLoc, NumAssociatedLoops) {}
974 void setNumGeneratedLoops(
unsigned Num) { NumGeneratedLoops =
Num; }
978 unsigned getNumAssociatedLoops()
const {
return getLoopsNumber(); }
981 unsigned getNumGeneratedLoops()
const {
return NumGeneratedLoops; }
988 Stmt *getTransformedStmt()
const;
991 Stmt *getPreInits()
const;
993 static bool classof(
const Stmt *T) {
994 Stmt::StmtClass
C =
T->getStmtClass();
995 return C == OMPTileDirectiveClass ||
C == OMPUnrollDirectiveClass ||
996 C == OMPReverseDirectiveClass ||
C == OMPInterchangeDirectiveClass ||
997 C == OMPStripeDirectiveClass;
1004class OMPLoopDirective :
public OMPLoopBasedDirective {
1005 friend class ASTStmtReader;
1024 IterationVariableOffset = 0,
1025 LastIterationOffset = 1,
1026 CalcLastIterationOffset = 2,
1027 PreConditionOffset = 3,
1038 IsLastIterVariableOffset = 8,
1039 LowerBoundVariableOffset = 9,
1040 UpperBoundVariableOffset = 10,
1041 StrideVariableOffset = 11,
1042 EnsureUpperBoundOffset = 12,
1043 NextLowerBoundOffset = 13,
1044 NextUpperBoundOffset = 14,
1045 NumIterationsOffset = 15,
1047 WorksharingEnd = 16,
1048 PrevLowerBoundVariableOffset = 16,
1049 PrevUpperBoundVariableOffset = 17,
1051 PrevEnsureUpperBoundOffset = 19,
1052 CombinedLowerBoundVariableOffset = 20,
1053 CombinedUpperBoundVariableOffset = 21,
1054 CombinedEnsureUpperBoundOffset = 22,
1055 CombinedInitOffset = 23,
1056 CombinedConditionOffset = 24,
1057 CombinedNextLowerBoundOffset = 25,
1058 CombinedNextUpperBoundOffset = 26,
1059 CombinedDistConditionOffset = 27,
1060 CombinedParForInDistConditionOffset = 28,
1064 CombinedDistributeEnd = 29,
1068 MutableArrayRef<Expr *> getCounters() {
1069 auto **
Storage =
reinterpret_cast<Expr **
>(
1070 &
Data->getChildren()[getArraysOffset(getDirectiveKind())]);
1071 return {
Storage, getLoopsNumber()};
1075 MutableArrayRef<Expr *> getPrivateCounters() {
1076 auto **
Storage =
reinterpret_cast<Expr **
>(
1077 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1079 return {
Storage, getLoopsNumber()};
1083 MutableArrayRef<Expr *> getInits() {
1084 auto **
Storage =
reinterpret_cast<Expr **
>(
1085 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1086 2 * getLoopsNumber()]);
1087 return {
Storage, getLoopsNumber()};
1091 MutableArrayRef<Expr *> getUpdates() {
1092 auto **
Storage =
reinterpret_cast<Expr **
>(
1093 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1094 3 * getLoopsNumber()]);
1095 return {
Storage, getLoopsNumber()};
1099 MutableArrayRef<Expr *> getFinals() {
1100 auto **
Storage =
reinterpret_cast<Expr **
>(
1101 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1102 4 * getLoopsNumber()]);
1103 return {
Storage, getLoopsNumber()};
1107 MutableArrayRef<Expr *> getDependentCounters() {
1108 auto **
Storage =
reinterpret_cast<Expr **
>(
1109 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1110 5 * getLoopsNumber()]);
1111 return {
Storage, getLoopsNumber()};
1115 MutableArrayRef<Expr *> getDependentInits() {
1116 auto **
Storage =
reinterpret_cast<Expr **
>(
1117 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1118 6 * getLoopsNumber()]);
1119 return {
Storage, getLoopsNumber()};
1123 MutableArrayRef<Expr *> getFinalsConditions() {
1124 auto **
Storage =
reinterpret_cast<Expr **
>(
1125 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1126 7 * getLoopsNumber()]);
1127 return {
Storage, getLoopsNumber()};
1139 OMPLoopDirective(StmtClass SC, OpenMPDirectiveKind Kind,
1140 SourceLocation StartLoc, SourceLocation EndLoc,
1141 unsigned CollapsedNum)
1142 : OMPLoopBasedDirective(SC,
Kind, StartLoc, EndLoc, CollapsedNum) {}
1145 static unsigned getArraysOffset(OpenMPDirectiveKind Kind) {
1147 return CombinedDistributeEnd;
1150 return WorksharingEnd;
1155 static unsigned numLoopChildren(
unsigned CollapsedNum,
1156 OpenMPDirectiveKind Kind) {
1157 return getArraysOffset(Kind) +
1163 void setIterationVariable(Expr *IV) {
1164 Data->getChildren()[IterationVariableOffset] = IV;
1166 void setLastIteration(Expr *LI) {
1167 Data->getChildren()[LastIterationOffset] = LI;
1169 void setCalcLastIteration(Expr *CLI) {
1170 Data->getChildren()[CalcLastIterationOffset] = CLI;
1172 void setPreCond(Expr *PC) {
Data->getChildren()[PreConditionOffset] = PC; }
1173 void setCond(Expr *Cond) {
Data->getChildren()[CondOffset] =
Cond; }
1174 void setInit(Expr *Init) {
Data->getChildren()[InitOffset] =
Init; }
1175 void setInc(Expr *Inc) {
Data->getChildren()[IncOffset] =
Inc; }
1176 void setPreInits(Stmt *PreInits) {
1177 Data->getChildren()[PreInitsOffset] = PreInits;
1179 void setIsLastIterVariable(Expr *IL) {
1184 "expected worksharing loop directive");
1185 Data->getChildren()[IsLastIterVariableOffset] = IL;
1187 void setLowerBoundVariable(Expr *LB) {
1192 "expected worksharing loop directive");
1193 Data->getChildren()[LowerBoundVariableOffset] = LB;
1195 void setUpperBoundVariable(Expr *UB) {
1200 "expected worksharing loop directive");
1201 Data->getChildren()[UpperBoundVariableOffset] = UB;
1203 void setStrideVariable(Expr *ST) {
1208 "expected worksharing loop directive");
1209 Data->getChildren()[StrideVariableOffset] = ST;
1211 void setEnsureUpperBound(Expr *EUB) {
1216 "expected worksharing loop directive");
1217 Data->getChildren()[EnsureUpperBoundOffset] = EUB;
1219 void setNextLowerBound(Expr *NLB) {
1224 "expected worksharing loop directive");
1225 Data->getChildren()[NextLowerBoundOffset] = NLB;
1227 void setNextUpperBound(Expr *NUB) {
1232 "expected worksharing loop directive");
1233 Data->getChildren()[NextUpperBoundOffset] = NUB;
1235 void setNumIterations(Expr *NI) {
1240 "expected worksharing loop directive");
1241 Data->getChildren()[NumIterationsOffset] = NI;
1243 void setPrevLowerBoundVariable(Expr *PrevLB) {
1245 "expected loop bound sharing directive");
1246 Data->getChildren()[PrevLowerBoundVariableOffset] = PrevLB;
1248 void setPrevUpperBoundVariable(Expr *PrevUB) {
1250 "expected loop bound sharing directive");
1251 Data->getChildren()[PrevUpperBoundVariableOffset] = PrevUB;
1253 void setDistInc(Expr *DistInc) {
1255 "expected loop bound sharing directive");
1256 Data->getChildren()[DistIncOffset] = DistInc;
1258 void setPrevEnsureUpperBound(Expr *PrevEUB) {
1260 "expected loop bound sharing directive");
1261 Data->getChildren()[PrevEnsureUpperBoundOffset] = PrevEUB;
1263 void setCombinedLowerBoundVariable(Expr *CombLB) {
1265 "expected loop bound sharing directive");
1266 Data->getChildren()[CombinedLowerBoundVariableOffset] = CombLB;
1268 void setCombinedUpperBoundVariable(Expr *CombUB) {
1270 "expected loop bound sharing directive");
1271 Data->getChildren()[CombinedUpperBoundVariableOffset] = CombUB;
1273 void setCombinedEnsureUpperBound(Expr *CombEUB) {
1275 "expected loop bound sharing directive");
1276 Data->getChildren()[CombinedEnsureUpperBoundOffset] = CombEUB;
1278 void setCombinedInit(Expr *CombInit) {
1280 "expected loop bound sharing directive");
1281 Data->getChildren()[CombinedInitOffset] = CombInit;
1283 void setCombinedCond(Expr *CombCond) {
1285 "expected loop bound sharing directive");
1286 Data->getChildren()[CombinedConditionOffset] = CombCond;
1288 void setCombinedNextLowerBound(Expr *CombNLB) {
1290 "expected loop bound sharing directive");
1291 Data->getChildren()[CombinedNextLowerBoundOffset] = CombNLB;
1293 void setCombinedNextUpperBound(Expr *CombNUB) {
1295 "expected loop bound sharing directive");
1296 Data->getChildren()[CombinedNextUpperBoundOffset] = CombNUB;
1298 void setCombinedDistCond(Expr *CombDistCond) {
1300 "expected loop bound distribute sharing directive");
1301 Data->getChildren()[CombinedDistConditionOffset] = CombDistCond;
1303 void setCombinedParForInDistCond(Expr *CombParForInDistCond) {
1305 "expected loop bound distribute sharing directive");
1306 Data->getChildren()[CombinedParForInDistConditionOffset] =
1307 CombParForInDistCond;
1309 void setCounters(ArrayRef<Expr *> A);
1310 void setPrivateCounters(ArrayRef<Expr *> A);
1311 void setInits(ArrayRef<Expr *> A);
1312 void setUpdates(ArrayRef<Expr *> A);
1313 void setFinals(ArrayRef<Expr *> A);
1314 void setDependentCounters(ArrayRef<Expr *> A);
1315 void setDependentInits(ArrayRef<Expr *> A);
1316 void setFinalsConditions(ArrayRef<Expr *> A);
1319 Expr *getIterationVariable()
const {
1320 return cast<Expr>(
Data->getChildren()[IterationVariableOffset]);
1322 Expr *getLastIteration()
const {
1323 return cast<Expr>(
Data->getChildren()[LastIterationOffset]);
1325 Expr *getCalcLastIteration()
const {
1326 return cast<Expr>(
Data->getChildren()[CalcLastIterationOffset]);
1328 Expr *getPreCond()
const {
1329 return cast<Expr>(
Data->getChildren()[PreConditionOffset]);
1331 Expr *getCond()
const {
return cast<Expr>(
Data->getChildren()[CondOffset]); }
1332 Expr *getInit()
const {
return cast<Expr>(
Data->getChildren()[InitOffset]); }
1333 Expr *getInc()
const {
return cast<Expr>(
Data->getChildren()[IncOffset]); }
1334 const Stmt *getPreInits()
const {
1335 return Data->getChildren()[PreInitsOffset];
1337 Stmt *getPreInits() {
return Data->getChildren()[PreInitsOffset]; }
1338 Expr *getIsLastIterVariable()
const {
1343 "expected worksharing loop directive");
1344 return cast<Expr>(
Data->getChildren()[IsLastIterVariableOffset]);
1346 Expr *getLowerBoundVariable()
const {
1351 "expected worksharing loop directive");
1352 return cast<Expr>(
Data->getChildren()[LowerBoundVariableOffset]);
1354 Expr *getUpperBoundVariable()
const {
1359 "expected worksharing loop directive");
1360 return cast<Expr>(
Data->getChildren()[UpperBoundVariableOffset]);
1362 Expr *getStrideVariable()
const {
1367 "expected worksharing loop directive");
1368 return cast<Expr>(
Data->getChildren()[StrideVariableOffset]);
1370 Expr *getEnsureUpperBound()
const {
1375 "expected worksharing loop directive");
1376 return cast<Expr>(
Data->getChildren()[EnsureUpperBoundOffset]);
1378 Expr *getNextLowerBound()
const {
1383 "expected worksharing loop directive");
1384 return cast<Expr>(
Data->getChildren()[NextLowerBoundOffset]);
1386 Expr *getNextUpperBound()
const {
1391 "expected worksharing loop directive");
1392 return cast<Expr>(
Data->getChildren()[NextUpperBoundOffset]);
1394 Expr *getNumIterations()
const {
1399 "expected worksharing loop directive");
1400 return cast<Expr>(
Data->getChildren()[NumIterationsOffset]);
1402 Expr *getPrevLowerBoundVariable()
const {
1404 "expected loop bound sharing directive");
1405 return cast<Expr>(
Data->getChildren()[PrevLowerBoundVariableOffset]);
1407 Expr *getPrevUpperBoundVariable()
const {
1409 "expected loop bound sharing directive");
1410 return cast<Expr>(
Data->getChildren()[PrevUpperBoundVariableOffset]);
1412 Expr *getDistInc()
const {
1414 "expected loop bound sharing directive");
1415 return cast<Expr>(
Data->getChildren()[DistIncOffset]);
1417 Expr *getPrevEnsureUpperBound()
const {
1419 "expected loop bound sharing directive");
1420 return cast<Expr>(
Data->getChildren()[PrevEnsureUpperBoundOffset]);
1422 Expr *getCombinedLowerBoundVariable()
const {
1424 "expected loop bound sharing directive");
1425 return cast<Expr>(
Data->getChildren()[CombinedLowerBoundVariableOffset]);
1427 Expr *getCombinedUpperBoundVariable()
const {
1429 "expected loop bound sharing directive");
1430 return cast<Expr>(
Data->getChildren()[CombinedUpperBoundVariableOffset]);
1432 Expr *getCombinedEnsureUpperBound()
const {
1434 "expected loop bound sharing directive");
1435 return cast<Expr>(
Data->getChildren()[CombinedEnsureUpperBoundOffset]);
1437 Expr *getCombinedInit()
const {
1439 "expected loop bound sharing directive");
1440 return cast<Expr>(
Data->getChildren()[CombinedInitOffset]);
1442 Expr *getCombinedCond()
const {
1444 "expected loop bound sharing directive");
1445 return cast<Expr>(
Data->getChildren()[CombinedConditionOffset]);
1447 Expr *getCombinedNextLowerBound()
const {
1449 "expected loop bound sharing directive");
1450 return cast<Expr>(
Data->getChildren()[CombinedNextLowerBoundOffset]);
1452 Expr *getCombinedNextUpperBound()
const {
1454 "expected loop bound sharing directive");
1455 return cast<Expr>(
Data->getChildren()[CombinedNextUpperBoundOffset]);
1457 Expr *getCombinedDistCond()
const {
1459 "expected loop bound distribute sharing directive");
1460 return cast<Expr>(
Data->getChildren()[CombinedDistConditionOffset]);
1462 Expr *getCombinedParForInDistCond()
const {
1464 "expected loop bound distribute sharing directive");
1465 return cast<Expr>(
Data->getChildren()[CombinedParForInDistConditionOffset]);
1468 const Stmt *getBody()
const {
1469 return const_cast<OMPLoopDirective *
>(
this)->getBody();
1472 ArrayRef<Expr *> counters() {
return getCounters(); }
1474 ArrayRef<Expr *> counters()
const {
1475 return const_cast<OMPLoopDirective *
>(
this)->getCounters();
1478 ArrayRef<Expr *> private_counters() {
return getPrivateCounters(); }
1480 ArrayRef<Expr *> private_counters()
const {
1481 return const_cast<OMPLoopDirective *
>(
this)->getPrivateCounters();
1484 ArrayRef<Expr *> inits() {
return getInits(); }
1486 ArrayRef<Expr *> inits()
const {
1487 return const_cast<OMPLoopDirective *
>(
this)->getInits();
1490 ArrayRef<Expr *> updates() {
return getUpdates(); }
1492 ArrayRef<Expr *> updates()
const {
1493 return const_cast<OMPLoopDirective *
>(
this)->getUpdates();
1496 ArrayRef<Expr *> finals() {
return getFinals(); }
1498 ArrayRef<Expr *> finals()
const {
1499 return const_cast<OMPLoopDirective *
>(
this)->getFinals();
1502 ArrayRef<Expr *> dependent_counters() {
return getDependentCounters(); }
1504 ArrayRef<Expr *> dependent_counters()
const {
1505 return const_cast<OMPLoopDirective *
>(
this)->getDependentCounters();
1508 ArrayRef<Expr *> dependent_inits() {
return getDependentInits(); }
1510 ArrayRef<Expr *> dependent_inits()
const {
1511 return const_cast<OMPLoopDirective *
>(
this)->getDependentInits();
1514 ArrayRef<Expr *> finals_conditions() {
return getFinalsConditions(); }
1516 ArrayRef<Expr *> finals_conditions()
const {
1517 return const_cast<OMPLoopDirective *
>(
this)->getFinalsConditions();
1520 static bool classof(
const Stmt *T) {
1521 return T->getStmtClass() == OMPSimdDirectiveClass ||
1522 T->getStmtClass() == OMPForDirectiveClass ||
1523 T->getStmtClass() == OMPForSimdDirectiveClass ||
1524 T->getStmtClass() == OMPParallelForDirectiveClass ||
1525 T->getStmtClass() == OMPParallelForSimdDirectiveClass ||
1526 T->getStmtClass() == OMPTaskLoopDirectiveClass ||
1527 T->getStmtClass() == OMPTaskLoopSimdDirectiveClass ||
1528 T->getStmtClass() == OMPMaskedTaskLoopDirectiveClass ||
1529 T->getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass ||
1530 T->getStmtClass() == OMPMasterTaskLoopDirectiveClass ||
1531 T->getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass ||
1532 T->getStmtClass() == OMPGenericLoopDirectiveClass ||
1533 T->getStmtClass() == OMPTeamsGenericLoopDirectiveClass ||
1534 T->getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass ||
1535 T->getStmtClass() == OMPParallelGenericLoopDirectiveClass ||
1536 T->getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass ||
1537 T->getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass ||
1538 T->getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass ||
1539 T->getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass ||
1540 T->getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass ||
1541 T->getStmtClass() == OMPDistributeDirectiveClass ||
1542 T->getStmtClass() == OMPTargetParallelForDirectiveClass ||
1543 T->getStmtClass() == OMPDistributeParallelForDirectiveClass ||
1544 T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass ||
1545 T->getStmtClass() == OMPDistributeSimdDirectiveClass ||
1546 T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass ||
1547 T->getStmtClass() == OMPTargetSimdDirectiveClass ||
1548 T->getStmtClass() == OMPTeamsDistributeDirectiveClass ||
1549 T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass ||
1550 T->getStmtClass() ==
1551 OMPTeamsDistributeParallelForSimdDirectiveClass ||
1552 T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass ||
1553 T->getStmtClass() ==
1554 OMPTargetTeamsDistributeParallelForDirectiveClass ||
1555 T->getStmtClass() ==
1556 OMPTargetTeamsDistributeParallelForSimdDirectiveClass ||
1557 T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass ||
1558 T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
1571class OMPSimdDirective :
public OMPLoopDirective {
1572 friend class ASTStmtReader;
1573 friend class OMPExecutableDirective;
1580 OMPSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1581 unsigned CollapsedNum)
1582 : OMPLoopDirective(OMPSimdDirectiveClass, llvm::omp::OMPD_simd, StartLoc,
1583 EndLoc, CollapsedNum) {}
1589 explicit OMPSimdDirective(
unsigned CollapsedNum)
1590 : OMPLoopDirective(OMPSimdDirectiveClass, llvm::omp::OMPD_simd,
1591 SourceLocation(), SourceLocation(), CollapsedNum) {}
1604 static OMPSimdDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
1605 SourceLocation EndLoc,
unsigned CollapsedNum,
1606 ArrayRef<OMPClause *> Clauses,
1607 Stmt *AssociatedStmt,
1608 const HelperExprs &Exprs);
1617 static OMPSimdDirective *
CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
1618 unsigned CollapsedNum, EmptyShell);
1620 static bool classof(
const Stmt *T) {
1621 return T->getStmtClass() == OMPSimdDirectiveClass;
1634class OMPForDirective :
public OMPLoopDirective {
1635 friend class ASTStmtReader;
1636 friend class OMPExecutableDirective;
1638 bool HasCancel =
false;
1646 OMPForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1647 unsigned CollapsedNum)
1648 : OMPLoopDirective(OMPForDirectiveClass, llvm::omp::OMPD_for, StartLoc,
1649 EndLoc, CollapsedNum) {}
1655 explicit OMPForDirective(
unsigned CollapsedNum)
1656 : OMPLoopDirective(OMPForDirectiveClass, llvm::omp::OMPD_for,
1657 SourceLocation(), SourceLocation(), CollapsedNum) {}
1660 void setTaskReductionRefExpr(Expr *E) {
1661 Data->getChildren()[numLoopChildren(getLoopsNumber(),
1662 llvm::omp::OMPD_for)] = E;
1666 void setHasCancel(
bool Has) { HasCancel = Has; }
1682 static OMPForDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
1683 SourceLocation EndLoc,
unsigned CollapsedNum,
1684 ArrayRef<OMPClause *> Clauses,
1685 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
1686 Expr *TaskRedRef,
bool HasCancel);
1695 static OMPForDirective *
CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
1696 unsigned CollapsedNum, EmptyShell);
1699 Expr *getTaskReductionRefExpr() {
1700 return cast_or_null<Expr>(
Data->getChildren()[numLoopChildren(
1701 getLoopsNumber(), llvm::omp::OMPD_for)]);
1703 const Expr *getTaskReductionRefExpr()
const {
1704 return const_cast<OMPForDirective *
>(
this)->getTaskReductionRefExpr();
1708 bool hasCancel()
const {
return HasCancel; }
1710 static bool classof(
const Stmt *T) {
1711 return T->getStmtClass() == OMPForDirectiveClass;
1724class OMPForSimdDirective :
public OMPLoopDirective {
1725 friend class ASTStmtReader;
1726 friend class OMPExecutableDirective;
1733 OMPForSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1734 unsigned CollapsedNum)
1735 : OMPLoopDirective(OMPForSimdDirectiveClass, llvm::omp::OMPD_for_simd,
1736 StartLoc, EndLoc, CollapsedNum) {}
1742 explicit OMPForSimdDirective(
unsigned CollapsedNum)
1743 : OMPLoopDirective(OMPForSimdDirectiveClass, llvm::omp::OMPD_for_simd,
1744 SourceLocation(), SourceLocation(), CollapsedNum) {}
1757 static OMPForSimdDirective *
1758 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1759 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
1760 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
1769 static OMPForSimdDirective *
CreateEmpty(
const ASTContext &C,
1770 unsigned NumClauses,
1771 unsigned CollapsedNum, EmptyShell);
1773 static bool classof(
const Stmt *T) {
1774 return T->getStmtClass() == OMPForSimdDirectiveClass;
1787class OMPSectionsDirective :
public OMPExecutableDirective {
1788 friend class ASTStmtReader;
1789 friend class OMPExecutableDirective;
1792 bool HasCancel =
false;
1799 OMPSectionsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1800 : OMPExecutableDirective(OMPSectionsDirectiveClass,
1801 llvm::omp::OMPD_sections, StartLoc, EndLoc) {}
1805 explicit OMPSectionsDirective()
1806 : OMPExecutableDirective(OMPSectionsDirectiveClass,
1807 llvm::omp::OMPD_sections, SourceLocation(),
1808 SourceLocation()) {}
1811 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
1814 void setHasCancel(
bool Has) { HasCancel = Has; }
1828 static OMPSectionsDirective *
1829 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1830 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
1839 static OMPSectionsDirective *
CreateEmpty(
const ASTContext &C,
1840 unsigned NumClauses, EmptyShell);
1843 Expr *getTaskReductionRefExpr() {
1844 return cast_or_null<Expr>(
Data->getChildren()[0]);
1846 const Expr *getTaskReductionRefExpr()
const {
1847 return const_cast<OMPSectionsDirective *
>(
this)->getTaskReductionRefExpr();
1851 bool hasCancel()
const {
return HasCancel; }
1853 static bool classof(
const Stmt *T) {
1854 return T->getStmtClass() == OMPSectionsDirectiveClass;
1864class OMPSectionDirective :
public OMPExecutableDirective {
1865 friend class ASTStmtReader;
1866 friend class OMPExecutableDirective;
1869 bool HasCancel =
false;
1876 OMPSectionDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1877 : OMPExecutableDirective(OMPSectionDirectiveClass,
1878 llvm::omp::OMPD_section, StartLoc, EndLoc) {}
1882 explicit OMPSectionDirective()
1883 : OMPExecutableDirective(OMPSectionDirectiveClass,
1884 llvm::omp::OMPD_section, SourceLocation(),
1885 SourceLocation()) {}
1896 static OMPSectionDirective *
Create(
const ASTContext &C,
1897 SourceLocation StartLoc,
1898 SourceLocation EndLoc,
1899 Stmt *AssociatedStmt,
bool HasCancel);
1905 static OMPSectionDirective *
CreateEmpty(
const ASTContext &C, EmptyShell);
1908 void setHasCancel(
bool Has) { HasCancel = Has; }
1911 bool hasCancel()
const {
return HasCancel; }
1913 static bool classof(
const Stmt *T) {
1914 return T->getStmtClass() == OMPSectionDirectiveClass;
1925class OMPScopeDirective final :
public OMPExecutableDirective {
1926 friend class ASTStmtReader;
1927 friend class OMPExecutableDirective;
1934 OMPScopeDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1935 : OMPExecutableDirective(OMPScopeDirectiveClass, llvm::omp::OMPD_scope,
1936 StartLoc, EndLoc) {}
1940 explicit OMPScopeDirective()
1941 : OMPExecutableDirective(OMPScopeDirectiveClass, llvm::omp::OMPD_scope,
1942 SourceLocation(), SourceLocation()) {}
1952 static OMPScopeDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
1953 SourceLocation EndLoc,
1954 ArrayRef<OMPClause *> Clauses,
1955 Stmt *AssociatedStmt);
1961 static OMPScopeDirective *
CreateEmpty(
const ASTContext &C,
1962 unsigned NumClauses, EmptyShell);
1964 static bool classof(
const Stmt *T) {
1965 return T->getStmtClass() == OMPScopeDirectiveClass;
1977class OMPSingleDirective :
public OMPExecutableDirective {
1978 friend class ASTStmtReader;
1979 friend class OMPExecutableDirective;
1985 OMPSingleDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1986 : OMPExecutableDirective(OMPSingleDirectiveClass, llvm::omp::OMPD_single,
1987 StartLoc, EndLoc) {}
1991 explicit OMPSingleDirective()
1992 : OMPExecutableDirective(OMPSingleDirectiveClass, llvm::omp::OMPD_single,
1993 SourceLocation(), SourceLocation()) {}
2004 static OMPSingleDirective *
2005 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2006 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2014 static OMPSingleDirective *
CreateEmpty(
const ASTContext &C,
2015 unsigned NumClauses, EmptyShell);
2017 static bool classof(
const Stmt *T) {
2018 return T->getStmtClass() == OMPSingleDirectiveClass;
2028class OMPMasterDirective :
public OMPExecutableDirective {
2029 friend class ASTStmtReader;
2030 friend class OMPExecutableDirective;
2036 OMPMasterDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2037 : OMPExecutableDirective(OMPMasterDirectiveClass, llvm::omp::OMPD_master,
2038 StartLoc, EndLoc) {}
2042 explicit OMPMasterDirective()
2043 : OMPExecutableDirective(OMPMasterDirectiveClass, llvm::omp::OMPD_master,
2044 SourceLocation(), SourceLocation()) {}
2054 static OMPMasterDirective *
Create(
const ASTContext &C,
2055 SourceLocation StartLoc,
2056 SourceLocation EndLoc,
2057 Stmt *AssociatedStmt);
2063 static OMPMasterDirective *
CreateEmpty(
const ASTContext &C, EmptyShell);
2065 static bool classof(
const Stmt *T) {
2066 return T->getStmtClass() == OMPMasterDirectiveClass;
2076class OMPCriticalDirective :
public OMPExecutableDirective {
2077 friend class ASTStmtReader;
2078 friend class OMPExecutableDirective;
2080 DeclarationNameInfo DirName;
2087 OMPCriticalDirective(
const DeclarationNameInfo &Name, SourceLocation StartLoc,
2088 SourceLocation EndLoc)
2089 : OMPExecutableDirective(OMPCriticalDirectiveClass,
2090 llvm::omp::OMPD_critical, StartLoc, EndLoc),
2095 explicit OMPCriticalDirective()
2096 : OMPExecutableDirective(OMPCriticalDirectiveClass,
2097 llvm::omp::OMPD_critical, SourceLocation(),
2098 SourceLocation()) {}
2104 void setDirectiveName(
const DeclarationNameInfo &Name) { DirName = Name; }
2116 static OMPCriticalDirective *
2117 Create(
const ASTContext &C,
const DeclarationNameInfo &Name,
2118 SourceLocation StartLoc, SourceLocation EndLoc,
2119 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2126 static OMPCriticalDirective *
CreateEmpty(
const ASTContext &C,
2127 unsigned NumClauses, EmptyShell);
2131 DeclarationNameInfo getDirectiveName()
const {
return DirName; }
2133 static bool classof(
const Stmt *T) {
2134 return T->getStmtClass() == OMPCriticalDirectiveClass;
2147class OMPParallelForDirective :
public OMPLoopDirective {
2148 friend class ASTStmtReader;
2149 friend class OMPExecutableDirective;
2152 bool HasCancel =
false;
2160 OMPParallelForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2161 unsigned CollapsedNum)
2162 : OMPLoopDirective(OMPParallelForDirectiveClass,
2163 llvm::omp::OMPD_parallel_for, StartLoc, EndLoc,
2170 explicit OMPParallelForDirective(
unsigned CollapsedNum)
2171 : OMPLoopDirective(OMPParallelForDirectiveClass,
2172 llvm::omp::OMPD_parallel_for, SourceLocation(),
2173 SourceLocation(), CollapsedNum) {}
2176 void setTaskReductionRefExpr(Expr *E) {
2177 Data->getChildren()[numLoopChildren(getLoopsNumber(),
2178 llvm::omp::OMPD_parallel_for)] = E;
2182 void setHasCancel(
bool Has) { HasCancel = Has; }
2198 static OMPParallelForDirective *
2199 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2200 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2201 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
2211 static OMPParallelForDirective *
CreateEmpty(
const ASTContext &C,
2212 unsigned NumClauses,
2213 unsigned CollapsedNum,
2217 Expr *getTaskReductionRefExpr() {
2218 return cast_or_null<Expr>(
Data->getChildren()[numLoopChildren(
2219 getLoopsNumber(), llvm::omp::OMPD_parallel_for)]);
2221 const Expr *getTaskReductionRefExpr()
const {
2222 return const_cast<OMPParallelForDirective *
>(
this)
2223 ->getTaskReductionRefExpr();
2227 bool hasCancel()
const {
return HasCancel; }
2229 static bool classof(
const Stmt *T) {
2230 return T->getStmtClass() == OMPParallelForDirectiveClass;
2244class OMPParallelForSimdDirective :
public OMPLoopDirective {
2245 friend class ASTStmtReader;
2246 friend class OMPExecutableDirective;
2253 OMPParallelForSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2254 unsigned CollapsedNum)
2255 : OMPLoopDirective(OMPParallelForSimdDirectiveClass,
2256 llvm::omp::OMPD_parallel_for_simd, StartLoc, EndLoc,
2263 explicit OMPParallelForSimdDirective(
unsigned CollapsedNum)
2264 : OMPLoopDirective(OMPParallelForSimdDirectiveClass,
2265 llvm::omp::OMPD_parallel_for_simd, SourceLocation(),
2266 SourceLocation(), CollapsedNum) {}
2279 static OMPParallelForSimdDirective *
2280 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2281 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2282 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
2291 static OMPParallelForSimdDirective *
CreateEmpty(
const ASTContext &C,
2292 unsigned NumClauses,
2293 unsigned CollapsedNum,
2296 static bool classof(
const Stmt *T) {
2297 return T->getStmtClass() == OMPParallelForSimdDirectiveClass;
2309class OMPParallelMasterDirective :
public OMPExecutableDirective {
2310 friend class ASTStmtReader;
2311 friend class OMPExecutableDirective;
2313 OMPParallelMasterDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2314 : OMPExecutableDirective(OMPParallelMasterDirectiveClass,
2315 llvm::omp::OMPD_parallel_master, StartLoc,
2318 explicit OMPParallelMasterDirective()
2319 : OMPExecutableDirective(OMPParallelMasterDirectiveClass,
2320 llvm::omp::OMPD_parallel_master,
2321 SourceLocation(), SourceLocation()) {}
2324 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2337 static OMPParallelMasterDirective *
2338 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2339 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);
2347 static OMPParallelMasterDirective *
2348 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2351 Expr *getTaskReductionRefExpr() {
2352 return cast_or_null<Expr>(
Data->getChildren()[0]);
2354 const Expr *getTaskReductionRefExpr()
const {
2355 return const_cast<OMPParallelMasterDirective *
>(
this)
2356 ->getTaskReductionRefExpr();
2359 static bool classof(
const Stmt *T) {
2360 return T->getStmtClass() == OMPParallelMasterDirectiveClass;
2372class OMPParallelMaskedDirective final :
public OMPExecutableDirective {
2373 friend class ASTStmtReader;
2374 friend class OMPExecutableDirective;
2376 OMPParallelMaskedDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2377 : OMPExecutableDirective(OMPParallelMaskedDirectiveClass,
2378 llvm::omp::OMPD_parallel_masked, StartLoc,
2381 explicit OMPParallelMaskedDirective()
2382 : OMPExecutableDirective(OMPParallelMaskedDirectiveClass,
2383 llvm::omp::OMPD_parallel_masked,
2384 SourceLocation(), SourceLocation()) {}
2387 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2400 static OMPParallelMaskedDirective *
2401 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2402 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);
2410 static OMPParallelMaskedDirective *
2411 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2414 Expr *getTaskReductionRefExpr() {
2415 return cast_or_null<Expr>(
Data->getChildren()[0]);
2417 const Expr *getTaskReductionRefExpr()
const {
2418 return const_cast<OMPParallelMaskedDirective *
>(
this)
2419 ->getTaskReductionRefExpr();
2422 static bool classof(
const Stmt *T) {
2423 return T->getStmtClass() == OMPParallelMaskedDirectiveClass;
2436class OMPParallelSectionsDirective :
public OMPExecutableDirective {
2437 friend class ASTStmtReader;
2438 friend class OMPExecutableDirective;
2441 bool HasCancel =
false;
2448 OMPParallelSectionsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2449 : OMPExecutableDirective(OMPParallelSectionsDirectiveClass,
2450 llvm::omp::OMPD_parallel_sections, StartLoc,
2455 explicit OMPParallelSectionsDirective()
2456 : OMPExecutableDirective(OMPParallelSectionsDirectiveClass,
2457 llvm::omp::OMPD_parallel_sections,
2458 SourceLocation(), SourceLocation()) {}
2461 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2464 void setHasCancel(
bool Has) { HasCancel = Has; }
2478 static OMPParallelSectionsDirective *
2479 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2480 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
2489 static OMPParallelSectionsDirective *
2490 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2493 Expr *getTaskReductionRefExpr() {
2494 return cast_or_null<Expr>(
Data->getChildren()[0]);
2496 const Expr *getTaskReductionRefExpr()
const {
2497 return const_cast<OMPParallelSectionsDirective *
>(
this)
2498 ->getTaskReductionRefExpr();
2502 bool hasCancel()
const {
return HasCancel; }
2504 static bool classof(
const Stmt *T) {
2505 return T->getStmtClass() == OMPParallelSectionsDirectiveClass;
2517class OMPTaskDirective :
public OMPExecutableDirective {
2518 friend class ASTStmtReader;
2519 friend class OMPExecutableDirective;
2521 bool HasCancel =
false;
2528 OMPTaskDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2529 : OMPExecutableDirective(OMPTaskDirectiveClass, llvm::omp::OMPD_task,
2530 StartLoc, EndLoc) {}
2534 explicit OMPTaskDirective()
2535 : OMPExecutableDirective(OMPTaskDirectiveClass, llvm::omp::OMPD_task,
2536 SourceLocation(), SourceLocation()) {}
2539 void setHasCancel(
bool Has) { HasCancel = Has; }
2551 static OMPTaskDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
2552 SourceLocation EndLoc,
2553 ArrayRef<OMPClause *> Clauses,
2554 Stmt *AssociatedStmt,
bool HasCancel);
2562 static OMPTaskDirective *
CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
2566 bool hasCancel()
const {
return HasCancel; }
2568 static bool classof(
const Stmt *T) {
2569 return T->getStmtClass() == OMPTaskDirectiveClass;
2579class OMPTaskyieldDirective :
public OMPExecutableDirective {
2580 friend class ASTStmtReader;
2581 friend class OMPExecutableDirective;
2587 OMPTaskyieldDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2588 : OMPExecutableDirective(OMPTaskyieldDirectiveClass,
2589 llvm::omp::OMPD_taskyield, StartLoc, EndLoc) {}
2593 explicit OMPTaskyieldDirective()
2594 : OMPExecutableDirective(OMPTaskyieldDirectiveClass,
2595 llvm::omp::OMPD_taskyield, SourceLocation(),
2596 SourceLocation()) {}
2605 static OMPTaskyieldDirective *
2606 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc);
2612 static OMPTaskyieldDirective *
CreateEmpty(
const ASTContext &C, EmptyShell);
2614 static bool classof(
const Stmt *T) {
2615 return T->getStmtClass() == OMPTaskyieldDirectiveClass;
2625class OMPBarrierDirective :
public OMPExecutableDirective {
2626 friend class ASTStmtReader;
2627 friend class OMPExecutableDirective;
2633 OMPBarrierDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2634 : OMPExecutableDirective(OMPBarrierDirectiveClass,
2635 llvm::omp::OMPD_barrier, StartLoc, EndLoc) {}
2639 explicit OMPBarrierDirective()
2640 : OMPExecutableDirective(OMPBarrierDirectiveClass,
2641 llvm::omp::OMPD_barrier, SourceLocation(),
2642 SourceLocation()) {}
2651 static OMPBarrierDirective *
2652 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc);
2658 static OMPBarrierDirective *
CreateEmpty(
const ASTContext &C, EmptyShell);
2660 static bool classof(
const Stmt *T) {
2661 return T->getStmtClass() == OMPBarrierDirectiveClass;
2671class OMPTaskwaitDirective :
public OMPExecutableDirective {
2672 friend class ASTStmtReader;
2673 friend class OMPExecutableDirective;
2679 OMPTaskwaitDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2680 : OMPExecutableDirective(OMPTaskwaitDirectiveClass,
2681 llvm::omp::OMPD_taskwait, StartLoc, EndLoc) {}
2685 explicit OMPTaskwaitDirective()
2686 : OMPExecutableDirective(OMPTaskwaitDirectiveClass,
2687 llvm::omp::OMPD_taskwait, SourceLocation(),
2688 SourceLocation()) {}
2698 static OMPTaskwaitDirective *
Create(
const ASTContext &C,
2699 SourceLocation StartLoc,
2700 SourceLocation EndLoc,
2701 ArrayRef<OMPClause *> Clauses);
2708 static OMPTaskwaitDirective *
CreateEmpty(
const ASTContext &C,
2709 unsigned NumClauses, EmptyShell);
2711 static bool classof(
const Stmt *T) {
2712 return T->getStmtClass() == OMPTaskwaitDirectiveClass;
2722class OMPTaskgroupDirective :
public OMPExecutableDirective {
2723 friend class ASTStmtReader;
2724 friend class OMPExecutableDirective;
2730 OMPTaskgroupDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2731 : OMPExecutableDirective(OMPTaskgroupDirectiveClass,
2732 llvm::omp::OMPD_taskgroup, StartLoc, EndLoc) {}
2736 explicit OMPTaskgroupDirective()
2737 : OMPExecutableDirective(OMPTaskgroupDirectiveClass,
2738 llvm::omp::OMPD_taskgroup, SourceLocation(),
2739 SourceLocation()) {}
2742 void setReductionRef(Expr *RR) {
Data->getChildren()[0] = RR; }
2754 static OMPTaskgroupDirective *
2755 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2756 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2757 Expr *ReductionRef);
2764 static OMPTaskgroupDirective *
CreateEmpty(
const ASTContext &C,
2765 unsigned NumClauses, EmptyShell);
2769 const Expr *getReductionRef()
const {
2770 return const_cast<OMPTaskgroupDirective *
>(
this)->getReductionRef();
2772 Expr *getReductionRef() {
return cast_or_null<Expr>(
Data->getChildren()[0]); }
2774 static bool classof(
const Stmt *T) {
2775 return T->getStmtClass() == OMPTaskgroupDirectiveClass;
2789class OMPFlushDirective :
public OMPExecutableDirective {
2790 friend class ASTStmtReader;
2791 friend class OMPExecutableDirective;
2797 OMPFlushDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2798 : OMPExecutableDirective(OMPFlushDirectiveClass, llvm::omp::OMPD_flush,
2799 StartLoc, EndLoc) {}
2803 explicit OMPFlushDirective()
2804 : OMPExecutableDirective(OMPFlushDirectiveClass, llvm::omp::OMPD_flush,
2805 SourceLocation(), SourceLocation()) {}
2816 static OMPFlushDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
2817 SourceLocation EndLoc,
2818 ArrayRef<OMPClause *> Clauses);
2826 static OMPFlushDirective *
CreateEmpty(
const ASTContext &C,
2827 unsigned NumClauses, EmptyShell);
2829 static bool classof(
const Stmt *T) {
2830 return T->getStmtClass() == OMPFlushDirectiveClass;
2841class OMPDepobjDirective final :
public OMPExecutableDirective {
2842 friend class ASTStmtReader;
2843 friend class OMPExecutableDirective;
2850 OMPDepobjDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2851 : OMPExecutableDirective(OMPDepobjDirectiveClass, llvm::omp::OMPD_depobj,
2852 StartLoc, EndLoc) {}
2856 explicit OMPDepobjDirective()
2857 : OMPExecutableDirective(OMPDepobjDirectiveClass, llvm::omp::OMPD_depobj,
2858 SourceLocation(), SourceLocation()) {}
2868 static OMPDepobjDirective *
Create(
const ASTContext &C,
2869 SourceLocation StartLoc,
2870 SourceLocation EndLoc,
2871 ArrayRef<OMPClause *> Clauses);
2879 static OMPDepobjDirective *
CreateEmpty(
const ASTContext &C,
2880 unsigned NumClauses, EmptyShell);
2882 static bool classof(
const Stmt *T) {
2883 return T->getStmtClass() == OMPDepobjDirectiveClass;
2893class OMPOrderedDirective :
public OMPExecutableDirective {
2894 friend class ASTStmtReader;
2895 friend class OMPExecutableDirective;
2901 OMPOrderedDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2902 : OMPExecutableDirective(OMPOrderedDirectiveClass,
2903 llvm::omp::OMPD_ordered, StartLoc, EndLoc) {}
2907 explicit OMPOrderedDirective()
2908 : OMPExecutableDirective(OMPOrderedDirectiveClass,
2909 llvm::omp::OMPD_ordered, SourceLocation(),
2910 SourceLocation()) {}
2921 static OMPOrderedDirective *
2922 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2923 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2931 static OMPOrderedDirective *
CreateEmpty(
const ASTContext &C,
2932 unsigned NumClauses,
2933 bool IsStandalone, EmptyShell);
2935 static bool classof(
const Stmt *T) {
2936 return T->getStmtClass() == OMPOrderedDirectiveClass;
2947class OMPAtomicDirective :
public OMPExecutableDirective {
2948 friend class ASTStmtReader;
2949 friend class OMPExecutableDirective;
2961 LLVM_PREFERRED_TYPE(
bool)
2971 LLVM_PREFERRED_TYPE(
bool)
2975 LLVM_PREFERRED_TYPE(
bool)
2984 OMPAtomicDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2985 : OMPExecutableDirective(OMPAtomicDirectiveClass, llvm::omp::OMPD_atomic,
2986 StartLoc, EndLoc) {}
2990 explicit OMPAtomicDirective()
2991 : OMPExecutableDirective(OMPAtomicDirectiveClass, llvm::omp::OMPD_atomic,
2992 SourceLocation(), SourceLocation()) {}
2994 enum DataPositionTy :
size_t {
3005 void setX(Expr *
X) {
Data->getChildren()[DataPositionTy::POS_X] =
X; }
3009 void setUpdateExpr(Expr *UE) {
3010 Data->getChildren()[DataPositionTy::POS_UpdateExpr] = UE;
3013 void setV(Expr *
V) {
Data->getChildren()[DataPositionTy::POS_V] =
V; }
3015 void setR(Expr *R) {
Data->getChildren()[DataPositionTy::POS_R] = R; }
3017 void setExpr(Expr *E) {
Data->getChildren()[DataPositionTy::POS_E] = E; }
3019 void setD(Expr *D) {
Data->getChildren()[DataPositionTy::POS_D] = D; }
3021 void setCond(Expr *C) {
Data->getChildren()[DataPositionTy::POS_Cond] =
C; }
3024 struct Expressions {
3061 SourceLocation StartLoc,
3062 SourceLocation EndLoc,
3064 Stmt *AssociatedStmt, Expressions Exprs);
3073 unsigned NumClauses, EmptyShell);
3077 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_X]);
3079 const Expr *
getX()
const {
3080 return cast_or_null<Expr>(
Data->getChildren()[DataPositionTy::POS_X]);
3086 return cast_or_null<Expr>(
3087 Data->getChildren()[DataPositionTy::POS_UpdateExpr]);
3090 return cast_or_null<Expr>(
3091 Data->getChildren()[DataPositionTy::POS_UpdateExpr]);
3105 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_V]);
3107 const Expr *
getV()
const {
3108 return cast_or_null<Expr>(
Data->getChildren()[DataPositionTy::POS_V]);
3112 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_R]);
3114 const Expr *
getR()
const {
3115 return cast_or_null<Expr>(
Data->getChildren()[DataPositionTy::POS_R]);
3119 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_E]);
3122 return cast_or_null<Expr>(
Data->getChildren()[DataPositionTy::POS_E]);
3126 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_D]);
3128 Expr *
getD()
const {
3129 return cast_or_null<Expr>(
Data->getChildren()[DataPositionTy::POS_D]);
3133 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_Cond]);
3136 return cast_or_null<Expr>(
Data->getChildren()[DataPositionTy::POS_Cond]);
3140 return T->getStmtClass() == OMPAtomicDirectiveClass;
3160 OMPTargetDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3162 StartLoc, EndLoc) {}
3168 SourceLocation(), SourceLocation()) {}
3179 static OMPTargetDirective *
3180 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3181 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3189 static OMPTargetDirective *
CreateEmpty(
const ASTContext &C,
3190 unsigned NumClauses, EmptyShell);
3193 return T->getStmtClass() == OMPTargetDirectiveClass;
3214 OMPTargetDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3216 llvm::omp::OMPD_target_data, StartLoc, EndLoc) {}
3222 llvm::omp::OMPD_target_data, SourceLocation(),
3223 SourceLocation()) {}
3234 static OMPTargetDataDirective *
3235 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3236 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3243 static OMPTargetDataDirective *
CreateEmpty(
const ASTContext &C,
unsigned N,
3247 return T->getStmtClass() == OMPTargetDataDirectiveClass;
3268 OMPTargetEnterDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3270 llvm::omp::OMPD_target_enter_data, StartLoc,
3277 llvm::omp::OMPD_target_enter_data,
3278 SourceLocation(), SourceLocation()) {}
3289 static OMPTargetEnterDataDirective *
3290 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3291 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3298 static OMPTargetEnterDataDirective *
CreateEmpty(
const ASTContext &C,
3299 unsigned N, EmptyShell);
3302 return T->getStmtClass() == OMPTargetEnterDataDirectiveClass;
3323 OMPTargetExitDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3325 llvm::omp::OMPD_target_exit_data, StartLoc,
3332 llvm::omp::OMPD_target_exit_data,
3333 SourceLocation(), SourceLocation()) {}
3344 static OMPTargetExitDataDirective *
3345 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3346 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3353 static OMPTargetExitDataDirective *
CreateEmpty(
const ASTContext &C,
3354 unsigned N, EmptyShell);
3357 return T->getStmtClass() == OMPTargetExitDataDirectiveClass;
3373 bool HasCancel =
false;
3380 OMPTargetParallelDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3382 llvm::omp::OMPD_target_parallel, StartLoc,
3389 llvm::omp::OMPD_target_parallel,
3390 SourceLocation(), SourceLocation()) {}
3393 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
3395 void setHasCancel(
bool Has) { HasCancel = Has; }
3409 static OMPTargetParallelDirective *
3410 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3411 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
3420 static OMPTargetParallelDirective *
3421 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
3425 return cast_or_null<Expr>(Data->getChildren()[0]);
3428 return const_cast<OMPTargetParallelDirective *
>(
this)
3436 return T->getStmtClass() == OMPTargetParallelDirectiveClass;
3454 bool HasCancel =
false;
3462 OMPTargetParallelForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3463 unsigned CollapsedNum)
3465 llvm::omp::OMPD_target_parallel_for, StartLoc, EndLoc,
3474 llvm::omp::OMPD_target_parallel_for, SourceLocation(),
3475 SourceLocation(), CollapsedNum) {}
3478 void setTaskReductionRefExpr(Expr *E) {
3479 Data->getChildren()[numLoopChildren(
3480 getLoopsNumber(), llvm::omp::OMPD_target_parallel_for)] = E;
3484 void setHasCancel(
bool Has) { HasCancel = Has; }
3500 static OMPTargetParallelForDirective *
3501 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3502 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3503 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
3513 static OMPTargetParallelForDirective *
CreateEmpty(
const ASTContext &C,
3514 unsigned NumClauses,
3515 unsigned CollapsedNum,
3520 return cast_or_null<Expr>(Data->getChildren()[numLoopChildren(
3521 getLoopsNumber(), llvm::omp::OMPD_target_parallel_for)]);
3524 return const_cast<OMPTargetParallelForDirective *
>(
this)
3532 return T->getStmtClass() == OMPTargetParallelForDirectiveClass;
3552 OMPTeamsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3554 StartLoc, EndLoc) {}
3560 SourceLocation(), SourceLocation()) {}
3571 static OMPTeamsDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
3572 SourceLocation EndLoc,
3573 ArrayRef<OMPClause *> Clauses,
3574 Stmt *AssociatedStmt);
3582 static OMPTeamsDirective *
CreateEmpty(
const ASTContext &C,
3583 unsigned NumClauses, EmptyShell);
3586 return T->getStmtClass() == OMPTeamsDirectiveClass;
3600 OpenMPDirectiveKind CancelRegion = llvm::omp::OMPD_unknown;
3607 OMPCancellationPointDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3609 llvm::omp::OMPD_cancellation_point, StartLoc,
3615 llvm::omp::OMPD_cancellation_point,
3616 SourceLocation(), SourceLocation()) {}
3620 void setCancelRegion(OpenMPDirectiveKind CR) { CancelRegion = CR; }
3629 static OMPCancellationPointDirective *
3630 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3631 OpenMPDirectiveKind CancelRegion);
3637 static OMPCancellationPointDirective *
CreateEmpty(
const ASTContext &C,
3644 return T->getStmtClass() == OMPCancellationPointDirectiveClass;
3658 OpenMPDirectiveKind CancelRegion = llvm::omp::OMPD_unknown;
3664 OMPCancelDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3666 StartLoc, EndLoc) {}
3672 SourceLocation(), SourceLocation()) {}
3676 void setCancelRegion(OpenMPDirectiveKind CR) { CancelRegion = CR; }
3686 static OMPCancelDirective *
3687 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3688 ArrayRef<OMPClause *> Clauses, OpenMPDirectiveKind CancelRegion);
3695 static OMPCancelDirective *
CreateEmpty(
const ASTContext &C,
3696 unsigned NumClauses, EmptyShell);
3702 return T->getStmtClass() == OMPCancelDirectiveClass;
3719 bool HasCancel =
false;
3727 OMPTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3728 unsigned CollapsedNum)
3730 StartLoc, EndLoc, CollapsedNum) {}
3738 SourceLocation(), SourceLocation(), CollapsedNum) {}
3741 void setHasCancel(
bool Has) { HasCancel = Has; }
3755 static OMPTaskLoopDirective *
3756 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3757 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3758 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
3767 static OMPTaskLoopDirective *
CreateEmpty(
const ASTContext &C,
3768 unsigned NumClauses,
3769 unsigned CollapsedNum, EmptyShell);
3775 return T->getStmtClass() == OMPTaskLoopDirectiveClass;
3797 OMPTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3798 unsigned CollapsedNum)
3800 llvm::omp::OMPD_taskloop_simd, StartLoc, EndLoc,
3809 llvm::omp::OMPD_taskloop_simd, SourceLocation(),
3810 SourceLocation(), CollapsedNum) {}
3823 static OMPTaskLoopSimdDirective *
3824 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3825 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3826 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
3835 static OMPTaskLoopSimdDirective *
CreateEmpty(
const ASTContext &C,
3836 unsigned NumClauses,
3837 unsigned CollapsedNum,
3841 return T->getStmtClass() == OMPTaskLoopSimdDirectiveClass;
3858 bool HasCancel =
false;
3866 OMPMasterTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3867 unsigned CollapsedNum)
3869 llvm::omp::OMPD_master_taskloop, StartLoc, EndLoc,
3878 llvm::omp::OMPD_master_taskloop, SourceLocation(),
3879 SourceLocation(), CollapsedNum) {}
3882 void setHasCancel(
bool Has) { HasCancel = Has; }
3896 static OMPMasterTaskLoopDirective *
3897 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3898 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3899 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
3908 static OMPMasterTaskLoopDirective *
CreateEmpty(
const ASTContext &C,
3909 unsigned NumClauses,
3910 unsigned CollapsedNum,
3917 return T->getStmtClass() == OMPMasterTaskLoopDirectiveClass;
3934 bool HasCancel =
false;
3942 OMPMaskedTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3943 unsigned CollapsedNum)
3945 llvm::omp::OMPD_masked_taskloop, StartLoc, EndLoc,
3954 llvm::omp::OMPD_masked_taskloop, SourceLocation(),
3955 SourceLocation(), CollapsedNum) {}
3958 void setHasCancel(
bool Has) { HasCancel = Has; }
3972 static OMPMaskedTaskLoopDirective *
3973 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3974 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3975 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
3984 static OMPMaskedTaskLoopDirective *
CreateEmpty(
const ASTContext &C,
3985 unsigned NumClauses,
3986 unsigned CollapsedNum,
3993 return T->getStmtClass() == OMPMaskedTaskLoopDirectiveClass;
4015 OMPMasterTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4016 unsigned CollapsedNum)
4018 llvm::omp::OMPD_master_taskloop_simd, StartLoc, EndLoc,
4027 llvm::omp::OMPD_master_taskloop_simd, SourceLocation(),
4028 SourceLocation(), CollapsedNum) {}
4041 static OMPMasterTaskLoopSimdDirective *
4042 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4043 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4044 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4052 static OMPMasterTaskLoopSimdDirective *
CreateEmpty(
const ASTContext &C,
4053 unsigned NumClauses,
4054 unsigned CollapsedNum,
4058 return T->getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass;
4080 OMPMaskedTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4081 unsigned CollapsedNum)
4083 llvm::omp::OMPD_masked_taskloop_simd, StartLoc, EndLoc,
4092 llvm::omp::OMPD_masked_taskloop_simd, SourceLocation(),
4093 SourceLocation(), CollapsedNum) {}
4106 static OMPMaskedTaskLoopSimdDirective *
4107 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4108 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4109 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4117 static OMPMaskedTaskLoopSimdDirective *
CreateEmpty(
const ASTContext &C,
4118 unsigned NumClauses,
4119 unsigned CollapsedNum,
4123 return T->getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass;
4141 bool HasCancel =
false;
4149 OMPParallelMasterTaskLoopDirective(SourceLocation StartLoc,
4150 SourceLocation EndLoc,
4151 unsigned CollapsedNum)
4153 llvm::omp::OMPD_parallel_master_taskloop, StartLoc,
4154 EndLoc, CollapsedNum) {}
4162 llvm::omp::OMPD_parallel_master_taskloop,
4163 SourceLocation(), SourceLocation(), CollapsedNum) {}
4166 void setHasCancel(
bool Has) { HasCancel = Has; }
4180 static OMPParallelMasterTaskLoopDirective *
4181 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4182 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4183 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4192 static OMPParallelMasterTaskLoopDirective *
CreateEmpty(
const ASTContext &C,
4193 unsigned NumClauses,
4194 unsigned CollapsedNum,
4201 return T->getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass;
4219 bool HasCancel =
false;
4227 OMPParallelMaskedTaskLoopDirective(SourceLocation StartLoc,
4228 SourceLocation EndLoc,
4229 unsigned CollapsedNum)
4231 llvm::omp::OMPD_parallel_masked_taskloop, StartLoc,
4232 EndLoc, CollapsedNum) {}
4240 llvm::omp::OMPD_parallel_masked_taskloop,
4241 SourceLocation(), SourceLocation(), CollapsedNum) {}
4244 void setHasCancel(
bool Has) { HasCancel = Has; }
4258 static OMPParallelMaskedTaskLoopDirective *
4259 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4260 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4261 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4270 static OMPParallelMaskedTaskLoopDirective *
CreateEmpty(
const ASTContext &C,
4271 unsigned NumClauses,
4272 unsigned CollapsedNum,
4279 return T->getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass;
4302 OMPParallelMasterTaskLoopSimdDirective(SourceLocation StartLoc,
4303 SourceLocation EndLoc,
4304 unsigned CollapsedNum)
4306 llvm::omp::OMPD_parallel_master_taskloop_simd,
4307 StartLoc, EndLoc, CollapsedNum) {}
4315 llvm::omp::OMPD_parallel_master_taskloop_simd,
4316 SourceLocation(), SourceLocation(), CollapsedNum) {}
4329 static OMPParallelMasterTaskLoopSimdDirective *
4330 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4331 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4332 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4341 static OMPParallelMasterTaskLoopSimdDirective *
4342 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4346 return T->getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass;
4369 OMPParallelMaskedTaskLoopSimdDirective(SourceLocation StartLoc,
4370 SourceLocation EndLoc,
4371 unsigned CollapsedNum)
4373 llvm::omp::OMPD_parallel_masked_taskloop_simd,
4374 StartLoc, EndLoc, CollapsedNum) {}
4382 llvm::omp::OMPD_parallel_masked_taskloop_simd,
4383 SourceLocation(), SourceLocation(), CollapsedNum) {}
4396 static OMPParallelMaskedTaskLoopSimdDirective *
4397 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4398 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4399 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4408 static OMPParallelMaskedTaskLoopSimdDirective *
4409 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4413 return T->getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass;
4435 OMPDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4436 unsigned CollapsedNum)
4438 llvm::omp::OMPD_distribute, StartLoc, EndLoc,
4447 llvm::omp::OMPD_distribute, SourceLocation(),
4448 SourceLocation(), CollapsedNum) {}
4461 static OMPDistributeDirective *
4462 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4463 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4464 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4473 static OMPDistributeDirective *
CreateEmpty(
const ASTContext &C,
4474 unsigned NumClauses,
4475 unsigned CollapsedNum, EmptyShell);
4478 return T->getStmtClass() == OMPDistributeDirectiveClass;
4499 OMPTargetUpdateDirective(SourceLocation StartLoc, SourceLocation EndLoc)
4501 llvm::omp::OMPD_target_update, StartLoc,
4508 llvm::omp::OMPD_target_update, SourceLocation(),
4509 SourceLocation()) {}
4520 static OMPTargetUpdateDirective *
4521 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4522 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
4530 static OMPTargetUpdateDirective *
CreateEmpty(
const ASTContext &C,
4531 unsigned NumClauses, EmptyShell);
4534 return T->getStmtClass() == OMPTargetUpdateDirectiveClass;
4551 bool HasCancel =
false;
4559 OMPDistributeParallelForDirective(SourceLocation StartLoc,
4560 SourceLocation EndLoc,
4561 unsigned CollapsedNum)
4563 llvm::omp::OMPD_distribute_parallel_for, StartLoc,
4564 EndLoc, CollapsedNum) {}
4572 llvm::omp::OMPD_distribute_parallel_for,
4573 SourceLocation(), SourceLocation(), CollapsedNum) {}
4576 void setTaskReductionRefExpr(Expr *E) {
4577 Data->getChildren()[numLoopChildren(
4578 getLoopsNumber(), llvm::omp::OMPD_distribute_parallel_for)] = E;
4582 void setHasCancel(
bool Has) { HasCancel = Has; }
4598 static OMPDistributeParallelForDirective *
4599 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4600 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4601 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
4611 static OMPDistributeParallelForDirective *
CreateEmpty(
const ASTContext &C,
4612 unsigned NumClauses,
4613 unsigned CollapsedNum,
4618 return cast_or_null<Expr>(Data->getChildren()[numLoopChildren(
4619 getLoopsNumber(), llvm::omp::OMPD_distribute_parallel_for)]);
4622 return const_cast<OMPDistributeParallelForDirective *
>(
this)
4630 return T->getStmtClass() == OMPDistributeParallelForDirectiveClass;
4653 OMPDistributeParallelForSimdDirective(SourceLocation StartLoc,
4654 SourceLocation EndLoc,
4655 unsigned CollapsedNum)
4657 llvm::omp::OMPD_distribute_parallel_for_simd, StartLoc,
4658 EndLoc, CollapsedNum) {}
4666 llvm::omp::OMPD_distribute_parallel_for_simd,
4667 SourceLocation(), SourceLocation(), CollapsedNum) {}
4680 static OMPDistributeParallelForSimdDirective *
Create(
4681 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4682 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4683 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4691 static OMPDistributeParallelForSimdDirective *
CreateEmpty(
4692 const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4696 return T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass;
4718 OMPDistributeSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4719 unsigned CollapsedNum)
4721 llvm::omp::OMPD_distribute_simd, StartLoc, EndLoc,
4730 llvm::omp::OMPD_distribute_simd, SourceLocation(),
4731 SourceLocation(), CollapsedNum) {}
4744 static OMPDistributeSimdDirective *
4745 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4746 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4747 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4755 static OMPDistributeSimdDirective *
CreateEmpty(
const ASTContext &C,
4756 unsigned NumClauses,
4757 unsigned CollapsedNum,
4761 return T->getStmtClass() == OMPDistributeSimdDirectiveClass;
4784 OMPTargetParallelForSimdDirective(SourceLocation StartLoc,
4785 SourceLocation EndLoc,
4786 unsigned CollapsedNum)
4788 llvm::omp::OMPD_target_parallel_for_simd, StartLoc,
4789 EndLoc, CollapsedNum) {}
4797 llvm::omp::OMPD_target_parallel_for_simd,
4798 SourceLocation(), SourceLocation(), CollapsedNum) {}
4811 static OMPTargetParallelForSimdDirective *
4812 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4813 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4814 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4822 static OMPTargetParallelForSimdDirective *
CreateEmpty(
const ASTContext &C,
4823 unsigned NumClauses,
4824 unsigned CollapsedNum,
4828 return T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass;
4851 OMPTargetSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4852 unsigned CollapsedNum)
4854 llvm::omp::OMPD_target_simd, StartLoc, EndLoc,
4863 llvm::omp::OMPD_target_simd, SourceLocation(),
4864 SourceLocation(), CollapsedNum) {}
4877 static OMPTargetSimdDirective *
4878 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4879 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4880 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4888 static OMPTargetSimdDirective *
CreateEmpty(
const ASTContext &C,
4889 unsigned NumClauses,
4890 unsigned CollapsedNum,
4894 return T->getStmtClass() == OMPTargetSimdDirectiveClass;
4916 OMPTeamsDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4917 unsigned CollapsedNum)
4919 llvm::omp::OMPD_teams_distribute, StartLoc, EndLoc,
4928 llvm::omp::OMPD_teams_distribute, SourceLocation(),
4929 SourceLocation(), CollapsedNum) {}
4942 static OMPTeamsDistributeDirective *
4943 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4944 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4945 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4953 static OMPTeamsDistributeDirective *
CreateEmpty(
const ASTContext &C,
4954 unsigned NumClauses,
4955 unsigned CollapsedNum,
4959 return T->getStmtClass() == OMPTeamsDistributeDirectiveClass;
4982 OMPTeamsDistributeSimdDirective(SourceLocation StartLoc,
4983 SourceLocation EndLoc,
unsigned CollapsedNum)
4985 llvm::omp::OMPD_teams_distribute_simd, StartLoc,
4986 EndLoc, CollapsedNum) {}
4994 llvm::omp::OMPD_teams_distribute_simd,
4995 SourceLocation(), SourceLocation(), CollapsedNum) {}
5008 static OMPTeamsDistributeSimdDirective *
5009 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5010 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5011 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5020 static OMPTeamsDistributeSimdDirective *
CreateEmpty(
const ASTContext &C,
5021 unsigned NumClauses,
5022 unsigned CollapsedNum,
5026 return T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass;
5039class OMPTeamsDistributeParallelForSimdDirective final
5050 OMPTeamsDistributeParallelForSimdDirective(SourceLocation StartLoc,
5051 SourceLocation EndLoc,
5052 unsigned CollapsedNum)
5054 llvm::omp::OMPD_teams_distribute_parallel_for_simd,
5055 StartLoc, EndLoc, CollapsedNum) {}
5063 llvm::omp::OMPD_teams_distribute_parallel_for_simd,
5064 SourceLocation(), SourceLocation(), CollapsedNum) {}
5077 static OMPTeamsDistributeParallelForSimdDirective *
5078 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5079 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5080 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5088 static OMPTeamsDistributeParallelForSimdDirective *
5089 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5093 return T->getStmtClass() == OMPTeamsDistributeParallelForSimdDirectiveClass;
5110 bool HasCancel =
false;
5118 OMPTeamsDistributeParallelForDirective(SourceLocation StartLoc,
5119 SourceLocation EndLoc,
5120 unsigned CollapsedNum)
5122 llvm::omp::OMPD_teams_distribute_parallel_for,
5123 StartLoc, EndLoc, CollapsedNum) {}
5131 llvm::omp::OMPD_teams_distribute_parallel_for,
5132 SourceLocation(), SourceLocation(), CollapsedNum) {}
5135 void setTaskReductionRefExpr(Expr *E) {
5136 Data->getChildren()[numLoopChildren(
5137 getLoopsNumber(), llvm::omp::OMPD_teams_distribute_parallel_for)] = E;
5141 void setHasCancel(
bool Has) { HasCancel = Has; }
5157 static OMPTeamsDistributeParallelForDirective *
5158 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5159 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5160 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
5169 static OMPTeamsDistributeParallelForDirective *
5170 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5175 return cast_or_null<Expr>(Data->getChildren()[numLoopChildren(
5176 getLoopsNumber(), llvm::omp::OMPD_teams_distribute_parallel_for)]);
5179 return const_cast<OMPTeamsDistributeParallelForDirective *
>(
this)
5187 return T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass;
5207 OMPTargetTeamsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
5209 llvm::omp::OMPD_target_teams, StartLoc, EndLoc) {
5216 llvm::omp::OMPD_target_teams, SourceLocation(),
5217 SourceLocation()) {}
5228 static OMPTargetTeamsDirective *
Create(
const ASTContext &C,
5229 SourceLocation StartLoc,
5230 SourceLocation EndLoc,
5231 ArrayRef<OMPClause *> Clauses,
5232 Stmt *AssociatedStmt);
5239 static OMPTargetTeamsDirective *
CreateEmpty(
const ASTContext &C,
5240 unsigned NumClauses, EmptyShell);
5243 return T->getStmtClass() == OMPTargetTeamsDirectiveClass;
5265 OMPTargetTeamsDistributeDirective(SourceLocation StartLoc,
5266 SourceLocation EndLoc,
5267 unsigned CollapsedNum)
5269 llvm::omp::OMPD_target_teams_distribute, StartLoc,
5270 EndLoc, CollapsedNum) {}
5278 llvm::omp::OMPD_target_teams_distribute,
5279 SourceLocation(), SourceLocation(), CollapsedNum) {}
5292 static OMPTargetTeamsDistributeDirective *
5293 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5294 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5295 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5303 static OMPTargetTeamsDistributeDirective *
5304 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5308 return T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass;
5321class OMPTargetTeamsDistributeParallelForDirective final
5326 bool HasCancel =
false;
5334 OMPTargetTeamsDistributeParallelForDirective(SourceLocation StartLoc,
5335 SourceLocation EndLoc,
5336 unsigned CollapsedNum)
5338 llvm::omp::OMPD_target_teams_distribute_parallel_for,
5339 StartLoc, EndLoc, CollapsedNum) {}
5347 llvm::omp::OMPD_target_teams_distribute_parallel_for,
5348 SourceLocation(), SourceLocation(), CollapsedNum) {}
5351 void setTaskReductionRefExpr(Expr *E) {
5352 Data->getChildren()[numLoopChildren(
5354 llvm::omp::OMPD_target_teams_distribute_parallel_for)] = E;
5358 void setHasCancel(
bool Has) { HasCancel = Has; }
5374 static OMPTargetTeamsDistributeParallelForDirective *
5375 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5376 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5377 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
5386 static OMPTargetTeamsDistributeParallelForDirective *
5387 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5392 return cast_or_null<Expr>(Data->getChildren()[numLoopChildren(
5394 llvm::omp::OMPD_target_teams_distribute_parallel_for)]);
5397 return const_cast<OMPTargetTeamsDistributeParallelForDirective *
>(
this)
5405 return T->getStmtClass() ==
5406 OMPTargetTeamsDistributeParallelForDirectiveClass;
5419class OMPTargetTeamsDistributeParallelForSimdDirective final
5430 OMPTargetTeamsDistributeParallelForSimdDirective(SourceLocation StartLoc,
5431 SourceLocation EndLoc,
5432 unsigned CollapsedNum)
5434 OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
5435 llvm::omp::OMPD_target_teams_distribute_parallel_for_simd, StartLoc,
5436 EndLoc, CollapsedNum) {}
5443 unsigned CollapsedNum)
5445 OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
5446 llvm::omp::OMPD_target_teams_distribute_parallel_for_simd,
5447 SourceLocation(), SourceLocation(), CollapsedNum) {}
5460 static OMPTargetTeamsDistributeParallelForSimdDirective *
5461 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5462 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5463 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5471 static OMPTargetTeamsDistributeParallelForSimdDirective *
5472 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5476 return T->getStmtClass() ==
5477 OMPTargetTeamsDistributeParallelForSimdDirectiveClass;
5500 OMPTargetTeamsDistributeSimdDirective(SourceLocation StartLoc,
5501 SourceLocation EndLoc,
5502 unsigned CollapsedNum)
5504 llvm::omp::OMPD_target_teams_distribute_simd, StartLoc,
5505 EndLoc, CollapsedNum) {}
5513 llvm::omp::OMPD_target_teams_distribute_simd,
5514 SourceLocation(), SourceLocation(), CollapsedNum) {}
5527 static OMPTargetTeamsDistributeSimdDirective *
5528 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5529 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5530 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5538 static OMPTargetTeamsDistributeSimdDirective *
5539 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5543 return T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
5548class OMPTileDirective final
5556 TransformedStmtOffset,
5562 OMPTileDirectiveClass,
llvm::omp::OMPD_tile, StartLoc, EndLoc,
5564 setNumGeneratedLoops(2 * NumLoops);
5567 void setPreInits(Stmt *PreInits) {
5568 Data->getChildren()[PreInitsOffset] = PreInits;
5571 void setTransformedStmt(Stmt *S) {
5572 Data->getChildren()[TransformedStmtOffset] = S;
5588 static OMPTileDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
5589 SourceLocation EndLoc,
5590 ArrayRef<OMPClause *> Clauses,
5591 unsigned NumLoops, Stmt *AssociatedStmt,
5592 Stmt *TransformedStmt, Stmt *PreInits);
5599 static OMPTileDirective *
CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
5614 return Data->getChildren()[TransformedStmtOffset];
5618 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5621 return T->getStmtClass() == OMPTileDirectiveClass;
5626class OMPStripeDirective final
5634 TransformedStmtOffset,
5640 OMPStripeDirectiveClass,
llvm::omp::OMPD_stripe, StartLoc, EndLoc,
5642 setNumGeneratedLoops(2 * NumLoops);
5645 void setPreInits(Stmt *PreInits) {
5646 Data->getChildren()[PreInitsOffset] = PreInits;
5649 void setTransformedStmt(Stmt *S) {
5650 Data->getChildren()[TransformedStmtOffset] = S;
5666 static OMPStripeDirective *
5667 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5668 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
5669 Stmt *TransformedStmt, Stmt *PreInits);
5676 static OMPStripeDirective *
5677 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned NumLoops);
5690 return Data->getChildren()[TransformedStmtOffset];
5694 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5697 return T->getStmtClass() == OMPStripeDirectiveClass;
5707class OMPUnrollDirective final
5715 TransformedStmtOffset,
5720 llvm::omp::OMPD_unroll,
5721 StartLoc, EndLoc, 1) {}
5724 void setPreInits(Stmt *PreInits) {
5725 Data->getChildren()[PreInitsOffset] = PreInits;
5729 void setTransformedStmt(Stmt *S) {
5730 Data->getChildren()[TransformedStmtOffset] = S;
5744 static OMPUnrollDirective *
5745 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5746 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
5747 unsigned NumGeneratedLoops, Stmt *TransformedStmt, Stmt *PreInits);
5753 static OMPUnrollDirective *
CreateEmpty(
const ASTContext &C,
5754 unsigned NumClauses);
5764 return Data->getChildren()[TransformedStmtOffset];
5768 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5771 return T->getStmtClass() == OMPUnrollDirectiveClass;
5782class OMPReverseDirective final
5790 TransformedStmtOffset,
5796 OMPReverseDirectiveClass,
llvm::omp::OMPD_reverse, StartLoc, EndLoc,
5798 setNumGeneratedLoops(NumLoops);
5801 void setPreInits(Stmt *PreInits) {
5802 Data->getChildren()[PreInitsOffset] = PreInits;
5805 void setTransformedStmt(Stmt *S) {
5806 Data->getChildren()[TransformedStmtOffset] = S;
5820 static OMPReverseDirective *
Create(
const ASTContext &C,
5821 SourceLocation StartLoc,
5822 SourceLocation EndLoc,
5823 Stmt *AssociatedStmt,
unsigned NumLoops,
5824 Stmt *TransformedStmt, Stmt *PreInits);
5830 static OMPReverseDirective *
CreateEmpty(
const ASTContext &C,
5836 return Data->getChildren()[TransformedStmtOffset];
5840 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5843 return T->getStmtClass() == OMPReverseDirectiveClass;
5855class OMPInterchangeDirective final
5863 TransformedStmtOffset,
5867 SourceLocation EndLoc,
unsigned NumLoops)
5869 OMPInterchangeDirectiveClass,
llvm::omp::OMPD_interchange, StartLoc,
5871 setNumGeneratedLoops(NumLoops);
5874 void setPreInits(Stmt *PreInits) {
5875 Data->getChildren()[PreInitsOffset] = PreInits;
5878 void setTransformedStmt(Stmt *S) {
5879 Data->getChildren()[TransformedStmtOffset] = S;
5895 static OMPInterchangeDirective *
5896 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5897 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
5898 Stmt *TransformedStmt, Stmt *PreInits);
5905 static OMPInterchangeDirective *
5906 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned NumLoops);
5911 return Data->getChildren()[TransformedStmtOffset];
5915 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5918 return T->getStmtClass() == OMPInterchangeDirectiveClass;
5937 OMPScanDirective(SourceLocation StartLoc, SourceLocation EndLoc)
5939 StartLoc, EndLoc) {}
5945 SourceLocation(), SourceLocation()) {}
5956 static OMPScanDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
5957 SourceLocation EndLoc,
5958 ArrayRef<OMPClause *> Clauses);
5966 static OMPScanDirective *
CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
5970 return T->getStmtClass() == OMPScanDirectiveClass;
5991 OMPInteropDirective(SourceLocation StartLoc, SourceLocation EndLoc)
5993 llvm::omp::OMPD_interop, StartLoc, EndLoc) {}
5999 llvm::omp::OMPD_interop, SourceLocation(),
6000 SourceLocation()) {}
6010 static OMPInteropDirective *
Create(
const ASTContext &C,
6011 SourceLocation StartLoc,
6012 SourceLocation EndLoc,
6013 ArrayRef<OMPClause *> Clauses);
6019 static OMPInteropDirective *
CreateEmpty(
const ASTContext &C,
6020 unsigned NumClauses, EmptyShell);
6023 return T->getStmtClass() == OMPInteropDirectiveClass;
6040 SourceLocation TargetCallLoc;
6043 void setTargetCallLoc(SourceLocation Loc) { TargetCallLoc = Loc; }
6052 llvm::omp::OMPD_dispatch, StartLoc, EndLoc) {}
6056 explicit OMPDispatchDirective()
6057 : OMPExecutableDirective(OMPDispatchDirectiveClass,
6058 llvm::omp::OMPD_dispatch, SourceLocation(),
6059 SourceLocation()) {}
6071 static OMPDispatchDirective *
6072 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6073 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
6074 SourceLocation TargetCallLoc);
6082 static OMPDispatchDirective *
CreateEmpty(
const ASTContext &C,
6083 unsigned NumClauses, EmptyShell);
6089 return T->getStmtClass() == OMPDispatchDirectiveClass;
6109 OMPMaskedDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6111 StartLoc, EndLoc) {}
6117 SourceLocation(), SourceLocation()) {}
6127 static OMPMaskedDirective *
6128 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6129 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
6135 static OMPMaskedDirective *
CreateEmpty(
const ASTContext &C,
6136 unsigned NumClauses, EmptyShell);
6139 return T->getStmtClass() == OMPMaskedDirectiveClass;
6156 OMPMetaDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6158 llvm::omp::OMPD_metadirective, StartLoc,
6162 llvm::omp::OMPD_metadirective, SourceLocation(),
6163 SourceLocation()) {}
6165 void setIfStmt(Stmt *S) { IfStmt = S; }
6168 static OMPMetaDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
6169 SourceLocation EndLoc,
6170 ArrayRef<OMPClause *> Clauses,
6171 Stmt *AssociatedStmt, Stmt *IfStmt);
6172 static OMPMetaDirective *
CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
6177 return T->getStmtClass() == OMPMetaDirectiveClass;
6199 OMPGenericLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
6200 unsigned CollapsedNum)
6202 StartLoc, EndLoc, CollapsedNum) {}
6210 SourceLocation(), SourceLocation(), CollapsedNum) {}
6223 static OMPGenericLoopDirective *
6224 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6225 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6226 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6234 static OMPGenericLoopDirective *
CreateEmpty(
const ASTContext &C,
6235 unsigned NumClauses,
6236 unsigned CollapsedNum,
6240 return T->getStmtClass() == OMPGenericLoopDirectiveClass;
6261 OMPTeamsGenericLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
6262 unsigned CollapsedNum)
6264 llvm::omp::OMPD_teams_loop, StartLoc, EndLoc,
6273 llvm::omp::OMPD_teams_loop, SourceLocation(),
6274 SourceLocation(), CollapsedNum) {}
6287 static OMPTeamsGenericLoopDirective *
6288 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6289 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6290 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6299 static OMPTeamsGenericLoopDirective *
CreateEmpty(
const ASTContext &C,
6300 unsigned NumClauses,
6301 unsigned CollapsedNum,
6305 return T->getStmtClass() == OMPTeamsGenericLoopDirectiveClass;
6321 bool CanBeParallelFor =
false;
6328 OMPTargetTeamsGenericLoopDirective(SourceLocation StartLoc,
6329 SourceLocation EndLoc,
6330 unsigned CollapsedNum)
6332 llvm::omp::OMPD_target_teams_loop, StartLoc, EndLoc,
6341 llvm::omp::OMPD_target_teams_loop, SourceLocation(),
6342 SourceLocation(), CollapsedNum) {}
6345 void setCanBeParallelFor(
bool ParFor) { CanBeParallelFor = ParFor; }
6358 static OMPTargetTeamsGenericLoopDirective *
6359 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6360 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6361 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool CanBeParallelFor);
6370 static OMPTargetTeamsGenericLoopDirective *
CreateEmpty(
const ASTContext &C,
6371 unsigned NumClauses,
6372 unsigned CollapsedNum,
6380 return T->getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass;
6401 OMPParallelGenericLoopDirective(SourceLocation StartLoc,
6402 SourceLocation EndLoc,
unsigned CollapsedNum)
6404 llvm::omp::OMPD_parallel_loop, StartLoc, EndLoc,
6413 llvm::omp::OMPD_parallel_loop, SourceLocation(),
6414 SourceLocation(), CollapsedNum) {}
6427 static OMPParallelGenericLoopDirective *
6428 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6429 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6430 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6439 static OMPParallelGenericLoopDirective *
CreateEmpty(
const ASTContext &C,
6440 unsigned NumClauses,
6441 unsigned CollapsedNum,
6445 return T->getStmtClass() == OMPParallelGenericLoopDirectiveClass;
6466 OMPTargetParallelGenericLoopDirective(SourceLocation StartLoc,
6467 SourceLocation EndLoc,
6468 unsigned CollapsedNum)
6470 llvm::omp::OMPD_target_parallel_loop, StartLoc, EndLoc,
6479 llvm::omp::OMPD_target_parallel_loop, SourceLocation(),
6480 SourceLocation(), CollapsedNum) {}
6493 static OMPTargetParallelGenericLoopDirective *
6494 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6495 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6496 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6505 static OMPTargetParallelGenericLoopDirective *
6506 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
6510 return T->getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass;
6527 OMPErrorDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6529 StartLoc, EndLoc) {}
6534 SourceLocation(), SourceLocation()) {}
6543 static OMPErrorDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
6544 SourceLocation EndLoc,
6545 ArrayRef<OMPClause *> Clauses);
6551 static OMPErrorDirective *
CreateEmpty(
const ASTContext &C,
6552 unsigned NumClauses, EmptyShell);
6555 return T->getStmtClass() == OMPErrorDirectiveClass;
6566 OMPAssumeDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6568 StartLoc, EndLoc) {}
6572 SourceLocation(), SourceLocation()) {}
6575 static OMPAssumeDirective *
Create(
const ASTContext &Ctx,
6576 SourceLocation StartLoc,
6577 SourceLocation EndLoc,
6578 ArrayRef<OMPClause *> Clauses, Stmt *AStmt);
6580 static OMPAssumeDirective *
CreateEmpty(
const ASTContext &C,
6581 unsigned NumClauses, EmptyShell);
6584 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.