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;
1060 Stmt *getFinals()
const;
1076 StmtClass SC, OpenMPDirectiveKind Kind, SourceLocation StartLoc,
1077 SourceLocation EndLoc,
unsigned NumAssociatedLoops)
1090 Stmt *getTransformedStmt()
const;
1093 Stmt *getPreInits()
const;
1097 Stmt *getFinals()
const;
1100 Stmt::StmtClass C = T->getStmtClass();
1101 return C == OMPTileDirectiveClass || C == OMPUnrollDirectiveClass ||
1102 C == OMPReverseDirectiveClass || C == OMPInterchangeDirectiveClass ||
1103 C == OMPStripeDirectiveClass || C == OMPFlattenDirectiveClass;
1130 IterationVariableOffset = 0,
1131 LastIterationOffset = 1,
1132 CalcLastIterationOffset = 2,
1133 PreConditionOffset = 3,
1144 IsLastIterVariableOffset = 8,
1145 LowerBoundVariableOffset = 9,
1146 UpperBoundVariableOffset = 10,
1147 StrideVariableOffset = 11,
1148 EnsureUpperBoundOffset = 12,
1149 NextLowerBoundOffset = 13,
1150 NextUpperBoundOffset = 14,
1151 NumIterationsOffset = 15,
1153 WorksharingEnd = 16,
1154 PrevLowerBoundVariableOffset = 16,
1155 PrevUpperBoundVariableOffset = 17,
1157 PrevEnsureUpperBoundOffset = 19,
1158 CombinedLowerBoundVariableOffset = 20,
1159 CombinedUpperBoundVariableOffset = 21,
1160 CombinedEnsureUpperBoundOffset = 22,
1161 CombinedInitOffset = 23,
1162 CombinedConditionOffset = 24,
1163 CombinedNextLowerBoundOffset = 25,
1164 CombinedNextUpperBoundOffset = 26,
1165 CombinedDistConditionOffset = 27,
1166 CombinedParForInDistConditionOffset = 28,
1170 CombinedDistributeEnd = 29,
1174 MutableArrayRef<Expr *> getCounters() {
1175 auto **Storage =
reinterpret_cast<Expr **
>(
1176 &Data->getChildren()[getArraysOffset(getDirectiveKind())]);
1177 return {Storage, getLoopsNumber()};
1181 MutableArrayRef<Expr *> getPrivateCounters() {
1182 auto **
Storage =
reinterpret_cast<Expr **
>(
1183 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1185 return {
Storage, getLoopsNumber()};
1189 MutableArrayRef<Expr *>
getInits() {
1190 auto **
Storage =
reinterpret_cast<Expr **
>(
1191 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1192 2 * getLoopsNumber()]);
1193 return {
Storage, getLoopsNumber()};
1198 auto **
Storage =
reinterpret_cast<Expr **
>(
1199 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1200 3 * getLoopsNumber()]);
1201 return {
Storage, getLoopsNumber()};
1206 auto **
Storage =
reinterpret_cast<Expr **
>(
1207 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1208 4 * getLoopsNumber()]);
1209 return {
Storage, getLoopsNumber()};
1213 MutableArrayRef<Expr *> getDependentCounters() {
1214 auto **
Storage =
reinterpret_cast<Expr **
>(
1215 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1216 5 * getLoopsNumber()]);
1217 return {
Storage, getLoopsNumber()};
1221 MutableArrayRef<Expr *> getDependentInits() {
1222 auto **
Storage =
reinterpret_cast<Expr **
>(
1223 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1224 6 * getLoopsNumber()]);
1225 return {
Storage, getLoopsNumber()};
1229 MutableArrayRef<Expr *> getFinalsConditions() {
1230 auto **
Storage =
reinterpret_cast<Expr **
>(
1231 &
Data->getChildren()[getArraysOffset(getDirectiveKind()) +
1232 7 * getLoopsNumber()]);
1233 return {
Storage, getLoopsNumber()};
1246 SourceLocation StartLoc, SourceLocation EndLoc,
1247 unsigned CollapsedNum)
1252 if (isOpenMPLoopBoundSharingDirective(Kind))
1253 return CombinedDistributeEnd;
1254 if (isOpenMPWorksharingDirective(Kind) || isOpenMPTaskLoopDirective(Kind) ||
1255 isOpenMPGenericLoopDirective(Kind) || isOpenMPDistributeDirective(Kind))
1256 return WorksharingEnd;
1262 OpenMPDirectiveKind Kind) {
1270 Data->getChildren()[IterationVariableOffset] = IV;
1273 Data->getChildren()[LastIterationOffset] = LI;
1276 Data->getChildren()[CalcLastIterationOffset] = CLI;
1278 void setPreCond(Expr *PC) { Data->getChildren()[PreConditionOffset] = PC; }
1279 void setCond(Expr *Cond) { Data->getChildren()[CondOffset] = Cond; }
1280 void setInit(Expr *Init) { Data->getChildren()[InitOffset] = Init; }
1281 void setInc(Expr *Inc) { Data->getChildren()[IncOffset] = Inc; }
1283 Data->getChildren()[PreInitsOffset] = PreInits;
1286 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1287 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1288 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1289 isOpenMPDistributeDirective(getDirectiveKind())) &&
1290 "expected worksharing loop directive");
1291 Data->getChildren()[IsLastIterVariableOffset] = IL;
1294 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1295 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1296 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1297 isOpenMPDistributeDirective(getDirectiveKind())) &&
1298 "expected worksharing loop directive");
1299 Data->getChildren()[LowerBoundVariableOffset] = LB;
1302 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1303 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1304 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1305 isOpenMPDistributeDirective(getDirectiveKind())) &&
1306 "expected worksharing loop directive");
1307 Data->getChildren()[UpperBoundVariableOffset] = UB;
1310 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1311 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1312 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1313 isOpenMPDistributeDirective(getDirectiveKind())) &&
1314 "expected worksharing loop directive");
1315 Data->getChildren()[StrideVariableOffset] = ST;
1318 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1319 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1320 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1321 isOpenMPDistributeDirective(getDirectiveKind())) &&
1322 "expected worksharing loop directive");
1323 Data->getChildren()[EnsureUpperBoundOffset] = EUB;
1326 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1327 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1328 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1329 isOpenMPDistributeDirective(getDirectiveKind())) &&
1330 "expected worksharing loop directive");
1331 Data->getChildren()[NextLowerBoundOffset] = NLB;
1334 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1335 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1336 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1337 isOpenMPDistributeDirective(getDirectiveKind())) &&
1338 "expected worksharing loop directive");
1339 Data->getChildren()[NextUpperBoundOffset] = NUB;
1342 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1343 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1344 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1345 isOpenMPDistributeDirective(getDirectiveKind())) &&
1346 "expected worksharing loop directive");
1347 Data->getChildren()[NumIterationsOffset] = NI;
1350 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1351 "expected loop bound sharing directive");
1352 Data->getChildren()[PrevLowerBoundVariableOffset] = PrevLB;
1355 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1356 "expected loop bound sharing directive");
1357 Data->getChildren()[PrevUpperBoundVariableOffset] = PrevUB;
1360 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1361 "expected loop bound sharing directive");
1362 Data->getChildren()[DistIncOffset] = DistInc;
1365 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1366 "expected loop bound sharing directive");
1367 Data->getChildren()[PrevEnsureUpperBoundOffset] = PrevEUB;
1370 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1371 "expected loop bound sharing directive");
1372 Data->getChildren()[CombinedLowerBoundVariableOffset] = CombLB;
1375 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1376 "expected loop bound sharing directive");
1377 Data->getChildren()[CombinedUpperBoundVariableOffset] = CombUB;
1380 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1381 "expected loop bound sharing directive");
1382 Data->getChildren()[CombinedEnsureUpperBoundOffset] = CombEUB;
1385 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1386 "expected loop bound sharing directive");
1387 Data->getChildren()[CombinedInitOffset] = CombInit;
1390 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1391 "expected loop bound sharing directive");
1392 Data->getChildren()[CombinedConditionOffset] = CombCond;
1395 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1396 "expected loop bound sharing directive");
1397 Data->getChildren()[CombinedNextLowerBoundOffset] = CombNLB;
1400 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1401 "expected loop bound sharing directive");
1402 Data->getChildren()[CombinedNextUpperBoundOffset] = CombNUB;
1405 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1406 "expected loop bound distribute sharing directive");
1407 Data->getChildren()[CombinedDistConditionOffset] = CombDistCond;
1410 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1411 "expected loop bound distribute sharing directive");
1412 Data->getChildren()[CombinedParForInDistConditionOffset] =
1413 CombParForInDistCond;
1424 void setHelperExprs(
const HelperExprs &Exprs);
1428 return cast<Expr>(Data->getChildren()[IterationVariableOffset]);
1431 return cast<Expr>(Data->getChildren()[LastIterationOffset]);
1434 return cast<Expr>(Data->getChildren()[CalcLastIterationOffset]);
1437 return cast<Expr>(Data->getChildren()[PreConditionOffset]);
1439 Expr *
getCond()
const {
return cast<Expr>(Data->getChildren()[CondOffset]); }
1440 Expr *
getInit()
const {
return cast<Expr>(Data->getChildren()[InitOffset]); }
1441 Expr *
getInc()
const {
return cast<Expr>(Data->getChildren()[IncOffset]); }
1443 return Data->getChildren()[PreInitsOffset];
1447 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1448 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1449 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1450 isOpenMPDistributeDirective(getDirectiveKind())) &&
1451 "expected worksharing loop directive");
1452 return cast<Expr>(Data->getChildren()[IsLastIterVariableOffset]);
1455 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1456 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1457 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1458 isOpenMPDistributeDirective(getDirectiveKind())) &&
1459 "expected worksharing loop directive");
1460 return cast<Expr>(Data->getChildren()[LowerBoundVariableOffset]);
1463 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1464 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1465 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1466 isOpenMPDistributeDirective(getDirectiveKind())) &&
1467 "expected worksharing loop directive");
1468 return cast<Expr>(Data->getChildren()[UpperBoundVariableOffset]);
1471 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1472 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1473 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1474 isOpenMPDistributeDirective(getDirectiveKind())) &&
1475 "expected worksharing loop directive");
1476 return cast<Expr>(Data->getChildren()[StrideVariableOffset]);
1479 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1480 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1481 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1482 isOpenMPDistributeDirective(getDirectiveKind())) &&
1483 "expected worksharing loop directive");
1484 return cast<Expr>(Data->getChildren()[EnsureUpperBoundOffset]);
1487 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1488 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1489 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1490 isOpenMPDistributeDirective(getDirectiveKind())) &&
1491 "expected worksharing loop directive");
1492 return cast<Expr>(Data->getChildren()[NextLowerBoundOffset]);
1495 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1496 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1497 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1498 isOpenMPDistributeDirective(getDirectiveKind())) &&
1499 "expected worksharing loop directive");
1500 return cast<Expr>(Data->getChildren()[NextUpperBoundOffset]);
1503 assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
1504 isOpenMPGenericLoopDirective(getDirectiveKind()) ||
1505 isOpenMPTaskLoopDirective(getDirectiveKind()) ||
1506 isOpenMPDistributeDirective(getDirectiveKind())) &&
1507 "expected worksharing loop directive");
1508 return cast<Expr>(Data->getChildren()[NumIterationsOffset]);
1511 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1512 "expected loop bound sharing directive");
1513 return cast<Expr>(Data->getChildren()[PrevLowerBoundVariableOffset]);
1516 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1517 "expected loop bound sharing directive");
1518 return cast<Expr>(Data->getChildren()[PrevUpperBoundVariableOffset]);
1521 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1522 "expected loop bound sharing directive");
1523 return cast<Expr>(Data->getChildren()[DistIncOffset]);
1526 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1527 "expected loop bound sharing directive");
1528 return cast<Expr>(Data->getChildren()[PrevEnsureUpperBoundOffset]);
1531 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1532 "expected loop bound sharing directive");
1533 return cast<Expr>(Data->getChildren()[CombinedLowerBoundVariableOffset]);
1536 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1537 "expected loop bound sharing directive");
1538 return cast<Expr>(Data->getChildren()[CombinedUpperBoundVariableOffset]);
1541 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1542 "expected loop bound sharing directive");
1543 return cast<Expr>(Data->getChildren()[CombinedEnsureUpperBoundOffset]);
1546 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1547 "expected loop bound sharing directive");
1548 return cast<Expr>(Data->getChildren()[CombinedInitOffset]);
1551 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1552 "expected loop bound sharing directive");
1553 return cast<Expr>(Data->getChildren()[CombinedConditionOffset]);
1556 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1557 "expected loop bound sharing directive");
1558 return cast<Expr>(Data->getChildren()[CombinedNextLowerBoundOffset]);
1561 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1562 "expected loop bound sharing directive");
1563 return cast<Expr>(Data->getChildren()[CombinedNextUpperBoundOffset]);
1566 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1567 "expected loop bound distribute sharing directive");
1568 return cast<Expr>(Data->getChildren()[CombinedDistConditionOffset]);
1571 assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1572 "expected loop bound distribute sharing directive");
1573 return cast<Expr>(Data->getChildren()[CombinedParForInDistConditionOffset]);
1629 return T->getStmtClass() == OMPSimdDirectiveClass ||
1630 T->getStmtClass() == OMPForDirectiveClass ||
1631 T->getStmtClass() == OMPForSimdDirectiveClass ||
1632 T->getStmtClass() == OMPParallelForDirectiveClass ||
1633 T->getStmtClass() == OMPParallelForSimdDirectiveClass ||
1634 T->getStmtClass() == OMPTaskLoopDirectiveClass ||
1635 T->getStmtClass() == OMPTaskLoopSimdDirectiveClass ||
1636 T->getStmtClass() == OMPMaskedTaskLoopDirectiveClass ||
1637 T->getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass ||
1638 T->getStmtClass() == OMPMasterTaskLoopDirectiveClass ||
1639 T->getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass ||
1640 T->getStmtClass() == OMPGenericLoopDirectiveClass ||
1641 T->getStmtClass() == OMPTeamsGenericLoopDirectiveClass ||
1642 T->getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass ||
1643 T->getStmtClass() == OMPParallelGenericLoopDirectiveClass ||
1644 T->getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass ||
1645 T->getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass ||
1646 T->getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass ||
1647 T->getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass ||
1648 T->getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass ||
1649 T->getStmtClass() == OMPDistributeDirectiveClass ||
1650 T->getStmtClass() == OMPTargetParallelForDirectiveClass ||
1651 T->getStmtClass() == OMPDistributeParallelForDirectiveClass ||
1652 T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass ||
1653 T->getStmtClass() == OMPDistributeSimdDirectiveClass ||
1654 T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass ||
1655 T->getStmtClass() == OMPTargetSimdDirectiveClass ||
1656 T->getStmtClass() == OMPTeamsDistributeDirectiveClass ||
1657 T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass ||
1658 T->getStmtClass() ==
1659 OMPTeamsDistributeParallelForSimdDirectiveClass ||
1660 T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass ||
1661 T->getStmtClass() ==
1662 OMPTargetTeamsDistributeParallelForDirectiveClass ||
1663 T->getStmtClass() ==
1664 OMPTargetTeamsDistributeParallelForSimdDirectiveClass ||
1665 T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass ||
1666 T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
1688 OMPSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1689 unsigned CollapsedNum)
1691 EndLoc, CollapsedNum) {}
1699 SourceLocation(), SourceLocation(), CollapsedNum) {}
1712 static OMPSimdDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
1713 SourceLocation EndLoc,
unsigned CollapsedNum,
1714 ArrayRef<OMPClause *> Clauses,
1715 Stmt *AssociatedStmt,
1716 const HelperExprs &Exprs);
1725 static OMPSimdDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
1726 unsigned CollapsedNum, EmptyShell);
1729 return T->getStmtClass() == OMPSimdDirectiveClass;
1746 bool HasCancel =
false;
1754 OMPForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1755 unsigned CollapsedNum)
1757 EndLoc, CollapsedNum) {}
1765 SourceLocation(), SourceLocation(), CollapsedNum) {}
1768 void setTaskReductionRefExpr(Expr *E) {
1769 Data->getChildren()[numLoopChildren(getLoopsNumber(),
1770 llvm::omp::OMPD_for)] = E;
1774 void setHasCancel(
bool Has) { HasCancel = Has; }
1790 static OMPForDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
1791 SourceLocation EndLoc,
unsigned CollapsedNum,
1792 ArrayRef<OMPClause *> Clauses,
1793 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
1794 Expr *TaskRedRef,
bool HasCancel);
1803 static OMPForDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
1804 unsigned CollapsedNum, EmptyShell);
1809 getLoopsNumber(), llvm::omp::OMPD_for)]);
1819 return T->getStmtClass() == OMPForDirectiveClass;
1841 OMPForSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1842 unsigned CollapsedNum)
1844 StartLoc, EndLoc, CollapsedNum) {}
1852 SourceLocation(), SourceLocation(), CollapsedNum) {}
1865 static OMPForSimdDirective *
1866 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1867 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
1868 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
1877 static OMPForSimdDirective *CreateEmpty(
const ASTContext &C,
1878 unsigned NumClauses,
1879 unsigned CollapsedNum, EmptyShell);
1882 return T->getStmtClass() == OMPForSimdDirectiveClass;
1900 bool HasCancel =
false;
1907 OMPSectionsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1909 llvm::omp::OMPD_sections, StartLoc, EndLoc) {}
1915 llvm::omp::OMPD_sections, SourceLocation(),
1916 SourceLocation()) {}
1919 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
1922 void setHasCancel(
bool Has) { HasCancel = Has; }
1936 static OMPSectionsDirective *
1937 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1938 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
1947 static OMPSectionsDirective *CreateEmpty(
const ASTContext &C,
1948 unsigned NumClauses, EmptyShell);
1952 return cast_or_null<Expr>(Data->getChildren()[0]);
1962 return T->getStmtClass() == OMPSectionsDirectiveClass;
1977 bool HasCancel =
false;
1984 OMPSectionDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1986 llvm::omp::OMPD_section, StartLoc, EndLoc) {}
1992 llvm::omp::OMPD_section, SourceLocation(),
1993 SourceLocation()) {}
2004 static OMPSectionDirective *
Create(
const ASTContext &C,
2005 SourceLocation StartLoc,
2006 SourceLocation EndLoc,
2007 Stmt *AssociatedStmt,
bool HasCancel);
2013 static OMPSectionDirective *CreateEmpty(
const ASTContext &C, EmptyShell);
2022 return T->getStmtClass() == OMPSectionDirectiveClass;
2042 OMPScopeDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2044 StartLoc, EndLoc) {}
2050 SourceLocation(), SourceLocation()) {}
2060 static OMPScopeDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
2061 SourceLocation EndLoc,
2062 ArrayRef<OMPClause *> Clauses,
2063 Stmt *AssociatedStmt);
2069 static OMPScopeDirective *CreateEmpty(
const ASTContext &C,
2070 unsigned NumClauses, EmptyShell);
2073 return T->getStmtClass() == OMPScopeDirectiveClass;
2093 OMPSingleDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2095 StartLoc, EndLoc) {}
2101 SourceLocation(), SourceLocation()) {}
2112 static OMPSingleDirective *
2113 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2114 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2122 static OMPSingleDirective *CreateEmpty(
const ASTContext &C,
2123 unsigned NumClauses, EmptyShell);
2126 return T->getStmtClass() == OMPSingleDirectiveClass;
2144 OMPMasterDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2146 StartLoc, EndLoc) {}
2152 SourceLocation(), SourceLocation()) {}
2162 static OMPMasterDirective *
Create(
const ASTContext &C,
2163 SourceLocation StartLoc,
2164 SourceLocation EndLoc,
2165 Stmt *AssociatedStmt);
2171 static OMPMasterDirective *CreateEmpty(
const ASTContext &C, EmptyShell);
2174 return T->getStmtClass() == OMPMasterDirectiveClass;
2188 DeclarationNameInfo DirName;
2195 OMPCriticalDirective(
const DeclarationNameInfo &Name, SourceLocation StartLoc,
2196 SourceLocation EndLoc)
2198 llvm::omp::OMPD_critical, StartLoc, EndLoc),
2205 llvm::omp::OMPD_critical, SourceLocation(),
2206 SourceLocation()) {}
2212 void setDirectiveName(
const DeclarationNameInfo &Name) { DirName = Name; }
2224 static OMPCriticalDirective *
2225 Create(
const ASTContext &C,
const DeclarationNameInfo &Name,
2226 SourceLocation StartLoc, SourceLocation EndLoc,
2227 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2234 static OMPCriticalDirective *CreateEmpty(
const ASTContext &C,
2235 unsigned NumClauses, EmptyShell);
2242 return T->getStmtClass() == OMPCriticalDirectiveClass;
2260 bool HasCancel =
false;
2268 OMPParallelForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2269 unsigned CollapsedNum)
2271 llvm::omp::OMPD_parallel_for, StartLoc, EndLoc,
2280 llvm::omp::OMPD_parallel_for, SourceLocation(),
2281 SourceLocation(), CollapsedNum) {}
2284 void setTaskReductionRefExpr(Expr *E) {
2285 Data->getChildren()[numLoopChildren(getLoopsNumber(),
2286 llvm::omp::OMPD_parallel_for)] = E;
2290 void setHasCancel(
bool Has) { HasCancel = Has; }
2306 static OMPParallelForDirective *
2307 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2308 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2309 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
2319 static OMPParallelForDirective *CreateEmpty(
const ASTContext &C,
2320 unsigned NumClauses,
2321 unsigned CollapsedNum,
2327 getLoopsNumber(), llvm::omp::OMPD_parallel_for)]);
2330 return const_cast<OMPParallelForDirective *
>(
this)
2338 return T->getStmtClass() == OMPParallelForDirectiveClass;
2361 OMPParallelForSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2362 unsigned CollapsedNum)
2364 llvm::omp::OMPD_parallel_for_simd, StartLoc, EndLoc,
2373 llvm::omp::OMPD_parallel_for_simd, SourceLocation(),
2374 SourceLocation(), CollapsedNum) {}
2387 static OMPParallelForSimdDirective *
2388 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2389 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2390 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
2399 static OMPParallelForSimdDirective *CreateEmpty(
const ASTContext &C,
2400 unsigned NumClauses,
2401 unsigned CollapsedNum,
2405 return T->getStmtClass() == OMPParallelForSimdDirectiveClass;
2421 OMPParallelMasterDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2423 llvm::omp::OMPD_parallel_master, StartLoc,
2428 llvm::omp::OMPD_parallel_master,
2429 SourceLocation(), SourceLocation()) {}
2432 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2445 static OMPParallelMasterDirective *
2446 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2447 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);
2455 static OMPParallelMasterDirective *
2456 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2460 return cast_or_null<Expr>(Data->getChildren()[0]);
2463 return const_cast<OMPParallelMasterDirective *
>(
this)
2468 return T->getStmtClass() == OMPParallelMasterDirectiveClass;
2484 OMPParallelMaskedDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2486 llvm::omp::OMPD_parallel_masked, StartLoc,
2491 llvm::omp::OMPD_parallel_masked,
2492 SourceLocation(), SourceLocation()) {}
2495 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2508 static OMPParallelMaskedDirective *
2509 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2510 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);
2518 static OMPParallelMaskedDirective *
2519 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2523 return cast_or_null<Expr>(Data->getChildren()[0]);
2526 return const_cast<OMPParallelMaskedDirective *
>(
this)
2531 return T->getStmtClass() == OMPParallelMaskedDirectiveClass;
2549 bool HasCancel =
false;
2556 OMPParallelSectionsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2558 llvm::omp::OMPD_parallel_sections, StartLoc,
2565 llvm::omp::OMPD_parallel_sections,
2566 SourceLocation(), SourceLocation()) {}
2569 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2572 void setHasCancel(
bool Has) { HasCancel = Has; }
2586 static OMPParallelSectionsDirective *
2587 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2588 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
2597 static OMPParallelSectionsDirective *
2598 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2602 return cast_or_null<Expr>(Data->getChildren()[0]);
2605 return const_cast<OMPParallelSectionsDirective *
>(
this)
2613 return T->getStmtClass() == OMPParallelSectionsDirectiveClass;
2629 bool HasCancel =
false;
2636 OMPTaskDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2638 StartLoc, EndLoc) {}
2644 SourceLocation(), SourceLocation()) {}
2647 void setHasCancel(
bool Has) { HasCancel = Has; }
2659 static OMPTaskDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
2660 SourceLocation EndLoc,
2661 ArrayRef<OMPClause *> Clauses,
2662 Stmt *AssociatedStmt,
bool HasCancel);
2670 static OMPTaskDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
2677 return T->getStmtClass() == OMPTaskDirectiveClass;
2695 OMPTaskyieldDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2697 llvm::omp::OMPD_taskyield, StartLoc, EndLoc) {}
2703 llvm::omp::OMPD_taskyield, SourceLocation(),
2704 SourceLocation()) {}
2713 static OMPTaskyieldDirective *
2714 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc);
2720 static OMPTaskyieldDirective *CreateEmpty(
const ASTContext &C, EmptyShell);
2723 return T->getStmtClass() == OMPTaskyieldDirectiveClass;
2741 OMPBarrierDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2743 llvm::omp::OMPD_barrier, StartLoc, EndLoc) {}
2749 llvm::omp::OMPD_barrier, SourceLocation(),
2750 SourceLocation()) {}
2759 static OMPBarrierDirective *
2760 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc);
2766 static OMPBarrierDirective *CreateEmpty(
const ASTContext &C, EmptyShell);
2769 return T->getStmtClass() == OMPBarrierDirectiveClass;
2787 OMPTaskwaitDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2789 llvm::omp::OMPD_taskwait, StartLoc, EndLoc) {}
2795 llvm::omp::OMPD_taskwait, SourceLocation(),
2796 SourceLocation()) {}
2806 static OMPTaskwaitDirective *
Create(
const ASTContext &C,
2807 SourceLocation StartLoc,
2808 SourceLocation EndLoc,
2809 ArrayRef<OMPClause *> Clauses);
2816 static OMPTaskwaitDirective *CreateEmpty(
const ASTContext &C,
2817 unsigned NumClauses, EmptyShell);
2820 return T->getStmtClass() == OMPTaskwaitDirectiveClass;
2838 OMPTaskgroupDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2840 llvm::omp::OMPD_taskgroup, StartLoc, EndLoc) {}
2846 llvm::omp::OMPD_taskgroup, SourceLocation(),
2847 SourceLocation()) {}
2850 void setReductionRef(Expr *RR) {
Data->getChildren()[0] = RR; }
2862 static OMPTaskgroupDirective *
2863 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2864 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2865 Expr *ReductionRef);
2872 static OMPTaskgroupDirective *CreateEmpty(
const ASTContext &C,
2873 unsigned NumClauses, EmptyShell);
2883 return T->getStmtClass() == OMPTaskgroupDirectiveClass;
2905 OMPFlushDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2907 StartLoc, EndLoc) {}
2913 SourceLocation(), SourceLocation()) {}
2924 static OMPFlushDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
2925 SourceLocation EndLoc,
2926 ArrayRef<OMPClause *> Clauses);
2934 static OMPFlushDirective *CreateEmpty(
const ASTContext &C,
2935 unsigned NumClauses, EmptyShell);
2938 return T->getStmtClass() == OMPFlushDirectiveClass;
2958 OMPDepobjDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2960 StartLoc, EndLoc) {}
2966 SourceLocation(), SourceLocation()) {}
2976 static OMPDepobjDirective *
Create(
const ASTContext &C,
2977 SourceLocation StartLoc,
2978 SourceLocation EndLoc,
2979 ArrayRef<OMPClause *> Clauses);
2987 static OMPDepobjDirective *CreateEmpty(
const ASTContext &C,
2988 unsigned NumClauses, EmptyShell);
2991 return T->getStmtClass() == OMPDepobjDirectiveClass;
3009 OMPOrderedStandaloneDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3011 llvm::omp::OMPD_ordered_standalone, StartLoc,
3018 llvm::omp::OMPD_ordered_standalone,
3019 SourceLocation(), SourceLocation()) {}
3029 static OMPOrderedStandaloneDirective *
Create(
const ASTContext &C,
3030 SourceLocation StartLoc,
3031 SourceLocation EndLoc,
3032 ArrayRef<OMPClause *> Clauses);
3039 static OMPOrderedStandaloneDirective *
3040 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
3043 return T->getStmtClass() == OMPOrderedStandaloneDirectiveClass;
3062 OMPOrderedBlockAssocDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3064 llvm::omp::OMPD_ordered_blockassoc, StartLoc,
3071 llvm::omp::OMPD_ordered_blockassoc,
3072 SourceLocation(), SourceLocation()) {}
3083 static OMPOrderedBlockAssocDirective *
3084 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3085 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3092 static OMPOrderedBlockAssocDirective *
3093 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
3096 return T->getStmtClass() == OMPOrderedBlockAssocDirectiveClass;
3121 LLVM_PREFERRED_TYPE(
bool)
3131 LLVM_PREFERRED_TYPE(
bool)
3135 LLVM_PREFERRED_TYPE(
bool)
3146 StartLoc, EndLoc) {}
3150 explicit OMPAtomicDirective()
3151 : OMPExecutableDirective(OMPAtomicDirectiveClass, llvm::omp::OMPD_atomic,
3152 SourceLocation(), SourceLocation()) {}
3154 enum DataPositionTy :
size_t {
3165 void setX(Expr *
X) {
Data->getChildren()[DataPositionTy::POS_X] =
X; }
3169 void setUpdateExpr(Expr *UE) {
3170 Data->getChildren()[DataPositionTy::POS_UpdateExpr] = UE;
3173 void setV(Expr *
V) {
Data->getChildren()[DataPositionTy::POS_V] =
V; }
3175 void setR(Expr *R) {
Data->getChildren()[DataPositionTy::POS_R] =
R; }
3177 void setExpr(Expr *E) {
Data->getChildren()[DataPositionTy::POS_E] = E; }
3179 void setD(Expr *D) {
Data->getChildren()[DataPositionTy::POS_D] = D; }
3181 void setCond(Expr *C) {
Data->getChildren()[DataPositionTy::POS_Cond] =
C; }
3221 SourceLocation StartLoc,
3222 SourceLocation EndLoc,
3233 unsigned NumClauses, EmptyShell);
3237 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_X]);
3240 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_X]);
3246 return cast_or_null<Expr>(
3247 Data->getChildren()[DataPositionTy::POS_UpdateExpr]);
3250 return cast_or_null<Expr>(
3251 Data->getChildren()[DataPositionTy::POS_UpdateExpr]);
3265 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_V]);
3268 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_V]);
3272 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_R]);
3275 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_R]);
3279 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_E]);
3282 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_E]);
3286 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_D]);
3289 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_D]);
3293 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_Cond]);
3296 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_Cond]);
3300 return T->getStmtClass() == OMPAtomicDirectiveClass;
3320 OMPTargetDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3322 StartLoc, EndLoc) {}
3328 SourceLocation(), SourceLocation()) {}
3339 static OMPTargetDirective *
3340 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3341 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3349 static OMPTargetDirective *CreateEmpty(
const ASTContext &C,
3350 unsigned NumClauses, EmptyShell);
3353 return T->getStmtClass() == OMPTargetDirectiveClass;
3374 OMPTargetDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3376 llvm::omp::OMPD_target_data, StartLoc, EndLoc) {}
3382 llvm::omp::OMPD_target_data, SourceLocation(),
3383 SourceLocation()) {}
3394 static OMPTargetDataDirective *
3395 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3396 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3403 static OMPTargetDataDirective *CreateEmpty(
const ASTContext &C,
unsigned N,
3407 return T->getStmtClass() == OMPTargetDataDirectiveClass;
3428 OMPTargetEnterDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3430 llvm::omp::OMPD_target_enter_data, StartLoc,
3437 llvm::omp::OMPD_target_enter_data,
3438 SourceLocation(), SourceLocation()) {}
3449 static OMPTargetEnterDataDirective *
3450 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3451 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3458 static OMPTargetEnterDataDirective *CreateEmpty(
const ASTContext &C,
3459 unsigned N, EmptyShell);
3462 return T->getStmtClass() == OMPTargetEnterDataDirectiveClass;
3483 OMPTargetExitDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3485 llvm::omp::OMPD_target_exit_data, StartLoc,
3492 llvm::omp::OMPD_target_exit_data,
3493 SourceLocation(), SourceLocation()) {}
3504 static OMPTargetExitDataDirective *
3505 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3506 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3513 static OMPTargetExitDataDirective *CreateEmpty(
const ASTContext &C,
3514 unsigned N, EmptyShell);
3517 return T->getStmtClass() == OMPTargetExitDataDirectiveClass;
3533 bool HasCancel =
false;
3540 OMPTargetParallelDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3542 llvm::omp::OMPD_target_parallel, StartLoc,
3549 llvm::omp::OMPD_target_parallel,
3550 SourceLocation(), SourceLocation()) {}
3553 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
3555 void setHasCancel(
bool Has) { HasCancel = Has; }
3569 static OMPTargetParallelDirective *
3570 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3571 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
3580 static OMPTargetParallelDirective *
3581 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
3585 return cast_or_null<Expr>(Data->getChildren()[0]);
3588 return const_cast<OMPTargetParallelDirective *
>(
this)
3596 return T->getStmtClass() == OMPTargetParallelDirectiveClass;
3614 bool HasCancel =
false;
3622 OMPTargetParallelForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3623 unsigned CollapsedNum)
3625 llvm::omp::OMPD_target_parallel_for, StartLoc, EndLoc,
3634 llvm::omp::OMPD_target_parallel_for, SourceLocation(),
3635 SourceLocation(), CollapsedNum) {}
3638 void setTaskReductionRefExpr(Expr *E) {
3639 Data->getChildren()[numLoopChildren(
3640 getLoopsNumber(), llvm::omp::OMPD_target_parallel_for)] = E;
3644 void setHasCancel(
bool Has) { HasCancel = Has; }
3660 static OMPTargetParallelForDirective *
3661 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3662 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3663 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
3673 static OMPTargetParallelForDirective *CreateEmpty(
const ASTContext &C,
3674 unsigned NumClauses,
3675 unsigned CollapsedNum,
3681 getLoopsNumber(), llvm::omp::OMPD_target_parallel_for)]);
3684 return const_cast<OMPTargetParallelForDirective *
>(
this)
3692 return T->getStmtClass() == OMPTargetParallelForDirectiveClass;
3712 OMPTeamsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3714 StartLoc, EndLoc) {}
3720 SourceLocation(), SourceLocation()) {}
3731 static OMPTeamsDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
3732 SourceLocation EndLoc,
3733 ArrayRef<OMPClause *> Clauses,
3734 Stmt *AssociatedStmt);
3742 static OMPTeamsDirective *CreateEmpty(
const ASTContext &C,
3743 unsigned NumClauses, EmptyShell);
3746 return T->getStmtClass() == OMPTeamsDirectiveClass;
3760 OpenMPDirectiveKind CancelRegion = llvm::omp::OMPD_unknown;
3767 OMPCancellationPointDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3769 llvm::omp::OMPD_cancellation_point, StartLoc,
3775 llvm::omp::OMPD_cancellation_point,
3776 SourceLocation(), SourceLocation()) {}
3780 void setCancelRegion(OpenMPDirectiveKind CR) { CancelRegion = CR; }
3789 static OMPCancellationPointDirective *
3790 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3791 OpenMPDirectiveKind CancelRegion);
3797 static OMPCancellationPointDirective *CreateEmpty(
const ASTContext &C,
3804 return T->getStmtClass() == OMPCancellationPointDirectiveClass;
3818 OpenMPDirectiveKind CancelRegion = llvm::omp::OMPD_unknown;
3824 OMPCancelDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3826 StartLoc, EndLoc) {}
3832 SourceLocation(), SourceLocation()) {}
3836 void setCancelRegion(OpenMPDirectiveKind CR) { CancelRegion = CR; }
3846 static OMPCancelDirective *
3847 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3848 ArrayRef<OMPClause *> Clauses, OpenMPDirectiveKind CancelRegion);
3855 static OMPCancelDirective *CreateEmpty(
const ASTContext &C,
3856 unsigned NumClauses, EmptyShell);
3862 return T->getStmtClass() == OMPCancelDirectiveClass;
3879 bool HasCancel =
false;
3887 OMPTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3888 unsigned CollapsedNum)
3890 StartLoc, EndLoc, CollapsedNum) {}
3898 SourceLocation(), SourceLocation(), CollapsedNum) {}
3901 void setHasCancel(
bool Has) { HasCancel = Has; }
3915 static OMPTaskLoopDirective *
3916 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3917 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3918 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
3927 static OMPTaskLoopDirective *CreateEmpty(
const ASTContext &C,
3928 unsigned NumClauses,
3929 unsigned CollapsedNum, EmptyShell);
3935 return T->getStmtClass() == OMPTaskLoopDirectiveClass;
3957 OMPTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3958 unsigned CollapsedNum)
3960 llvm::omp::OMPD_taskloop_simd, StartLoc, EndLoc,
3969 llvm::omp::OMPD_taskloop_simd, SourceLocation(),
3970 SourceLocation(), CollapsedNum) {}
3983 static OMPTaskLoopSimdDirective *
3984 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3985 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3986 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
3995 static OMPTaskLoopSimdDirective *CreateEmpty(
const ASTContext &C,
3996 unsigned NumClauses,
3997 unsigned CollapsedNum,
4001 return T->getStmtClass() == OMPTaskLoopSimdDirectiveClass;
4018 bool HasCancel =
false;
4026 OMPMasterTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4027 unsigned CollapsedNum)
4029 llvm::omp::OMPD_master_taskloop, StartLoc, EndLoc,
4038 llvm::omp::OMPD_master_taskloop, SourceLocation(),
4039 SourceLocation(), CollapsedNum) {}
4042 void setHasCancel(
bool Has) { HasCancel = Has; }
4056 static OMPMasterTaskLoopDirective *
4057 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4058 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4059 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4068 static OMPMasterTaskLoopDirective *CreateEmpty(
const ASTContext &C,
4069 unsigned NumClauses,
4070 unsigned CollapsedNum,
4077 return T->getStmtClass() == OMPMasterTaskLoopDirectiveClass;
4094 bool HasCancel =
false;
4102 OMPMaskedTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4103 unsigned CollapsedNum)
4105 llvm::omp::OMPD_masked_taskloop, StartLoc, EndLoc,
4114 llvm::omp::OMPD_masked_taskloop, SourceLocation(),
4115 SourceLocation(), CollapsedNum) {}
4118 void setHasCancel(
bool Has) { HasCancel = Has; }
4132 static OMPMaskedTaskLoopDirective *
4133 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4134 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4135 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4144 static OMPMaskedTaskLoopDirective *CreateEmpty(
const ASTContext &C,
4145 unsigned NumClauses,
4146 unsigned CollapsedNum,
4153 return T->getStmtClass() == OMPMaskedTaskLoopDirectiveClass;
4175 OMPMasterTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4176 unsigned CollapsedNum)
4178 llvm::omp::OMPD_master_taskloop_simd, StartLoc, EndLoc,
4187 llvm::omp::OMPD_master_taskloop_simd, SourceLocation(),
4188 SourceLocation(), CollapsedNum) {}
4201 static OMPMasterTaskLoopSimdDirective *
4202 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4203 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4204 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4212 static OMPMasterTaskLoopSimdDirective *CreateEmpty(
const ASTContext &C,
4213 unsigned NumClauses,
4214 unsigned CollapsedNum,
4218 return T->getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass;
4240 OMPMaskedTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4241 unsigned CollapsedNum)
4243 llvm::omp::OMPD_masked_taskloop_simd, StartLoc, EndLoc,
4252 llvm::omp::OMPD_masked_taskloop_simd, SourceLocation(),
4253 SourceLocation(), CollapsedNum) {}
4266 static OMPMaskedTaskLoopSimdDirective *
4267 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4268 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4269 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4277 static OMPMaskedTaskLoopSimdDirective *CreateEmpty(
const ASTContext &C,
4278 unsigned NumClauses,
4279 unsigned CollapsedNum,
4283 return T->getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass;
4301 bool HasCancel =
false;
4309 OMPParallelMasterTaskLoopDirective(SourceLocation StartLoc,
4310 SourceLocation EndLoc,
4311 unsigned CollapsedNum)
4313 llvm::omp::OMPD_parallel_master_taskloop, StartLoc,
4314 EndLoc, CollapsedNum) {}
4322 llvm::omp::OMPD_parallel_master_taskloop,
4323 SourceLocation(), SourceLocation(), CollapsedNum) {}
4326 void setHasCancel(
bool Has) { HasCancel = Has; }
4340 static OMPParallelMasterTaskLoopDirective *
4341 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4342 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4343 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4352 static OMPParallelMasterTaskLoopDirective *CreateEmpty(
const ASTContext &C,
4353 unsigned NumClauses,
4354 unsigned CollapsedNum,
4361 return T->getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass;
4379 bool HasCancel =
false;
4387 OMPParallelMaskedTaskLoopDirective(SourceLocation StartLoc,
4388 SourceLocation EndLoc,
4389 unsigned CollapsedNum)
4391 llvm::omp::OMPD_parallel_masked_taskloop, StartLoc,
4392 EndLoc, CollapsedNum) {}
4400 llvm::omp::OMPD_parallel_masked_taskloop,
4401 SourceLocation(), SourceLocation(), CollapsedNum) {}
4404 void setHasCancel(
bool Has) { HasCancel = Has; }
4418 static OMPParallelMaskedTaskLoopDirective *
4419 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4420 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4421 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4430 static OMPParallelMaskedTaskLoopDirective *CreateEmpty(
const ASTContext &C,
4431 unsigned NumClauses,
4432 unsigned CollapsedNum,
4439 return T->getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass;
4462 OMPParallelMasterTaskLoopSimdDirective(SourceLocation StartLoc,
4463 SourceLocation EndLoc,
4464 unsigned CollapsedNum)
4466 llvm::omp::OMPD_parallel_master_taskloop_simd,
4467 StartLoc, EndLoc, CollapsedNum) {}
4475 llvm::omp::OMPD_parallel_master_taskloop_simd,
4476 SourceLocation(), SourceLocation(), CollapsedNum) {}
4489 static OMPParallelMasterTaskLoopSimdDirective *
4490 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4491 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4492 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4501 static OMPParallelMasterTaskLoopSimdDirective *
4502 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4506 return T->getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass;
4529 OMPParallelMaskedTaskLoopSimdDirective(SourceLocation StartLoc,
4530 SourceLocation EndLoc,
4531 unsigned CollapsedNum)
4533 llvm::omp::OMPD_parallel_masked_taskloop_simd,
4534 StartLoc, EndLoc, CollapsedNum) {}
4542 llvm::omp::OMPD_parallel_masked_taskloop_simd,
4543 SourceLocation(), SourceLocation(), CollapsedNum) {}
4556 static OMPParallelMaskedTaskLoopSimdDirective *
4557 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4558 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4559 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4568 static OMPParallelMaskedTaskLoopSimdDirective *
4569 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4573 return T->getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass;
4595 OMPDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4596 unsigned CollapsedNum)
4598 llvm::omp::OMPD_distribute, StartLoc, EndLoc,
4607 llvm::omp::OMPD_distribute, SourceLocation(),
4608 SourceLocation(), CollapsedNum) {}
4621 static OMPDistributeDirective *
4622 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4623 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4624 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4633 static OMPDistributeDirective *CreateEmpty(
const ASTContext &C,
4634 unsigned NumClauses,
4635 unsigned CollapsedNum, EmptyShell);
4638 return T->getStmtClass() == OMPDistributeDirectiveClass;
4659 OMPTargetUpdateDirective(SourceLocation StartLoc, SourceLocation EndLoc)
4661 llvm::omp::OMPD_target_update, StartLoc,
4668 llvm::omp::OMPD_target_update, SourceLocation(),
4669 SourceLocation()) {}
4680 static OMPTargetUpdateDirective *
4681 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4682 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
4690 static OMPTargetUpdateDirective *CreateEmpty(
const ASTContext &C,
4691 unsigned NumClauses, EmptyShell);
4694 return T->getStmtClass() == OMPTargetUpdateDirectiveClass;
4711 bool HasCancel =
false;
4719 OMPDistributeParallelForDirective(SourceLocation StartLoc,
4720 SourceLocation EndLoc,
4721 unsigned CollapsedNum)
4723 llvm::omp::OMPD_distribute_parallel_for, StartLoc,
4724 EndLoc, CollapsedNum) {}
4732 llvm::omp::OMPD_distribute_parallel_for,
4733 SourceLocation(), SourceLocation(), CollapsedNum) {}
4736 void setTaskReductionRefExpr(Expr *E) {
4737 Data->getChildren()[numLoopChildren(
4738 getLoopsNumber(), llvm::omp::OMPD_distribute_parallel_for)] = E;
4742 void setHasCancel(
bool Has) { HasCancel = Has; }
4758 static OMPDistributeParallelForDirective *
4759 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4760 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4761 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
4771 static OMPDistributeParallelForDirective *CreateEmpty(
const ASTContext &C,
4772 unsigned NumClauses,
4773 unsigned CollapsedNum,
4779 getLoopsNumber(), llvm::omp::OMPD_distribute_parallel_for)]);
4782 return const_cast<OMPDistributeParallelForDirective *
>(
this)
4790 return T->getStmtClass() == OMPDistributeParallelForDirectiveClass;
4813 OMPDistributeParallelForSimdDirective(SourceLocation StartLoc,
4814 SourceLocation EndLoc,
4815 unsigned CollapsedNum)
4817 llvm::omp::OMPD_distribute_parallel_for_simd, StartLoc,
4818 EndLoc, CollapsedNum) {}
4826 llvm::omp::OMPD_distribute_parallel_for_simd,
4827 SourceLocation(), SourceLocation(), CollapsedNum) {}
4840 static OMPDistributeParallelForSimdDirective *
Create(
4841 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4842 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4843 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4851 static OMPDistributeParallelForSimdDirective *CreateEmpty(
4852 const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4856 return T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass;
4878 OMPDistributeSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4879 unsigned CollapsedNum)
4881 llvm::omp::OMPD_distribute_simd, StartLoc, EndLoc,
4890 llvm::omp::OMPD_distribute_simd, SourceLocation(),
4891 SourceLocation(), CollapsedNum) {}
4904 static OMPDistributeSimdDirective *
4905 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4906 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4907 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4915 static OMPDistributeSimdDirective *CreateEmpty(
const ASTContext &C,
4916 unsigned NumClauses,
4917 unsigned CollapsedNum,
4921 return T->getStmtClass() == OMPDistributeSimdDirectiveClass;
4944 OMPTargetParallelForSimdDirective(SourceLocation StartLoc,
4945 SourceLocation EndLoc,
4946 unsigned CollapsedNum)
4948 llvm::omp::OMPD_target_parallel_for_simd, StartLoc,
4949 EndLoc, CollapsedNum) {}
4957 llvm::omp::OMPD_target_parallel_for_simd,
4958 SourceLocation(), SourceLocation(), CollapsedNum) {}
4971 static OMPTargetParallelForSimdDirective *
4972 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4973 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4974 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4982 static OMPTargetParallelForSimdDirective *CreateEmpty(
const ASTContext &C,
4983 unsigned NumClauses,
4984 unsigned CollapsedNum,
4988 return T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass;
5011 OMPTargetSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
5012 unsigned CollapsedNum)
5014 llvm::omp::OMPD_target_simd, StartLoc, EndLoc,
5023 llvm::omp::OMPD_target_simd, SourceLocation(),
5024 SourceLocation(), CollapsedNum) {}
5037 static OMPTargetSimdDirective *
5038 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5039 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5040 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5048 static OMPTargetSimdDirective *CreateEmpty(
const ASTContext &C,
5049 unsigned NumClauses,
5050 unsigned CollapsedNum,
5054 return T->getStmtClass() == OMPTargetSimdDirectiveClass;
5076 OMPTeamsDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
5077 unsigned CollapsedNum)
5079 llvm::omp::OMPD_teams_distribute, StartLoc, EndLoc,
5088 llvm::omp::OMPD_teams_distribute, SourceLocation(),
5089 SourceLocation(), CollapsedNum) {}
5102 static OMPTeamsDistributeDirective *
5103 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5104 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5105 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5113 static OMPTeamsDistributeDirective *CreateEmpty(
const ASTContext &C,
5114 unsigned NumClauses,
5115 unsigned CollapsedNum,
5119 return T->getStmtClass() == OMPTeamsDistributeDirectiveClass;
5142 OMPTeamsDistributeSimdDirective(SourceLocation StartLoc,
5143 SourceLocation EndLoc,
unsigned CollapsedNum)
5145 llvm::omp::OMPD_teams_distribute_simd, StartLoc,
5146 EndLoc, CollapsedNum) {}
5154 llvm::omp::OMPD_teams_distribute_simd,
5155 SourceLocation(), SourceLocation(), CollapsedNum) {}
5168 static OMPTeamsDistributeSimdDirective *
5169 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5170 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5171 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5180 static OMPTeamsDistributeSimdDirective *CreateEmpty(
const ASTContext &C,
5181 unsigned NumClauses,
5182 unsigned CollapsedNum,
5186 return T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass;
5199class OMPTeamsDistributeParallelForSimdDirective final
5210 OMPTeamsDistributeParallelForSimdDirective(SourceLocation StartLoc,
5211 SourceLocation EndLoc,
5212 unsigned CollapsedNum)
5214 llvm::omp::OMPD_teams_distribute_parallel_for_simd,
5215 StartLoc, EndLoc, CollapsedNum) {}
5223 llvm::omp::OMPD_teams_distribute_parallel_for_simd,
5224 SourceLocation(), SourceLocation(), CollapsedNum) {}
5237 static OMPTeamsDistributeParallelForSimdDirective *
5238 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5239 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5240 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5248 static OMPTeamsDistributeParallelForSimdDirective *
5249 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5253 return T->getStmtClass() == OMPTeamsDistributeParallelForSimdDirectiveClass;
5270 bool HasCancel =
false;
5278 OMPTeamsDistributeParallelForDirective(SourceLocation StartLoc,
5279 SourceLocation EndLoc,
5280 unsigned CollapsedNum)
5282 llvm::omp::OMPD_teams_distribute_parallel_for,
5283 StartLoc, EndLoc, CollapsedNum) {}
5291 llvm::omp::OMPD_teams_distribute_parallel_for,
5292 SourceLocation(), SourceLocation(), CollapsedNum) {}
5295 void setTaskReductionRefExpr(Expr *E) {
5296 Data->getChildren()[numLoopChildren(
5297 getLoopsNumber(), llvm::omp::OMPD_teams_distribute_parallel_for)] = E;
5301 void setHasCancel(
bool Has) { HasCancel = Has; }
5317 static OMPTeamsDistributeParallelForDirective *
5318 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5319 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5320 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
5329 static OMPTeamsDistributeParallelForDirective *
5330 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5336 getLoopsNumber(), llvm::omp::OMPD_teams_distribute_parallel_for)]);
5339 return const_cast<OMPTeamsDistributeParallelForDirective *
>(
this)
5347 return T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass;
5367 OMPTargetTeamsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
5369 llvm::omp::OMPD_target_teams, StartLoc, EndLoc) {
5376 llvm::omp::OMPD_target_teams, SourceLocation(),
5377 SourceLocation()) {}
5388 static OMPTargetTeamsDirective *
Create(
const ASTContext &C,
5389 SourceLocation StartLoc,
5390 SourceLocation EndLoc,
5391 ArrayRef<OMPClause *> Clauses,
5392 Stmt *AssociatedStmt);
5399 static OMPTargetTeamsDirective *CreateEmpty(
const ASTContext &C,
5400 unsigned NumClauses, EmptyShell);
5403 return T->getStmtClass() == OMPTargetTeamsDirectiveClass;
5425 OMPTargetTeamsDistributeDirective(SourceLocation StartLoc,
5426 SourceLocation EndLoc,
5427 unsigned CollapsedNum)
5429 llvm::omp::OMPD_target_teams_distribute, StartLoc,
5430 EndLoc, CollapsedNum) {}
5438 llvm::omp::OMPD_target_teams_distribute,
5439 SourceLocation(), SourceLocation(), CollapsedNum) {}
5452 static OMPTargetTeamsDistributeDirective *
5453 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5454 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5455 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5463 static OMPTargetTeamsDistributeDirective *
5464 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5468 return T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass;
5481class OMPTargetTeamsDistributeParallelForDirective final
5486 bool HasCancel =
false;
5494 OMPTargetTeamsDistributeParallelForDirective(SourceLocation StartLoc,
5495 SourceLocation EndLoc,
5496 unsigned CollapsedNum)
5498 llvm::omp::OMPD_target_teams_distribute_parallel_for,
5499 StartLoc, EndLoc, CollapsedNum) {}
5507 llvm::omp::OMPD_target_teams_distribute_parallel_for,
5508 SourceLocation(), SourceLocation(), CollapsedNum) {}
5511 void setTaskReductionRefExpr(Expr *E) {
5512 Data->getChildren()[numLoopChildren(
5514 llvm::omp::OMPD_target_teams_distribute_parallel_for)] = E;
5518 void setHasCancel(
bool Has) { HasCancel = Has; }
5534 static OMPTargetTeamsDistributeParallelForDirective *
5535 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5536 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5537 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
5546 static OMPTargetTeamsDistributeParallelForDirective *
5547 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5554 llvm::omp::OMPD_target_teams_distribute_parallel_for)]);
5557 return const_cast<OMPTargetTeamsDistributeParallelForDirective *
>(
this)
5565 return T->getStmtClass() ==
5566 OMPTargetTeamsDistributeParallelForDirectiveClass;
5579class OMPTargetTeamsDistributeParallelForSimdDirective final
5590 OMPTargetTeamsDistributeParallelForSimdDirective(SourceLocation StartLoc,
5591 SourceLocation EndLoc,
5592 unsigned CollapsedNum)
5594 OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
5595 llvm::omp::OMPD_target_teams_distribute_parallel_for_simd, StartLoc,
5596 EndLoc, CollapsedNum) {}
5603 unsigned CollapsedNum)
5605 OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
5606 llvm::omp::OMPD_target_teams_distribute_parallel_for_simd,
5607 SourceLocation(), SourceLocation(), CollapsedNum) {}
5620 static OMPTargetTeamsDistributeParallelForSimdDirective *
5621 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5622 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5623 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5631 static OMPTargetTeamsDistributeParallelForSimdDirective *
5632 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5636 return T->getStmtClass() ==
5637 OMPTargetTeamsDistributeParallelForSimdDirectiveClass;
5660 OMPTargetTeamsDistributeSimdDirective(SourceLocation StartLoc,
5661 SourceLocation EndLoc,
5662 unsigned CollapsedNum)
5664 llvm::omp::OMPD_target_teams_distribute_simd, StartLoc,
5665 EndLoc, CollapsedNum) {}
5673 llvm::omp::OMPD_target_teams_distribute_simd,
5674 SourceLocation(), SourceLocation(), CollapsedNum) {}
5687 static OMPTargetTeamsDistributeSimdDirective *
5688 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5689 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5690 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5698 static OMPTargetTeamsDistributeSimdDirective *
5699 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5703 return T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
5708class OMPTileDirective final
5716 TransformedStmtOffset,
5723 OMPTileDirectiveClass,
llvm::omp::OMPD_tile, StartLoc, EndLoc,
5726 void setPreInits(Stmt *PreInits) {
5727 Data->getChildren()[PreInitsOffset] = PreInits;
5730 void setTransformedStmt(Stmt *S) {
5731 Data->getChildren()[TransformedStmtOffset] = S;
5734 void setFinals(Stmt *Finals) {
Data->getChildren()[FinalsOffset] = Finals; }
5750 static OMPTileDirective *
5751 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5752 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
5753 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals);
5760 static OMPTileDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
5775 return Data->getChildren()[TransformedStmtOffset];
5779 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5782 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
5785 return T->getStmtClass() == OMPTileDirectiveClass;
5790class OMPStripeDirective final
5798 TransformedStmtOffset,
5805 OMPStripeDirectiveClass,
llvm::omp::OMPD_stripe, StartLoc, EndLoc,
5808 void setPreInits(Stmt *PreInits) {
5809 Data->getChildren()[PreInitsOffset] = PreInits;
5812 void setTransformedStmt(Stmt *S) {
5813 Data->getChildren()[TransformedStmtOffset] = S;
5816 void setFinals(Stmt *Finals) {
Data->getChildren()[FinalsOffset] = Finals; }
5832 static OMPStripeDirective *
5833 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5834 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
5835 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals);
5842 static OMPStripeDirective *
5843 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned NumLoops);
5856 return Data->getChildren()[TransformedStmtOffset];
5860 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5863 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
5866 return T->getStmtClass() == OMPStripeDirectiveClass;
5876class OMPUnrollDirective final
5884 TransformedStmtOffset,
5890 llvm::omp::OMPD_unroll,
5891 StartLoc, EndLoc, 1) {}
5894 void setPreInits(Stmt *PreInits) {
5895 Data->getChildren()[PreInitsOffset] = PreInits;
5898 void setFinals(Stmt *Finals) {
Data->getChildren()[FinalsOffset] = Finals; }
5901 void setTransformedStmt(Stmt *S) {
5902 Data->getChildren()[TransformedStmtOffset] = S;
5917 static OMPUnrollDirective *
5918 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5919 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
5920 unsigned NumGeneratedTopLevelLoops, Stmt *TransformedStmt,
5921 Stmt *PreInits, Stmt *Finals);
5927 static OMPUnrollDirective *CreateEmpty(
const ASTContext &C,
5928 unsigned NumClauses);
5938 return Data->getChildren()[TransformedStmtOffset];
5942 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5946 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
5949 return T->getStmtClass() == OMPUnrollDirectiveClass;
5960class OMPReverseDirective final
5968 TransformedStmtOffset,
5975 OMPReverseDirectiveClass,
llvm::omp::OMPD_reverse, StartLoc, EndLoc,
5978 void setPreInits(Stmt *PreInits) {
5979 Data->getChildren()[PreInitsOffset] = PreInits;
5982 void setTransformedStmt(Stmt *S) {
5983 Data->getChildren()[TransformedStmtOffset] = S;
5986 void setFinals(Stmt *Finals) {
Data->getChildren()[FinalsOffset] = Finals; }
6000 static OMPReverseDirective *
6001 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6002 Stmt *AssociatedStmt,
unsigned NumLoops, Stmt *TransformedStmt,
6003 Stmt *PreInits, Stmt *Finals);
6009 static OMPReverseDirective *CreateEmpty(
const ASTContext &C,
6015 return Data->getChildren()[TransformedStmtOffset];
6019 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6022 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
6025 return T->getStmtClass() == OMPReverseDirectiveClass;
6037class OMPInterchangeDirective final
6045 TransformedStmtOffset,
6050 SourceLocation EndLoc,
unsigned NumLoops)
6052 OMPInterchangeDirectiveClass,
llvm::omp::OMPD_interchange, StartLoc,
6053 EndLoc, NumLoops) {}
6055 void setPreInits(Stmt *PreInits) {
6056 Data->getChildren()[PreInitsOffset] = PreInits;
6059 void setTransformedStmt(Stmt *S) {
6060 Data->getChildren()[TransformedStmtOffset] = S;
6063 void setFinals(Stmt *Finals) {
Data->getChildren()[FinalsOffset] = Finals; }
6079 static OMPInterchangeDirective *
6080 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6081 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
6082 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals);
6089 static OMPInterchangeDirective *
6090 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned NumLoops);
6095 return Data->getChildren()[TransformedStmtOffset];
6099 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6102 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
6105 return T->getStmtClass() == OMPInterchangeDirectiveClass;
6117class OMPFlattenDirective final
6125 TransformedStmtOffset,
6132 OMPFlattenDirectiveClass,
llvm::omp::OMPD_flatten, StartLoc, EndLoc,
6135 void setPreInits(Stmt *PreInits) {
6136 Data->getChildren()[PreInitsOffset] = PreInits;
6139 void setTransformedStmt(Stmt *S) {
6140 Data->getChildren()[TransformedStmtOffset] = S;
6143 void setFinals(Stmt *S) {
Data->getChildren()[FinalsOffset] = S; }
6159 static OMPFlattenDirective *
6160 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6161 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
6162 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals);
6169 static OMPFlattenDirective *
6170 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned NumLoops);
6175 return Data->getChildren()[TransformedStmtOffset];
6179 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6182 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
6185 return T->getStmtClass() == OMPFlattenDirectiveClass;
6198 StmtClass SC, OpenMPDirectiveKind Kind, SourceLocation StartLoc,
6199 SourceLocation EndLoc)
6209 Stmt *getTransformedStmt()
const;
6212 Stmt *getPreInits()
const;
6216 Stmt *getFinals()
const;
6219 Stmt::StmtClass C = T->getStmtClass();
6220 return C == OMPFuseDirectiveClass;
6234class OMPFuseDirective final
6242 TransformedStmtOffset,
6248 OMPFuseDirectiveClass,
llvm::omp::OMPD_fuse, StartLoc, EndLoc) {}
6250 void setPreInits(Stmt *PreInits) {
6251 Data->getChildren()[PreInitsOffset] = PreInits;
6254 void setTransformedStmt(Stmt *S) {
6255 Data->getChildren()[TransformedStmtOffset] = S;
6258 void setFinals(Stmt *Finals) {
Data->getChildren()[FinalsOffset] = Finals; }
6276 static OMPFuseDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
6277 SourceLocation EndLoc,
6278 ArrayRef<OMPClause *> Clauses,
6279 unsigned NumGeneratedTopLevelLoops,
6280 Stmt *AssociatedStmt, Stmt *TransformedStmt,
6281 Stmt *PreInits, Stmt *Finals);
6288 static OMPFuseDirective *CreateEmpty(
const ASTContext &C,
6289 unsigned NumClauses);
6294 return Data->getChildren()[TransformedStmtOffset];
6298 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6301 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
6304 return T->getStmtClass() == OMPFuseDirectiveClass;
6320class OMPSplitDirective final
6328 TransformedStmtOffset,
6335 OMPSplitDirectiveClass,
llvm::omp::OMPD_split, StartLoc, EndLoc,
6338 void setPreInits(Stmt *PreInits) {
6339 Data->getChildren()[PreInitsOffset] = PreInits;
6342 void setTransformedStmt(Stmt *S) {
6343 Data->getChildren()[TransformedStmtOffset] = S;
6346 void setFinals(Stmt *Finals) {
Data->getChildren()[FinalsOffset] = Finals; }
6362 static OMPSplitDirective *
6363 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6364 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
6365 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals);
6372 static OMPSplitDirective *CreateEmpty(
const ASTContext &C,
6373 unsigned NumClauses,
unsigned NumLoops);
6378 return Data->getChildren()[TransformedStmtOffset];
6382 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6385 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
6388 return T->getStmtClass() == OMPSplitDirectiveClass;
6407 OMPScanDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6409 StartLoc, EndLoc) {}
6415 SourceLocation(), SourceLocation()) {}
6426 static OMPScanDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
6427 SourceLocation EndLoc,
6428 ArrayRef<OMPClause *> Clauses);
6436 static OMPScanDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
6440 return T->getStmtClass() == OMPScanDirectiveClass;
6461 OMPInteropDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6463 llvm::omp::OMPD_interop, StartLoc, EndLoc) {}
6469 llvm::omp::OMPD_interop, SourceLocation(),
6470 SourceLocation()) {}
6480 static OMPInteropDirective *
Create(
const ASTContext &C,
6481 SourceLocation StartLoc,
6482 SourceLocation EndLoc,
6483 ArrayRef<OMPClause *> Clauses);
6489 static OMPInteropDirective *CreateEmpty(
const ASTContext &C,
6490 unsigned NumClauses, EmptyShell);
6493 return T->getStmtClass() == OMPInteropDirectiveClass;
6510 SourceLocation TargetCallLoc;
6513 void setTargetCallLoc(SourceLocation Loc) { TargetCallLoc = Loc; }
6522 llvm::omp::OMPD_dispatch, StartLoc, EndLoc) {}
6526 explicit OMPDispatchDirective()
6527 : OMPExecutableDirective(OMPDispatchDirectiveClass,
6528 llvm::omp::OMPD_dispatch, SourceLocation(),
6529 SourceLocation()) {}
6541 static OMPDispatchDirective *
6542 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6543 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
6544 SourceLocation TargetCallLoc);
6552 static OMPDispatchDirective *CreateEmpty(
const ASTContext &C,
6553 unsigned NumClauses, EmptyShell);
6559 return T->getStmtClass() == OMPDispatchDirectiveClass;
6579 OMPMaskedDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6581 StartLoc, EndLoc) {}
6587 SourceLocation(), SourceLocation()) {}
6597 static OMPMaskedDirective *
6598 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6599 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
6605 static OMPMaskedDirective *CreateEmpty(
const ASTContext &C,
6606 unsigned NumClauses, EmptyShell);
6609 return T->getStmtClass() == OMPMaskedDirectiveClass;
6630 bool HasImplicitOtherwise =
false;
6632 OMPMetaDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6634 llvm::omp::OMPD_metadirective, StartLoc,
6639 static size_t getTraitInfosOffset(
unsigned NumVariants) {
6640 return llvm::alignTo(OMPChildren::size(0,
6645 static OMPMetaDirective *allocate(
const ASTContext &C,
unsigned NumVariants,
6646 SourceLocation StartLoc,
6647 SourceLocation EndLoc);
6649 MutableArrayRef<Stmt *> getTrailingVariants() {
6650 return Data->getChildren().take_front(getNumVariants());
6652 MutableArrayRef<Expr *> getTrailingConditions() {
6653 return {
reinterpret_cast<Expr **
>(
Data->getChildren().data() +
6657 MutableArrayRef<OMPTraitInfo *> getTrailingTraitInfos() {
6658 return {
reinterpret_cast<OMPTraitInfo **
>(
6659 reinterpret_cast<char *
>(
Data) +
6660 getTraitInfosOffset(getNumVariants())),
6663 ArrayRef<Stmt *> getTrailingVariants()
const {
6664 return const_cast<OMPMetaDirective *
>(
this)->getTrailingVariants();
6666 ArrayRef<Expr *> getTrailingConditions()
const {
6667 return const_cast<OMPMetaDirective *
>(
this)->getTrailingConditions();
6669 ArrayRef<OMPTraitInfo *> getTrailingTraitInfos()
const {
6670 return const_cast<OMPMetaDirective *
>(
this)->getTrailingTraitInfos();
6673 void setHasImplicitOtherwise(
bool V) { HasImplicitOtherwise =
V; }
6676 static OMPMetaDirective *
6677 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6678 ArrayRef<Stmt *> Variants, ArrayRef<Expr *> Conditions,
6679 ArrayRef<OMPTraitInfo *> TraitInfos,
bool HasImplicitOtherwise);
6680 static OMPMetaDirective *CreateEmpty(
const ASTContext &C,
6681 unsigned NumVariants, EmptyShell);
6688 return getTrailingTraitInfos();
6692 MutableArrayRef<Stmt *>
Children = Data->getChildren();
6696 return const_cast<OMPMetaDirective *
>(
this)->
children();
6700 return T->getStmtClass() == OMPMetaDirectiveClass;
6722 OMPGenericLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
6723 unsigned CollapsedNum)
6725 StartLoc, EndLoc, CollapsedNum) {}
6733 SourceLocation(), SourceLocation(), CollapsedNum) {}
6746 static OMPGenericLoopDirective *
6747 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6748 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6749 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6757 static OMPGenericLoopDirective *CreateEmpty(
const ASTContext &C,
6758 unsigned NumClauses,
6759 unsigned CollapsedNum,
6763 return T->getStmtClass() == OMPGenericLoopDirectiveClass;
6784 OMPTeamsGenericLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
6785 unsigned CollapsedNum)
6787 llvm::omp::OMPD_teams_loop, StartLoc, EndLoc,
6796 llvm::omp::OMPD_teams_loop, SourceLocation(),
6797 SourceLocation(), CollapsedNum) {}
6810 static OMPTeamsGenericLoopDirective *
6811 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6812 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6813 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6822 static OMPTeamsGenericLoopDirective *CreateEmpty(
const ASTContext &C,
6823 unsigned NumClauses,
6824 unsigned CollapsedNum,
6828 return T->getStmtClass() == OMPTeamsGenericLoopDirectiveClass;
6844 bool CanBeParallelFor =
false;
6851 OMPTargetTeamsGenericLoopDirective(SourceLocation StartLoc,
6852 SourceLocation EndLoc,
6853 unsigned CollapsedNum)
6855 llvm::omp::OMPD_target_teams_loop, StartLoc, EndLoc,
6864 llvm::omp::OMPD_target_teams_loop, SourceLocation(),
6865 SourceLocation(), CollapsedNum) {}
6868 void setCanBeParallelFor(
bool ParFor) { CanBeParallelFor = ParFor; }
6881 static OMPTargetTeamsGenericLoopDirective *
6882 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6883 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6884 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool CanBeParallelFor);
6893 static OMPTargetTeamsGenericLoopDirective *CreateEmpty(
const ASTContext &C,
6894 unsigned NumClauses,
6895 unsigned CollapsedNum,
6903 return T->getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass;
6924 OMPParallelGenericLoopDirective(SourceLocation StartLoc,
6925 SourceLocation EndLoc,
unsigned CollapsedNum)
6927 llvm::omp::OMPD_parallel_loop, StartLoc, EndLoc,
6936 llvm::omp::OMPD_parallel_loop, SourceLocation(),
6937 SourceLocation(), CollapsedNum) {}
6950 static OMPParallelGenericLoopDirective *
6951 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6952 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6953 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6962 static OMPParallelGenericLoopDirective *CreateEmpty(
const ASTContext &C,
6963 unsigned NumClauses,
6964 unsigned CollapsedNum,
6968 return T->getStmtClass() == OMPParallelGenericLoopDirectiveClass;
6989 OMPTargetParallelGenericLoopDirective(SourceLocation StartLoc,
6990 SourceLocation EndLoc,
6991 unsigned CollapsedNum)
6993 llvm::omp::OMPD_target_parallel_loop, StartLoc, EndLoc,
7002 llvm::omp::OMPD_target_parallel_loop, SourceLocation(),
7003 SourceLocation(), CollapsedNum) {}
7016 static OMPTargetParallelGenericLoopDirective *
7017 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
7018 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
7019 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
7028 static OMPTargetParallelGenericLoopDirective *
7029 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
7033 return T->getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass;
7050 OMPErrorDirective(SourceLocation StartLoc, SourceLocation EndLoc)
7052 StartLoc, EndLoc) {}
7057 SourceLocation(), SourceLocation()) {}
7066 static OMPErrorDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
7067 SourceLocation EndLoc,
7068 ArrayRef<OMPClause *> Clauses);
7074 static OMPErrorDirective *CreateEmpty(
const ASTContext &C,
7075 unsigned NumClauses, EmptyShell);
7078 return T->getStmtClass() == OMPErrorDirectiveClass;
7089 OMPAssumeDirective(SourceLocation StartLoc, SourceLocation EndLoc)
7091 StartLoc, EndLoc) {}
7095 SourceLocation(), SourceLocation()) {}
7098 static OMPAssumeDirective *
Create(
const ASTContext &Ctx,
7099 SourceLocation StartLoc,
7100 SourceLocation EndLoc,
7101 ArrayRef<OMPClause *> Clauses, Stmt *AStmt);
7103 static OMPAssumeDirective *CreateEmpty(
const ASTContext &C,
7104 unsigned NumClauses, EmptyShell);
7107 return T->getStmtClass() == OMPAssumeDirectiveClass;
7122 clang::OMPLoopTransformationDirective *, clang::Stmt *,
7123 CastInfo<clang::OMPLoopTransformationDirective, clang::Stmt *>> {
7125 return clang::OMPLoopTransformationDirective::classof(T);
7130 dyn_cast<clang::OMPCanonicalLoopNestTransformationDirective>(T))
7131 return static_cast<clang::OMPLoopTransformationDirective *
>(D);
7133 dyn_cast<clang::OMPCanonicalLoopSequenceTransformationDirective>(T))
7134 return static_cast<clang::OMPLoopTransformationDirective *
>(D);
7135 llvm_unreachable(
"unexpected type");
7141 clang::OMPLoopTransformationDirective, const clang::Stmt *,
7142 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 * getFinals() const
Return finals statement.
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 * getFinals() const
Return finals statement.
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.
Stmt * getFinals() const
Return finals statement.
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 * getFinals() const
Return finals statement (loop variable finalization).
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.
Stmt * getFinals() const
Return finals statement (loop variable finalization).
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
Stmt * getFinals() const
Return finals statement (loop variable finalization).
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.
Stmt * getFinals() const
Return finals statement, used when an enclosing loop transformation consumes the unrolled loop.
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 __builtin_riscv_mqwacc_i64 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.