15 #ifndef LLVM_CLANG_AST_STMTOPENMP_H
16 #define LLVM_CLANG_AST_STMTOPENMP_H
42 const unsigned NumClauses;
44 const unsigned NumChildren;
49 const unsigned ClausesOffset;
54 reinterpret_cast<char *
>(
this) + ClausesOffset);
69 unsigned NumClauses,
unsigned NumChildren)
70 :
Stmt(SC),
Kind(K), StartLoc(std::move(StartLoc)),
71 EndLoc(std::move(EndLoc)), NumClauses(NumClauses),
72 NumChildren(NumChildren),
73 ClausesOffset(llvm::RoundUpToAlignment(sizeof(T),
111 :
Current(Arr.begin()),
End(Arr.end()), Pred(std::move(Pred)) {
133 template <
typename Fn>
143 filtered_clause_iterator<ClauseKindFilter>
186 return const_cast<Stmt *
>(*child_begin());
192 return S->getStmtClass() >= firstOMPExecutableDirectiveConstant &&
193 S->getStmtClass() <= lastOMPExecutableDirectiveConstant;
198 return child_range();
199 Stmt **ChildStorage =
reinterpret_cast<Stmt **
>(getClauses().end());
200 return child_range(ChildStorage, ChildStorage + NumChildren);
228 StartLoc, EndLoc, NumClauses, 1) {}
258 unsigned NumClauses, EmptyShell);
261 return T->getStmtClass() == OMPParallelDirectiveClass;
271 unsigned CollapsedNum;
282 AssociatedStmtOffset = 0,
283 IterationVariableOffset = 1,
284 LastIterationOffset = 2,
285 CalcLastIterationOffset = 3,
286 PreConditionOffset = 4,
295 IsLastIterVariableOffset = 8,
296 LowerBoundVariableOffset = 9,
297 UpperBoundVariableOffset = 10,
298 StrideVariableOffset = 11,
299 EnsureUpperBoundOffset = 12,
300 NextLowerBoundOffset = 13,
301 NextUpperBoundOffset = 14,
309 Expr **Storage =
reinterpret_cast<Expr **
>(
315 MutableArrayRef<Expr *>
getInits() {
316 Expr **Storage =
reinterpret_cast<Expr **
>(
317 &*std::next(child_begin(),
319 return MutableArrayRef<Expr *>(Storage, CollapsedNum);
324 Expr **Storage =
reinterpret_cast<Expr **
>(
325 &*std::next(child_begin(),
327 return MutableArrayRef<Expr *>(Storage, CollapsedNum);
332 Expr **Storage =
reinterpret_cast<Expr **
>(
333 &*std::next(child_begin(),
335 return MutableArrayRef<Expr *>(Storage, CollapsedNum);
349 template <
typename T>
352 unsigned CollapsedNum,
unsigned NumClauses,
353 unsigned NumSpecialChildren = 0)
357 CollapsedNum(CollapsedNum) {}
373 *std::next(child_begin(), IterationVariableOffset) = IV;
376 *std::next(child_begin(), LastIterationOffset) = LI;
379 *std::next(child_begin(), CalcLastIterationOffset) = CLI;
382 *std::next(child_begin(), PreConditionOffset) = PC;
385 *std::next(child_begin(), CondOffset) = Cond;
387 void setInit(
Expr *Init) { *std::next(child_begin(), InitOffset) = Init; }
388 void setInc(
Expr *Inc) { *std::next(child_begin(), IncOffset) = Inc; }
391 "expected worksharing loop directive");
392 *std::next(child_begin(), IsLastIterVariableOffset) = IL;
396 "expected worksharing loop directive");
397 *std::next(child_begin(), LowerBoundVariableOffset) = LB;
401 "expected worksharing loop directive");
402 *std::next(child_begin(), UpperBoundVariableOffset) = UB;
406 "expected worksharing loop directive");
407 *std::next(child_begin(), StrideVariableOffset) = ST;
411 "expected worksharing loop directive");
412 *std::next(child_begin(), EnsureUpperBoundOffset) = EUB;
416 "expected worksharing loop directive");
417 *std::next(child_begin(), NextLowerBoundOffset) = NLB;
421 "expected worksharing loop directive");
422 *std::next(child_begin(), NextUpperBoundOffset) = NUB;
477 Cond !=
nullptr &&
Init !=
nullptr &&
Inc !=
nullptr;
501 for (
unsigned i = 0; i < Size; ++i) {
514 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
515 *std::next(child_begin(), IterationVariableOffset)));
518 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
519 *std::next(child_begin(), LastIterationOffset)));
522 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
523 *std::next(child_begin(), CalcLastIterationOffset)));
526 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
527 *std::next(child_begin(), PreConditionOffset)));
530 return const_cast<Expr *
>(
531 reinterpret_cast<const Expr *
>(*std::next(child_begin(), CondOffset)));
534 return const_cast<Expr *
>(
535 reinterpret_cast<const Expr *
>(*std::next(child_begin(), InitOffset)));
538 return const_cast<Expr *
>(
539 reinterpret_cast<const Expr *
>(*std::next(child_begin(), IncOffset)));
543 "expected worksharing loop directive");
544 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
545 *std::next(child_begin(), IsLastIterVariableOffset)));
549 "expected worksharing loop directive");
550 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
551 *std::next(child_begin(), LowerBoundVariableOffset)));
555 "expected worksharing loop directive");
556 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
557 *std::next(child_begin(), UpperBoundVariableOffset)));
561 "expected worksharing loop directive");
562 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
563 *std::next(child_begin(), StrideVariableOffset)));
567 "expected worksharing loop directive");
568 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
569 *std::next(child_begin(), EnsureUpperBoundOffset)));
573 "expected worksharing loop directive");
574 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
575 *std::next(child_begin(), NextLowerBoundOffset)));
579 "expected worksharing loop directive");
580 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
581 *std::next(child_begin(), NextUpperBoundOffset)));
586 Body = cast<ForStmt>(Body)->
getBody();
587 for (
unsigned Cnt = 1; Cnt < CollapsedNum; ++Cnt) {
588 Body = Body->IgnoreContainers();
589 Body = cast<ForStmt>(Body)->
getBody();
619 return T->getStmtClass() == OMPSimdDirectiveClass ||
620 T->getStmtClass() == OMPForDirectiveClass ||
621 T->getStmtClass() == OMPForSimdDirectiveClass ||
622 T->getStmtClass() == OMPParallelForDirectiveClass ||
623 T->getStmtClass() == OMPParallelForSimdDirectiveClass;
646 unsigned CollapsedNum,
unsigned NumClauses)
648 EndLoc, CollapsedNum, NumClauses) {}
671 static OMPSimdDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
672 SourceLocation EndLoc,
unsigned CollapsedNum,
673 ArrayRef<OMPClause *> Clauses,
674 Stmt *AssociatedStmt,
675 const HelperExprs &Exprs);
684 static OMPSimdDirective *
CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
685 unsigned CollapsedNum, EmptyShell);
688 return T->getStmtClass() == OMPSimdDirectiveClass;
711 unsigned CollapsedNum,
unsigned NumClauses)
713 CollapsedNum, NumClauses) {}
735 static OMPForDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
736 SourceLocation EndLoc,
unsigned CollapsedNum,
737 ArrayRef<OMPClause *> Clauses,
738 Stmt *AssociatedStmt,
739 const HelperExprs &Exprs);
748 static OMPForDirective *
CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
749 unsigned CollapsedNum, EmptyShell);
752 return T->getStmtClass() == OMPForDirectiveClass;
775 unsigned CollapsedNum,
unsigned NumClauses)
777 StartLoc, EndLoc, CollapsedNum, NumClauses) {}
800 static OMPForSimdDirective *
801 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
802 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
803 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
812 static OMPForSimdDirective *
CreateEmpty(
const ASTContext &
C,
814 unsigned CollapsedNum, EmptyShell);
817 return T->getStmtClass() == OMPForSimdDirectiveClass;
841 StartLoc, EndLoc, NumClauses, 1) {}
861 static OMPSectionsDirective *
862 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
863 ArrayRef<OMPClause *> Clauses,
Stmt *AssociatedStmt);
871 static OMPSectionsDirective *
CreateEmpty(
const ASTContext &
C,
872 unsigned NumClauses, EmptyShell);
875 return T->getStmtClass() == OMPSectionsDirectiveClass;
894 StartLoc, EndLoc, 0, 1) {}
910 static OMPSectionDirective *
Create(
const ASTContext &
C,
911 SourceLocation StartLoc,
912 SourceLocation EndLoc,
913 Stmt *AssociatedStmt);
919 static OMPSectionDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
922 return T->getStmtClass() == OMPSectionDirectiveClass;
945 StartLoc, EndLoc, NumClauses, 1) {}
965 static OMPSingleDirective *
966 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
967 ArrayRef<OMPClause *> Clauses,
Stmt *AssociatedStmt);
975 static OMPSingleDirective *
CreateEmpty(
const ASTContext &
C,
976 unsigned NumClauses, EmptyShell);
979 return T->getStmtClass() == OMPSingleDirectiveClass;
998 StartLoc, EndLoc, 0, 1) {}
1014 static OMPMasterDirective *
Create(
const ASTContext &
C,
1015 SourceLocation StartLoc,
1016 SourceLocation EndLoc,
1017 Stmt *AssociatedStmt);
1023 static OMPMasterDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
1026 return T->getStmtClass() == OMPMasterDirectiveClass;
1049 StartLoc, EndLoc, 0, 1),
1063 void setDirectiveName(
const DeclarationNameInfo &Name) { DirName = Name; }
1074 static OMPCriticalDirective *
1075 Create(
const ASTContext &
C,
const DeclarationNameInfo &Name,
1076 SourceLocation StartLoc, SourceLocation EndLoc,
Stmt *AssociatedStmt);
1082 static OMPCriticalDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
1089 return T->getStmtClass() == OMPCriticalDirectiveClass;
1112 unsigned CollapsedNum,
unsigned NumClauses)
1114 StartLoc, EndLoc, CollapsedNum, NumClauses) {}
1137 static OMPParallelForDirective *
1138 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
1139 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
1140 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
1149 static OMPParallelForDirective *
CreateEmpty(
const ASTContext &
C,
1150 unsigned NumClauses,
1151 unsigned CollapsedNum,
1155 return T->getStmtClass() == OMPParallelForDirectiveClass;
1179 unsigned CollapsedNum,
unsigned NumClauses)
1181 OMPD_parallel_for_simd, StartLoc, EndLoc, CollapsedNum,
1190 unsigned NumClauses)
1206 static OMPParallelForSimdDirective *
1207 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
1208 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
1209 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
1218 static OMPParallelForSimdDirective *
CreateEmpty(
const ASTContext &
C,
1219 unsigned NumClauses,
1220 unsigned CollapsedNum,
1224 return T->getStmtClass() == OMPParallelForSimdDirectiveClass;
1246 unsigned NumClauses)
1248 OMPD_parallel_sections, StartLoc, EndLoc,
1269 static OMPParallelSectionsDirective *
1270 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
1271 ArrayRef<OMPClause *> Clauses,
Stmt *AssociatedStmt);
1279 static OMPParallelSectionsDirective *
1280 CreateEmpty(
const ASTContext &
C,
unsigned NumClauses, EmptyShell);
1283 return T->getStmtClass() == OMPParallelSectionsDirectiveClass;
1304 unsigned NumClauses)
1306 EndLoc, NumClauses, 1) {}
1326 static OMPTaskDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
1327 SourceLocation EndLoc,
1328 ArrayRef<OMPClause *> Clauses,
1329 Stmt *AssociatedStmt);
1337 static OMPTaskDirective *
CreateEmpty(
const ASTContext &
C,
unsigned NumClauses,
1341 return T->getStmtClass() == OMPTaskDirectiveClass;
1360 StartLoc, EndLoc, 0, 0) {}
1375 static OMPTaskyieldDirective *
1376 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc);
1382 static OMPTaskyieldDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
1385 return T->getStmtClass() == OMPTaskyieldDirectiveClass;
1404 StartLoc, EndLoc, 0, 0) {}
1419 static OMPBarrierDirective *
1420 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc);
1426 static OMPBarrierDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
1429 return T->getStmtClass() == OMPBarrierDirectiveClass;
1448 StartLoc, EndLoc, 0, 0) {}
1463 static OMPTaskwaitDirective *
1464 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc);
1470 static OMPTaskwaitDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
1473 return T->getStmtClass() == OMPTaskwaitDirectiveClass;
1492 StartLoc, EndLoc, 0, 1) {}
1508 static OMPTaskgroupDirective *
Create(
const ASTContext &
C,
1509 SourceLocation StartLoc,
1510 SourceLocation EndLoc,
1511 Stmt *AssociatedStmt);
1517 static OMPTaskgroupDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
1520 return T->getStmtClass() == OMPTaskgroupDirectiveClass;
1543 unsigned NumClauses)
1545 StartLoc, EndLoc, NumClauses, 0) {}
1565 static OMPFlushDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
1566 SourceLocation EndLoc,
1567 ArrayRef<OMPClause *> Clauses);
1575 static OMPFlushDirective *
CreateEmpty(
const ASTContext &
C,
1576 unsigned NumClauses, EmptyShell);
1579 return T->getStmtClass() == OMPFlushDirectiveClass;
1598 StartLoc, EndLoc, 0, 1) {}
1614 static OMPOrderedDirective *
Create(
const ASTContext &
C,
1615 SourceLocation StartLoc,
1616 SourceLocation EndLoc,
1617 Stmt *AssociatedStmt);
1623 static OMPOrderedDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
1626 return T->getStmtClass() == OMPOrderedDirectiveClass;
1648 bool IsXLHSInRHSPart;
1657 bool IsPostfixUpdate;
1666 unsigned NumClauses)
1668 StartLoc, EndLoc, NumClauses, 5),
1669 IsXLHSInRHSPart(
false), IsPostfixUpdate(
false) {}
1679 IsXLHSInRHSPart(
false), IsPostfixUpdate(
false) {}
1682 void setX(Expr *
X) { *std::next(child_begin()) =
X; }
1686 void setUpdateExpr(Expr *UE) { *std::next(child_begin(), 2) = UE; }
1688 void setV(Expr *V) { *std::next(child_begin(), 3) = V; }
1690 void setExpr(Expr *E) { *std::next(child_begin(), 4) = E; }
1712 static OMPAtomicDirective *
1713 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
1714 ArrayRef<OMPClause *> Clauses,
Stmt *AssociatedStmt, Expr *X, Expr *V,
1715 Expr *E, Expr *UE,
bool IsXLHSInRHSPart,
bool IsPostfixUpdate);
1723 static OMPAtomicDirective *
CreateEmpty(
const ASTContext &
C,
1724 unsigned NumClauses, EmptyShell);
1727 Expr *
getX() {
return cast_or_null<Expr>(*std::next(child_begin())); }
1729 return cast_or_null<Expr>(*std::next(child_begin()));
1735 return cast_or_null<Expr>(*std::next(child_begin(), 2));
1738 return cast_or_null<Expr>(*std::next(child_begin(), 2));
1748 Expr *
getV() {
return cast_or_null<Expr>(*std::next(child_begin(), 3)); }
1750 return cast_or_null<Expr>(*std::next(child_begin(), 3));
1753 Expr *
getExpr() {
return cast_or_null<Expr>(*std::next(child_begin(), 4)); }
1755 return cast_or_null<Expr>(*std::next(child_begin(), 4));
1759 return T->getStmtClass() == OMPAtomicDirectiveClass;
1780 unsigned NumClauses)
1782 StartLoc, EndLoc, NumClauses, 1) {}
1802 static OMPTargetDirective *
1803 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
1804 ArrayRef<OMPClause *> Clauses,
Stmt *AssociatedStmt);
1812 static OMPTargetDirective *
CreateEmpty(
const ASTContext &
C,
1813 unsigned NumClauses, EmptyShell);
1816 return T->getStmtClass() == OMPTargetDirectiveClass;
1837 unsigned NumClauses)
1839 StartLoc, EndLoc, NumClauses, 1) {}
1859 static OMPTeamsDirective *
Create(
const ASTContext &
C, SourceLocation StartLoc,
1860 SourceLocation EndLoc,
1861 ArrayRef<OMPClause *> Clauses,
1862 Stmt *AssociatedStmt);
1870 static OMPTeamsDirective *
CreateEmpty(
const ASTContext &
C,
1871 unsigned NumClauses, EmptyShell);
1874 return T->getStmtClass() == OMPTeamsDirectiveClass;
1895 OMPD_cancellation_point, StartLoc, EndLoc, 0, 0),
1917 static OMPCancellationPointDirective *
1918 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation EndLoc,
1925 static OMPCancellationPointDirective *
CreateEmpty(
const ASTContext &
C,
1932 return T->getStmtClass() == OMPCancellationPointDirectiveClass;
1953 StartLoc, EndLoc, 0, 0),
1974 static OMPCancelDirective *
Create(
const ASTContext &
C,
1975 SourceLocation StartLoc,
1976 SourceLocation EndLoc,
1983 static OMPCancelDirective *
CreateEmpty(
const ASTContext &
C, EmptyShell);
1989 return T->getStmtClass() == OMPCancelDirectiveClass;
Expr * NLB
Update of LowerBound for statically sheduled 'omp for' loops.
static bool classof(const Stmt *T)
SmallVector< Expr *, 4 > Finals
Final loop counter values for GodeGen.
This represents '#pragma omp master' directive.
SmallVector< Expr *, 4 > Updates
Expressions for loop counters update for CodeGen.
This represents '#pragma omp task' directive.
void setEnsureUpperBound(Expr *EUB)
static OMPSectionDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
bool isXLHSInRHSPart() const
Return true if helper update expression has form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' and...
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static bool classof(const Stmt *T)
const OMPClause * getSingleClause(OpenMPClauseKind K) const
Gets a single clause of the specified kind K associated with the current directive iff there is only ...
ArrayRef< OMPClause * > clauses()
static bool classof(const Stmt *T)
OMPLoopDirective(const T *That, StmtClass SC, OpenMPDirectiveKind Kind, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, unsigned NumClauses, unsigned NumSpecialChildren=0)
Build instance of loop directive of class Kind.
filtered_clause_iterator & operator++()
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
ArrayRef< OMPClause * >::const_iterator Current
void setLastIteration(Expr *LI)
static bool classof(const Stmt *T)
This represents '#pragma omp for simd' directive.
Expr * EUB
EnsureUpperBound – expression LB = min(LB, NumIterations).
static OMPSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
void setUpperBoundVariable(Expr *UB)
static OMPAtomicDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V, Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate)
Creates directive with a list of Clauses and 'x', 'v' and 'expr' parts of the atomic construct (see S...
void setNextLowerBound(Expr *NLB)
const Expr * getExpr() const
ArrayRef< OMPClause * > clauses() const
This represents '#pragma omp parallel for' directive.
void setIsLastIterVariable(Expr *IL)
static OMPParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
Expr * LastIteration
Loop last iteration number.
OpenMPDirectiveKind getDirectiveKind() const
static bool classof(const Stmt *T)
void setFinals(ArrayRef< Expr * > A)
const Expr * getV() const
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel' directive.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
static OMPCancelDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
filtered_clause_iterator operator++(int)
ArrayRef< Expr * > updates()
static unsigned getArraysOffset(OpenMPDirectiveKind Kind)
Offset to the start of children expression arrays.
static bool classof(const Stmt *T)
Defines some OpenMP-specific enums and functions.
This represents '#pragma omp barrier' directive.
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc...
This represents '#pragma omp critical' directive.
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
ArrayRef< Expr * > finals()
void setCounters(ArrayRef< Expr * > A)
Expr * getX()
Get 'x' part of the associated expression/statement.
static bool classof(const Stmt *S)
This represents '#pragma omp cancellation point' directive.
static bool classof(const Stmt *T)
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
This represents '#pragma omp teams' directive.
Expr * CalcLastIteration
Calculation of last iteration.
bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a worksharing directive.
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static bool classof(const Stmt *T)
static bool classof(const Stmt *T)
static bool classof(const Stmt *T)
Expr * NUB
Update of UpperBound for statically sheduled 'omp for' loops.
Expr * Cond
Loop condition.
Expr * PreCond
Loop pre-condition.
OpenMPClauseKind getClauseKind() const
Returns kind of OpenMP clause (private, shared, reduction, etc.).
static OMPSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
The expressions built for the OpenMP loop CodeGen for the whole collapsed loop nest.
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static bool classof(const Stmt *T)
This represents '#pragma omp taskgroup' directive.
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
bool isPostfixUpdate() const
Return true if 'v' expression must be updated to original value of 'x', false if 'v' must be updated ...
Expr * IterationVarRef
Loop iteration variable.
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
OMPClause * getClause(unsigned i) const
Returns specified clause.
filtered_clause_iterator(ArrayRef< OMPClause * > Arr, FilterPredicate Pred)
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
static unsigned numLoopChildren(unsigned CollapsedNum, OpenMPDirectiveKind Kind)
Children number.
static OMPMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
Expr * getIterationVariable() const
OpenMPClauseKind
OpenMP clauses.
static bool classof(const Stmt *T)
bool operator()(const OMPClause *clause) const
bool builtAll()
Check if all the expressions are built (does not check the worksharing ones).
const Expr * getUpdateExpr() const
This represents '#pragma omp for' directive.
static bool classof(const Stmt *T)
ArrayRef< Expr * > finals() const
void setAssociatedStmt(Stmt *S)
Set the associated statement for the directive.
Expr * getIsLastIterVariable() const
static bool classof(const Stmt *T)
Expr * getNextUpperBound() const
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 cancel' directive.
ArrayRef< Expr * > counters() const
unsigned getNumClauses() const
Get number of clauses.
static OMPTaskDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static bool classof(const Stmt *T)
This file defines OpenMP AST classes for clauses. There are clauses for executable directives...
static bool classof(const Stmt *T)
This represents '#pragma omp flush' directive.
This represents '#pragma omp parallel for simd' directive.
Expr * NumIterations
Loop number of iterations.
SourceLocation getLocStart() const
Returns starting location of directive kind.
void setLocStart(SourceLocation Loc)
Set starting location of directive kind.
Expr * ST
Stride - local variable passed to runtime.
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
filtered_clause_iterator< Fn > getFilteredClauses(Fn &&fn) const
void setLowerBoundVariable(Expr *LB)
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static bool classof(const Stmt *T)
SmallVector< Expr *, 4 > Counters
Counters Loop counters.
static OMPCriticalDirective * Create(const ASTContext &C, const DeclarationNameInfo &Name, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
This represents '#pragma omp single' directive.
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
void setIterationVariable(Expr *IV)
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
clang::OMPLinearClause OMPVarListClause getInits()
static OMPCancelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Creates directive.
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This is a basic class for representing single OpenMP executable directive.
static OMPTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Expr * getLowerBoundVariable() const
Expr * getExpr()
Get 'expr' part of the associated expression/statement.
unsigned getCollapsedNumber() const
Get number of collapsed loops.
value_type operator*() const
OpenMPDirectiveKind
OpenMP directives.
static bool classof(const Stmt *T)
static bool classof(const Stmt *T)
static OMPAtomicDirective * 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 taskwait' directive.
This is a basic class for representing single OpenMP clause.
This represents '#pragma omp target' directive.
void setClauses(ArrayRef< OMPClause * > Clauses)
Sets the list of variables for this clause.
Expr * getUpperBoundVariable() const
Expr * getV()
Get 'v' part of the associated expression/statement.
static bool classof(const Stmt *T)
value_type operator->() const
This represents '#pragma omp ordered' directive.
Expr * LB
LowerBound - local variable passed to runtime.
void clear(unsigned Size)
Initialize all the fields to null.
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Expr * Init
Loop iteration variable init.
Expr * getPreCond() const
static OMPParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
ArrayRef< OMPClause * >::const_iterator End
SmallVector< Expr *, 4 > Inits
Expressions for loop counters inits for CodeGen.
static OMPParallelSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
This represents '#pragma omp section' directive.
ArrayRef< Expr * > inits() const
const Stmt * getBody() const
This represents '#pragma omp simd' directive.
DeclarationNameInfo getDirectiveName() const
Return name of the directive.
filtered_clause_iterator()
Expr * getEnsureUpperBound() const
Expr * getUpdateExpr()
Get helper expression of the form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExp...
This represents '#pragma omp atomic' directive.
Expr * getCalcLastIteration() const
ArrayRef< Expr * > counters()
static OMPOrderedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
filtered_clause_iterator< ClauseKindFilter > getClausesOfKind(OpenMPClauseKind Kind) const
ArrayRef< Expr * > inits()
Expr * Inc
Loop increment.
static OMPForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
ArrayRef< Expr * > updates() const
static OMPSingleDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
static OMPTaskyieldDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Expr * getNextLowerBound() const
Expr * UB
UpperBound - local variable passed to runtime.
Defines the clang::SourceLocation class and associated facilities.
static bool classof(const Stmt *T)
void setStrideVariable(Expr *ST)
static bool classof(const Stmt *T)
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPBarrierDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
void setUpdates(ArrayRef< Expr * > A)
static bool classof(const Stmt *T)
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTaskgroupDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
void setPreCond(Expr *PC)
static OMPParallelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTaskwaitDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
OMPExecutableDirective(const T *, StmtClass SC, OpenMPDirectiveKind K, SourceLocation StartLoc, SourceLocation EndLoc, unsigned NumClauses, unsigned NumChildren)
Build instance of directive of class K.
This represents '#pragma omp sections' directive.
void setNextUpperBound(Expr *NUB)
Expr * getLastIteration() const
const OMPClause * value_type
Expr * IL
IsLastIteration - local flag variable passed to runtime.
This represents '#pragma omp taskyield' directive.
static OMPCancellationPointDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Creates directive.
static OMPFlushDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
This represents '#pragma omp parallel sections' directive.
void setCalcLastIteration(Expr *CLI)
SourceLocation getLocEnd() const
Returns ending location of directive.
Stmt * getAssociatedStmt() const
Returns statement associated with the directive.
const Expr * getX() const
void setLocEnd(SourceLocation Loc)
Set ending location of directive.
void setInits(ArrayRef< Expr * > A)
static bool classof(const Stmt *T)
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Expr * getStrideVariable() const
Iterates over a filtered subrange of clauses applied to a directive.