17 #ifndef LLVM_CLANG_AST_OPENMPCLAUSE_H 18 #define LLVM_CLANG_AST_OPENMPCLAUSE_H 29 #include "llvm/ADT/ArrayRef.h" 30 #include "llvm/ADT/MapVector.h" 31 #include "llvm/ADT/SmallVector.h" 32 #include "llvm/ADT/iterator.h" 33 #include "llvm/ADT/iterator_range.h" 34 #include "llvm/Support/Casting.h" 35 #include "llvm/Support/Compiler.h" 36 #include "llvm/Support/TrailingObjects.h" 63 : StartLoc(StartLoc), EndLoc(EndLoc), Kind(K) {}
103 Stmt *PreInit =
nullptr;
110 assert(
get(This) &&
"get is not tuned for pre-init.");
116 CaptureRegion = ThisRegion;
139 Expr *PostUpdate =
nullptr;
142 OMPClauseWithPostUpdate(
const OMPClause *This) : OMPClauseWithPreInit(This) {
143 assert(
get(This) &&
"get is not tuned for post-update.");
182 :
OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
187 static_cast<T *
>(
this)->
template getTrailingObjects<Expr *>(), NumVars);
192 assert(VL.size() == NumVars &&
193 "Number of variables is not the same as the preallocated buffer");
194 std::copy(VL.begin(), VL.end(),
195 static_cast<T *
>(
this)->
template getTrailingObjects<Expr *>());
227 return llvm::makeArrayRef(
228 static_cast<const T *>(
this)->
template getTrailingObjects<Expr *>(),
247 Stmt *Condition =
nullptr;
259 void setCondition(
Expr *Cond) { Condition = Cond; }
265 void setNameModifierLoc(
SourceLocation Loc) { NameModifierLoc = Loc; }
287 :
OMPClause(OMPC_if, StartLoc, EndLoc), OMPClauseWithPreInit(this),
288 LParenLoc(LParenLoc), Condition(Cond), ColonLoc(ColonLoc),
289 NameModifier(NameModifier), NameModifierLoc(NameModifierLoc) {
290 setPreInitStmt(HelperCond, CaptureRegion);
296 OMPClauseWithPreInit(this) {}
337 Stmt *Condition =
nullptr;
340 void setCondition(
Expr *Cond) { Condition = Cond; }
351 :
OMPClause(OMPC_final, StartLoc, EndLoc), LParenLoc(LParenLoc),
389 Stmt *NumThreads =
nullptr;
392 void setNumThreads(
Expr *NThreads) { NumThreads = NThreads; }
408 :
OMPClause(OMPC_num_threads, StartLoc, EndLoc),
409 OMPClauseWithPreInit(this), LParenLoc(LParenLoc),
410 NumThreads(NumThreads) {
411 setPreInitStmt(HelperNumThreads, CaptureRegion);
417 OMPClauseWithPreInit(this) {}
454 Stmt *Safelen =
nullptr;
457 void setSafelen(
Expr *Len) { Safelen = Len; }
467 :
OMPClause(OMPC_safelen, StartLoc, EndLoc), LParenLoc(LParenLoc),
508 Stmt *Simdlen =
nullptr;
511 void setSimdlen(
Expr *Len) { Simdlen = Len; }
521 :
OMPClause(OMPC_simdlen, StartLoc, EndLoc), LParenLoc(LParenLoc),
562 Stmt *NumForLoops =
nullptr;
565 void setNumForLoops(
Expr *Num) { NumForLoops = Num; }
576 :
OMPClause(OMPC_collapse, StartLoc, EndLoc), LParenLoc(LParenLoc),
626 void setDefaultKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
639 :
OMPClause(OMPC_default, StartLoc, EndLoc), LParenLoc(LParenLoc),
640 Kind(A), KindKwLoc(ALoc) {}
695 void setProcBindKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
709 :
OMPClause(OMPC_proc_bind, StartLoc, EndLoc), LParenLoc(LParenLoc),
710 Kind(A), KindKwLoc(ALoc) {}
754 enum {FIRST, SECOND, NUM_MODIFIERS};
767 Expr *ChunkSize =
nullptr;
778 Modifiers[FIRST] = M;
785 Modifiers[SECOND] = M;
790 ModifiersLoc[FIRST] = Loc;
795 ModifiersLoc[SECOND] = Loc;
803 Modifiers[FIRST] = M;
806 Modifiers[SECOND] = M;
828 void setChunkSize(
Expr *E) { ChunkSize = E; }
849 Expr *ChunkSize,
Stmt *HelperChunkSize,
852 :
OMPClause(OMPC_schedule, StartLoc, EndLoc), OMPClauseWithPreInit(this),
853 LParenLoc(LParenLoc), Kind(Kind), KindLoc(KLoc), CommaLoc(CommaLoc),
854 ChunkSize(ChunkSize) {
855 setPreInitStmt(HelperChunkSize);
856 Modifiers[FIRST] = M1;
857 Modifiers[SECOND] = M2;
858 ModifiersLoc[FIRST] = M1Loc;
859 ModifiersLoc[SECOND] = M2Loc;
865 OMPClauseWithPreInit(this) {
875 return Modifiers[FIRST];
880 return Modifiers[SECOND];
891 return ModifiersLoc[FIRST];
896 return ModifiersLoc[SECOND];
909 return child_range(reinterpret_cast<Stmt **>(&ChunkSize),
910 reinterpret_cast<Stmt **>(&ChunkSize) + 1);
932 Stmt *NumForLoops =
nullptr;
935 void setNumForLoops(
Expr *Num) { NumForLoops = Num; }
946 :
OMPClause(OMPC_ordered, StartLoc, EndLoc), LParenLoc(LParenLoc),
982 :
OMPClause(OMPC_nowait, StartLoc, EndLoc) {}
1010 :
OMPClause(OMPC_untied, StartLoc, EndLoc) {}
1039 :
OMPClause(OMPC_mergeable, StartLoc, EndLoc) {}
1067 :
OMPClause(OMPC_read, StartLoc, EndLoc) {}
1094 :
OMPClause(OMPC_write, StartLoc, EndLoc) {}
1123 :
OMPClause(OMPC_update, StartLoc, EndLoc) {}
1152 :
OMPClause(OMPC_capture, StartLoc, EndLoc) {}
1181 :
OMPClause(OMPC_seq_cst, StartLoc, EndLoc) {}
1240 return llvm::makeArrayRef(varlist_end(), varlist_size());
1267 llvm::iterator_range<private_copies_const_iterator>;
1271 getPrivateCopies().end());
1276 getPrivateCopies().end());
1280 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1281 reinterpret_cast<Stmt **>(varlist_end()));
1299 public OMPClauseWithPreInit,
1314 LParenLoc, EndLoc, N),
1315 OMPClauseWithPreInit(this) {}
1324 OMPClauseWithPreInit(this) {}
1337 return llvm::makeArrayRef(varlist_end(), varlist_size());
1351 return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
1383 llvm::iterator_range<private_copies_const_iterator>;
1387 getPrivateCopies().end());
1391 getPrivateCopies().end());
1407 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1408 reinterpret_cast<Stmt **>(varlist_end()));
1426 public OMPClauseWithPostUpdate,
1457 LParenLoc, EndLoc, N),
1458 OMPClauseWithPostUpdate(this) {}
1467 OMPClauseWithPostUpdate(this) {}
1475 return llvm::makeArrayRef(varlist_end(), varlist_size());
1489 return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
1503 return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
1516 return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
1560 llvm::iterator_range<helper_expr_const_iterator>;
1568 getPrivateCopies().end());
1573 getPrivateCopies().end());
1578 getSourceExprs().end());
1587 getDestinationExprs().end());
1592 getDestinationExprs().end());
1597 getAssignmentOps().end());
1602 getAssignmentOps().end());
1606 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1607 reinterpret_cast<Stmt **>(varlist_end()));
1666 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1667 reinterpret_cast<Stmt **>(varlist_end()));
1685 public OMPClauseWithPostUpdate,
1714 LParenLoc, EndLoc, N),
1715 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
1716 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
1725 OMPClauseWithPostUpdate(this) {}
1746 return llvm::makeArrayRef(varlist_end(), varlist_size());
1759 return llvm::makeArrayRef(
getPrivates().end(), varlist_size());
1774 return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
1788 return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
1851 llvm::iterator_range<helper_expr_const_iterator>;
1879 getReductionOps().end());
1884 getReductionOps().end());
1888 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1889 reinterpret_cast<Stmt **>(varlist_end()));
1907 public OMPClauseWithPostUpdate,
1936 LParenLoc, EndLoc, N),
1937 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
1938 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
1947 OMPClauseWithPostUpdate(this) {}
1967 return llvm::makeArrayRef(varlist_end(), varlist_size());
1980 return llvm::makeArrayRef(
getPrivates().end(), varlist_size());
1994 return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
2008 return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
2071 llvm::iterator_range<helper_expr_const_iterator>;
2099 getReductionOps().end());
2104 getReductionOps().end());
2108 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2109 reinterpret_cast<Stmt **>(varlist_end()));
2126 public OMPClauseWithPostUpdate,
2155 LParenLoc, EndLoc, N),
2156 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
2157 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
2166 OMPClauseWithPostUpdate(this) {}
2186 return llvm::makeArrayRef(varlist_end(), varlist_size());
2199 return llvm::makeArrayRef(
getPrivates().end(), varlist_size());
2213 return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
2227 return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
2238 return llvm::makeArrayRef(getReductionOps().end(), varlist_size());
2304 llvm::iterator_range<helper_expr_const_iterator>;
2332 getReductionOps().end());
2337 getReductionOps().end());
2342 getTaskgroupDescriptors().end());
2347 getTaskgroupDescriptors().end());
2351 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2352 reinterpret_cast<Stmt **>(varlist_end()));
2370 public OMPClauseWithPostUpdate,
2404 OMPClauseWithPostUpdate(this), Modifier(Modifier),
2405 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc) {}
2414 OMPClauseWithPostUpdate(this) {}
2432 return llvm::makeArrayRef(varlist_end(), varlist_size());
2439 return llvm::makeArrayRef(
getPrivates().end(), varlist_size());
2447 return llvm::makeArrayRef(
getInits().end(), varlist_size());
2455 return llvm::makeArrayRef(
getUpdates().end(), varlist_size());
2590 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2591 reinterpret_cast<Stmt **>(varlist_end()));
2618 void setAlignment(Expr *A) { *varlist_end() = A; }
2628 SourceLocation ColonLoc, SourceLocation EndLoc,
2632 ColonLoc(ColonLoc) {}
2639 SourceLocation(), SourceLocation(),
2653 SourceLocation LParenLoc,
2654 SourceLocation ColonLoc,
2655 SourceLocation EndLoc, ArrayRef<Expr *> VL,
2677 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2678 reinterpret_cast<Stmt **>(varlist_end()));
2682 return T->getClauseKind() == OMPC_aligned;
2720 SourceLocation EndLoc,
unsigned N)
2729 SourceLocation(), SourceLocation(),
2735 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
2738 MutableArrayRef<Expr *> getSourceExprs() {
2739 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2741 ArrayRef<const Expr *> getSourceExprs()
const {
2742 return llvm::makeArrayRef(varlist_end(), varlist_size());
2748 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
2751 MutableArrayRef<Expr *> getDestinationExprs() {
2752 return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
2754 ArrayRef<const Expr *> getDestinationExprs()
const {
2755 return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
2762 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
2765 MutableArrayRef<Expr *> getAssignmentOps() {
2766 return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
2768 ArrayRef<const Expr *> getAssignmentOps()
const {
2769 return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
2795 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
2796 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
2797 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
2809 llvm::iterator_range<helper_expr_const_iterator>;
2813 getSourceExprs().end());
2822 getDestinationExprs().end());
2827 getDestinationExprs().end());
2832 getAssignmentOps().end());
2837 getAssignmentOps().end());
2841 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2842 reinterpret_cast<Stmt **>(varlist_end()));
2846 return T->getClauseKind() == OMPC_copyin;
2872 SourceLocation EndLoc,
unsigned N)
2874 LParenLoc, EndLoc, N) {}
2881 OMPC_copyprivate, SourceLocation(), SourceLocation(),
2882 SourceLocation(), N) {}
2887 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
2890 MutableArrayRef<Expr *> getSourceExprs() {
2891 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2893 ArrayRef<const Expr *> getSourceExprs()
const {
2894 return llvm::makeArrayRef(varlist_end(), varlist_size());
2900 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
2903 MutableArrayRef<Expr *> getDestinationExprs() {
2904 return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
2906 ArrayRef<const Expr *> getDestinationExprs()
const {
2907 return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
2914 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
2917 MutableArrayRef<Expr *> getAssignmentOps() {
2918 return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
2920 ArrayRef<const Expr *> getAssignmentOps()
const {
2921 return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
2946 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
2947 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
2948 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
2960 llvm::iterator_range<helper_expr_const_iterator>;
2964 getSourceExprs().end());
2973 getDestinationExprs().end());
2978 getDestinationExprs().end());
2983 getAssignmentOps().end());
2988 getAssignmentOps().end());
2992 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2993 reinterpret_cast<Stmt **>(varlist_end()));
2997 return T->getClauseKind() == OMPC_copyprivate;
3025 OMPFlushClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3026 SourceLocation EndLoc,
unsigned N)
3027 : OMPVarListClause<OMPFlushClause>(OMPC_flush, StartLoc, LParenLoc,
3034 : OMPVarListClause<OMPFlushClause>(OMPC_flush, SourceLocation(),
3035 SourceLocation(), SourceLocation(),
3047 SourceLocation LParenLoc, SourceLocation EndLoc,
3048 ArrayRef<Expr *> VL);
3057 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3058 reinterpret_cast<Stmt **>(varlist_end()));
3062 return T->getClauseKind() == OMPC_flush;
3085 SourceLocation DepLoc;
3097 SourceLocation EndLoc,
unsigned N)
3106 SourceLocation(), SourceLocation(),
3113 void setDependencyLoc(SourceLocation Loc) { DepLoc = Loc; }
3116 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
3130 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
3132 SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VL);
3151 void setCounterValue(Expr *V);
3154 Expr *getCounterValue();
3157 const Expr *getCounterValue()
const;
3160 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3161 reinterpret_cast<Stmt **>(varlist_end()));
3165 return T->getClauseKind() == OMPC_depend;
3181 SourceLocation LParenLoc;
3184 Stmt *Device =
nullptr;
3189 void setDevice(Expr *E) { Device = E; }
3201 SourceLocation StartLoc, SourceLocation LParenLoc,
3202 SourceLocation EndLoc)
3203 :
OMPClause(OMPC_device, StartLoc, EndLoc), OMPClauseWithPreInit(this),
3204 LParenLoc(LParenLoc), Device(E) {
3205 setPreInitStmt(HelperE, CaptureRegion);
3210 :
OMPClause(OMPC_device, SourceLocation(), SourceLocation()),
3211 OMPClauseWithPreInit(this) {}
3228 return T->getClauseKind() == OMPC_device;
3245 :
OMPClause(OMPC_threads, StartLoc, EndLoc) {}
3249 :
OMPClause(OMPC_threads, SourceLocation(), SourceLocation()) {}
3256 return T->getClauseKind() == OMPC_threads;
3273 :
OMPClause(OMPC_simd, StartLoc, EndLoc) {}
3283 return T->getClauseKind() == OMPC_simd;
3299 Expr *AssociatedExpression =
nullptr;
3304 ValueDecl *AssociatedDeclaration =
nullptr;
3309 ValueDecl *AssociatedDeclaration)
3310 : AssociatedExpression(AssociatedExpression),
3311 AssociatedDeclaration(
3312 AssociatedDeclaration
3319 return AssociatedDeclaration;
3342 getUniqueDeclarationsTotalNumber(ArrayRef<const ValueDecl *> Declarations);
3355 unsigned NumUniqueDeclarations;
3358 unsigned NumComponentLists;
3361 unsigned NumComponents;
3379 SourceLocation LParenLoc, SourceLocation EndLoc,
3380 unsigned NumVars,
unsigned NumUniqueDeclarations,
3381 unsigned NumComponentLists,
unsigned NumComponents)
3383 NumUniqueDeclarations(NumUniqueDeclarations),
3384 NumComponentLists(NumComponentLists), NumComponents(NumComponents) {}
3389 return MutableArrayRef<ValueDecl *>(
3390 static_cast<T *
>(
this)->
template getTrailingObjects<ValueDecl *>(),
3391 NumUniqueDeclarations);
3397 return ArrayRef<ValueDecl *>(
3398 static_cast<const T *
>(
this)
3399 ->
template getTrailingObjects<ValueDecl *>(),
3400 NumUniqueDeclarations);
3406 assert(UDs.size() == NumUniqueDeclarations &&
3407 "Unexpected amount of unique declarations.");
3408 std::copy(UDs.begin(), UDs.end(), getUniqueDeclsRef().begin());
3414 return MutableArrayRef<unsigned>(
3415 static_cast<T *
>(
this)->
template getTrailingObjects<unsigned>(),
3416 NumUniqueDeclarations);
3422 return ArrayRef<unsigned>(
3423 static_cast<const T *
>(
this)->
template getTrailingObjects<unsigned>(),
3424 NumUniqueDeclarations);
3430 assert(DNLs.size() == NumUniqueDeclarations &&
3431 "Unexpected amount of list numbers.");
3432 std::copy(DNLs.begin(), DNLs.end(), getDeclNumListsRef().begin());
3438 return MutableArrayRef<unsigned>(
3439 static_cast<T *
>(
this)->
template getTrailingObjects<unsigned>() +
3440 NumUniqueDeclarations,
3447 return ArrayRef<unsigned>(
3448 static_cast<const T *
>(
this)->
template getTrailingObjects<unsigned>() +
3449 NumUniqueDeclarations,
3456 assert(CLSs.size() == NumComponentLists &&
3457 "Unexpected amount of component lists.");
3458 std::copy(CLSs.begin(), CLSs.end(), getComponentListSizesRef().begin());
3463 return MutableArrayRef<MappableComponent>(
3464 static_cast<T *
>(
this)
3465 ->
template getTrailingObjects<MappableComponent>(),
3471 return ArrayRef<MappableComponent>(
3472 static_cast<const T *
>(
this)
3473 ->
template getTrailingObjects<MappableComponent>(),
3481 ArrayRef<unsigned> CLSs) {
3482 assert(Components.size() == NumComponents &&
3483 "Unexpected amount of component lists.");
3484 assert(CLSs.size() == NumComponentLists &&
3485 "Unexpected amount of list sizes.");
3486 std::copy(Components.begin(), Components.end(), getComponentsRef().begin());
3495 assert(getUniqueDeclarationsTotalNumber(Declarations) ==
3496 NumUniqueDeclarations &&
3497 "Unexpected number of mappable expression info entries!");
3498 assert(getComponentsTotalNumber(ComponentLists) == NumComponents &&
3499 "Unexpected total number of components!");
3500 assert(Declarations.size() == ComponentLists.size() &&
3501 "Declaration and component lists size is not consistent!");
3502 assert(Declarations.size() == NumComponentLists &&
3503 "Unexpected declaration and component lists size!");
3508 llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
3511 auto CI = ComponentLists.begin();
3512 for (
auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
3514 assert(!CI->empty() &&
"Invalid component list!");
3515 ComponentListMap[*DI].push_back(*CI);
3520 auto UniqueDeclarations = getUniqueDeclsRef();
3521 auto UDI = UniqueDeclarations.begin();
3523 auto DeclNumLists = getDeclNumListsRef();
3524 auto DNLI = DeclNumLists.begin();
3526 auto ComponentListSizes = getComponentListSizesRef();
3527 auto CLSI = ComponentListSizes.begin();
3529 auto Components = getComponentsRef();
3530 auto CI = Components.begin();
3533 unsigned PrevSize = 0u;
3536 for (
auto &M : ComponentListMap) {
3553 PrevSize +=
C.size();
3560 CI = std::copy(
C.begin(),
C.end(), CI);
3579 :
public llvm::iterator_adaptor_base<
3580 const_component_lists_iterator,
3581 MappableExprComponentListRef::const_iterator,
3582 std::forward_iterator_tag, MappableComponent, ptrdiff_t,
3583 MappableComponent, MappableComponent> {
3585 ArrayRef<ValueDecl *>::iterator DeclCur;
3588 ArrayRef<unsigned>::iterator NumListsCur;
3591 unsigned RemainingLists = 0;
3595 unsigned PrevListSize = 0;
3599 ArrayRef<unsigned>::const_iterator ListSizeCur;
3600 ArrayRef<unsigned>::const_iterator ListSizeEnd;
3603 MappableExprComponentListRef::const_iterator
End;
3608 ArrayRef<ValueDecl *> UniqueDecls, ArrayRef<unsigned> DeclsListNum,
3609 ArrayRef<unsigned> CumulativeListSizes,
3612 Components.begin()),
3613 DeclCur(UniqueDecls.begin()), NumListsCur(DeclsListNum.begin()),
3614 ListSizeCur(CumulativeListSizes.begin()),
3615 ListSizeEnd(CumulativeListSizes.end()), End(Components.end()) {
3616 assert(UniqueDecls.size() == DeclsListNum.size() &&
3617 "Inconsistent number of declarations and list sizes!");
3618 if (!DeclsListNum.empty())
3619 RemainingLists = *NumListsCur;
3625 const ValueDecl *Declaration, ArrayRef<ValueDecl *> UniqueDecls,
3626 ArrayRef<unsigned> DeclsListNum, ArrayRef<unsigned> CumulativeListSizes,
3629 CumulativeListSizes, Components) {
3633 for (; DeclCur != UniqueDecls.end(); ++DeclCur, ++NumListsCur) {
3634 if (*DeclCur == Declaration)
3637 assert(*NumListsCur > 0 &&
"No lists associated with declaration??");
3641 std::advance(ListSizeCur, *NumListsCur - 1);
3642 PrevListSize = *ListSizeCur;
3648 if (ListSizeCur == CumulativeListSizes.end()) {
3650 RemainingLists = 0u;
3656 RemainingLists = *NumListsCur;
3659 ListSizeEnd = ListSizeCur;
3660 std::advance(ListSizeEnd, RemainingLists);
3664 std::advance(this->I, PrevListSize);
3669 std::pair<const ValueDecl *, MappableExprComponentListRef>
3671 assert(ListSizeCur != ListSizeEnd &&
"Invalid iterator!");
3672 return std::make_pair(
3676 std::pair<const ValueDecl *, MappableExprComponentListRef>
3683 assert(ListSizeCur != ListSizeEnd && RemainingLists &&
3684 "Invalid iterator!");
3688 if (std::next(ListSizeCur) == ListSizeEnd) {
3692 std::advance(this->I, *ListSizeCur - PrevListSize);
3693 PrevListSize = *ListSizeCur;
3696 if (!(--RemainingLists)) {
3699 RemainingLists = *NumListsCur;
3700 assert(RemainingLists &&
"No lists in the following declaration??");
3710 llvm::iterator_range<const_component_lists_iterator>;
3714 return const_component_lists_iterator(
3715 getUniqueDeclsRef(), getDeclNumListsRef(), getComponentListSizesRef(),
3716 getComponentsRef());
3719 return const_component_lists_iterator(
3720 ArrayRef<ValueDecl *>(), ArrayRef<unsigned>(), ArrayRef<unsigned>(),
3722 getComponentsRef().end()));
3725 return {component_lists_begin(), component_lists_end()};
3730 const_component_lists_iterator
3732 return const_component_lists_iterator(
3733 VD, getUniqueDeclsRef(), getDeclNumListsRef(),
3734 getComponentListSizesRef(), getComponentsRef());
3737 return component_lists_end();
3740 return {decl_component_lists_begin(VD), decl_component_lists_end()};
3749 auto A = getUniqueDeclsRef();
3755 llvm::iterator_range<const_all_num_lists_iterator>;
3758 auto A = getDeclNumListsRef();
3764 llvm::iterator_range<const_all_lists_sizes_iterator>;
3767 auto A = getComponentListSizesRef();
3773 llvm::iterator_range<const_all_components_iterator>;
3776 auto A = getComponentsRef();
3791 OMPMapClause, Expr *, ValueDecl *, unsigned,
3792 OMPClauseMappableExprCommon::MappableComponent> {
3800 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
3801 return varlist_size();
3803 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
3804 return getUniqueDeclarationsNum();
3806 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
3807 return getUniqueDeclarationsNum() + getTotalComponentListNum();
3817 bool MapTypeIsImplicit =
false;
3820 SourceLocation MapLoc;
3842 SourceLocation MapLoc, SourceLocation StartLoc,
3843 SourceLocation LParenLoc, SourceLocation EndLoc,
3844 unsigned NumVars,
unsigned NumUniqueDeclarations,
3845 unsigned NumComponentLists,
unsigned NumComponents)
3847 NumVars, NumUniqueDeclarations,
3848 NumComponentLists, NumComponents),
3849 MapTypeModifier(MapTypeModifier), MapType(MapType),
3850 MapTypeIsImplicit(MapTypeIsImplicit), MapLoc(MapLoc) {}
3859 explicit OMPMapClause(
unsigned NumVars,
unsigned NumUniqueDeclarations,
3860 unsigned NumComponentLists,
unsigned NumComponents)
3862 OMPC_map, SourceLocation(), SourceLocation(), SourceLocation(),
3863 NumVars, NumUniqueDeclarations, NumComponentLists, NumComponents) {}
3878 void setMapLoc(SourceLocation TLoc) { MapLoc = TLoc; }
3881 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
3897 SourceLocation LParenLoc, SourceLocation EndLoc,
3898 ArrayRef<Expr *> Vars,
3899 ArrayRef<ValueDecl *> Declarations,
3903 SourceLocation TypeLoc);
3917 unsigned NumUniqueDeclarations,
3918 unsigned NumComponentLists,
3919 unsigned NumComponents);
3933 return MapTypeModifier;
3937 SourceLocation
getMapLoc() const LLVM_READONLY {
return MapLoc; }
3944 reinterpret_cast<Stmt **>(varlist_begin()),
3945 reinterpret_cast<Stmt **>(varlist_end()));
3949 return T->getClauseKind() == OMPC_map;
3965 SourceLocation LParenLoc;
3968 Stmt *NumTeams =
nullptr;
3973 void setNumTeams(Expr *E) { NumTeams = E; }
3986 SourceLocation StartLoc, SourceLocation LParenLoc,
3987 SourceLocation EndLoc)
3988 :
OMPClause(OMPC_num_teams, StartLoc, EndLoc), OMPClauseWithPreInit(this),
3989 LParenLoc(LParenLoc), NumTeams(E) {
3990 setPreInitStmt(HelperE, CaptureRegion);
3995 :
OMPClause(OMPC_num_teams, SourceLocation(), SourceLocation()),
3996 OMPClauseWithPreInit(this) {}
4013 return T->getClauseKind() == OMPC_num_teams;
4029 SourceLocation LParenLoc;
4032 Stmt *ThreadLimit =
nullptr;
4037 void setThreadLimit(Expr *E) { ThreadLimit = E; }
4051 SourceLocation StartLoc, SourceLocation LParenLoc,
4052 SourceLocation EndLoc)
4053 :
OMPClause(OMPC_thread_limit, StartLoc, EndLoc),
4054 OMPClauseWithPreInit(this), LParenLoc(LParenLoc), ThreadLimit(E) {
4055 setPreInitStmt(HelperE, CaptureRegion);
4060 :
OMPClause(OMPC_thread_limit, SourceLocation(), SourceLocation()),
4061 OMPClauseWithPreInit(this) {}
4078 return T->getClauseKind() == OMPC_thread_limit;
4094 SourceLocation LParenLoc;
4097 Stmt *Priority =
nullptr;
4102 void setPriority(Expr *E) { Priority = E; }
4112 SourceLocation EndLoc)
4113 :
OMPClause(OMPC_priority, StartLoc, EndLoc), LParenLoc(LParenLoc),
4118 :
OMPClause(OMPC_priority, SourceLocation(), SourceLocation()) {}
4135 return T->getClauseKind() == OMPC_priority;
4151 SourceLocation LParenLoc;
4154 Stmt *Grainsize =
nullptr;
4157 void setGrainsize(Expr *Size) { Grainsize = Size; }
4166 SourceLocation LParenLoc, SourceLocation EndLoc)
4167 :
OMPClause(OMPC_grainsize, StartLoc, EndLoc), LParenLoc(LParenLoc),
4172 :
OMPClause(OMPC_grainsize, SourceLocation(), SourceLocation()) {}
4186 return T->getClauseKind() == OMPC_grainsize;
4203 :
OMPClause(OMPC_nogroup, StartLoc, EndLoc) {}
4207 :
OMPClause(OMPC_nogroup, SourceLocation(), SourceLocation()) {}
4214 return T->getClauseKind() == OMPC_nogroup;
4230 SourceLocation LParenLoc;
4233 Stmt *NumTasks =
nullptr;
4236 void setNumTasks(Expr *Size) { NumTasks = Size; }
4245 SourceLocation LParenLoc, SourceLocation EndLoc)
4246 :
OMPClause(OMPC_num_tasks, StartLoc, EndLoc), LParenLoc(LParenLoc),
4251 :
OMPClause(OMPC_num_tasks, SourceLocation(), SourceLocation()) {}
4265 return T->getClauseKind() == OMPC_num_tasks;
4280 SourceLocation LParenLoc;
4283 Stmt *Hint =
nullptr;
4286 void setHint(Expr *H) { Hint = H; }
4296 SourceLocation EndLoc)
4297 :
OMPClause(OMPC_hint, StartLoc, EndLoc), LParenLoc(LParenLoc),
4310 Expr *
getHint()
const {
return cast_or_null<Expr>(Hint); }
4315 return T->getClauseKind() == OMPC_hint;
4331 SourceLocation LParenLoc;
4337 SourceLocation KindLoc;
4340 SourceLocation CommaLoc;
4343 Expr *ChunkSize =
nullptr;
4353 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
4358 void setDistScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
4363 void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
4368 void setChunkSize(Expr *E) { ChunkSize = E; }
4383 SourceLocation KLoc, SourceLocation CommaLoc,
4384 SourceLocation EndLoc,
4386 Stmt *HelperChunkSize)
4387 :
OMPClause(OMPC_dist_schedule, StartLoc, EndLoc),
4388 OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Kind(Kind),
4389 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
4390 setPreInitStmt(HelperChunkSize);
4395 :
OMPClause(OMPC_dist_schedule, SourceLocation(), SourceLocation()),
4396 OMPClauseWithPreInit(this) {}
4417 return child_range(reinterpret_cast<Stmt **>(&ChunkSize),
4418 reinterpret_cast<Stmt **>(&ChunkSize) + 1);
4422 return T->getClauseKind() == OMPC_dist_schedule;
4437 SourceLocation LParenLoc;
4449 SourceLocation KindLoc;
4464 void setDefaultmapModifierLoc(SourceLocation Loc) {
4471 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
4476 void setDefaultmapKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
4489 SourceLocation MLoc, SourceLocation KLoc,
4492 :
OMPClause(OMPC_defaultmap, StartLoc, EndLoc), LParenLoc(LParenLoc),
4493 Modifier(M), ModifierLoc(MLoc), Kind(Kind), KindLoc(KLoc) {}
4497 :
OMPClause(OMPC_defaultmap, SourceLocation(), SourceLocation()) {}
4523 return T->getClauseKind() == OMPC_defaultmap;
4537 OMPToClause, Expr *, ValueDecl *, unsigned,
4538 OMPClauseMappableExprCommon::MappableComponent> {
4553 explicit OMPToClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4554 SourceLocation EndLoc,
unsigned NumVars,
4555 unsigned NumUniqueDeclarations,
4556 unsigned NumComponentLists,
unsigned NumComponents)
4558 NumUniqueDeclarations, NumComponentLists,
4568 explicit OMPToClause(
unsigned NumVars,
unsigned NumUniqueDeclarations,
4569 unsigned NumComponentLists,
unsigned NumComponents)
4571 OMPC_to, SourceLocation(), SourceLocation(), SourceLocation(),
4572 NumVars, NumUniqueDeclarations, NumComponentLists, NumComponents) {}
4576 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4577 return varlist_size();
4579 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
4580 return getUniqueDeclarationsNum();
4582 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
4583 return getUniqueDeclarationsNum() + getTotalComponentListNum();
4596 SourceLocation LParenLoc, SourceLocation EndLoc,
4597 ArrayRef<Expr *> Vars,
4598 ArrayRef<ValueDecl *> Declarations,
4611 unsigned NumUniqueDeclarations,
4612 unsigned NumComponentLists,
4613 unsigned NumComponents);
4616 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
4617 reinterpret_cast<Stmt **>(varlist_end()));
4621 return T->getClauseKind() == OMPC_to;
4636 OMPFromClause, Expr *, ValueDecl *, unsigned,
4637 OMPClauseMappableExprCommon::MappableComponent> {
4652 explicit OMPFromClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4653 SourceLocation EndLoc,
unsigned NumVars,
4654 unsigned NumUniqueDeclarations,
4655 unsigned NumComponentLists,
unsigned NumComponents)
4657 NumVars, NumUniqueDeclarations,
4658 NumComponentLists, NumComponents) {}
4667 explicit OMPFromClause(
unsigned NumVars,
unsigned NumUniqueDeclarations,
4668 unsigned NumComponentLists,
unsigned NumComponents)
4670 OMPC_from, SourceLocation(), SourceLocation(), SourceLocation(),
4671 NumVars, NumUniqueDeclarations, NumComponentLists, NumComponents) {}
4675 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4676 return varlist_size();
4678 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
4679 return getUniqueDeclarationsNum();
4681 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
4682 return getUniqueDeclarationsNum() + getTotalComponentListNum();
4695 SourceLocation LParenLoc, SourceLocation EndLoc,
4696 ArrayRef<Expr *> Vars,
4697 ArrayRef<ValueDecl *> Declarations,
4710 unsigned NumUniqueDeclarations,
4711 unsigned NumComponentLists,
4712 unsigned NumComponents);
4715 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
4716 reinterpret_cast<Stmt **>(varlist_end()));
4720 return T->getClauseKind() == OMPC_from;
4735 OMPUseDevicePtrClause, Expr *, ValueDecl *, unsigned,
4736 OMPClauseMappableExprCommon::MappableComponent> {
4752 SourceLocation LParenLoc,
4753 SourceLocation EndLoc,
unsigned NumVars,
4754 unsigned NumUniqueDeclarations,
4755 unsigned NumComponentLists,
4756 unsigned NumComponents)
4758 EndLoc, NumVars, NumUniqueDeclarations,
4759 NumComponentLists, NumComponents) {}
4769 unsigned NumUniqueDeclarations,
4770 unsigned NumComponentLists,
4771 unsigned NumComponents)
4773 SourceLocation(), SourceLocation(), NumVars,
4774 NumUniqueDeclarations, NumComponentLists,
4779 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4780 return 3 * varlist_size();
4782 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
4783 return getUniqueDeclarationsNum();
4785 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
4786 return getUniqueDeclarationsNum() + getTotalComponentListNum();
4792 void setPrivateCopies(ArrayRef<Expr *> VL);
4796 MutableArrayRef<Expr *> getPrivateCopies() {
4797 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
4799 ArrayRef<const Expr *> getPrivateCopies()
const {
4800 return llvm::makeArrayRef(varlist_end(), varlist_size());
4806 void setInits(ArrayRef<Expr *> VL);
4810 MutableArrayRef<Expr *>
getInits() {
4811 return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
4813 ArrayRef<const Expr *>
getInits()
const {
4814 return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
4829 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
4830 SourceLocation EndLoc, ArrayRef<Expr *> Vars,
4831 ArrayRef<Expr *> PrivateVars, ArrayRef<Expr *>
Inits,
4832 ArrayRef<ValueDecl *> Declarations,
4846 unsigned NumUniqueDeclarations,
4847 unsigned NumComponentLists,
4848 unsigned NumComponents);
4854 llvm::iterator_range<private_copies_const_iterator>;
4858 getPrivateCopies().end());
4863 getPrivateCopies().end());
4880 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
4881 reinterpret_cast<Stmt **>(varlist_end()));
4885 return T->getClauseKind() == OMPC_use_device_ptr;
4900 OMPIsDevicePtrClause, Expr *, ValueDecl *, unsigned,
4901 OMPClauseMappableExprCommon::MappableComponent> {
4917 SourceLocation LParenLoc, SourceLocation EndLoc,
4919 unsigned NumUniqueDeclarations,
4920 unsigned NumComponentLists,
4921 unsigned NumComponents)
4923 EndLoc, NumVars, NumUniqueDeclarations,
4924 NumComponentLists, NumComponents) {}
4934 unsigned NumUniqueDeclarations,
4935 unsigned NumComponentLists,
4936 unsigned NumComponents)
4938 SourceLocation(), SourceLocation(), NumVars,
4939 NumUniqueDeclarations, NumComponentLists,
4944 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4945 return varlist_size();
4947 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
4948 return getUniqueDeclarationsNum();
4950 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
4951 return getUniqueDeclarationsNum() + getTotalComponentListNum();
4964 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
4965 SourceLocation EndLoc, ArrayRef<Expr *> Vars,
4966 ArrayRef<ValueDecl *> Declarations,
4980 unsigned NumUniqueDeclarations,
4981 unsigned NumComponentLists,
4982 unsigned NumComponents);
4985 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
4986 reinterpret_cast<Stmt **>(varlist_end()));
4990 return T->getClauseKind() == OMPC_is_device_ptr;
4996 #endif // LLVM_CLANG_AST_OPENMPCLAUSE_H
OMPCaptureClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'capture' clause.
OMPNumTeamsClause(Expr *E, Stmt *HelperE, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'num_teams' clause.
helper_expr_range source_exprs()
OMPHintClause()
Build an empty clause.
llvm::iterator_range< helper_expr_iterator > helper_expr_range
static const Decl * getCanonicalDecl(const Decl *D)
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
OMPUntiedClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'untied' clause.
helper_expr_const_range reduction_ops() const
This represents 'thread_limit' clause in the '#pragma omp ...' directive.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
Iterator that browse the components by lists.
OMPSeqCstClause()
Build an empty clause.
helper_expr_const_range lhs_exprs() const
const_all_decls_range all_decls() const
This represents clause 'copyin' in the '#pragma omp ...' directives.
llvm::iterator_range< private_copies_const_iterator > private_copies_const_range
helper_expr_range source_exprs()
bool varlist_empty() const
const Expr * getChunkSize() const
Get chunk size.
MutableArrayRef< Expr * >::iterator updates_iterator
static bool classof(const OMPClause *T)
SourceLocation getCommaLoc()
Get location of ','.
helper_expr_range privates()
OpenMPDefaultmapClauseKind
OpenMP attributes for 'defaultmap' clause.
helper_expr_const_range rhs_exprs() const
llvm::iterator_range< inits_iterator > inits_range
const_component_lists_iterator(ArrayRef< ValueDecl *> UniqueDecls, ArrayRef< unsigned > DeclsListNum, ArrayRef< unsigned > CumulativeListSizes, MappableExprComponentListRef Components)
Construct an iterator that scans all lists.
private_copies_range private_copies()
void setUniqueDecls(ArrayRef< ValueDecl *> UDs)
Set the unique declarations that are in the trailing objects of the class.
Stmt - This represents one statement.
This represents clause 'in_reduction' in the '#pragma omp task' directives.
static bool classof(const OMPClause *T)
Class that handles pre-initialization statement for some clauses, like 'shedule', 'firstprivate' etc...
llvm::iterator_range< inits_iterator > inits_range
static bool classof(const OMPClause *T)
helper_expr_range rhs_exprs()
OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'update' clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
helper_expr_const_range rhs_exprs() const
This represents 'grainsize' clause in the '#pragma omp ...' directive.
static bool classof(const OMPClause *T)
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
This represents 'if' clause in the '#pragma omp ...' directive.
helper_expr_const_range assignment_ops() const
OMPSIMDClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'simd' clause.
This represents 'priority' clause in the '#pragma omp ...' directive.
helper_expr_const_range lhs_exprs() const
llvm::iterator_range< private_copies_iterator > private_copies_range
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
Expr * getCondition() const
Returns condition.
This represents 'update' clause in the '#pragma omp atomic' directive.
void setComponents(ArrayRef< MappableComponent > Components, ArrayRef< unsigned > CLSs)
Set the components that are in the trailing objects of the class.
ArrayRef< const Expr * >::iterator private_copies_const_iterator
Expr * getCondition() const
Returns condition.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
MutableArrayRef< Expr * >::iterator helper_expr_iterator
OpenMPDefaultmapClauseModifier
OpenMP modifiers for 'defaultmap' clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
Expr * getAlignment()
Returns alignment.
Expr * getNumForLoops() const
Return the number of associated for-loops.
OMPOrderedClause(Expr *Num, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'ordered' clause.
SourceLocation getSecondScheduleModifierLoc() const
Get the second modifier location.
helper_expr_range rhs_exprs()
ArrayRef< MappableComponent > getComponentsRef() const
Get the components that are in the trailing objects of the class.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
static bool classof(const OMPClause *T)
SourceLocation getDependencyLoc() const
Get dependency type location.
This represents 'read' clause in the '#pragma omp atomic' directive.
helper_expr_const_range assignment_ops() const
OMPFinalClause()
Build an empty clause.
helper_expr_range source_exprs()
This represents clause 'private' in the '#pragma omp ...' directives.
static bool classof(const OMPClause *T)
static bool classof(const OMPClause *T)
This represents 'num_threads' clause in the '#pragma omp ...' directive.
llvm::iterator_range< const_all_num_lists_iterator > const_all_num_lists_range
This represents 'defaultmap' clause in the '#pragma omp ...' directive.
This represents clauses with a list of expressions that are mappable.
llvm::iterator_range< const_all_components_iterator > const_all_components_range
void setUpdates(ArrayRef< Expr *> UL)
Sets the list of update expressions for linear variables.
StmtIterator child_iterator
SourceLocation getColonLoc() const
Return the location of ':'.
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
private_copies_const_range private_copies() const
static bool classof(const OMPClause *T)
OMPNumTasksClause(Expr *Size, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'num_tasks' clause.
unsigned getTotalComponentsNum() const
Return the total number of components in all lists derived from the clause.
OMPNogroupClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'nogroup' clause.
Struct that defines common infrastructure to handle mappable expressions used in OpenMP clauses...
SourceLocation getLParenLoc() const
Returns the location of '('.
Expr * getGrainsize() const
Return safe iteration space distance.
This represents 'nogroup' clause in the '#pragma omp ...' directive.
This represents 'safelen' clause in the '#pragma omp ...' directive.
SourceLocation getLParenLoc() const
Returns the location of '('.
MutableArrayRef< Expr * >::iterator inits_iterator
static bool classof(const OMPClause *T)
OMPHintClause(Expr *Hint, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'hint' clause with expression Hint.
unsigned varlist_size() const
llvm::iterator_range< private_copies_iterator > private_copies_range
This represents clauses with the list of variables like 'private', 'firstprivate', 'copyin', 'shared', or 'reduction' clauses in the '#pragma omp ...' directives.
OMPProcBindClause()
Build an empty clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
llvm::iterator_range< helper_expr_iterator > helper_expr_range
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.
SourceLocation getColonLoc() const
Returns the location of ':'.
This represents 'simd' clause in the '#pragma omp ...' directive.
static bool classof(const OMPClause *T)
llvm::iterator_range< updates_iterator > updates_range
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
MutableArrayRef< Expr *>::iterator varlist_iterator
Expr * getAssociatedExpression() const
static bool classof(const OMPClause *T)
helper_expr_range assignment_ops()
This represents clause 'lastprivate' in the '#pragma omp ...' directives.
OMPSIMDClause()
Build an empty clause.
llvm::iterator_range< helper_expr_iterator > helper_expr_range
OMPPriorityClause(Expr *E, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'priority' clause.
OMPVarListClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N)
Build a clause with N variables.
SourceLocation getLParenLoc() const
Returns the location of '('.
helper_expr_range privates()
varlist_iterator varlist_begin()
ArrayRef< const Expr * >::iterator private_copies_const_iterator
Expr * getChunkSize()
Get chunk size.
This represents clause 'map' in the '#pragma omp ...' directives.
SourceLocation getDefaultKindKwLoc() const
Returns location of clause kind.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
This represents clause 'to' in the '#pragma omp ...' directives.
void setColonLoc(SourceLocation Loc)
Sets the location of ':'.
OMPMappableExprListClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Build a clause for NumUniqueDeclarations declarations, NumComponentLists total component lists...
Defines some OpenMP-specific enums and functions.
Expr * getSafelen() const
Return safe iteration space distance.
OMPPriorityClause()
Build an empty clause.
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
helper_expr_range lhs_exprs()
Expr * getNumTeams()
Return NumTeams number.
llvm::iterator_range< helper_expr_iterator > helper_expr_range
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OMPDefaultmapClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc, SourceLocation KLoc, SourceLocation EndLoc, OpenMPDefaultmapClauseKind Kind, OpenMPDefaultmapClauseModifier M)
Build 'defaultmap' clause with defaultmap kind Kind.
MutableArrayRef< Expr * >::iterator private_copies_iterator
MutableArrayRef< unsigned > getComponentListSizesRef()
Get the cumulative component lists sizes that are in the trailing objects of the class.
MutableArrayRef< Expr * >::iterator helper_expr_iterator
OMPSafelenClause()
Build an empty clause.
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
void setModifierLoc(SourceLocation Loc)
Set modifier location.
void setCalcStep(Expr *CalcStep)
Sets the expression to calculate linear step for clause.
helper_expr_range destination_exprs()
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.