18 using namespace clang;
24 #define OPENMP_CLAUSE(Name, Class) \
26 return static_cast<Class *>(this)->children();
27 #include "clang/Basic/OpenMPKinds.def"
29 llvm_unreachable(
"unknown OMPClause");
41 case OMPC_dist_schedule:
43 case OMPC_firstprivate:
45 case OMPC_lastprivate:
49 case OMPC_task_reduction:
55 case OMPC_num_threads:
59 case OMPC_thread_limit:
71 case OMPC_copyprivate:
98 case OMPC_use_device_ptr:
99 case OMPC_is_device_ptr:
113 case OMPC_lastprivate:
117 case OMPC_task_reduction:
122 case OMPC_dist_schedule:
123 case OMPC_firstprivate:
128 case OMPC_num_threads:
136 case OMPC_copyprivate:
154 case OMPC_thread_limit:
160 case OMPC_defaultmap:
165 case OMPC_use_device_ptr:
166 case OMPC_is_device_ptr:
175 "Number of private copies is not the same as the preallocated buffer");
184 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(2 * VL.size()));
188 Clause->setPrivateCopies(PrivateVL);
194 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(2 * N));
200 "Number of private copies is not the same as the preallocated buffer");
206 "Number of inits is not the same as the preallocated buffer");
207 std::copy(VL.begin(), VL.end(), getPrivateCopies().end());
215 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(3 * VL.size()));
219 Clause->setPrivateCopies(PrivateVL);
220 Clause->setInits(InitVL);
227 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(3 * N));
233 "Number of private copies is not the same as the preallocated buffer");
234 std::copy(PrivateCopies.begin(), PrivateCopies.end(),
varlist_end());
238 assert(SrcExprs.size() ==
varlist_size() &&
"Number of source expressions is "
239 "not the same as the "
240 "preallocated buffer");
241 std::copy(SrcExprs.begin(), SrcExprs.end(), getPrivateCopies().end());
245 assert(DstExprs.size() ==
varlist_size() &&
"Number of destination "
246 "expressions is not the same as "
247 "the preallocated buffer");
248 std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
251 void OMPLastprivateClause::setAssignmentOps(
ArrayRef<Expr *> AssignmentOps) {
253 "Number of assignment expressions is not the same as the preallocated "
255 std::copy(AssignmentOps.begin(), AssignmentOps.end(),
256 getDestinationExprs().end());
264 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
268 Clause->setSourceExprs(SrcExprs);
269 Clause->setDestinationExprs(DstExprs);
270 Clause->setAssignmentOps(AssignmentOps);
278 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * N));
287 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(VL.size()));
295 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(N));
301 "Number of privates is not the same as the preallocated buffer");
307 "Number of inits is not the same as the preallocated buffer");
308 std::copy(IL.begin(), IL.end(),
getPrivates().end());
313 "Number of updates is not the same as the preallocated buffer");
314 std::copy(UL.begin(), UL.end(),
getInits().end());
319 "Number of final updates is not the same as the preallocated buffer");
320 std::copy(FL.begin(), FL.end(),
getUpdates().end());
331 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * VL.size() + 2));
333 StartLoc, LParenLoc, Modifier, ModifierLoc, ColonLoc, EndLoc, VL.size());
335 Clause->setPrivates(PL);
336 Clause->setInits(IL);
339 std::fill(Clause->getInits().end(), Clause->getInits().end() + VL.size(),
341 std::fill(Clause->getUpdates().end(), Clause->getUpdates().end() + VL.size(),
343 Clause->setStep(Step);
344 Clause->setCalcStep(CalcStep);
354 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * NumVars + 2));
362 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
365 Clause->setVarRefs(VL);
366 Clause->setAlignment(A);
372 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(NumVars + 1));
377 assert(SrcExprs.size() == varlist_size() &&
"Number of source expressions is "
378 "not the same as the "
379 "preallocated buffer");
380 std::copy(SrcExprs.begin(), SrcExprs.end(), varlist_end());
384 assert(DstExprs.size() == varlist_size() &&
"Number of destination "
385 "expressions is not the same as "
386 "the preallocated buffer");
387 std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
391 assert(AssignmentOps.size() == varlist_size() &&
392 "Number of assignment expressions is not the same as the preallocated "
394 std::copy(AssignmentOps.begin(), AssignmentOps.end(),
395 getDestinationExprs().end());
400 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
401 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps) {
402 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(4 * VL.size()));
405 Clause->setVarRefs(VL);
406 Clause->setSourceExprs(SrcExprs);
407 Clause->setDestinationExprs(DstExprs);
408 Clause->setAssignmentOps(AssignmentOps);
413 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(4 * N));
418 assert(SrcExprs.size() == varlist_size() &&
"Number of source expressions is "
419 "not the same as the "
420 "preallocated buffer");
421 std::copy(SrcExprs.begin(), SrcExprs.end(), varlist_end());
425 assert(DstExprs.size() == varlist_size() &&
"Number of destination "
426 "expressions is not the same as "
427 "the preallocated buffer");
428 std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
431 void OMPCopyprivateClause::setAssignmentOps(
ArrayRef<Expr *> AssignmentOps) {
432 assert(AssignmentOps.size() == varlist_size() &&
433 "Number of assignment expressions is not the same as the preallocated "
435 std::copy(AssignmentOps.begin(), AssignmentOps.end(),
436 getDestinationExprs().end());
441 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
442 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps) {
443 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(4 * VL.size()));
446 Clause->setVarRefs(VL);
447 Clause->setSourceExprs(SrcExprs);
448 Clause->setDestinationExprs(DstExprs);
449 Clause->setAssignmentOps(AssignmentOps);
455 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(4 * N));
461 "Number of private copies is not the same as the preallocated buffer");
462 std::copy(Privates.begin(), Privates.end(),
varlist_end());
468 "Number of LHS expressions is not the same as the preallocated buffer");
469 std::copy(LHSExprs.begin(), LHSExprs.end(), getPrivates().end());
475 "Number of RHS expressions is not the same as the preallocated buffer");
476 std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
480 assert(ReductionOps.size() ==
varlist_size() &&
"Number of reduction "
481 "expressions is not the same "
482 "as the preallocated buffer");
483 std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
493 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
495 StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
497 Clause->setPrivates(Privates);
498 Clause->setLHSExprs(LHSExprs);
499 Clause->setRHSExprs(RHSExprs);
500 Clause->setReductionOps(ReductionOps);
508 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * N));
514 "Number of private copies is not the same as the preallocated buffer");
515 std::copy(Privates.begin(), Privates.end(),
varlist_end());
521 "Number of LHS expressions is not the same as the preallocated buffer");
522 std::copy(LHSExprs.begin(), LHSExprs.end(), getPrivates().end());
528 "Number of RHS expressions is not the same as the preallocated buffer");
529 std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
532 void OMPTaskReductionClause::setReductionOps(
ArrayRef<Expr *> ReductionOps) {
533 assert(ReductionOps.size() ==
varlist_size() &&
"Number of task reduction "
534 "expressions is not the same "
535 "as the preallocated buffer");
536 std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
546 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
548 StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
550 Clause->setPrivates(Privates);
551 Clause->setLHSExprs(LHSExprs);
552 Clause->setRHSExprs(RHSExprs);
553 Clause->setReductionOps(ReductionOps);
561 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * N));
570 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
573 Clause->setVarRefs(VL);
578 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(N));
586 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
589 Clause->setVarRefs(VL);
590 Clause->setDependencyKind(DepKind);
591 Clause->setDependencyLoc(DepLoc);
592 Clause->setColonLoc(ColonLoc);
598 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(N + 1));
603 assert(getDependencyKind() == OMPC_DEPEND_sink ||
604 getDependencyKind() == OMPC_DEPEND_source || V ==
nullptr);
605 *getVarRefs().end() = V;
609 auto *V = *getVarRefs().end();
610 assert(getDependencyKind() == OMPC_DEPEND_sink ||
611 getDependencyKind() == OMPC_DEPEND_source || V ==
nullptr);
616 auto *V = *getVarRefs().end();
617 assert(getDependencyKind() == OMPC_DEPEND_sink ||
618 getDependencyKind() == OMPC_DEPEND_source || V ==
nullptr);
624 unsigned TotalNum = 0u;
625 for (
auto &C : ComponentLists)
626 TotalNum += C.size();
631 ArrayRef<ValueDecl *> Declarations) {
632 unsigned TotalNum = 0u;
633 llvm::SmallPtrSet<const ValueDecl *, 8>
Cache;
634 for (
auto *D : Declarations) {
635 const ValueDecl *VD = D ? cast<ValueDecl>(D->getCanonicalDecl()) :
nullptr;
652 unsigned NumVars = Vars.size();
653 unsigned NumUniqueDeclarations =
654 getUniqueDeclarationsTotalNumber(Declarations);
655 unsigned NumComponentLists = ComponentLists.size();
656 unsigned NumComponents = getComponentsTotalNumber(ComponentLists);
671 NumVars, NumUniqueDeclarations,
672 NumUniqueDeclarations + NumComponentLists, NumComponents));
674 TypeModifier, Type, TypeIsImplicit, TypeLoc, StartLoc, LParenLoc, EndLoc,
675 NumVars, NumUniqueDeclarations, NumComponentLists, NumComponents);
677 Clause->setVarRefs(Vars);
679 Clause->setMapTypeModifier(TypeModifier);
680 Clause->setMapType(Type);
681 Clause->setMapLoc(TypeLoc);
686 unsigned NumUniqueDeclarations,
687 unsigned NumComponentLists,
688 unsigned NumComponents) {
692 NumVars, NumUniqueDeclarations,
693 NumUniqueDeclarations + NumComponentLists, NumComponents));
694 return new (Mem)
OMPMapClause(NumVars, NumUniqueDeclarations,
695 NumComponentLists, NumComponents);
703 unsigned NumVars = Vars.size();
704 unsigned NumUniqueDeclarations =
705 getUniqueDeclarationsTotalNumber(Declarations);
706 unsigned NumComponentLists = ComponentLists.size();
707 unsigned NumComponents = getComponentsTotalNumber(ComponentLists);
722 NumVars, NumUniqueDeclarations,
723 NumUniqueDeclarations + NumComponentLists, NumComponents));
726 OMPToClause(StartLoc, LParenLoc, EndLoc, NumVars, NumUniqueDeclarations,
727 NumComponentLists, NumComponents);
729 Clause->setVarRefs(Vars);
735 unsigned NumUniqueDeclarations,
736 unsigned NumComponentLists,
737 unsigned NumComponents) {
741 NumVars, NumUniqueDeclarations,
742 NumUniqueDeclarations + NumComponentLists, NumComponents));
743 return new (Mem)
OMPToClause(NumVars, NumUniqueDeclarations,
744 NumComponentLists, NumComponents);
752 unsigned NumVars = Vars.size();
753 unsigned NumUniqueDeclarations =
754 getUniqueDeclarationsTotalNumber(Declarations);
755 unsigned NumComponentLists = ComponentLists.size();
756 unsigned NumComponents = getComponentsTotalNumber(ComponentLists);
771 NumVars, NumUniqueDeclarations,
772 NumUniqueDeclarations + NumComponentLists, NumComponents));
775 OMPFromClause(StartLoc, LParenLoc, EndLoc, NumVars, NumUniqueDeclarations,
776 NumComponentLists, NumComponents);
778 Clause->setVarRefs(Vars);
784 unsigned NumUniqueDeclarations,
785 unsigned NumComponentLists,
786 unsigned NumComponents) {
790 NumVars, NumUniqueDeclarations,
791 NumUniqueDeclarations + NumComponentLists, NumComponents));
792 return new (Mem)
OMPFromClause(NumVars, NumUniqueDeclarations,
793 NumComponentLists, NumComponents);
797 assert(VL.size() == varlist_size() &&
798 "Number of private copies is not the same as the preallocated buffer");
799 std::copy(VL.begin(), VL.end(), varlist_end());
803 assert(VL.size() == varlist_size() &&
804 "Number of inits is not the same as the preallocated buffer");
805 std::copy(VL.begin(), VL.end(), getPrivateCopies().end());
810 SourceLocation EndLoc, ArrayRef<Expr *> Vars, ArrayRef<Expr *> PrivateVars,
811 ArrayRef<Expr *>
Inits, ArrayRef<ValueDecl *> Declarations,
813 unsigned NumVars = Vars.size();
814 unsigned NumUniqueDeclarations =
815 getUniqueDeclarationsTotalNumber(Declarations);
816 unsigned NumComponentLists = ComponentLists.size();
817 unsigned NumComponents = getComponentsTotalNumber(ComponentLists);
832 3 * NumVars, NumUniqueDeclarations,
833 NumUniqueDeclarations + NumComponentLists, NumComponents));
836 StartLoc, LParenLoc, EndLoc, NumVars, NumUniqueDeclarations,
837 NumComponentLists, NumComponents);
839 Clause->setVarRefs(Vars);
840 Clause->setPrivateCopies(PrivateVars);
841 Clause->setInits(Inits);
847 const ASTContext &C,
unsigned NumVars,
unsigned NumUniqueDeclarations,
848 unsigned NumComponentLists,
unsigned NumComponents) {
852 3 * NumVars, NumUniqueDeclarations,
853 NumUniqueDeclarations + NumComponentLists, NumComponents));
855 NumComponentLists, NumComponents);
864 unsigned NumVars = Vars.size();
865 unsigned NumUniqueDeclarations =
866 getUniqueDeclarationsTotalNumber(Declarations);
867 unsigned NumComponentLists = ComponentLists.size();
868 unsigned NumComponents = getComponentsTotalNumber(ComponentLists);
883 NumVars, NumUniqueDeclarations,
884 NumUniqueDeclarations + NumComponentLists, NumComponents));
887 StartLoc, LParenLoc, EndLoc, NumVars, NumUniqueDeclarations,
888 NumComponentLists, NumComponents);
890 Clause->setVarRefs(Vars);
896 const ASTContext &C,
unsigned NumVars,
unsigned NumUniqueDeclarations,
897 unsigned NumComponentLists,
unsigned NumComponents) {
901 NumVars, NumUniqueDeclarations,
902 NumUniqueDeclarations + NumComponentLists, NumComponents));
904 NumComponentLists, NumComponents);
static OMPPrivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > PrivateVL)
Creates clause with a list of variables VL.
static OMPDependClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
Defines the clang::ASTContext interface.
static OMPReductionClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, ArrayRef< Expr * > Privates, ArrayRef< Expr * > LHSExprs, ArrayRef< Expr * > RHSExprs, ArrayRef< Expr * > ReductionOps, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL.
This represents 'thread_limit' clause in the '#pragma omp ...' directive.
static OMPToClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > Vars, ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists)
Creates clause with a list of variables Vars.
static OMPCopyinClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
This represents clause 'copyin' in the '#pragma omp ...' directives.
static OMPUseDevicePtrClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
static OMPClauseWithPreInit * get(OMPClause *C)
Stmt - This represents one statement.
Class that handles pre-initialization statement for some clauses, like 'shedule', 'firstprivate' etc...
static OMPCopyprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > SrcExprs, ArrayRef< Expr * > DstExprs, ArrayRef< Expr * > AssignmentOps)
Creates clause with a list of variables VL.
static OMPFirstprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
llvm::iterator_range< child_iterator > child_range
This represents 'if' clause in the '#pragma omp ...' directive.
static OMPCopyinClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > SrcExprs, ArrayRef< Expr * > DstExprs, ArrayRef< Expr * > AssignmentOps)
Creates clause with a list of variables VL.
static OMPMapClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for for NumVars original expressions, NumUniqueDeclarations de...
TypePropertyCache< Private > Cache
The base class of the type hierarchy.
static OMPIsDevicePtrClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > Vars, ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists)
Creates clause with a list of variables Vars.
static OMPReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents clause 'private' in the '#pragma omp ...' directives.
This represents 'num_threads' clause in the '#pragma omp ...' directive.
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
static OMPTaskReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
void setClauseInfo(ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists)
Fill the clause information from the list of declarations and associated component lists...
Base wrapper for a particular "section" of type source info.
static OMPSharedClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL)
Creates clause with a list of variables VL.
clang::OMPLinearClause OMPVarListClause, OMPClauseWithPostUpdate, llvm::TrailingObjects getPrivates()
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
This represents clause 'lastprivate' in the '#pragma omp ...' directives.
void setUpdates(ArrayRef< Expr * > UL)
Sets the list of update expressions for linear variables.
This represents clause 'map' in the '#pragma omp ...' directives.
This represents clause 'to' in the '#pragma omp ...' directives.
Expr * getCounterValue()
Get the loop counter value.
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
void setFinals(ArrayRef< Expr * > FL)
Sets the list of final update expressions for linear variables.
static OMPIsDevicePtrClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
static unsigned getComponentsTotalNumber(MappableExprComponentListsRef ComponentLists)
static OMPToClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
Class that handles post-update expression for some clauses, like 'lastprivate', 'reduction' etc...
This represents clause 'reduction' in the '#pragma omp ...' directives.
This represents clause 'is_device_ptr' in the '#pragma omp ...' directives.
static OMPTaskReductionClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, ArrayRef< Expr * > Privates, ArrayRef< Expr * > LHSExprs, ArrayRef< Expr * > RHSExprs, ArrayRef< Expr * > ReductionOps, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL.
This represents clause 'from' in the '#pragma omp ...' directives.
OpenMPClauseKind getClauseKind() const
Returns kind of OpenMP clause (private, shared, reduction, etc.).
This represents clause 'aligned' in the '#pragma omp ...' directives.
static OMPAlignedClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
This represents clause 'task_reduction' in the '#pragma omp taskgroup' directives.
This represents implicit clause 'depend' for the '#pragma omp task' directive.
static OMPFlushClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL)
Creates clause with a list of variables VL.
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
void setInits(ArrayRef< Expr * > IL)
Sets the list of the initial values for linear variables.
static OMPUseDevicePtrClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > Vars, ArrayRef< Expr * > PrivateVars, ArrayRef< Expr * > Inits, ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists)
Creates clause with a list of variables Vars.
static OMPFlushClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
void setPrivateCopies(ArrayRef< Expr * > PrivateCopies)
Set list of helper expressions, required for generation of private copies of original lastprivate var...
static OMPPrivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents clause 'firstprivate' in the '#pragma omp ...' directives.
static OMPDependClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, OpenMPDependClauseKind DepKind, SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef< Expr * > VL)
Creates clause with a list of variables VL.
This file defines OpenMP AST classes for clauses.
void setPostUpdateExpr(Expr *S)
Set pre-initialization statement for the clause.
This represents 'num_teams' clause in the '#pragma omp ...' directive.
static OMPFirstprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > PrivateVL, ArrayRef< Expr * > InitVL, Stmt *PreInit)
Creates clause with a list of variables VL.
Encodes a location in the source.
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
MutableArrayRef< Expr * > getInits()
void setVarRefs(ArrayRef< Expr * > VL)
Sets the list of variables for this clause.
This represents 'schedule' clause in the '#pragma omp ...' directive.
static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > PL, ArrayRef< Expr * > IL, Expr *Step, Expr *CalcStep, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL and a linear step Step.
This represents clause 'shared' in the '#pragma omp ...' directives.
OpenMPLinearClauseKind Modifier
Modifier of 'linear' clause.
This is a basic class for representing single OpenMP clause.
static OMPFromClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > Vars, ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists)
Creates clause with a list of variables Vars.
static OMPAlignedClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, Expr *A)
Creates clause with a list of variables VL and alignment A.
SourceLocation ModifierLoc
Location of linear modifier if any.
ArrayRef< MappableExprComponentList > MappableExprComponentListsRef
void setCounterValue(Expr *V)
Set the loop counter value for the depend clauses with 'sink|source' kind of dependency.
This represents clause 'linear' in the '#pragma omp ...' directives.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
static OMPSharedClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
static OMPCopyprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
static OMPLastprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > SrcExprs, ArrayRef< Expr * > DstExprs, ArrayRef< Expr * > AssignmentOps, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL.
static unsigned getUniqueDeclarationsTotalNumber(ArrayRef< ValueDecl * > Declarations)
varlist_iterator varlist_end()
Privates[]
Gets the list of initial values for linear variables.
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
void * Allocate(size_t Size, unsigned Align=8) const
static OMPMapClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > Vars, ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists, OpenMPMapClauseKind TypeModifier, OpenMPMapClauseKind Type, bool TypeIsImplicit, SourceLocation TypeLoc)
Creates clause with a list of variables VL.
void setPreInitStmt(Stmt *S, OpenMPDirectiveKind ThisRegion=OMPD_unknown)
Set pre-initialization statement for the clause.
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
void setPrivates(ArrayRef< Expr * > PL)
Sets the list of the copies of original linear variables.
static OMPFromClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
static OMPClauseWithPostUpdate * get(OMPClause *C)
static OMPLastprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
SourceLocation ColonLoc
Location of ':'.
unsigned varlist_size() const
This represents clause 'use_device_ptr' in the '#pragma omp ...' directives.