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() == OMPTargetGenericLoopDirectiveClass ||
1646 T->getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass ||
1647 T->getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass ||
1648 T->getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass ||
1649 T->getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass ||
1650 T->getStmtClass() == OMPDistributeDirectiveClass ||
1651 T->getStmtClass() == OMPTargetParallelForDirectiveClass ||
1652 T->getStmtClass() == OMPDistributeParallelForDirectiveClass ||
1653 T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass ||
1654 T->getStmtClass() == OMPDistributeSimdDirectiveClass ||
1655 T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass ||
1656 T->getStmtClass() == OMPTargetSimdDirectiveClass ||
1657 T->getStmtClass() == OMPTeamsDistributeDirectiveClass ||
1658 T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass ||
1659 T->getStmtClass() ==
1660 OMPTeamsDistributeParallelForSimdDirectiveClass ||
1661 T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass ||
1662 T->getStmtClass() ==
1663 OMPTargetTeamsDistributeParallelForDirectiveClass ||
1664 T->getStmtClass() ==
1665 OMPTargetTeamsDistributeParallelForSimdDirectiveClass ||
1666 T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass ||
1667 T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
1689 OMPSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1690 unsigned CollapsedNum)
1692 EndLoc, CollapsedNum) {}
1700 SourceLocation(), SourceLocation(), CollapsedNum) {}
1713 static OMPSimdDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
1714 SourceLocation EndLoc,
unsigned CollapsedNum,
1715 ArrayRef<OMPClause *> Clauses,
1716 Stmt *AssociatedStmt,
1717 const HelperExprs &Exprs);
1726 static OMPSimdDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
1727 unsigned CollapsedNum, EmptyShell);
1730 return T->getStmtClass() == OMPSimdDirectiveClass;
1747 bool HasCancel =
false;
1755 OMPForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1756 unsigned CollapsedNum)
1758 EndLoc, CollapsedNum) {}
1766 SourceLocation(), SourceLocation(), CollapsedNum) {}
1769 void setTaskReductionRefExpr(Expr *E) {
1770 Data->getChildren()[numLoopChildren(getLoopsNumber(),
1771 llvm::omp::OMPD_for)] = E;
1775 void setHasCancel(
bool Has) { HasCancel = Has; }
1791 static OMPForDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
1792 SourceLocation EndLoc,
unsigned CollapsedNum,
1793 ArrayRef<OMPClause *> Clauses,
1794 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
1795 Expr *TaskRedRef,
bool HasCancel);
1804 static OMPForDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
1805 unsigned CollapsedNum, EmptyShell);
1810 getLoopsNumber(), llvm::omp::OMPD_for)]);
1820 return T->getStmtClass() == OMPForDirectiveClass;
1842 OMPForSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1843 unsigned CollapsedNum)
1845 StartLoc, EndLoc, CollapsedNum) {}
1853 SourceLocation(), SourceLocation(), CollapsedNum) {}
1866 static OMPForSimdDirective *
1867 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1868 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
1869 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
1878 static OMPForSimdDirective *CreateEmpty(
const ASTContext &C,
1879 unsigned NumClauses,
1880 unsigned CollapsedNum, EmptyShell);
1883 return T->getStmtClass() == OMPForSimdDirectiveClass;
1901 bool HasCancel =
false;
1908 OMPSectionsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1910 llvm::omp::OMPD_sections, StartLoc, EndLoc) {}
1916 llvm::omp::OMPD_sections, SourceLocation(),
1917 SourceLocation()) {}
1920 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
1923 void setHasCancel(
bool Has) { HasCancel = Has; }
1937 static OMPSectionsDirective *
1938 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1939 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
1948 static OMPSectionsDirective *CreateEmpty(
const ASTContext &C,
1949 unsigned NumClauses, EmptyShell);
1953 return cast_or_null<Expr>(Data->getChildren()[0]);
1963 return T->getStmtClass() == OMPSectionsDirectiveClass;
1978 bool HasCancel =
false;
1985 OMPSectionDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1987 llvm::omp::OMPD_section, StartLoc, EndLoc) {}
1993 llvm::omp::OMPD_section, SourceLocation(),
1994 SourceLocation()) {}
2005 static OMPSectionDirective *
Create(
const ASTContext &C,
2006 SourceLocation StartLoc,
2007 SourceLocation EndLoc,
2008 Stmt *AssociatedStmt,
bool HasCancel);
2014 static OMPSectionDirective *CreateEmpty(
const ASTContext &C, EmptyShell);
2023 return T->getStmtClass() == OMPSectionDirectiveClass;
2043 OMPScopeDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2045 StartLoc, EndLoc) {}
2051 SourceLocation(), SourceLocation()) {}
2061 static OMPScopeDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
2062 SourceLocation EndLoc,
2063 ArrayRef<OMPClause *> Clauses,
2064 Stmt *AssociatedStmt);
2070 static OMPScopeDirective *CreateEmpty(
const ASTContext &C,
2071 unsigned NumClauses, EmptyShell);
2074 return T->getStmtClass() == OMPScopeDirectiveClass;
2094 OMPSingleDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2096 StartLoc, EndLoc) {}
2102 SourceLocation(), SourceLocation()) {}
2113 static OMPSingleDirective *
2114 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2115 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2123 static OMPSingleDirective *CreateEmpty(
const ASTContext &C,
2124 unsigned NumClauses, EmptyShell);
2127 return T->getStmtClass() == OMPSingleDirectiveClass;
2145 OMPMasterDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2147 StartLoc, EndLoc) {}
2153 SourceLocation(), SourceLocation()) {}
2163 static OMPMasterDirective *
Create(
const ASTContext &C,
2164 SourceLocation StartLoc,
2165 SourceLocation EndLoc,
2166 Stmt *AssociatedStmt);
2172 static OMPMasterDirective *CreateEmpty(
const ASTContext &C, EmptyShell);
2175 return T->getStmtClass() == OMPMasterDirectiveClass;
2189 DeclarationNameInfo DirName;
2196 OMPCriticalDirective(
const DeclarationNameInfo &Name, SourceLocation StartLoc,
2197 SourceLocation EndLoc)
2199 llvm::omp::OMPD_critical, StartLoc, EndLoc),
2206 llvm::omp::OMPD_critical, SourceLocation(),
2207 SourceLocation()) {}
2213 void setDirectiveName(
const DeclarationNameInfo &Name) { DirName = Name; }
2225 static OMPCriticalDirective *
2226 Create(
const ASTContext &C,
const DeclarationNameInfo &Name,
2227 SourceLocation StartLoc, SourceLocation EndLoc,
2228 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2235 static OMPCriticalDirective *CreateEmpty(
const ASTContext &C,
2236 unsigned NumClauses, EmptyShell);
2243 return T->getStmtClass() == OMPCriticalDirectiveClass;
2261 bool HasCancel =
false;
2269 OMPParallelForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2270 unsigned CollapsedNum)
2272 llvm::omp::OMPD_parallel_for, StartLoc, EndLoc,
2281 llvm::omp::OMPD_parallel_for, SourceLocation(),
2282 SourceLocation(), CollapsedNum) {}
2285 void setTaskReductionRefExpr(Expr *E) {
2286 Data->getChildren()[numLoopChildren(getLoopsNumber(),
2287 llvm::omp::OMPD_parallel_for)] = E;
2291 void setHasCancel(
bool Has) { HasCancel = Has; }
2307 static OMPParallelForDirective *
2308 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2309 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2310 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
2320 static OMPParallelForDirective *CreateEmpty(
const ASTContext &C,
2321 unsigned NumClauses,
2322 unsigned CollapsedNum,
2328 getLoopsNumber(), llvm::omp::OMPD_parallel_for)]);
2331 return const_cast<OMPParallelForDirective *
>(
this)
2339 return T->getStmtClass() == OMPParallelForDirectiveClass;
2362 OMPParallelForSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2363 unsigned CollapsedNum)
2365 llvm::omp::OMPD_parallel_for_simd, StartLoc, EndLoc,
2374 llvm::omp::OMPD_parallel_for_simd, SourceLocation(),
2375 SourceLocation(), CollapsedNum) {}
2388 static OMPParallelForSimdDirective *
2389 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2390 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2391 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
2400 static OMPParallelForSimdDirective *CreateEmpty(
const ASTContext &C,
2401 unsigned NumClauses,
2402 unsigned CollapsedNum,
2406 return T->getStmtClass() == OMPParallelForSimdDirectiveClass;
2422 OMPParallelMasterDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2424 llvm::omp::OMPD_parallel_master, StartLoc,
2429 llvm::omp::OMPD_parallel_master,
2430 SourceLocation(), SourceLocation()) {}
2433 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2446 static OMPParallelMasterDirective *
2447 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2448 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);
2456 static OMPParallelMasterDirective *
2457 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2461 return cast_or_null<Expr>(Data->getChildren()[0]);
2464 return const_cast<OMPParallelMasterDirective *
>(
this)
2469 return T->getStmtClass() == OMPParallelMasterDirectiveClass;
2485 OMPParallelMaskedDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2487 llvm::omp::OMPD_parallel_masked, StartLoc,
2492 llvm::omp::OMPD_parallel_masked,
2493 SourceLocation(), SourceLocation()) {}
2496 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2509 static OMPParallelMaskedDirective *
2510 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2511 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);
2519 static OMPParallelMaskedDirective *
2520 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2524 return cast_or_null<Expr>(Data->getChildren()[0]);
2527 return const_cast<OMPParallelMaskedDirective *
>(
this)
2532 return T->getStmtClass() == OMPParallelMaskedDirectiveClass;
2550 bool HasCancel =
false;
2557 OMPParallelSectionsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2559 llvm::omp::OMPD_parallel_sections, StartLoc,
2566 llvm::omp::OMPD_parallel_sections,
2567 SourceLocation(), SourceLocation()) {}
2570 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
2573 void setHasCancel(
bool Has) { HasCancel = Has; }
2587 static OMPParallelSectionsDirective *
2588 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2589 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
2598 static OMPParallelSectionsDirective *
2599 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
2603 return cast_or_null<Expr>(Data->getChildren()[0]);
2606 return const_cast<OMPParallelSectionsDirective *
>(
this)
2614 return T->getStmtClass() == OMPParallelSectionsDirectiveClass;
2630 bool HasCancel =
false;
2637 OMPTaskDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2639 StartLoc, EndLoc) {}
2645 SourceLocation(), SourceLocation()) {}
2648 void setHasCancel(
bool Has) { HasCancel = Has; }
2660 static OMPTaskDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
2661 SourceLocation EndLoc,
2662 ArrayRef<OMPClause *> Clauses,
2663 Stmt *AssociatedStmt,
bool HasCancel);
2671 static OMPTaskDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
2678 return T->getStmtClass() == OMPTaskDirectiveClass;
2696 OMPTaskyieldDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2698 llvm::omp::OMPD_taskyield, StartLoc, EndLoc) {}
2704 llvm::omp::OMPD_taskyield, SourceLocation(),
2705 SourceLocation()) {}
2714 static OMPTaskyieldDirective *
2715 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc);
2721 static OMPTaskyieldDirective *CreateEmpty(
const ASTContext &C, EmptyShell);
2724 return T->getStmtClass() == OMPTaskyieldDirectiveClass;
2742 OMPBarrierDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2744 llvm::omp::OMPD_barrier, StartLoc, EndLoc) {}
2750 llvm::omp::OMPD_barrier, SourceLocation(),
2751 SourceLocation()) {}
2760 static OMPBarrierDirective *
2761 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc);
2767 static OMPBarrierDirective *CreateEmpty(
const ASTContext &C, EmptyShell);
2770 return T->getStmtClass() == OMPBarrierDirectiveClass;
2788 OMPTaskwaitDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2790 llvm::omp::OMPD_taskwait, StartLoc, EndLoc) {}
2796 llvm::omp::OMPD_taskwait, SourceLocation(),
2797 SourceLocation()) {}
2807 static OMPTaskwaitDirective *
Create(
const ASTContext &C,
2808 SourceLocation StartLoc,
2809 SourceLocation EndLoc,
2810 ArrayRef<OMPClause *> Clauses);
2817 static OMPTaskwaitDirective *CreateEmpty(
const ASTContext &C,
2818 unsigned NumClauses, EmptyShell);
2821 return T->getStmtClass() == OMPTaskwaitDirectiveClass;
2839 OMPTaskgroupDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2841 llvm::omp::OMPD_taskgroup, StartLoc, EndLoc) {}
2847 llvm::omp::OMPD_taskgroup, SourceLocation(),
2848 SourceLocation()) {}
2851 void setReductionRef(Expr *RR) {
Data->getChildren()[0] = RR; }
2863 static OMPTaskgroupDirective *
2864 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2865 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2866 Expr *ReductionRef);
2873 static OMPTaskgroupDirective *CreateEmpty(
const ASTContext &C,
2874 unsigned NumClauses, EmptyShell);
2884 return T->getStmtClass() == OMPTaskgroupDirectiveClass;
2906 OMPFlushDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2908 StartLoc, EndLoc) {}
2914 SourceLocation(), SourceLocation()) {}
2925 static OMPFlushDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
2926 SourceLocation EndLoc,
2927 ArrayRef<OMPClause *> Clauses);
2935 static OMPFlushDirective *CreateEmpty(
const ASTContext &C,
2936 unsigned NumClauses, EmptyShell);
2939 return T->getStmtClass() == OMPFlushDirectiveClass;
2959 OMPDepobjDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2961 StartLoc, EndLoc) {}
2967 SourceLocation(), SourceLocation()) {}
2977 static OMPDepobjDirective *
Create(
const ASTContext &C,
2978 SourceLocation StartLoc,
2979 SourceLocation EndLoc,
2980 ArrayRef<OMPClause *> Clauses);
2988 static OMPDepobjDirective *CreateEmpty(
const ASTContext &C,
2989 unsigned NumClauses, EmptyShell);
2992 return T->getStmtClass() == OMPDepobjDirectiveClass;
3010 OMPOrderedStandaloneDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3012 llvm::omp::OMPD_ordered_standalone, StartLoc,
3019 llvm::omp::OMPD_ordered_standalone,
3020 SourceLocation(), SourceLocation()) {}
3030 static OMPOrderedStandaloneDirective *
Create(
const ASTContext &C,
3031 SourceLocation StartLoc,
3032 SourceLocation EndLoc,
3033 ArrayRef<OMPClause *> Clauses);
3040 static OMPOrderedStandaloneDirective *
3041 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
3044 return T->getStmtClass() == OMPOrderedStandaloneDirectiveClass;
3063 OMPOrderedBlockAssocDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3065 llvm::omp::OMPD_ordered_blockassoc, StartLoc,
3072 llvm::omp::OMPD_ordered_blockassoc,
3073 SourceLocation(), SourceLocation()) {}
3084 static OMPOrderedBlockAssocDirective *
3085 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3086 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3093 static OMPOrderedBlockAssocDirective *
3094 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
3097 return T->getStmtClass() == OMPOrderedBlockAssocDirectiveClass;
3122 LLVM_PREFERRED_TYPE(
bool)
3132 LLVM_PREFERRED_TYPE(
bool)
3136 LLVM_PREFERRED_TYPE(
bool)
3147 StartLoc, EndLoc) {}
3151 explicit OMPAtomicDirective()
3152 : OMPExecutableDirective(OMPAtomicDirectiveClass, llvm::omp::OMPD_atomic,
3153 SourceLocation(), SourceLocation()) {}
3155 enum DataPositionTy :
size_t {
3166 void setX(Expr *
X) {
Data->getChildren()[DataPositionTy::POS_X] =
X; }
3170 void setUpdateExpr(Expr *UE) {
3171 Data->getChildren()[DataPositionTy::POS_UpdateExpr] = UE;
3174 void setV(Expr *
V) {
Data->getChildren()[DataPositionTy::POS_V] =
V; }
3176 void setR(Expr *R) {
Data->getChildren()[DataPositionTy::POS_R] =
R; }
3178 void setExpr(Expr *E) {
Data->getChildren()[DataPositionTy::POS_E] = E; }
3180 void setD(Expr *D) {
Data->getChildren()[DataPositionTy::POS_D] = D; }
3182 void setCond(Expr *C) {
Data->getChildren()[DataPositionTy::POS_Cond] =
C; }
3222 SourceLocation StartLoc,
3223 SourceLocation EndLoc,
3234 unsigned NumClauses, EmptyShell);
3238 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_X]);
3241 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_X]);
3247 return cast_or_null<Expr>(
3248 Data->getChildren()[DataPositionTy::POS_UpdateExpr]);
3251 return cast_or_null<Expr>(
3252 Data->getChildren()[DataPositionTy::POS_UpdateExpr]);
3266 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_V]);
3269 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_V]);
3273 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_R]);
3276 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_R]);
3280 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_E]);
3283 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_E]);
3287 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_D]);
3290 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_D]);
3294 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_Cond]);
3297 return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_Cond]);
3301 return T->getStmtClass() == OMPAtomicDirectiveClass;
3321 OMPTargetDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3323 StartLoc, EndLoc) {}
3329 SourceLocation(), SourceLocation()) {}
3340 static OMPTargetDirective *
3341 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3342 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3350 static OMPTargetDirective *CreateEmpty(
const ASTContext &C,
3351 unsigned NumClauses, EmptyShell);
3354 return T->getStmtClass() == OMPTargetDirectiveClass;
3375 OMPTargetDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3377 llvm::omp::OMPD_target_data, StartLoc, EndLoc) {}
3383 llvm::omp::OMPD_target_data, SourceLocation(),
3384 SourceLocation()) {}
3395 static OMPTargetDataDirective *
3396 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3397 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3404 static OMPTargetDataDirective *CreateEmpty(
const ASTContext &C,
unsigned N,
3408 return T->getStmtClass() == OMPTargetDataDirectiveClass;
3429 OMPTargetEnterDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3431 llvm::omp::OMPD_target_enter_data, StartLoc,
3438 llvm::omp::OMPD_target_enter_data,
3439 SourceLocation(), SourceLocation()) {}
3450 static OMPTargetEnterDataDirective *
3451 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3452 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3459 static OMPTargetEnterDataDirective *CreateEmpty(
const ASTContext &C,
3460 unsigned N, EmptyShell);
3463 return T->getStmtClass() == OMPTargetEnterDataDirectiveClass;
3484 OMPTargetExitDataDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3486 llvm::omp::OMPD_target_exit_data, StartLoc,
3493 llvm::omp::OMPD_target_exit_data,
3494 SourceLocation(), SourceLocation()) {}
3505 static OMPTargetExitDataDirective *
3506 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3507 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3514 static OMPTargetExitDataDirective *CreateEmpty(
const ASTContext &C,
3515 unsigned N, EmptyShell);
3518 return T->getStmtClass() == OMPTargetExitDataDirectiveClass;
3534 bool HasCancel =
false;
3541 OMPTargetParallelDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3543 llvm::omp::OMPD_target_parallel, StartLoc,
3550 llvm::omp::OMPD_target_parallel,
3551 SourceLocation(), SourceLocation()) {}
3554 void setTaskReductionRefExpr(Expr *E) {
Data->getChildren()[0] = E; }
3556 void setHasCancel(
bool Has) { HasCancel = Has; }
3570 static OMPTargetParallelDirective *
3571 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3572 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
3581 static OMPTargetParallelDirective *
3582 CreateEmpty(
const ASTContext &C,
unsigned NumClauses, EmptyShell);
3586 return cast_or_null<Expr>(Data->getChildren()[0]);
3589 return const_cast<OMPTargetParallelDirective *
>(
this)
3597 return T->getStmtClass() == OMPTargetParallelDirectiveClass;
3615 bool HasCancel =
false;
3623 OMPTargetParallelForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3624 unsigned CollapsedNum)
3626 llvm::omp::OMPD_target_parallel_for, StartLoc, EndLoc,
3635 llvm::omp::OMPD_target_parallel_for, SourceLocation(),
3636 SourceLocation(), CollapsedNum) {}
3639 void setTaskReductionRefExpr(Expr *E) {
3640 Data->getChildren()[numLoopChildren(
3641 getLoopsNumber(), llvm::omp::OMPD_target_parallel_for)] = E;
3645 void setHasCancel(
bool Has) { HasCancel = Has; }
3661 static OMPTargetParallelForDirective *
3662 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3663 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3664 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
3674 static OMPTargetParallelForDirective *CreateEmpty(
const ASTContext &C,
3675 unsigned NumClauses,
3676 unsigned CollapsedNum,
3682 getLoopsNumber(), llvm::omp::OMPD_target_parallel_for)]);
3685 return const_cast<OMPTargetParallelForDirective *
>(
this)
3693 return T->getStmtClass() == OMPTargetParallelForDirectiveClass;
3713 OMPTeamsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3715 StartLoc, EndLoc) {}
3721 SourceLocation(), SourceLocation()) {}
3732 static OMPTeamsDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
3733 SourceLocation EndLoc,
3734 ArrayRef<OMPClause *> Clauses,
3735 Stmt *AssociatedStmt);
3743 static OMPTeamsDirective *CreateEmpty(
const ASTContext &C,
3744 unsigned NumClauses, EmptyShell);
3747 return T->getStmtClass() == OMPTeamsDirectiveClass;
3761 OpenMPDirectiveKind CancelRegion = llvm::omp::OMPD_unknown;
3768 OMPCancellationPointDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3770 llvm::omp::OMPD_cancellation_point, StartLoc,
3776 llvm::omp::OMPD_cancellation_point,
3777 SourceLocation(), SourceLocation()) {}
3781 void setCancelRegion(OpenMPDirectiveKind CR) { CancelRegion = CR; }
3790 static OMPCancellationPointDirective *
3791 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3792 OpenMPDirectiveKind CancelRegion);
3798 static OMPCancellationPointDirective *CreateEmpty(
const ASTContext &C,
3805 return T->getStmtClass() == OMPCancellationPointDirectiveClass;
3819 OpenMPDirectiveKind CancelRegion = llvm::omp::OMPD_unknown;
3825 OMPCancelDirective(SourceLocation StartLoc, SourceLocation EndLoc)
3827 StartLoc, EndLoc) {}
3833 SourceLocation(), SourceLocation()) {}
3837 void setCancelRegion(OpenMPDirectiveKind CR) { CancelRegion = CR; }
3847 static OMPCancelDirective *
3848 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3849 ArrayRef<OMPClause *> Clauses, OpenMPDirectiveKind CancelRegion);
3856 static OMPCancelDirective *CreateEmpty(
const ASTContext &C,
3857 unsigned NumClauses, EmptyShell);
3863 return T->getStmtClass() == OMPCancelDirectiveClass;
3880 bool HasCancel =
false;
3888 OMPTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3889 unsigned CollapsedNum)
3891 StartLoc, EndLoc, CollapsedNum) {}
3899 SourceLocation(), SourceLocation(), CollapsedNum) {}
3902 void setHasCancel(
bool Has) { HasCancel = Has; }
3916 static OMPTaskLoopDirective *
3917 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3918 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3919 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
3928 static OMPTaskLoopDirective *CreateEmpty(
const ASTContext &C,
3929 unsigned NumClauses,
3930 unsigned CollapsedNum, EmptyShell);
3936 return T->getStmtClass() == OMPTaskLoopDirectiveClass;
3958 OMPTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3959 unsigned CollapsedNum)
3961 llvm::omp::OMPD_taskloop_simd, StartLoc, EndLoc,
3970 llvm::omp::OMPD_taskloop_simd, SourceLocation(),
3971 SourceLocation(), CollapsedNum) {}
3984 static OMPTaskLoopSimdDirective *
3985 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3986 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3987 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
3996 static OMPTaskLoopSimdDirective *CreateEmpty(
const ASTContext &C,
3997 unsigned NumClauses,
3998 unsigned CollapsedNum,
4002 return T->getStmtClass() == OMPTaskLoopSimdDirectiveClass;
4019 bool HasCancel =
false;
4027 OMPMasterTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4028 unsigned CollapsedNum)
4030 llvm::omp::OMPD_master_taskloop, StartLoc, EndLoc,
4039 llvm::omp::OMPD_master_taskloop, SourceLocation(),
4040 SourceLocation(), CollapsedNum) {}
4043 void setHasCancel(
bool Has) { HasCancel = Has; }
4057 static OMPMasterTaskLoopDirective *
4058 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4059 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4060 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4069 static OMPMasterTaskLoopDirective *CreateEmpty(
const ASTContext &C,
4070 unsigned NumClauses,
4071 unsigned CollapsedNum,
4078 return T->getStmtClass() == OMPMasterTaskLoopDirectiveClass;
4095 bool HasCancel =
false;
4103 OMPMaskedTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4104 unsigned CollapsedNum)
4106 llvm::omp::OMPD_masked_taskloop, StartLoc, EndLoc,
4115 llvm::omp::OMPD_masked_taskloop, SourceLocation(),
4116 SourceLocation(), CollapsedNum) {}
4119 void setHasCancel(
bool Has) { HasCancel = Has; }
4133 static OMPMaskedTaskLoopDirective *
4134 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4135 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4136 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4145 static OMPMaskedTaskLoopDirective *CreateEmpty(
const ASTContext &C,
4146 unsigned NumClauses,
4147 unsigned CollapsedNum,
4154 return T->getStmtClass() == OMPMaskedTaskLoopDirectiveClass;
4176 OMPMasterTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4177 unsigned CollapsedNum)
4179 llvm::omp::OMPD_master_taskloop_simd, StartLoc, EndLoc,
4188 llvm::omp::OMPD_master_taskloop_simd, SourceLocation(),
4189 SourceLocation(), CollapsedNum) {}
4202 static OMPMasterTaskLoopSimdDirective *
4203 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4204 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4205 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4213 static OMPMasterTaskLoopSimdDirective *CreateEmpty(
const ASTContext &C,
4214 unsigned NumClauses,
4215 unsigned CollapsedNum,
4219 return T->getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass;
4241 OMPMaskedTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4242 unsigned CollapsedNum)
4244 llvm::omp::OMPD_masked_taskloop_simd, StartLoc, EndLoc,
4253 llvm::omp::OMPD_masked_taskloop_simd, SourceLocation(),
4254 SourceLocation(), CollapsedNum) {}
4267 static OMPMaskedTaskLoopSimdDirective *
4268 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4269 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4270 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4278 static OMPMaskedTaskLoopSimdDirective *CreateEmpty(
const ASTContext &C,
4279 unsigned NumClauses,
4280 unsigned CollapsedNum,
4284 return T->getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass;
4302 bool HasCancel =
false;
4310 OMPParallelMasterTaskLoopDirective(SourceLocation StartLoc,
4311 SourceLocation EndLoc,
4312 unsigned CollapsedNum)
4314 llvm::omp::OMPD_parallel_master_taskloop, StartLoc,
4315 EndLoc, CollapsedNum) {}
4323 llvm::omp::OMPD_parallel_master_taskloop,
4324 SourceLocation(), SourceLocation(), CollapsedNum) {}
4327 void setHasCancel(
bool Has) { HasCancel = Has; }
4341 static OMPParallelMasterTaskLoopDirective *
4342 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4343 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4344 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4353 static OMPParallelMasterTaskLoopDirective *CreateEmpty(
const ASTContext &C,
4354 unsigned NumClauses,
4355 unsigned CollapsedNum,
4362 return T->getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass;
4380 bool HasCancel =
false;
4388 OMPParallelMaskedTaskLoopDirective(SourceLocation StartLoc,
4389 SourceLocation EndLoc,
4390 unsigned CollapsedNum)
4392 llvm::omp::OMPD_parallel_masked_taskloop, StartLoc,
4393 EndLoc, CollapsedNum) {}
4401 llvm::omp::OMPD_parallel_masked_taskloop,
4402 SourceLocation(), SourceLocation(), CollapsedNum) {}
4405 void setHasCancel(
bool Has) { HasCancel = Has; }
4419 static OMPParallelMaskedTaskLoopDirective *
4420 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4421 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4422 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4431 static OMPParallelMaskedTaskLoopDirective *CreateEmpty(
const ASTContext &C,
4432 unsigned NumClauses,
4433 unsigned CollapsedNum,
4440 return T->getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass;
4463 OMPParallelMasterTaskLoopSimdDirective(SourceLocation StartLoc,
4464 SourceLocation EndLoc,
4465 unsigned CollapsedNum)
4467 llvm::omp::OMPD_parallel_master_taskloop_simd,
4468 StartLoc, EndLoc, CollapsedNum) {}
4476 llvm::omp::OMPD_parallel_master_taskloop_simd,
4477 SourceLocation(), SourceLocation(), CollapsedNum) {}
4490 static OMPParallelMasterTaskLoopSimdDirective *
4491 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4492 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4493 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4502 static OMPParallelMasterTaskLoopSimdDirective *
4503 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4507 return T->getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass;
4530 OMPParallelMaskedTaskLoopSimdDirective(SourceLocation StartLoc,
4531 SourceLocation EndLoc,
4532 unsigned CollapsedNum)
4534 llvm::omp::OMPD_parallel_masked_taskloop_simd,
4535 StartLoc, EndLoc, CollapsedNum) {}
4543 llvm::omp::OMPD_parallel_masked_taskloop_simd,
4544 SourceLocation(), SourceLocation(), CollapsedNum) {}
4557 static OMPParallelMaskedTaskLoopSimdDirective *
4558 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4559 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4560 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4569 static OMPParallelMaskedTaskLoopSimdDirective *
4570 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4574 return T->getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass;
4596 OMPDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4597 unsigned CollapsedNum)
4599 llvm::omp::OMPD_distribute, StartLoc, EndLoc,
4608 llvm::omp::OMPD_distribute, SourceLocation(),
4609 SourceLocation(), CollapsedNum) {}
4622 static OMPDistributeDirective *
4623 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4624 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4625 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4634 static OMPDistributeDirective *CreateEmpty(
const ASTContext &C,
4635 unsigned NumClauses,
4636 unsigned CollapsedNum, EmptyShell);
4639 return T->getStmtClass() == OMPDistributeDirectiveClass;
4660 OMPTargetUpdateDirective(SourceLocation StartLoc, SourceLocation EndLoc)
4662 llvm::omp::OMPD_target_update, StartLoc,
4669 llvm::omp::OMPD_target_update, SourceLocation(),
4670 SourceLocation()) {}
4681 static OMPTargetUpdateDirective *
4682 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4683 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
4691 static OMPTargetUpdateDirective *CreateEmpty(
const ASTContext &C,
4692 unsigned NumClauses, EmptyShell);
4695 return T->getStmtClass() == OMPTargetUpdateDirectiveClass;
4712 bool HasCancel =
false;
4720 OMPDistributeParallelForDirective(SourceLocation StartLoc,
4721 SourceLocation EndLoc,
4722 unsigned CollapsedNum)
4724 llvm::omp::OMPD_distribute_parallel_for, StartLoc,
4725 EndLoc, CollapsedNum) {}
4733 llvm::omp::OMPD_distribute_parallel_for,
4734 SourceLocation(), SourceLocation(), CollapsedNum) {}
4737 void setTaskReductionRefExpr(Expr *E) {
4738 Data->getChildren()[numLoopChildren(
4739 getLoopsNumber(), llvm::omp::OMPD_distribute_parallel_for)] = E;
4743 void setHasCancel(
bool Has) { HasCancel = Has; }
4759 static OMPDistributeParallelForDirective *
4760 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4761 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4762 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
4772 static OMPDistributeParallelForDirective *CreateEmpty(
const ASTContext &C,
4773 unsigned NumClauses,
4774 unsigned CollapsedNum,
4780 getLoopsNumber(), llvm::omp::OMPD_distribute_parallel_for)]);
4783 return const_cast<OMPDistributeParallelForDirective *
>(
this)
4791 return T->getStmtClass() == OMPDistributeParallelForDirectiveClass;
4814 OMPDistributeParallelForSimdDirective(SourceLocation StartLoc,
4815 SourceLocation EndLoc,
4816 unsigned CollapsedNum)
4818 llvm::omp::OMPD_distribute_parallel_for_simd, StartLoc,
4819 EndLoc, CollapsedNum) {}
4827 llvm::omp::OMPD_distribute_parallel_for_simd,
4828 SourceLocation(), SourceLocation(), CollapsedNum) {}
4841 static OMPDistributeParallelForSimdDirective *
Create(
4842 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4843 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4844 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4852 static OMPDistributeParallelForSimdDirective *CreateEmpty(
4853 const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
4857 return T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass;
4879 OMPDistributeSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
4880 unsigned CollapsedNum)
4882 llvm::omp::OMPD_distribute_simd, StartLoc, EndLoc,
4891 llvm::omp::OMPD_distribute_simd, SourceLocation(),
4892 SourceLocation(), CollapsedNum) {}
4905 static OMPDistributeSimdDirective *
4906 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4907 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4908 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4916 static OMPDistributeSimdDirective *CreateEmpty(
const ASTContext &C,
4917 unsigned NumClauses,
4918 unsigned CollapsedNum,
4922 return T->getStmtClass() == OMPDistributeSimdDirectiveClass;
4945 OMPTargetParallelForSimdDirective(SourceLocation StartLoc,
4946 SourceLocation EndLoc,
4947 unsigned CollapsedNum)
4949 llvm::omp::OMPD_target_parallel_for_simd, StartLoc,
4950 EndLoc, CollapsedNum) {}
4958 llvm::omp::OMPD_target_parallel_for_simd,
4959 SourceLocation(), SourceLocation(), CollapsedNum) {}
4972 static OMPTargetParallelForSimdDirective *
4973 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
4974 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4975 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4983 static OMPTargetParallelForSimdDirective *CreateEmpty(
const ASTContext &C,
4984 unsigned NumClauses,
4985 unsigned CollapsedNum,
4989 return T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass;
5012 OMPTargetSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
5013 unsigned CollapsedNum)
5015 llvm::omp::OMPD_target_simd, StartLoc, EndLoc,
5024 llvm::omp::OMPD_target_simd, SourceLocation(),
5025 SourceLocation(), CollapsedNum) {}
5038 static OMPTargetSimdDirective *
5039 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5040 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5041 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5049 static OMPTargetSimdDirective *CreateEmpty(
const ASTContext &C,
5050 unsigned NumClauses,
5051 unsigned CollapsedNum,
5055 return T->getStmtClass() == OMPTargetSimdDirectiveClass;
5077 OMPTeamsDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
5078 unsigned CollapsedNum)
5080 llvm::omp::OMPD_teams_distribute, StartLoc, EndLoc,
5089 llvm::omp::OMPD_teams_distribute, SourceLocation(),
5090 SourceLocation(), CollapsedNum) {}
5103 static OMPTeamsDistributeDirective *
5104 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5105 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5106 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5114 static OMPTeamsDistributeDirective *CreateEmpty(
const ASTContext &C,
5115 unsigned NumClauses,
5116 unsigned CollapsedNum,
5120 return T->getStmtClass() == OMPTeamsDistributeDirectiveClass;
5143 OMPTeamsDistributeSimdDirective(SourceLocation StartLoc,
5144 SourceLocation EndLoc,
unsigned CollapsedNum)
5146 llvm::omp::OMPD_teams_distribute_simd, StartLoc,
5147 EndLoc, CollapsedNum) {}
5155 llvm::omp::OMPD_teams_distribute_simd,
5156 SourceLocation(), SourceLocation(), CollapsedNum) {}
5169 static OMPTeamsDistributeSimdDirective *
5170 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5171 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5172 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5181 static OMPTeamsDistributeSimdDirective *CreateEmpty(
const ASTContext &C,
5182 unsigned NumClauses,
5183 unsigned CollapsedNum,
5187 return T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass;
5200class OMPTeamsDistributeParallelForSimdDirective final
5211 OMPTeamsDistributeParallelForSimdDirective(SourceLocation StartLoc,
5212 SourceLocation EndLoc,
5213 unsigned CollapsedNum)
5215 llvm::omp::OMPD_teams_distribute_parallel_for_simd,
5216 StartLoc, EndLoc, CollapsedNum) {}
5224 llvm::omp::OMPD_teams_distribute_parallel_for_simd,
5225 SourceLocation(), SourceLocation(), CollapsedNum) {}
5238 static OMPTeamsDistributeParallelForSimdDirective *
5239 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5240 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5241 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5249 static OMPTeamsDistributeParallelForSimdDirective *
5250 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5254 return T->getStmtClass() == OMPTeamsDistributeParallelForSimdDirectiveClass;
5271 bool HasCancel =
false;
5279 OMPTeamsDistributeParallelForDirective(SourceLocation StartLoc,
5280 SourceLocation EndLoc,
5281 unsigned CollapsedNum)
5283 llvm::omp::OMPD_teams_distribute_parallel_for,
5284 StartLoc, EndLoc, CollapsedNum) {}
5292 llvm::omp::OMPD_teams_distribute_parallel_for,
5293 SourceLocation(), SourceLocation(), CollapsedNum) {}
5296 void setTaskReductionRefExpr(Expr *E) {
5297 Data->getChildren()[numLoopChildren(
5298 getLoopsNumber(), llvm::omp::OMPD_teams_distribute_parallel_for)] = E;
5302 void setHasCancel(
bool Has) { HasCancel = Has; }
5318 static OMPTeamsDistributeParallelForDirective *
5319 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5320 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5321 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
5330 static OMPTeamsDistributeParallelForDirective *
5331 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5337 getLoopsNumber(), llvm::omp::OMPD_teams_distribute_parallel_for)]);
5340 return const_cast<OMPTeamsDistributeParallelForDirective *
>(
this)
5348 return T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass;
5368 OMPTargetTeamsDirective(SourceLocation StartLoc, SourceLocation EndLoc)
5370 llvm::omp::OMPD_target_teams, StartLoc, EndLoc) {
5377 llvm::omp::OMPD_target_teams, SourceLocation(),
5378 SourceLocation()) {}
5389 static OMPTargetTeamsDirective *
Create(
const ASTContext &C,
5390 SourceLocation StartLoc,
5391 SourceLocation EndLoc,
5392 ArrayRef<OMPClause *> Clauses,
5393 Stmt *AssociatedStmt);
5400 static OMPTargetTeamsDirective *CreateEmpty(
const ASTContext &C,
5401 unsigned NumClauses, EmptyShell);
5404 return T->getStmtClass() == OMPTargetTeamsDirectiveClass;
5426 OMPTargetTeamsDistributeDirective(SourceLocation StartLoc,
5427 SourceLocation EndLoc,
5428 unsigned CollapsedNum)
5430 llvm::omp::OMPD_target_teams_distribute, StartLoc,
5431 EndLoc, CollapsedNum) {}
5439 llvm::omp::OMPD_target_teams_distribute,
5440 SourceLocation(), SourceLocation(), CollapsedNum) {}
5453 static OMPTargetTeamsDistributeDirective *
5454 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5455 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5456 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5464 static OMPTargetTeamsDistributeDirective *
5465 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5469 return T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass;
5482class OMPTargetTeamsDistributeParallelForDirective final
5487 bool HasCancel =
false;
5495 OMPTargetTeamsDistributeParallelForDirective(SourceLocation StartLoc,
5496 SourceLocation EndLoc,
5497 unsigned CollapsedNum)
5499 llvm::omp::OMPD_target_teams_distribute_parallel_for,
5500 StartLoc, EndLoc, CollapsedNum) {}
5508 llvm::omp::OMPD_target_teams_distribute_parallel_for,
5509 SourceLocation(), SourceLocation(), CollapsedNum) {}
5512 void setTaskReductionRefExpr(Expr *E) {
5513 Data->getChildren()[numLoopChildren(
5515 llvm::omp::OMPD_target_teams_distribute_parallel_for)] = E;
5519 void setHasCancel(
bool Has) { HasCancel = Has; }
5535 static OMPTargetTeamsDistributeParallelForDirective *
5536 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5537 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5538 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
5547 static OMPTargetTeamsDistributeParallelForDirective *
5548 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5555 llvm::omp::OMPD_target_teams_distribute_parallel_for)]);
5558 return const_cast<OMPTargetTeamsDistributeParallelForDirective *
>(
this)
5566 return T->getStmtClass() ==
5567 OMPTargetTeamsDistributeParallelForDirectiveClass;
5580class OMPTargetTeamsDistributeParallelForSimdDirective final
5591 OMPTargetTeamsDistributeParallelForSimdDirective(SourceLocation StartLoc,
5592 SourceLocation EndLoc,
5593 unsigned CollapsedNum)
5595 OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
5596 llvm::omp::OMPD_target_teams_distribute_parallel_for_simd, StartLoc,
5597 EndLoc, CollapsedNum) {}
5604 unsigned CollapsedNum)
5606 OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
5607 llvm::omp::OMPD_target_teams_distribute_parallel_for_simd,
5608 SourceLocation(), SourceLocation(), CollapsedNum) {}
5621 static OMPTargetTeamsDistributeParallelForSimdDirective *
5622 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5623 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5624 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5632 static OMPTargetTeamsDistributeParallelForSimdDirective *
5633 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5637 return T->getStmtClass() ==
5638 OMPTargetTeamsDistributeParallelForSimdDirectiveClass;
5661 OMPTargetTeamsDistributeSimdDirective(SourceLocation StartLoc,
5662 SourceLocation EndLoc,
5663 unsigned CollapsedNum)
5665 llvm::omp::OMPD_target_teams_distribute_simd, StartLoc,
5666 EndLoc, CollapsedNum) {}
5674 llvm::omp::OMPD_target_teams_distribute_simd,
5675 SourceLocation(), SourceLocation(), CollapsedNum) {}
5688 static OMPTargetTeamsDistributeSimdDirective *
5689 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5690 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5691 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5699 static OMPTargetTeamsDistributeSimdDirective *
5700 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
5704 return T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
5709class OMPTileDirective final
5717 TransformedStmtOffset,
5724 OMPTileDirectiveClass,
llvm::omp::OMPD_tile, StartLoc, EndLoc,
5727 void setPreInits(Stmt *PreInits) {
5728 Data->getChildren()[PreInitsOffset] = PreInits;
5731 void setTransformedStmt(Stmt *S) {
5732 Data->getChildren()[TransformedStmtOffset] = S;
5735 void setFinals(Stmt *Finals) {
Data->getChildren()[FinalsOffset] = Finals; }
5751 static OMPTileDirective *
5752 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5753 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
5754 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals);
5761 static OMPTileDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
5776 return Data->getChildren()[TransformedStmtOffset];
5780 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5783 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
5786 return T->getStmtClass() == OMPTileDirectiveClass;
5791class OMPStripeDirective final
5799 TransformedStmtOffset,
5806 OMPStripeDirectiveClass,
llvm::omp::OMPD_stripe, StartLoc, EndLoc,
5809 void setPreInits(Stmt *PreInits) {
5810 Data->getChildren()[PreInitsOffset] = PreInits;
5813 void setTransformedStmt(Stmt *S) {
5814 Data->getChildren()[TransformedStmtOffset] = S;
5817 void setFinals(Stmt *Finals) {
Data->getChildren()[FinalsOffset] = Finals; }
5833 static OMPStripeDirective *
5834 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5835 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
5836 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals);
5843 static OMPStripeDirective *
5844 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned NumLoops);
5857 return Data->getChildren()[TransformedStmtOffset];
5861 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5864 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
5867 return T->getStmtClass() == OMPStripeDirectiveClass;
5877class OMPUnrollDirective final
5885 TransformedStmtOffset,
5891 llvm::omp::OMPD_unroll,
5892 StartLoc, EndLoc, 1) {}
5895 void setPreInits(Stmt *PreInits) {
5896 Data->getChildren()[PreInitsOffset] = PreInits;
5899 void setFinals(Stmt *Finals) {
Data->getChildren()[FinalsOffset] = Finals; }
5902 void setTransformedStmt(Stmt *S) {
5903 Data->getChildren()[TransformedStmtOffset] = S;
5918 static OMPUnrollDirective *
5919 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5920 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
5921 unsigned NumGeneratedTopLevelLoops, Stmt *TransformedStmt,
5922 Stmt *PreInits, Stmt *Finals);
5928 static OMPUnrollDirective *CreateEmpty(
const ASTContext &C,
5929 unsigned NumClauses);
5939 return Data->getChildren()[TransformedStmtOffset];
5943 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
5947 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
5950 return T->getStmtClass() == OMPUnrollDirectiveClass;
5961class OMPReverseDirective final
5969 TransformedStmtOffset,
5976 OMPReverseDirectiveClass,
llvm::omp::OMPD_reverse, StartLoc, EndLoc,
5979 void setPreInits(Stmt *PreInits) {
5980 Data->getChildren()[PreInitsOffset] = PreInits;
5983 void setTransformedStmt(Stmt *S) {
5984 Data->getChildren()[TransformedStmtOffset] = S;
5987 void setFinals(Stmt *Finals) {
Data->getChildren()[FinalsOffset] = Finals; }
6001 static OMPReverseDirective *
6002 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6003 Stmt *AssociatedStmt,
unsigned NumLoops, Stmt *TransformedStmt,
6004 Stmt *PreInits, Stmt *Finals);
6010 static OMPReverseDirective *CreateEmpty(
const ASTContext &C,
6016 return Data->getChildren()[TransformedStmtOffset];
6020 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6023 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
6026 return T->getStmtClass() == OMPReverseDirectiveClass;
6038class OMPInterchangeDirective final
6046 TransformedStmtOffset,
6051 SourceLocation EndLoc,
unsigned NumLoops)
6053 OMPInterchangeDirectiveClass,
llvm::omp::OMPD_interchange, StartLoc,
6054 EndLoc, NumLoops) {}
6056 void setPreInits(Stmt *PreInits) {
6057 Data->getChildren()[PreInitsOffset] = PreInits;
6060 void setTransformedStmt(Stmt *S) {
6061 Data->getChildren()[TransformedStmtOffset] = S;
6064 void setFinals(Stmt *Finals) {
Data->getChildren()[FinalsOffset] = Finals; }
6080 static OMPInterchangeDirective *
6081 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6082 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
6083 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals);
6090 static OMPInterchangeDirective *
6091 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned NumLoops);
6096 return Data->getChildren()[TransformedStmtOffset];
6100 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6103 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
6106 return T->getStmtClass() == OMPInterchangeDirectiveClass;
6118class OMPFlattenDirective final
6126 TransformedStmtOffset,
6133 OMPFlattenDirectiveClass,
llvm::omp::OMPD_flatten, StartLoc, EndLoc,
6136 void setPreInits(Stmt *PreInits) {
6137 Data->getChildren()[PreInitsOffset] = PreInits;
6140 void setTransformedStmt(Stmt *S) {
6141 Data->getChildren()[TransformedStmtOffset] = S;
6144 void setFinals(Stmt *S) {
Data->getChildren()[FinalsOffset] = S; }
6160 static OMPFlattenDirective *
6161 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6162 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
6163 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals);
6170 static OMPFlattenDirective *
6171 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned NumLoops);
6176 return Data->getChildren()[TransformedStmtOffset];
6180 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6183 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
6186 return T->getStmtClass() == OMPFlattenDirectiveClass;
6199 StmtClass SC, OpenMPDirectiveKind Kind, SourceLocation StartLoc,
6200 SourceLocation EndLoc)
6210 Stmt *getTransformedStmt()
const;
6213 Stmt *getPreInits()
const;
6217 Stmt *getFinals()
const;
6220 Stmt::StmtClass C = T->getStmtClass();
6221 return C == OMPFuseDirectiveClass;
6235class OMPFuseDirective final
6243 TransformedStmtOffset,
6249 OMPFuseDirectiveClass,
llvm::omp::OMPD_fuse, StartLoc, EndLoc) {}
6251 void setPreInits(Stmt *PreInits) {
6252 Data->getChildren()[PreInitsOffset] = PreInits;
6255 void setTransformedStmt(Stmt *S) {
6256 Data->getChildren()[TransformedStmtOffset] = S;
6259 void setFinals(Stmt *Finals) {
Data->getChildren()[FinalsOffset] = Finals; }
6277 static OMPFuseDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
6278 SourceLocation EndLoc,
6279 ArrayRef<OMPClause *> Clauses,
6280 unsigned NumGeneratedTopLevelLoops,
6281 Stmt *AssociatedStmt, Stmt *TransformedStmt,
6282 Stmt *PreInits, Stmt *Finals);
6289 static OMPFuseDirective *CreateEmpty(
const ASTContext &C,
6290 unsigned NumClauses);
6295 return Data->getChildren()[TransformedStmtOffset];
6299 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6302 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
6305 return T->getStmtClass() == OMPFuseDirectiveClass;
6321class OMPSplitDirective final
6329 TransformedStmtOffset,
6336 OMPSplitDirectiveClass,
llvm::omp::OMPD_split, StartLoc, EndLoc,
6339 void setPreInits(Stmt *PreInits) {
6340 Data->getChildren()[PreInitsOffset] = PreInits;
6343 void setTransformedStmt(Stmt *S) {
6344 Data->getChildren()[TransformedStmtOffset] = S;
6347 void setFinals(Stmt *Finals) {
Data->getChildren()[FinalsOffset] = Finals; }
6363 static OMPSplitDirective *
6364 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6365 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
6366 Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals);
6373 static OMPSplitDirective *CreateEmpty(
const ASTContext &C,
6374 unsigned NumClauses,
unsigned NumLoops);
6379 return Data->getChildren()[TransformedStmtOffset];
6383 Stmt *
getPreInits()
const {
return Data->getChildren()[PreInitsOffset]; }
6386 Stmt *
getFinals()
const {
return Data->getChildren()[FinalsOffset]; }
6389 return T->getStmtClass() == OMPSplitDirectiveClass;
6408 OMPScanDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6410 StartLoc, EndLoc) {}
6416 SourceLocation(), SourceLocation()) {}
6427 static OMPScanDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
6428 SourceLocation EndLoc,
6429 ArrayRef<OMPClause *> Clauses);
6437 static OMPScanDirective *CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
6441 return T->getStmtClass() == OMPScanDirectiveClass;
6462 OMPInteropDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6464 llvm::omp::OMPD_interop, StartLoc, EndLoc) {}
6470 llvm::omp::OMPD_interop, SourceLocation(),
6471 SourceLocation()) {}
6481 static OMPInteropDirective *
Create(
const ASTContext &C,
6482 SourceLocation StartLoc,
6483 SourceLocation EndLoc,
6484 ArrayRef<OMPClause *> Clauses);
6490 static OMPInteropDirective *CreateEmpty(
const ASTContext &C,
6491 unsigned NumClauses, EmptyShell);
6494 return T->getStmtClass() == OMPInteropDirectiveClass;
6511 SourceLocation TargetCallLoc;
6514 void setTargetCallLoc(SourceLocation Loc) { TargetCallLoc = Loc; }
6523 llvm::omp::OMPD_dispatch, StartLoc, EndLoc) {}
6527 explicit OMPDispatchDirective()
6528 : OMPExecutableDirective(OMPDispatchDirectiveClass,
6529 llvm::omp::OMPD_dispatch, SourceLocation(),
6530 SourceLocation()) {}
6542 static OMPDispatchDirective *
6543 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6544 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
6545 SourceLocation TargetCallLoc);
6553 static OMPDispatchDirective *CreateEmpty(
const ASTContext &C,
6554 unsigned NumClauses, EmptyShell);
6560 return T->getStmtClass() == OMPDispatchDirectiveClass;
6580 OMPMaskedDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6582 StartLoc, EndLoc) {}
6588 SourceLocation(), SourceLocation()) {}
6598 static OMPMaskedDirective *
6599 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6600 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
6606 static OMPMaskedDirective *CreateEmpty(
const ASTContext &C,
6607 unsigned NumClauses, EmptyShell);
6610 return T->getStmtClass() == OMPMaskedDirectiveClass;
6631 bool HasImplicitOtherwise =
false;
6633 OMPMetaDirective(SourceLocation StartLoc, SourceLocation EndLoc)
6635 llvm::omp::OMPD_metadirective, StartLoc,
6640 static size_t getTraitInfosOffset(
unsigned NumVariants) {
6641 return llvm::alignTo(OMPChildren::size(0,
6646 static OMPMetaDirective *allocate(
const ASTContext &C,
unsigned NumVariants,
6647 SourceLocation StartLoc,
6648 SourceLocation EndLoc);
6650 MutableArrayRef<Stmt *> getTrailingVariants() {
6651 return Data->getChildren().take_front(getNumVariants());
6653 MutableArrayRef<Expr *> getTrailingConditions() {
6654 return {
reinterpret_cast<Expr **
>(
Data->getChildren().data() +
6658 MutableArrayRef<OMPTraitInfo *> getTrailingTraitInfos() {
6659 return {
reinterpret_cast<OMPTraitInfo **
>(
6660 reinterpret_cast<char *
>(
Data) +
6661 getTraitInfosOffset(getNumVariants())),
6664 ArrayRef<Stmt *> getTrailingVariants()
const {
6665 return const_cast<OMPMetaDirective *
>(
this)->getTrailingVariants();
6667 ArrayRef<Expr *> getTrailingConditions()
const {
6668 return const_cast<OMPMetaDirective *
>(
this)->getTrailingConditions();
6670 ArrayRef<OMPTraitInfo *> getTrailingTraitInfos()
const {
6671 return const_cast<OMPMetaDirective *
>(
this)->getTrailingTraitInfos();
6674 void setHasImplicitOtherwise(
bool V) { HasImplicitOtherwise =
V; }
6677 static OMPMetaDirective *
6678 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6679 ArrayRef<Stmt *> Variants, ArrayRef<Expr *> Conditions,
6680 ArrayRef<OMPTraitInfo *> TraitInfos,
bool HasImplicitOtherwise);
6681 static OMPMetaDirective *CreateEmpty(
const ASTContext &C,
6682 unsigned NumVariants, EmptyShell);
6689 return getTrailingTraitInfos();
6693 MutableArrayRef<Stmt *>
Children = Data->getChildren();
6697 return const_cast<OMPMetaDirective *
>(
this)->
children();
6701 return T->getStmtClass() == OMPMetaDirectiveClass;
6723 OMPGenericLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
6724 unsigned CollapsedNum)
6726 StartLoc, EndLoc, CollapsedNum) {}
6734 SourceLocation(), SourceLocation(), CollapsedNum) {}
6747 static OMPGenericLoopDirective *
6748 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6749 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6750 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6758 static OMPGenericLoopDirective *CreateEmpty(
const ASTContext &C,
6759 unsigned NumClauses,
6760 unsigned CollapsedNum,
6764 return T->getStmtClass() == OMPGenericLoopDirectiveClass;
6785 OMPTeamsGenericLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
6786 unsigned CollapsedNum)
6788 llvm::omp::OMPD_teams_loop, StartLoc, EndLoc,
6797 llvm::omp::OMPD_teams_loop, SourceLocation(),
6798 SourceLocation(), CollapsedNum) {}
6811 static OMPTeamsGenericLoopDirective *
6812 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6813 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6814 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6823 static OMPTeamsGenericLoopDirective *CreateEmpty(
const ASTContext &C,
6824 unsigned NumClauses,
6825 unsigned CollapsedNum,
6829 return T->getStmtClass() == OMPTeamsGenericLoopDirectiveClass;
6845 bool CanBeParallelFor =
false;
6852 OMPTargetTeamsGenericLoopDirective(SourceLocation StartLoc,
6853 SourceLocation EndLoc,
6854 unsigned CollapsedNum)
6856 llvm::omp::OMPD_target_teams_loop, StartLoc, EndLoc,
6865 llvm::omp::OMPD_target_teams_loop, SourceLocation(),
6866 SourceLocation(), CollapsedNum) {}
6869 void setCanBeParallelFor(
bool ParFor) { CanBeParallelFor = ParFor; }
6882 static OMPTargetTeamsGenericLoopDirective *
6883 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6884 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6885 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool CanBeParallelFor);
6894 static OMPTargetTeamsGenericLoopDirective *CreateEmpty(
const ASTContext &C,
6895 unsigned NumClauses,
6896 unsigned CollapsedNum,
6904 return T->getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass;
6925 OMPParallelGenericLoopDirective(SourceLocation StartLoc,
6926 SourceLocation EndLoc,
unsigned CollapsedNum)
6928 llvm::omp::OMPD_parallel_loop, StartLoc, EndLoc,
6937 llvm::omp::OMPD_parallel_loop, SourceLocation(),
6938 SourceLocation(), CollapsedNum) {}
6951 static OMPParallelGenericLoopDirective *
6952 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
6953 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6954 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6963 static OMPParallelGenericLoopDirective *CreateEmpty(
const ASTContext &C,
6964 unsigned NumClauses,
6965 unsigned CollapsedNum,
6969 return T->getStmtClass() == OMPParallelGenericLoopDirectiveClass;
6990 OMPTargetParallelGenericLoopDirective(SourceLocation StartLoc,
6991 SourceLocation EndLoc,
6992 unsigned CollapsedNum)
6994 llvm::omp::OMPD_target_parallel_loop, StartLoc, EndLoc,
7003 llvm::omp::OMPD_target_parallel_loop, SourceLocation(),
7004 SourceLocation(), CollapsedNum) {}
7017 static OMPTargetParallelGenericLoopDirective *
7018 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
7019 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
7020 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
7029 static OMPTargetParallelGenericLoopDirective *
7030 CreateEmpty(
const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
7034 return T->getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass;
7055 OMPTargetGenericLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
7056 unsigned CollapsedNum)
7058 llvm::omp::OMPD_target_loop, StartLoc, EndLoc,
7067 llvm::omp::OMPD_target_loop, SourceLocation(),
7068 SourceLocation(), CollapsedNum) {}
7081 static OMPTargetGenericLoopDirective *
7082 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
7083 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
7084 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
7093 static OMPTargetGenericLoopDirective *CreateEmpty(
const ASTContext &C,
7094 unsigned NumClauses,
7095 unsigned CollapsedNum,
7099 return T->getStmtClass() == OMPTargetGenericLoopDirectiveClass;
7116 OMPErrorDirective(SourceLocation StartLoc, SourceLocation EndLoc)
7118 StartLoc, EndLoc) {}
7123 SourceLocation(), SourceLocation()) {}
7132 static OMPErrorDirective *
Create(
const ASTContext &C, SourceLocation StartLoc,
7133 SourceLocation EndLoc,
7134 ArrayRef<OMPClause *> Clauses);
7140 static OMPErrorDirective *CreateEmpty(
const ASTContext &C,
7141 unsigned NumClauses, EmptyShell);
7144 return T->getStmtClass() == OMPErrorDirectiveClass;
7155 OMPAssumeDirective(SourceLocation StartLoc, SourceLocation EndLoc)
7157 StartLoc, EndLoc) {}
7161 SourceLocation(), SourceLocation()) {}
7164 static OMPAssumeDirective *
Create(
const ASTContext &Ctx,
7165 SourceLocation StartLoc,
7166 SourceLocation EndLoc,
7167 ArrayRef<OMPClause *> Clauses, Stmt *AStmt);
7169 static OMPAssumeDirective *CreateEmpty(
const ASTContext &C,
7170 unsigned NumClauses, EmptyShell);
7173 return T->getStmtClass() == OMPAssumeDirectiveClass;
7188 clang::OMPLoopTransformationDirective *, clang::Stmt *,
7189 CastInfo<clang::OMPLoopTransformationDirective, clang::Stmt *>> {
7191 return clang::OMPLoopTransformationDirective::classof(T);
7196 dyn_cast<clang::OMPCanonicalLoopNestTransformationDirective>(T))
7197 return static_cast<clang::OMPLoopTransformationDirective *
>(D);
7199 dyn_cast<clang::OMPCanonicalLoopSequenceTransformationDirective>(T))
7200 return static_cast<clang::OMPLoopTransformationDirective *
>(D);
7201 llvm_unreachable(
"unexpected type");
7207 clang::OMPLoopTransformationDirective, const clang::Stmt *,
7208 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 loop' directive.
static bool classof(const Stmt *T)
friend class OMPExecutableDirective
friend class ASTStmtReader
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.