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) {}
105 Stmt *PreInit =
nullptr;
112 assert(
get(This) &&
"get is not tuned for pre-init.");
118 CaptureRegion = ThisRegion;
141 Expr *PostUpdate =
nullptr;
145 assert(
get(This) &&
"get is not tuned for post-update.");
184 :
OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
189 static_cast<T *
>(
this)->
template getTrailingObjects<Expr *>(), NumVars);
194 assert(VL.size() == NumVars &&
195 "Number of variables is not the same as the preallocated buffer");
196 std::copy(VL.begin(), VL.end(),
197 static_cast<T *
>(
this)->
template getTrailingObjects<Expr *>());
229 return llvm::makeArrayRef(
230 static_cast<const T *>(
this)->
template getTrailingObjects<Expr *>(),
249 Stmt *Condition =
nullptr;
261 void setCondition(
Expr *Cond) { Condition = Cond; }
267 void setNameModifierLoc(
SourceLocation Loc) { NameModifierLoc = Loc; }
289 :
OMPClause(OMPC_if, StartLoc, EndLoc), OMPClauseWithPreInit(this),
290 LParenLoc(LParenLoc), Condition(Cond), ColonLoc(ColonLoc),
291 NameModifier(NameModifier), NameModifierLoc(NameModifierLoc) {
292 setPreInitStmt(HelperCond, CaptureRegion);
298 OMPClauseWithPreInit(this) {}
339 Stmt *Condition =
nullptr;
342 void setCondition(
Expr *Cond) { Condition = Cond; }
353 :
OMPClause(OMPC_final, StartLoc, EndLoc), LParenLoc(LParenLoc),
391 Stmt *NumThreads =
nullptr;
394 void setNumThreads(
Expr *NThreads) { NumThreads = NThreads; }
410 :
OMPClause(OMPC_num_threads, StartLoc, EndLoc),
411 OMPClauseWithPreInit(this), LParenLoc(LParenLoc),
412 NumThreads(NumThreads) {
413 setPreInitStmt(HelperNumThreads, CaptureRegion);
419 OMPClauseWithPreInit(this) {}
456 Stmt *Safelen =
nullptr;
459 void setSafelen(
Expr *Len) { Safelen = Len; }
469 :
OMPClause(OMPC_safelen, StartLoc, EndLoc), LParenLoc(LParenLoc),
510 Stmt *Simdlen =
nullptr;
513 void setSimdlen(
Expr *Len) { Simdlen = Len; }
523 :
OMPClause(OMPC_simdlen, StartLoc, EndLoc), LParenLoc(LParenLoc),
564 Stmt *NumForLoops =
nullptr;
567 void setNumForLoops(
Expr *Num) { NumForLoops = Num; }
578 :
OMPClause(OMPC_collapse, StartLoc, EndLoc), LParenLoc(LParenLoc),
628 void setDefaultKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
641 :
OMPClause(OMPC_default, StartLoc, EndLoc), LParenLoc(LParenLoc),
642 Kind(A), KindKwLoc(ALoc) {}
697 void setProcBindKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
711 :
OMPClause(OMPC_proc_bind, StartLoc, EndLoc), LParenLoc(LParenLoc),
712 Kind(A), KindKwLoc(ALoc) {}
756 enum {FIRST, SECOND, NUM_MODIFIERS};
769 Expr *ChunkSize =
nullptr;
780 Modifiers[FIRST] = M;
787 Modifiers[SECOND] = M;
792 ModifiersLoc[FIRST] = Loc;
797 ModifiersLoc[SECOND] = Loc;
805 Modifiers[FIRST] = M;
808 Modifiers[SECOND] = M;
830 void setChunkSize(
Expr *E) { ChunkSize = E; }
851 Expr *ChunkSize,
Stmt *HelperChunkSize,
854 :
OMPClause(OMPC_schedule, StartLoc, EndLoc), OMPClauseWithPreInit(this),
855 LParenLoc(LParenLoc), Kind(Kind), KindLoc(KLoc), CommaLoc(CommaLoc),
856 ChunkSize(ChunkSize) {
857 setPreInitStmt(HelperChunkSize);
858 Modifiers[FIRST] = M1;
859 Modifiers[SECOND] = M2;
860 ModifiersLoc[FIRST] = M1Loc;
861 ModifiersLoc[SECOND] = M2Loc;
867 OMPClauseWithPreInit(this) {
877 return Modifiers[FIRST];
882 return Modifiers[SECOND];
893 return ModifiersLoc[FIRST];
898 return ModifiersLoc[SECOND];
911 return child_range(reinterpret_cast<Stmt **>(&ChunkSize),
912 reinterpret_cast<Stmt **>(&ChunkSize) + 1);
937 Stmt *NumForLoops =
nullptr;
940 unsigned NumberOfLoops = 0;
951 :
OMPClause(OMPC_ordered, StartLoc, EndLoc), LParenLoc(LParenLoc),
952 NumForLoops(Num), NumberOfLoops(NumLoops) {}
957 NumberOfLoops(NumLoops) {}
960 void setNumForLoops(
Expr *Num) { NumForLoops = Num; }
988 void setLoopNumIterations(
unsigned NumLoop,
Expr *NumIterations);
993 void setLoopCounter(
unsigned NumLoop,
Expr *Counter);
995 Expr *getLoopCunter(
unsigned NumLoop);
996 const Expr *getLoopCunter(
unsigned NumLoop)
const;
1018 :
OMPClause(OMPC_nowait, StartLoc, EndLoc) {}
1046 :
OMPClause(OMPC_untied, StartLoc, EndLoc) {}
1075 :
OMPClause(OMPC_mergeable, StartLoc, EndLoc) {}
1103 :
OMPClause(OMPC_read, StartLoc, EndLoc) {}
1130 :
OMPClause(OMPC_write, StartLoc, EndLoc) {}
1159 :
OMPClause(OMPC_update, StartLoc, EndLoc) {}
1188 :
OMPClause(OMPC_capture, StartLoc, EndLoc) {}
1217 :
OMPClause(OMPC_seq_cst, StartLoc, EndLoc) {}
1276 return llvm::makeArrayRef(varlist_end(), varlist_size());
1303 llvm::iterator_range<private_copies_const_iterator>;
1307 getPrivateCopies().end());
1312 getPrivateCopies().end());
1316 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1317 reinterpret_cast<Stmt **>(varlist_end()));
1335 public OMPClauseWithPreInit,
1350 LParenLoc, EndLoc, N),
1351 OMPClauseWithPreInit(this) {}
1360 OMPClauseWithPreInit(this) {}
1373 return llvm::makeArrayRef(varlist_end(), varlist_size());
1387 return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
1419 llvm::iterator_range<private_copies_const_iterator>;
1423 getPrivateCopies().end());
1427 getPrivateCopies().end());
1443 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1444 reinterpret_cast<Stmt **>(varlist_end()));
1462 public OMPClauseWithPostUpdate,
1493 LParenLoc, EndLoc, N),
1494 OMPClauseWithPostUpdate(this) {}
1503 OMPClauseWithPostUpdate(this) {}
1511 return llvm::makeArrayRef(varlist_end(), varlist_size());
1525 return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
1539 return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
1552 return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
1596 llvm::iterator_range<helper_expr_const_iterator>;
1604 getPrivateCopies().end());
1609 getPrivateCopies().end());
1614 getSourceExprs().end());
1623 getDestinationExprs().end());
1628 getDestinationExprs().end());
1633 getAssignmentOps().end());
1638 getAssignmentOps().end());
1642 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1643 reinterpret_cast<Stmt **>(varlist_end()));
1702 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1703 reinterpret_cast<Stmt **>(varlist_end()));
1721 public OMPClauseWithPostUpdate,
1750 LParenLoc, EndLoc, N),
1751 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
1752 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
1761 OMPClauseWithPostUpdate(this) {}
1782 return llvm::makeArrayRef(varlist_end(), varlist_size());
1795 return llvm::makeArrayRef(
getPrivates().end(), varlist_size());
1810 return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
1824 return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
1887 llvm::iterator_range<helper_expr_const_iterator>;
1915 getReductionOps().end());
1920 getReductionOps().end());
1924 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1925 reinterpret_cast<Stmt **>(varlist_end()));
1943 public OMPClauseWithPostUpdate,
1972 LParenLoc, EndLoc, N),
1973 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
1974 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
1983 OMPClauseWithPostUpdate(this) {}
2003 return llvm::makeArrayRef(varlist_end(), varlist_size());
2016 return llvm::makeArrayRef(
getPrivates().end(), varlist_size());
2030 return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
2044 return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
2107 llvm::iterator_range<helper_expr_const_iterator>;
2135 getReductionOps().end());
2140 getReductionOps().end());
2144 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2145 reinterpret_cast<Stmt **>(varlist_end()));
2162 public OMPClauseWithPostUpdate,
2191 LParenLoc, EndLoc, N),
2192 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
2193 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
2202 OMPClauseWithPostUpdate(this) {}
2222 return llvm::makeArrayRef(varlist_end(), varlist_size());
2235 return llvm::makeArrayRef(
getPrivates().end(), varlist_size());
2249 return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
2263 return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
2274 return llvm::makeArrayRef(getReductionOps().end(), varlist_size());
2340 llvm::iterator_range<helper_expr_const_iterator>;
2368 getReductionOps().end());
2373 getReductionOps().end());
2378 getTaskgroupDescriptors().end());
2383 getTaskgroupDescriptors().end());
2387 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2388 reinterpret_cast<Stmt **>(varlist_end()));
2406 public OMPClauseWithPostUpdate,
2440 OMPClauseWithPostUpdate(this), Modifier(Modifier),
2441 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc) {}
2450 OMPClauseWithPostUpdate(this) {}
2468 return llvm::makeArrayRef(varlist_end(), varlist_size());
2475 return llvm::makeArrayRef(
getPrivates().end(), varlist_size());
2483 return llvm::makeArrayRef(
getInits().end(), varlist_size());
2491 return llvm::makeArrayRef(
getUpdates().end(), varlist_size());
2626 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2627 reinterpret_cast<Stmt **>(varlist_end()));
2654 void setAlignment(Expr *A) { *varlist_end() = A; }
2664 SourceLocation ColonLoc, SourceLocation EndLoc,
2668 ColonLoc(ColonLoc) {}
2675 SourceLocation(), SourceLocation(),
2689 SourceLocation LParenLoc,
2690 SourceLocation ColonLoc,
2691 SourceLocation EndLoc, ArrayRef<Expr *> VL,
2713 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2714 reinterpret_cast<Stmt **>(varlist_end()));
2718 return T->getClauseKind() == OMPC_aligned;
2756 SourceLocation EndLoc,
unsigned N)
2765 SourceLocation(), SourceLocation(),
2771 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
2774 MutableArrayRef<Expr *> getSourceExprs() {
2775 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2777 ArrayRef<const Expr *> getSourceExprs()
const {
2778 return llvm::makeArrayRef(varlist_end(), varlist_size());
2784 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
2787 MutableArrayRef<Expr *> getDestinationExprs() {
2788 return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
2790 ArrayRef<const Expr *> getDestinationExprs()
const {
2791 return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
2798 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
2801 MutableArrayRef<Expr *> getAssignmentOps() {
2802 return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
2804 ArrayRef<const Expr *> getAssignmentOps()
const {
2805 return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
2831 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
2832 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
2833 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
2845 llvm::iterator_range<helper_expr_const_iterator>;
2849 getSourceExprs().end());
2858 getDestinationExprs().end());
2863 getDestinationExprs().end());
2868 getAssignmentOps().end());
2873 getAssignmentOps().end());
2877 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2878 reinterpret_cast<Stmt **>(varlist_end()));
2882 return T->getClauseKind() == OMPC_copyin;
2908 SourceLocation EndLoc,
unsigned N)
2910 LParenLoc, EndLoc, N) {}
2917 OMPC_copyprivate, SourceLocation(), SourceLocation(),
2918 SourceLocation(), N) {}
2923 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
2926 MutableArrayRef<Expr *> getSourceExprs() {
2927 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2929 ArrayRef<const Expr *> getSourceExprs()
const {
2930 return llvm::makeArrayRef(varlist_end(), varlist_size());
2936 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
2939 MutableArrayRef<Expr *> getDestinationExprs() {
2940 return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
2942 ArrayRef<const Expr *> getDestinationExprs()
const {
2943 return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
2950 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
2953 MutableArrayRef<Expr *> getAssignmentOps() {
2954 return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
2956 ArrayRef<const Expr *> getAssignmentOps()
const {
2957 return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
2982 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
2983 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
2984 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
2996 llvm::iterator_range<helper_expr_const_iterator>;
3000 getSourceExprs().end());
3009 getDestinationExprs().end());
3014 getDestinationExprs().end());
3019 getAssignmentOps().end());
3024 getAssignmentOps().end());
3028 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3029 reinterpret_cast<Stmt **>(varlist_end()));
3033 return T->getClauseKind() == OMPC_copyprivate;
3061 OMPFlushClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3062 SourceLocation EndLoc,
unsigned N)
3063 : OMPVarListClause<OMPFlushClause>(OMPC_flush, StartLoc, LParenLoc,
3070 : OMPVarListClause<OMPFlushClause>(OMPC_flush, SourceLocation(),
3071 SourceLocation(), SourceLocation(),
3083 SourceLocation LParenLoc, SourceLocation EndLoc,
3084 ArrayRef<Expr *> VL);
3093 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3094 reinterpret_cast<Stmt **>(varlist_end()));
3098 return T->getClauseKind() == OMPC_flush;
3121 SourceLocation DepLoc;
3127 unsigned NumLoops = 0;
3138 SourceLocation EndLoc,
unsigned N,
unsigned NumLoops)
3140 EndLoc, N), NumLoops(NumLoops) {}
3149 SourceLocation(), SourceLocation(),
3151 NumLoops(NumLoops) {}
3157 void setDependencyLoc(SourceLocation Loc) { DepLoc = Loc; }
3160 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
3176 SourceLocation LParenLoc,
3177 SourceLocation EndLoc,
3179 SourceLocation DepLoc, SourceLocation ColonLoc,
3180 ArrayRef<Expr *> VL,
unsigned NumLoops);
3205 void setLoopData(
unsigned NumLoop, Expr *Cnt);
3208 Expr *getLoopData(
unsigned NumLoop);
3209 const Expr *getLoopData(
unsigned NumLoop)
const;
3212 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3213 reinterpret_cast<Stmt **>(varlist_end()));
3217 return T->getClauseKind() == OMPC_depend;
3233 SourceLocation LParenLoc;
3236 Stmt *Device =
nullptr;
3241 void setDevice(Expr *E) { Device = E; }
3253 SourceLocation StartLoc, SourceLocation LParenLoc,
3254 SourceLocation EndLoc)
3255 :
OMPClause(OMPC_device, StartLoc, EndLoc), OMPClauseWithPreInit(this),
3256 LParenLoc(LParenLoc), Device(E) {
3257 setPreInitStmt(HelperE, CaptureRegion);
3262 :
OMPClause(OMPC_device, SourceLocation(), SourceLocation()),
3263 OMPClauseWithPreInit(this) {}
3280 return T->getClauseKind() == OMPC_device;
3297 :
OMPClause(OMPC_threads, StartLoc, EndLoc) {}
3301 :
OMPClause(OMPC_threads, SourceLocation(), SourceLocation()) {}
3308 return T->getClauseKind() == OMPC_threads;
3325 :
OMPClause(OMPC_simd, StartLoc, EndLoc) {}
3335 return T->getClauseKind() == OMPC_simd;
3351 Expr *AssociatedExpression =
nullptr;
3356 ValueDecl *AssociatedDeclaration =
nullptr;
3361 ValueDecl *AssociatedDeclaration)
3362 : AssociatedExpression(AssociatedExpression),
3363 AssociatedDeclaration(
3364 AssociatedDeclaration
3371 return AssociatedDeclaration;
3394 getUniqueDeclarationsTotalNumber(ArrayRef<const ValueDecl *> Declarations);
3407 unsigned NumUniqueDeclarations;
3410 unsigned NumComponentLists;
3413 unsigned NumComponents;
3431 SourceLocation LParenLoc, SourceLocation EndLoc,
3432 unsigned NumVars,
unsigned NumUniqueDeclarations,
3433 unsigned NumComponentLists,
unsigned NumComponents)
3435 NumUniqueDeclarations(NumUniqueDeclarations),
3436 NumComponentLists(NumComponentLists), NumComponents(NumComponents) {}
3441 return MutableArrayRef<ValueDecl *>(
3442 static_cast<T *
>(
this)->
template getTrailingObjects<ValueDecl *>(),
3443 NumUniqueDeclarations);
3449 return ArrayRef<ValueDecl *>(
3450 static_cast<const T *
>(
this)
3451 ->
template getTrailingObjects<ValueDecl *>(),
3452 NumUniqueDeclarations);
3458 assert(UDs.size() == NumUniqueDeclarations &&
3459 "Unexpected amount of unique declarations.");
3460 std::copy(UDs.begin(), UDs.end(), getUniqueDeclsRef().begin());
3466 return MutableArrayRef<unsigned>(
3467 static_cast<T *
>(
this)->
template getTrailingObjects<unsigned>(),
3468 NumUniqueDeclarations);
3474 return ArrayRef<unsigned>(
3475 static_cast<const T *
>(
this)->
template getTrailingObjects<unsigned>(),
3476 NumUniqueDeclarations);
3482 assert(DNLs.size() == NumUniqueDeclarations &&
3483 "Unexpected amount of list numbers.");
3484 std::copy(DNLs.begin(), DNLs.end(), getDeclNumListsRef().begin());
3490 return MutableArrayRef<unsigned>(
3491 static_cast<T *
>(
this)->
template getTrailingObjects<unsigned>() +
3492 NumUniqueDeclarations,
3499 return ArrayRef<unsigned>(
3500 static_cast<const T *
>(
this)->
template getTrailingObjects<unsigned>() +
3501 NumUniqueDeclarations,
3508 assert(CLSs.size() == NumComponentLists &&
3509 "Unexpected amount of component lists.");
3510 std::copy(CLSs.begin(), CLSs.end(), getComponentListSizesRef().begin());
3515 return MutableArrayRef<MappableComponent>(
3516 static_cast<T *
>(
this)
3517 ->
template getTrailingObjects<MappableComponent>(),
3523 return ArrayRef<MappableComponent>(
3524 static_cast<const T *
>(
this)
3525 ->
template getTrailingObjects<MappableComponent>(),
3533 ArrayRef<unsigned> CLSs) {
3534 assert(Components.size() == NumComponents &&
3535 "Unexpected amount of component lists.");
3536 assert(CLSs.size() == NumComponentLists &&
3537 "Unexpected amount of list sizes.");
3538 std::copy(Components.begin(), Components.end(), getComponentsRef().begin());
3547 assert(getUniqueDeclarationsTotalNumber(Declarations) ==
3548 NumUniqueDeclarations &&
3549 "Unexpected number of mappable expression info entries!");
3550 assert(getComponentsTotalNumber(ComponentLists) == NumComponents &&
3551 "Unexpected total number of components!");
3552 assert(Declarations.size() == ComponentLists.size() &&
3553 "Declaration and component lists size is not consistent!");
3554 assert(Declarations.size() == NumComponentLists &&
3555 "Unexpected declaration and component lists size!");
3560 llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
3563 auto CI = ComponentLists.begin();
3564 for (
auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
3566 assert(!CI->empty() &&
"Invalid component list!");
3567 ComponentListMap[*DI].push_back(*CI);
3572 auto UniqueDeclarations = getUniqueDeclsRef();
3573 auto UDI = UniqueDeclarations.begin();
3575 auto DeclNumLists = getDeclNumListsRef();
3576 auto DNLI = DeclNumLists.begin();
3578 auto ComponentListSizes = getComponentListSizesRef();
3579 auto CLSI = ComponentListSizes.begin();
3581 auto Components = getComponentsRef();
3582 auto CI = Components.begin();
3585 unsigned PrevSize = 0u;
3588 for (
auto &M : ComponentListMap) {
3605 PrevSize +=
C.size();
3612 CI = std::copy(
C.begin(),
C.end(), CI);
3631 :
public llvm::iterator_adaptor_base<
3632 const_component_lists_iterator,
3633 MappableExprComponentListRef::const_iterator,
3634 std::forward_iterator_tag, MappableComponent, ptrdiff_t,
3635 MappableComponent, MappableComponent> {
3637 ArrayRef<ValueDecl *>::iterator DeclCur;
3640 ArrayRef<unsigned>::iterator NumListsCur;
3643 unsigned RemainingLists = 0;
3647 unsigned PrevListSize = 0;
3651 ArrayRef<unsigned>::const_iterator ListSizeCur;
3652 ArrayRef<unsigned>::const_iterator ListSizeEnd;
3655 MappableExprComponentListRef::const_iterator
End;
3660 ArrayRef<ValueDecl *> UniqueDecls, ArrayRef<unsigned> DeclsListNum,
3661 ArrayRef<unsigned> CumulativeListSizes,
3664 Components.begin()),
3665 DeclCur(UniqueDecls.begin()), NumListsCur(DeclsListNum.begin()),
3666 ListSizeCur(CumulativeListSizes.begin()),
3667 ListSizeEnd(CumulativeListSizes.end()), End(Components.end()) {
3668 assert(UniqueDecls.size() == DeclsListNum.size() &&
3669 "Inconsistent number of declarations and list sizes!");
3670 if (!DeclsListNum.empty())
3671 RemainingLists = *NumListsCur;
3677 const ValueDecl *Declaration, ArrayRef<ValueDecl *> UniqueDecls,
3678 ArrayRef<unsigned> DeclsListNum, ArrayRef<unsigned> CumulativeListSizes,
3681 CumulativeListSizes, Components) {
3685 for (; DeclCur != UniqueDecls.end(); ++DeclCur, ++NumListsCur) {
3686 if (*DeclCur == Declaration)
3689 assert(*NumListsCur > 0 &&
"No lists associated with declaration??");
3693 std::advance(ListSizeCur, *NumListsCur - 1);
3694 PrevListSize = *ListSizeCur;
3700 if (ListSizeCur == CumulativeListSizes.end()) {
3702 RemainingLists = 0u;
3708 RemainingLists = *NumListsCur;
3711 ListSizeEnd = ListSizeCur;
3712 std::advance(ListSizeEnd, RemainingLists);
3716 std::advance(this->I, PrevListSize);
3721 std::pair<const ValueDecl *, MappableExprComponentListRef>
3723 assert(ListSizeCur != ListSizeEnd &&
"Invalid iterator!");
3724 return std::make_pair(
3728 std::pair<const ValueDecl *, MappableExprComponentListRef>
3735 assert(ListSizeCur != ListSizeEnd && RemainingLists &&
3736 "Invalid iterator!");
3740 if (std::next(ListSizeCur) == ListSizeEnd) {
3744 std::advance(this->I, *ListSizeCur - PrevListSize);
3745 PrevListSize = *ListSizeCur;
3748 if (!(--RemainingLists)) {
3751 RemainingLists = *NumListsCur;
3752 assert(RemainingLists &&
"No lists in the following declaration??");
3762 llvm::iterator_range<const_component_lists_iterator>;
3766 return const_component_lists_iterator(
3767 getUniqueDeclsRef(), getDeclNumListsRef(), getComponentListSizesRef(),
3768 getComponentsRef());
3771 return const_component_lists_iterator(
3772 ArrayRef<ValueDecl *>(), ArrayRef<unsigned>(), ArrayRef<unsigned>(),
3774 getComponentsRef().end()));
3777 return {component_lists_begin(), component_lists_end()};
3782 const_component_lists_iterator
3784 return const_component_lists_iterator(
3785 VD, getUniqueDeclsRef(), getDeclNumListsRef(),
3786 getComponentListSizesRef(), getComponentsRef());
3789 return component_lists_end();
3792 return {decl_component_lists_begin(VD), decl_component_lists_end()};
3801 auto A = getUniqueDeclsRef();
3807 llvm::iterator_range<const_all_num_lists_iterator>;
3810 auto A = getDeclNumListsRef();
3816 llvm::iterator_range<const_all_lists_sizes_iterator>;
3819 auto A = getComponentListSizesRef();
3825 llvm::iterator_range<const_all_components_iterator>;
3828 auto A = getComponentsRef();
3843 OMPMapClause, Expr *, ValueDecl *, unsigned,
3844 OMPClauseMappableExprCommon::MappableComponent> {
3852 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
3853 return varlist_size();
3855 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
3856 return getUniqueDeclarationsNum();
3858 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
3859 return getUniqueDeclarationsNum() + getTotalComponentListNum();
3869 bool MapTypeIsImplicit =
false;
3872 SourceLocation MapLoc;
3894 SourceLocation MapLoc, SourceLocation StartLoc,
3895 SourceLocation LParenLoc, SourceLocation EndLoc,
3896 unsigned NumVars,
unsigned NumUniqueDeclarations,
3897 unsigned NumComponentLists,
unsigned NumComponents)
3899 NumVars, NumUniqueDeclarations,
3900 NumComponentLists, NumComponents),
3901 MapTypeModifier(MapTypeModifier), MapType(MapType),
3902 MapTypeIsImplicit(MapTypeIsImplicit), MapLoc(MapLoc) {}
3911 explicit OMPMapClause(
unsigned NumVars,
unsigned NumUniqueDeclarations,
3912 unsigned NumComponentLists,
unsigned NumComponents)
3914 OMPC_map, SourceLocation(), SourceLocation(), SourceLocation(),
3915 NumVars, NumUniqueDeclarations, NumComponentLists, NumComponents) {}
3930 void setMapLoc(SourceLocation TLoc) { MapLoc = TLoc; }
3933 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
3949 SourceLocation LParenLoc, SourceLocation EndLoc,
3950 ArrayRef<Expr *> Vars,
3951 ArrayRef<ValueDecl *> Declarations,
3955 SourceLocation TypeLoc);
3969 unsigned NumUniqueDeclarations,
3970 unsigned NumComponentLists,
3971 unsigned NumComponents);
3985 return MapTypeModifier;
3989 SourceLocation
getMapLoc() const LLVM_READONLY {
return MapLoc; }
3996 reinterpret_cast<Stmt **>(varlist_begin()),
3997 reinterpret_cast<Stmt **>(varlist_end()));
4001 return T->getClauseKind() == OMPC_map;
4017 SourceLocation LParenLoc;
4020 Stmt *NumTeams =
nullptr;
4025 void setNumTeams(Expr *E) { NumTeams = E; }
4038 SourceLocation StartLoc, SourceLocation LParenLoc,
4039 SourceLocation EndLoc)
4040 :
OMPClause(OMPC_num_teams, StartLoc, EndLoc), OMPClauseWithPreInit(this),
4041 LParenLoc(LParenLoc), NumTeams(E) {
4042 setPreInitStmt(HelperE, CaptureRegion);
4047 :
OMPClause(OMPC_num_teams, SourceLocation(), SourceLocation()),
4048 OMPClauseWithPreInit(this) {}
4065 return T->getClauseKind() == OMPC_num_teams;
4081 SourceLocation LParenLoc;
4084 Stmt *ThreadLimit =
nullptr;
4089 void setThreadLimit(Expr *E) { ThreadLimit = E; }
4103 SourceLocation StartLoc, SourceLocation LParenLoc,
4104 SourceLocation EndLoc)
4105 :
OMPClause(OMPC_thread_limit, StartLoc, EndLoc),
4106 OMPClauseWithPreInit(this), LParenLoc(LParenLoc), ThreadLimit(E) {
4107 setPreInitStmt(HelperE, CaptureRegion);
4112 :
OMPClause(OMPC_thread_limit, SourceLocation(), SourceLocation()),
4113 OMPClauseWithPreInit(this) {}
4130 return T->getClauseKind() == OMPC_thread_limit;
4146 SourceLocation LParenLoc;
4149 Stmt *Priority =
nullptr;
4154 void setPriority(Expr *E) { Priority = E; }
4164 SourceLocation EndLoc)
4165 :
OMPClause(OMPC_priority, StartLoc, EndLoc), LParenLoc(LParenLoc),
4170 :
OMPClause(OMPC_priority, SourceLocation(), SourceLocation()) {}
4187 return T->getClauseKind() == OMPC_priority;
4203 SourceLocation LParenLoc;
4206 Stmt *Grainsize =
nullptr;
4209 void setGrainsize(Expr *Size) { Grainsize = Size; }
4218 SourceLocation LParenLoc, SourceLocation EndLoc)
4219 :
OMPClause(OMPC_grainsize, StartLoc, EndLoc), LParenLoc(LParenLoc),
4224 :
OMPClause(OMPC_grainsize, SourceLocation(), SourceLocation()) {}
4238 return T->getClauseKind() == OMPC_grainsize;
4255 :
OMPClause(OMPC_nogroup, StartLoc, EndLoc) {}
4259 :
OMPClause(OMPC_nogroup, SourceLocation(), SourceLocation()) {}
4266 return T->getClauseKind() == OMPC_nogroup;
4282 SourceLocation LParenLoc;
4285 Stmt *NumTasks =
nullptr;
4288 void setNumTasks(Expr *Size) { NumTasks = Size; }
4297 SourceLocation LParenLoc, SourceLocation EndLoc)
4298 :
OMPClause(OMPC_num_tasks, StartLoc, EndLoc), LParenLoc(LParenLoc),
4303 :
OMPClause(OMPC_num_tasks, SourceLocation(), SourceLocation()) {}
4317 return T->getClauseKind() == OMPC_num_tasks;
4332 SourceLocation LParenLoc;
4335 Stmt *Hint =
nullptr;
4338 void setHint(Expr *H) { Hint = H; }
4348 SourceLocation EndLoc)
4349 :
OMPClause(OMPC_hint, StartLoc, EndLoc), LParenLoc(LParenLoc),
4362 Expr *
getHint()
const {
return cast_or_null<Expr>(Hint); }
4367 return T->getClauseKind() == OMPC_hint;
4383 SourceLocation LParenLoc;
4389 SourceLocation KindLoc;
4392 SourceLocation CommaLoc;
4395 Expr *ChunkSize =
nullptr;
4405 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
4410 void setDistScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
4415 void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
4420 void setChunkSize(Expr *E) { ChunkSize = E; }
4435 SourceLocation KLoc, SourceLocation CommaLoc,
4436 SourceLocation EndLoc,
4438 Stmt *HelperChunkSize)
4439 :
OMPClause(OMPC_dist_schedule, StartLoc, EndLoc),
4440 OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Kind(Kind),
4441 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
4442 setPreInitStmt(HelperChunkSize);
4447 :
OMPClause(OMPC_dist_schedule, SourceLocation(), SourceLocation()),
4448 OMPClauseWithPreInit(this) {}
4469 return child_range(reinterpret_cast<Stmt **>(&ChunkSize),
4470 reinterpret_cast<Stmt **>(&ChunkSize) + 1);
4474 return T->getClauseKind() == OMPC_dist_schedule;
4489 SourceLocation LParenLoc;
4501 SourceLocation KindLoc;
4516 void setDefaultmapModifierLoc(SourceLocation Loc) {
4523 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
4528 void setDefaultmapKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
4541 SourceLocation MLoc, SourceLocation KLoc,
4544 :
OMPClause(OMPC_defaultmap, StartLoc, EndLoc), LParenLoc(LParenLoc),
4545 Modifier(M), ModifierLoc(MLoc), Kind(Kind), KindLoc(KLoc) {}
4549 :
OMPClause(OMPC_defaultmap, SourceLocation(), SourceLocation()) {}
4575 return T->getClauseKind() == OMPC_defaultmap;
4589 OMPToClause, Expr *, ValueDecl *, unsigned,
4590 OMPClauseMappableExprCommon::MappableComponent> {
4605 explicit OMPToClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4606 SourceLocation EndLoc,
unsigned NumVars,
4607 unsigned NumUniqueDeclarations,
4608 unsigned NumComponentLists,
unsigned NumComponents)
4610 NumUniqueDeclarations, NumComponentLists,
4620 explicit OMPToClause(
unsigned NumVars,
unsigned NumUniqueDeclarations,
4621 unsigned NumComponentLists,
unsigned NumComponents)
4623 OMPC_to, SourceLocation(), SourceLocation(), SourceLocation(),
4624 NumVars, NumUniqueDeclarations, NumComponentLists, NumComponents) {}
4628 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4629 return varlist_size();
4631 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
4632 return getUniqueDeclarationsNum();
4634 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
4635 return getUniqueDeclarationsNum() + getTotalComponentListNum();
4648 SourceLocation LParenLoc, SourceLocation EndLoc,
4649 ArrayRef<Expr *> Vars,
4650 ArrayRef<ValueDecl *> Declarations,
4663 unsigned NumUniqueDeclarations,
4664 unsigned NumComponentLists,
4665 unsigned NumComponents);
4668 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
4669 reinterpret_cast<Stmt **>(varlist_end()));
4673 return T->getClauseKind() == OMPC_to;
4688 OMPFromClause, Expr *, ValueDecl *, unsigned,
4689 OMPClauseMappableExprCommon::MappableComponent> {
4704 explicit OMPFromClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4705 SourceLocation EndLoc,
unsigned NumVars,
4706 unsigned NumUniqueDeclarations,
4707 unsigned NumComponentLists,
unsigned NumComponents)
4709 NumVars, NumUniqueDeclarations,
4710 NumComponentLists, NumComponents) {}
4719 explicit OMPFromClause(
unsigned NumVars,
unsigned NumUniqueDeclarations,
4720 unsigned NumComponentLists,
unsigned NumComponents)
4722 OMPC_from, SourceLocation(), SourceLocation(), SourceLocation(),
4723 NumVars, NumUniqueDeclarations, NumComponentLists, NumComponents) {}
4727 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4728 return varlist_size();
4730 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
4731 return getUniqueDeclarationsNum();
4733 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
4734 return getUniqueDeclarationsNum() + getTotalComponentListNum();
4747 SourceLocation LParenLoc, SourceLocation EndLoc,
4748 ArrayRef<Expr *> Vars,
4749 ArrayRef<ValueDecl *> Declarations,
4762 unsigned NumUniqueDeclarations,
4763 unsigned NumComponentLists,
4764 unsigned NumComponents);
4767 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
4768 reinterpret_cast<Stmt **>(varlist_end()));
4772 return T->getClauseKind() == OMPC_from;
4787 OMPUseDevicePtrClause, Expr *, ValueDecl *, unsigned,
4788 OMPClauseMappableExprCommon::MappableComponent> {
4804 SourceLocation LParenLoc,
4805 SourceLocation EndLoc,
unsigned NumVars,
4806 unsigned NumUniqueDeclarations,
4807 unsigned NumComponentLists,
4808 unsigned NumComponents)
4810 EndLoc, NumVars, NumUniqueDeclarations,
4811 NumComponentLists, NumComponents) {}
4821 unsigned NumUniqueDeclarations,
4822 unsigned NumComponentLists,
4823 unsigned NumComponents)
4825 SourceLocation(), SourceLocation(), NumVars,
4826 NumUniqueDeclarations, NumComponentLists,
4831 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4832 return 3 * varlist_size();
4834 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
4835 return getUniqueDeclarationsNum();
4837 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
4838 return getUniqueDeclarationsNum() + getTotalComponentListNum();
4844 void setPrivateCopies(ArrayRef<Expr *> VL);
4848 MutableArrayRef<Expr *> getPrivateCopies() {
4849 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
4851 ArrayRef<const Expr *> getPrivateCopies()
const {
4852 return llvm::makeArrayRef(varlist_end(), varlist_size());
4858 void setInits(ArrayRef<Expr *> VL);
4862 MutableArrayRef<Expr *>
getInits() {
4863 return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
4865 ArrayRef<const Expr *>
getInits()
const {
4866 return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
4881 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
4882 SourceLocation EndLoc, ArrayRef<Expr *> Vars,
4883 ArrayRef<Expr *> PrivateVars, ArrayRef<Expr *>
Inits,
4884 ArrayRef<ValueDecl *> Declarations,
4898 unsigned NumUniqueDeclarations,
4899 unsigned NumComponentLists,
4900 unsigned NumComponents);
4906 llvm::iterator_range<private_copies_const_iterator>;
4910 getPrivateCopies().end());
4915 getPrivateCopies().end());
4932 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
4933 reinterpret_cast<Stmt **>(varlist_end()));
4937 return T->getClauseKind() == OMPC_use_device_ptr;
4952 OMPIsDevicePtrClause, Expr *, ValueDecl *, unsigned,
4953 OMPClauseMappableExprCommon::MappableComponent> {
4969 SourceLocation LParenLoc, SourceLocation EndLoc,
4971 unsigned NumUniqueDeclarations,
4972 unsigned NumComponentLists,
4973 unsigned NumComponents)
4975 EndLoc, NumVars, NumUniqueDeclarations,
4976 NumComponentLists, NumComponents) {}
4986 unsigned NumUniqueDeclarations,
4987 unsigned NumComponentLists,
4988 unsigned NumComponents)
4990 SourceLocation(), SourceLocation(), NumVars,
4991 NumUniqueDeclarations, NumComponentLists,
4996 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4997 return varlist_size();
4999 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
5000 return getUniqueDeclarationsNum();
5002 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
5003 return getUniqueDeclarationsNum() + getTotalComponentListNum();
5016 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
5017 SourceLocation EndLoc, ArrayRef<Expr *> Vars,
5018 ArrayRef<ValueDecl *> Declarations,
5032 unsigned NumUniqueDeclarations,
5033 unsigned NumComponentLists,
5034 unsigned NumComponents);
5037 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
5038 reinterpret_cast<Stmt **>(varlist_end()));
5042 return T->getClauseKind() == OMPC_is_device_ptr;
5048 #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.
SourceLocation getLocEnd() const LLVM_READONLY
Returns the ending location of the 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.
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.
helper_expr_range privates()
SourceLocation getDefaultmapKindLoc()
Get kind location.
MutableArrayRef< Expr * >::iterator private_copies_iterator
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
const Stmt * getPreInitStmt() const
Get pre-initialization statement for the clause.
ValueDecl * getAssociatedDeclaration() const
static bool classof(const OMPClause *T)
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OMPDistScheduleClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation KLoc, SourceLocation CommaLoc, SourceLocation EndLoc, OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize, Stmt *HelperChunkSize)
Build 'dist_schedule' clause with schedule kind Kind and chunk size expression ChunkSize.
static bool classof(const OMPClause *T)
const_component_lists_iterator(const ValueDecl *Declaration, ArrayRef< ValueDecl *> UniqueDecls, ArrayRef< unsigned > DeclsListNum, ArrayRef< unsigned > CumulativeListSizes, MappableExprComponentListRef Components)
Construct an iterator that scan lists for a given declaration Declaration.
Class that handles post-update expression for some clauses, like 'lastprivate', 'reduction' etc...
SmallVector< MappableComponent, 8 > MappableExprComponentList
helper_expr_range lhs_exprs()
This represents 'default' clause in the '#pragma omp ...' directive.
OMPProcBindClause(OpenMPProcBindClauseKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'proc_bind' clause with argument A ('master', 'close' or 'spread').
OMPWriteClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'write' clause.
Expr * getPriority() const
Return Priority number.
This represents 'final' clause in the '#pragma omp ...' directive.
This represents 'mergeable' clause in the '#pragma omp ...' directive.
const_component_lists_iterator decl_component_lists_begin(const ValueDecl *VD) const
Iterators for component lists associated with the provided declaration.
ArrayRef< MappableComponent > MappableExprComponentListRef
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
OpenMPDependClauseKind getDependencyKind() const
Get dependency type.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
MutableArrayRef< Expr * >::iterator helper_expr_iterator
This represents clause 'reduction' in the '#pragma omp ...' directives.
void setPrivates(ArrayRef< Expr *> PL)
Sets the list of the copies of original linear variables.
OMPNogroupClause()
Build an empty clause.
const_component_lists_range decl_component_lists(const ValueDecl *VD) const
SourceLocation getDefaultmapModifierLoc() const
Get the modifier location.
ArrayRef< const Expr * >::iterator private_copies_const_iterator
helper_expr_const_range source_exprs() const
void setColonLoc(SourceLocation Loc)
Sets the location of ':'.
static bool classof(const OMPClause *T)
This represents clause 'is_device_ptr' in the '#pragma omp ...' directives.
MutableArrayRef< Expr * >::iterator helper_expr_iterator
unsigned getUniqueDeclarationsNum() const
Return the number of unique base declarations in this clause.
Expr * getPostUpdateExpr()
Get post-update expression for the clause.
Expr * getDevice() const
Return device number.
helper_expr_const_range source_exprs() const
void setFinals(ArrayRef< Expr *> FL)
Sets the list of final update expressions for linear variables.
static bool classof(const OMPClause *T)
llvm::iterator_range< helper_expr_iterator > helper_expr_range
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
OMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'seq_cst' clause.
void setModifier(OpenMPLinearClauseKind Kind)
Set modifier.
helper_expr_const_range privates() const
private_copies_range private_copies()
This represents clause 'from' in the '#pragma omp ...' directives.
static bool classof(const OMPClause *T)
OMPScheduleClause()
Build an empty clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
OMPGrainsizeClause(Expr *Size, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'grainsize' clause.
helper_expr_const_range reduction_ops() const
OMPCollapseClause(Expr *Num, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'collapse' clause.
static bool classof(const OMPClause *)
OMPDistScheduleClause()
Build an empty clause.
static bool classof(const OMPClause *T)
OpenMPDefaultClauseKind getDefaultKind() const
Returns kind of the clause.
OMPLinearClause(SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, unsigned NumVars)
Build 'linear' clause with given number of variables NumVars.
This represents 'threads' clause in the '#pragma omp ...' directive.
helper_expr_const_range destination_exprs() const
Expr * getSimdlen() const
Return safe iteration space distance.
friend class OMPClauseReader
helper_expr_range assignment_ops()
helper_expr_const_range source_exprs() const
OMPNowaitClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'nowait' clause.
This represents clause 'aligned' in the '#pragma omp ...' directives.
OpenMPClauseKind getClauseKind() const
Returns kind of OpenMP clause (private, shared, reduction, etc.).
static bool classof(const OMPClause *T)
void setLocEnd(SourceLocation Loc)
Sets the ending location of the clause.
OMPWriteClause()
Build an empty clause.
static bool classof(const OMPClause *T)
OMPCaptureClause()
Build an empty clause.
helper_expr_const_range private_copies() const
static bool classof(const OMPClause *T)
OMPSafelenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'safelen' clause.
This represents clause 'task_reduction' in the '#pragma omp taskgroup' directives.
SourceLocation getLParenLoc() const
Returns the location of '('.
static bool classof(const OMPClause *T)
helper_expr_range assignment_ops()
helper_expr_const_range destination_exprs() const
OpenMPProcBindClauseKind getProcBindKind() const
Returns kind of the clause.
llvm::iterator_range< inits_const_iterator > inits_const_range
unsigned getNumLoops() const
Get number of loops associated with the clause.
std::pair< const ValueDecl *, MappableExprComponentListRef > operator->() const
This represents implicit clause 'depend' for the '#pragma omp task' directive.
Expr * getStep()
Returns linear step.
const_all_num_lists_range all_num_lists() const
ArrayRef< unsigned >::iterator const_all_lists_sizes_iterator
llvm::iterator_range< inits_iterator > inits_range
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
This represents 'capture' clause in the '#pragma omp atomic' directive.
Expr - This represents one expression.
const_component_lists_iterator decl_component_lists_end() const
SourceLocation getMapLoc() const LLVM_READONLY
Fetches location of clause mapping kind.
OMPIfClause(OpenMPDirectiveKind NameModifier, Expr *Cond, Stmt *HelperCond, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation NameModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc)
Build 'if' clause with condition Cond.
This represents 'simdlen' clause in the '#pragma omp ...' directive.
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
Expr * getNumTasks() const
Return safe iteration space distance.
SourceLocation getScheduleKindLoc()
Get kind location.
static bool classof(const OMPClause *T)
MutableArrayRef< Expr * > getVarRefs()
Fetches list of variables associated with this clause.
varlist_const_iterator varlist_end() const
SourceLocation getLParenLoc() const
Returns the location of '('.
MutableArrayRef< Expr * >::iterator inits_iterator
OpenMPClauseKind
OpenMP clauses.
static bool classof(const OMPClause *T)
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OpenMPDistScheduleClauseKind getDistScheduleKind() const
Get kind of the clause.
static bool classof(const OMPClause *T)
helper_expr_const_range rhs_exprs() const
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
void setDeclNumLists(ArrayRef< unsigned > DNLs)
Set the number of lists per declaration that are in the trailing objects of the class.
This represents 'ordered' clause in the '#pragma omp ...' directive.
MutableArrayRef< unsigned > getDeclNumListsRef()
Get the number of lists per declaration that are in the trailing objects of the class.
Expr * getCalcStep()
Returns expression to calculate linear step.
SourceLocation getColonLoc() const
Get colon location.
const_component_lists_range component_lists() const
static bool classof(const OMPClause *T)
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
static bool classof(const OMPClause *T)
static bool classof(const OMPClause *T)
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
llvm::iterator_range< helper_expr_iterator > helper_expr_range
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
Expr * getDevice()
Return device number.
This represents 'collapse' clause in the '#pragma omp ...' directive.
This represents clause 'firstprivate' in the '#pragma omp ...' directives.
inits_const_range inits() const
SourceLocation getCommaLoc()
Get location of ','.
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
OpenMPProcBindClauseKind
OpenMP attributes for 'proc_bind' clause.
MutableArrayRef< Expr * >::iterator inits_iterator
OMPThreadLimitClause()
Build an empty clause.
helper_expr_range destination_exprs()
This represents 'seq_cst' clause in the '#pragma omp atomic' directive.
helper_expr_const_range assignment_ops() const
This represents 'untied' clause in the '#pragma omp ...' directive.
helper_expr_range lhs_exprs()
helper_expr_range reduction_ops()
static bool classof(const OMPClause *T)
SourceLocation getModifierLoc() const
Return modifier location.
OMPMergeableClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'mergeable' clause.
OMPNumThreadsClause(Expr *NumThreads, Stmt *HelperNumThreads, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'num_threads' clause with condition NumThreads.
static bool classof(const OMPClause *T)
static bool classof(const OMPClause *T)
void setPostUpdateExpr(Expr *S)
Set pre-initialization statement for the clause.
SourceLocation getLParenLoc()
Get location of '('.
helper_expr_range destination_exprs()
SourceLocation getColonLoc() const
Returns the location of ':'.
This represents 'num_teams' clause in the '#pragma omp ...' directive.
OMPSimdlenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'simdlen' clause.
llvm::iterator_range< child_iterator > child_range
SourceLocation getLParenLoc()
Get location of '('.
MappableComponent(Expr *AssociatedExpression, ValueDecl *AssociatedDeclaration)
helper_expr_const_range taskgroup_descriptors() const
helper_expr_range private_copies()
const Expr * getChunkSize() const
Get chunk size.
OMPCollapseClause()
Build an empty clause.
llvm::iterator_range< updates_const_iterator > updates_const_range
unsigned getTotalComponentListNum() const
Return the number of lists derived from the clause expressions.
ArrayRef< unsigned > getDeclNumListsRef() const
Get the number of lists per declaration that are in the trailing objects of the class.
static bool classof(const OMPClause *T)
OMPThreadsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'threads' clause.
Encodes a location in the source.
Expr * getNumTeams() const
Return NumTeams number.
This represents 'hint' clause in the '#pragma omp ...' directive.
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
MutableArrayRef< Expr * > getInits()
varlist_const_iterator varlist_begin() const
helper_expr_range rhs_exprs()
llvm::iterator_range< const_all_lists_sizes_iterator > const_all_lists_sizes_range
private_copies_range private_copies()
ArrayRef< const Expr * >::iterator updates_const_iterator
This represents 'schedule' clause in the '#pragma omp ...' directive.
llvm::iterator_range< finals_const_iterator > finals_const_range
MutableArrayRef< Expr * >::iterator privates_iterator
OMPMergeableClause()
Build an empty clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OpenMPDirectiveKind
OpenMP directives.
SourceLocation getLParenLoc() const
Returns the location of '('.
This represents clause 'shared' in the '#pragma omp ...' directives.
SourceLocation getProcBindKindKwLoc() const
Returns location of clause kind.
OMPNumTeamsClause()
Build an empty clause.
llvm::iterator_range< const_child_iterator > const_child_range
Expr * getPriority()
Return Priority number.
ArrayRef< ValueDecl * > getUniqueDeclsRef() const
Get the unique declarations that are in the trailing objects of the class.
OpenMPLinearClauseKind Modifier
Modifier of 'linear' clause.
OpenMPMapClauseKind getMapType() const LLVM_READONLY
Fetches mapping kind for the clause.
static bool classof(const OMPClause *T)
const_component_lists_iterator & operator++()
This is a basic class for representing single OpenMP clause.
MutableArrayRef< Expr * >::iterator helper_expr_iterator
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
MutableArrayRef< Expr * >::iterator finals_iterator
SourceLocation getNameModifierLoc() const
Return the location of directive name modifier.
SourceLocation getLocStart() const LLVM_READONLY
Returns the starting location of the clause.
void setVarRefs(ArrayRef< Expr *> VL)
Sets the list of variables for this clause.
OpenMPMapClauseKind getMapTypeModifier() const LLVM_READONLY
Fetches the map type modifier for the clause.
static bool classof(const OMPClause *T)
ArrayRef< MappableComponent >::iterator const_all_components_iterator
Expr * getNumForLoops() const
Return the number of associated for-loops.
const_all_lists_sizes_range all_lists_sizes() const
helper_expr_range reduction_ops()
static bool classof(const OMPClause *T)
std::pair< const ValueDecl *, MappableExprComponentListRef > operator*() const
MutableArrayRef< Expr * >::iterator helper_expr_iterator
SourceLocation getLParenLoc() const
Returns the location of '('.
helper_expr_const_range lhs_exprs() const
ArrayRef< unsigned >::iterator const_all_num_lists_iterator
llvm::iterator_range< inits_const_iterator > inits_const_range
ArrayRef< const Expr * >::iterator inits_const_iterator
OMPDefaultmapClause()
Build an empty clause.
const_component_lists_iterator component_lists_begin() const
Iterators for all component lists.
void setStep(Expr *Step)
Sets the linear step for clause.
llvm::iterator_range< const_all_decls_iterator > const_all_decls_range
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
llvm::iterator_range< varlist_const_iterator > varlist_const_range
Dataflow Directional Tag Classes.
ArrayRef< const Expr * > getVarRefs() const
Fetches list of all variables in the clause.
SourceLocation getColonLoc() const
Get colon location.
This represents 'device' clause in the '#pragma omp ...' directive.
const Expr * getAlignment() const
Returns alignment.
OMPThreadsClause()
Build an empty clause.
OpenMPDefaultmapClauseKind getDefaultmapKind() const
Get kind of the clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
SourceLocation ModifierLoc
Location of linear modifier if any.
helper_expr_const_range privates() const
static bool classof(const OMPClause *T)
static bool classof(const OMPClause *T)
const_all_components_range all_components() const
OMPNumThreadsClause()
Build an empty clause.
MutableArrayRef< ValueDecl * > getUniqueDeclsRef()
Get the unique declarations that are in the trailing objects of the class.
SourceLocation getLParenLoc()
Get location of '('.
Stmt * getPreInitStmt()
Get pre-initialization statement for the clause.
U cast(CodeGen::Address addr)
static bool classof(const OMPClause *T)
static bool classof(const OMPClause *T)
This represents clause 'linear' in the '#pragma omp ...' directives.
static bool classof(const OMPClause *T)
ArrayRef< const Expr * >::iterator inits_const_iterator
static bool classof(const OMPClause *T)
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
OpenMPDefaultmapClauseModifier getDefaultmapModifier() const
Get the modifier of the clause.
void setLocStart(SourceLocation Loc)
Sets the starting location of the clause.
SourceLocation getBeginLoc() const
ArrayRef< MappableExprComponentList > MappableExprComponentListsRef
SourceLocation getLParenLoc() const
Returns the location of '('.
static bool classof(const OMPClause *T)
SmallVector< MappableExprComponentList, 8 > MappableExprComponentLists
bool isImplicitMapType() const LLVM_READONLY
Is this an implicit map type? We have to capture 'IsMapTypeImplicit' from the parser for more informa...
llvm::iterator_range< private_copies_iterator > private_copies_range
MutableArrayRef< Expr * >::iterator private_copies_iterator
ArrayRef< unsigned > getComponentListSizesRef() const
Get the cumulative component lists sizes that are in the trailing objects of the class.
SourceLocation getEndLoc() const
void setComponentListSizes(ArrayRef< unsigned > CLSs)
Set the cumulative component lists sizes that are in the trailing objects of the class.
helper_expr_const_range privates() const
Class that represents a component of a mappable expression.
ArrayRef< const Expr * >::iterator inits_const_iterator
private_copies_const_range private_copies() const
inits_const_range inits() const
OMPDefaultClause(OpenMPDefaultClauseKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'default' clause with argument A ('none' or 'shared').
OMPDeviceClause(Expr *E, Stmt *HelperE, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'device' clause.
OMPReadClause()
Build an empty clause.
OMPThreadLimitClause(Expr *E, Stmt *HelperE, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'thread_limit' clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
OpenMPDirectiveKind getNameModifier() const
Return directive name modifier associated with the clause.
llvm::iterator_range< privates_const_iterator > privates_const_range
llvm::iterator_range< private_copies_const_iterator > private_copies_const_range
const_component_lists_iterator component_lists_end() const
helper_expr_const_range destination_exprs() const
llvm::iterator_range< const_component_lists_iterator > const_component_lists_range
ArrayRef< const Expr * >::iterator finals_const_iterator
llvm::iterator_range< private_copies_const_iterator > private_copies_const_range
OMPUntiedClause()
Build an empty clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
OMPFinalClause(Expr *Cond, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'final' clause with condition Cond.
private_copies_const_range private_copies() const
OpenMPDefaultClauseKind
OpenMP attributes for 'default' clause.
OMPDeviceClause()
Build an empty clause.
llvm::iterator_range< inits_const_iterator > inits_const_range
SourceLocation getDistScheduleKindLoc()
Get kind location.
llvm::iterator_range< finals_iterator > finals_range
OMPNowaitClause()
Build an empty clause.
privates_range privates()
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
This represents 'write' clause in the '#pragma omp atomic' directive.
OMPNumTasksClause()
Build an empty clause.
helper_expr_range taskgroup_descriptors()
SourceLocation getLParenLoc() const
Returns the location of '('.
void setClauseInfo(ArrayRef< ValueDecl *> Declarations, MappableExprComponentListsRef ComponentLists)
Fill the clause information from the list of declarations and associated component lists...
static bool classof(const OMPClause *T)
static bool classof(const OMPClause *T)
SourceLocation getLParenLoc() const
Returns the location of '('.
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
ArrayRef< ValueDecl *>::iterator const_all_decls_iterator
Iterators to access all the declarations, number of lists, list sizes, and components.
OpenMPScheduleClauseModifier getSecondScheduleModifier() const
Get the second modifier of the clause.
Defines the clang::SourceLocation class and associated facilities.
llvm::iterator_range< privates_iterator > privates_range
This represents 'nowait' clause in the '#pragma omp ...' directive.
MutableArrayRef< MappableComponent > getComponentsRef()
Get the components that are in the trailing objects of the class.
helper_expr_range reduction_ops()
varlist_iterator varlist_end()
OpenMPScheduleClauseModifier getFirstScheduleModifier() const
Get the first modifier of the clause.
This represents 'num_tasks' clause in the '#pragma omp ...' directive.
OpenMPScheduleClauseKind getScheduleKind() const
Get kind of the clause.
varlist_const_range varlists() const
Privates[]
Gets the list of initial values for linear variables.
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
OpenMPLinearClauseKind getModifier() const
Return modifier.
SourceLocation getFirstScheduleModifierLoc() const
Get the first modifier location.
OMPClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation EndLoc)
helper_expr_const_range reduction_ops() const
OMPSimdlenClause()
Build an empty clause.
Expr * getThreadLimit()
Return ThreadLimit number.
OMPIfClause()
Build an empty clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OMPScheduleClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation KLoc, SourceLocation CommaLoc, SourceLocation EndLoc, OpenMPScheduleClauseKind Kind, Expr *ChunkSize, Stmt *HelperChunkSize, OpenMPScheduleClauseModifier M1, SourceLocation M1Loc, OpenMPScheduleClauseModifier M2, SourceLocation M2Loc)
Build 'schedule' clause with schedule kind Kind and chunk size expression ChunkSize.
void setPreInitStmt(Stmt *S, OpenMPDirectiveKind ThisRegion=OMPD_unknown)
Set pre-initialization statement for the clause.
ArrayRef< const Expr * >::iterator privates_const_iterator
OMPUpdateClause()
Build an empty clause.
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
ArrayRef< const Expr *>::iterator varlist_const_iterator
Expr * getHint() const
Returns number of threads.
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
void setInits(ArrayRef< Expr *> IL)
Sets the list of the initial values for linear variables.
OMPGrainsizeClause()
Build an empty clause.
static bool classof(const OMPClause *T)
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
Expr * getChunkSize()
Get chunk size.
Expr * getNumThreads() const
Returns number of threads.
OMPReadClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'read' clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
OMPClauseWithPostUpdate(const OMPClause *This)
static bool classof(const OMPClause *T)
const Expr * getPostUpdateExpr() const
Get post-update expression for the clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
SourceLocation ColonLoc
Location of ':'.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
llvm::iterator_range< varlist_iterator > varlist_range
This represents clause 'use_device_ptr' in the '#pragma omp ...' directives.
OMPDefaultClause()
Build an empty clause.
static bool classof(const OMPClause *T)
OMPClauseWithPreInit(const OMPClause *This)
Expr * getThreadLimit() const
Return ThreadLimit number.
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.
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
static bool classof(const OMPClause *T)