14#ifndef LLVM_CLANG_AST_STMTOPENMP_H
15#define LLVM_CLANG_AST_STMTOPENMP_H
24#include "llvm/Support/Casting.h"
28class OMPInvariantPredicateBoundAttr;
145class OMPCanonicalLoop :
public Stmt {
146 friend class ASTStmtReader;
147 friend class ASTStmtWriter;
155 LastSubStmt = LOOPVAR_REF
160 Stmt *SubStmts[LastSubStmt + 1] = {};
162 OMPCanonicalLoop() : Stmt(StmtClass::OMPCanonicalLoopClass) {}
166 static OMPCanonicalLoop *
create(
const ASTContext &Ctx, Stmt *LoopStmt,
167 CapturedStmt *DistanceFunc,
168 CapturedStmt *LoopVarFunc,
169 DeclRefExpr *LoopVarRef) {
170 OMPCanonicalLoop *S =
new (Ctx) OMPCanonicalLoop();
171 S->setLoopStmt(LoopStmt);
172 S->setDistanceFunc(DistanceFunc);
173 S->setLoopVarFunc(LoopVarFunc);
174 S->setLoopVarRef(LoopVarRef);
179 static OMPCanonicalLoop *createEmpty(
const ASTContext &Ctx) {
180 return new (Ctx) OMPCanonicalLoop();
183 static bool classof(
const Stmt *S) {
184 return S->getStmtClass() == StmtClass::OMPCanonicalLoopClass;
187 SourceLocation getBeginLoc()
const {
return getLoopStmt()->getBeginLoc(); }
188 SourceLocation getEndLoc()
const {
return getLoopStmt()->getEndLoc(); }
193 return child_range(&SubStmts[0], &SubStmts[0] + LastSubStmt + 1);
195 const_child_range
children()
const {
196 return const_child_range(&SubStmts[0], &SubStmts[0] + LastSubStmt + 1);
202 Stmt *getLoopStmt() {
return SubStmts[LOOP_STMT]; }
203 const Stmt *getLoopStmt()
const {
return SubStmts[LOOP_STMT]; }
204 void setLoopStmt(Stmt *S) {
205 assert((isa<ForStmt>(S) || isa<CXXForRangeStmt>(S)) &&
206 "Canonical loop must be a for loop (range-based or otherwise)");
207 SubStmts[LOOP_STMT] = S;
218 CapturedStmt *getDistanceFunc() {
219 return cast<CapturedStmt>(SubStmts[DISTANCE_FUNC]);
221 const CapturedStmt *getDistanceFunc()
const {
222 return cast<CapturedStmt>(SubStmts[DISTANCE_FUNC]);
224 void setDistanceFunc(CapturedStmt *S) {
225 assert(S &&
"Expected non-null captured statement");
226 SubStmts[DISTANCE_FUNC] = S;
239 CapturedStmt *getLoopVarFunc() {
240 return cast<CapturedStmt>(SubStmts[LOOPVAR_FUNC]);
242 const CapturedStmt *getLoopVarFunc()
const {
243 return cast<CapturedStmt>(SubStmts[LOOPVAR_FUNC]);
245 void setLoopVarFunc(CapturedStmt *S) {
246 assert(S &&
"Expected non-null captured statement");
247 SubStmts[LOOPVAR_FUNC] = S;
253 DeclRefExpr *getLoopVarRef() {
254 return cast<DeclRefExpr>(SubStmts[LOOPVAR_REF]);
256 const DeclRefExpr *getLoopVarRef()
const {
257 return cast<DeclRefExpr>(SubStmts[LOOPVAR_REF]);
259 void setLoopVarRef(DeclRefExpr *E) {
260 assert(E &&
"Expected non-null loop variable");
261 SubStmts[LOOPVAR_REF] = E;
269class OMPExecutableDirective :
public Stmt {
270 friend class ASTStmtReader;
271 friend class ASTStmtWriter;
276 SourceLocation StartLoc;
278 SourceLocation EndLoc;
281 MutableArrayRef<OMPClause *> getClauses() {
284 return Data->getClauses();
289 OMPChildren *
Data =
nullptr;
298 OMPExecutableDirective(StmtClass SC, OpenMPDirectiveKind K,
299 SourceLocation StartLoc, SourceLocation EndLoc)
300 : Stmt(SC),
Kind(K), StartLoc(std::move(StartLoc)),
301 EndLoc(std::move(EndLoc)) {}
303 template <
typename T,
typename... Params>
304 static T *createDirective(
const ASTContext &C, ArrayRef<OMPClause *> Clauses,
305 Stmt *AssociatedStmt,
unsigned NumChildren,
308 C.Allocate(
sizeof(T) + OMPChildren::size(Clauses.size(), AssociatedStmt,
312 auto *
Data = OMPChildren::Create(
reinterpret_cast<T *
>(Mem) + 1, Clauses,
313 AssociatedStmt, NumChildren);
314 auto *Inst =
new (Mem)
T(std::forward<Params>(P)...);
319 template <
typename T,
typename... Params>
320 static T *createEmptyDirective(
const ASTContext &C,
unsigned NumClauses,
321 bool HasAssociatedStmt,
unsigned NumChildren,
324 C.Allocate(
sizeof(T) + OMPChildren::size(NumClauses, HasAssociatedStmt,
328 OMPChildren::CreateEmpty(
reinterpret_cast<T *
>(Mem) + 1, NumClauses,
329 HasAssociatedStmt, NumChildren);
330 auto *Inst =
new (Mem)
T(std::forward<Params>(P)...);
335 template <
typename T>
336 static T *createEmptyDirective(
const ASTContext &C,
unsigned NumClauses,
337 bool HasAssociatedStmt =
false,
338 unsigned NumChildren = 0) {
340 C.Allocate(
sizeof(T) + OMPChildren::size(NumClauses, HasAssociatedStmt,
344 OMPChildren::CreateEmpty(
reinterpret_cast<T *
>(Mem) + 1, NumClauses,
345 HasAssociatedStmt, NumChildren);
346 auto *Inst =
new (Mem) T;
353 class used_clauses_child_iterator
354 :
public llvm::iterator_adaptor_base<
355 used_clauses_child_iterator, ArrayRef<OMPClause *>::iterator,
356 std::forward_iterator_tag, Stmt *, ptrdiff_t, Stmt *, Stmt *> {
357 ArrayRef<OMPClause *>::iterator End;
358 OMPClause::child_iterator ChildI, ChildEnd;
361 if (ChildI != ChildEnd)
363 while (this->I != End) {
365 if (this->I != End) {
368 if (ChildI != ChildEnd)
375 explicit used_clauses_child_iterator(ArrayRef<OMPClause *> Clauses)
376 : used_clauses_child_iterator::iterator_adaptor_base(Clauses.begin()),
378 if (this->I != End) {
384 Stmt *
operator*()
const {
return *ChildI; }
385 Stmt *operator->()
const {
return **
this; }
387 used_clauses_child_iterator &operator++() {
389 if (ChildI != ChildEnd)
391 if (this->I != End) {
393 if (this->I != End) {
403 static llvm::iterator_range<used_clauses_child_iterator>
404 used_clauses_children(ArrayRef<OMPClause *> Clauses) {
405 return {used_clauses_child_iterator(Clauses),
406 used_clauses_child_iterator(ArrayRef(Clauses.end(), (
size_t)0))};
413 template <
typename SpecificClause>
414 class specific_clause_iterator
415 :
public llvm::iterator_adaptor_base<
416 specific_clause_iterator<SpecificClause>,
417 ArrayRef<OMPClause *>::const_iterator, std::forward_iterator_tag,
418 const SpecificClause *, ptrdiff_t, const SpecificClause *,
419 const SpecificClause *> {
420 ArrayRef<OMPClause *>::const_iterator End;
422 void SkipToNextClause() {
423 while (this->I != End && !isa<SpecificClause>(*this->I))
428 explicit specific_clause_iterator(ArrayRef<OMPClause *> Clauses)
429 : specific_clause_iterator::iterator_adaptor_base(Clauses.begin()),
434 const SpecificClause *
operator*()
const {
435 return cast<SpecificClause>(*this->I);
437 const SpecificClause *operator->()
const {
return **
this; }
439 specific_clause_iterator &operator++() {
446 template <
typename SpecificClause>
447 static llvm::iterator_range<specific_clause_iterator<SpecificClause>>
448 getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
449 return {specific_clause_iterator<SpecificClause>(Clauses),
450 specific_clause_iterator<SpecificClause>(
451 ArrayRef(Clauses.end(), (
size_t)0))};
454 template <
typename SpecificClause>
455 llvm::iterator_range<specific_clause_iterator<SpecificClause>>
456 getClausesOfKind()
const {
457 return getClausesOfKind<SpecificClause>(clauses());
465 template <
typename SpecificClause>
466 static const SpecificClause *getSingleClause(ArrayRef<OMPClause *> Clauses) {
467 auto ClausesOfKind = getClausesOfKind<SpecificClause>(Clauses);
469 if (ClausesOfKind.begin() != ClausesOfKind.end()) {
470 assert(std::next(ClausesOfKind.begin()) == ClausesOfKind.end() &&
471 "There are at least 2 clauses of the specified kind");
472 return *ClausesOfKind.begin();
477 template <
typename SpecificClause>
478 const SpecificClause *getSingleClause()
const {
479 return getSingleClause<SpecificClause>(clauses());
484 template <
typename SpecificClause>
485 bool hasClausesOfKind()
const {
486 auto Clauses = getClausesOfKind<SpecificClause>();
487 return Clauses.begin() != Clauses.end();
491 SourceLocation getBeginLoc()
const {
return StartLoc; }
493 SourceLocation getEndLoc()
const {
return EndLoc; }
499 void setLocStart(SourceLocation Loc) { StartLoc = Loc; }
504 void setLocEnd(SourceLocation Loc) { EndLoc = Loc; }
507 unsigned getNumClauses()
const {
510 return Data->getNumClauses();
517 OMPClause *getClause(
unsigned I)
const {
return clauses()[I]; }
520 bool hasAssociatedStmt()
const {
return Data &&
Data->hasAssociatedStmt(); }
523 const Stmt *getAssociatedStmt()
const {
524 return const_cast<OMPExecutableDirective *
>(
this)->getAssociatedStmt();
526 Stmt *getAssociatedStmt() {
527 assert(hasAssociatedStmt() &&
528 "Expected directive with the associated statement.");
529 return Data->getAssociatedStmt();
536 const CapturedStmt *getCapturedStmt(OpenMPDirectiveKind RegionKind)
const {
537 assert(hasAssociatedStmt() &&
538 "Expected directive with the associated statement.");
539 SmallVector<OpenMPDirectiveKind, 4> CaptureRegions;
541 return Data->getCapturedStmt(RegionKind, CaptureRegions);
545 CapturedStmt *getInnermostCapturedStmt() {
546 assert(hasAssociatedStmt() &&
547 "Expected directive with the associated statement.");
548 SmallVector<OpenMPDirectiveKind, 4> CaptureRegions;
550 return Data->getInnermostCapturedStmt(CaptureRegions);
553 const CapturedStmt *getInnermostCapturedStmt()
const {
554 return const_cast<OMPExecutableDirective *
>(
this)
555 ->getInnermostCapturedStmt();
560 static bool classof(
const Stmt *S) {
561 return S->getStmtClass() >= firstOMPExecutableDirectiveConstant &&
562 S->getStmtClass() <= lastOMPExecutableDirectiveConstant;
567 return child_range(child_iterator(), child_iterator());
568 return Data->getAssociatedStmtAsRange();
571 const_child_range
children()
const {
572 return const_cast<OMPExecutableDirective *
>(
this)->
children();
575 ArrayRef<OMPClause *> clauses()
const {
578 return Data->getClauses();
585 bool isStandaloneDirective()
const;
595 const Stmt *getRawStmt()
const {
596 return const_cast<OMPExecutableDirective *
>(
this)->getRawStmt();
599 assert(hasAssociatedStmt() &&
600 "Expected directive with the associated statement.");
601 return Data->getRawStmt();
614class OMPParallelDirective :
public OMPExecutableDirective {
615 friend class ASTStmtReader;
616 friend class OMPExecutableDirective;
618 bool HasCancel =
false;
625 OMPParallelDirective(SourceLocation StartLoc, SourceLocation EndLoc)
626 : OMPExecutableDirective(OMPParallelDirectiveClass,
627 llvm::omp::OMPD_parallel, StartLoc, EndLoc) {}
631 explicit OMPParallelDirective()
632 : OMPExecutableDirective(OMPParallelDirectiveClass,
633 llvm::omp::OMPD_parallel, SourceLocation(),
637 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
640 void setHasCancel(
bool Has) { HasCancel = Has; }
654 static OMPParallelDirective *
655 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
656 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
664 static OMPParallelDirective *CreateEmpty(
const ASTContext &C,
665 unsigned NumClauses, EmptyShell);
668 Expr *getTaskReductionRefExpr() {
669 return cast_or_null<Expr>(
Data->getChildren()[0]);
671 const Expr *getTaskReductionRefExpr()
const {
672 return const_cast<OMPParallelDirective *
>(
this)->getTaskReductionRefExpr();
676 bool hasCancel()
const {
return HasCancel; }
678 static bool classof(
const Stmt *T) {
679 return T->getStmtClass() == OMPParallelDirectiveClass;
685class OMPLoopTransformationDirective;
689class OMPLoopBasedDirective :
public OMPExecutableDirective {
690 friend class ASTStmtReader;
694 unsigned NumAssociatedLoops = 0;
704 OMPLoopBasedDirective(StmtClass SC, OpenMPDirectiveKind Kind,
705 SourceLocation StartLoc, SourceLocation EndLoc,
706 unsigned NumAssociatedLoops)
707 : OMPExecutableDirective(SC,
Kind, StartLoc, EndLoc),
708 NumAssociatedLoops(NumAssociatedLoops) {}
713 struct DistCombinedHelperExprs {
742 Expr *ParForInDistCond;
749 Expr *IterationVarRef;
755 Expr *CalcLastIteration;
795 SmallVector<Expr *, 4> Counters;
797 SmallVector<Expr *, 4> PrivateCounters;
799 SmallVector<Expr *, 4>
Inits;
801 SmallVector<Expr *, 4>
Updates;
803 SmallVector<Expr *, 4> Finals;
806 SmallVector<Expr *, 4> DependentCounters;
809 SmallVector<Expr *, 4> DependentInits;
812 SmallVector<Expr *, 4> FinalsConditions;
817 DistCombinedHelperExprs DistCombinedFields;
822 return IterationVarRef !=
nullptr && LastIteration !=
nullptr &&
823 NumIterations !=
nullptr && PreCond !=
nullptr &&
824 Cond !=
nullptr &&
Init !=
nullptr &&
Inc !=
nullptr;
831 void clear(
unsigned Size) {
832 IterationVarRef =
nullptr;
833 LastIteration =
nullptr;
834 CalcLastIteration =
nullptr;
846 NumIterations =
nullptr;
851 Counters.resize(Size);
852 PrivateCounters.resize(Size);
856 DependentCounters.resize(Size);
857 DependentInits.resize(Size);
858 FinalsConditions.resize(Size);
859 for (
unsigned I = 0; I <
Size; ++I) {
860 Counters[I] =
nullptr;
861 PrivateCounters[I] =
nullptr;
865 DependentCounters[I] =
nullptr;
866 DependentInits[I] =
nullptr;
867 FinalsConditions[I] =
nullptr;
870 DistCombinedFields.LB =
nullptr;
871 DistCombinedFields.UB =
nullptr;
872 DistCombinedFields.EUB =
nullptr;
873 DistCombinedFields.Init =
nullptr;
874 DistCombinedFields.Cond =
nullptr;
875 DistCombinedFields.NLB =
nullptr;
876 DistCombinedFields.NUB =
nullptr;
877 DistCombinedFields.DistCond =
nullptr;
878 DistCombinedFields.ParForInDistCond =
nullptr;
883 unsigned getLoopsNumber()
const {
return NumAssociatedLoops; }
889 static Stmt *tryToFindNextInnerLoop(Stmt *CurStmt,
890 bool TryImperfectlyNestedLoops);
891 static const Stmt *tryToFindNextInnerLoop(
const Stmt *CurStmt,
892 bool TryImperfectlyNestedLoops) {
893 return tryToFindNextInnerLoop(
const_cast<Stmt *
>(CurStmt),
894 TryImperfectlyNestedLoops);
899 static const OMPInvariantPredicateBoundAttr *getIntraTileHint(
const Stmt *S);
903 static Stmt *ignoreIntraTileHint(Stmt *S);
904 static const Stmt *ignoreIntraTileHint(
const Stmt *S) {
905 return ignoreIntraTileHint(
const_cast<Stmt *
>(S));
919 llvm::function_ref<
bool(
unsigned , Stmt * ,
933 return doForAllLoops(CurStmt, TryImperfectlyNestedLoops, NumLoops,
939 llvm::function_ref<
bool(
unsigned,
const Stmt *)>
Callback,
942 auto &&NewCallback = [
Callback](
unsigned Cnt,
Stmt *CurStmt) {
945 auto &&NewTransformCb =
950 NumLoops, NewCallback, NewTransformCb);
966 llvm::function_ref<
bool(
unsigned,
const Stmt *)>
Callback) {
967 auto &&NewCallback = [
Callback](
unsigned Cnt,
const Stmt *CurStmt) {
971 NumLoops, NewCallback);
977 Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
980 const Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
986 NumLoops, NewCallback);
990 if (
auto *D = dyn_cast<OMPExecutableDirective>(
T))
1009 unsigned NumGeneratedTopLevelLoops = 1;
1017 NumGeneratedTopLevelLoops = N;
1024 return NumGeneratedTopLevelLoops;
1035 Stmt *getTransformedStmt()
const;
1038 Stmt *getPreInits()
const;
1054 StmtClass SC, OpenMPDirectiveKind Kind, SourceLocation StartLoc,
1055 SourceLocation EndLoc,
unsigned NumAssociatedLoops)
1068 Stmt *getTransformedStmt()
const;
1071 Stmt *getPreInits()
const;
1074 Stmt::StmtClass C = T->getStmtClass();
1075 return C == OMPTileDirectiveClass || C == OMPUnrollDirectiveClass ||
1076 C == OMPReverseDirectiveClass || C == OMPInterchangeDirectiveClass ||
1077 C == OMPStripeDirectiveClass;
1104 IterationVariableOffset = 0,
1105 LastIterationOffset = 1,
1106 CalcLastIterationOffset = 2,
1107 PreConditionOffset = 3,
1118 IsLastIterVariableOffset = 8,
1119 LowerBoundVariableOffset = 9,
1120 UpperBoundVariableOffset = 10,
1121 StrideVariableOffset = 11,
1122 EnsureUpperBoundOffset = 12,
1123 NextLowerBoundOffset = 13,
1124 NextUpperBoundOffset = 14,
1125 NumIterationsOffset = 15,
1127 WorksharingEnd = 16,
1128 PrevLowerBoundVariableOffset = 16,
1129 PrevUpperBoundVariableOffset = 17,
1131 PrevEnsureUpperBoundOffset = 19,
1132 CombinedLowerBoundVariableOffset = 20,
1133 CombinedUpperBoundVariableOffset = 21,
1134 CombinedEnsureUpperBoundOffset = 22,
1135 CombinedInitOffset = 23,
1136 CombinedConditionOffset = 24,
1137 CombinedNextLowerBoundOffset = 25,
1138 CombinedNextUpperBoundOffset = 26,
1139 CombinedDistConditionOffset = 27,
1140 CombinedParForInDistConditionOffset = 28,
1144 CombinedDistributeEnd = 29,
1148 MutableArrayRef<Expr *> getCounters() {
1149 auto **Storage =
reinterpret_cast<Expr **
>(
1150 &Data->getChildren()[getArraysOffset(getDirectiveKind())]);
1151 return {Storage, getLoopsNumber()};
1155 MutableArrayRef<Expr *> getPrivateCounters() {
1156 auto **
Storage =
reinterpret_cast<Expr **
>(
1157 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1159 return {
Storage, getLoopsNumber()};
1163 MutableArrayRef<Expr *>
getInits() {
1164 auto **
Storage =
reinterpret_cast<Expr **
>(
1165 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1166 2 * getLoopsNumber()]);
1167 return {
Storage, getLoopsNumber()};
1172 auto **
Storage =
reinterpret_cast<Expr **
>(
1173 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1174 3 * getLoopsNumber()]);
1175 return {
Storage, getLoopsNumber()};
1180 auto **
Storage =
reinterpret_cast<Expr **
>(
1181 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1182 4 * getLoopsNumber()]);
1183 return {
Storage, getLoopsNumber()};
1187 MutableArrayRef<Expr *> getDependentCounters() {
1188 auto **
Storage =
reinterpret_cast<Expr **
>(
1189 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1190 5 * getLoopsNumber()]);
1191 return {
Storage, getLoopsNumber()};
1195 MutableArrayRef<Expr *> getDependentInits() {
1196 auto **
Storage =
reinterpret_cast<Expr **
>(
1197 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1198 6 * getLoopsNumber()]);
1199 return {
Storage, getLoopsNumber()};
1203 MutableArrayRef<Expr *> getFinalsConditions() {
1204 auto **
Storage =
reinterpret_cast<Expr **
>(
1205 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1206 7 * getLoopsNumber()]);
1207 return {
Storage, getLoopsNumber()};
1220 SourceLocation StartLoc, SourceLocation EndLoc,
1221 unsigned CollapsedNum)
1226 if (isOpenMPLoopBoundSharingDirective(Kind))
1227 return CombinedDistributeEnd;
1228 if (isOpenMPWorksharingDirective(Kind) || isOpenMPTaskLoopDirective(Kind) ||
1229 isOpenMPGenericLoopDirective(Kind) || isOpenMPDistributeDirective(Kind))
1230 return WorksharingEnd;
1236 OpenMPDirectiveKind Kind) {
1244 Data->getChildren()[IterationVariableOffset] = IV;
1247 Data->getChildren()[LastIterationOffset] = LI;
1250 Data->getChildren()[CalcLastIterationOffset] = CLI;
1252 void setPreCond(Expr *PC) { Data->getChildren()[PreConditionOffset] = PC; }
1253 void setCond(Expr *Cond) { Data->getChildren()[CondOffset] = Cond; }
1254 void setInit(Expr *Init) { Data->getChildren()[InitOffset] = Init; }
1255 void setInc(Expr *Inc) { Data->getChildren()[IncOffset] = Inc; }
1257 Data->getChildren()[PreInitsOffset] = PreInits;
1260 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1261 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1262 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1263 isOpenMPDistributeDirective(getDirectiveKind())) &&
1264 "expected worksharing loop directive");
1265 Data->getChildren()[IsLastIterVariableOffset] = IL;
1268 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1269 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1270 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1271 isOpenMPDistributeDirective(getDirectiveKind())) &&
1272 "expected worksharing loop directive");
1273 Data->getChildren()[LowerBoundVariableOffset] = LB;
1276 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1277 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1278 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1279 isOpenMPDistributeDirective(getDirectiveKind())) &&
1280 "expected worksharing loop directive");
1281 Data->getChildren()[UpperBoundVariableOffset] = UB;
1284 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1285 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1286 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1287 isOpenMPDistributeDirective(getDirectiveKind())) &&
1288 "expected worksharing loop directive");
1289 Data->getChildren()[StrideVariableOffset] = ST;
1292 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1293 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1294 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1295 isOpenMPDistributeDirective(getDirectiveKind())) &&
1296 "expected worksharing loop directive");
1297 Data->getChildren()[EnsureUpperBoundOffset] = EUB;
1300 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1301 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1302 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1303 isOpenMPDistributeDirective(getDirectiveKind())) &&
1304 "expected worksharing loop directive");
1305 Data->getChildren()[NextLowerBoundOffset] = NLB;
1308 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1309 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1310 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1311 isOpenMPDistributeDirective(getDirectiveKind())) &&
1312 "expected worksharing loop directive");
1313 Data->getChildren()[NextUpperBoundOffset] = NUB;
1316 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1317 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1318 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1319 isOpenMPDistributeDirective(getDirectiveKind())) &&
1320 "expected worksharing loop directive");
1321 Data->getChildren()[NumIterationsOffset] = NI;
1324 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1325 "expected loop bound sharing directive");
1326 Data->getChildren()[PrevLowerBoundVariableOffset] = PrevLB;
1329 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1330 "expected loop bound sharing directive");
1331 Data->getChildren()[PrevUpperBoundVariableOffset] = PrevUB;
1334 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1335 "expected loop bound sharing directive");
1336 Data->getChildren()[DistIncOffset] = DistInc;
1339 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1340 "expected loop bound sharing directive");
1341 Data->getChildren()[PrevEnsureUpperBoundOffset] = PrevEUB;
1344 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1345 "expected loop bound sharing directive");
1346 Data->getChildren()[CombinedLowerBoundVariableOffset] = CombLB;
1349 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1350 "expected loop bound sharing directive");
1351 Data->getChildren()[CombinedUpperBoundVariableOffset] = CombUB;
1354 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1355 "expected loop bound sharing directive");
1356 Data->getChildren()[CombinedEnsureUpperBoundOffset] = CombEUB;
1359 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1360 "expected loop bound sharing directive");
1361 Data->getChildren()[CombinedInitOffset] = CombInit;
1364 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1365 "expected loop bound sharing directive");
1366 Data->getChildren()[CombinedConditionOffset] = CombCond;
1369 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1370 "expected loop bound sharing directive");
1371 Data->getChildren()[CombinedNextLowerBoundOffset] = CombNLB;
1374 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1375 "expected loop bound sharing directive");
1376 Data->getChildren()[CombinedNextUpperBoundOffset] = CombNUB;
1379 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1380 "expected loop bound distribute sharing directive");
1381 Data->getChildren()[CombinedDistConditionOffset] = CombDistCond;
1384 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1385 "expected loop bound distribute sharing directive");
1386 Data->getChildren()[CombinedParForInDistConditionOffset] =
1387 CombParForInDistCond;
1400 return cast<Expr>(Data->getChildren()[IterationVariableOffset]);
1403 return cast<Expr>(Data->getChildren()[LastIterationOffset]);
1406 return cast<Expr>(Data->getChildren()[CalcLastIterationOffset]);
1409 return cast<Expr>(Data->getChildren()[PreConditionOffset]);
1411 Expr *
getCond()
const {
return cast<Expr>(Data->getChildren()[CondOffset]); }
1412 Expr *
getInit()
const {
return cast<Expr>(Data->getChildren()[InitOffset]); }
1413 Expr *
getInc()
const {
return cast<Expr>(Data->getChildren()[IncOffset]); }
1415 return Data->getChildren()[PreInitsOffset];
1419 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1420 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1421 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1422 isOpenMPDistributeDirective(getDirectiveKind())) &&
1423 "expected worksharing loop directive");
1424 return cast<Expr>(Data->getChildren()[IsLastIterVariableOffset]);
1427 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1428 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1429 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1430 isOpenMPDistributeDirective(getDirectiveKind())) &&
1431 "expected worksharing loop directive");
1432 return cast<Expr>(Data->getChildren()[LowerBoundVariableOffset]);
1435 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1436 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1437 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1438 isOpenMPDistributeDirective(getDirectiveKind())) &&
1439 "expected worksharing loop directive");
1440 return cast<Expr>(Data->getChildren()[UpperBoundVariableOffset]);
1443 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1444 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1445 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1446 isOpenMPDistributeDirective(getDirectiveKind())) &&
1447 "expected worksharing loop directive");
1448 return cast<Expr>(Data->getChildren()[StrideVariableOffset]);
1451 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1452 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1453 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1454 isOpenMPDistributeDirective(getDirectiveKind())) &&
1455 "expected worksharing loop directive");
1456 return cast<Expr>(Data->getChildren()[EnsureUpperBoundOffset]);
1459 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1460 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1461 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1462 isOpenMPDistributeDirective(getDirectiveKind())) &&
1463 "expected worksharing loop directive");
1464 return cast<Expr>(Data->getChildren()[NextLowerBoundOffset]);
1467 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1468 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1469 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1470 isOpenMPDistributeDirective(getDirectiveKind())) &&
1471 "expected worksharing loop directive");
1472 return cast<Expr>(Data->getChildren()[NextUpperBoundOffset]);
1475 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1476 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1477 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1478 isOpenMPDistributeDirective(getDirectiveKind())) &&
1479 "expected worksharing loop directive");
1480 return cast<Expr>(Data->getChildren()[NumIterationsOffset]);
1483 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1484 "expected loop bound sharing directive");
1485 return cast<Expr>(Data->getChildren()[PrevLowerBoundVariableOffset]);
1488 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1489 "expected loop bound sharing directive");
1490 return cast<Expr>(Data->getChildren()[PrevUpperBoundVariableOffset]);
1493 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1494 "expected loop bound sharing directive");
1495 return cast<Expr>(Data->getChildren()[DistIncOffset]);
1498 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1499 "expected loop bound sharing directive");
1500 return cast<Expr>(Data->getChildren()[PrevEnsureUpperBoundOffset]);
1503 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1504 "expected loop bound sharing directive");
1505 return cast<Expr>(Data->getChildren()[CombinedLowerBoundVariableOffset]);
1508 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1509 "expected loop bound sharing directive");
1510 return cast<Expr>(Data->getChildren()[CombinedUpperBoundVariableOffset]);
1513 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1514 "expected loop bound sharing directive");
1515 return cast<Expr>(Data->getChildren()[CombinedEnsureUpperBoundOffset]);
1518 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1519 "expected loop bound sharing directive");
1520 return cast<Expr>(Data->getChildren()[CombinedInitOffset]);
1523 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1524 "expected loop bound sharing directive");
1525 return cast<Expr>(Data->getChildren()[CombinedConditionOffset]);
1528 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1529 "expected loop bound sharing directive");
1530 return cast<Expr>(Data->getChildren()[CombinedNextLowerBoundOffset]);
1533 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1534 "expected loop bound sharing directive");
1535 return cast<Expr>(Data->getChildren()[CombinedNextUpperBoundOffset]);
1538 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1539 "expected loop bound distribute sharing directive");
1540 return cast<Expr>(Data->getChildren()[CombinedDistConditionOffset]);
1543 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1544 "expected loop bound distribute sharing directive");
1545 return cast<Expr>(Data->getChildren()[CombinedParForInDistConditionOffset]);
1601 return T->getStmtClass() == OMPSimdDirectiveClass ||
1602 T->getStmtClass() == OMPForDirectiveClass ||
1603 T->getStmtClass() == OMPForSimdDirectiveClass ||
1604 T->getStmtClass() == OMPParallelForDirectiveClass ||
1605 T->getStmtClass() == OMPParallelForSimdDirectiveClass ||
1606 T->getStmtClass() == OMPTaskLoopDirectiveClass ||
1607 T->getStmtClass() == OMPTaskLoopSimdDirectiveClass ||
1608 T->getStmtClass() == OMPMaskedTaskLoopDirectiveClass ||
1609 T->getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass ||
1610 T->getStmtClass() == OMPMasterTaskLoopDirectiveClass ||
1611 T->getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass ||
1612 T->getStmtClass() == OMPGenericLoopDirectiveClass ||
1613 T->getStmtClass() == OMPTeamsGenericLoopDirectiveClass ||
1614 T->getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass ||
1615 T->getStmtClass() == OMPParallelGenericLoopDirectiveClass ||
1616 T->getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass ||
1617 T->getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass ||
1618 T->getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass ||
1619 T->getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass ||
1620 T->getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass ||
1621 T->getStmtClass() == OMPDistributeDirectiveClass ||
1622 T->getStmtClass() == OMPTargetParallelForDirectiveClass ||
1623 T->getStmtClass() == OMPDistributeParallelForDirectiveClass ||
1624 T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass ||
1625 T->getStmtClass() == OMPDistributeSimdDirectiveClass ||
1626 T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass ||
1627 T->getStmtClass() == OMPTargetSimdDirectiveClass ||
1628 T->getStmtClass() == OMPTeamsDistributeDirectiveClass ||
1629 T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass ||
1630 T->getStmtClass() ==
1631 OMPTeamsDistributeParallelForSimdDirectiveClass ||
1632 T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass ||
1633 T->getStmtClass() ==
1634 OMPTargetTeamsDistributeParallelForDirectiveClass ||
1635 T->getStmtClass() ==
1636 OMPTargetTeamsDistributeParallelForSimdDirectiveClass ||
1637 T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass ||
1638 T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
1660 OMPSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1661 unsigned CollapsedNum)
1663 EndLoc, CollapsedNum) {}
1671 SourceLocation(), SourceLocation(), CollapsedNum) {}
1684 static OMPSimdDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
1685 SourceLocation EndLoc,
unsigned CollapsedNum,
1686 ArrayRef<OMPClause *> Clauses,
1687 Stmt *AssociatedStmt,
1688 const HelperExprs &Exprs);
1697 static OMPSimdDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
1698 unsigned CollapsedNum, EmptyShell);
1701 return T->getStmtClass() == OMPSimdDirectiveClass;
1718 bool HasCancel =
false;
1726 OMPForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1727 unsigned CollapsedNum)
1729 EndLoc, CollapsedNum) {}
1737 SourceLocation(), SourceLocation(), CollapsedNum) {}
1740 void setTaskReductionRefExpr(Expr *E) {
1741 Data->getChildren()[numLoopChildren(getLoopsNumber(),
1742 llvm::omp::OMPD_for)] = E;
1746 void setHasCancel(
bool Has) { HasCancel = Has; }
1762 static OMPForDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
1763 SourceLocation EndLoc,
unsigned CollapsedNum,
1764 ArrayRef<OMPClause *> Clauses,
1765 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
1766 Expr *TaskRedRef,
bool HasCancel);
1775 static OMPForDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
1776 unsigned CollapsedNum, EmptyShell);
1781 getLoopsNumber(), llvm::omp::OMPD_for)]);
1791 return T->getStmtClass() == OMPForDirectiveClass;
1813 OMPForSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1814 unsigned CollapsedNum)
1816 StartLoc, EndLoc, CollapsedNum) {}
1824 SourceLocation(), SourceLocation(), CollapsedNum) {}
1837 static OMPForSimdDirective *
1838 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1839 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
1840 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
1849 static OMPForSimdDirective *CreateEmpty(
const ASTContext &C,
1850 unsigned NumClauses,
1851 unsigned CollapsedNum, EmptyShell);
1854 return T->getStmtClass() == OMPForSimdDirectiveClass;
1872 bool HasCancel =
false;
1879 OMPSectionsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1881 llvm::omp::OMPD_sections, StartLoc, EndLoc) {}
1887 llvm::omp::OMPD_sections, SourceLocation(),
1888 SourceLocation()) {}
1891 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
1894 void setHasCancel(
bool Has) { HasCancel = Has; }
1908 static OMPSectionsDirective *
1909 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1910 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
1919 static OMPSectionsDirective *CreateEmpty(
const ASTContext &C,
1920 unsigned NumClauses, EmptyShell);
1924 return cast_or_null<Expr>(Data->getChildren()[0]);
1934 return T->getStmtClass() == OMPSectionsDirectiveClass;
1949 bool HasCancel =
false;
1956 OMPSectionDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1958 llvm::omp::OMPD_section, StartLoc, EndLoc) {}
1964 llvm::omp::OMPD_section, SourceLocation(),
1965 SourceLocation()) {}
1976 static OMPSectionDirective *
Create(
const ASTContext &C,
1977 SourceLocation StartLoc,
1978 SourceLocation EndLoc,
1979 Stmt *AssociatedStmt,
bool HasCancel);
1985 static OMPSectionDirective *CreateEmpty(
const ASTContext &C, EmptyShell);
1994 return T->getStmtClass() == OMPSectionDirectiveClass;
2014 OMPScopeDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2016 StartLoc, EndLoc) {}
2022 SourceLocation(), SourceLocation()) {}
2032 static OMPScopeDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
2033 SourceLocation EndLoc,
2034 ArrayRef<OMPClause *> Clauses,
2035 Stmt *AssociatedStmt);
2041 static OMPScopeDirective *CreateEmpty(
const ASTContext &C,
2042 unsigned NumClauses, EmptyShell);
2045 return T->getStmtClass() == OMPScopeDirectiveClass;
2065 OMPSingleDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2067 StartLoc, EndLoc) {}
2073 SourceLocation(), SourceLocation()) {}
2084 static OMPSingleDirective *
2085 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2086 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2094 static OMPSingleDirective *CreateEmpty(
const ASTContext &C,
2095 unsigned NumClauses, EmptyShell);
2098 return T->getStmtClass() == OMPSingleDirectiveClass;
2116 OMPMasterDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2118 StartLoc, EndLoc) {}
2124 SourceLocation(), SourceLocation()) {}
2134 static OMPMasterDirective *
Create(
const ASTContext &C,
2135 SourceLocation StartLoc,
2136 SourceLocation EndLoc,
2137 Stmt *AssociatedStmt);
2143 static OMPMasterDirective *CreateEmpty(
const ASTContext &C, EmptyShell);
2146 return T->getStmtClass() == OMPMasterDirectiveClass;
2160 DeclarationNameInfo DirName;
2167 OMPCriticalDirective(
const DeclarationNameInfo &Name, SourceLocation StartLoc,
2168 SourceLocation EndLoc)
2170 llvm::omp::OMPD_critical, StartLoc, EndLoc),
2177 llvm::omp::OMPD_critical, SourceLocation(),
2178 SourceLocation()) {}
2184 void setDirectiveName(
const DeclarationNameInfo &Name) { DirName = Name; }
2196 static OMPCriticalDirective *
2197 Create(
const ASTContext &C,
const DeclarationNameInfo &Name,
2198 SourceLocation StartLoc, SourceLocation EndLoc,
2199 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2206 static OMPCriticalDirective *CreateEmpty(
const ASTContext &C,
2207 unsigned NumClauses, EmptyShell);
2214 return T->getStmtClass() == OMPCriticalDirectiveClass;
2232 bool HasCancel =
false;
2240 OMPParallelForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2241 unsigned CollapsedNum)
2243 llvm::omp::OMPD_parallel_for, StartLoc, EndLoc,
2252 llvm::omp::OMPD_parallel_for, SourceLocation(),
2253 SourceLocation(), CollapsedNum) {}
2256 void setTaskReductionRefExpr(Expr *E) {
2257 Data->getChildren()[numLoopChildren(getLoopsNumber(),
2258 llvm::omp::OMPD_parallel_for)] = E;
2262 void setHasCancel(
bool Has) { HasCancel = Has; }
2278 static OMPParallelForDirective *
2279 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2280 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2281 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
2291 static OMPParallelForDirective *CreateEmpty(
const ASTContext &C,
2292 unsigned NumClauses,
2293 unsigned CollapsedNum,
2299 getLoopsNumber(), llvm::omp::OMPD_parallel_for)]);
2302 return const_cast<OMPParallelForDirective *
>(
this)
2310 return T->getStmtClass() == OMPParallelForDirectiveClass;
2333 OMPParallelForSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2334 unsigned CollapsedNum)
2336 llvm::omp::OMPD_parallel_for_simd, StartLoc, EndLoc,
2345 llvm::omp::OMPD_parallel_for_simd, SourceLocation(),
2346 SourceLocation(), CollapsedNum) {}
2359 static OMPParallelForSimdDirective *
2360 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2361 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2362 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
2371 static OMPParallelForSimdDirective *CreateEmpty(
const ASTContext &C,
2372 unsigned NumClauses,
2373 unsigned CollapsedNum,
2377 return T->getStmtClass() == OMPParallelForSimdDirectiveClass;
2393 OMPParallelMasterDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2395 llvm::omp::OMPD_parallel_master, StartLoc,
2400 llvm::omp::OMPD_parallel_master,
2401 SourceLocation(), SourceLocation()) {}
2404 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2417 static OMPParallelMasterDirective *
2418 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2419 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);
2427 static OMPParallelMasterDirective *
2428 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2432 return cast_or_null<Expr>(Data->getChildren()[0]);
2435 return const_cast<OMPParallelMasterDirective *
>(
this)
2440 return T->getStmtClass() == OMPParallelMasterDirectiveClass;
2456 OMPParallelMaskedDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2458 llvm::omp::OMPD_parallel_masked, StartLoc,
2463 llvm::omp::OMPD_parallel_masked,
2464 SourceLocation(), SourceLocation()) {}
2467 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2480 static OMPParallelMaskedDirective *
2481 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2482 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);
2490 static OMPParallelMaskedDirective *
2491 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2495 return cast_or_null<Expr>(Data->getChildren()[0]);
2498 return const_cast<OMPParallelMaskedDirective *
>(
this)
2503 return T->getStmtClass() == OMPParallelMaskedDirectiveClass;
2521 bool HasCancel =
false;
2528 OMPParallelSectionsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2530 llvm::omp::OMPD_parallel_sections, StartLoc,
2537 llvm::omp::OMPD_parallel_sections,
2538 SourceLocation(), SourceLocation()) {}
2541 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2544 void setHasCancel(
bool Has) { HasCancel = Has; }
2558 static OMPParallelSectionsDirective *
2559 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2560 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
2569 static OMPParallelSectionsDirective *
2570 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2574 return cast_or_null<Expr>(Data->getChildren()[0]);
2577 return const_cast<OMPParallelSectionsDirective *
>(
this)
2585 return T->getStmtClass() == OMPParallelSectionsDirectiveClass;
2601 bool HasCancel =
false;
2608 OMPTaskDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2610 StartLoc, EndLoc) {}
2616 SourceLocation(), SourceLocation()) {}
2619 void setHasCancel(
bool Has) { HasCancel = Has; }
2631 static OMPTaskDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
2632 SourceLocation EndLoc,
2633 ArrayRef<OMPClause *> Clauses,
2634 Stmt *AssociatedStmt,
bool HasCancel);
2642 static OMPTaskDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
2649 return T->getStmtClass() == OMPTaskDirectiveClass;
2667 OMPTaskyieldDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2669 llvm::omp::OMPD_taskyield, StartLoc, EndLoc) {}
2675 llvm::omp::OMPD_taskyield, SourceLocation(),
2676 SourceLocation()) {}
2685 static OMPTaskyieldDirective *
2686 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc);
2692 static OMPTaskyieldDirective *CreateEmpty(
const ASTContext &C, EmptyShell);
2695 return T->getStmtClass() == OMPTaskyieldDirectiveClass;
2713 OMPBarrierDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2715 llvm::omp::OMPD_barrier, StartLoc, EndLoc) {}
2721 llvm::omp::OMPD_barrier, SourceLocation(),
2722 SourceLocation()) {}
2731 static OMPBarrierDirective *
2732 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc);
2738 static OMPBarrierDirective *CreateEmpty(
const ASTContext &C, EmptyShell);
2741 return T->getStmtClass() == OMPBarrierDirectiveClass;
2759 OMPTaskwaitDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2761 llvm::omp::OMPD_taskwait, StartLoc, EndLoc) {}
2767 llvm::omp::OMPD_taskwait, SourceLocation(),
2768 SourceLocation()) {}
2778 static OMPTaskwaitDirective *
Create(
const ASTContext &C,
2779 SourceLocation StartLoc,
2780 SourceLocation EndLoc,
2781 ArrayRef<OMPClause *> Clauses);
2788 static OMPTaskwaitDirective *CreateEmpty(
const ASTContext &C,
2789 unsigned NumClauses, EmptyShell);
2792 return T->getStmtClass() == OMPTaskwaitDirectiveClass;
2810 OMPTaskgroupDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2812 llvm::omp::OMPD_taskgroup, StartLoc, EndLoc) {}
2818 llvm::omp::OMPD_taskgroup, SourceLocation(),
2819 SourceLocation()) {}
2822 void setReductionRef(Expr *RR) {
Data->getChildren()[0] = RR; }
2834 static OMPTaskgroupDirective *
2835 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2836 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2837 Expr *ReductionRef);
2844 static OMPTaskgroupDirective *CreateEmpty(
const ASTContext &C,
2845 unsigned NumClauses, EmptyShell);
2855 return T->getStmtClass() == OMPTaskgroupDirectiveClass;
2877 OMPFlushDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2879 StartLoc, EndLoc) {}
2885 SourceLocation(), SourceLocation()) {}
2896 static OMPFlushDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
2897 SourceLocation EndLoc,
2898 ArrayRef<OMPClause *> Clauses);
2906 static OMPFlushDirective *CreateEmpty(
const ASTContext &C,
2907 unsigned NumClauses, EmptyShell);
2910 return T->getStmtClass() == OMPFlushDirectiveClass;
2930 OMPDepobjDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2932 StartLoc, EndLoc) {}
2938 SourceLocation(), SourceLocation()) {}
2948 static OMPDepobjDirective *
Create(
const ASTContext &C,
2949 SourceLocation StartLoc,
2950 SourceLocation EndLoc,
2951 ArrayRef<OMPClause *> Clauses);
2959 static OMPDepobjDirective *CreateEmpty(
const ASTContext &C,
2960 unsigned NumClauses, EmptyShell);
2963 return T->getStmtClass() == OMPDepobjDirectiveClass;
2981 OMPOrderedStandaloneDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2983 llvm::omp::OMPD_ordered_standalone, StartLoc,
2990 llvm::omp::OMPD_ordered_standalone,
2991 SourceLocation(), SourceLocation()) {}
3001 static OMPOrderedStandaloneDirective *
Create(
const ASTContext &C,
3002 SourceLocation StartLoc,
3003 SourceLocation EndLoc,
3004 ArrayRef<OMPClause *> Clauses);
3011 static OMPOrderedStandaloneDirective *
3012 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
3015 return T->getStmtClass() == OMPOrderedStandaloneDirectiveClass;
3034 OMPOrderedBlockAssocDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3036 llvm::omp::OMPD_ordered_blockassoc, StartLoc,
3043 llvm::omp::OMPD_ordered_blockassoc,
3044 SourceLocation(), SourceLocation()) {}
3055 static OMPOrderedBlockAssocDirective *
3056 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3057 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3064 static OMPOrderedBlockAssocDirective *
3065 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
3068 return T->getStmtClass() == OMPOrderedBlockAssocDirectiveClass;
3093 LLVM_PREFERRED_TYPE(
bool)
3103 LLVM_PREFERRED_TYPE(
bool)
3107 LLVM_PREFERRED_TYPE(
bool)
3118 StartLoc, EndLoc) {}
3122 explicit OMPAtomicDirective()
3123 : OMPExecutableDirective(OMPAtomicDirectiveClass, llvm::omp::OMPD_atomic,
3124 SourceLocation(), SourceLocation()) {}
3126 enum DataPositionTy :
size_t {
3137 void setX(Expr *
X) {
Data->getChildren()[DataPositionTy::POS_X] =
X; }
3141 void setUpdateExpr(Expr *UE) {
3142 Data->getChildren()[DataPositionTy::POS_UpdateExpr] = UE;
3145 void setV(Expr *
V) {
Data->getChildren()[DataPositionTy::POS_V] =
V; }
3147 void setR(Expr *R) {
Data->getChildren()[DataPositionTy::POS_R] =
R; }
3149 void setExpr(Expr *E) {
Data->getChildren()[DataPositionTy::POS_E] = E; }
3151 void setD(Expr *D) {
Data->getChildren()[DataPositionTy::POS_D] = D; }
3153 void setCond(Expr *C) {
Data->getChildren()[DataPositionTy::POS_Cond] =
C; }
3193 SourceLocation StartLoc,
3194 SourceLocation EndLoc,
3205 unsigned NumClauses, EmptyShell);
3209 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_X]);
3212 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_X]);
3218 return cast_or_null<Expr>(
3219 Data->getChildren()[DataPositionTy::POS_UpdateExpr]);
3222 return cast_or_null<Expr>(
3223 Data->getChildren()[DataPositionTy::POS_UpdateExpr]);
3237 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_V]);
3240 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_V]);
3244 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_R]);
3247 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_R]);
3251 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_E]);
3254 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_E]);
3258 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_D]);
3261 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_D]);
3265 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_Cond]);
3268 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_Cond]);
3272 return T->getStmtClass() == OMPAtomicDirectiveClass;
3292 OMPTargetDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3294 StartLoc, EndLoc) {}
3300 SourceLocation(), SourceLocation()) {}
3311 static OMPTargetDirective *
3312 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3313 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3321 static OMPTargetDirective *CreateEmpty(
const ASTContext &C,
3322 unsigned NumClauses, EmptyShell);
3325 return T->getStmtClass() == OMPTargetDirectiveClass;
3346 OMPTargetDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3348 llvm::omp::OMPD_target_data, StartLoc, EndLoc) {}
3354 llvm::omp::OMPD_target_data, SourceLocation(),
3355 SourceLocation()) {}
3366 static OMPTargetDataDirective *
3367 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3368 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3375 static OMPTargetDataDirective *CreateEmpty(
const ASTContext &C,
unsigned N,
3379 return T->getStmtClass() == OMPTargetDataDirectiveClass;
3400 OMPTargetEnterDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3402 llvm::omp::OMPD_target_enter_data, StartLoc,
3409 llvm::omp::OMPD_target_enter_data,
3410 SourceLocation(), SourceLocation()) {}
3421 static OMPTargetEnterDataDirective *
3422 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3423 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3430 static OMPTargetEnterDataDirective *CreateEmpty(
const ASTContext &C,
3431 unsigned N, EmptyShell);
3434 return T->getStmtClass() == OMPTargetEnterDataDirectiveClass;
3455 OMPTargetExitDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3457 llvm::omp::OMPD_target_exit_data, StartLoc,
3464 llvm::omp::OMPD_target_exit_data,
3465 SourceLocation(), SourceLocation()) {}
3476 static OMPTargetExitDataDirective *
3477 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3478 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3485 static OMPTargetExitDataDirective *CreateEmpty(
const ASTContext &C,
3486 unsigned N, EmptyShell);
3489 return T->getStmtClass() == OMPTargetExitDataDirectiveClass;
3505 bool HasCancel =
false;
3512 OMPTargetParallelDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3514 llvm::omp::OMPD_target_parallel, StartLoc,
3521 llvm::omp::OMPD_target_parallel,
3522 SourceLocation(), SourceLocation()) {}
3525 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
3527 void setHasCancel(
bool Has) { HasCancel = Has; }
3541 static OMPTargetParallelDirective *
3542 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3543 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
3552 static OMPTargetParallelDirective *
3553 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
3557 return cast_or_null<Expr>(Data->getChildren()[0]);
3560 return const_cast<OMPTargetParallelDirective *
>(
this)
3568 return T->getStmtClass() == OMPTargetParallelDirectiveClass;
3586 bool HasCancel =
false;
3594 OMPTargetParallelForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3595 unsigned CollapsedNum)
3597 llvm::omp::OMPD_target_parallel_for, StartLoc, EndLoc,
3606 llvm::omp::OMPD_target_parallel_for, SourceLocation(),
3607 SourceLocation(), CollapsedNum) {}
3610 void setTaskReductionRefExpr(Expr *E) {
3611 Data->getChildren()[numLoopChildren(
3612 getLoopsNumber(), llvm::omp::OMPD_target_parallel_for)] = E;
3616 void setHasCancel(
bool Has) { HasCancel = Has; }
3632 static OMPTargetParallelForDirective *
3633 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3634 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3635 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
3645 static OMPTargetParallelForDirective *CreateEmpty(
const ASTContext &C,
3646 unsigned NumClauses,
3647 unsigned CollapsedNum,
3653 getLoopsNumber(), llvm::omp::OMPD_target_parallel_for)]);
3656 return const_cast<OMPTargetParallelForDirective *
>(
this)
3664 return T->getStmtClass() == OMPTargetParallelForDirectiveClass;
3684 OMPTeamsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3686 StartLoc, EndLoc) {}
3692 SourceLocation(), SourceLocation()) {}
3703 static OMPTeamsDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
3704 SourceLocation EndLoc,
3705 ArrayRef<OMPClause *> Clauses,
3706 Stmt *AssociatedStmt);
3714 static OMPTeamsDirective *CreateEmpty(
const ASTContext &C,
3715 unsigned NumClauses, EmptyShell);
3718 return T->getStmtClass() == OMPTeamsDirectiveClass;
3732 OpenMPDirectiveKind CancelRegion = llvm::omp::OMPD_unknown;
3739 OMPCancellationPointDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3741 llvm::omp::OMPD_cancellation_point, StartLoc,
3747 llvm::omp::OMPD_cancellation_point,
3748 SourceLocation(), SourceLocation()) {}
3752 void setCancelRegion(OpenMPDirectiveKind CR) { CancelRegion = CR; }
3761 static OMPCancellationPointDirective *
3762 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3763 OpenMPDirectiveKind CancelRegion);
3769 static OMPCancellationPointDirective *CreateEmpty(
const ASTContext &C,
3776 return T->getStmtClass() == OMPCancellationPointDirectiveClass;
3790 OpenMPDirectiveKind CancelRegion = llvm::omp::OMPD_unknown;
3796 OMPCancelDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3798 StartLoc, EndLoc) {}
3804 SourceLocation(), SourceLocation()) {}
3808 void setCancelRegion(OpenMPDirectiveKind CR) { CancelRegion = CR; }
3818 static OMPCancelDirective *
3819 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3820 ArrayRef<OMPClause *> Clauses, OpenMPDirectiveKind CancelRegion);
3827 static OMPCancelDirective *CreateEmpty(
const ASTContext &C,
3828 unsigned NumClauses, EmptyShell);
3834 return T->getStmtClass() == OMPCancelDirectiveClass;
3851 bool HasCancel =
false;
3859 OMPTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3860 unsigned CollapsedNum)
3862 StartLoc, EndLoc, CollapsedNum) {}
3870 SourceLocation(), SourceLocation(), CollapsedNum) {}
3873 void setHasCancel(
bool Has) { HasCancel = Has; }
3887 static OMPTaskLoopDirective *
3888 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3889 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3890 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
3899 static OMPTaskLoopDirective *CreateEmpty(
const ASTContext &C,
3900 unsigned NumClauses,
3901 unsigned CollapsedNum, EmptyShell);
3907 return T->getStmtClass() == OMPTaskLoopDirectiveClass;
3929 OMPTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3930 unsigned CollapsedNum)
3932 llvm::omp::OMPD_taskloop_simd, StartLoc, EndLoc,
3941 llvm::omp::OMPD_taskloop_simd, SourceLocation(),
3942 SourceLocation(), CollapsedNum) {}
3955 static OMPTaskLoopSimdDirective *
3956 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3957 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3958 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
3967 static OMPTaskLoopSimdDirective *CreateEmpty(
const ASTContext &C,
3968 unsigned NumClauses,
3969 unsigned CollapsedNum,
3973 return T->getStmtClass() == OMPTaskLoopSimdDirectiveClass;
3990 bool HasCancel =
false;
3998 OMPMasterTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3999 unsigned CollapsedNum)
4001 llvm::omp::OMPD_master_taskloop, StartLoc, EndLoc,
4010 llvm::omp::OMPD_master_taskloop, SourceLocation(),
4011 SourceLocation(), CollapsedNum) {}
4014 void setHasCancel(
bool Has) { HasCancel = Has; }
4028 static OMPMasterTaskLoopDirective *
4029 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4030 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4031 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4040 static OMPMasterTaskLoopDirective *CreateEmpty(
const ASTContext &C,
4041 unsigned NumClauses,
4042 unsigned CollapsedNum,
4049 return T->getStmtClass() == OMPMasterTaskLoopDirectiveClass;
4066 bool HasCancel =
false;
4074 OMPMaskedTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4075 unsigned CollapsedNum)
4077 llvm::omp::OMPD_masked_taskloop, StartLoc, EndLoc,
4086 llvm::omp::OMPD_masked_taskloop, SourceLocation(),
4087 SourceLocation(), CollapsedNum) {}
4090 void setHasCancel(
bool Has) { HasCancel = Has; }
4104 static OMPMaskedTaskLoopDirective *
4105 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4106 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4107 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4116 static OMPMaskedTaskLoopDirective *CreateEmpty(
const ASTContext &C,
4117 unsigned NumClauses,
4118 unsigned CollapsedNum,
4125 return T->getStmtClass() == OMPMaskedTaskLoopDirectiveClass;
4147 OMPMasterTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4148 unsigned CollapsedNum)
4150 llvm::omp::OMPD_master_taskloop_simd, StartLoc, EndLoc,
4159 llvm::omp::OMPD_master_taskloop_simd, SourceLocation(),
4160 SourceLocation(), CollapsedNum) {}
4173 static OMPMasterTaskLoopSimdDirective *
4174 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4175 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4176 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4184 static OMPMasterTaskLoopSimdDirective *CreateEmpty(
const ASTContext &C,
4185 unsigned NumClauses,
4186 unsigned CollapsedNum,
4190 return T->getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass;
4212 OMPMaskedTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4213 unsigned CollapsedNum)
4215 llvm::omp::OMPD_masked_taskloop_simd, StartLoc, EndLoc,
4224 llvm::omp::OMPD_masked_taskloop_simd, SourceLocation(),
4225 SourceLocation(), CollapsedNum) {}
4238 static OMPMaskedTaskLoopSimdDirective *
4239 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4240 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4241 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4249 static OMPMaskedTaskLoopSimdDirective *CreateEmpty(
const ASTContext &C,
4250 unsigned NumClauses,
4251 unsigned CollapsedNum,
4255 return T->getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass;
4273 bool HasCancel =
false;
4281 OMPParallelMasterTaskLoopDirective(SourceLocation StartLoc,
4282 SourceLocation EndLoc,
4283 unsigned CollapsedNum)
4285 llvm::omp::OMPD_parallel_master_taskloop, StartLoc,
4286 EndLoc, CollapsedNum) {}
4294 llvm::omp::OMPD_parallel_master_taskloop,
4295 SourceLocation(), SourceLocation(), CollapsedNum) {}
4298 void setHasCancel(
bool Has) { HasCancel = Has; }
4312 static OMPParallelMasterTaskLoopDirective *
4313 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4314 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4315 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4324 static OMPParallelMasterTaskLoopDirective *CreateEmpty(
const ASTContext &C,
4325 unsigned NumClauses,
4326 unsigned CollapsedNum,
4333 return T->getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass;
4351 bool HasCancel =
false;
4359 OMPParallelMaskedTaskLoopDirective(SourceLocation StartLoc,
4360 SourceLocation EndLoc,
4361 unsigned CollapsedNum)
4363 llvm::omp::OMPD_parallel_masked_taskloop, StartLoc,
4364 EndLoc, CollapsedNum) {}
4372 llvm::omp::OMPD_parallel_masked_taskloop,
4373 SourceLocation(), SourceLocation(), CollapsedNum) {}
4376 void setHasCancel(
bool Has) { HasCancel = Has; }
4390 static OMPParallelMaskedTaskLoopDirective *
4391 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4392 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4393 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4402 static OMPParallelMaskedTaskLoopDirective *CreateEmpty(
const ASTContext &C,
4403 unsigned NumClauses,
4404 unsigned CollapsedNum,
4411 return T->getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass;
4434 OMPParallelMasterTaskLoopSimdDirective(SourceLocation StartLoc,
4435 SourceLocation EndLoc,
4436 unsigned CollapsedNum)
4438 llvm::omp::OMPD_parallel_master_taskloop_simd,
4439 StartLoc, EndLoc, CollapsedNum) {}
4447 llvm::omp::OMPD_parallel_master_taskloop_simd,
4448 SourceLocation(), SourceLocation(), CollapsedNum) {}
4461 static OMPParallelMasterTaskLoopSimdDirective *
4462 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4463 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4464 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4473 static OMPParallelMasterTaskLoopSimdDirective *
4474 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4478 return T->getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass;
4501 OMPParallelMaskedTaskLoopSimdDirective(SourceLocation StartLoc,
4502 SourceLocation EndLoc,
4503 unsigned CollapsedNum)
4505 llvm::omp::OMPD_parallel_masked_taskloop_simd,
4506 StartLoc, EndLoc, CollapsedNum) {}
4514 llvm::omp::OMPD_parallel_masked_taskloop_simd,
4515 SourceLocation(), SourceLocation(), CollapsedNum) {}
4528 static OMPParallelMaskedTaskLoopSimdDirective *
4529 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4530 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4531 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4540 static OMPParallelMaskedTaskLoopSimdDirective *
4541 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4545 return T->getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass;
4567 OMPDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4568 unsigned CollapsedNum)
4570 llvm::omp::OMPD_distribute, StartLoc, EndLoc,
4579 llvm::omp::OMPD_distribute, SourceLocation(),
4580 SourceLocation(), CollapsedNum) {}
4593 static OMPDistributeDirective *
4594 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4595 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4596 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4605 static OMPDistributeDirective *CreateEmpty(
const ASTContext &C,
4606 unsigned NumClauses,
4607 unsigned CollapsedNum, EmptyShell);
4610 return T->getStmtClass() == OMPDistributeDirectiveClass;
4631 OMPTargetUpdateDirective(SourceLocation StartLoc, SourceLocation EndLoc)
4633 llvm::omp::OMPD_target_update, StartLoc,
4640 llvm::omp::OMPD_target_update, SourceLocation(),
4641 SourceLocation()) {}
4652 static OMPTargetUpdateDirective *
4653 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4654 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
4662 static OMPTargetUpdateDirective *CreateEmpty(
const ASTContext &C,
4663 unsigned NumClauses, EmptyShell);
4666 return T->getStmtClass() == OMPTargetUpdateDirectiveClass;
4683 bool HasCancel =
false;
4691 OMPDistributeParallelForDirective(SourceLocation StartLoc,
4692 SourceLocation EndLoc,
4693 unsigned CollapsedNum)
4695 llvm::omp::OMPD_distribute_parallel_for, StartLoc,
4696 EndLoc, CollapsedNum) {}
4704 llvm::omp::OMPD_distribute_parallel_for,
4705 SourceLocation(), SourceLocation(), CollapsedNum) {}
4708 void setTaskReductionRefExpr(Expr *E) {
4709 Data->getChildren()[numLoopChildren(
4710 getLoopsNumber(), llvm::omp::OMPD_distribute_parallel_for)] = E;
4714 void setHasCancel(
bool Has) { HasCancel = Has; }
4730 static OMPDistributeParallelForDirective *
4731 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4732 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4733 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
4743 static OMPDistributeParallelForDirective *CreateEmpty(
const ASTContext &C,
4744 unsigned NumClauses,
4745 unsigned CollapsedNum,
4751 getLoopsNumber(), llvm::omp::OMPD_distribute_parallel_for)]);
4754 return const_cast<OMPDistributeParallelForDirective *
>(
this)
4762 return T->getStmtClass() == OMPDistributeParallelForDirectiveClass;
4785 OMPDistributeParallelForSimdDirective(SourceLocation StartLoc,
4786 SourceLocation EndLoc,
4787 unsigned CollapsedNum)
4789 llvm::omp::OMPD_distribute_parallel_for_simd, StartLoc,
4790 EndLoc, CollapsedNum) {}
4798 llvm::omp::OMPD_distribute_parallel_for_simd,
4799 SourceLocation(), SourceLocation(), CollapsedNum) {}
4812 static OMPDistributeParallelForSimdDirective *
Create(
4813 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4814 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4815 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4823 static OMPDistributeParallelForSimdDirective *CreateEmpty(
4824 const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4828 return T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass;
4850 OMPDistributeSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4851 unsigned CollapsedNum)
4853 llvm::omp::OMPD_distribute_simd, StartLoc, EndLoc,
4862 llvm::omp::OMPD_distribute_simd, SourceLocation(),
4863 SourceLocation(), CollapsedNum) {}
4876 static OMPDistributeSimdDirective *
4877 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4878 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4879 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4887 static OMPDistributeSimdDirective *CreateEmpty(
const ASTContext &C,
4888 unsigned NumClauses,
4889 unsigned CollapsedNum,
4893 return T->getStmtClass() == OMPDistributeSimdDirectiveClass;
4916 OMPTargetParallelForSimdDirective(SourceLocation StartLoc,
4917 SourceLocation EndLoc,
4918 unsigned CollapsedNum)
4920 llvm::omp::OMPD_target_parallel_for_simd, StartLoc,
4921 EndLoc, CollapsedNum) {}
4929 llvm::omp::OMPD_target_parallel_for_simd,
4930 SourceLocation(), SourceLocation(), CollapsedNum) {}
4943 static OMPTargetParallelForSimdDirective *
4944 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4945 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4946 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4954 static OMPTargetParallelForSimdDirective *CreateEmpty(
const ASTContext &C,
4955 unsigned NumClauses,
4956 unsigned CollapsedNum,
4960 return T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass;
4983 OMPTargetSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4984 unsigned CollapsedNum)
4986 llvm::omp::OMPD_target_simd, StartLoc, EndLoc,
4995 llvm::omp::OMPD_target_simd, SourceLocation(),
4996 SourceLocation(), CollapsedNum) {}
5009 static OMPTargetSimdDirective *
5010 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5011 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5012 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5020 static OMPTargetSimdDirective *CreateEmpty(
const ASTContext &C,
5021 unsigned NumClauses,
5022 unsigned CollapsedNum,
5026 return T->getStmtClass() == OMPTargetSimdDirectiveClass;
5048 OMPTeamsDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
5049 unsigned CollapsedNum)
5051 llvm::omp::OMPD_teams_distribute, StartLoc, EndLoc,
5060 llvm::omp::OMPD_teams_distribute, SourceLocation(),
5061 SourceLocation(), CollapsedNum) {}
5074 static OMPTeamsDistributeDirective *
5075 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5076 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5077 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5085 static OMPTeamsDistributeDirective *CreateEmpty(
const ASTContext &C,
5086 unsigned NumClauses,
5087 unsigned CollapsedNum,
5091 return T->getStmtClass() == OMPTeamsDistributeDirectiveClass;
5114 OMPTeamsDistributeSimdDirective(SourceLocation StartLoc,
5115 SourceLocation EndLoc,
unsigned CollapsedNum)
5117 llvm::omp::OMPD_teams_distribute_simd, StartLoc,
5118 EndLoc, CollapsedNum) {}
5126 llvm::omp::OMPD_teams_distribute_simd,
5127 SourceLocation(), SourceLocation(), CollapsedNum) {}
5140 static OMPTeamsDistributeSimdDirective *
5141 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5142 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5143 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5152 static OMPTeamsDistributeSimdDirective *CreateEmpty(
const ASTContext &C,
5153 unsigned NumClauses,
5154 unsigned CollapsedNum,
5158 return T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass;
5171class OMPTeamsDistributeParallelForSimdDirective final
5182 OMPTeamsDistributeParallelForSimdDirective(SourceLocation StartLoc,
5183 SourceLocation EndLoc,
5184 unsigned CollapsedNum)
5186 llvm::omp::OMPD_teams_distribute_parallel_for_simd,
5187 StartLoc, EndLoc, CollapsedNum) {}
5195 llvm::omp::OMPD_teams_distribute_parallel_for_simd,
5196 SourceLocation(), SourceLocation(), CollapsedNum) {}
5209 static OMPTeamsDistributeParallelForSimdDirective *
5210 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5211 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5212 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5220 static OMPTeamsDistributeParallelForSimdDirective *
5221 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5225 return T->getStmtClass() == OMPTeamsDistributeParallelForSimdDirectiveClass;
5242 bool HasCancel =
false;
5250 OMPTeamsDistributeParallelForDirective(SourceLocation StartLoc,
5251 SourceLocation EndLoc,
5252 unsigned CollapsedNum)
5254 llvm::omp::OMPD_teams_distribute_parallel_for,
5255 StartLoc, EndLoc, CollapsedNum) {}
5263 llvm::omp::OMPD_teams_distribute_parallel_for,
5264 SourceLocation(), SourceLocation(), CollapsedNum) {}
5267 void setTaskReductionRefExpr(Expr *E) {
5268 Data->getChildren()[numLoopChildren(
5269 getLoopsNumber(), llvm::omp::OMPD_teams_distribute_parallel_for)] = E;
5273 void setHasCancel(
bool Has) { HasCancel = Has; }
5289 static OMPTeamsDistributeParallelForDirective *
5290 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5291 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5292 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
5301 static OMPTeamsDistributeParallelForDirective *
5302 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5308 getLoopsNumber(), llvm::omp::OMPD_teams_distribute_parallel_for)]);
5311 return const_cast<OMPTeamsDistributeParallelForDirective *
>(
this)
5319 return T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass;
5339 OMPTargetTeamsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
5341 llvm::omp::OMPD_target_teams, StartLoc, EndLoc) {
5348 llvm::omp::OMPD_target_teams, SourceLocation(),
5349 SourceLocation()) {}
5360 static OMPTargetTeamsDirective *
Create(
const ASTContext &C,
5361 SourceLocation StartLoc,
5362 SourceLocation EndLoc,
5363 ArrayRef<OMPClause *> Clauses,
5364 Stmt *AssociatedStmt);
5371 static OMPTargetTeamsDirective *CreateEmpty(
const ASTContext &C,
5372 unsigned NumClauses, EmptyShell);
5375 return T->getStmtClass() == OMPTargetTeamsDirectiveClass;
5397 OMPTargetTeamsDistributeDirective(SourceLocation StartLoc,
5398 SourceLocation EndLoc,
5399 unsigned CollapsedNum)
5401 llvm::omp::OMPD_target_teams_distribute, StartLoc,
5402 EndLoc, CollapsedNum) {}
5410 llvm::omp::OMPD_target_teams_distribute,
5411 SourceLocation(), SourceLocation(), CollapsedNum) {}
5424 static OMPTargetTeamsDistributeDirective *
5425 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5426 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5427 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5435 static OMPTargetTeamsDistributeDirective *
5436 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5440 return T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass;
5453class OMPTargetTeamsDistributeParallelForDirective final
5458 bool HasCancel =
false;
5466 OMPTargetTeamsDistributeParallelForDirective(SourceLocation StartLoc,
5467 SourceLocation EndLoc,
5468 unsigned CollapsedNum)
5470 llvm::omp::OMPD_target_teams_distribute_parallel_for,
5471 StartLoc, EndLoc, CollapsedNum) {}
5479 llvm::omp::OMPD_target_teams_distribute_parallel_for,
5480 SourceLocation(), SourceLocation(), CollapsedNum) {}
5483 void setTaskReductionRefExpr(Expr *E) {
5484 Data->getChildren()[numLoopChildren(
5486 llvm::omp::OMPD_target_teams_distribute_parallel_for)] = E;
5490 void setHasCancel(
bool Has) { HasCancel = Has; }
5506 static OMPTargetTeamsDistributeParallelForDirective *
5507 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5508 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5509 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
5518 static OMPTargetTeamsDistributeParallelForDirective *
5519 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5526 llvm::omp::OMPD_target_teams_distribute_parallel_for)]);
5529 return const_cast<OMPTargetTeamsDistributeParallelForDirective *
>(
this)
5537 return T->getStmtClass() ==
5538 OMPTargetTeamsDistributeParallelForDirectiveClass;
5551class OMPTargetTeamsDistributeParallelForSimdDirective final
5562 OMPTargetTeamsDistributeParallelForSimdDirective(SourceLocation StartLoc,
5563 SourceLocation EndLoc,
5564 unsigned CollapsedNum)
5566 OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
5567 llvm::omp::OMPD_target_teams_distribute_parallel_for_simd, StartLoc,
5568 EndLoc, CollapsedNum) {}
5575 unsigned CollapsedNum)
5577 OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
5578 llvm::omp::OMPD_target_teams_distribute_parallel_for_simd,
5579 SourceLocation(), SourceLocation(), CollapsedNum) {}
5592 static OMPTargetTeamsDistributeParallelForSimdDirective *
5593 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5594 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5595 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5603 static OMPTargetTeamsDistributeParallelForSimdDirective *
5604 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5608 return T->getStmtClass() ==
5609 OMPTargetTeamsDistributeParallelForSimdDirectiveClass;
5632 OMPTargetTeamsDistributeSimdDirective(SourceLocation StartLoc,
5633 SourceLocation EndLoc,
5634 unsigned CollapsedNum)
5636 llvm::omp::OMPD_target_teams_distribute_simd, StartLoc,
5637 EndLoc, CollapsedNum) {}
5645 llvm::omp::OMPD_target_teams_distribute_simd,
5646 SourceLocation(), SourceLocation(), CollapsedNum) {}
5659 static OMPTargetTeamsDistributeSimdDirective *
5660 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5661 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5662 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5670 static OMPTargetTeamsDistributeSimdDirective *
5671 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5675 return T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
5680class OMPTileDirective final
5688 TransformedStmtOffset,
5694 OMPTileDirectiveClass,
llvm::omp::OMPD_tile, StartLoc, EndLoc,
5697 void setPreInits(Stmt *PreInits) {
5698 Data->getChildren()[PreInitsOffset] = PreInits;
5701 void setTransformedStmt(Stmt *S) {
5702 Data->getChildren()[TransformedStmtOffset] = S;
5718 static OMPTileDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
5719 SourceLocation EndLoc,
5720 ArrayRef<OMPClause *> Clauses,
5721 unsigned NumLoops, Stmt *AssociatedStmt,
5722 Stmt *TransformedStmt, Stmt *PreInits);
5729 static OMPTileDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
5744 return Data->getChildren()[TransformedStmtOffset];
5748 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5751 return T->getStmtClass() == OMPTileDirectiveClass;
5756class OMPStripeDirective final
5764 TransformedStmtOffset,
5770 OMPStripeDirectiveClass,
llvm::omp::OMPD_stripe, StartLoc, EndLoc,
5773 void setPreInits(Stmt *PreInits) {
5774 Data->getChildren()[PreInitsOffset] = PreInits;
5777 void setTransformedStmt(Stmt *S) {
5778 Data->getChildren()[TransformedStmtOffset] = S;
5794 static OMPStripeDirective *
5795 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5796 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
5797 Stmt *TransformedStmt, Stmt *PreInits);
5804 static OMPStripeDirective *
5805 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned NumLoops);
5818 return Data->getChildren()[TransformedStmtOffset];
5822 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5825 return T->getStmtClass() == OMPStripeDirectiveClass;
5835class OMPUnrollDirective final
5843 TransformedStmtOffset,
5848 llvm::omp::OMPD_unroll,
5849 StartLoc, EndLoc, 1) {}
5852 void setPreInits(Stmt *PreInits) {
5853 Data->getChildren()[PreInitsOffset] = PreInits;
5857 void setTransformedStmt(Stmt *S) {
5858 Data->getChildren()[TransformedStmtOffset] = S;
5872 static OMPUnrollDirective *
5873 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5874 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
5875 unsigned NumGeneratedTopLevelLoops, Stmt *TransformedStmt,
5882 static OMPUnrollDirective *CreateEmpty(
const ASTContext &C,
5883 unsigned NumClauses);
5893 return Data->getChildren()[TransformedStmtOffset];
5897 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5900 return T->getStmtClass() == OMPUnrollDirectiveClass;
5911class OMPReverseDirective final
5919 TransformedStmtOffset,
5925 OMPReverseDirectiveClass,
llvm::omp::OMPD_reverse, StartLoc, EndLoc,
5928 void setPreInits(Stmt *PreInits) {
5929 Data->getChildren()[PreInitsOffset] = PreInits;
5932 void setTransformedStmt(Stmt *S) {
5933 Data->getChildren()[TransformedStmtOffset] = S;
5947 static OMPReverseDirective *
Create(
const ASTContext &C,
5948 SourceLocation StartLoc,
5949 SourceLocation EndLoc,
5950 Stmt *AssociatedStmt,
unsigned NumLoops,
5951 Stmt *TransformedStmt, Stmt *PreInits);
5957 static OMPReverseDirective *CreateEmpty(
const ASTContext &C,
5963 return Data->getChildren()[TransformedStmtOffset];
5967 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5970 return T->getStmtClass() == OMPReverseDirectiveClass;
5982class OMPInterchangeDirective final
5990 TransformedStmtOffset,
5994 SourceLocation EndLoc,
unsigned NumLoops)
5996 OMPInterchangeDirectiveClass,
llvm::omp::OMPD_interchange, StartLoc,
5997 EndLoc, NumLoops) {}
5999 void setPreInits(Stmt *PreInits) {
6000 Data->getChildren()[PreInitsOffset] = PreInits;
6003 void setTransformedStmt(Stmt *S) {
6004 Data->getChildren()[TransformedStmtOffset] = S;
6020 static OMPInterchangeDirective *
6021 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6022 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
6023 Stmt *TransformedStmt, Stmt *PreInits);
6030 static OMPInterchangeDirective *
6031 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned NumLoops);
6036 return Data->getChildren()[TransformedStmtOffset];
6040 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6043 return T->getStmtClass() == OMPInterchangeDirectiveClass;
6056 StmtClass SC, OpenMPDirectiveKind Kind, SourceLocation StartLoc,
6057 SourceLocation EndLoc)
6067 Stmt *getTransformedStmt()
const;
6070 Stmt *getPreInits()
const;
6073 Stmt::StmtClass C = T->getStmtClass();
6074 return C == OMPFuseDirectiveClass;
6088class OMPFuseDirective final
6096 TransformedStmtOffset,
6101 OMPFuseDirectiveClass,
llvm::omp::OMPD_fuse, StartLoc, EndLoc) {}
6103 void setPreInits(Stmt *PreInits) {
6104 Data->getChildren()[PreInitsOffset] = PreInits;
6107 void setTransformedStmt(Stmt *S) {
6108 Data->getChildren()[TransformedStmtOffset] = S;
6126 static OMPFuseDirective *
6127 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6128 ArrayRef<OMPClause *> Clauses,
unsigned NumGeneratedTopLevelLoops,
6129 Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits);
6136 static OMPFuseDirective *CreateEmpty(
const ASTContext &C,
6137 unsigned NumClauses);
6142 return Data->getChildren()[TransformedStmtOffset];
6146 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6149 return T->getStmtClass() == OMPFuseDirectiveClass;
6165class OMPSplitDirective final
6173 TransformedStmtOffset,
6179 OMPSplitDirectiveClass,
llvm::omp::OMPD_split, StartLoc, EndLoc,
6182 void setPreInits(Stmt *PreInits) {
6183 Data->getChildren()[PreInitsOffset] = PreInits;
6186 void setTransformedStmt(Stmt *S) {
6187 Data->getChildren()[TransformedStmtOffset] = S;
6203 static OMPSplitDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
6204 SourceLocation EndLoc,
6205 ArrayRef<OMPClause *> Clauses,
6206 unsigned NumLoops, Stmt *AssociatedStmt,
6207 Stmt *TransformedStmt, Stmt *PreInits);
6214 static OMPSplitDirective *CreateEmpty(
const ASTContext &C,
6215 unsigned NumClauses,
unsigned NumLoops);
6220 return Data->getChildren()[TransformedStmtOffset];
6224 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6227 return T->getStmtClass() == OMPSplitDirectiveClass;
6246 OMPScanDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6248 StartLoc, EndLoc) {}
6254 SourceLocation(), SourceLocation()) {}
6265 static OMPScanDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
6266 SourceLocation EndLoc,
6267 ArrayRef<OMPClause *> Clauses);
6275 static OMPScanDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
6279 return T->getStmtClass() == OMPScanDirectiveClass;
6300 OMPInteropDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6302 llvm::omp::OMPD_interop, StartLoc, EndLoc) {}
6308 llvm::omp::OMPD_interop, SourceLocation(),
6309 SourceLocation()) {}
6319 static OMPInteropDirective *
Create(
const ASTContext &C,
6320 SourceLocation StartLoc,
6321 SourceLocation EndLoc,
6322 ArrayRef<OMPClause *> Clauses);
6328 static OMPInteropDirective *CreateEmpty(
const ASTContext &C,
6329 unsigned NumClauses, EmptyShell);
6332 return T->getStmtClass() == OMPInteropDirectiveClass;
6349 SourceLocation TargetCallLoc;
6352 void setTargetCallLoc(SourceLocation Loc) { TargetCallLoc = Loc; }
6361 llvm::omp::OMPD_dispatch, StartLoc, EndLoc) {}
6365 explicit OMPDispatchDirective()
6366 : OMPExecutableDirective(OMPDispatchDirectiveClass,
6367 llvm::omp::OMPD_dispatch, SourceLocation(),
6368 SourceLocation()) {}
6380 static OMPDispatchDirective *
6381 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6382 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
6383 SourceLocation TargetCallLoc);
6391 static OMPDispatchDirective *CreateEmpty(
const ASTContext &C,
6392 unsigned NumClauses, EmptyShell);
6398 return T->getStmtClass() == OMPDispatchDirectiveClass;
6418 OMPMaskedDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6420 StartLoc, EndLoc) {}
6426 SourceLocation(), SourceLocation()) {}
6436 static OMPMaskedDirective *
6437 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6438 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
6444 static OMPMaskedDirective *CreateEmpty(
const ASTContext &C,
6445 unsigned NumClauses, EmptyShell);
6448 return T->getStmtClass() == OMPMaskedDirectiveClass;
6465 OMPMetaDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6467 llvm::omp::OMPD_metadirective, StartLoc,
6471 llvm::omp::OMPD_metadirective, SourceLocation(),
6472 SourceLocation()) {}
6474 void setIfStmt(Stmt *S) { IfStmt = S; }
6477 static OMPMetaDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
6478 SourceLocation EndLoc,
6479 ArrayRef<OMPClause *> Clauses,
6480 Stmt *AssociatedStmt, Stmt *IfStmt);
6481 static OMPMetaDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
6486 return T->getStmtClass() == OMPMetaDirectiveClass;
6508 OMPGenericLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
6509 unsigned CollapsedNum)
6511 StartLoc, EndLoc, CollapsedNum) {}
6519 SourceLocation(), SourceLocation(), CollapsedNum) {}
6532 static OMPGenericLoopDirective *
6533 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6534 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6535 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6543 static OMPGenericLoopDirective *CreateEmpty(
const ASTContext &C,
6544 unsigned NumClauses,
6545 unsigned CollapsedNum,
6549 return T->getStmtClass() == OMPGenericLoopDirectiveClass;
6570 OMPTeamsGenericLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
6571 unsigned CollapsedNum)
6573 llvm::omp::OMPD_teams_loop, StartLoc, EndLoc,
6582 llvm::omp::OMPD_teams_loop, SourceLocation(),
6583 SourceLocation(), CollapsedNum) {}
6596 static OMPTeamsGenericLoopDirective *
6597 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6598 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6599 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6608 static OMPTeamsGenericLoopDirective *CreateEmpty(
const ASTContext &C,
6609 unsigned NumClauses,
6610 unsigned CollapsedNum,
6614 return T->getStmtClass() == OMPTeamsGenericLoopDirectiveClass;
6630 bool CanBeParallelFor =
false;
6637 OMPTargetTeamsGenericLoopDirective(SourceLocation StartLoc,
6638 SourceLocation EndLoc,
6639 unsigned CollapsedNum)
6641 llvm::omp::OMPD_target_teams_loop, StartLoc, EndLoc,
6650 llvm::omp::OMPD_target_teams_loop, SourceLocation(),
6651 SourceLocation(), CollapsedNum) {}
6654 void setCanBeParallelFor(
bool ParFor) { CanBeParallelFor = ParFor; }
6667 static OMPTargetTeamsGenericLoopDirective *
6668 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6669 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6670 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool CanBeParallelFor);
6679 static OMPTargetTeamsGenericLoopDirective *CreateEmpty(
const ASTContext &C,
6680 unsigned NumClauses,
6681 unsigned CollapsedNum,
6689 return T->getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass;
6710 OMPParallelGenericLoopDirective(SourceLocation StartLoc,
6711 SourceLocation EndLoc,
unsigned CollapsedNum)
6713 llvm::omp::OMPD_parallel_loop, StartLoc, EndLoc,
6722 llvm::omp::OMPD_parallel_loop, SourceLocation(),
6723 SourceLocation(), CollapsedNum) {}
6736 static OMPParallelGenericLoopDirective *
6737 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6738 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6739 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6748 static OMPParallelGenericLoopDirective *CreateEmpty(
const ASTContext &C,
6749 unsigned NumClauses,
6750 unsigned CollapsedNum,
6754 return T->getStmtClass() == OMPParallelGenericLoopDirectiveClass;
6775 OMPTargetParallelGenericLoopDirective(SourceLocation StartLoc,
6776 SourceLocation EndLoc,
6777 unsigned CollapsedNum)
6779 llvm::omp::OMPD_target_parallel_loop, StartLoc, EndLoc,
6788 llvm::omp::OMPD_target_parallel_loop, SourceLocation(),
6789 SourceLocation(), CollapsedNum) {}
6802 static OMPTargetParallelGenericLoopDirective *
6803 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6804 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6805 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6814 static OMPTargetParallelGenericLoopDirective *
6815 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
6819 return T->getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass;
6836 OMPErrorDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6838 StartLoc, EndLoc) {}
6843 SourceLocation(), SourceLocation()) {}
6852 static OMPErrorDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
6853 SourceLocation EndLoc,
6854 ArrayRef<OMPClause *> Clauses);
6860 static OMPErrorDirective *CreateEmpty(
const ASTContext &C,
6861 unsigned NumClauses, EmptyShell);
6864 return T->getStmtClass() == OMPErrorDirectiveClass;
6875 OMPAssumeDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6877 StartLoc, EndLoc) {}
6881 SourceLocation(), SourceLocation()) {}
6884 static OMPAssumeDirective *
Create(
const ASTContext &Ctx,
6885 SourceLocation StartLoc,
6886 SourceLocation EndLoc,
6887 ArrayRef<OMPClause *> Clauses, Stmt *AStmt);
6889 static OMPAssumeDirective *CreateEmpty(
const ASTContext &C,
6890 unsigned NumClauses, EmptyShell);
6893 return T->getStmtClass() == OMPAssumeDirectiveClass;
6908 clang::OMPLoopTransformationDirective *, clang::Stmt *,
6909 CastInfo<clang::OMPLoopTransformationDirective, clang::Stmt *>> {
6911 return clang::OMPLoopTransformationDirective::classof(T);
6916 dyn_cast<clang::OMPCanonicalLoopNestTransformationDirective>(T))
6917 return static_cast<clang::OMPLoopTransformationDirective *
>(D);
6919 dyn_cast<clang::OMPCanonicalLoopSequenceTransformationDirective>(T))
6920 return static_cast<clang::OMPLoopTransformationDirective *
>(D);
6921 llvm_unreachable(
"unexpected type");
6927 clang::OMPLoopTransformationDirective, const clang::Stmt *,
6928 CastInfo<clang::OMPLoopTransformationDirective, clang::Stmt *>> {};
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.
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 atomic' directive.
Expr * getR()
Get 'r' part of the associated expression/statement.
Expr * getX()
Get 'x' part of the associated expression/statement.
const Expr * getUpdateExpr() const
bool isFailOnly() const
Return true if 'v' is updated only when the condition is evaluated false (compare capture only).
Expr * getCondExpr() const
bool isPostfixUpdate() const
Return true if 'v' expression must be updated to original value of 'x', false if 'v' must be updated ...
const Expr * getV() const
const Expr * getR() const
Expr * getExpr()
Get 'expr' part of the associated expression/statement.
Expr * getV()
Get 'v' part of the associated expression/statement.
const Expr * getX() const
static bool classof(const Stmt *T)
const Expr * getExpr() const
bool isXLHSInRHSPart() const
Return true if helper update expression has form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' and...
Expr * getD()
Get 'd' part of the associated expression/statement.
friend class OMPExecutableDirective
Expr * getUpdateExpr()
Get helper expression of the form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExp...
friend class ASTStmtReader
Expr * getCondExpr()
Get the 'cond' part of the source atomic expression.
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPAtomicDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expressions Exprs)
Creates directive with a list of Clauses and 'x', 'v' and 'expr' parts of the atomic construct (see S...
This represents 'pragma omp barrier' directive.
friend class OMPExecutableDirective
friend class ASTStmtReader
static bool classof(const Stmt *T)
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 critical' directive.
friend class OMPExecutableDirective
friend class ASTStmtReader
DeclarationNameInfo getDirectiveName() const
Return name of the directive.
static bool classof(const Stmt *T)
This represents 'pragma omp depobj' directive.
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 flush' directive.
friend class OMPExecutableDirective
friend class ASTStmtReader
static bool classof(const Stmt *T)
This represents 'pragma omp for' directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
static bool classof(const Stmt *T)
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
friend class OMPExecutableDirective
friend class ASTStmtReader
const Expr * getTaskReductionRefExpr() const
This represents 'pragma omp for simd' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
Represents the 'pragma omp fuse' loop transformation directive.
static bool classof(const Stmt *T)
Stmt * getPreInits() const
Return preinits statement.
friend class OMPExecutableDirective
friend class ASTStmtReader
Stmt * getTransformedStmt() const
Gets the associated loops after the transformation.
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 is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc....
void setCombinedNextUpperBound(Expr *CombNUB)
Expr * getCombinedUpperBoundVariable() const
Expr * getPreCond() const
void setNextUpperBound(Expr *NUB)
Expr * getPrevUpperBoundVariable() const
Expr * getIsLastIterVariable() const
static unsigned numLoopChildren(unsigned CollapsedNum, OpenMPDirectiveKind Kind)
Children number.
Expr * getCombinedLowerBoundVariable() const
void setUpperBoundVariable(Expr *UB)
static bool classof(const Stmt *T)
Expr * getCombinedCond() const
void setIsLastIterVariable(Expr *IL)
Expr * getCombinedInit() const
void setPrevEnsureUpperBound(Expr *PrevEUB)
Expr * getLowerBoundVariable() const
void setCombinedLowerBoundVariable(Expr *CombLB)
void setPreInits(Stmt *PreInits)
OMPLoopDirective(StmtClass SC, OpenMPDirectiveKind Kind, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum)
Build instance of loop directive of class Kind.
ArrayRef< Expr * > dependent_inits() const
Expr * getCombinedNextLowerBound() const
ArrayRef< Expr * > finals_conditions()
ArrayRef< Expr * > counters()
void setNextLowerBound(Expr *NLB)
ArrayRef< Expr * > private_counters()
Expr * getUpperBoundVariable() const
ArrayRef< Expr * > dependent_counters() const
void setCombinedParForInDistCond(Expr *CombParForInDistCond)
void setEnsureUpperBound(Expr *EUB)
void setCombinedNextLowerBound(Expr *CombNLB)
Expr * getCombinedDistCond() const
Expr * getPrevLowerBoundVariable() const
ArrayRef< Expr * > dependent_inits()
void setPrevLowerBoundVariable(Expr *PrevLB)
void setCombinedCond(Expr *CombCond)
Expr * getNextLowerBound() const
void setLowerBoundVariable(Expr *LB)
Expr * getDistInc() const
const Stmt * getBody() const
void setPrevUpperBoundVariable(Expr *PrevUB)
ArrayRef< Expr * > inits() const
ArrayRef< Expr * > updates()
Expr * getNextUpperBound() const
Expr * getLastIteration() const
Expr * getEnsureUpperBound() const
void setCombinedUpperBoundVariable(Expr *CombUB)
const Stmt * getPreInits() const
Expr * getCalcLastIteration() const
ArrayRef< Expr * > updates() const
void setStrideVariable(Expr *ST)
void setCombinedDistCond(Expr *CombDistCond)
void setCalcLastIteration(Expr *CLI)
void setDistInc(Expr *DistInc)
ArrayRef< Expr * > finals() const
void setCombinedEnsureUpperBound(Expr *CombEUB)
ArrayRef< Expr * > finals_conditions() const
Expr * getCombinedNextUpperBound() const
void setIterationVariable(Expr *IV)
ArrayRef< Expr * > private_counters() const
Expr * getIterationVariable() const
Expr * getStrideVariable() const
Expr * getNumIterations() const
friend class ASTStmtReader
Expr * getCombinedParForInDistCond() const
void setPreCond(Expr *PC)
static unsigned getArraysOffset(OpenMPDirectiveKind Kind)
Offset to the start of children expression arrays.
ArrayRef< Expr * > finals()
void setNumIterations(Expr *NI)
void setLastIteration(Expr *LI)
Expr * getPrevEnsureUpperBound() const
Expr * getCombinedEnsureUpperBound() const
ArrayRef< Expr * > dependent_counters()
void setCombinedInit(Expr *CombInit)
ArrayRef< Expr * > counters() const
ArrayRef< Expr * > inits()
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' 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 block-associated 'pragma omp ordered' directive.
friend class OMPExecutableDirective
friend class ASTStmtReader
static bool classof(const Stmt *T)
This represents standalone 'pragma omp ordered' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp parallel for' directive.
const Expr * getTaskReductionRefExpr() const
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
bool hasCancel() const
Return true if current directive has inner cancel directive.
friend class ASTStmtReader
This represents 'pragma omp parallel for 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' directive.
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
const Expr * getTaskReductionRefExpr() const
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' directive.
static bool classof(const Stmt *T)
const Expr * getTaskReductionRefExpr() const
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
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
This represents 'pragma omp parallel sections' directive.
static bool classof(const Stmt *T)
bool hasCancel() const
Return true if current directive has inner cancel directive.
friend class OMPExecutableDirective
const Expr * getTaskReductionRefExpr() const
friend class ASTStmtReader
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
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 'pragma omp scope' directive.
friend class OMPExecutableDirective
friend class ASTStmtReader
static bool classof(const Stmt *T)
This represents 'pragma omp section' directive.
void setHasCancel(bool Has)
Set cancel state.
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 sections' directive.
const Expr * getTaskReductionRefExpr() const
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
bool hasCancel() const
Return true if current directive has inner cancel directive.
friend class ASTStmtReader
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
This represents 'pragma omp simd' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp single' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
Represents the 'pragma omp split' loop transformation directive.
Stmt * getPreInits() const
Return preinits statement.
Stmt * getTransformedStmt() const
Gets/sets the associated loops after the transformation, i.e.
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 task' 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 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 taskgroup' directive.
const Expr * getReductionRef() const
Returns reference to the task_reduction return variable.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp taskwait' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
This represents 'pragma omp taskyield' directive.
friend class OMPExecutableDirective
static bool classof(const Stmt *T)
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
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.
Top level wrappers for InstallAPI frontend operations.
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
Stmt Stmt llvm::function_ref< void(OMPLoopTransformationDirective *)> OnTransformationCallback
static bool classof(const OMPClause *T)
Stmt * getStructuredBlock()
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
static void doForAllLoopsBodies(Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops, llvm::function_ref< void(unsigned, Stmt *, Stmt *)> Callback)
Calls the specified callback function for all the loop bodies in CurStmt, from the outermost loop to ...
static bool classof(const Stmt *T)
static bool doForAllLoops(Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops, llvm::function_ref< bool(unsigned, Stmt *)> Callback, llvm::function_ref< void(OMPLoopTransformationDirective *)> OnTransformationCallback)
const FunctionProtoType * T
child_range used_children()
bool isOpenMPLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a directive with an associated loop construct.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
void getOpenMPCaptureRegions(llvm::SmallVectorImpl< OpenMPDirectiveKind > &CaptureRegions, OpenMPDirectiveKind DKind)
Return the captured regions of an OpenMP directive.
MutableArrayRef< Expr * > getInits()
Diagnostic wrappers for TextAPI types for error reporting.
__packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 __packed_splat2 uint8_t
Expr * Cond
Conditional expression in atomic compare construct. */.
Expr * X
'x' part of the associated expression/statement.
bool IsXLHSInRHSPart
True if UE has the first form and false if the second.
Expr * E
'expr' part of the associated expression/statement.
Expr * D
'd' part of the associated expression/statement.
Expr * V
'v' part of the associated expression/statement.
bool IsFailOnly
True if 'v' is updated only when the condition is false (compare capture only).
Expr * UE
UE Helper expression of the form: 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExp...
bool IsPostfixUpdate
True if original value of 'x' must be stored in 'v', not an updated one.