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));
910 static ArrayRef<Stmt *> getStmtsBeforeNestedLoop(Stmt *Body);
930 llvm::function_ref<
bool(
unsigned , Stmt * ,
946 return doForAllLoops(CurStmt, TryImperfectlyNestedLoops, NumLoops,
953 llvm::function_ref<
bool(
unsigned,
const Stmt *)>
Callback,
957 auto &&NewCallback = [
Callback](
unsigned Cnt,
Stmt *CurStmt) {
960 auto &&NewTransformCb =
965 NumLoops, NewCallback, NewTransformCb,
982 llvm::function_ref<
bool(
unsigned,
const Stmt *)>
Callback,
984 auto &&NewCallback = [
Callback](
unsigned Cnt,
const Stmt *CurStmt) {
988 NumLoops, NewCallback,
995 Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
998 const Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
1004 NumLoops, NewCallback);
1008 if (
auto *D = dyn_cast<OMPExecutableDirective>(
T))
1027 unsigned NumGeneratedTopLevelLoops = 1;
1035 NumGeneratedTopLevelLoops = N;
1042 return NumGeneratedTopLevelLoops;
1053 Stmt *getTransformedStmt()
const;
1056 Stmt *getPreInits()
const;
1072 StmtClass SC, OpenMPDirectiveKind Kind, SourceLocation StartLoc,
1073 SourceLocation EndLoc,
unsigned NumAssociatedLoops)
1086 Stmt *getTransformedStmt()
const;
1089 Stmt *getPreInits()
const;
1092 Stmt::StmtClass C = T->getStmtClass();
1093 return C == OMPTileDirectiveClass || C == OMPUnrollDirectiveClass ||
1094 C == OMPReverseDirectiveClass || C == OMPInterchangeDirectiveClass ||
1095 C == OMPStripeDirectiveClass || C == OMPFlattenDirectiveClass;
1122 IterationVariableOffset = 0,
1123 LastIterationOffset = 1,
1124 CalcLastIterationOffset = 2,
1125 PreConditionOffset = 3,
1136 IsLastIterVariableOffset = 8,
1137 LowerBoundVariableOffset = 9,
1138 UpperBoundVariableOffset = 10,
1139 StrideVariableOffset = 11,
1140 EnsureUpperBoundOffset = 12,
1141 NextLowerBoundOffset = 13,
1142 NextUpperBoundOffset = 14,
1143 NumIterationsOffset = 15,
1145 WorksharingEnd = 16,
1146 PrevLowerBoundVariableOffset = 16,
1147 PrevUpperBoundVariableOffset = 17,
1149 PrevEnsureUpperBoundOffset = 19,
1150 CombinedLowerBoundVariableOffset = 20,
1151 CombinedUpperBoundVariableOffset = 21,
1152 CombinedEnsureUpperBoundOffset = 22,
1153 CombinedInitOffset = 23,
1154 CombinedConditionOffset = 24,
1155 CombinedNextLowerBoundOffset = 25,
1156 CombinedNextUpperBoundOffset = 26,
1157 CombinedDistConditionOffset = 27,
1158 CombinedParForInDistConditionOffset = 28,
1162 CombinedDistributeEnd = 29,
1166 MutableArrayRef<Expr *> getCounters() {
1167 auto **Storage =
reinterpret_cast<Expr **
>(
1168 &Data->getChildren()[getArraysOffset(getDirectiveKind())]);
1169 return {Storage, getLoopsNumber()};
1173 MutableArrayRef<Expr *> getPrivateCounters() {
1174 auto **
Storage =
reinterpret_cast<Expr **
>(
1175 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1177 return {
Storage, getLoopsNumber()};
1181 MutableArrayRef<Expr *>
getInits() {
1182 auto **
Storage =
reinterpret_cast<Expr **
>(
1183 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1184 2 * getLoopsNumber()]);
1185 return {
Storage, getLoopsNumber()};
1190 auto **
Storage =
reinterpret_cast<Expr **
>(
1191 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1192 3 * getLoopsNumber()]);
1193 return {
Storage, getLoopsNumber()};
1198 auto **
Storage =
reinterpret_cast<Expr **
>(
1199 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1200 4 * getLoopsNumber()]);
1201 return {
Storage, getLoopsNumber()};
1205 MutableArrayRef<Expr *> getDependentCounters() {
1206 auto **
Storage =
reinterpret_cast<Expr **
>(
1207 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1208 5 * getLoopsNumber()]);
1209 return {
Storage, getLoopsNumber()};
1213 MutableArrayRef<Expr *> getDependentInits() {
1214 auto **
Storage =
reinterpret_cast<Expr **
>(
1215 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1216 6 * getLoopsNumber()]);
1217 return {
Storage, getLoopsNumber()};
1221 MutableArrayRef<Expr *> getFinalsConditions() {
1222 auto **
Storage =
reinterpret_cast<Expr **
>(
1223 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1224 7 * getLoopsNumber()]);
1225 return {
Storage, getLoopsNumber()};
1238 SourceLocation StartLoc, SourceLocation EndLoc,
1239 unsigned CollapsedNum)
1244 if (isOpenMPLoopBoundSharingDirective(Kind))
1245 return CombinedDistributeEnd;
1246 if (isOpenMPWorksharingDirective(Kind) || isOpenMPTaskLoopDirective(Kind) ||
1247 isOpenMPGenericLoopDirective(Kind) || isOpenMPDistributeDirective(Kind))
1248 return WorksharingEnd;
1254 OpenMPDirectiveKind Kind) {
1262 Data->getChildren()[IterationVariableOffset] = IV;
1265 Data->getChildren()[LastIterationOffset] = LI;
1268 Data->getChildren()[CalcLastIterationOffset] = CLI;
1270 void setPreCond(Expr *PC) { Data->getChildren()[PreConditionOffset] = PC; }
1271 void setCond(Expr *Cond) { Data->getChildren()[CondOffset] = Cond; }
1272 void setInit(Expr *Init) { Data->getChildren()[InitOffset] = Init; }
1273 void setInc(Expr *Inc) { Data->getChildren()[IncOffset] = Inc; }
1275 Data->getChildren()[PreInitsOffset] = PreInits;
1278 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1279 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1280 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1281 isOpenMPDistributeDirective(getDirectiveKind())) &&
1282 "expected worksharing loop directive");
1283 Data->getChildren()[IsLastIterVariableOffset] = IL;
1286 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1287 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1288 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1289 isOpenMPDistributeDirective(getDirectiveKind())) &&
1290 "expected worksharing loop directive");
1291 Data->getChildren()[LowerBoundVariableOffset] = LB;
1294 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1295 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1296 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1297 isOpenMPDistributeDirective(getDirectiveKind())) &&
1298 "expected worksharing loop directive");
1299 Data->getChildren()[UpperBoundVariableOffset] = UB;
1302 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1303 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1304 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1305 isOpenMPDistributeDirective(getDirectiveKind())) &&
1306 "expected worksharing loop directive");
1307 Data->getChildren()[StrideVariableOffset] = ST;
1310 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1311 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1312 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1313 isOpenMPDistributeDirective(getDirectiveKind())) &&
1314 "expected worksharing loop directive");
1315 Data->getChildren()[EnsureUpperBoundOffset] = EUB;
1318 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1319 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1320 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1321 isOpenMPDistributeDirective(getDirectiveKind())) &&
1322 "expected worksharing loop directive");
1323 Data->getChildren()[NextLowerBoundOffset] = NLB;
1326 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1327 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1328 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1329 isOpenMPDistributeDirective(getDirectiveKind())) &&
1330 "expected worksharing loop directive");
1331 Data->getChildren()[NextUpperBoundOffset] = NUB;
1334 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1335 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1336 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1337 isOpenMPDistributeDirective(getDirectiveKind())) &&
1338 "expected worksharing loop directive");
1339 Data->getChildren()[NumIterationsOffset] = NI;
1342 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1343 "expected loop bound sharing directive");
1344 Data->getChildren()[PrevLowerBoundVariableOffset] = PrevLB;
1347 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1348 "expected loop bound sharing directive");
1349 Data->getChildren()[PrevUpperBoundVariableOffset] = PrevUB;
1352 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1353 "expected loop bound sharing directive");
1354 Data->getChildren()[DistIncOffset] = DistInc;
1357 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1358 "expected loop bound sharing directive");
1359 Data->getChildren()[PrevEnsureUpperBoundOffset] = PrevEUB;
1362 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1363 "expected loop bound sharing directive");
1364 Data->getChildren()[CombinedLowerBoundVariableOffset] = CombLB;
1367 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1368 "expected loop bound sharing directive");
1369 Data->getChildren()[CombinedUpperBoundVariableOffset] = CombUB;
1372 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1373 "expected loop bound sharing directive");
1374 Data->getChildren()[CombinedEnsureUpperBoundOffset] = CombEUB;
1377 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1378 "expected loop bound sharing directive");
1379 Data->getChildren()[CombinedInitOffset] = CombInit;
1382 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1383 "expected loop bound sharing directive");
1384 Data->getChildren()[CombinedConditionOffset] = CombCond;
1387 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1388 "expected loop bound sharing directive");
1389 Data->getChildren()[CombinedNextLowerBoundOffset] = CombNLB;
1392 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1393 "expected loop bound sharing directive");
1394 Data->getChildren()[CombinedNextUpperBoundOffset] = CombNUB;
1397 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1398 "expected loop bound distribute sharing directive");
1399 Data->getChildren()[CombinedDistConditionOffset] = CombDistCond;
1402 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1403 "expected loop bound distribute sharing directive");
1404 Data->getChildren()[CombinedParForInDistConditionOffset] =
1405 CombParForInDistCond;
1418 return cast<Expr>(Data->getChildren()[IterationVariableOffset]);
1421 return cast<Expr>(Data->getChildren()[LastIterationOffset]);
1424 return cast<Expr>(Data->getChildren()[CalcLastIterationOffset]);
1427 return cast<Expr>(Data->getChildren()[PreConditionOffset]);
1429 Expr *
getCond()
const {
return cast<Expr>(Data->getChildren()[CondOffset]); }
1430 Expr *
getInit()
const {
return cast<Expr>(Data->getChildren()[InitOffset]); }
1431 Expr *
getInc()
const {
return cast<Expr>(Data->getChildren()[IncOffset]); }
1433 return Data->getChildren()[PreInitsOffset];
1437 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1438 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1439 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1440 isOpenMPDistributeDirective(getDirectiveKind())) &&
1441 "expected worksharing loop directive");
1442 return cast<Expr>(Data->getChildren()[IsLastIterVariableOffset]);
1445 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1446 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1447 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1448 isOpenMPDistributeDirective(getDirectiveKind())) &&
1449 "expected worksharing loop directive");
1450 return cast<Expr>(Data->getChildren()[LowerBoundVariableOffset]);
1453 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1454 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1455 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1456 isOpenMPDistributeDirective(getDirectiveKind())) &&
1457 "expected worksharing loop directive");
1458 return cast<Expr>(Data->getChildren()[UpperBoundVariableOffset]);
1461 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1462 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1463 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1464 isOpenMPDistributeDirective(getDirectiveKind())) &&
1465 "expected worksharing loop directive");
1466 return cast<Expr>(Data->getChildren()[StrideVariableOffset]);
1469 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1470 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1471 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1472 isOpenMPDistributeDirective(getDirectiveKind())) &&
1473 "expected worksharing loop directive");
1474 return cast<Expr>(Data->getChildren()[EnsureUpperBoundOffset]);
1477 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1478 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1479 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1480 isOpenMPDistributeDirective(getDirectiveKind())) &&
1481 "expected worksharing loop directive");
1482 return cast<Expr>(Data->getChildren()[NextLowerBoundOffset]);
1485 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1486 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1487 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1488 isOpenMPDistributeDirective(getDirectiveKind())) &&
1489 "expected worksharing loop directive");
1490 return cast<Expr>(Data->getChildren()[NextUpperBoundOffset]);
1493 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1494 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1495 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1496 isOpenMPDistributeDirective(getDirectiveKind())) &&
1497 "expected worksharing loop directive");
1498 return cast<Expr>(Data->getChildren()[NumIterationsOffset]);
1501 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1502 "expected loop bound sharing directive");
1503 return cast<Expr>(Data->getChildren()[PrevLowerBoundVariableOffset]);
1506 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1507 "expected loop bound sharing directive");
1508 return cast<Expr>(Data->getChildren()[PrevUpperBoundVariableOffset]);
1511 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1512 "expected loop bound sharing directive");
1513 return cast<Expr>(Data->getChildren()[DistIncOffset]);
1516 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1517 "expected loop bound sharing directive");
1518 return cast<Expr>(Data->getChildren()[PrevEnsureUpperBoundOffset]);
1521 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1522 "expected loop bound sharing directive");
1523 return cast<Expr>(Data->getChildren()[CombinedLowerBoundVariableOffset]);
1526 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1527 "expected loop bound sharing directive");
1528 return cast<Expr>(Data->getChildren()[CombinedUpperBoundVariableOffset]);
1531 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1532 "expected loop bound sharing directive");
1533 return cast<Expr>(Data->getChildren()[CombinedEnsureUpperBoundOffset]);
1536 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1537 "expected loop bound sharing directive");
1538 return cast<Expr>(Data->getChildren()[CombinedInitOffset]);
1541 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1542 "expected loop bound sharing directive");
1543 return cast<Expr>(Data->getChildren()[CombinedConditionOffset]);
1546 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1547 "expected loop bound sharing directive");
1548 return cast<Expr>(Data->getChildren()[CombinedNextLowerBoundOffset]);
1551 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1552 "expected loop bound sharing directive");
1553 return cast<Expr>(Data->getChildren()[CombinedNextUpperBoundOffset]);
1556 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1557 "expected loop bound distribute sharing directive");
1558 return cast<Expr>(Data->getChildren()[CombinedDistConditionOffset]);
1561 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1562 "expected loop bound distribute sharing directive");
1563 return cast<Expr>(Data->getChildren()[CombinedParForInDistConditionOffset]);
1619 return T->getStmtClass() == OMPSimdDirectiveClass ||
1620 T->getStmtClass() == OMPForDirectiveClass ||
1621 T->getStmtClass() == OMPForSimdDirectiveClass ||
1622 T->getStmtClass() == OMPParallelForDirectiveClass ||
1623 T->getStmtClass() == OMPParallelForSimdDirectiveClass ||
1624 T->getStmtClass() == OMPTaskLoopDirectiveClass ||
1625 T->getStmtClass() == OMPTaskLoopSimdDirectiveClass ||
1626 T->getStmtClass() == OMPMaskedTaskLoopDirectiveClass ||
1627 T->getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass ||
1628 T->getStmtClass() == OMPMasterTaskLoopDirectiveClass ||
1629 T->getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass ||
1630 T->getStmtClass() == OMPGenericLoopDirectiveClass ||
1631 T->getStmtClass() == OMPTeamsGenericLoopDirectiveClass ||
1632 T->getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass ||
1633 T->getStmtClass() == OMPParallelGenericLoopDirectiveClass ||
1634 T->getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass ||
1635 T->getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass ||
1636 T->getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass ||
1637 T->getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass ||
1638 T->getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass ||
1639 T->getStmtClass() == OMPDistributeDirectiveClass ||
1640 T->getStmtClass() == OMPTargetParallelForDirectiveClass ||
1641 T->getStmtClass() == OMPDistributeParallelForDirectiveClass ||
1642 T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass ||
1643 T->getStmtClass() == OMPDistributeSimdDirectiveClass ||
1644 T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass ||
1645 T->getStmtClass() == OMPTargetSimdDirectiveClass ||
1646 T->getStmtClass() == OMPTeamsDistributeDirectiveClass ||
1647 T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass ||
1648 T->getStmtClass() ==
1649 OMPTeamsDistributeParallelForSimdDirectiveClass ||
1650 T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass ||
1651 T->getStmtClass() ==
1652 OMPTargetTeamsDistributeParallelForDirectiveClass ||
1653 T->getStmtClass() ==
1654 OMPTargetTeamsDistributeParallelForSimdDirectiveClass ||
1655 T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass ||
1656 T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
1678 OMPSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1679 unsigned CollapsedNum)
1681 EndLoc, CollapsedNum) {}
1689 SourceLocation(), SourceLocation(), CollapsedNum) {}
1702 static OMPSimdDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
1703 SourceLocation EndLoc,
unsigned CollapsedNum,
1704 ArrayRef<OMPClause *> Clauses,
1705 Stmt *AssociatedStmt,
1706 const HelperExprs &Exprs);
1715 static OMPSimdDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
1716 unsigned CollapsedNum, EmptyShell);
1719 return T->getStmtClass() == OMPSimdDirectiveClass;
1736 bool HasCancel =
false;
1744 OMPForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1745 unsigned CollapsedNum)
1747 EndLoc, CollapsedNum) {}
1755 SourceLocation(), SourceLocation(), CollapsedNum) {}
1758 void setTaskReductionRefExpr(Expr *E) {
1759 Data->getChildren()[numLoopChildren(getLoopsNumber(),
1760 llvm::omp::OMPD_for)] = E;
1764 void setHasCancel(
bool Has) { HasCancel = Has; }
1780 static OMPForDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
1781 SourceLocation EndLoc,
unsigned CollapsedNum,
1782 ArrayRef<OMPClause *> Clauses,
1783 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
1784 Expr *TaskRedRef,
bool HasCancel);
1793 static OMPForDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
1794 unsigned CollapsedNum, EmptyShell);
1799 getLoopsNumber(), llvm::omp::OMPD_for)]);
1809 return T->getStmtClass() == OMPForDirectiveClass;
1831 OMPForSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1832 unsigned CollapsedNum)
1834 StartLoc, EndLoc, CollapsedNum) {}
1842 SourceLocation(), SourceLocation(), CollapsedNum) {}
1855 static OMPForSimdDirective *
1856 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1857 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
1858 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
1867 static OMPForSimdDirective *CreateEmpty(
const ASTContext &C,
1868 unsigned NumClauses,
1869 unsigned CollapsedNum, EmptyShell);
1872 return T->getStmtClass() == OMPForSimdDirectiveClass;
1890 bool HasCancel =
false;
1897 OMPSectionsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1899 llvm::omp::OMPD_sections, StartLoc, EndLoc) {}
1905 llvm::omp::OMPD_sections, SourceLocation(),
1906 SourceLocation()) {}
1909 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
1912 void setHasCancel(
bool Has) { HasCancel = Has; }
1926 static OMPSectionsDirective *
1927 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1928 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
1937 static OMPSectionsDirective *CreateEmpty(
const ASTContext &C,
1938 unsigned NumClauses, EmptyShell);
1942 return cast_or_null<Expr>(Data->getChildren()[0]);
1952 return T->getStmtClass() == OMPSectionsDirectiveClass;
1967 bool HasCancel =
false;
1974 OMPSectionDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1976 llvm::omp::OMPD_section, StartLoc, EndLoc) {}
1982 llvm::omp::OMPD_section, SourceLocation(),
1983 SourceLocation()) {}
1994 static OMPSectionDirective *
Create(
const ASTContext &C,
1995 SourceLocation StartLoc,
1996 SourceLocation EndLoc,
1997 Stmt *AssociatedStmt,
bool HasCancel);
2003 static OMPSectionDirective *CreateEmpty(
const ASTContext &C, EmptyShell);
2012 return T->getStmtClass() == OMPSectionDirectiveClass;
2032 OMPScopeDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2034 StartLoc, EndLoc) {}
2040 SourceLocation(), SourceLocation()) {}
2050 static OMPScopeDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
2051 SourceLocation EndLoc,
2052 ArrayRef<OMPClause *> Clauses,
2053 Stmt *AssociatedStmt);
2059 static OMPScopeDirective *CreateEmpty(
const ASTContext &C,
2060 unsigned NumClauses, EmptyShell);
2063 return T->getStmtClass() == OMPScopeDirectiveClass;
2083 OMPSingleDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2085 StartLoc, EndLoc) {}
2091 SourceLocation(), SourceLocation()) {}
2102 static OMPSingleDirective *
2103 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2104 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2112 static OMPSingleDirective *CreateEmpty(
const ASTContext &C,
2113 unsigned NumClauses, EmptyShell);
2116 return T->getStmtClass() == OMPSingleDirectiveClass;
2134 OMPMasterDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2136 StartLoc, EndLoc) {}
2142 SourceLocation(), SourceLocation()) {}
2152 static OMPMasterDirective *
Create(
const ASTContext &C,
2153 SourceLocation StartLoc,
2154 SourceLocation EndLoc,
2155 Stmt *AssociatedStmt);
2161 static OMPMasterDirective *CreateEmpty(
const ASTContext &C, EmptyShell);
2164 return T->getStmtClass() == OMPMasterDirectiveClass;
2178 DeclarationNameInfo DirName;
2185 OMPCriticalDirective(
const DeclarationNameInfo &Name, SourceLocation StartLoc,
2186 SourceLocation EndLoc)
2188 llvm::omp::OMPD_critical, StartLoc, EndLoc),
2195 llvm::omp::OMPD_critical, SourceLocation(),
2196 SourceLocation()) {}
2202 void setDirectiveName(
const DeclarationNameInfo &Name) { DirName = Name; }
2214 static OMPCriticalDirective *
2215 Create(
const ASTContext &C,
const DeclarationNameInfo &Name,
2216 SourceLocation StartLoc, SourceLocation EndLoc,
2217 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2224 static OMPCriticalDirective *CreateEmpty(
const ASTContext &C,
2225 unsigned NumClauses, EmptyShell);
2232 return T->getStmtClass() == OMPCriticalDirectiveClass;
2250 bool HasCancel =
false;
2258 OMPParallelForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2259 unsigned CollapsedNum)
2261 llvm::omp::OMPD_parallel_for, StartLoc, EndLoc,
2270 llvm::omp::OMPD_parallel_for, SourceLocation(),
2271 SourceLocation(), CollapsedNum) {}
2274 void setTaskReductionRefExpr(Expr *E) {
2275 Data->getChildren()[numLoopChildren(getLoopsNumber(),
2276 llvm::omp::OMPD_parallel_for)] = E;
2280 void setHasCancel(
bool Has) { HasCancel = Has; }
2296 static OMPParallelForDirective *
2297 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2298 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2299 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
2309 static OMPParallelForDirective *CreateEmpty(
const ASTContext &C,
2310 unsigned NumClauses,
2311 unsigned CollapsedNum,
2317 getLoopsNumber(), llvm::omp::OMPD_parallel_for)]);
2320 return const_cast<OMPParallelForDirective *
>(
this)
2328 return T->getStmtClass() == OMPParallelForDirectiveClass;
2351 OMPParallelForSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2352 unsigned CollapsedNum)
2354 llvm::omp::OMPD_parallel_for_simd, StartLoc, EndLoc,
2363 llvm::omp::OMPD_parallel_for_simd, SourceLocation(),
2364 SourceLocation(), CollapsedNum) {}
2377 static OMPParallelForSimdDirective *
2378 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2379 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2380 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
2389 static OMPParallelForSimdDirective *CreateEmpty(
const ASTContext &C,
2390 unsigned NumClauses,
2391 unsigned CollapsedNum,
2395 return T->getStmtClass() == OMPParallelForSimdDirectiveClass;
2411 OMPParallelMasterDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2413 llvm::omp::OMPD_parallel_master, StartLoc,
2418 llvm::omp::OMPD_parallel_master,
2419 SourceLocation(), SourceLocation()) {}
2422 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2435 static OMPParallelMasterDirective *
2436 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2437 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);
2445 static OMPParallelMasterDirective *
2446 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2450 return cast_or_null<Expr>(Data->getChildren()[0]);
2453 return const_cast<OMPParallelMasterDirective *
>(
this)
2458 return T->getStmtClass() == OMPParallelMasterDirectiveClass;
2474 OMPParallelMaskedDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2476 llvm::omp::OMPD_parallel_masked, StartLoc,
2481 llvm::omp::OMPD_parallel_masked,
2482 SourceLocation(), SourceLocation()) {}
2485 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2498 static OMPParallelMaskedDirective *
2499 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2500 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);
2508 static OMPParallelMaskedDirective *
2509 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2513 return cast_or_null<Expr>(Data->getChildren()[0]);
2516 return const_cast<OMPParallelMaskedDirective *
>(
this)
2521 return T->getStmtClass() == OMPParallelMaskedDirectiveClass;
2539 bool HasCancel =
false;
2546 OMPParallelSectionsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2548 llvm::omp::OMPD_parallel_sections, StartLoc,
2555 llvm::omp::OMPD_parallel_sections,
2556 SourceLocation(), SourceLocation()) {}
2559 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2562 void setHasCancel(
bool Has) { HasCancel = Has; }
2576 static OMPParallelSectionsDirective *
2577 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2578 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
2587 static OMPParallelSectionsDirective *
2588 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2592 return cast_or_null<Expr>(Data->getChildren()[0]);
2595 return const_cast<OMPParallelSectionsDirective *
>(
this)
2603 return T->getStmtClass() == OMPParallelSectionsDirectiveClass;
2619 bool HasCancel =
false;
2626 OMPTaskDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2628 StartLoc, EndLoc) {}
2634 SourceLocation(), SourceLocation()) {}
2637 void setHasCancel(
bool Has) { HasCancel = Has; }
2649 static OMPTaskDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
2650 SourceLocation EndLoc,
2651 ArrayRef<OMPClause *> Clauses,
2652 Stmt *AssociatedStmt,
bool HasCancel);
2660 static OMPTaskDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
2667 return T->getStmtClass() == OMPTaskDirectiveClass;
2685 OMPTaskyieldDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2687 llvm::omp::OMPD_taskyield, StartLoc, EndLoc) {}
2693 llvm::omp::OMPD_taskyield, SourceLocation(),
2694 SourceLocation()) {}
2703 static OMPTaskyieldDirective *
2704 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc);
2710 static OMPTaskyieldDirective *CreateEmpty(
const ASTContext &C, EmptyShell);
2713 return T->getStmtClass() == OMPTaskyieldDirectiveClass;
2731 OMPBarrierDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2733 llvm::omp::OMPD_barrier, StartLoc, EndLoc) {}
2739 llvm::omp::OMPD_barrier, SourceLocation(),
2740 SourceLocation()) {}
2749 static OMPBarrierDirective *
2750 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc);
2756 static OMPBarrierDirective *CreateEmpty(
const ASTContext &C, EmptyShell);
2759 return T->getStmtClass() == OMPBarrierDirectiveClass;
2777 OMPTaskwaitDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2779 llvm::omp::OMPD_taskwait, StartLoc, EndLoc) {}
2785 llvm::omp::OMPD_taskwait, SourceLocation(),
2786 SourceLocation()) {}
2796 static OMPTaskwaitDirective *
Create(
const ASTContext &C,
2797 SourceLocation StartLoc,
2798 SourceLocation EndLoc,
2799 ArrayRef<OMPClause *> Clauses);
2806 static OMPTaskwaitDirective *CreateEmpty(
const ASTContext &C,
2807 unsigned NumClauses, EmptyShell);
2810 return T->getStmtClass() == OMPTaskwaitDirectiveClass;
2828 OMPTaskgroupDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2830 llvm::omp::OMPD_taskgroup, StartLoc, EndLoc) {}
2836 llvm::omp::OMPD_taskgroup, SourceLocation(),
2837 SourceLocation()) {}
2840 void setReductionRef(Expr *RR) {
Data->getChildren()[0] = RR; }
2852 static OMPTaskgroupDirective *
2853 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2854 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2855 Expr *ReductionRef);
2862 static OMPTaskgroupDirective *CreateEmpty(
const ASTContext &C,
2863 unsigned NumClauses, EmptyShell);
2873 return T->getStmtClass() == OMPTaskgroupDirectiveClass;
2895 OMPFlushDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2897 StartLoc, EndLoc) {}
2903 SourceLocation(), SourceLocation()) {}
2914 static OMPFlushDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
2915 SourceLocation EndLoc,
2916 ArrayRef<OMPClause *> Clauses);
2924 static OMPFlushDirective *CreateEmpty(
const ASTContext &C,
2925 unsigned NumClauses, EmptyShell);
2928 return T->getStmtClass() == OMPFlushDirectiveClass;
2948 OMPDepobjDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2950 StartLoc, EndLoc) {}
2956 SourceLocation(), SourceLocation()) {}
2966 static OMPDepobjDirective *
Create(
const ASTContext &C,
2967 SourceLocation StartLoc,
2968 SourceLocation EndLoc,
2969 ArrayRef<OMPClause *> Clauses);
2977 static OMPDepobjDirective *CreateEmpty(
const ASTContext &C,
2978 unsigned NumClauses, EmptyShell);
2981 return T->getStmtClass() == OMPDepobjDirectiveClass;
2999 OMPOrderedStandaloneDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3001 llvm::omp::OMPD_ordered_standalone, StartLoc,
3008 llvm::omp::OMPD_ordered_standalone,
3009 SourceLocation(), SourceLocation()) {}
3019 static OMPOrderedStandaloneDirective *
Create(
const ASTContext &C,
3020 SourceLocation StartLoc,
3021 SourceLocation EndLoc,
3022 ArrayRef<OMPClause *> Clauses);
3029 static OMPOrderedStandaloneDirective *
3030 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
3033 return T->getStmtClass() == OMPOrderedStandaloneDirectiveClass;
3052 OMPOrderedBlockAssocDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3054 llvm::omp::OMPD_ordered_blockassoc, StartLoc,
3061 llvm::omp::OMPD_ordered_blockassoc,
3062 SourceLocation(), SourceLocation()) {}
3073 static OMPOrderedBlockAssocDirective *
3074 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3075 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3082 static OMPOrderedBlockAssocDirective *
3083 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
3086 return T->getStmtClass() == OMPOrderedBlockAssocDirectiveClass;
3111 LLVM_PREFERRED_TYPE(
bool)
3121 LLVM_PREFERRED_TYPE(
bool)
3125 LLVM_PREFERRED_TYPE(
bool)
3136 StartLoc, EndLoc) {}
3140 explicit OMPAtomicDirective()
3141 : OMPExecutableDirective(OMPAtomicDirectiveClass, llvm::omp::OMPD_atomic,
3142 SourceLocation(), SourceLocation()) {}
3144 enum DataPositionTy :
size_t {
3155 void setX(Expr *
X) {
Data->getChildren()[DataPositionTy::POS_X] =
X; }
3159 void setUpdateExpr(Expr *UE) {
3160 Data->getChildren()[DataPositionTy::POS_UpdateExpr] = UE;
3163 void setV(Expr *
V) {
Data->getChildren()[DataPositionTy::POS_V] =
V; }
3165 void setR(Expr *R) {
Data->getChildren()[DataPositionTy::POS_R] =
R; }
3167 void setExpr(Expr *E) {
Data->getChildren()[DataPositionTy::POS_E] = E; }
3169 void setD(Expr *D) {
Data->getChildren()[DataPositionTy::POS_D] = D; }
3171 void setCond(Expr *C) {
Data->getChildren()[DataPositionTy::POS_Cond] =
C; }
3211 SourceLocation StartLoc,
3212 SourceLocation EndLoc,
3223 unsigned NumClauses, EmptyShell);
3227 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_X]);
3230 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_X]);
3236 return cast_or_null<Expr>(
3237 Data->getChildren()[DataPositionTy::POS_UpdateExpr]);
3240 return cast_or_null<Expr>(
3241 Data->getChildren()[DataPositionTy::POS_UpdateExpr]);
3255 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_V]);
3258 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_V]);
3262 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_R]);
3265 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_R]);
3269 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_E]);
3272 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_E]);
3276 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_D]);
3279 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_D]);
3283 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_Cond]);
3286 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_Cond]);
3290 return T->getStmtClass() == OMPAtomicDirectiveClass;
3310 OMPTargetDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3312 StartLoc, EndLoc) {}
3318 SourceLocation(), SourceLocation()) {}
3329 static OMPTargetDirective *
3330 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3331 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3339 static OMPTargetDirective *CreateEmpty(
const ASTContext &C,
3340 unsigned NumClauses, EmptyShell);
3343 return T->getStmtClass() == OMPTargetDirectiveClass;
3364 OMPTargetDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3366 llvm::omp::OMPD_target_data, StartLoc, EndLoc) {}
3372 llvm::omp::OMPD_target_data, SourceLocation(),
3373 SourceLocation()) {}
3384 static OMPTargetDataDirective *
3385 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3386 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3393 static OMPTargetDataDirective *CreateEmpty(
const ASTContext &C,
unsigned N,
3397 return T->getStmtClass() == OMPTargetDataDirectiveClass;
3418 OMPTargetEnterDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3420 llvm::omp::OMPD_target_enter_data, StartLoc,
3427 llvm::omp::OMPD_target_enter_data,
3428 SourceLocation(), SourceLocation()) {}
3439 static OMPTargetEnterDataDirective *
3440 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3441 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3448 static OMPTargetEnterDataDirective *CreateEmpty(
const ASTContext &C,
3449 unsigned N, EmptyShell);
3452 return T->getStmtClass() == OMPTargetEnterDataDirectiveClass;
3473 OMPTargetExitDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3475 llvm::omp::OMPD_target_exit_data, StartLoc,
3482 llvm::omp::OMPD_target_exit_data,
3483 SourceLocation(), SourceLocation()) {}
3494 static OMPTargetExitDataDirective *
3495 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3496 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3503 static OMPTargetExitDataDirective *CreateEmpty(
const ASTContext &C,
3504 unsigned N, EmptyShell);
3507 return T->getStmtClass() == OMPTargetExitDataDirectiveClass;
3523 bool HasCancel =
false;
3530 OMPTargetParallelDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3532 llvm::omp::OMPD_target_parallel, StartLoc,
3539 llvm::omp::OMPD_target_parallel,
3540 SourceLocation(), SourceLocation()) {}
3543 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
3545 void setHasCancel(
bool Has) { HasCancel = Has; }
3559 static OMPTargetParallelDirective *
3560 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3561 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
3570 static OMPTargetParallelDirective *
3571 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
3575 return cast_or_null<Expr>(Data->getChildren()[0]);
3578 return const_cast<OMPTargetParallelDirective *
>(
this)
3586 return T->getStmtClass() == OMPTargetParallelDirectiveClass;
3604 bool HasCancel =
false;
3612 OMPTargetParallelForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3613 unsigned CollapsedNum)
3615 llvm::omp::OMPD_target_parallel_for, StartLoc, EndLoc,
3624 llvm::omp::OMPD_target_parallel_for, SourceLocation(),
3625 SourceLocation(), CollapsedNum) {}
3628 void setTaskReductionRefExpr(Expr *E) {
3629 Data->getChildren()[numLoopChildren(
3630 getLoopsNumber(), llvm::omp::OMPD_target_parallel_for)] = E;
3634 void setHasCancel(
bool Has) { HasCancel = Has; }
3650 static OMPTargetParallelForDirective *
3651 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3652 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3653 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
3663 static OMPTargetParallelForDirective *CreateEmpty(
const ASTContext &C,
3664 unsigned NumClauses,
3665 unsigned CollapsedNum,
3671 getLoopsNumber(), llvm::omp::OMPD_target_parallel_for)]);
3674 return const_cast<OMPTargetParallelForDirective *
>(
this)
3682 return T->getStmtClass() == OMPTargetParallelForDirectiveClass;
3702 OMPTeamsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3704 StartLoc, EndLoc) {}
3710 SourceLocation(), SourceLocation()) {}
3721 static OMPTeamsDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
3722 SourceLocation EndLoc,
3723 ArrayRef<OMPClause *> Clauses,
3724 Stmt *AssociatedStmt);
3732 static OMPTeamsDirective *CreateEmpty(
const ASTContext &C,
3733 unsigned NumClauses, EmptyShell);
3736 return T->getStmtClass() == OMPTeamsDirectiveClass;
3750 OpenMPDirectiveKind CancelRegion = llvm::omp::OMPD_unknown;
3757 OMPCancellationPointDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3759 llvm::omp::OMPD_cancellation_point, StartLoc,
3765 llvm::omp::OMPD_cancellation_point,
3766 SourceLocation(), SourceLocation()) {}
3770 void setCancelRegion(OpenMPDirectiveKind CR) { CancelRegion = CR; }
3779 static OMPCancellationPointDirective *
3780 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3781 OpenMPDirectiveKind CancelRegion);
3787 static OMPCancellationPointDirective *CreateEmpty(
const ASTContext &C,
3794 return T->getStmtClass() == OMPCancellationPointDirectiveClass;
3808 OpenMPDirectiveKind CancelRegion = llvm::omp::OMPD_unknown;
3814 OMPCancelDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3816 StartLoc, EndLoc) {}
3822 SourceLocation(), SourceLocation()) {}
3826 void setCancelRegion(OpenMPDirectiveKind CR) { CancelRegion = CR; }
3836 static OMPCancelDirective *
3837 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3838 ArrayRef<OMPClause *> Clauses, OpenMPDirectiveKind CancelRegion);
3845 static OMPCancelDirective *CreateEmpty(
const ASTContext &C,
3846 unsigned NumClauses, EmptyShell);
3852 return T->getStmtClass() == OMPCancelDirectiveClass;
3869 bool HasCancel =
false;
3877 OMPTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3878 unsigned CollapsedNum)
3880 StartLoc, EndLoc, CollapsedNum) {}
3888 SourceLocation(), SourceLocation(), CollapsedNum) {}
3891 void setHasCancel(
bool Has) { HasCancel = Has; }
3905 static OMPTaskLoopDirective *
3906 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3907 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3908 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
3917 static OMPTaskLoopDirective *CreateEmpty(
const ASTContext &C,
3918 unsigned NumClauses,
3919 unsigned CollapsedNum, EmptyShell);
3925 return T->getStmtClass() == OMPTaskLoopDirectiveClass;
3947 OMPTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3948 unsigned CollapsedNum)
3950 llvm::omp::OMPD_taskloop_simd, StartLoc, EndLoc,
3959 llvm::omp::OMPD_taskloop_simd, SourceLocation(),
3960 SourceLocation(), CollapsedNum) {}
3973 static OMPTaskLoopSimdDirective *
3974 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3975 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3976 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
3985 static OMPTaskLoopSimdDirective *CreateEmpty(
const ASTContext &C,
3986 unsigned NumClauses,
3987 unsigned CollapsedNum,
3991 return T->getStmtClass() == OMPTaskLoopSimdDirectiveClass;
4008 bool HasCancel =
false;
4016 OMPMasterTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4017 unsigned CollapsedNum)
4019 llvm::omp::OMPD_master_taskloop, StartLoc, EndLoc,
4028 llvm::omp::OMPD_master_taskloop, SourceLocation(),
4029 SourceLocation(), CollapsedNum) {}
4032 void setHasCancel(
bool Has) { HasCancel = Has; }
4046 static OMPMasterTaskLoopDirective *
4047 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4048 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4049 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4058 static OMPMasterTaskLoopDirective *CreateEmpty(
const ASTContext &C,
4059 unsigned NumClauses,
4060 unsigned CollapsedNum,
4067 return T->getStmtClass() == OMPMasterTaskLoopDirectiveClass;
4084 bool HasCancel =
false;
4092 OMPMaskedTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4093 unsigned CollapsedNum)
4095 llvm::omp::OMPD_masked_taskloop, StartLoc, EndLoc,
4104 llvm::omp::OMPD_masked_taskloop, SourceLocation(),
4105 SourceLocation(), CollapsedNum) {}
4108 void setHasCancel(
bool Has) { HasCancel = Has; }
4122 static OMPMaskedTaskLoopDirective *
4123 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4124 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4125 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4134 static OMPMaskedTaskLoopDirective *CreateEmpty(
const ASTContext &C,
4135 unsigned NumClauses,
4136 unsigned CollapsedNum,
4143 return T->getStmtClass() == OMPMaskedTaskLoopDirectiveClass;
4165 OMPMasterTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4166 unsigned CollapsedNum)
4168 llvm::omp::OMPD_master_taskloop_simd, StartLoc, EndLoc,
4177 llvm::omp::OMPD_master_taskloop_simd, SourceLocation(),
4178 SourceLocation(), CollapsedNum) {}
4191 static OMPMasterTaskLoopSimdDirective *
4192 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4193 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4194 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4202 static OMPMasterTaskLoopSimdDirective *CreateEmpty(
const ASTContext &C,
4203 unsigned NumClauses,
4204 unsigned CollapsedNum,
4208 return T->getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass;
4230 OMPMaskedTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4231 unsigned CollapsedNum)
4233 llvm::omp::OMPD_masked_taskloop_simd, StartLoc, EndLoc,
4242 llvm::omp::OMPD_masked_taskloop_simd, SourceLocation(),
4243 SourceLocation(), CollapsedNum) {}
4256 static OMPMaskedTaskLoopSimdDirective *
4257 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4258 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4259 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4267 static OMPMaskedTaskLoopSimdDirective *CreateEmpty(
const ASTContext &C,
4268 unsigned NumClauses,
4269 unsigned CollapsedNum,
4273 return T->getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass;
4291 bool HasCancel =
false;
4299 OMPParallelMasterTaskLoopDirective(SourceLocation StartLoc,
4300 SourceLocation EndLoc,
4301 unsigned CollapsedNum)
4303 llvm::omp::OMPD_parallel_master_taskloop, StartLoc,
4304 EndLoc, CollapsedNum) {}
4312 llvm::omp::OMPD_parallel_master_taskloop,
4313 SourceLocation(), SourceLocation(), CollapsedNum) {}
4316 void setHasCancel(
bool Has) { HasCancel = Has; }
4330 static OMPParallelMasterTaskLoopDirective *
4331 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4332 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4333 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4342 static OMPParallelMasterTaskLoopDirective *CreateEmpty(
const ASTContext &C,
4343 unsigned NumClauses,
4344 unsigned CollapsedNum,
4351 return T->getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass;
4369 bool HasCancel =
false;
4377 OMPParallelMaskedTaskLoopDirective(SourceLocation StartLoc,
4378 SourceLocation EndLoc,
4379 unsigned CollapsedNum)
4381 llvm::omp::OMPD_parallel_masked_taskloop, StartLoc,
4382 EndLoc, CollapsedNum) {}
4390 llvm::omp::OMPD_parallel_masked_taskloop,
4391 SourceLocation(), SourceLocation(), CollapsedNum) {}
4394 void setHasCancel(
bool Has) { HasCancel = Has; }
4408 static OMPParallelMaskedTaskLoopDirective *
4409 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4410 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4411 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4420 static OMPParallelMaskedTaskLoopDirective *CreateEmpty(
const ASTContext &C,
4421 unsigned NumClauses,
4422 unsigned CollapsedNum,
4429 return T->getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass;
4452 OMPParallelMasterTaskLoopSimdDirective(SourceLocation StartLoc,
4453 SourceLocation EndLoc,
4454 unsigned CollapsedNum)
4456 llvm::omp::OMPD_parallel_master_taskloop_simd,
4457 StartLoc, EndLoc, CollapsedNum) {}
4465 llvm::omp::OMPD_parallel_master_taskloop_simd,
4466 SourceLocation(), SourceLocation(), CollapsedNum) {}
4479 static OMPParallelMasterTaskLoopSimdDirective *
4480 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4481 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4482 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4491 static OMPParallelMasterTaskLoopSimdDirective *
4492 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4496 return T->getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass;
4519 OMPParallelMaskedTaskLoopSimdDirective(SourceLocation StartLoc,
4520 SourceLocation EndLoc,
4521 unsigned CollapsedNum)
4523 llvm::omp::OMPD_parallel_masked_taskloop_simd,
4524 StartLoc, EndLoc, CollapsedNum) {}
4532 llvm::omp::OMPD_parallel_masked_taskloop_simd,
4533 SourceLocation(), SourceLocation(), CollapsedNum) {}
4546 static OMPParallelMaskedTaskLoopSimdDirective *
4547 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4548 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4549 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4558 static OMPParallelMaskedTaskLoopSimdDirective *
4559 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4563 return T->getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass;
4585 OMPDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4586 unsigned CollapsedNum)
4588 llvm::omp::OMPD_distribute, StartLoc, EndLoc,
4597 llvm::omp::OMPD_distribute, SourceLocation(),
4598 SourceLocation(), CollapsedNum) {}
4611 static OMPDistributeDirective *
4612 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4613 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4614 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4623 static OMPDistributeDirective *CreateEmpty(
const ASTContext &C,
4624 unsigned NumClauses,
4625 unsigned CollapsedNum, EmptyShell);
4628 return T->getStmtClass() == OMPDistributeDirectiveClass;
4649 OMPTargetUpdateDirective(SourceLocation StartLoc, SourceLocation EndLoc)
4651 llvm::omp::OMPD_target_update, StartLoc,
4658 llvm::omp::OMPD_target_update, SourceLocation(),
4659 SourceLocation()) {}
4670 static OMPTargetUpdateDirective *
4671 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4672 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
4680 static OMPTargetUpdateDirective *CreateEmpty(
const ASTContext &C,
4681 unsigned NumClauses, EmptyShell);
4684 return T->getStmtClass() == OMPTargetUpdateDirectiveClass;
4701 bool HasCancel =
false;
4709 OMPDistributeParallelForDirective(SourceLocation StartLoc,
4710 SourceLocation EndLoc,
4711 unsigned CollapsedNum)
4713 llvm::omp::OMPD_distribute_parallel_for, StartLoc,
4714 EndLoc, CollapsedNum) {}
4722 llvm::omp::OMPD_distribute_parallel_for,
4723 SourceLocation(), SourceLocation(), CollapsedNum) {}
4726 void setTaskReductionRefExpr(Expr *E) {
4727 Data->getChildren()[numLoopChildren(
4728 getLoopsNumber(), llvm::omp::OMPD_distribute_parallel_for)] = E;
4732 void setHasCancel(
bool Has) { HasCancel = Has; }
4748 static OMPDistributeParallelForDirective *
4749 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4750 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4751 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
4761 static OMPDistributeParallelForDirective *CreateEmpty(
const ASTContext &C,
4762 unsigned NumClauses,
4763 unsigned CollapsedNum,
4769 getLoopsNumber(), llvm::omp::OMPD_distribute_parallel_for)]);
4772 return const_cast<OMPDistributeParallelForDirective *
>(
this)
4780 return T->getStmtClass() == OMPDistributeParallelForDirectiveClass;
4803 OMPDistributeParallelForSimdDirective(SourceLocation StartLoc,
4804 SourceLocation EndLoc,
4805 unsigned CollapsedNum)
4807 llvm::omp::OMPD_distribute_parallel_for_simd, StartLoc,
4808 EndLoc, CollapsedNum) {}
4816 llvm::omp::OMPD_distribute_parallel_for_simd,
4817 SourceLocation(), SourceLocation(), CollapsedNum) {}
4830 static OMPDistributeParallelForSimdDirective *
Create(
4831 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4832 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4833 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4841 static OMPDistributeParallelForSimdDirective *CreateEmpty(
4842 const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4846 return T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass;
4868 OMPDistributeSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4869 unsigned CollapsedNum)
4871 llvm::omp::OMPD_distribute_simd, StartLoc, EndLoc,
4880 llvm::omp::OMPD_distribute_simd, SourceLocation(),
4881 SourceLocation(), CollapsedNum) {}
4894 static OMPDistributeSimdDirective *
4895 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4896 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4897 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4905 static OMPDistributeSimdDirective *CreateEmpty(
const ASTContext &C,
4906 unsigned NumClauses,
4907 unsigned CollapsedNum,
4911 return T->getStmtClass() == OMPDistributeSimdDirectiveClass;
4934 OMPTargetParallelForSimdDirective(SourceLocation StartLoc,
4935 SourceLocation EndLoc,
4936 unsigned CollapsedNum)
4938 llvm::omp::OMPD_target_parallel_for_simd, StartLoc,
4939 EndLoc, CollapsedNum) {}
4947 llvm::omp::OMPD_target_parallel_for_simd,
4948 SourceLocation(), SourceLocation(), CollapsedNum) {}
4961 static OMPTargetParallelForSimdDirective *
4962 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4963 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4964 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4972 static OMPTargetParallelForSimdDirective *CreateEmpty(
const ASTContext &C,
4973 unsigned NumClauses,
4974 unsigned CollapsedNum,
4978 return T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass;
5001 OMPTargetSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
5002 unsigned CollapsedNum)
5004 llvm::omp::OMPD_target_simd, StartLoc, EndLoc,
5013 llvm::omp::OMPD_target_simd, SourceLocation(),
5014 SourceLocation(), CollapsedNum) {}
5027 static OMPTargetSimdDirective *
5028 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5029 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5030 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5038 static OMPTargetSimdDirective *CreateEmpty(
const ASTContext &C,
5039 unsigned NumClauses,
5040 unsigned CollapsedNum,
5044 return T->getStmtClass() == OMPTargetSimdDirectiveClass;
5066 OMPTeamsDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
5067 unsigned CollapsedNum)
5069 llvm::omp::OMPD_teams_distribute, StartLoc, EndLoc,
5078 llvm::omp::OMPD_teams_distribute, SourceLocation(),
5079 SourceLocation(), CollapsedNum) {}
5092 static OMPTeamsDistributeDirective *
5093 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5094 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5095 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5103 static OMPTeamsDistributeDirective *CreateEmpty(
const ASTContext &C,
5104 unsigned NumClauses,
5105 unsigned CollapsedNum,
5109 return T->getStmtClass() == OMPTeamsDistributeDirectiveClass;
5132 OMPTeamsDistributeSimdDirective(SourceLocation StartLoc,
5133 SourceLocation EndLoc,
unsigned CollapsedNum)
5135 llvm::omp::OMPD_teams_distribute_simd, StartLoc,
5136 EndLoc, CollapsedNum) {}
5144 llvm::omp::OMPD_teams_distribute_simd,
5145 SourceLocation(), SourceLocation(), CollapsedNum) {}
5158 static OMPTeamsDistributeSimdDirective *
5159 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5160 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5161 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5170 static OMPTeamsDistributeSimdDirective *CreateEmpty(
const ASTContext &C,
5171 unsigned NumClauses,
5172 unsigned CollapsedNum,
5176 return T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass;
5189class OMPTeamsDistributeParallelForSimdDirective final
5200 OMPTeamsDistributeParallelForSimdDirective(SourceLocation StartLoc,
5201 SourceLocation EndLoc,
5202 unsigned CollapsedNum)
5204 llvm::omp::OMPD_teams_distribute_parallel_for_simd,
5205 StartLoc, EndLoc, CollapsedNum) {}
5213 llvm::omp::OMPD_teams_distribute_parallel_for_simd,
5214 SourceLocation(), SourceLocation(), CollapsedNum) {}
5227 static OMPTeamsDistributeParallelForSimdDirective *
5228 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5229 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5230 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5238 static OMPTeamsDistributeParallelForSimdDirective *
5239 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5243 return T->getStmtClass() == OMPTeamsDistributeParallelForSimdDirectiveClass;
5260 bool HasCancel =
false;
5268 OMPTeamsDistributeParallelForDirective(SourceLocation StartLoc,
5269 SourceLocation EndLoc,
5270 unsigned CollapsedNum)
5272 llvm::omp::OMPD_teams_distribute_parallel_for,
5273 StartLoc, EndLoc, CollapsedNum) {}
5281 llvm::omp::OMPD_teams_distribute_parallel_for,
5282 SourceLocation(), SourceLocation(), CollapsedNum) {}
5285 void setTaskReductionRefExpr(Expr *E) {
5286 Data->getChildren()[numLoopChildren(
5287 getLoopsNumber(), llvm::omp::OMPD_teams_distribute_parallel_for)] = E;
5291 void setHasCancel(
bool Has) { HasCancel = Has; }
5307 static OMPTeamsDistributeParallelForDirective *
5308 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5309 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5310 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
5319 static OMPTeamsDistributeParallelForDirective *
5320 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5326 getLoopsNumber(), llvm::omp::OMPD_teams_distribute_parallel_for)]);
5329 return const_cast<OMPTeamsDistributeParallelForDirective *
>(
this)
5337 return T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass;
5357 OMPTargetTeamsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
5359 llvm::omp::OMPD_target_teams, StartLoc, EndLoc) {
5366 llvm::omp::OMPD_target_teams, SourceLocation(),
5367 SourceLocation()) {}
5378 static OMPTargetTeamsDirective *
Create(
const ASTContext &C,
5379 SourceLocation StartLoc,
5380 SourceLocation EndLoc,
5381 ArrayRef<OMPClause *> Clauses,
5382 Stmt *AssociatedStmt);
5389 static OMPTargetTeamsDirective *CreateEmpty(
const ASTContext &C,
5390 unsigned NumClauses, EmptyShell);
5393 return T->getStmtClass() == OMPTargetTeamsDirectiveClass;
5415 OMPTargetTeamsDistributeDirective(SourceLocation StartLoc,
5416 SourceLocation EndLoc,
5417 unsigned CollapsedNum)
5419 llvm::omp::OMPD_target_teams_distribute, StartLoc,
5420 EndLoc, CollapsedNum) {}
5428 llvm::omp::OMPD_target_teams_distribute,
5429 SourceLocation(), SourceLocation(), CollapsedNum) {}
5442 static OMPTargetTeamsDistributeDirective *
5443 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5444 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5445 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5453 static OMPTargetTeamsDistributeDirective *
5454 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5458 return T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass;
5471class OMPTargetTeamsDistributeParallelForDirective final
5476 bool HasCancel =
false;
5484 OMPTargetTeamsDistributeParallelForDirective(SourceLocation StartLoc,
5485 SourceLocation EndLoc,
5486 unsigned CollapsedNum)
5488 llvm::omp::OMPD_target_teams_distribute_parallel_for,
5489 StartLoc, EndLoc, CollapsedNum) {}
5497 llvm::omp::OMPD_target_teams_distribute_parallel_for,
5498 SourceLocation(), SourceLocation(), CollapsedNum) {}
5501 void setTaskReductionRefExpr(Expr *E) {
5502 Data->getChildren()[numLoopChildren(
5504 llvm::omp::OMPD_target_teams_distribute_parallel_for)] = E;
5508 void setHasCancel(
bool Has) { HasCancel = Has; }
5524 static OMPTargetTeamsDistributeParallelForDirective *
5525 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5526 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5527 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
5536 static OMPTargetTeamsDistributeParallelForDirective *
5537 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5544 llvm::omp::OMPD_target_teams_distribute_parallel_for)]);
5547 return const_cast<OMPTargetTeamsDistributeParallelForDirective *
>(
this)
5555 return T->getStmtClass() ==
5556 OMPTargetTeamsDistributeParallelForDirectiveClass;
5569class OMPTargetTeamsDistributeParallelForSimdDirective final
5580 OMPTargetTeamsDistributeParallelForSimdDirective(SourceLocation StartLoc,
5581 SourceLocation EndLoc,
5582 unsigned CollapsedNum)
5584 OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
5585 llvm::omp::OMPD_target_teams_distribute_parallel_for_simd, StartLoc,
5586 EndLoc, CollapsedNum) {}
5593 unsigned CollapsedNum)
5595 OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
5596 llvm::omp::OMPD_target_teams_distribute_parallel_for_simd,
5597 SourceLocation(), SourceLocation(), CollapsedNum) {}
5610 static OMPTargetTeamsDistributeParallelForSimdDirective *
5611 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5612 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5613 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5621 static OMPTargetTeamsDistributeParallelForSimdDirective *
5622 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5626 return T->getStmtClass() ==
5627 OMPTargetTeamsDistributeParallelForSimdDirectiveClass;
5650 OMPTargetTeamsDistributeSimdDirective(SourceLocation StartLoc,
5651 SourceLocation EndLoc,
5652 unsigned CollapsedNum)
5654 llvm::omp::OMPD_target_teams_distribute_simd, StartLoc,
5655 EndLoc, CollapsedNum) {}
5663 llvm::omp::OMPD_target_teams_distribute_simd,
5664 SourceLocation(), SourceLocation(), CollapsedNum) {}
5677 static OMPTargetTeamsDistributeSimdDirective *
5678 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5679 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5680 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5688 static OMPTargetTeamsDistributeSimdDirective *
5689 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5693 return T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
5698class OMPTileDirective final
5706 TransformedStmtOffset,
5712 OMPTileDirectiveClass,
llvm::omp::OMPD_tile, StartLoc, EndLoc,
5715 void setPreInits(Stmt *PreInits) {
5716 Data->getChildren()[PreInitsOffset] = PreInits;
5719 void setTransformedStmt(Stmt *S) {
5720 Data->getChildren()[TransformedStmtOffset] = S;
5736 static OMPTileDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
5737 SourceLocation EndLoc,
5738 ArrayRef<OMPClause *> Clauses,
5739 unsigned NumLoops, Stmt *AssociatedStmt,
5740 Stmt *TransformedStmt, Stmt *PreInits);
5747 static OMPTileDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
5762 return Data->getChildren()[TransformedStmtOffset];
5766 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5769 return T->getStmtClass() == OMPTileDirectiveClass;
5774class OMPStripeDirective final
5782 TransformedStmtOffset,
5788 OMPStripeDirectiveClass,
llvm::omp::OMPD_stripe, StartLoc, EndLoc,
5791 void setPreInits(Stmt *PreInits) {
5792 Data->getChildren()[PreInitsOffset] = PreInits;
5795 void setTransformedStmt(Stmt *S) {
5796 Data->getChildren()[TransformedStmtOffset] = S;
5812 static OMPStripeDirective *
5813 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5814 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
5815 Stmt *TransformedStmt, Stmt *PreInits);
5822 static OMPStripeDirective *
5823 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned NumLoops);
5836 return Data->getChildren()[TransformedStmtOffset];
5840 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5843 return T->getStmtClass() == OMPStripeDirectiveClass;
5853class OMPUnrollDirective final
5861 TransformedStmtOffset,
5866 llvm::omp::OMPD_unroll,
5867 StartLoc, EndLoc, 1) {}
5870 void setPreInits(Stmt *PreInits) {
5871 Data->getChildren()[PreInitsOffset] = PreInits;
5875 void setTransformedStmt(Stmt *S) {
5876 Data->getChildren()[TransformedStmtOffset] = S;
5890 static OMPUnrollDirective *
5891 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5892 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
5893 unsigned NumGeneratedTopLevelLoops, Stmt *TransformedStmt,
5900 static OMPUnrollDirective *CreateEmpty(
const ASTContext &C,
5901 unsigned NumClauses);
5911 return Data->getChildren()[TransformedStmtOffset];
5915 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5918 return T->getStmtClass() == OMPUnrollDirectiveClass;
5929class OMPReverseDirective final
5937 TransformedStmtOffset,
5943 OMPReverseDirectiveClass,
llvm::omp::OMPD_reverse, StartLoc, EndLoc,
5946 void setPreInits(Stmt *PreInits) {
5947 Data->getChildren()[PreInitsOffset] = PreInits;
5950 void setTransformedStmt(Stmt *S) {
5951 Data->getChildren()[TransformedStmtOffset] = S;
5965 static OMPReverseDirective *
Create(
const ASTContext &C,
5966 SourceLocation StartLoc,
5967 SourceLocation EndLoc,
5968 Stmt *AssociatedStmt,
unsigned NumLoops,
5969 Stmt *TransformedStmt, Stmt *PreInits);
5975 static OMPReverseDirective *CreateEmpty(
const ASTContext &C,
5981 return Data->getChildren()[TransformedStmtOffset];
5985 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5988 return T->getStmtClass() == OMPReverseDirectiveClass;
6000class OMPInterchangeDirective final
6008 TransformedStmtOffset,
6012 SourceLocation EndLoc,
unsigned NumLoops)
6014 OMPInterchangeDirectiveClass,
llvm::omp::OMPD_interchange, StartLoc,
6015 EndLoc, NumLoops) {}
6017 void setPreInits(Stmt *PreInits) {
6018 Data->getChildren()[PreInitsOffset] = PreInits;
6021 void setTransformedStmt(Stmt *S) {
6022 Data->getChildren()[TransformedStmtOffset] = S;
6038 static OMPInterchangeDirective *
6039 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6040 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
6041 Stmt *TransformedStmt, Stmt *PreInits);
6048 static OMPInterchangeDirective *
6049 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned NumLoops);
6054 return Data->getChildren()[TransformedStmtOffset];
6058 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6061 return T->getStmtClass() == OMPInterchangeDirectiveClass;
6073class OMPFlattenDirective final
6081 TransformedStmtOffset,
6088 OMPFlattenDirectiveClass,
llvm::omp::OMPD_flatten, StartLoc, EndLoc,
6091 void setPreInits(Stmt *PreInits) {
6092 Data->getChildren()[PreInitsOffset] = PreInits;
6095 void setTransformedStmt(Stmt *S) {
6096 Data->getChildren()[TransformedStmtOffset] = S;
6099 void setFinals(Stmt *S) {
Data->getChildren()[FinalsOffset] = S; }
6115 static OMPFlattenDirective *
6116 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6117 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
6118 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals);
6125 static OMPFlattenDirective *
6126 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned NumLoops);
6131 return Data->getChildren()[TransformedStmtOffset];
6135 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6138 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
6141 return T->getStmtClass() == OMPFlattenDirectiveClass;
6154 StmtClass SC, OpenMPDirectiveKind Kind, SourceLocation StartLoc,
6155 SourceLocation EndLoc)
6165 Stmt *getTransformedStmt()
const;
6168 Stmt *getPreInits()
const;
6171 Stmt::StmtClass C = T->getStmtClass();
6172 return C == OMPFuseDirectiveClass;
6186class OMPFuseDirective final
6194 TransformedStmtOffset,
6199 OMPFuseDirectiveClass,
llvm::omp::OMPD_fuse, StartLoc, EndLoc) {}
6201 void setPreInits(Stmt *PreInits) {
6202 Data->getChildren()[PreInitsOffset] = PreInits;
6205 void setTransformedStmt(Stmt *S) {
6206 Data->getChildren()[TransformedStmtOffset] = S;
6224 static OMPFuseDirective *
6225 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6226 ArrayRef<OMPClause *> Clauses,
unsigned NumGeneratedTopLevelLoops,
6227 Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits);
6234 static OMPFuseDirective *CreateEmpty(
const ASTContext &C,
6235 unsigned NumClauses);
6240 return Data->getChildren()[TransformedStmtOffset];
6244 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6247 return T->getStmtClass() == OMPFuseDirectiveClass;
6263class OMPSplitDirective final
6271 TransformedStmtOffset,
6277 OMPSplitDirectiveClass,
llvm::omp::OMPD_split, StartLoc, EndLoc,
6280 void setPreInits(Stmt *PreInits) {
6281 Data->getChildren()[PreInitsOffset] = PreInits;
6284 void setTransformedStmt(Stmt *S) {
6285 Data->getChildren()[TransformedStmtOffset] = S;
6301 static OMPSplitDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
6302 SourceLocation EndLoc,
6303 ArrayRef<OMPClause *> Clauses,
6304 unsigned NumLoops, Stmt *AssociatedStmt,
6305 Stmt *TransformedStmt, Stmt *PreInits);
6312 static OMPSplitDirective *CreateEmpty(
const ASTContext &C,
6313 unsigned NumClauses,
unsigned NumLoops);
6318 return Data->getChildren()[TransformedStmtOffset];
6322 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6325 return T->getStmtClass() == OMPSplitDirectiveClass;
6344 OMPScanDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6346 StartLoc, EndLoc) {}
6352 SourceLocation(), SourceLocation()) {}
6363 static OMPScanDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
6364 SourceLocation EndLoc,
6365 ArrayRef<OMPClause *> Clauses);
6373 static OMPScanDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
6377 return T->getStmtClass() == OMPScanDirectiveClass;
6398 OMPInteropDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6400 llvm::omp::OMPD_interop, StartLoc, EndLoc) {}
6406 llvm::omp::OMPD_interop, SourceLocation(),
6407 SourceLocation()) {}
6417 static OMPInteropDirective *
Create(
const ASTContext &C,
6418 SourceLocation StartLoc,
6419 SourceLocation EndLoc,
6420 ArrayRef<OMPClause *> Clauses);
6426 static OMPInteropDirective *CreateEmpty(
const ASTContext &C,
6427 unsigned NumClauses, EmptyShell);
6430 return T->getStmtClass() == OMPInteropDirectiveClass;
6447 SourceLocation TargetCallLoc;
6450 void setTargetCallLoc(SourceLocation Loc) { TargetCallLoc = Loc; }
6459 llvm::omp::OMPD_dispatch, StartLoc, EndLoc) {}
6463 explicit OMPDispatchDirective()
6464 : OMPExecutableDirective(OMPDispatchDirectiveClass,
6465 llvm::omp::OMPD_dispatch, SourceLocation(),
6466 SourceLocation()) {}
6478 static OMPDispatchDirective *
6479 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6480 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
6481 SourceLocation TargetCallLoc);
6489 static OMPDispatchDirective *CreateEmpty(
const ASTContext &C,
6490 unsigned NumClauses, EmptyShell);
6496 return T->getStmtClass() == OMPDispatchDirectiveClass;
6516 OMPMaskedDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6518 StartLoc, EndLoc) {}
6524 SourceLocation(), SourceLocation()) {}
6534 static OMPMaskedDirective *
6535 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6536 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
6542 static OMPMaskedDirective *CreateEmpty(
const ASTContext &C,
6543 unsigned NumClauses, EmptyShell);
6546 return T->getStmtClass() == OMPMaskedDirectiveClass;
6563 OMPMetaDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6565 llvm::omp::OMPD_metadirective, StartLoc,
6569 llvm::omp::OMPD_metadirective, SourceLocation(),
6570 SourceLocation()) {}
6572 void setIfStmt(Stmt *S) { IfStmt = S; }
6575 static OMPMetaDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
6576 SourceLocation EndLoc,
6577 ArrayRef<OMPClause *> Clauses,
6578 Stmt *AssociatedStmt, Stmt *IfStmt);
6579 static OMPMetaDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
6584 return T->getStmtClass() == OMPMetaDirectiveClass;
6606 OMPGenericLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
6607 unsigned CollapsedNum)
6609 StartLoc, EndLoc, CollapsedNum) {}
6617 SourceLocation(), SourceLocation(), CollapsedNum) {}
6630 static OMPGenericLoopDirective *
6631 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6632 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6633 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6641 static OMPGenericLoopDirective *CreateEmpty(
const ASTContext &C,
6642 unsigned NumClauses,
6643 unsigned CollapsedNum,
6647 return T->getStmtClass() == OMPGenericLoopDirectiveClass;
6668 OMPTeamsGenericLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
6669 unsigned CollapsedNum)
6671 llvm::omp::OMPD_teams_loop, StartLoc, EndLoc,
6680 llvm::omp::OMPD_teams_loop, SourceLocation(),
6681 SourceLocation(), CollapsedNum) {}
6694 static OMPTeamsGenericLoopDirective *
6695 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6696 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6697 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6706 static OMPTeamsGenericLoopDirective *CreateEmpty(
const ASTContext &C,
6707 unsigned NumClauses,
6708 unsigned CollapsedNum,
6712 return T->getStmtClass() == OMPTeamsGenericLoopDirectiveClass;
6728 bool CanBeParallelFor =
false;
6735 OMPTargetTeamsGenericLoopDirective(SourceLocation StartLoc,
6736 SourceLocation EndLoc,
6737 unsigned CollapsedNum)
6739 llvm::omp::OMPD_target_teams_loop, StartLoc, EndLoc,
6748 llvm::omp::OMPD_target_teams_loop, SourceLocation(),
6749 SourceLocation(), CollapsedNum) {}
6752 void setCanBeParallelFor(
bool ParFor) { CanBeParallelFor = ParFor; }
6765 static OMPTargetTeamsGenericLoopDirective *
6766 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6767 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6768 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool CanBeParallelFor);
6777 static OMPTargetTeamsGenericLoopDirective *CreateEmpty(
const ASTContext &C,
6778 unsigned NumClauses,
6779 unsigned CollapsedNum,
6787 return T->getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass;
6808 OMPParallelGenericLoopDirective(SourceLocation StartLoc,
6809 SourceLocation EndLoc,
unsigned CollapsedNum)
6811 llvm::omp::OMPD_parallel_loop, StartLoc, EndLoc,
6820 llvm::omp::OMPD_parallel_loop, SourceLocation(),
6821 SourceLocation(), CollapsedNum) {}
6834 static OMPParallelGenericLoopDirective *
6835 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6836 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6837 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6846 static OMPParallelGenericLoopDirective *CreateEmpty(
const ASTContext &C,
6847 unsigned NumClauses,
6848 unsigned CollapsedNum,
6852 return T->getStmtClass() == OMPParallelGenericLoopDirectiveClass;
6873 OMPTargetParallelGenericLoopDirective(SourceLocation StartLoc,
6874 SourceLocation EndLoc,
6875 unsigned CollapsedNum)
6877 llvm::omp::OMPD_target_parallel_loop, StartLoc, EndLoc,
6886 llvm::omp::OMPD_target_parallel_loop, SourceLocation(),
6887 SourceLocation(), CollapsedNum) {}
6900 static OMPTargetParallelGenericLoopDirective *
6901 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6902 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6903 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6912 static OMPTargetParallelGenericLoopDirective *
6913 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
6917 return T->getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass;
6934 OMPErrorDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6936 StartLoc, EndLoc) {}
6941 SourceLocation(), SourceLocation()) {}
6950 static OMPErrorDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
6951 SourceLocation EndLoc,
6952 ArrayRef<OMPClause *> Clauses);
6958 static OMPErrorDirective *CreateEmpty(
const ASTContext &C,
6959 unsigned NumClauses, EmptyShell);
6962 return T->getStmtClass() == OMPErrorDirectiveClass;
6973 OMPAssumeDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6975 StartLoc, EndLoc) {}
6979 SourceLocation(), SourceLocation()) {}
6982 static OMPAssumeDirective *
Create(
const ASTContext &Ctx,
6983 SourceLocation StartLoc,
6984 SourceLocation EndLoc,
6985 ArrayRef<OMPClause *> Clauses, Stmt *AStmt);
6987 static OMPAssumeDirective *CreateEmpty(
const ASTContext &C,
6988 unsigned NumClauses, EmptyShell);
6991 return T->getStmtClass() == OMPAssumeDirectiveClass;
7006 clang::OMPLoopTransformationDirective *, clang::Stmt *,
7007 CastInfo<clang::OMPLoopTransformationDirective, clang::Stmt *>> {
7009 return clang::OMPLoopTransformationDirective::classof(T);
7014 dyn_cast<clang::OMPCanonicalLoopNestTransformationDirective>(T))
7015 return static_cast<clang::OMPLoopTransformationDirective *
>(D);
7017 dyn_cast<clang::OMPCanonicalLoopSequenceTransformationDirective>(T))
7018 return static_cast<clang::OMPLoopTransformationDirective *
>(D);
7019 llvm_unreachable(
"unexpected type");
7025 clang::OMPLoopTransformationDirective, const clang::Stmt *,
7026 CastInfo<clang::OMPLoopTransformationDirective, clang::Stmt *>> {};
Defines the clang::ASTContext interface.
clang::CharUnits operator*(clang::CharUnits::QuantityType Scale, 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
Represents the 'pragma omp flatten' loop transformation directive.
static bool classof(const Stmt *T)
Stmt * getPreInits() const
Return preinits statement.
friend class OMPExecutableDirective
Stmt * getTransformedStmt() const
Gets the flattened loop after the transformation.
friend class ASTStmtReader
Stmt * getFinals() const
Return updates to the original loop variables after the flattened loop.
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
Stmt Stmt llvm::function_ref< void(OMPLoopTransformationDirective *)> bool RelaxNestForPeeledTransformation
static bool classof(const OMPClause *T)
void setFinals(ArrayRef< Expr * > FL)
Sets the list of final update expressions for linear variables.
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, bool RelaxNestForPeeledTransformation=false)
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.
__builtin_bitreverse32 uint32_t __builtin_riscv_aaddu_u32 __builtin_riscv_asubu_u32 __builtin_elementwise_add_sat __builtin_elementwise_sub_sat int32_t uint32_t uint32_t __builtin_riscv_mhacc_i32 __builtin_riscv_mhaccu_u32 __builtin_riscv_mhaccsu_i32 __builtin_riscv_mulq_i32 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.