18 using namespace clang;
22 "Number of clauses is not the same as the preallocated buffer");
23 std::copy(Clauses.begin(), Clauses.end(), getClauses().begin());
28 "Number of loop counters is not the same as the collapsed number");
29 std::copy(A.begin(), A.end(), getCounters().begin());
34 "is not the same as the collapsed "
36 std::copy(A.begin(), A.end(), getPrivateCounters().begin());
41 "Number of counter inits is not the same as the collapsed number");
42 std::copy(A.begin(), A.end(), getInits().begin());
47 "Number of counter updates is not the same as the collapsed number");
48 std::copy(A.begin(), A.end(), getUpdates().begin());
53 "Number of counter finals is not the same as the collapsed number");
54 std::copy(A.begin(), A.end(), getFinals().begin());
61 llvm::alignOf<OMPClause *>());
68 Dir->setHasCancel(HasCancel);
76 llvm::alignOf<OMPClause *>());
88 llvm::alignOf<OMPClause *>());
113 unsigned CollapsedNum,
116 llvm::alignOf<OMPClause *>());
129 llvm::alignOf<OMPClause *>());
134 new (Mem)
OMPForDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
156 Dir->setHasCancel(HasCancel);
162 unsigned CollapsedNum,
165 llvm::alignOf<OMPClause *>());
178 llvm::alignOf<OMPClause *>());
210 unsigned CollapsedNum,
213 llvm::alignOf<OMPClause *>());
224 llvm::alignOf<OMPClause *>());
231 Dir->setHasCancel(HasCancel);
239 llvm::alignOf<OMPClause *>());
248 Stmt *AssociatedStmt,
251 llvm::alignOf<Stmt *>());
262 llvm::alignOf<Stmt *>());
271 Stmt *AssociatedStmt) {
273 llvm::alignOf<OMPClause *>());
287 llvm::alignOf<OMPClause *>());
296 Stmt *AssociatedStmt) {
298 llvm::alignOf<Stmt *>());
308 llvm::alignOf<Stmt *>());
318 llvm::alignOf<OMPClause *>());
332 llvm::alignOf<OMPClause *>());
343 llvm::alignOf<OMPClause *>());
370 Dir->setHasCancel(HasCancel);
376 unsigned CollapsedNum, EmptyShell) {
378 llvm::alignOf<OMPClause *>());
390 llvm::alignOf<OMPClause *>());
392 Size +
sizeof(
OMPClause *) * Clauses.size() +
395 StartLoc, EndLoc, CollapsedNum, Clauses.size());
423 unsigned CollapsedNum, EmptyShell) {
425 llvm::alignOf<OMPClause *>());
427 Size +
sizeof(
OMPClause *) * NumClauses +
436 llvm::alignOf<OMPClause *>());
443 Dir->setHasCancel(HasCancel);
449 unsigned NumClauses, EmptyShell) {
451 llvm::alignOf<OMPClause *>());
460 Stmt *AssociatedStmt,
bool HasCancel) {
462 llvm::alignOf<OMPClause *>());
469 Dir->setHasCancel(HasCancel);
477 llvm::alignOf<OMPClause *>());
529 Stmt *AssociatedStmt) {
531 llvm::alignOf<Stmt *>());
542 llvm::alignOf<Stmt *>());
550 unsigned Size = llvm::RoundUpToAlignment(
555 Dir->setCancelRegion(CancelRegion);
561 unsigned Size = llvm::RoundUpToAlignment(
571 unsigned Size = llvm::RoundUpToAlignment(
573 llvm::alignOf<Stmt *>());
578 Dir->setCancelRegion(CancelRegion);
587 llvm::alignOf<Stmt *>());
597 llvm::alignOf<OMPClause *>());
609 llvm::alignOf<OMPClause *>());
618 Stmt *AssociatedStmt) {
620 llvm::alignOf<OMPClause *>());
634 llvm::alignOf<OMPClause *>());
643 Expr *
E,
Expr *UE,
bool IsXLHSInRHSPart,
bool IsPostfixUpdate) {
645 llvm::alignOf<OMPClause *>());
655 Dir->setUpdateExpr(UE);
656 Dir->IsXLHSInRHSPart = IsXLHSInRHSPart;
657 Dir->IsPostfixUpdate = IsPostfixUpdate;
665 llvm::alignOf<OMPClause *>());
675 Stmt *AssociatedStmt) {
677 llvm::alignOf<OMPClause *>());
691 llvm::alignOf<OMPClause *>());
702 llvm::alignOf<OMPClause *>()) +
716 llvm::alignOf<OMPClause *>()) +
725 Stmt *AssociatedStmt) {
727 llvm::alignOf<OMPClause *>());
741 llvm::alignOf<OMPClause *>());
752 llvm::alignOf<OMPClause *>());
784 unsigned CollapsedNum,
787 llvm::alignOf<OMPClause *>());
799 llvm::alignOf<OMPClause *>());
831 unsigned CollapsedNum, EmptyShell) {
833 llvm::alignOf<OMPClause *>());
845 llvm::alignOf<OMPClause *>());
877 unsigned CollapsedNum, EmptyShell) {
879 llvm::alignOf<OMPClause *>());
Expr * NLB
Update of LowerBound for statically sheduled 'omp for' loops.
Defines the clang::ASTContext interface.
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 OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
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.
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
void setHasCancel(bool Has)
Set cancel state.
void setLastIteration(Expr *LI)
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)
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.
void setFinals(ArrayRef< Expr * > A)
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.
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
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.
This represents '#pragma omp barrier' directive.
This represents '#pragma omp critical' directive.
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.
void setCounters(ArrayRef< Expr * > A)
This represents '#pragma omp cancellation point' directive.
This represents '#pragma omp teams' directive.
Expr * CalcLastIteration
Calculation of last iteration.
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
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.
The expressions built for the OpenMP loop CodeGen for the whole collapsed loop nest.
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
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.
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.
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Expr - This represents one expression.
static unsigned numLoopChildren(unsigned CollapsedNum, OpenMPDirectiveKind Kind)
Children number.
static OMPMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
static OMPOrderedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
This represents '#pragma omp for' directive.
void setAssociatedStmt(Stmt *S)
Set the associated statement for the directive.
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
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.
This represents '#pragma omp flush' directive.
This represents '#pragma omp parallel for simd' directive.
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.
SmallVector< Expr *, 4 > Counters
Counters Loop counters.
This represents '#pragma omp single' directive.
Encodes a location in the source.
void setIterationVariable(Expr *IV)
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
unsigned getCollapsedNumber() const
Get number of collapsed loops.
OpenMPDirectiveKind
OpenMP directives.
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
This represents '#pragma omp ordered' directive.
Expr * LB
LowerBound - local variable passed to runtime.
Expr * Init
Loop iteration variable init.
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.
This represents '#pragma omp section' directive.
This represents '#pragma omp simd' directive.
detail::InMemoryDirectory::const_iterator E
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
This represents '#pragma omp atomic' directive.
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
This file defines OpenMP AST classes for executable directives and clauses.
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.
static OMPSingleDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
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 * UB
UpperBound - local variable passed to runtime.
void setStrideVariable(Expr *ST)
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)
void * Allocate(size_t Size, unsigned Align=8) const
static OMPSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
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.
static OMPTaskwaitDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
This represents '#pragma omp sections' directive.
This represents '#pragma omp target data' directive.
void setNextUpperBound(Expr *NUB)
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)
void setInits(ArrayRef< Expr * > A)
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.
This represents '#pragma omp taskloop' directive.