14#ifndef LLVM_CLANG_AST_STMTOPENMP_H
15#define LLVM_CLANG_AST_STMTOPENMP_H
152 LastSubStmt = LOOPVAR_REF
157 Stmt *SubStmts[LastSubStmt + 1] = {};
159 OMPCanonicalLoop() :
Stmt(
StmtClass::OMPCanonicalLoopClass) {}
168 S->setLoopStmt(LoopStmt);
169 S->setDistanceFunc(DistanceFunc);
170 S->setLoopVarFunc(LoopVarFunc);
171 S->setLoopVarRef(LoopVarRef);
181 return S->getStmtClass() == StmtClass::OMPCanonicalLoopClass;
190 return child_range(&SubStmts[0], &SubStmts[0] + LastSubStmt + 1);
202 assert((isa<ForStmt>(S) || isa<CXXForRangeStmt>(S)) &&
203 "Canonical loop must be a for loop (range-based or otherwise)");
204 SubStmts[LOOP_STMT] = S;
216 return cast<CapturedStmt>(SubStmts[DISTANCE_FUNC]);
219 return cast<CapturedStmt>(SubStmts[DISTANCE_FUNC]);
222 assert(S &&
"Expected non-null captured statement");
223 SubStmts[DISTANCE_FUNC] = S;
237 return cast<CapturedStmt>(SubStmts[LOOPVAR_FUNC]);
240 return cast<CapturedStmt>(SubStmts[LOOPVAR_FUNC]);
243 assert(S &&
"Expected non-null captured statement");
244 SubStmts[LOOPVAR_FUNC] = S;
251 return cast<DeclRefExpr>(SubStmts[LOOPVAR_REF]);
254 return cast<DeclRefExpr>(SubStmts[LOOPVAR_REF]);
257 assert(
E &&
"Expected non-null loop variable");
258 SubStmts[LOOPVAR_REF] =
E;
297 :
Stmt(SC),
Kind(K), StartLoc(
std::move(StartLoc)),
298 EndLoc(
std::move(EndLoc)) {}
300 template <
typename T,
typename... Params>
302 Stmt *AssociatedStmt,
unsigned NumChildren,
305 C.Allocate(
sizeof(
T) + OMPChildren::size(Clauses.size(), AssociatedStmt,
309 auto *
Data = OMPChildren::Create(
reinterpret_cast<T *
>(Mem) + 1, Clauses,
310 AssociatedStmt, NumChildren);
311 auto *Inst =
new (Mem)
T(std::forward<Params>(
P)...);
316 template <
typename T,
typename... Params>
318 bool HasAssociatedStmt,
unsigned NumChildren,
321 C.Allocate(
sizeof(
T) + OMPChildren::size(NumClauses, HasAssociatedStmt,
325 OMPChildren::CreateEmpty(
reinterpret_cast<T *
>(Mem) + 1, NumClauses,
326 HasAssociatedStmt, NumChildren);
327 auto *Inst =
new (Mem)
T(std::forward<Params>(
P)...);
332 template <
typename T>
334 bool HasAssociatedStmt =
false,
335 unsigned NumChildren = 0) {
337 C.Allocate(
sizeof(
T) + OMPChildren::size(NumClauses, HasAssociatedStmt,
341 OMPChildren::CreateEmpty(
reinterpret_cast<T *
>(Mem) + 1, NumClauses,
342 HasAssociatedStmt, NumChildren);
343 auto *Inst =
new (Mem)
T;
351 :
public llvm::iterator_adaptor_base<
352 used_clauses_child_iterator, ArrayRef<OMPClause *>::iterator,
353 std::forward_iterator_tag, Stmt *, ptrdiff_t, Stmt *, Stmt *> {
358 if (ChildI != ChildEnd)
360 while (this->I != End) {
362 if (this->I != End) {
363 ChildI = (*this->I)->used_children().begin();
364 ChildEnd = (*this->I)->used_children().end();
365 if (ChildI != ChildEnd)
375 if (this->I != End) {
376 ChildI = (*this->I)->used_children().begin();
377 ChildEnd = (*this->I)->used_children().end();
386 if (ChildI != ChildEnd)
388 if (this->I != End) {
390 if (this->I != End) {
391 ChildI = (*this->I)->used_children().begin();
392 ChildEnd = (*this->I)->used_children().end();
400 static llvm::iterator_range<used_clauses_child_iterator>
411 template <
typename SpecificClause>
413 :
public llvm::iterator_adaptor_base<
414 specific_clause_iterator<SpecificClause>,
415 ArrayRef<OMPClause *>::const_iterator, std::forward_iterator_tag,
416 const SpecificClause *, ptrdiff_t, const SpecificClause *,
417 const SpecificClause *> {
420 void SkipToNextClause() {
421 while (this->I != End && !isa<SpecificClause>(*this->I))
433 return cast<SpecificClause>(*this->I);
444 template <
typename SpecificClause>
445 static llvm::iterator_range<specific_clause_iterator<SpecificClause>>
452 template <
typename SpecificClause>
453 llvm::iterator_range<specific_clause_iterator<SpecificClause>>
455 return getClausesOfKind<SpecificClause>(
clauses());
463 template <
typename SpecificClause>
465 auto ClausesOfKind = getClausesOfKind<SpecificClause>(Clauses);
467 if (ClausesOfKind.begin() != ClausesOfKind.end()) {
468 assert(std::next(ClausesOfKind.begin()) == ClausesOfKind.end() &&
469 "There are at least 2 clauses of the specified kind");
470 return *ClausesOfKind.begin();
475 template <
typename SpecificClause>
477 return getSingleClause<SpecificClause>(
clauses());
482 template <
typename SpecificClause>
484 auto Clauses = getClausesOfKind<SpecificClause>();
485 return Clauses.begin() != Clauses.end();
526 "Expected directive with the associated statement.");
536 "Expected directive with the associated statement.");
545 "Expected directive with the associated statement.");
559 return S->getStmtClass() >= firstOMPExecutableDirectiveConstant &&
560 S->getStmtClass() <= lastOMPExecutableDirectiveConstant;
598 "Expected directive with the associated statement.");
616 bool HasCancel =
false;
625 llvm::omp::OMPD_parallel, StartLoc, EndLoc) {}
638 void setHasCancel(
bool Has) { HasCancel = Has; }
652 static OMPParallelDirective *
653 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
654 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
662 static OMPParallelDirective *
CreateEmpty(
const ASTContext &
C,
663 unsigned NumClauses, EmptyShell);
677 return T->getStmtClass() == OMPParallelDirectiveClass;
818 Cond !=
nullptr &&
Init !=
nullptr &&
Inc !=
nullptr;
853 for (
unsigned I = 0; I < Size; ++I) {
884 bool TryImperfectlyNestedLoops);
886 bool TryImperfectlyNestedLoops) {
888 TryImperfectlyNestedLoops);
896 llvm::function_ref<
bool(
unsigned,
Stmt *)> Callback,
898 OnTransformationCallback);
902 llvm::function_ref<
bool(
unsigned,
const Stmt *)> Callback,
904 OnTransformationCallback) {
905 auto &&NewCallback = [Callback](
unsigned Cnt,
Stmt *CurStmt) {
906 return Callback(Cnt, CurStmt);
908 auto &&NewTransformCb =
910 OnTransformationCallback(A);
913 NumLoops, NewCallback, NewTransformCb);
921 llvm::function_ref<
bool(
unsigned,
Stmt *)> Callback) {
923 return doForAllLoops(CurStmt, TryImperfectlyNestedLoops, NumLoops, Callback,
929 llvm::function_ref<
bool(
unsigned,
const Stmt *)> Callback) {
930 auto &&NewCallback = [Callback](
unsigned Cnt,
const Stmt *CurStmt) {
931 return Callback(Cnt, CurStmt);
934 NumLoops, NewCallback);
940 Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
941 llvm::function_ref<
void(
unsigned,
Stmt *,
Stmt *)> Callback);
943 const Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
944 llvm::function_ref<
void(
unsigned,
const Stmt *,
const Stmt *)> Callback) {
945 auto &&NewCallback = [Callback](
unsigned Cnt,
Stmt *
Loop,
Stmt *Body) {
946 Callback(Cnt,
Loop, Body);
949 NumLoops, NewCallback);
953 if (
auto *
D = dyn_cast<OMPExecutableDirective>(
T))
964 unsigned NumGeneratedLoops = 0;
996 return C == OMPTileDirectiveClass ||
C == OMPUnrollDirectiveClass ||
997 C == OMPReverseDirectiveClass ||
C == OMPInterchangeDirectiveClass;
1024 IterationVariableOffset = 0,
1025 LastIterationOffset = 1,
1026 CalcLastIterationOffset = 2,
1027 PreConditionOffset = 3,
1038 IsLastIterVariableOffset = 8,
1039 LowerBoundVariableOffset = 9,
1040 UpperBoundVariableOffset = 10,
1041 StrideVariableOffset = 11,
1042 EnsureUpperBoundOffset = 12,
1043 NextLowerBoundOffset = 13,
1044 NextUpperBoundOffset = 14,
1045 NumIterationsOffset = 15,
1047 WorksharingEnd = 16,
1048 PrevLowerBoundVariableOffset = 16,
1049 PrevUpperBoundVariableOffset = 17,
1051 PrevEnsureUpperBoundOffset = 19,
1052 CombinedLowerBoundVariableOffset = 20,
1053 CombinedUpperBoundVariableOffset = 21,
1054 CombinedEnsureUpperBoundOffset = 22,
1055 CombinedInitOffset = 23,
1056 CombinedConditionOffset = 24,
1057 CombinedNextLowerBoundOffset = 25,
1058 CombinedNextUpperBoundOffset = 26,
1059 CombinedDistConditionOffset = 27,
1060 CombinedParForInDistConditionOffset = 28,
1064 CombinedDistributeEnd = 29,
1069 auto **Storage =
reinterpret_cast<Expr **
>(
1075 MutableArrayRef<Expr *> getPrivateCounters() {
1076 auto **Storage =
reinterpret_cast<Expr **
>(
1083 MutableArrayRef<Expr *> getInits() {
1084 auto **
Storage =
reinterpret_cast<Expr **
>(
1091 MutableArrayRef<Expr *> getUpdates() {
1092 auto **
Storage =
reinterpret_cast<Expr **
>(
1099 MutableArrayRef<Expr *> getFinals() {
1100 auto **
Storage =
reinterpret_cast<Expr **
>(
1107 MutableArrayRef<Expr *> getDependentCounters() {
1108 auto **
Storage =
reinterpret_cast<Expr **
>(
1115 MutableArrayRef<Expr *> getDependentInits() {
1116 auto **
Storage =
reinterpret_cast<Expr **
>(
1123 MutableArrayRef<Expr *> getFinalsConditions() {
1124 auto **
Storage =
reinterpret_cast<Expr **
>(
1141 unsigned CollapsedNum)
1147 return CombinedDistributeEnd;
1150 return WorksharingEnd;
1184 "expected worksharing loop directive");
1192 "expected worksharing loop directive");
1200 "expected worksharing loop directive");
1208 "expected worksharing loop directive");
1216 "expected worksharing loop directive");
1224 "expected worksharing loop directive");
1232 "expected worksharing loop directive");
1240 "expected worksharing loop directive");
1245 "expected loop bound sharing directive");
1250 "expected loop bound sharing directive");
1255 "expected loop bound sharing directive");
1260 "expected loop bound sharing directive");
1265 "expected loop bound sharing directive");
1270 "expected loop bound sharing directive");
1275 "expected loop bound sharing directive");
1280 "expected loop bound sharing directive");
1285 "expected loop bound sharing directive");
1290 "expected loop bound sharing directive");
1295 "expected loop bound sharing directive");
1300 "expected loop bound distribute sharing directive");
1305 "expected loop bound distribute sharing directive");
1307 CombParForInDistCond;
1343 "expected worksharing loop directive");
1351 "expected worksharing loop directive");
1359 "expected worksharing loop directive");
1367 "expected worksharing loop directive");
1375 "expected worksharing loop directive");
1383 "expected worksharing loop directive");
1391 "expected worksharing loop directive");
1399 "expected worksharing loop directive");
1404 "expected loop bound sharing directive");
1409 "expected loop bound sharing directive");
1414 "expected loop bound sharing directive");
1419 "expected loop bound sharing directive");
1424 "expected loop bound sharing directive");
1425 return cast<Expr>(
Data->
getChildren()[CombinedLowerBoundVariableOffset]);
1429 "expected loop bound sharing directive");
1430 return cast<Expr>(
Data->
getChildren()[CombinedUpperBoundVariableOffset]);
1434 "expected loop bound sharing directive");
1435 return cast<Expr>(
Data->
getChildren()[CombinedEnsureUpperBoundOffset]);
1439 "expected loop bound sharing directive");
1444 "expected loop bound sharing directive");
1449 "expected loop bound sharing directive");
1454 "expected loop bound sharing directive");
1459 "expected loop bound distribute sharing directive");
1464 "expected loop bound distribute sharing directive");
1465 return cast<Expr>(
Data->
getChildren()[CombinedParForInDistConditionOffset]);
1521 return T->getStmtClass() == OMPSimdDirectiveClass ||
1522 T->getStmtClass() == OMPForDirectiveClass ||
1523 T->getStmtClass() == OMPForSimdDirectiveClass ||
1524 T->getStmtClass() == OMPParallelForDirectiveClass ||
1525 T->getStmtClass() == OMPParallelForSimdDirectiveClass ||
1526 T->getStmtClass() == OMPTaskLoopDirectiveClass ||
1527 T->getStmtClass() == OMPTaskLoopSimdDirectiveClass ||
1528 T->getStmtClass() == OMPMaskedTaskLoopDirectiveClass ||
1529 T->getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass ||
1530 T->getStmtClass() == OMPMasterTaskLoopDirectiveClass ||
1531 T->getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass ||
1532 T->getStmtClass() == OMPGenericLoopDirectiveClass ||
1533 T->getStmtClass() == OMPTeamsGenericLoopDirectiveClass ||
1534 T->getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass ||
1535 T->getStmtClass() == OMPParallelGenericLoopDirectiveClass ||
1536 T->getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass ||
1537 T->getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass ||
1538 T->getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass ||
1539 T->getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass ||
1540 T->getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass ||
1541 T->getStmtClass() == OMPDistributeDirectiveClass ||
1542 T->getStmtClass() == OMPTargetParallelForDirectiveClass ||
1543 T->getStmtClass() == OMPDistributeParallelForDirectiveClass ||
1544 T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass ||
1545 T->getStmtClass() == OMPDistributeSimdDirectiveClass ||
1546 T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass ||
1547 T->getStmtClass() == OMPTargetSimdDirectiveClass ||
1548 T->getStmtClass() == OMPTeamsDistributeDirectiveClass ||
1549 T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass ||
1550 T->getStmtClass() ==
1551 OMPTeamsDistributeParallelForSimdDirectiveClass ||
1552 T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass ||
1553 T->getStmtClass() ==
1554 OMPTargetTeamsDistributeParallelForDirectiveClass ||
1555 T->getStmtClass() ==
1556 OMPTargetTeamsDistributeParallelForSimdDirectiveClass ||
1557 T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass ||
1558 T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
1581 unsigned CollapsedNum)
1583 EndLoc, CollapsedNum) {}
1604 static OMPSimdDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
1605 SourceLocation EndLoc,
unsigned CollapsedNum,
1606 ArrayRef<OMPClause *> Clauses,
1607 Stmt *AssociatedStmt,
1608 const HelperExprs &Exprs);
1617 static OMPSimdDirective *
CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
1618 unsigned CollapsedNum, EmptyShell);
1621 return T->getStmtClass() == OMPSimdDirectiveClass;
1638 bool HasCancel =
false;
1647 unsigned CollapsedNum)
1649 EndLoc, CollapsedNum) {}
1660 void setTaskReductionRefExpr(Expr *
E) {
1662 llvm::omp::OMPD_for)] =
E;
1666 void setHasCancel(
bool Has) { HasCancel = Has; }
1682 static OMPForDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
1683 SourceLocation EndLoc,
unsigned CollapsedNum,
1684 ArrayRef<OMPClause *> Clauses,
1685 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
1686 Expr *TaskRedRef,
bool HasCancel);
1695 static OMPForDirective *
CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
1696 unsigned CollapsedNum, EmptyShell);
1711 return T->getStmtClass() == OMPForDirectiveClass;
1734 unsigned CollapsedNum)
1736 StartLoc, EndLoc, CollapsedNum) {}
1757 static OMPForSimdDirective *
1758 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
1759 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
1760 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
1769 static OMPForSimdDirective *
CreateEmpty(
const ASTContext &
C,
1770 unsigned NumClauses,
1771 unsigned CollapsedNum, EmptyShell);
1774 return T->getStmtClass() == OMPForSimdDirectiveClass;
1792 bool HasCancel =
false;
1801 llvm::omp::OMPD_sections, StartLoc, EndLoc) {}
1814 void setHasCancel(
bool Has) { HasCancel = Has; }
1828 static OMPSectionsDirective *
1829 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
1830 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
1839 static OMPSectionsDirective *
CreateEmpty(
const ASTContext &
C,
1840 unsigned NumClauses, EmptyShell);
1854 return T->getStmtClass() == OMPSectionsDirectiveClass;
1869 bool HasCancel =
false;
1878 llvm::omp::OMPD_section, StartLoc, EndLoc) {}
1896 static OMPSectionDirective *
Create(
const ASTContext &
C,
1897 SourceLocation StartLoc,
1898 SourceLocation EndLoc,
1899 Stmt *AssociatedStmt,
bool HasCancel);
1905 static OMPSectionDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
1914 return T->getStmtClass() == OMPSectionDirectiveClass;
1936 StartLoc, EndLoc) {}
1952 static OMPScopeDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
1953 SourceLocation EndLoc,
1954 ArrayRef<OMPClause *> Clauses,
1955 Stmt *AssociatedStmt);
1961 static OMPScopeDirective *
CreateEmpty(
const ASTContext &
C,
1962 unsigned NumClauses, EmptyShell);
1965 return T->getStmtClass() == OMPScopeDirectiveClass;
1987 StartLoc, EndLoc) {}
2004 static OMPSingleDirective *
2005 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
2006 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2014 static OMPSingleDirective *
CreateEmpty(
const ASTContext &
C,
2015 unsigned NumClauses, EmptyShell);
2018 return T->getStmtClass() == OMPSingleDirectiveClass;
2038 StartLoc, EndLoc) {}
2054 static OMPMasterDirective *
Create(
const ASTContext &
C,
2055 SourceLocation StartLoc,
2056 SourceLocation EndLoc,
2057 Stmt *AssociatedStmt);
2063 static OMPMasterDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
2066 return T->getStmtClass() == OMPMasterDirectiveClass;
2090 llvm::omp::OMPD_critical, StartLoc, EndLoc),
2104 void setDirectiveName(
const DeclarationNameInfo &Name) { DirName = Name; }
2116 static OMPCriticalDirective *
2117 Create(
const ASTContext &
C,
const DeclarationNameInfo &Name,
2118 SourceLocation StartLoc, SourceLocation EndLoc,
2119 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2126 static OMPCriticalDirective *
CreateEmpty(
const ASTContext &
C,
2127 unsigned NumClauses, EmptyShell);
2134 return T->getStmtClass() == OMPCriticalDirectiveClass;
2152 bool HasCancel =
false;
2161 unsigned CollapsedNum)
2163 llvm::omp::OMPD_parallel_for, StartLoc, EndLoc,
2176 void setTaskReductionRefExpr(Expr *
E) {
2178 llvm::omp::OMPD_parallel_for)] =
E;
2182 void setHasCancel(
bool Has) { HasCancel = Has; }
2198 static OMPParallelForDirective *
2199 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
2200 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2201 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
2211 static OMPParallelForDirective *
CreateEmpty(
const ASTContext &
C,
2212 unsigned NumClauses,
2213 unsigned CollapsedNum,
2230 return T->getStmtClass() == OMPParallelForDirectiveClass;
2254 unsigned CollapsedNum)
2256 llvm::omp::OMPD_parallel_for_simd, StartLoc, EndLoc,
2279 static OMPParallelForSimdDirective *
2280 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
2281 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2282 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
2291 static OMPParallelForSimdDirective *
CreateEmpty(
const ASTContext &
C,
2292 unsigned NumClauses,
2293 unsigned CollapsedNum,
2297 return T->getStmtClass() == OMPParallelForSimdDirectiveClass;
2315 llvm::omp::OMPD_parallel_master, StartLoc,
2320 llvm::omp::OMPD_parallel_master,
2337 static OMPParallelMasterDirective *
2338 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
2339 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);
2347 static OMPParallelMasterDirective *
2348 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses, EmptyShell);
2360 return T->getStmtClass() == OMPParallelMasterDirectiveClass;
2378 llvm::omp::OMPD_parallel_masked, StartLoc,
2383 llvm::omp::OMPD_parallel_masked,
2400 static OMPParallelMaskedDirective *
2401 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
2402 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);
2410 static OMPParallelMaskedDirective *
2411 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses, EmptyShell);
2423 return T->getStmtClass() == OMPParallelMaskedDirectiveClass;
2441 bool HasCancel =
false;
2450 llvm::omp::OMPD_parallel_sections, StartLoc,
2457 llvm::omp::OMPD_parallel_sections,
2464 void setHasCancel(
bool Has) { HasCancel = Has; }
2478 static OMPParallelSectionsDirective *
2479 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
2480 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
2489 static OMPParallelSectionsDirective *
2490 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses, EmptyShell);
2505 return T->getStmtClass() == OMPParallelSectionsDirectiveClass;
2521 bool HasCancel =
false;
2530 StartLoc, EndLoc) {}
2539 void setHasCancel(
bool Has) { HasCancel = Has; }
2551 static OMPTaskDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
2552 SourceLocation EndLoc,
2553 ArrayRef<OMPClause *> Clauses,
2554 Stmt *AssociatedStmt,
bool HasCancel);
2562 static OMPTaskDirective *
CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
2569 return T->getStmtClass() == OMPTaskDirectiveClass;
2589 llvm::omp::OMPD_taskyield, StartLoc, EndLoc) {}
2605 static OMPTaskyieldDirective *
2606 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc);
2612 static OMPTaskyieldDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
2615 return T->getStmtClass() == OMPTaskyieldDirectiveClass;
2635 llvm::omp::OMPD_barrier, StartLoc, EndLoc) {}
2651 static OMPBarrierDirective *
2652 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc);
2658 static OMPBarrierDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
2661 return T->getStmtClass() == OMPBarrierDirectiveClass;
2681 llvm::omp::OMPD_taskwait, StartLoc, EndLoc) {}
2698 static OMPTaskwaitDirective *
Create(
const ASTContext &
C,
2699 SourceLocation StartLoc,
2700 SourceLocation EndLoc,
2701 ArrayRef<OMPClause *> Clauses);
2708 static OMPTaskwaitDirective *
CreateEmpty(
const ASTContext &
C,
2709 unsigned NumClauses, EmptyShell);
2712 return T->getStmtClass() == OMPTaskwaitDirectiveClass;
2732 llvm::omp::OMPD_taskgroup, StartLoc, EndLoc) {}
2754 static OMPTaskgroupDirective *
2755 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
2756 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2757 Expr *ReductionRef);
2764 static OMPTaskgroupDirective *
CreateEmpty(
const ASTContext &
C,
2765 unsigned NumClauses, EmptyShell);
2775 return T->getStmtClass() == OMPTaskgroupDirectiveClass;
2799 StartLoc, EndLoc) {}
2816 static OMPFlushDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
2817 SourceLocation EndLoc,
2818 ArrayRef<OMPClause *> Clauses);
2826 static OMPFlushDirective *
CreateEmpty(
const ASTContext &
C,
2827 unsigned NumClauses, EmptyShell);
2830 return T->getStmtClass() == OMPFlushDirectiveClass;
2852 StartLoc, EndLoc) {}
2868 static OMPDepobjDirective *
Create(
const ASTContext &
C,
2869 SourceLocation StartLoc,
2870 SourceLocation EndLoc,
2871 ArrayRef<OMPClause *> Clauses);
2879 static OMPDepobjDirective *
CreateEmpty(
const ASTContext &
C,
2880 unsigned NumClauses, EmptyShell);
2883 return T->getStmtClass() == OMPDepobjDirectiveClass;
2903 llvm::omp::OMPD_ordered, StartLoc, EndLoc) {}
2921 static OMPOrderedDirective *
2922 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
2923 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2931 static OMPOrderedDirective *
CreateEmpty(
const ASTContext &
C,
2932 unsigned NumClauses,
2933 bool IsStandalone, EmptyShell);
2936 return T->getStmtClass() == OMPOrderedDirectiveClass;
2961 LLVM_PREFERRED_TYPE(
bool)
2962 uint8_t IsXLHSInRHSPart : 1;
2971 LLVM_PREFERRED_TYPE(
bool)
2972 uint8_t IsPostfixUpdate : 1;
2975 LLVM_PREFERRED_TYPE(
bool)
2976 uint8_t IsFailOnly : 1;
2986 StartLoc, EndLoc) {}
2990 explicit OMPAtomicDirective()
2992 SourceLocation(), SourceLocation()) {}
2994 enum DataPositionTy :
size_t {
3009 void setUpdateExpr(Expr *UE) {
3015 void setR(Expr *R) {
Data->
getChildren()[DataPositionTy::POS_R] = R; }
3077 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_X]);
3080 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_X]);
3086 return cast_or_null<Expr>(
3090 return cast_or_null<Expr>(
3105 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_V]);
3108 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_V]);
3112 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_R]);
3115 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_R]);
3119 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_E]);
3122 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_E]);
3126 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_D]);
3129 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_D]);
3133 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_Cond]);
3136 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_Cond]);
3140 return T->getStmtClass() == OMPAtomicDirectiveClass;
3162 StartLoc, EndLoc) {}
3179 static OMPTargetDirective *
3180 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3181 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3189 static OMPTargetDirective *
CreateEmpty(
const ASTContext &
C,
3190 unsigned NumClauses, EmptyShell);
3193 return T->getStmtClass() == OMPTargetDirectiveClass;
3216 llvm::omp::OMPD_target_data, StartLoc, EndLoc) {}
3234 static OMPTargetDataDirective *
3235 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3236 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3243 static OMPTargetDataDirective *
CreateEmpty(
const ASTContext &
C,
unsigned N,
3247 return T->getStmtClass() == OMPTargetDataDirectiveClass;
3270 llvm::omp::OMPD_target_enter_data, StartLoc,
3277 llvm::omp::OMPD_target_enter_data,
3289 static OMPTargetEnterDataDirective *
3290 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3291 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3298 static OMPTargetEnterDataDirective *
CreateEmpty(
const ASTContext &
C,
3299 unsigned N, EmptyShell);
3302 return T->getStmtClass() == OMPTargetEnterDataDirectiveClass;
3325 llvm::omp::OMPD_target_exit_data, StartLoc,
3332 llvm::omp::OMPD_target_exit_data,
3344 static OMPTargetExitDataDirective *
3345 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3346 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3353 static OMPTargetExitDataDirective *
CreateEmpty(
const ASTContext &
C,
3354 unsigned N, EmptyShell);
3357 return T->getStmtClass() == OMPTargetExitDataDirectiveClass;
3373 bool HasCancel =
false;
3382 llvm::omp::OMPD_target_parallel, StartLoc,
3389 llvm::omp::OMPD_target_parallel,
3395 void setHasCancel(
bool Has) { HasCancel = Has; }
3409 static OMPTargetParallelDirective *
3410 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3411 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
3420 static OMPTargetParallelDirective *
3421 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses, EmptyShell);
3436 return T->getStmtClass() == OMPTargetParallelDirectiveClass;
3454 bool HasCancel =
false;
3463 unsigned CollapsedNum)
3465 llvm::omp::OMPD_target_parallel_for, StartLoc, EndLoc,
3478 void setTaskReductionRefExpr(Expr *
E) {
3484 void setHasCancel(
bool Has) { HasCancel = Has; }
3500 static OMPTargetParallelForDirective *
3501 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3502 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3503 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
3513 static OMPTargetParallelForDirective *
CreateEmpty(
const ASTContext &
C,
3514 unsigned NumClauses,
3515 unsigned CollapsedNum,
3532 return T->getStmtClass() == OMPTargetParallelForDirectiveClass;
3554 StartLoc, EndLoc) {}
3571 static OMPTeamsDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
3572 SourceLocation EndLoc,
3573 ArrayRef<OMPClause *> Clauses,
3574 Stmt *AssociatedStmt);
3582 static OMPTeamsDirective *
CreateEmpty(
const ASTContext &
C,
3583 unsigned NumClauses, EmptyShell);
3586 return T->getStmtClass() == OMPTeamsDirectiveClass;
3609 llvm::omp::OMPD_cancellation_point, StartLoc,
3615 llvm::omp::OMPD_cancellation_point,
3629 static OMPCancellationPointDirective *
3630 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3637 static OMPCancellationPointDirective *
CreateEmpty(
const ASTContext &
C,
3644 return T->getStmtClass() == OMPCancellationPointDirectiveClass;
3666 StartLoc, EndLoc) {}
3686 static OMPCancelDirective *
3687 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3695 static OMPCancelDirective *
CreateEmpty(
const ASTContext &
C,
3696 unsigned NumClauses, EmptyShell);
3702 return T->getStmtClass() == OMPCancelDirectiveClass;
3719 bool HasCancel =
false;
3728 unsigned CollapsedNum)
3730 StartLoc, EndLoc, CollapsedNum) {}
3741 void setHasCancel(
bool Has) { HasCancel = Has; }
3755 static OMPTaskLoopDirective *
3756 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3757 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3758 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
3767 static OMPTaskLoopDirective *
CreateEmpty(
const ASTContext &
C,
3768 unsigned NumClauses,
3769 unsigned CollapsedNum, EmptyShell);
3775 return T->getStmtClass() == OMPTaskLoopDirectiveClass;
3798 unsigned CollapsedNum)
3800 llvm::omp::OMPD_taskloop_simd, StartLoc, EndLoc,
3823 static OMPTaskLoopSimdDirective *
3824 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3825 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3826 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
3835 static OMPTaskLoopSimdDirective *
CreateEmpty(
const ASTContext &
C,
3836 unsigned NumClauses,
3837 unsigned CollapsedNum,
3841 return T->getStmtClass() == OMPTaskLoopSimdDirectiveClass;
3858 bool HasCancel =
false;
3867 unsigned CollapsedNum)
3869 llvm::omp::OMPD_master_taskloop, StartLoc, EndLoc,
3882 void setHasCancel(
bool Has) { HasCancel = Has; }
3896 static OMPMasterTaskLoopDirective *
3897 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3898 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3899 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
3908 static OMPMasterTaskLoopDirective *
CreateEmpty(
const ASTContext &
C,
3909 unsigned NumClauses,
3910 unsigned CollapsedNum,
3917 return T->getStmtClass() == OMPMasterTaskLoopDirectiveClass;
3934 bool HasCancel =
false;
3943 unsigned CollapsedNum)
3945 llvm::omp::OMPD_masked_taskloop, StartLoc, EndLoc,
3958 void setHasCancel(
bool Has) { HasCancel = Has; }
3972 static OMPMaskedTaskLoopDirective *
3973 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3974 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3975 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
3984 static OMPMaskedTaskLoopDirective *
CreateEmpty(
const ASTContext &
C,
3985 unsigned NumClauses,
3986 unsigned CollapsedNum,
3993 return T->getStmtClass() == OMPMaskedTaskLoopDirectiveClass;
4016 unsigned CollapsedNum)
4018 llvm::omp::OMPD_master_taskloop_simd, StartLoc, EndLoc,
4041 static OMPMasterTaskLoopSimdDirective *
4042 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4043 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4044 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4052 static OMPMasterTaskLoopSimdDirective *
CreateEmpty(
const ASTContext &
C,
4053 unsigned NumClauses,
4054 unsigned CollapsedNum,
4058 return T->getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass;
4081 unsigned CollapsedNum)
4083 llvm::omp::OMPD_masked_taskloop_simd, StartLoc, EndLoc,
4106 static OMPMaskedTaskLoopSimdDirective *
4107 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4108 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4109 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4117 static OMPMaskedTaskLoopSimdDirective *
CreateEmpty(
const ASTContext &
C,
4118 unsigned NumClauses,
4119 unsigned CollapsedNum,
4123 return T->getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass;
4141 bool HasCancel =
false;
4151 unsigned CollapsedNum)
4153 llvm::omp::OMPD_parallel_master_taskloop, StartLoc,
4154 EndLoc, CollapsedNum) {}
4162 llvm::omp::OMPD_parallel_master_taskloop,
4166 void setHasCancel(
bool Has) { HasCancel = Has; }
4180 static OMPParallelMasterTaskLoopDirective *
4181 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4182 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4183 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4192 static OMPParallelMasterTaskLoopDirective *
CreateEmpty(
const ASTContext &
C,
4193 unsigned NumClauses,
4194 unsigned CollapsedNum,
4201 return T->getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass;
4219 bool HasCancel =
false;
4229 unsigned CollapsedNum)
4231 llvm::omp::OMPD_parallel_masked_taskloop, StartLoc,
4232 EndLoc, CollapsedNum) {}
4240 llvm::omp::OMPD_parallel_masked_taskloop,
4244 void setHasCancel(
bool Has) { HasCancel = Has; }
4258 static OMPParallelMaskedTaskLoopDirective *
4259 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4260 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4261 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4270 static OMPParallelMaskedTaskLoopDirective *
CreateEmpty(
const ASTContext &
C,
4271 unsigned NumClauses,
4272 unsigned CollapsedNum,
4279 return T->getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass;
4304 unsigned CollapsedNum)
4306 llvm::omp::OMPD_parallel_master_taskloop_simd,
4307 StartLoc, EndLoc, CollapsedNum) {}
4315 llvm::omp::OMPD_parallel_master_taskloop_simd,
4329 static OMPParallelMasterTaskLoopSimdDirective *
4330 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4331 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4332 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4341 static OMPParallelMasterTaskLoopSimdDirective *
4342 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
4346 return T->getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass;
4371 unsigned CollapsedNum)
4373 llvm::omp::OMPD_parallel_masked_taskloop_simd,
4374 StartLoc, EndLoc, CollapsedNum) {}
4382 llvm::omp::OMPD_parallel_masked_taskloop_simd,
4396 static OMPParallelMaskedTaskLoopSimdDirective *
4397 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4398 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4399 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4408 static OMPParallelMaskedTaskLoopSimdDirective *
4409 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
4413 return T->getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass;
4436 unsigned CollapsedNum)
4438 llvm::omp::OMPD_distribute, StartLoc, EndLoc,
4461 static OMPDistributeDirective *
4462 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4463 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4464 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4473 static OMPDistributeDirective *
CreateEmpty(
const ASTContext &
C,
4474 unsigned NumClauses,
4475 unsigned CollapsedNum, EmptyShell);
4478 return T->getStmtClass() == OMPDistributeDirectiveClass;
4501 llvm::omp::OMPD_target_update, StartLoc,
4520 static OMPTargetUpdateDirective *
4521 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4522 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
4530 static OMPTargetUpdateDirective *
CreateEmpty(
const ASTContext &
C,
4531 unsigned NumClauses, EmptyShell);
4534 return T->getStmtClass() == OMPTargetUpdateDirectiveClass;
4551 bool HasCancel =
false;
4561 unsigned CollapsedNum)
4563 llvm::omp::OMPD_distribute_parallel_for, StartLoc,
4564 EndLoc, CollapsedNum) {}
4572 llvm::omp::OMPD_distribute_parallel_for,
4576 void setTaskReductionRefExpr(Expr *
E) {
4582 void setHasCancel(
bool Has) { HasCancel = Has; }
4598 static OMPDistributeParallelForDirective *
4599 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4600 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4601 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
4611 static OMPDistributeParallelForDirective *
CreateEmpty(
const ASTContext &
C,
4612 unsigned NumClauses,
4613 unsigned CollapsedNum,
4630 return T->getStmtClass() == OMPDistributeParallelForDirectiveClass;
4655 unsigned CollapsedNum)
4657 llvm::omp::OMPD_distribute_parallel_for_simd, StartLoc,
4658 EndLoc, CollapsedNum) {}
4666 llvm::omp::OMPD_distribute_parallel_for_simd,
4680 static OMPDistributeParallelForSimdDirective *
Create(
4681 const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4682 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4683 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4691 static OMPDistributeParallelForSimdDirective *
CreateEmpty(
4692 const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
4696 return T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass;
4719 unsigned CollapsedNum)
4721 llvm::omp::OMPD_distribute_simd, StartLoc, EndLoc,
4744 static OMPDistributeSimdDirective *
4745 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4746 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4747 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4755 static OMPDistributeSimdDirective *
CreateEmpty(
const ASTContext &
C,
4756 unsigned NumClauses,
4757 unsigned CollapsedNum,
4761 return T->getStmtClass() == OMPDistributeSimdDirectiveClass;
4786 unsigned CollapsedNum)
4788 llvm::omp::OMPD_target_parallel_for_simd, StartLoc,
4789 EndLoc, CollapsedNum) {}
4797 llvm::omp::OMPD_target_parallel_for_simd,
4811 static OMPTargetParallelForSimdDirective *
4812 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4813 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4814 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4822 static OMPTargetParallelForSimdDirective *
CreateEmpty(
const ASTContext &
C,
4823 unsigned NumClauses,
4824 unsigned CollapsedNum,
4828 return T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass;
4852 unsigned CollapsedNum)
4854 llvm::omp::OMPD_target_simd, StartLoc, EndLoc,
4877 static OMPTargetSimdDirective *
4878 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4879 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4880 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4888 static OMPTargetSimdDirective *
CreateEmpty(
const ASTContext &
C,
4889 unsigned NumClauses,
4890 unsigned CollapsedNum,
4894 return T->getStmtClass() == OMPTargetSimdDirectiveClass;
4917 unsigned CollapsedNum)
4919 llvm::omp::OMPD_teams_distribute, StartLoc, EndLoc,
4942 static OMPTeamsDistributeDirective *
4943 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4944 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4945 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4953 static OMPTeamsDistributeDirective *
CreateEmpty(
const ASTContext &
C,
4954 unsigned NumClauses,
4955 unsigned CollapsedNum,
4959 return T->getStmtClass() == OMPTeamsDistributeDirectiveClass;
4985 llvm::omp::OMPD_teams_distribute_simd, StartLoc,
4986 EndLoc, CollapsedNum) {}
4994 llvm::omp::OMPD_teams_distribute_simd,
5008 static OMPTeamsDistributeSimdDirective *
5009 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5010 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5011 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5020 static OMPTeamsDistributeSimdDirective *
CreateEmpty(
const ASTContext &
C,
5021 unsigned NumClauses,
5022 unsigned CollapsedNum,
5026 return T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass;
5052 unsigned CollapsedNum)
5054 llvm::omp::OMPD_teams_distribute_parallel_for_simd,
5055 StartLoc, EndLoc, CollapsedNum) {}
5063 llvm::omp::OMPD_teams_distribute_parallel_for_simd,
5077 static OMPTeamsDistributeParallelForSimdDirective *
5078 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5079 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5080 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5088 static OMPTeamsDistributeParallelForSimdDirective *
5089 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
5093 return T->getStmtClass() == OMPTeamsDistributeParallelForSimdDirectiveClass;
5110 bool HasCancel =
false;
5120 unsigned CollapsedNum)
5122 llvm::omp::OMPD_teams_distribute_parallel_for,
5123 StartLoc, EndLoc, CollapsedNum) {}
5131 llvm::omp::OMPD_teams_distribute_parallel_for,
5135 void setTaskReductionRefExpr(Expr *
E) {
5137 getLoopsNumber(), llvm::omp::OMPD_teams_distribute_parallel_for)] =
E;
5141 void setHasCancel(
bool Has) { HasCancel = Has; }
5157 static OMPTeamsDistributeParallelForDirective *
5158 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5159 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5160 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
5169 static OMPTeamsDistributeParallelForDirective *
5170 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
5176 getLoopsNumber(), llvm::omp::OMPD_teams_distribute_parallel_for)]);
5187 return T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass;
5209 llvm::omp::OMPD_target_teams, StartLoc, EndLoc) {
5228 static OMPTargetTeamsDirective *
Create(
const ASTContext &
C,
5229 SourceLocation StartLoc,
5230 SourceLocation EndLoc,
5231 ArrayRef<OMPClause *> Clauses,
5232 Stmt *AssociatedStmt);
5239 static OMPTargetTeamsDirective *
CreateEmpty(
const ASTContext &
C,
5240 unsigned NumClauses, EmptyShell);
5243 return T->getStmtClass() == OMPTargetTeamsDirectiveClass;
5267 unsigned CollapsedNum)
5269 llvm::omp::OMPD_target_teams_distribute, StartLoc,
5270 EndLoc, CollapsedNum) {}
5278 llvm::omp::OMPD_target_teams_distribute,
5292 static OMPTargetTeamsDistributeDirective *
5293 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5294 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5295 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5303 static OMPTargetTeamsDistributeDirective *
5304 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
5308 return T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass;
5326 bool HasCancel =
false;
5336 unsigned CollapsedNum)
5338 llvm::omp::OMPD_target_teams_distribute_parallel_for,
5339 StartLoc, EndLoc, CollapsedNum) {}
5347 llvm::omp::OMPD_target_teams_distribute_parallel_for,
5351 void setTaskReductionRefExpr(Expr *
E) {
5354 llvm::omp::OMPD_target_teams_distribute_parallel_for)] =
E;
5358 void setHasCancel(
bool Has) { HasCancel = Has; }
5374 static OMPTargetTeamsDistributeParallelForDirective *
5375 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5376 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5377 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
5386 static OMPTargetTeamsDistributeParallelForDirective *
5387 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
5394 llvm::omp::OMPD_target_teams_distribute_parallel_for)]);
5405 return T->getStmtClass() ==
5406 OMPTargetTeamsDistributeParallelForDirectiveClass;
5432 unsigned CollapsedNum)
5434 OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
5435 llvm::omp::OMPD_target_teams_distribute_parallel_for_simd, StartLoc,
5436 EndLoc, CollapsedNum) {}
5443 unsigned CollapsedNum)
5445 OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
5446 llvm::omp::OMPD_target_teams_distribute_parallel_for_simd,
5460 static OMPTargetTeamsDistributeParallelForSimdDirective *
5461 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5462 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5463 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5471 static OMPTargetTeamsDistributeParallelForSimdDirective *
5472 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
5476 return T->getStmtClass() ==
5477 OMPTargetTeamsDistributeParallelForSimdDirectiveClass;
5502 unsigned CollapsedNum)
5504 llvm::omp::OMPD_target_teams_distribute_simd, StartLoc,
5505 EndLoc, CollapsedNum) {}
5513 llvm::omp::OMPD_target_teams_distribute_simd,
5527 static OMPTargetTeamsDistributeSimdDirective *
5528 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5529 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5530 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5538 static OMPTargetTeamsDistributeSimdDirective *
5539 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
5543 return T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
5555 TransformedStmtOffset,
5561 llvm::omp::OMPD_tile, StartLoc, EndLoc,
5566 void setPreInits(Stmt *PreInits) {
5567 Data->getChildren()[PreInitsOffset] = PreInits;
5570 void setTransformedStmt(Stmt *S) {
5571 Data->getChildren()[TransformedStmtOffset] = S;
5587 static OMPTileDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
5588 SourceLocation EndLoc,
5589 ArrayRef<OMPClause *> Clauses,
5590 unsigned NumLoops, Stmt *AssociatedStmt,
5591 Stmt *TransformedStmt, Stmt *PreInits);
5598 static OMPTileDirective *
CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
5613 return Data->getChildren()[TransformedStmtOffset];
5620 return T->getStmtClass() == OMPTileDirectiveClass;
5637 TransformedStmtOffset,
5642 llvm::omp::OMPD_unroll, StartLoc, EndLoc,
5646 void setPreInits(Stmt *PreInits) {
5647 Data->getChildren()[PreInitsOffset] = PreInits;
5651 void setTransformedStmt(Stmt *S) {
5652 Data->getChildren()[TransformedStmtOffset] = S;
5666 static OMPUnrollDirective *
5667 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5668 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
5669 unsigned NumGeneratedLoops, Stmt *TransformedStmt, Stmt *PreInits);
5675 static OMPUnrollDirective *
CreateEmpty(
const ASTContext &
C,
5676 unsigned NumClauses);
5686 return Data->getChildren()[TransformedStmtOffset];
5693 return T->getStmtClass() == OMPUnrollDirectiveClass;
5711 TransformedStmtOffset,
5716 llvm::omp::OMPD_reverse, StartLoc,
5719 void setPreInits(Stmt *PreInits) {
5720 Data->getChildren()[PreInitsOffset] = PreInits;
5723 void setTransformedStmt(Stmt *S) {
5724 Data->getChildren()[TransformedStmtOffset] = S;
5737 static OMPReverseDirective *
5738 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5739 Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits);
5745 static OMPReverseDirective *
CreateEmpty(
const ASTContext &
C);
5750 return Data->getChildren()[TransformedStmtOffset];
5757 return T->getStmtClass() == OMPReverseDirectiveClass;
5776 TransformedStmtOffset,
5782 llvm::omp::OMPD_interchange, StartLoc,
5787 void setPreInits(Stmt *PreInits) {
5788 Data->getChildren()[PreInitsOffset] = PreInits;
5791 void setTransformedStmt(Stmt *S) {
5792 Data->getChildren()[TransformedStmtOffset] = S;
5808 static OMPInterchangeDirective *
5809 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5810 ArrayRef<OMPClause *> Clauses,
unsigned NumLoops, Stmt *AssociatedStmt,
5811 Stmt *TransformedStmt, Stmt *PreInits);
5818 static OMPInterchangeDirective *
5819 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned NumLoops);
5824 return Data->getChildren()[TransformedStmtOffset];
5831 return T->getStmtClass() == OMPInterchangeDirectiveClass;
5852 StartLoc, EndLoc) {}
5869 static OMPScanDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
5870 SourceLocation EndLoc,
5871 ArrayRef<OMPClause *> Clauses);
5879 static OMPScanDirective *
CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
5883 return T->getStmtClass() == OMPScanDirectiveClass;
5906 llvm::omp::OMPD_interop, StartLoc, EndLoc) {}
5923 static OMPInteropDirective *
Create(
const ASTContext &
C,
5924 SourceLocation StartLoc,
5925 SourceLocation EndLoc,
5926 ArrayRef<OMPClause *> Clauses);
5932 static OMPInteropDirective *
CreateEmpty(
const ASTContext &
C,
5933 unsigned NumClauses, EmptyShell);
5936 return T->getStmtClass() == OMPInteropDirectiveClass;
5965 llvm::omp::OMPD_dispatch, StartLoc, EndLoc) {}
5969 explicit OMPDispatchDirective()
5971 llvm::omp::OMPD_dispatch, SourceLocation(),
5972 SourceLocation()) {}
5984 static OMPDispatchDirective *
5985 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5986 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
5987 SourceLocation TargetCallLoc);
5995 static OMPDispatchDirective *
CreateEmpty(
const ASTContext &
C,
5996 unsigned NumClauses, EmptyShell);
6002 return T->getStmtClass() == OMPDispatchDirectiveClass;
6024 StartLoc, EndLoc) {}
6040 static OMPMaskedDirective *
6041 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
6042 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
6048 static OMPMaskedDirective *
CreateEmpty(
const ASTContext &
C,
6049 unsigned NumClauses, EmptyShell);
6052 return T->getStmtClass() == OMPMaskedDirectiveClass;
6071 llvm::omp::OMPD_metadirective, StartLoc,
6078 void setIfStmt(Stmt *S) { IfStmt = S; }
6081 static OMPMetaDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
6082 SourceLocation EndLoc,
6083 ArrayRef<OMPClause *> Clauses,
6084 Stmt *AssociatedStmt, Stmt *IfStmt);
6085 static OMPMetaDirective *
CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
6090 return T->getStmtClass() == OMPMetaDirectiveClass;
6113 unsigned CollapsedNum)
6115 StartLoc, EndLoc, CollapsedNum) {}
6136 static OMPGenericLoopDirective *
6137 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
6138 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6139 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6147 static OMPGenericLoopDirective *
CreateEmpty(
const ASTContext &
C,
6148 unsigned NumClauses,
6149 unsigned CollapsedNum,
6153 return T->getStmtClass() == OMPGenericLoopDirectiveClass;
6175 unsigned CollapsedNum)
6177 llvm::omp::OMPD_teams_loop, StartLoc, EndLoc,
6200 static OMPTeamsGenericLoopDirective *
6201 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
6202 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6203 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6212 static OMPTeamsGenericLoopDirective *
CreateEmpty(
const ASTContext &
C,
6213 unsigned NumClauses,
6214 unsigned CollapsedNum,
6218 return T->getStmtClass() == OMPTeamsGenericLoopDirectiveClass;
6234 bool CanBeParallelFor =
false;
6243 unsigned CollapsedNum)
6245 llvm::omp::OMPD_target_teams_loop, StartLoc, EndLoc,
6258 void setCanBeParallelFor(
bool ParFor) { CanBeParallelFor = ParFor; }
6271 static OMPTargetTeamsGenericLoopDirective *
6272 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
6273 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6274 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool CanBeParallelFor);
6283 static OMPTargetTeamsGenericLoopDirective *
CreateEmpty(
const ASTContext &
C,
6284 unsigned NumClauses,
6285 unsigned CollapsedNum,
6293 return T->getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass;
6317 llvm::omp::OMPD_parallel_loop, StartLoc, EndLoc,
6340 static OMPParallelGenericLoopDirective *
6341 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
6342 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6343 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6352 static OMPParallelGenericLoopDirective *
CreateEmpty(
const ASTContext &
C,
6353 unsigned NumClauses,
6354 unsigned CollapsedNum,
6358 return T->getStmtClass() == OMPParallelGenericLoopDirectiveClass;
6381 unsigned CollapsedNum)
6383 llvm::omp::OMPD_target_parallel_loop, StartLoc, EndLoc,
6406 static OMPTargetParallelGenericLoopDirective *
6407 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
6408 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6409 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6418 static OMPTargetParallelGenericLoopDirective *
6419 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
6423 return T->getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass;
6442 StartLoc, EndLoc) {}
6456 static OMPErrorDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
6457 SourceLocation EndLoc,
6458 ArrayRef<OMPClause *> Clauses);
6464 static OMPErrorDirective *
CreateEmpty(
const ASTContext &
C,
6465 unsigned NumClauses, EmptyShell);
6468 return T->getStmtClass() == OMPErrorDirectiveClass;
6481 StartLoc, EndLoc) {}
6488 static OMPAssumeDirective *
Create(
const ASTContext &Ctx,
6489 SourceLocation StartLoc,
6490 SourceLocation EndLoc,
6491 ArrayRef<OMPClause *> Clauses, Stmt *AStmt);
6493 static OMPAssumeDirective *
CreateEmpty(
const ASTContext &
C,
6494 unsigned NumClauses, EmptyShell);
6497 return T->getStmtClass() == OMPAssumeDirectiveClass;
Defines the clang::ASTContext interface.
enum clang::sema::@1655::IndirectLocalPathEntry::EntryKind Kind
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 ...
This captures a statement into a function.
A reference to a declared variable, function, enum, etc.
This represents one expression.
IfStmt - This represents an if/then/else.
static OMPAssumeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
static bool classof(const Stmt *T)
This represents '#pragma omp atomic' directive.
const Expr * getR() const
static bool classof(const Stmt *T)
bool isXLHSInRHSPart() const
Return true if helper update expression has form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' and...
bool isFailOnly() const
Return true if 'v' is updated only when the condition is evaluated false (compare capture only).
Expr * getD()
Get 'd' part of the associated expression/statement.
Expr * getCondExpr() const
Expr * getExpr()
Get 'expr' part of the associated expression/statement.
Expr * getX()
Get 'x' part of the associated expression/statement.
Expr * getCondExpr()
Get the 'cond' part of the source atomic expression.
bool isPostfixUpdate() const
Return true if 'v' expression must be updated to original value of 'x', false if 'v' must be updated ...
const Expr * getX() const
Expr * getV()
Get 'v' part of the associated expression/statement.
friend class OMPExecutableDirective
Expr * getUpdateExpr()
Get helper expression of the form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExp...
const Expr * getExpr() const
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
const Expr * getUpdateExpr() const
Expr * getR()
Get 'r' part of the associated expression/statement.
const Expr * getV() const
This represents '#pragma omp barrier' directive.
static bool classof(const Stmt *T)
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
This represents '#pragma omp cancel' directive.
static bool classof(const Stmt *T)
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents '#pragma omp cancellation point' directive.
static bool classof(const Stmt *T)
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Representation of an OpenMP canonical loop.
child_range children()
Return this AST node's children.
DeclRefExpr * getLoopVarRef()
Reference to the loop user variable as accessed in the loop body.
const CapturedStmt * getDistanceFunc() const
const DeclRefExpr * getLoopVarRef() const
CapturedStmt * getLoopVarFunc()
The function that computes the loop user variable from a logical iteration counter.
SourceLocation getEndLoc() const
void setLoopStmt(Stmt *S)
Stmt * getLoopStmt()
The wrapped syntactic loop statement (ForStmt or CXXForRangeStmt).
CapturedStmt * getDistanceFunc()
The function that computes the number of loop iterations.
const CapturedStmt * getLoopVarFunc() const
static OMPCanonicalLoop * create(const ASTContext &Ctx, Stmt *LoopStmt, CapturedStmt *DistanceFunc, CapturedStmt *LoopVarFunc, DeclRefExpr *LoopVarRef)
Create a new OMPCanonicalLoop.
void setDistanceFunc(CapturedStmt *S)
static bool classof(const Stmt *S)
const Stmt * getLoopStmt() const
const_child_range children() const
void setLoopVarFunc(CapturedStmt *S)
SourceLocation getBeginLoc() const
static OMPCanonicalLoop * createEmpty(const ASTContext &Ctx)
Create an empty OMPCanonicalLoop for deserialization.
void setLoopVarRef(DeclRefExpr *E)
Contains data for OpenMP directives: clauses, children expressions/statements (helpers for codegen) a...
unsigned getNumClauses() const
const CapturedStmt * getCapturedStmt(OpenMPDirectiveKind RegionKind, ArrayRef< OpenMPDirectiveKind > CaptureRegions) const
Returns the captured statement associated with the component region within the (combined) directive.
bool hasAssociatedStmt() const
Stmt::child_range getAssociatedStmtAsRange()
const Stmt * getAssociatedStmt() const
Returns statement associated with the directive.
MutableArrayRef< OMPClause * > getClauses()
Get the clauses storage.
MutableArrayRef< Stmt * > getChildren()
CapturedStmt * getInnermostCapturedStmt(ArrayRef< OpenMPDirectiveKind > CaptureRegions)
Get innermost captured statement for the construct.
This is a basic class for representing single OpenMP clause.
This represents '#pragma omp critical' directive.
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
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)
static OMPDepobjDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp dispatch' directive.
static bool classof(const Stmt *T)
static OMPDispatchDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
SourceLocation getTargetCallLoc() const
Return location of target-call.
friend class OMPExecutableDirective
This represents '#pragma omp distribute' directive.
static bool classof(const Stmt *T)
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp distribute parallel for' composite directive.
static OMPDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
const Expr * getTaskReductionRefExpr() const
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.
This represents '#pragma omp distribute parallel for simd' composite directive.
static bool classof(const Stmt *T)
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp distribute simd' composite directive.
static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static bool classof(const Stmt *T)
This represents '#pragma omp error' directive.
static bool classof(const Stmt *T)
static OMPErrorDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Iterates over a filtered subrange of clauses applied to a directive.
specific_clause_iterator(ArrayRef< OMPClause * > Clauses)
const SpecificClause * operator->() const
const SpecificClause * operator*() const
specific_clause_iterator & operator++()
Iterates over expressions/statements used in the construct.
used_clauses_child_iterator & operator++()
Stmt * operator->() const
used_clauses_child_iterator(ArrayRef< OMPClause * > Clauses)
This is a basic class for representing single OpenMP executable directive.
void setLocStart(SourceLocation Loc)
Set starting location of directive kind.
CapturedStmt * getInnermostCapturedStmt()
Get innermost captured statement for the construct.
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
OMPClause * getClause(unsigned I) const
Returns specified clause.
static T * createDirective(const ASTContext &C, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, unsigned NumChildren, Params &&... P)
const_child_range children() const
const CapturedStmt * getCapturedStmt(OpenMPDirectiveKind RegionKind) const
Returns the captured statement associated with the component region within the (combined) directive.
OMPExecutableDirective(StmtClass SC, OpenMPDirectiveKind K, SourceLocation StartLoc, SourceLocation EndLoc)
Build instance of directive of class K.
const SpecificClause * getSingleClause() const
OpenMPDirectiveKind getDirectiveKind() const
const Stmt * getAssociatedStmt() const
Returns statement associated with the directive.
llvm::iterator_range< specific_clause_iterator< SpecificClause > > getClausesOfKind() const
SourceLocation getBeginLoc() const
Returns starting location of directive kind.
const Stmt * getRawStmt() const
ArrayRef< OMPClause * > clauses() const
unsigned getNumClauses() const
Get number of clauses.
OMPChildren * Data
Data, associated with the directive.
const CapturedStmt * getInnermostCapturedStmt() const
static T * createEmptyDirective(const ASTContext &C, unsigned NumClauses, bool HasAssociatedStmt=false, unsigned NumChildren=0)
void setLocEnd(SourceLocation Loc)
Set ending location of directive.
bool hasClausesOfKind() const
Returns true if the current directive has one or more clauses of a specific kind.
SourceLocation getEndLoc() const
Returns ending location of directive.
static bool classof(const Stmt *S)
const Stmt * getStructuredBlock() const
Returns the AST node representing OpenMP structured-block of this OpenMP executable directive,...
Stmt * getAssociatedStmt()
static const SpecificClause * getSingleClause(ArrayRef< OMPClause * > Clauses)
Gets a single clause of the specified kind associated with the current directive iff there is only on...
bool isStandaloneDirective() const
Returns whether or not this is a Standalone directive.
static llvm::iterator_range< used_clauses_child_iterator > used_clauses_children(ArrayRef< OMPClause * > Clauses)
static T * createEmptyDirective(const ASTContext &C, unsigned NumClauses, bool HasAssociatedStmt, unsigned NumChildren, Params &&... P)
static llvm::iterator_range< specific_clause_iterator< SpecificClause > > getClausesOfKind(ArrayRef< OMPClause * > Clauses)
This represents '#pragma omp flush' directive.
static bool classof(const Stmt *T)
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp for' directive.
static bool classof(const Stmt *T)
const Expr * getTaskReductionRefExpr() const
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
bool hasCancel() const
Return true if current directive has inner cancel directive.
This represents '#pragma omp for simd' directive.
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static bool classof(const Stmt *T)
This represents '#pragma omp loop' directive.
static bool classof(const Stmt *T)
static OMPGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with a place for NumClauses clauses.
Represents the '#pragma omp interchange' loop transformation directive.
Stmt * getTransformedStmt() const
Gets the associated loops after the transformation.
static OMPInterchangeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty '#pragma omp interchange' AST node for deserialization.
Stmt * getPreInits() const
Return preinits statement.
static bool classof(const Stmt *T)
This represents '#pragma omp interop' directive.
static OMPInteropDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static bool classof(const Stmt *T)
The base class for all loop-based directives, including loop transformation directives.
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 doForAllLoops(const Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops, llvm::function_ref< bool(unsigned, const Stmt *)> Callback)
static bool classof(const Stmt *T)
OMPLoopBasedDirective(StmtClass SC, OpenMPDirectiveKind Kind, SourceLocation StartLoc, SourceLocation EndLoc, unsigned NumAssociatedLoops)
Build instance of loop directive of class Kind.
static void doForAllLoopsBodies(const Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops, llvm::function_ref< void(unsigned, const Stmt *, const Stmt *)> Callback)
unsigned NumAssociatedLoops
Number of collapsed loops as specified by 'collapse' clause.
static Stmt * tryToFindNextInnerLoop(Stmt *CurStmt, bool TryImperfectlyNestedLoops)
Try to find the next loop sub-statement in the specified statement CurStmt.
static bool doForAllLoops(Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops, llvm::function_ref< bool(unsigned, Stmt *)> Callback)
Calls the specified callback function for all the loops in CurStmt, from the outermost to the innermo...
static bool doForAllLoops(Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops, llvm::function_ref< bool(unsigned, Stmt *)> Callback, llvm::function_ref< void(OMPLoopTransformationDirective *)> OnTransformationCallback)
Calls the specified callback function for all the loops in CurStmt, from the outermost to the innermo...
unsigned getLoopsNumber() const
Get number of collapsed loops.
static const Stmt * tryToFindNextInnerLoop(const Stmt *CurStmt, bool TryImperfectlyNestedLoops)
static bool doForAllLoops(const Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops, llvm::function_ref< bool(unsigned, const Stmt *)> Callback, llvm::function_ref< void(const OMPLoopTransformationDirective *)> OnTransformationCallback)
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc....
ArrayRef< Expr * > finals() const
Expr * getStrideVariable() const
void setNextLowerBound(Expr *NLB)
Expr * getIsLastIterVariable() const
ArrayRef< Expr * > finals_conditions()
OMPLoopDirective(StmtClass SC, OpenMPDirectiveKind Kind, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum)
Build instance of loop directive of class Kind.
void setFinals(ArrayRef< Expr * > A)
ArrayRef< Expr * > inits()
void setPreCond(Expr *PC)
Expr * getCombinedParForInDistCond() const
Expr * getPrevUpperBoundVariable() const
ArrayRef< Expr * > counters()
void setPrevUpperBoundVariable(Expr *PrevUB)
void setCombinedLowerBoundVariable(Expr *CombLB)
void setDependentCounters(ArrayRef< Expr * > A)
static unsigned getArraysOffset(OpenMPDirectiveKind Kind)
Offset to the start of children expression arrays.
void setNumIterations(Expr *NI)
Expr * getPrevEnsureUpperBound() const
Expr * getLastIteration() const
Expr * getCombinedNextUpperBound() const
ArrayRef< Expr * > dependent_inits() const
Expr * getDistInc() const
ArrayRef< Expr * > inits() const
void setDistInc(Expr *DistInc)
void setPreInits(Stmt *PreInits)
void setFinalsConditions(ArrayRef< Expr * > A)
void setCombinedCond(Expr *CombCond)
void setIterationVariable(Expr *IV)
ArrayRef< Expr * > private_counters() const
Expr * getCalcLastIteration() const
ArrayRef< Expr * > counters() const
Expr * getCombinedUpperBoundVariable() const
Expr * getCombinedCond() const
Expr * getNumIterations() const
void setPrevEnsureUpperBound(Expr *PrevEUB)
void setCalcLastIteration(Expr *CLI)
ArrayRef< Expr * > finals()
Expr * getPrevLowerBoundVariable() const
void setPrevLowerBoundVariable(Expr *PrevLB)
const Stmt * getPreInits() const
ArrayRef< Expr * > finals_conditions() const
void setCombinedNextLowerBound(Expr *CombNLB)
void setNextUpperBound(Expr *NUB)
ArrayRef< Expr * > updates() const
Expr * getNextLowerBound() const
ArrayRef< Expr * > dependent_counters()
void setInits(ArrayRef< Expr * > A)
Expr * getNextUpperBound() const
static unsigned numLoopChildren(unsigned CollapsedNum, OpenMPDirectiveKind Kind)
Children number.
const Stmt * getBody() const
ArrayRef< Expr * > dependent_counters() const
void setEnsureUpperBound(Expr *EUB)
void setCombinedInit(Expr *CombInit)
void setUpperBoundVariable(Expr *UB)
void setLowerBoundVariable(Expr *LB)
Expr * getIterationVariable() const
Expr * getEnsureUpperBound() const
void setCombinedParForInDistCond(Expr *CombParForInDistCond)
void setCombinedNextUpperBound(Expr *CombNUB)
Expr * getCombinedNextLowerBound() const
Expr * getUpperBoundVariable() const
ArrayRef< Expr * > dependent_inits()
Expr * getCombinedDistCond() const
void setCounters(ArrayRef< Expr * > A)
void setCombinedDistCond(Expr *CombDistCond)
Expr * getCombinedLowerBoundVariable() const
ArrayRef< Expr * > updates()
void setDependentInits(ArrayRef< Expr * > A)
void setIsLastIterVariable(Expr *IL)
void setStrideVariable(Expr *ST)
void setLastIteration(Expr *LI)
Expr * getLowerBoundVariable() const
Expr * getCombinedEnsureUpperBound() const
Expr * getCombinedInit() const
void setCombinedEnsureUpperBound(Expr *CombEUB)
ArrayRef< Expr * > private_counters()
Expr * getPreCond() const
static bool classof(const Stmt *T)
void setCombinedUpperBoundVariable(Expr *CombUB)
void setUpdates(ArrayRef< Expr * > A)
void setPrivateCounters(ArrayRef< Expr * > A)
This represents '#pragma omp masked' directive.
static OMPMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static bool classof(const Stmt *T)
This represents '#pragma omp masked taskloop' directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
static bool classof(const Stmt *T)
static OMPMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp masked taskloop simd' directive.
static OMPMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static bool classof(const Stmt *T)
This represents '#pragma omp master' directive.
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static bool classof(const Stmt *T)
This represents '#pragma omp master taskloop' directive.
static bool classof(const Stmt *T)
static OMPMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
bool hasCancel() const
Return true if current directive has inner cancel directive.
This represents '#pragma omp master taskloop simd' directive.
static bool classof(const Stmt *T)
static OMPMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp ordered' directive.
static bool classof(const Stmt *T)
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, bool IsStandalone, EmptyShell)
Creates an empty directive.
This represents '#pragma omp parallel' directive.
const Expr * getTaskReductionRefExpr() const
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.
static OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents '#pragma omp parallel for' directive.
const Expr * getTaskReductionRefExpr() const
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.
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel for simd' directive.
static bool classof(const Stmt *T)
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel loop' directive.
static OMPParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static bool classof(const Stmt *T)
This represents '#pragma omp parallel masked' directive.
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
static bool classof(const Stmt *T)
static OMPParallelMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
const Expr * getTaskReductionRefExpr() const
This represents '#pragma omp parallel masked taskloop' directive.
static bool classof(const Stmt *T)
bool hasCancel() const
Return true if current directive has inner cancel directive.
static OMPParallelMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel masked taskloop simd' directive.
static OMPParallelMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static bool classof(const Stmt *T)
This represents '#pragma omp parallel master' directive.
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
const Expr * getTaskReductionRefExpr() const
static bool classof(const Stmt *T)
static OMPParallelMasterDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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)
static OMPParallelMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel master taskloop simd' directive.
static bool classof(const Stmt *T)
static OMPParallelMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel sections' directive.
const Expr * getTaskReductionRefExpr() const
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
bool hasCancel() const
Return true if current directive has inner cancel directive.
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static bool classof(const Stmt *T)
Represents the '#pragma omp reverse' loop transformation directive.
static bool classof(const Stmt *T)
Stmt * getTransformedStmt() const
Gets/sets the associated loops after the transformation, i.e.
static OMPReverseDirective * CreateEmpty(const ASTContext &C)
Build an empty '#pragma omp reverse' AST node for deserialization.
Stmt * getPreInits() const
Return preinits statement.
This represents '#pragma omp scan' directive.
static OMPScanDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static bool classof(const Stmt *T)
This represents '#pragma omp scope' directive.
static bool classof(const Stmt *T)
static OMPScopeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents '#pragma omp section' directive.
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static bool classof(const Stmt *T)
void setHasCancel(bool Has)
Set cancel state.
bool hasCancel() const
Return true if current directive has inner cancel directive.
This represents '#pragma omp sections' directive.
static bool classof(const Stmt *T)
bool hasCancel() const
Return true if current directive has inner cancel directive.
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
const Expr * getTaskReductionRefExpr() const
This represents '#pragma omp simd' directive.
static bool classof(const Stmt *T)
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp single' directive.
static bool classof(const Stmt *T)
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target data' directive.
static bool classof(const Stmt *T)
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents '#pragma omp target' directive.
static bool classof(const Stmt *T)
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target enter data' directive.
static bool classof(const Stmt *T)
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents '#pragma omp target exit data' directive.
static bool classof(const Stmt *T)
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents '#pragma omp target parallel' directive.
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
static bool classof(const Stmt *T)
bool hasCancel() const
Return true if current directive has inner cancel directive.
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
const Expr * getTaskReductionRefExpr() const
This represents '#pragma omp target parallel for' directive.
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
bool hasCancel() const
Return true if current directive has inner cancel directive.
const Expr * getTaskReductionRefExpr() const
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static bool classof(const Stmt *T)
This represents '#pragma omp target parallel for simd' directive.
static bool classof(const Stmt *T)
static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target parallel loop' directive.
static bool classof(const Stmt *T)
static OMPTargetParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target simd' directive.
static bool classof(const Stmt *T)
static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams' directive.
static bool classof(const Stmt *T)
static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams distribute' combined directive.
static bool classof(const Stmt *T)
static OMPTargetTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams distribute parallel for' combined directive.
static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
const Expr * getTaskReductionRefExpr() const
bool hasCancel() const
Return true if current directive has inner cancel directive.
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
static bool classof(const Stmt *T)
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
static OMPTargetTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static bool classof(const Stmt *T)
This represents '#pragma omp target teams distribute simd' combined directive.
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static bool classof(const Stmt *T)
This represents '#pragma omp target teams loop' directive.
bool canBeParallelFor() const
Return true if current loop directive's associated loop can be a parallel for.
static bool classof(const Stmt *T)
static OMPTargetTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target update' directive.
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static bool classof(const Stmt *T)
This represents '#pragma omp task' directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static bool classof(const Stmt *T)
This represents '#pragma omp taskloop' directive.
static bool classof(const Stmt *T)
bool hasCancel() const
Return true if current directive has inner cancel directive.
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp taskloop simd' directive.
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static bool classof(const Stmt *T)
This represents '#pragma omp taskgroup' directive.
static bool classof(const Stmt *T)
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
const Expr * getReductionRef() const
Returns reference to the task_reduction return variable.
This represents '#pragma omp taskwait' directive.
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static bool classof(const Stmt *T)
This represents '#pragma omp taskyield' directive.
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static bool classof(const Stmt *T)
This represents '#pragma omp teams' directive.
static bool classof(const Stmt *T)
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams distribute' directive.
static bool classof(const Stmt *T)
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams distribute parallel for' composite directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
const Expr * getTaskReductionRefExpr() const
static bool classof(const Stmt *T)
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams distribute parallel for simd' composite directive.
static bool classof(const Stmt *T)
static OMPTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams distribute simd' combined directive.
static bool classof(const Stmt *T)
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams loop' directive.
static OMPTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static bool classof(const Stmt *T)
This represents the '#pragma omp tile' loop transformation directive.
Stmt * getPreInits() const
Return preinits statement.
static OMPTileDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty '#pragma omp tile' AST node for deserialization.
Stmt * getTransformedStmt() const
Gets/sets the associated loops after tiling.
static bool classof(const Stmt *T)
This represents the '#pragma omp unroll' loop transformation directive.
static bool classof(const Stmt *T)
Stmt * getTransformedStmt() const
Get the de-sugared associated loops after unrolling.
Stmt * getPreInits() const
Return the pre-init statements.
static OMPUnrollDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Build an empty '#pragma omp unroll' AST node for deserialization.
Encodes a location in the source.
Stmt - This represents one statement.
SourceLocation getEndLoc() const LLVM_READONLY
StmtIterator child_iterator
Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatem...
llvm::iterator_range< child_iterator > child_range
SourceLocation getBeginLoc() const LLVM_READONLY
llvm::iterator_range< const_child_iterator > const_child_range
The JSON file list parser is used to communicate input to InstallAPI.
bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a worksharing directive.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a distribute directive.
bool isOpenMPGenericLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive constitutes a 'loop' directive in the outermost nest.
bool isOpenMPLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a directive with an associated loop construct.
bool isOpenMPLoopBoundSharingDirective(OpenMPDirectiveKind Kind)
Checks if the specified directive kind is one of the composite or combined directives that need loop ...
const FunctionProtoType * T
void getOpenMPCaptureRegions(llvm::SmallVectorImpl< OpenMPDirectiveKind > &CaptureRegions, OpenMPDirectiveKind DKind)
Return the captured regions of an OpenMP directive.
bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a taskloop directive.
Diagnostic wrappers for TextAPI types for error reporting.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
Expr * E
'expr' part of the associated expression/statement.
Expr * D
'd' part of the associated expression/statement.
Expr * UE
UE Helper expression of the form: 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExp...
bool IsFailOnly
True if 'v' is updated only when the condition is false (compare capture only).
Expr * X
'x' part of the associated expression/statement.
Expr * Cond
Conditional expression in atomic compare construct.
Expr * V
'v' part of the associated expression/statement.
bool IsPostfixUpdate
True if original value of 'x' must be stored in 'v', not an updated one.
bool IsXLHSInRHSPart
True if UE has the first form and false if the second.
The expressions built to support OpenMP loops in combined/composite pragmas (e.g.
Expr * ParForInDistCond
'omp parallel for' loop condition used when composed with 'omp distribute' in the same construct and ...
Expr * LB
DistributeLowerBound - used when composing 'omp distribute' with 'omp for' in a same construct.
Expr * Init
Distribute loop iteration variable init used when composing 'omp distribute' with 'omp for' in a same...
Expr * NUB
Update of UpperBound for statically scheduled omp loops for outer loop in combined constructs (e....
Expr * EUB
DistributeEnsureUpperBound - used when composing 'omp distribute' with 'omp for' in a same construct,...
Expr * UB
DistributeUpperBound - used when composing 'omp distribute' with 'omp for' in a same construct.
Expr * NLB
Update of LowerBound for statically scheduled omp loops for outer loop in combined constructs (e....
Expr * DistCond
Distribute Loop condition used when composing 'omp distribute' with 'omp for' in a same construct whe...
Expr * Cond
Distribute Loop condition used when composing 'omp distribute' with 'omp for' in a same construct.
The expressions built for the OpenMP loop CodeGen for the whole collapsed loop nest.
Expr * LastIteration
Loop last iteration number.
Expr * Cond
Loop condition.
SmallVector< Expr *, 4 > DependentInits
List of initializers required for the generation of the non-rectangular loops.
SmallVector< Expr *, 4 > Inits
Expressions for loop counters inits for CodeGen.
Expr * PrevEUB
PrevEUB - expression similar to EUB but to be used when loop scheduling uses PrevLB and PrevUB (e....
Expr * DistInc
DistInc - increment expression for distribute loop when found combined with a further loop level (e....
Expr * IL
IsLastIteration - local flag variable passed to runtime.
SmallVector< Expr *, 4 > PrivateCounters
PrivateCounters Loop counters.
bool builtAll()
Check if all the expressions are built (does not check the worksharing ones).
Expr * CalcLastIteration
Calculation of last iteration.
SmallVector< Expr *, 4 > Updates
Expressions for loop counters update for CodeGen.
Expr * ST
Stride - local variable passed to runtime.
SmallVector< Expr *, 4 > Finals
Final loop counter values for GodeGen.
SmallVector< Expr *, 4 > FinalsConditions
List of final conditions required for the generation of the non-rectangular loops.
Expr * PreCond
Loop pre-condition.
Stmt * PreInits
Init statement for all captured expressions.
Expr * IterationVarRef
Loop iteration variable.
Expr * NumIterations
Loop number of iterations.
SmallVector< Expr *, 4 > Counters
Counters Loop counters.
Expr * NLB
Update of LowerBound for statically scheduled 'omp for' loops.
Expr * PrevUB
PreviousUpperBound - local variable passed to runtime in the enclosing schedule or null if that does ...
DistCombinedHelperExprs DistCombinedFields
Expressions used when combining OpenMP loop pragmas.
void clear(unsigned Size)
Initialize all the fields to null.
Expr * Inc
Loop increment.
Expr * EUB
EnsureUpperBound – expression UB = min(UB, NumIterations).
Expr * UB
UpperBound - local variable passed to runtime.
Expr * NUB
Update of UpperBound for statically scheduled 'omp for' loops.
Expr * LB
LowerBound - local variable passed to runtime.
Expr * PrevLB
PreviousLowerBound - local variable passed to runtime in the enclosing schedule or null if that does ...
SmallVector< Expr *, 4 > DependentCounters
List of counters required for the generation of the non-rectangular loops.
Expr * Init
Loop iteration variable init.
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....