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),
96 template <
typename SpecificClause>
98 :
public llvm::iterator_adaptor_base<
99 specific_clause_iterator<SpecificClause>,
100 ArrayRef<OMPClause *>::const_iterator, std::forward_iterator_tag,
101 const SpecificClause *, ptrdiff_t, const SpecificClause *,
102 const SpecificClause *> {
105 void SkipToNextClause() {
106 while (this->
I != End && !isa<SpecificClause>(*this->
I))
118 return cast<SpecificClause>(*this->
I);
129 template <
typename SpecificClause>
130 static llvm::iterator_range<specific_clause_iterator<SpecificClause>>
134 llvm::makeArrayRef(Clauses.end(), 0))};
137 template <
typename SpecificClause>
138 llvm::iterator_range<specific_clause_iterator<SpecificClause>>
140 return getClausesOfKind<SpecificClause>(
clauses());
148 template <
typename SpecificClause>
150 auto Clauses = getClausesOfKind<SpecificClause>();
152 if (Clauses.begin() != Clauses.end()) {
153 assert(std::next(Clauses.begin()) == Clauses.end() &&
154 "There are at least 2 clauses of the specified kind");
155 return *Clauses.begin();
162 template <
typename SpecificClause>
164 auto Clauses = getClausesOfKind<SpecificClause>();
165 return Clauses.begin() != Clauses.end();
199 return const_cast<Stmt *
>(*child_begin());
205 return S->getStmtClass() >= firstOMPExecutableDirectiveConstant &&
206 S->getStmtClass() <= lastOMPExecutableDirectiveConstant;
211 return child_range(child_iterator(), child_iterator());
212 Stmt **ChildStorage =
reinterpret_cast<Stmt **
>(getClauses().end());
213 return child_range(ChildStorage, ChildStorage + NumChildren);
245 StartLoc, EndLoc, NumClauses, 1),
259 void setHasCancel(
bool Has) { HasCancel = Has; }
271 static OMPParallelDirective *
273 ArrayRef<OMPClause *> Clauses,
Stmt *AssociatedStmt,
bool HasCancel);
281 unsigned NumClauses, EmptyShell);
287 return T->getStmtClass() == OMPParallelDirectiveClass;
297 unsigned CollapsedNum;
308 AssociatedStmtOffset = 0,
309 IterationVariableOffset = 1,
310 LastIterationOffset = 2,
311 CalcLastIterationOffset = 3,
312 PreConditionOffset = 4,
321 IsLastIterVariableOffset = 8,
322 LowerBoundVariableOffset = 9,
323 UpperBoundVariableOffset = 10,
324 StrideVariableOffset = 11,
325 EnsureUpperBoundOffset = 12,
326 NextLowerBoundOffset = 13,
327 NextUpperBoundOffset = 14,
335 Expr **Storage =
reinterpret_cast<Expr **
>(
341 MutableArrayRef<Expr *> getPrivateCounters() {
342 Expr **Storage =
reinterpret_cast<Expr **
>(&*std::next(
344 return MutableArrayRef<Expr *>(Storage, CollapsedNum);
348 MutableArrayRef<Expr *>
getInits() {
349 Expr **Storage =
reinterpret_cast<Expr **
>(
350 &*std::next(child_begin(),
352 return MutableArrayRef<Expr *>(Storage, CollapsedNum);
357 Expr **Storage =
reinterpret_cast<Expr **
>(
358 &*std::next(child_begin(),
360 return MutableArrayRef<Expr *>(Storage, CollapsedNum);
365 Expr **Storage =
reinterpret_cast<Expr **
>(
366 &*std::next(child_begin(),
368 return MutableArrayRef<Expr *>(Storage, CollapsedNum);
382 template <
typename T>
385 unsigned CollapsedNum,
unsigned NumClauses,
386 unsigned NumSpecialChildren = 0)
390 CollapsedNum(CollapsedNum) {}
410 *std::next(child_begin(), IterationVariableOffset) = IV;
413 *std::next(child_begin(), LastIterationOffset) = LI;
416 *std::next(child_begin(), CalcLastIterationOffset) = CLI;
419 *std::next(child_begin(), PreConditionOffset) = PC;
422 *std::next(child_begin(), CondOffset) = Cond;
424 void setInit(
Expr *Init) { *std::next(child_begin(), InitOffset) = Init; }
425 void setInc(
Expr *Inc) { *std::next(child_begin(), IncOffset) = Inc; }
430 "expected worksharing loop directive");
431 *std::next(child_begin(), IsLastIterVariableOffset) = IL;
437 "expected worksharing loop directive");
438 *std::next(child_begin(), LowerBoundVariableOffset) = LB;
444 "expected worksharing loop directive");
445 *std::next(child_begin(), UpperBoundVariableOffset) = UB;
451 "expected worksharing loop directive");
452 *std::next(child_begin(), StrideVariableOffset) = ST;
458 "expected worksharing loop directive");
459 *std::next(child_begin(), EnsureUpperBoundOffset) = EUB;
465 "expected worksharing loop directive");
466 *std::next(child_begin(), NextLowerBoundOffset) = NLB;
472 "expected worksharing loop directive");
473 *std::next(child_begin(), NextUpperBoundOffset) = NUB;
531 Cond !=
nullptr &&
Init !=
nullptr &&
Inc !=
nullptr;
556 for (
unsigned i = 0; i < Size; ++i) {
570 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
571 *std::next(child_begin(), IterationVariableOffset)));
574 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
575 *std::next(child_begin(), LastIterationOffset)));
578 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
579 *std::next(child_begin(), CalcLastIterationOffset)));
582 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
583 *std::next(child_begin(), PreConditionOffset)));
586 return const_cast<Expr *
>(
587 reinterpret_cast<const Expr *
>(*std::next(child_begin(), CondOffset)));
590 return const_cast<Expr *
>(
591 reinterpret_cast<const Expr *
>(*std::next(child_begin(), InitOffset)));
594 return const_cast<Expr *
>(
595 reinterpret_cast<const Expr *
>(*std::next(child_begin(), IncOffset)));
600 "expected worksharing loop directive");
601 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
602 *std::next(child_begin(), IsLastIterVariableOffset)));
607 "expected worksharing loop directive");
608 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
609 *std::next(child_begin(), LowerBoundVariableOffset)));
614 "expected worksharing loop directive");
615 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
616 *std::next(child_begin(), UpperBoundVariableOffset)));
621 "expected worksharing loop directive");
622 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
623 *std::next(child_begin(), StrideVariableOffset)));
628 "expected worksharing loop directive");
629 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
630 *std::next(child_begin(), EnsureUpperBoundOffset)));
635 "expected worksharing loop directive");
636 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
637 *std::next(child_begin(), NextLowerBoundOffset)));
642 "expected worksharing loop directive");
643 return const_cast<Expr *
>(
reinterpret_cast<const Expr *
>(
644 *std::next(child_begin(), NextUpperBoundOffset)));
649 Body = cast<ForStmt>(Body)->
getBody();
650 for (
unsigned Cnt = 1; Cnt < CollapsedNum; ++Cnt) {
651 Body = Body->IgnoreContainers();
652 Body = cast<ForStmt>(Body)->
getBody();
688 return T->getStmtClass() == OMPSimdDirectiveClass ||
689 T->getStmtClass() == OMPForDirectiveClass ||
690 T->getStmtClass() == OMPForSimdDirectiveClass ||
691 T->getStmtClass() == OMPParallelForDirectiveClass ||
692 T->getStmtClass() == OMPParallelForSimdDirectiveClass ||
693 T->getStmtClass() == OMPTaskLoopDirectiveClass ||
694 T->getStmtClass() == OMPTaskLoopSimdDirectiveClass ||
695 T->getStmtClass() == OMPDistributeDirectiveClass;
718 unsigned CollapsedNum,
unsigned NumClauses)
720 EndLoc, CollapsedNum, NumClauses) {}
744 SourceLocation EndLoc,
unsigned CollapsedNum,
745 ArrayRef<OMPClause *> Clauses,
746 Stmt *AssociatedStmt,
747 const HelperExprs &Exprs);
757 unsigned CollapsedNum, EmptyShell);
760 return T->getStmtClass() == OMPSimdDirectiveClass;
787 unsigned CollapsedNum,
unsigned NumClauses)
789 CollapsedNum, NumClauses),
803 void setHasCancel(
bool Has) { HasCancel = Has; }
818 SourceLocation EndLoc,
unsigned CollapsedNum,
819 ArrayRef<OMPClause *> Clauses,
820 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
831 unsigned CollapsedNum, EmptyShell);
837 return T->getStmtClass() == OMPForDirectiveClass;
860 unsigned CollapsedNum,
unsigned NumClauses)
862 StartLoc, EndLoc, CollapsedNum, NumClauses) {}
885 static OMPForSimdDirective *
887 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
888 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
899 unsigned CollapsedNum, EmptyShell);
902 return T->getStmtClass() == OMPForSimdDirectiveClass;
930 StartLoc, EndLoc, NumClauses, 1),
944 void setHasCancel(
bool Has) { HasCancel = Has; }
956 static OMPSectionsDirective *
958 ArrayRef<OMPClause *> Clauses,
Stmt *AssociatedStmt,
bool HasCancel);
967 unsigned NumClauses, EmptyShell);
973 return T->getStmtClass() == OMPSectionsDirectiveClass;
996 StartLoc, EndLoc, 0, 1),
1016 SourceLocation StartLoc,
1017 SourceLocation EndLoc,
1018 Stmt *AssociatedStmt,
bool HasCancel);
1033 return T->getStmtClass() == OMPSectionDirectiveClass;
1054 unsigned NumClauses)
1056 StartLoc, EndLoc, NumClauses, 1) {}
1076 static OMPSingleDirective *
1078 ArrayRef<OMPClause *> Clauses,
Stmt *AssociatedStmt);
1087 unsigned NumClauses, EmptyShell);
1090 return T->getStmtClass() == OMPSingleDirectiveClass;
1109 StartLoc, EndLoc, 0, 1) {}
1126 SourceLocation StartLoc,
1127 SourceLocation EndLoc,
1128 Stmt *AssociatedStmt);
1137 return T->getStmtClass() == OMPMasterDirectiveClass;
1161 StartLoc, EndLoc, NumClauses, 1),
1178 void setDirectiveName(
const DeclarationNameInfo &
Name) { DirName =
Name; }
1190 static OMPCriticalDirective *
1192 SourceLocation StartLoc, SourceLocation EndLoc,
1193 ArrayRef<OMPClause *> Clauses,
Stmt *AssociatedStmt);
1201 unsigned NumClauses, EmptyShell);
1208 return T->getStmtClass() == OMPCriticalDirectiveClass;
1235 unsigned CollapsedNum,
unsigned NumClauses)
1237 StartLoc, EndLoc, CollapsedNum, NumClauses),
1252 void setHasCancel(
bool Has) { HasCancel = Has; }
1266 static OMPParallelForDirective *
1268 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
1269 Stmt *AssociatedStmt,
const HelperExprs &Exprs,
bool HasCancel);
1279 unsigned NumClauses,
1280 unsigned CollapsedNum,
1287 return T->getStmtClass() == OMPParallelForDirectiveClass;
1311 unsigned CollapsedNum,
unsigned NumClauses)
1313 OMPD_parallel_for_simd, StartLoc, EndLoc, CollapsedNum,
1322 unsigned NumClauses)
1338 static OMPParallelForSimdDirective *
1340 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
1341 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
1351 unsigned NumClauses,
1352 unsigned CollapsedNum,
1356 return T->getStmtClass() == OMPParallelForSimdDirectiveClass;
1382 unsigned NumClauses)
1384 OMPD_parallel_sections, StartLoc, EndLoc,
1399 void setHasCancel(
bool Has) { HasCancel = Has; }
1411 static OMPParallelSectionsDirective *
1413 ArrayRef<OMPClause *> Clauses,
Stmt *AssociatedStmt,
bool HasCancel);
1421 static OMPParallelSectionsDirective *
1428 return T->getStmtClass() == OMPParallelSectionsDirectiveClass;
1452 unsigned NumClauses)
1454 EndLoc, NumClauses, 1),
1468 void setHasCancel(
bool Has) { HasCancel = Has; }
1481 SourceLocation EndLoc,
1482 ArrayRef<OMPClause *> Clauses,
1483 Stmt *AssociatedStmt,
bool HasCancel);
1498 return T->getStmtClass() == OMPTaskDirectiveClass;
1517 StartLoc, EndLoc, 0, 0) {}
1532 static OMPTaskyieldDirective *
1542 return T->getStmtClass() == OMPTaskyieldDirectiveClass;
1561 StartLoc, EndLoc, 0, 0) {}
1576 static OMPBarrierDirective *
1586 return T->getStmtClass() == OMPBarrierDirectiveClass;
1605 StartLoc, EndLoc, 0, 0) {}
1620 static OMPTaskwaitDirective *
1630 return T->getStmtClass() == OMPTaskwaitDirectiveClass;
1649 StartLoc, EndLoc, 0, 1) {}
1666 SourceLocation StartLoc,
1667 SourceLocation EndLoc,
1668 Stmt *AssociatedStmt);
1677 return T->getStmtClass() == OMPTaskgroupDirectiveClass;
1700 unsigned NumClauses)
1702 StartLoc, EndLoc, NumClauses, 0) {}
1723 SourceLocation EndLoc,
1724 ArrayRef<OMPClause *> Clauses);
1733 unsigned NumClauses, EmptyShell);
1736 return T->getStmtClass() == OMPFlushDirectiveClass;
1755 unsigned NumClauses)
1757 StartLoc, EndLoc, NumClauses, 1) {}
1777 static OMPOrderedDirective *
1779 ArrayRef<OMPClause *> Clauses,
Stmt *AssociatedStmt);
1787 unsigned NumClauses, EmptyShell);
1790 return T->getStmtClass() == OMPOrderedDirectiveClass;
1812 bool IsXLHSInRHSPart;
1821 bool IsPostfixUpdate;
1830 unsigned NumClauses)
1832 StartLoc, EndLoc, NumClauses, 5),
1833 IsXLHSInRHSPart(
false), IsPostfixUpdate(
false) {}
1843 IsXLHSInRHSPart(
false), IsPostfixUpdate(
false) {}
1846 void setX(Expr *
X) { *std::next(child_begin()) =
X; }
1850 void setUpdateExpr(Expr *UE) { *std::next(child_begin(), 2) = UE; }
1852 void setV(Expr *V) { *std::next(child_begin(), 3) = V; }
1854 void setExpr(Expr *
E) { *std::next(child_begin(), 4) =
E; }
1876 static OMPAtomicDirective *
1878 ArrayRef<OMPClause *> Clauses,
Stmt *AssociatedStmt, Expr *X, Expr *V,
1879 Expr *E, Expr *UE,
bool IsXLHSInRHSPart,
bool IsPostfixUpdate);
1888 unsigned NumClauses, EmptyShell);
1891 Expr *
getX() {
return cast_or_null<Expr>(*std::next(child_begin())); }
1893 return cast_or_null<Expr>(*std::next(child_begin()));
1899 return cast_or_null<Expr>(*std::next(child_begin(), 2));
1902 return cast_or_null<Expr>(*std::next(child_begin(), 2));
1912 Expr *
getV() {
return cast_or_null<Expr>(*std::next(child_begin(), 3)); }
1914 return cast_or_null<Expr>(*std::next(child_begin(), 3));
1917 Expr *
getExpr() {
return cast_or_null<Expr>(*std::next(child_begin(), 4)); }
1919 return cast_or_null<Expr>(*std::next(child_begin(), 4));
1923 return T->getStmtClass() == OMPAtomicDirectiveClass;
1944 unsigned NumClauses)
1946 StartLoc, EndLoc, NumClauses, 1) {}
1966 static OMPTargetDirective *
1968 ArrayRef<OMPClause *> Clauses,
Stmt *AssociatedStmt);
1977 unsigned NumClauses, EmptyShell);
1980 return T->getStmtClass() == OMPTargetDirectiveClass;
2002 unsigned NumClauses)
2004 OMPD_target_data, StartLoc, EndLoc, NumClauses,
2025 static OMPTargetDataDirective *
2027 ArrayRef<OMPClause *> Clauses,
Stmt *AssociatedStmt);
2038 return T->getStmtClass() == OMPTargetDataDirectiveClass;
2059 unsigned NumClauses)
2061 StartLoc, EndLoc, NumClauses, 1) {}
2082 SourceLocation EndLoc,
2083 ArrayRef<OMPClause *> Clauses,
2084 Stmt *AssociatedStmt);
2093 unsigned NumClauses, EmptyShell);
2096 return T->getStmtClass() == OMPTeamsDirectiveClass;
2117 OMPD_cancellation_point, StartLoc, EndLoc, 0, 0),
2139 static OMPCancellationPointDirective *
2154 return T->getStmtClass() == OMPCancellationPointDirectiveClass;
2175 unsigned NumClauses)
2177 StartLoc, EndLoc, NumClauses, 0),
2201 static OMPCancelDirective *
2211 unsigned NumClauses, EmptyShell);
2217 return T->getStmtClass() == OMPCancelDirectiveClass;
2240 unsigned CollapsedNum,
unsigned NumClauses)
2242 StartLoc, EndLoc, CollapsedNum, NumClauses) {}
2265 static OMPTaskLoopDirective *
2267 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2268 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
2278 unsigned NumClauses,
2279 unsigned CollapsedNum, EmptyShell);
2282 return T->getStmtClass() == OMPTaskLoopDirectiveClass;
2305 unsigned CollapsedNum,
unsigned NumClauses)
2307 OMPD_taskloop_simd, StartLoc, EndLoc, CollapsedNum,
2318 CollapsedNum, NumClauses) {}
2331 static OMPTaskLoopSimdDirective *
2333 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2334 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
2344 unsigned NumClauses,
2345 unsigned CollapsedNum,
2349 return T->getStmtClass() == OMPTaskLoopSimdDirectiveClass;
2372 unsigned CollapsedNum,
unsigned NumClauses)
2374 StartLoc, EndLoc, CollapsedNum, NumClauses)
2399 static OMPDistributeDirective *
2401 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2402 Stmt *AssociatedStmt,
const HelperExprs &Exprs);
2412 unsigned NumClauses,
2413 unsigned CollapsedNum, EmptyShell);
2416 return T->getStmtClass() == OMPDistributeDirectiveClass;
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)
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)
static OMPDistributeDirective * 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< OMPClause * > clauses()
llvm::iterator_range< specific_clause_iterator< SpecificClause > > getClausesOfKind() const
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.
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
void setHasCancel(bool Has)
Set cancel state.
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 OMPSectionDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, bool HasCancel)
Creates directive.
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...
static OMPCriticalDirective * Create(const ASTContext &C, const DeclarationNameInfo &Name, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
void setNextLowerBound(Expr *NLB)
const Expr * getExpr() const
ArrayRef< OMPClause * > clauses() const
This represents '#pragma omp parallel for' directive.
void setIsLastIterVariable(Expr *IL)
static OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
static OMPTaskLoopSimdDirective * 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 OMPParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of 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.
bool hasCancel() const
Return true if current directive has inner cancel directive.
This represents '#pragma omp parallel' directive.
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
const SpecificClause * operator->() const
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
bool hasCancel() const
Return true if current directive has inner cancel 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.
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPParallelSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPCancelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, OpenMPDirectiveKind CancelRegion)
Creates directive.
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.
bool hasCancel() const
Return true if current directive has inner cancel directive.
static bool classof(const Stmt *T)
static bool classof(const Stmt *T)
detail::InMemoryDirectory::const_iterator I
static bool classof(const Stmt *T)
Expr * NUB
Update of UpperBound for statically sheduled 'omp for' loops.
Expr * Cond
Loop condition.
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Expr * PreCond
Loop pre-condition.
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.
ArrayRef< Expr * > private_counters()
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.
This represents '#pragma omp distribute' directive.
static OMPTargetDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
specific_clause_iterator(ArrayRef< OMPClause * > Clauses)
OMPClause * getClause(unsigned i) const
Returns specified clause.
static OMPSimdDirective * 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)
Expr - This represents one expression.
const SpecificClause * operator*() const
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
static unsigned numLoopChildren(unsigned CollapsedNum, OpenMPDirectiveKind Kind)
Children number.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
static OMPMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
Expr * getIterationVariable() const
static bool classof(const Stmt *T)
static bool classof(const Stmt *T)
bool builtAll()
Check if all the expressions are built (does not check the worksharing ones).
static OMPOrderedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
const Expr * getUpdateExpr() const
This represents '#pragma omp for' directive.
static bool classof(const Stmt *T)
ArrayRef< Expr * > private_counters() const
ArrayRef< Expr * > finals() const
void setAssociatedStmt(Stmt *S)
Set the associated statement for the directive.
Expr * getIsLastIterVariable() const
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a taskloop directive.
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.
static OMPTargetDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
ArrayRef< Expr * > counters() const
unsigned getNumClauses() const
Get number of clauses.
static OMPTaskLoopDirective * 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.
specific_clause_iterator & operator++()
static bool classof(const Stmt *T)
This file defines OpenMP AST classes for clauses.
static bool classof(const Stmt *T)
bool hasClausesOfKind() const
Returns true if the current directive has one or more clauses of a specific kind. ...
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.
SmallVector< Expr *, 4 > PrivateCounters
PrivateCounters Loop counters.
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.
This represents '#pragma omp single' directive.
Encodes a location in the source.
void setIterationVariable(Expr *IV)
MutableArrayRef< Expr * > getInits()
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.
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.
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents '#pragma omp target' directive.
void setClauses(ArrayRef< OMPClause * > Clauses)
Sets the list of variables for this clause.
static OMPForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
Expr * getUpperBoundVariable() const
Expr * getV()
Get 'v' part of the associated expression/statement.
static bool classof(const Stmt *T)
This represents '#pragma omp ordered' directive.
Expr * LB
LowerBound - local variable passed to runtime.
const SpecificClause * getSingleClause() const
Gets a single clause of the specified kind associated with the current directive iff there is only on...
void clear(unsigned Size)
Initialize all the fields to null.
Expr * Init
Loop iteration variable init.
Expr * getPreCond() const
void setPrivateCounters(ArrayRef< Expr * > A)
static OMPTaskDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
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.
SmallVector< Expr *, 4 > Inits
Expressions for loop counters inits for CodeGen.
static bool classof(const Stmt *T)
bool hasCancel() const
Return true if current directive has inner cancel directive.
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.
Expr * getEnsureUpperBound() const
detail::InMemoryDirectory::const_iterator E
Expr * getUpdateExpr()
Get helper expression of the form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExp...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
This represents '#pragma omp atomic' directive.
Expr * getCalcLastIteration() const
ArrayRef< Expr * > counters()
Iterates over a filtered subrange of clauses applied to a directive.
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a distribute directive.
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
ArrayRef< Expr * > inits()
static bool classof(const Stmt *T)
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.
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
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)
static llvm::iterator_range< specific_clause_iterator< SpecificClause > > getClausesOfKind(ArrayRef< OMPClause * > Clauses)
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 OMPSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
static bool classof(const Stmt *T)
This represents '#pragma omp taskloop simd' directive.
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 OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
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.
This represents '#pragma omp target data' directive.
void setNextUpperBound(Expr *NUB)
Expr * getLastIteration() const
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 OMPParallelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Expr * getStrideVariable() const
This represents '#pragma omp taskloop' directive.