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;
306 :
Stmt(SC), Kind(K), StartLoc(
std::move(StartLoc)),
307 EndLoc(
std::move(EndLoc)) {}
309 template <
typename T,
typename... Params>
311 Stmt *AssociatedStmt,
unsigned NumChildren,
314 C.Allocate(
sizeof(T) + OMPChildren::size(Clauses.size(), AssociatedStmt,
318 auto *
Data = OMPChildren::Create(
reinterpret_cast<T *
>(Mem) + 1, Clauses,
319 AssociatedStmt, NumChildren);
320 auto *Inst =
new (Mem) T(std::forward<Params>(
P)...);
325 template <
typename T,
typename... Params>
327 bool HasAssociatedStmt,
unsigned NumChildren,
330 C.Allocate(
sizeof(T) + OMPChildren::size(NumClauses, HasAssociatedStmt,
334 OMPChildren::CreateEmpty(
reinterpret_cast<T *
>(Mem) + 1, NumClauses,
335 HasAssociatedStmt, NumChildren);
336 auto *Inst =
new (Mem) T(std::forward<Params>(
P)...);
341 template <
typename T>
343 bool HasAssociatedStmt =
false,
344 unsigned NumChildren = 0) {
346 C.Allocate(
sizeof(T) + OMPChildren::size(NumClauses, HasAssociatedStmt,
350 OMPChildren::CreateEmpty(
reinterpret_cast<T *
>(Mem) + 1, NumClauses,
351 HasAssociatedStmt, NumChildren);
352 auto *Inst =
new (Mem) T;
358 PrevMappedDirective = MappedDirective;
364 :
public llvm::iterator_adaptor_base<
365 used_clauses_child_iterator, ArrayRef<OMPClause *>::iterator,
366 std::forward_iterator_tag, Stmt *, ptrdiff_t, Stmt *, Stmt *> {
371 if (ChildI != ChildEnd)
373 while (this->I != End) {
375 if (this->I != End) {
376 ChildI = (*this->I)->used_children().begin();
377 ChildEnd = (*this->I)->used_children().end();
378 if (ChildI != ChildEnd)
388 if (this->I != End) {
389 ChildI = (*this->I)->used_children().begin();
390 ChildEnd = (*this->I)->used_children().end();
399 if (ChildI != ChildEnd)
401 if (this->I != End) {
403 if (this->I != End) {
404 ChildI = (*this->I)->used_children().begin();
405 ChildEnd = (*this->I)->used_children().end();
413 static llvm::iterator_range<used_clauses_child_iterator>
424 template <
typename SpecificClause>
426 :
public llvm::iterator_adaptor_base<
427 specific_clause_iterator<SpecificClause>,
428 ArrayRef<OMPClause *>::const_iterator, std::forward_iterator_tag,
429 const SpecificClause *, ptrdiff_t, const SpecificClause *,
430 const SpecificClause *> {
433 void SkipToNextClause() {
434 while (this->I != End && !isa<SpecificClause>(*this->I))
446 return cast<SpecificClause>(*this->I);
457 template <
typename SpecificClause>
458 static llvm::iterator_range<specific_clause_iterator<SpecificClause>>
465 template <
typename SpecificClause>
466 llvm::iterator_range<specific_clause_iterator<SpecificClause>>
468 return getClausesOfKind<SpecificClause>(
clauses());
476 template <
typename SpecificClause>
478 auto ClausesOfKind = getClausesOfKind<SpecificClause>(Clauses);
480 if (ClausesOfKind.begin() != ClausesOfKind.end()) {
481 assert(std::next(ClausesOfKind.begin()) == ClausesOfKind.end() &&
482 "There are at least 2 clauses of the specified kind");
483 return *ClausesOfKind.begin();
488 template <
typename SpecificClause>
490 return getSingleClause<SpecificClause>(
clauses());
495 template <
typename SpecificClause>
497 auto Clauses = getClausesOfKind<SpecificClause>();
498 return Clauses.begin() != Clauses.end();
539 "Expected directive with the associated statement.");
549 "Expected directive with the associated statement.");
558 "Expected directive with the associated statement.");
572 return S->getStmtClass() >= firstOMPExecutableDirectiveConstant &&
573 S->getStmtClass() <= lastOMPExecutableDirectiveConstant;
611 "Expected directive with the associated statement.");
631 bool HasCancel =
false;
640 llvm::omp::OMPD_parallel, StartLoc, EndLoc) {}
653 void setHasCancel(
bool Has) { HasCancel = Has; }
667 static OMPParallelDirective *
668 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
669 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
677 static OMPParallelDirective *
CreateEmpty(
const ASTContext &
C,
678 unsigned NumClauses, EmptyShell);
833 Cond !=
nullptr &&
Init !=
nullptr &&
Inc !=
nullptr;
868 for (
unsigned I = 0; I < Size; ++I) {
899 bool TryImperfectlyNestedLoops);
901 bool TryImperfectlyNestedLoops) {
903 TryImperfectlyNestedLoops);
911 llvm::function_ref<
bool(
unsigned,
Stmt *)> Callback,
913 OnTransformationCallback);
917 llvm::function_ref<
bool(
unsigned,
const Stmt *)> Callback,
919 OnTransformationCallback) {
920 auto &&NewCallback = [Callback](
unsigned Cnt,
Stmt *CurStmt) {
921 return Callback(Cnt, CurStmt);
923 auto &&NewTransformCb =
925 OnTransformationCallback(A);
928 NumLoops, NewCallback, NewTransformCb);
936 llvm::function_ref<
bool(
unsigned,
Stmt *)> Callback) {
938 return doForAllLoops(CurStmt, TryImperfectlyNestedLoops, NumLoops, Callback,
944 llvm::function_ref<
bool(
unsigned,
const Stmt *)> Callback) {
945 auto &&NewCallback = [Callback](
unsigned Cnt,
const Stmt *CurStmt) {
946 return Callback(Cnt, CurStmt);
949 NumLoops, NewCallback);
955 Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
956 llvm::function_ref<
void(
unsigned,
Stmt *,
Stmt *)> Callback);
958 const Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
959 llvm::function_ref<
void(
unsigned,
const Stmt *,
const Stmt *)> Callback) {
960 auto &&NewCallback = [Callback](
unsigned Cnt,
Stmt *
Loop,
Stmt *Body) {
961 Callback(Cnt,
Loop, Body);
964 NumLoops, NewCallback);
968 if (
auto *D = dyn_cast<OMPExecutableDirective>(T))
979 unsigned NumGeneratedLoops = 0;
1038 IterationVariableOffset = 0,
1039 LastIterationOffset = 1,
1040 CalcLastIterationOffset = 2,
1041 PreConditionOffset = 3,
1052 IsLastIterVariableOffset = 8,
1053 LowerBoundVariableOffset = 9,
1054 UpperBoundVariableOffset = 10,
1055 StrideVariableOffset = 11,
1056 EnsureUpperBoundOffset = 12,
1057 NextLowerBoundOffset = 13,
1058 NextUpperBoundOffset = 14,
1059 NumIterationsOffset = 15,
1061 WorksharingEnd = 16,
1062 PrevLowerBoundVariableOffset = 16,
1063 PrevUpperBoundVariableOffset = 17,
1065 PrevEnsureUpperBoundOffset = 19,
1066 CombinedLowerBoundVariableOffset = 20,
1067 CombinedUpperBoundVariableOffset = 21,
1068 CombinedEnsureUpperBoundOffset = 22,
1069 CombinedInitOffset = 23,
1070 CombinedConditionOffset = 24,
1071 CombinedNextLowerBoundOffset = 25,
1072 CombinedNextUpperBoundOffset = 26,
1073 CombinedDistConditionOffset = 27,
1074 CombinedParForInDistConditionOffset = 28,
1078 CombinedDistributeEnd = 29,
1083 auto **Storage =
reinterpret_cast<Expr **
>(
1089 MutableArrayRef<Expr *> getPrivateCounters() {
1090 auto **Storage =
reinterpret_cast<Expr **
>(
1097 MutableArrayRef<Expr *> getInits() {
1098 auto **Storage =
reinterpret_cast<Expr **
>(
1105 MutableArrayRef<Expr *> getUpdates() {
1106 auto **Storage =
reinterpret_cast<Expr **
>(
1113 MutableArrayRef<Expr *> getFinals() {
1114 auto **Storage =
reinterpret_cast<Expr **
>(
1121 MutableArrayRef<Expr *> getDependentCounters() {
1122 auto **Storage =
reinterpret_cast<Expr **
>(
1129 MutableArrayRef<Expr *> getDependentInits() {
1130 auto **Storage =
reinterpret_cast<Expr **
>(
1137 MutableArrayRef<Expr *> getFinalsConditions() {
1138 auto **Storage =
reinterpret_cast<Expr **
>(
1155 unsigned CollapsedNum)
1161 return CombinedDistributeEnd;
1164 return WorksharingEnd;
1198 "expected worksharing loop directive");
1206 "expected worksharing loop directive");
1214 "expected worksharing loop directive");
1222 "expected worksharing loop directive");
1230 "expected worksharing loop directive");
1238 "expected worksharing loop directive");
1246 "expected worksharing loop directive");
1254 "expected worksharing loop directive");
1259 "expected loop bound sharing directive");
1264 "expected loop bound sharing directive");
1269 "expected loop bound sharing directive");
1274 "expected loop bound sharing directive");
1279 "expected loop bound sharing directive");
1284 "expected loop bound sharing directive");
1289 "expected loop bound sharing directive");
1294 "expected loop bound sharing directive");
1299 "expected loop bound sharing directive");
1304 "expected loop bound sharing directive");
1309 "expected loop bound sharing directive");
1314 "expected loop bound distribute sharing directive");
1319 "expected loop bound distribute sharing directive");
1321 CombParForInDistCond;
1357 "expected worksharing loop directive");
1365 "expected worksharing loop directive");
1373 "expected worksharing loop directive");
1381 "expected worksharing loop directive");
1389 "expected worksharing loop directive");
1397 "expected worksharing loop directive");
1405 "expected worksharing loop directive");
1413 "expected worksharing loop directive");
1418 "expected loop bound sharing directive");
1423 "expected loop bound sharing directive");
1428 "expected loop bound sharing directive");
1433 "expected loop bound sharing directive");
1438 "expected loop bound sharing directive");
1439 return cast<Expr>(
Data->
getChildren()[CombinedLowerBoundVariableOffset]);
1443 "expected loop bound sharing directive");
1444 return cast<Expr>(
Data->
getChildren()[CombinedUpperBoundVariableOffset]);
1448 "expected loop bound sharing directive");
1449 return cast<Expr>(
Data->
getChildren()[CombinedEnsureUpperBoundOffset]);
1453 "expected loop bound sharing directive");
1458 "expected loop bound sharing directive");
1463 "expected loop bound sharing directive");
1468 "expected loop bound sharing directive");
1473 "expected loop bound distribute sharing directive");
1478 "expected loop bound distribute sharing directive");
1479 return cast<Expr>(
Data->
getChildren()[CombinedParForInDistConditionOffset]);
1539 T->
getStmtClass() == OMPParallelForSimdDirectiveClass ||
1542 T->
getStmtClass() == OMPMaskedTaskLoopDirectiveClass ||
1543 T->
getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass ||
1544 T->
getStmtClass() == OMPMasterTaskLoopDirectiveClass ||
1545 T->
getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass ||
1547 T->
getStmtClass() == OMPTeamsGenericLoopDirectiveClass ||
1548 T->
getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass ||
1549 T->
getStmtClass() == OMPParallelGenericLoopDirectiveClass ||
1550 T->
getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass ||
1551 T->
getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass ||
1552 T->
getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass ||
1553 T->
getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass ||
1554 T->
getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass ||
1556 T->
getStmtClass() == OMPTargetParallelForDirectiveClass ||
1557 T->
getStmtClass() == OMPDistributeParallelForDirectiveClass ||
1558 T->
getStmtClass() == OMPDistributeParallelForSimdDirectiveClass ||
1559 T->
getStmtClass() == OMPDistributeSimdDirectiveClass ||
1560 T->
getStmtClass() == OMPTargetParallelForSimdDirectiveClass ||
1562 T->
getStmtClass() == OMPTeamsDistributeDirectiveClass ||
1563 T->
getStmtClass() == OMPTeamsDistributeSimdDirectiveClass ||
1565 OMPTeamsDistributeParallelForSimdDirectiveClass ||
1566 T->
getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass ||
1568 OMPTargetTeamsDistributeParallelForDirectiveClass ||
1570 OMPTargetTeamsDistributeParallelForSimdDirectiveClass ||
1571 T->
getStmtClass() == OMPTargetTeamsDistributeDirectiveClass ||
1572 T->
getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
1595 unsigned CollapsedNum)
1597 EndLoc, CollapsedNum) {}
1618 static OMPSimdDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
1619 SourceLocation EndLoc,
unsigned CollapsedNum,
1620 ArrayRef<OMPClause *> Clauses,
1621 Stmt *AssociatedStmt,
1622 const HelperExprs &Exprs,
1632 static OMPSimdDirective *
CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
1633 unsigned CollapsedNum, EmptyShell);
1653 bool HasCancel =
false;
1662 unsigned CollapsedNum)
1664 EndLoc, CollapsedNum) {}
1675 void setTaskReductionRefExpr(Expr *E) {
1677 llvm::omp::OMPD_for)] = E;
1681 void setHasCancel(
bool Has) { HasCancel = Has; }
1697 static OMPForDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
1698 SourceLocation EndLoc,
unsigned CollapsedNum,
1699 ArrayRef<OMPClause *> Clauses,
1700 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
1701 Expr *TaskRedRef,
bool HasCancel,
1711 static OMPForDirective *
CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
1712 unsigned CollapsedNum, EmptyShell);
1750 unsigned CollapsedNum)
1752 StartLoc, EndLoc, CollapsedNum) {}
1773 static OMPForSimdDirective *
1774 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
1775 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
1776 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
1785 static OMPForSimdDirective *
CreateEmpty(
const ASTContext &
C,
1786 unsigned NumClauses,
1787 unsigned CollapsedNum, EmptyShell);
1808 bool HasCancel =
false;
1817 llvm::omp::OMPD_sections, StartLoc, EndLoc) {}
1830 void setHasCancel(
bool Has) { HasCancel = Has; }
1844 static OMPSectionsDirective *
1845 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
1846 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
1855 static OMPSectionsDirective *
CreateEmpty(
const ASTContext &
C,
1856 unsigned NumClauses, EmptyShell);
1885 bool HasCancel =
false;
1894 llvm::omp::OMPD_section, StartLoc, EndLoc) {}
1912 static OMPSectionDirective *
Create(
const ASTContext &
C,
1913 SourceLocation StartLoc,
1914 SourceLocation EndLoc,
1915 Stmt *AssociatedStmt,
bool HasCancel);
1921 static OMPSectionDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
1952 StartLoc, EndLoc) {}
1968 static OMPScopeDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
1969 SourceLocation EndLoc,
1970 ArrayRef<OMPClause *> Clauses,
1971 Stmt *AssociatedStmt);
1977 static OMPScopeDirective *
CreateEmpty(
const ASTContext &
C,
1978 unsigned NumClauses, EmptyShell);
2003 StartLoc, EndLoc) {}
2020 static OMPSingleDirective *
2021 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
2022 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2030 static OMPSingleDirective *
CreateEmpty(
const ASTContext &
C,
2031 unsigned NumClauses, EmptyShell);
2054 StartLoc, EndLoc) {}
2070 static OMPMasterDirective *
Create(
const ASTContext &
C,
2071 SourceLocation StartLoc,
2072 SourceLocation EndLoc,
2073 Stmt *AssociatedStmt);
2079 static OMPMasterDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
2106 llvm::omp::OMPD_critical, StartLoc, EndLoc),
2120 void setDirectiveName(
const DeclarationNameInfo &Name) { DirName = Name; }
2132 static OMPCriticalDirective *
2133 Create(
const ASTContext &
C,
const DeclarationNameInfo &Name,
2134 SourceLocation StartLoc, SourceLocation EndLoc,
2135 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2142 static OMPCriticalDirective *
CreateEmpty(
const ASTContext &
C,
2143 unsigned NumClauses, EmptyShell);
2168 bool HasCancel =
false;
2177 unsigned CollapsedNum)
2179 llvm::omp::OMPD_parallel_for, StartLoc, EndLoc,
2192 void setTaskReductionRefExpr(Expr *E) {
2194 llvm::omp::OMPD_parallel_for)] = E;
2198 void setHasCancel(
bool Has) { HasCancel = Has; }
2214 static OMPParallelForDirective *
2215 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
2216 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2217 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
2227 static OMPParallelForDirective *
CreateEmpty(
const ASTContext &
C,
2228 unsigned NumClauses,
2229 unsigned CollapsedNum,
2246 return T->
getStmtClass() == OMPParallelForDirectiveClass;
2270 unsigned CollapsedNum)
2272 llvm::omp::OMPD_parallel_for_simd, StartLoc, EndLoc,
2295 static OMPParallelForSimdDirective *
2296 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
2297 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2298 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
2307 static OMPParallelForSimdDirective *
CreateEmpty(
const ASTContext &
C,
2308 unsigned NumClauses,
2309 unsigned CollapsedNum,
2313 return T->
getStmtClass() == OMPParallelForSimdDirectiveClass;
2331 llvm::omp::OMPD_parallel_master, StartLoc,
2336 llvm::omp::OMPD_parallel_master,
2353 static OMPParallelMasterDirective *
2354 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
2355 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);
2363 static OMPParallelMasterDirective *
2364 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses, EmptyShell);
2376 return T->
getStmtClass() == OMPParallelMasterDirectiveClass;
2394 llvm::omp::OMPD_parallel_masked, StartLoc,
2399 llvm::omp::OMPD_parallel_masked,
2416 static OMPParallelMaskedDirective *
2417 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
2418 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);
2426 static OMPParallelMaskedDirective *
2427 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses, EmptyShell);
2439 return T->
getStmtClass() == OMPParallelMaskedDirectiveClass;
2457 bool HasCancel =
false;
2466 llvm::omp::OMPD_parallel_sections, StartLoc,
2473 llvm::omp::OMPD_parallel_sections,
2480 void setHasCancel(
bool Has) { HasCancel = Has; }
2494 static OMPParallelSectionsDirective *
2495 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
2496 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
2505 static OMPParallelSectionsDirective *
2506 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses, EmptyShell);
2521 return T->
getStmtClass() == OMPParallelSectionsDirectiveClass;
2537 bool HasCancel =
false;
2546 StartLoc, EndLoc) {}
2555 void setHasCancel(
bool Has) { HasCancel = Has; }
2567 static OMPTaskDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
2568 SourceLocation EndLoc,
2569 ArrayRef<OMPClause *> Clauses,
2570 Stmt *AssociatedStmt,
bool HasCancel);
2578 static OMPTaskDirective *
CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
2605 llvm::omp::OMPD_taskyield, StartLoc, EndLoc) {}
2621 static OMPTaskyieldDirective *
2622 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc);
2628 static OMPTaskyieldDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
2631 return T->
getStmtClass() == OMPTaskyieldDirectiveClass;
2651 llvm::omp::OMPD_barrier, StartLoc, EndLoc) {}
2667 static OMPBarrierDirective *
2668 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc);
2674 static OMPBarrierDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
2697 llvm::omp::OMPD_taskwait, StartLoc, EndLoc) {}
2714 static OMPTaskwaitDirective *
Create(
const ASTContext &
C,
2715 SourceLocation StartLoc,
2716 SourceLocation EndLoc,
2717 ArrayRef<OMPClause *> Clauses);
2724 static OMPTaskwaitDirective *
CreateEmpty(
const ASTContext &
C,
2725 unsigned NumClauses, EmptyShell);
2748 llvm::omp::OMPD_taskgroup, StartLoc, EndLoc) {}
2770 static OMPTaskgroupDirective *
2771 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
2772 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2773 Expr *ReductionRef);
2780 static OMPTaskgroupDirective *
CreateEmpty(
const ASTContext &
C,
2781 unsigned NumClauses, EmptyShell);
2791 return T->
getStmtClass() == OMPTaskgroupDirectiveClass;
2815 StartLoc, EndLoc) {}
2832 static OMPFlushDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
2833 SourceLocation EndLoc,
2834 ArrayRef<OMPClause *> Clauses);
2842 static OMPFlushDirective *
CreateEmpty(
const ASTContext &
C,
2843 unsigned NumClauses, EmptyShell);
2868 StartLoc, EndLoc) {}
2884 static OMPDepobjDirective *
Create(
const ASTContext &
C,
2885 SourceLocation StartLoc,
2886 SourceLocation EndLoc,
2887 ArrayRef<OMPClause *> Clauses);
2895 static OMPDepobjDirective *
CreateEmpty(
const ASTContext &
C,
2896 unsigned NumClauses, EmptyShell);
2919 llvm::omp::OMPD_ordered, StartLoc, EndLoc) {}
2937 static OMPOrderedDirective *
2938 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
2939 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2947 static OMPOrderedDirective *
CreateEmpty(
const ASTContext &
C,
2948 unsigned NumClauses,
2949 bool IsStandalone, EmptyShell);
2977 LLVM_PREFERRED_TYPE(
bool)
2978 uint8_t IsXLHSInRHSPart : 1;
2987 LLVM_PREFERRED_TYPE(
bool)
2988 uint8_t IsPostfixUpdate : 1;
2991 LLVM_PREFERRED_TYPE(
bool)
2992 uint8_t IsFailOnly : 1;
3002 StartLoc, EndLoc) {}
3006 explicit OMPAtomicDirective()
3008 SourceLocation(), SourceLocation()) {}
3010 enum DataPositionTy :
size_t {
3025 void setUpdateExpr(Expr *UE) {
3031 void setR(Expr *R) {
Data->
getChildren()[DataPositionTy::POS_R] = R; }
3033 void setExpr(Expr *E) {
Data->
getChildren()[DataPositionTy::POS_E] = E; }
3035 void setD(Expr *D) {
Data->
getChildren()[DataPositionTy::POS_D] = D; }
3093 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_X]);
3096 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_X]);
3102 return cast_or_null<Expr>(
3106 return cast_or_null<Expr>(
3121 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_V]);
3124 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_V]);
3128 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_R]);
3131 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_R]);
3135 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_E]);
3138 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_E]);
3142 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_D]);
3145 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_D]);
3149 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_Cond]);
3152 return cast_or_null<Expr>(
Data->
getChildren()[DataPositionTy::POS_Cond]);
3178 StartLoc, EndLoc) {}
3195 static OMPTargetDirective *
3196 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3197 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3205 static OMPTargetDirective *
CreateEmpty(
const ASTContext &
C,
3206 unsigned NumClauses, EmptyShell);
3232 llvm::omp::OMPD_target_data, StartLoc, EndLoc) {}
3250 static OMPTargetDataDirective *
3251 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3252 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3259 static OMPTargetDataDirective *
CreateEmpty(
const ASTContext &
C,
unsigned N,
3263 return T->
getStmtClass() == OMPTargetDataDirectiveClass;
3286 llvm::omp::OMPD_target_enter_data, StartLoc,
3293 llvm::omp::OMPD_target_enter_data,
3305 static OMPTargetEnterDataDirective *
3306 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3307 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3314 static OMPTargetEnterDataDirective *
CreateEmpty(
const ASTContext &
C,
3315 unsigned N, EmptyShell);
3318 return T->
getStmtClass() == OMPTargetEnterDataDirectiveClass;
3341 llvm::omp::OMPD_target_exit_data, StartLoc,
3348 llvm::omp::OMPD_target_exit_data,
3360 static OMPTargetExitDataDirective *
3361 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3362 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3369 static OMPTargetExitDataDirective *
CreateEmpty(
const ASTContext &
C,
3370 unsigned N, EmptyShell);
3373 return T->
getStmtClass() == OMPTargetExitDataDirectiveClass;
3389 bool HasCancel =
false;
3398 llvm::omp::OMPD_target_parallel, StartLoc,
3405 llvm::omp::OMPD_target_parallel,
3411 void setHasCancel(
bool Has) { HasCancel = Has; }
3425 static OMPTargetParallelDirective *
3426 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3427 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,
3436 static OMPTargetParallelDirective *
3437 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses, EmptyShell);
3452 return T->
getStmtClass() == OMPTargetParallelDirectiveClass;
3470 bool HasCancel =
false;
3479 unsigned CollapsedNum)
3481 llvm::omp::OMPD_target_parallel_for, StartLoc, EndLoc,
3494 void setTaskReductionRefExpr(Expr *E) {
3500 void setHasCancel(
bool Has) { HasCancel = Has; }
3516 static OMPTargetParallelForDirective *
3517 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3518 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3519 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
3529 static OMPTargetParallelForDirective *
CreateEmpty(
const ASTContext &
C,
3530 unsigned NumClauses,
3531 unsigned CollapsedNum,
3548 return T->
getStmtClass() == OMPTargetParallelForDirectiveClass;
3570 StartLoc, EndLoc) {}
3587 static OMPTeamsDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
3588 SourceLocation EndLoc,
3589 ArrayRef<OMPClause *> Clauses,
3590 Stmt *AssociatedStmt);
3598 static OMPTeamsDirective *
CreateEmpty(
const ASTContext &
C,
3599 unsigned NumClauses, EmptyShell);
3625 llvm::omp::OMPD_cancellation_point, StartLoc,
3631 llvm::omp::OMPD_cancellation_point,
3645 static OMPCancellationPointDirective *
3646 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3653 static OMPCancellationPointDirective *
CreateEmpty(
const ASTContext &
C,
3660 return T->
getStmtClass() == OMPCancellationPointDirectiveClass;
3682 StartLoc, EndLoc) {}
3702 static OMPCancelDirective *
3703 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3711 static OMPCancelDirective *
CreateEmpty(
const ASTContext &
C,
3712 unsigned NumClauses, EmptyShell);
3735 bool HasCancel =
false;
3744 unsigned CollapsedNum)
3746 StartLoc, EndLoc, CollapsedNum) {}
3757 void setHasCancel(
bool Has) { HasCancel = Has; }
3771 static OMPTaskLoopDirective *
3772 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3773 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3774 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
3783 static OMPTaskLoopDirective *
CreateEmpty(
const ASTContext &
C,
3784 unsigned NumClauses,
3785 unsigned CollapsedNum, EmptyShell);
3814 unsigned CollapsedNum)
3816 llvm::omp::OMPD_taskloop_simd, StartLoc, EndLoc,
3839 static OMPTaskLoopSimdDirective *
3840 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3841 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3842 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
3851 static OMPTaskLoopSimdDirective *
CreateEmpty(
const ASTContext &
C,
3852 unsigned NumClauses,
3853 unsigned CollapsedNum,
3857 return T->
getStmtClass() == OMPTaskLoopSimdDirectiveClass;
3874 bool HasCancel =
false;
3883 unsigned CollapsedNum)
3885 llvm::omp::OMPD_master_taskloop, StartLoc, EndLoc,
3898 void setHasCancel(
bool Has) { HasCancel = Has; }
3912 static OMPMasterTaskLoopDirective *
3913 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3914 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3915 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
3924 static OMPMasterTaskLoopDirective *
CreateEmpty(
const ASTContext &
C,
3925 unsigned NumClauses,
3926 unsigned CollapsedNum,
3933 return T->
getStmtClass() == OMPMasterTaskLoopDirectiveClass;
3950 bool HasCancel =
false;
3959 unsigned CollapsedNum)
3961 llvm::omp::OMPD_masked_taskloop, StartLoc, EndLoc,
3974 void setHasCancel(
bool Has) { HasCancel = Has; }
3988 static OMPMaskedTaskLoopDirective *
3989 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
3990 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3991 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4000 static OMPMaskedTaskLoopDirective *
CreateEmpty(
const ASTContext &
C,
4001 unsigned NumClauses,
4002 unsigned CollapsedNum,
4009 return T->
getStmtClass() == OMPMaskedTaskLoopDirectiveClass;
4032 unsigned CollapsedNum)
4034 llvm::omp::OMPD_master_taskloop_simd, StartLoc, EndLoc,
4057 static OMPMasterTaskLoopSimdDirective *
4058 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4059 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4060 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4068 static OMPMasterTaskLoopSimdDirective *
CreateEmpty(
const ASTContext &
C,
4069 unsigned NumClauses,
4070 unsigned CollapsedNum,
4074 return T->
getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass;
4097 unsigned CollapsedNum)
4099 llvm::omp::OMPD_masked_taskloop_simd, StartLoc, EndLoc,
4122 static OMPMaskedTaskLoopSimdDirective *
4123 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4124 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4125 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4133 static OMPMaskedTaskLoopSimdDirective *
CreateEmpty(
const ASTContext &
C,
4134 unsigned NumClauses,
4135 unsigned CollapsedNum,
4139 return T->
getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass;
4157 bool HasCancel =
false;
4167 unsigned CollapsedNum)
4169 llvm::omp::OMPD_parallel_master_taskloop, StartLoc,
4170 EndLoc, CollapsedNum) {}
4178 llvm::omp::OMPD_parallel_master_taskloop,
4182 void setHasCancel(
bool Has) { HasCancel = Has; }
4196 static OMPParallelMasterTaskLoopDirective *
4197 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4198 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4199 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4208 static OMPParallelMasterTaskLoopDirective *
CreateEmpty(
const ASTContext &
C,
4209 unsigned NumClauses,
4210 unsigned CollapsedNum,
4217 return T->
getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass;
4235 bool HasCancel =
false;
4245 unsigned CollapsedNum)
4247 llvm::omp::OMPD_parallel_masked_taskloop, StartLoc,
4248 EndLoc, CollapsedNum) {}
4256 llvm::omp::OMPD_parallel_masked_taskloop,
4260 void setHasCancel(
bool Has) { HasCancel = Has; }
4274 static OMPParallelMaskedTaskLoopDirective *
4275 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4276 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4277 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
4286 static OMPParallelMaskedTaskLoopDirective *
CreateEmpty(
const ASTContext &
C,
4287 unsigned NumClauses,
4288 unsigned CollapsedNum,
4295 return T->
getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass;
4320 unsigned CollapsedNum)
4322 llvm::omp::OMPD_parallel_master_taskloop_simd,
4323 StartLoc, EndLoc, CollapsedNum) {}
4331 llvm::omp::OMPD_parallel_master_taskloop_simd,
4345 static OMPParallelMasterTaskLoopSimdDirective *
4346 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4347 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4348 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4357 static OMPParallelMasterTaskLoopSimdDirective *
4358 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
4362 return T->
getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass;
4387 unsigned CollapsedNum)
4389 llvm::omp::OMPD_parallel_masked_taskloop_simd,
4390 StartLoc, EndLoc, CollapsedNum) {}
4398 llvm::omp::OMPD_parallel_masked_taskloop_simd,
4412 static OMPParallelMaskedTaskLoopSimdDirective *
4413 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4414 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4415 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4424 static OMPParallelMaskedTaskLoopSimdDirective *
4425 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
4429 return T->
getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass;
4452 unsigned CollapsedNum)
4454 llvm::omp::OMPD_distribute, StartLoc, EndLoc,
4477 static OMPDistributeDirective *
4478 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4479 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4480 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
4490 static OMPDistributeDirective *
CreateEmpty(
const ASTContext &
C,
4491 unsigned NumClauses,
4492 unsigned CollapsedNum, EmptyShell);
4495 return T->
getStmtClass() == OMPDistributeDirectiveClass;
4518 llvm::omp::OMPD_target_update, StartLoc,
4537 static OMPTargetUpdateDirective *
4538 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4539 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
4547 static OMPTargetUpdateDirective *
CreateEmpty(
const ASTContext &
C,
4548 unsigned NumClauses, EmptyShell);
4551 return T->
getStmtClass() == OMPTargetUpdateDirectiveClass;
4568 bool HasCancel =
false;
4578 unsigned CollapsedNum)
4580 llvm::omp::OMPD_distribute_parallel_for, StartLoc,
4581 EndLoc, CollapsedNum) {}
4589 llvm::omp::OMPD_distribute_parallel_for,
4593 void setTaskReductionRefExpr(Expr *E) {
4599 void setHasCancel(
bool Has) { HasCancel = Has; }
4615 static OMPDistributeParallelForDirective *
4616 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4617 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4618 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
4628 static OMPDistributeParallelForDirective *
CreateEmpty(
const ASTContext &
C,
4629 unsigned NumClauses,
4630 unsigned CollapsedNum,
4647 return T->
getStmtClass() == OMPDistributeParallelForDirectiveClass;
4672 unsigned CollapsedNum)
4674 llvm::omp::OMPD_distribute_parallel_for_simd, StartLoc,
4675 EndLoc, CollapsedNum) {}
4683 llvm::omp::OMPD_distribute_parallel_for_simd,
4697 static OMPDistributeParallelForSimdDirective *
Create(
4698 const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4699 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4700 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4708 static OMPDistributeParallelForSimdDirective *
CreateEmpty(
4709 const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
4713 return T->
getStmtClass() == OMPDistributeParallelForSimdDirectiveClass;
4736 unsigned CollapsedNum)
4738 llvm::omp::OMPD_distribute_simd, StartLoc, EndLoc,
4761 static OMPDistributeSimdDirective *
4762 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4763 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4764 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4772 static OMPDistributeSimdDirective *
CreateEmpty(
const ASTContext &
C,
4773 unsigned NumClauses,
4774 unsigned CollapsedNum,
4778 return T->
getStmtClass() == OMPDistributeSimdDirectiveClass;
4803 unsigned CollapsedNum)
4805 llvm::omp::OMPD_target_parallel_for_simd, StartLoc,
4806 EndLoc, CollapsedNum) {}
4814 llvm::omp::OMPD_target_parallel_for_simd,
4828 static OMPTargetParallelForSimdDirective *
4829 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4830 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4831 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4839 static OMPTargetParallelForSimdDirective *
CreateEmpty(
const ASTContext &
C,
4840 unsigned NumClauses,
4841 unsigned CollapsedNum,
4845 return T->
getStmtClass() == OMPTargetParallelForSimdDirectiveClass;
4869 unsigned CollapsedNum)
4871 llvm::omp::OMPD_target_simd, StartLoc, EndLoc,
4894 static OMPTargetSimdDirective *
4895 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4896 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4897 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4905 static OMPTargetSimdDirective *
CreateEmpty(
const ASTContext &
C,
4906 unsigned NumClauses,
4907 unsigned CollapsedNum,
4911 return T->
getStmtClass() == OMPTargetSimdDirectiveClass;
4934 unsigned CollapsedNum)
4936 llvm::omp::OMPD_teams_distribute, StartLoc, EndLoc,
4959 static OMPTeamsDistributeDirective *
4960 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
4961 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4962 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
4970 static OMPTeamsDistributeDirective *
CreateEmpty(
const ASTContext &
C,
4971 unsigned NumClauses,
4972 unsigned CollapsedNum,
4976 return T->
getStmtClass() == OMPTeamsDistributeDirectiveClass;
5002 llvm::omp::OMPD_teams_distribute_simd, StartLoc,
5003 EndLoc, CollapsedNum) {}
5011 llvm::omp::OMPD_teams_distribute_simd,
5025 static OMPTeamsDistributeSimdDirective *
5026 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5027 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5028 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5037 static OMPTeamsDistributeSimdDirective *
CreateEmpty(
const ASTContext &
C,
5038 unsigned NumClauses,
5039 unsigned CollapsedNum,
5043 return T->
getStmtClass() == OMPTeamsDistributeSimdDirectiveClass;
5069 unsigned CollapsedNum)
5071 llvm::omp::OMPD_teams_distribute_parallel_for_simd,
5072 StartLoc, EndLoc, CollapsedNum) {}
5080 llvm::omp::OMPD_teams_distribute_parallel_for_simd,
5094 static OMPTeamsDistributeParallelForSimdDirective *
5095 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5096 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5097 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5105 static OMPTeamsDistributeParallelForSimdDirective *
5106 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
5110 return T->
getStmtClass() == OMPTeamsDistributeParallelForSimdDirectiveClass;
5127 bool HasCancel =
false;
5137 unsigned CollapsedNum)
5139 llvm::omp::OMPD_teams_distribute_parallel_for,
5140 StartLoc, EndLoc, CollapsedNum) {}
5148 llvm::omp::OMPD_teams_distribute_parallel_for,
5152 void setTaskReductionRefExpr(Expr *E) {
5154 getLoopsNumber(), llvm::omp::OMPD_teams_distribute_parallel_for)] = E;
5158 void setHasCancel(
bool Has) { HasCancel = Has; }
5174 static OMPTeamsDistributeParallelForDirective *
5175 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5176 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5177 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
5186 static OMPTeamsDistributeParallelForDirective *
5187 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
5193 getLoopsNumber(), llvm::omp::OMPD_teams_distribute_parallel_for)]);
5204 return T->
getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass;
5226 llvm::omp::OMPD_target_teams, StartLoc, EndLoc) {
5245 static OMPTargetTeamsDirective *
Create(
const ASTContext &
C,
5246 SourceLocation StartLoc,
5247 SourceLocation EndLoc,
5248 ArrayRef<OMPClause *> Clauses,
5249 Stmt *AssociatedStmt);
5256 static OMPTargetTeamsDirective *
CreateEmpty(
const ASTContext &
C,
5257 unsigned NumClauses, EmptyShell);
5260 return T->
getStmtClass() == OMPTargetTeamsDirectiveClass;
5284 unsigned CollapsedNum)
5286 llvm::omp::OMPD_target_teams_distribute, StartLoc,
5287 EndLoc, CollapsedNum) {}
5295 llvm::omp::OMPD_target_teams_distribute,
5309 static OMPTargetTeamsDistributeDirective *
5310 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5311 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5312 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5320 static OMPTargetTeamsDistributeDirective *
5321 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
5325 return T->
getStmtClass() == OMPTargetTeamsDistributeDirectiveClass;
5343 bool HasCancel =
false;
5353 unsigned CollapsedNum)
5355 llvm::omp::OMPD_target_teams_distribute_parallel_for,
5356 StartLoc, EndLoc, CollapsedNum) {}
5364 llvm::omp::OMPD_target_teams_distribute_parallel_for,
5368 void setTaskReductionRefExpr(Expr *E) {
5371 llvm::omp::OMPD_target_teams_distribute_parallel_for)] = E;
5375 void setHasCancel(
bool Has) { HasCancel = Has; }
5391 static OMPTargetTeamsDistributeParallelForDirective *
5392 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5393 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5394 Stmt *AssociatedStmt,
const HelperExprs &Exprs, Expr *TaskRedRef,
5403 static OMPTargetTeamsDistributeParallelForDirective *
5404 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
5411 llvm::omp::OMPD_target_teams_distribute_parallel_for)]);
5423 OMPTargetTeamsDistributeParallelForDirectiveClass;
5449 unsigned CollapsedNum)
5451 OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
5452 llvm::omp::OMPD_target_teams_distribute_parallel_for_simd, StartLoc,
5453 EndLoc, CollapsedNum) {}
5460 unsigned CollapsedNum)
5462 OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
5463 llvm::omp::OMPD_target_teams_distribute_parallel_for_simd,
5477 static OMPTargetTeamsDistributeParallelForSimdDirective *
5478 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5479 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5480 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5488 static OMPTargetTeamsDistributeParallelForSimdDirective *
5489 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
5494 OMPTargetTeamsDistributeParallelForSimdDirectiveClass;
5519 unsigned CollapsedNum)
5521 llvm::omp::OMPD_target_teams_distribute_simd, StartLoc,
5522 EndLoc, CollapsedNum) {}
5530 llvm::omp::OMPD_target_teams_distribute_simd,
5544 static OMPTargetTeamsDistributeSimdDirective *
5545 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5546 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
5547 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
5555 static OMPTargetTeamsDistributeSimdDirective *
5556 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
5560 return T->
getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass;
5572 TransformedStmtOffset,
5578 llvm::omp::OMPD_tile, StartLoc, EndLoc,
5583 void setPreInits(Stmt *PreInits) {
5584 Data->getChildren()[PreInitsOffset] = PreInits;
5587 void setTransformedStmt(Stmt *S) {
5588 Data->getChildren()[TransformedStmtOffset] = S;
5604 static OMPTileDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
5605 SourceLocation EndLoc,
5606 ArrayRef<OMPClause *> Clauses,
5607 unsigned NumLoops, Stmt *AssociatedStmt,
5608 Stmt *TransformedStmt, Stmt *PreInits);
5615 static OMPTileDirective *
CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
5630 return Data->getChildren()[TransformedStmtOffset];
5654 TransformedStmtOffset,
5659 llvm::omp::OMPD_unroll, StartLoc, EndLoc,
5663 void setPreInits(Stmt *PreInits) {
5664 Data->getChildren()[PreInitsOffset] = PreInits;
5668 void setTransformedStmt(Stmt *S) {
5669 Data->getChildren()[TransformedStmtOffset] = S;
5683 static OMPUnrollDirective *
5684 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5685 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
5686 unsigned NumGeneratedLoops, Stmt *TransformedStmt, Stmt *PreInits);
5692 static OMPUnrollDirective *
CreateEmpty(
const ASTContext &
C,
5693 unsigned NumClauses);
5703 return Data->getChildren()[TransformedStmtOffset];
5731 StartLoc, EndLoc) {}
5748 static OMPScanDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
5749 SourceLocation EndLoc,
5750 ArrayRef<OMPClause *> Clauses);
5758 static OMPScanDirective *
CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
5785 llvm::omp::OMPD_interop, StartLoc, EndLoc) {}
5802 static OMPInteropDirective *
Create(
const ASTContext &
C,
5803 SourceLocation StartLoc,
5804 SourceLocation EndLoc,
5805 ArrayRef<OMPClause *> Clauses);
5811 static OMPInteropDirective *
CreateEmpty(
const ASTContext &
C,
5812 unsigned NumClauses, EmptyShell);
5835 void setTargetCallLoc(
SourceLocation Loc) { TargetCallLoc = Loc; }
5844 llvm::omp::OMPD_dispatch, StartLoc, EndLoc) {}
5848 explicit OMPDispatchDirective()
5850 llvm::omp::OMPD_dispatch, SourceLocation(),
5851 SourceLocation()) {}
5863 static OMPDispatchDirective *
5864 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5865 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
5866 SourceLocation TargetCallLoc);
5874 static OMPDispatchDirective *
CreateEmpty(
const ASTContext &
C,
5875 unsigned NumClauses, EmptyShell);
5903 StartLoc, EndLoc) {}
5919 static OMPMaskedDirective *
5920 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
5921 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
5927 static OMPMaskedDirective *
CreateEmpty(
const ASTContext &
C,
5928 unsigned NumClauses, EmptyShell);
5950 llvm::omp::OMPD_metadirective, StartLoc,
5957 void setIfStmt(Stmt *S) { IfStmt = S; }
5960 static OMPMetaDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
5961 SourceLocation EndLoc,
5962 ArrayRef<OMPClause *> Clauses,
5963 Stmt *AssociatedStmt, Stmt *IfStmt);
5964 static OMPMetaDirective *
CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
5992 unsigned CollapsedNum)
5994 StartLoc, EndLoc, CollapsedNum) {}
6015 static OMPGenericLoopDirective *
6016 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
6017 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6018 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6026 static OMPGenericLoopDirective *
CreateEmpty(
const ASTContext &
C,
6027 unsigned NumClauses,
6028 unsigned CollapsedNum,
6032 return T->
getStmtClass() == OMPGenericLoopDirectiveClass;
6054 unsigned CollapsedNum)
6056 llvm::omp::OMPD_teams_loop, StartLoc, EndLoc,
6079 static OMPTeamsGenericLoopDirective *
6080 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
6081 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6082 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6091 static OMPTeamsGenericLoopDirective *
CreateEmpty(
const ASTContext &
C,
6092 unsigned NumClauses,
6093 unsigned CollapsedNum,
6097 return T->
getStmtClass() == OMPTeamsGenericLoopDirectiveClass;
6120 unsigned CollapsedNum)
6122 llvm::omp::OMPD_target_teams_loop, StartLoc, EndLoc,
6145 static OMPTargetTeamsGenericLoopDirective *
6146 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
6147 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6148 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6157 static OMPTargetTeamsGenericLoopDirective *
CreateEmpty(
const ASTContext &
C,
6158 unsigned NumClauses,
6159 unsigned CollapsedNum,
6163 return T->
getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass;
6187 llvm::omp::OMPD_parallel_loop, StartLoc, EndLoc,
6210 static OMPParallelGenericLoopDirective *
6211 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
6212 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6213 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6222 static OMPParallelGenericLoopDirective *
CreateEmpty(
const ASTContext &
C,
6223 unsigned NumClauses,
6224 unsigned CollapsedNum,
6228 return T->
getStmtClass() == OMPParallelGenericLoopDirectiveClass;
6251 unsigned CollapsedNum)
6253 llvm::omp::OMPD_target_parallel_loop, StartLoc, EndLoc,
6276 static OMPTargetParallelGenericLoopDirective *
6277 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
6278 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
6279 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
6288 static OMPTargetParallelGenericLoopDirective *
6289 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
6293 return T->
getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass;
6312 StartLoc, EndLoc) {}
6326 static OMPErrorDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
6327 SourceLocation EndLoc,
6328 ArrayRef<OMPClause *> Clauses);
6334 static OMPErrorDirective *
CreateEmpty(
const ASTContext &
C,
6335 unsigned NumClauses, EmptyShell);
Defines the clang::ASTContext interface.
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.
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.
OpenMPDirectiveKind getMappedDirective() const
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)
void setMappedDirective(OpenMPDirectiveKind MappedDirective)
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.
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)
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.
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...
StmtClass getStmtClass() const
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
'copyin' 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 ...
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.
YAML serialization mapping.
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....