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;
135 class OMPClauseWithPostUpdate :
public OMPClauseWithPreInit {
139 Expr *PostUpdate =
nullptr;
143 assert(
get(This) &&
"get is not tuned for post-update.");
151 const Expr *getPostUpdateExpr()
const {
return PostUpdate; }
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) {}
753 :
OMPClause(OMPC_unified_address, StartLoc, EndLoc) {}
784 :
OMPClause(OMPC_unified_shared_memory, StartLoc, EndLoc) {}
815 :
OMPClause(OMPC_reverse_offload, StartLoc, EndLoc) {}
846 :
OMPClause(OMPC_dynamic_allocators, StartLoc, EndLoc) {}
910 :
OMPClause(OMPC_atomic_default_mem_order, StartLoc, EndLoc),
911 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {}
958 enum {FIRST, SECOND, NUM_MODIFIERS};
971 Expr *ChunkSize =
nullptr;
982 Modifiers[FIRST] = M;
989 Modifiers[SECOND] = M;
994 ModifiersLoc[FIRST] = Loc;
999 ModifiersLoc[SECOND] = Loc;
1007 Modifiers[FIRST] = M;
1010 Modifiers[SECOND] = M;
1032 void setChunkSize(
Expr *E) { ChunkSize = E; }
1053 Expr *ChunkSize,
Stmt *HelperChunkSize,
1056 :
OMPClause(OMPC_schedule, StartLoc, EndLoc), OMPClauseWithPreInit(this),
1057 LParenLoc(LParenLoc), Kind(Kind), KindLoc(KLoc), CommaLoc(CommaLoc),
1058 ChunkSize(ChunkSize) {
1059 setPreInitStmt(HelperChunkSize);
1060 Modifiers[FIRST] = M1;
1061 Modifiers[SECOND] = M2;
1062 ModifiersLoc[FIRST] = M1Loc;
1063 ModifiersLoc[SECOND] = M2Loc;
1069 OMPClauseWithPreInit(this) {
1079 return Modifiers[FIRST];
1084 return Modifiers[SECOND];
1095 return ModifiersLoc[FIRST];
1100 return ModifiersLoc[SECOND];
1113 return child_range(reinterpret_cast<Stmt **>(&ChunkSize),
1114 reinterpret_cast<Stmt **>(&ChunkSize) + 1);
1139 Stmt *NumForLoops =
nullptr;
1142 unsigned NumberOfLoops = 0;
1153 :
OMPClause(OMPC_ordered, StartLoc, EndLoc), LParenLoc(LParenLoc),
1154 NumForLoops(Num), NumberOfLoops(NumLoops) {}
1159 NumberOfLoops(NumLoops) {}
1162 void setNumForLoops(
Expr *Num) { NumForLoops = Num; }
1190 void setLoopNumIterations(
unsigned NumLoop,
Expr *NumIterations);
1195 void setLoopCounter(
unsigned NumLoop,
Expr *Counter);
1197 Expr *getLoopCounter(
unsigned NumLoop);
1198 const Expr *getLoopCounter(
unsigned NumLoop)
const;
1220 :
OMPClause(OMPC_nowait, StartLoc, EndLoc) {}
1248 :
OMPClause(OMPC_untied, StartLoc, EndLoc) {}
1277 :
OMPClause(OMPC_mergeable, StartLoc, EndLoc) {}
1305 :
OMPClause(OMPC_read, StartLoc, EndLoc) {}
1332 :
OMPClause(OMPC_write, StartLoc, EndLoc) {}
1361 :
OMPClause(OMPC_update, StartLoc, EndLoc) {}
1390 :
OMPClause(OMPC_capture, StartLoc, EndLoc) {}
1419 :
OMPClause(OMPC_seq_cst, StartLoc, EndLoc) {}
1478 return llvm::makeArrayRef(varlist_end(), varlist_size());
1505 llvm::iterator_range<private_copies_const_iterator>;
1509 getPrivateCopies().end());
1514 getPrivateCopies().end());
1518 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1519 reinterpret_cast<Stmt **>(varlist_end()));
1537 public OMPClauseWithPreInit,
1552 LParenLoc, EndLoc, N),
1553 OMPClauseWithPreInit(this) {}
1562 OMPClauseWithPreInit(this) {}
1575 return llvm::makeArrayRef(varlist_end(), varlist_size());
1589 return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
1621 llvm::iterator_range<private_copies_const_iterator>;
1625 getPrivateCopies().end());
1629 getPrivateCopies().end());
1645 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1646 reinterpret_cast<Stmt **>(varlist_end()));
1664 public OMPClauseWithPostUpdate,
1695 LParenLoc, EndLoc, N),
1696 OMPClauseWithPostUpdate(this) {}
1705 OMPClauseWithPostUpdate(this) {}
1713 return llvm::makeArrayRef(varlist_end(), varlist_size());
1727 return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
1741 return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
1754 return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
1798 llvm::iterator_range<helper_expr_const_iterator>;
1806 getPrivateCopies().end());
1811 getPrivateCopies().end());
1816 getSourceExprs().end());
1825 getDestinationExprs().end());
1830 getDestinationExprs().end());
1835 getAssignmentOps().end());
1840 getAssignmentOps().end());
1844 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1845 reinterpret_cast<Stmt **>(varlist_end()));
1904 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1905 reinterpret_cast<Stmt **>(varlist_end()));
1923 public OMPClauseWithPostUpdate,
1952 LParenLoc, EndLoc, N),
1953 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
1954 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
1963 OMPClauseWithPostUpdate(this) {}
1984 return llvm::makeArrayRef(varlist_end(), varlist_size());
1997 return llvm::makeArrayRef(
getPrivates().end(), varlist_size());
2012 return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
2026 return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
2089 llvm::iterator_range<helper_expr_const_iterator>;
2117 getReductionOps().end());
2122 getReductionOps().end());
2126 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2127 reinterpret_cast<Stmt **>(varlist_end()));
2145 public OMPClauseWithPostUpdate,
2174 LParenLoc, EndLoc, N),
2175 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
2176 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
2185 OMPClauseWithPostUpdate(this) {}
2205 return llvm::makeArrayRef(varlist_end(), varlist_size());
2218 return llvm::makeArrayRef(
getPrivates().end(), varlist_size());
2232 return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
2246 return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
2309 llvm::iterator_range<helper_expr_const_iterator>;
2337 getReductionOps().end());
2342 getReductionOps().end());
2346 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2347 reinterpret_cast<Stmt **>(varlist_end()));
2364 public OMPClauseWithPostUpdate,
2393 LParenLoc, EndLoc, N),
2394 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
2395 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
2404 OMPClauseWithPostUpdate(this) {}
2424 return llvm::makeArrayRef(varlist_end(), varlist_size());
2437 return llvm::makeArrayRef(
getPrivates().end(), varlist_size());
2451 return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
2465 return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
2476 return llvm::makeArrayRef(getReductionOps().end(), varlist_size());
2542 llvm::iterator_range<helper_expr_const_iterator>;
2570 getReductionOps().end());
2575 getReductionOps().end());
2580 getTaskgroupDescriptors().end());
2585 getTaskgroupDescriptors().end());
2589 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2590 reinterpret_cast<Stmt **>(varlist_end()));
2608 public OMPClauseWithPostUpdate,
2642 OMPClauseWithPostUpdate(this), Modifier(Modifier),
2643 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc) {}
2652 OMPClauseWithPostUpdate(this) {}
2670 return llvm::makeArrayRef(varlist_end(), varlist_size());
2677 return llvm::makeArrayRef(
getPrivates().end(), varlist_size());
2685 return llvm::makeArrayRef(
getInits().end(), varlist_size());
2693 return llvm::makeArrayRef(
getUpdates().end(), varlist_size());
2828 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2829 reinterpret_cast<Stmt **>(varlist_end()));
2856 void setAlignment(Expr *A) { *varlist_end() = A; }
2866 SourceLocation ColonLoc, SourceLocation EndLoc,
2870 ColonLoc(ColonLoc) {}
2877 SourceLocation(), SourceLocation(),
2891 SourceLocation LParenLoc,
2892 SourceLocation ColonLoc,
2893 SourceLocation EndLoc, ArrayRef<Expr *> VL,
2915 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2916 reinterpret_cast<Stmt **>(varlist_end()));
2920 return T->getClauseKind() == OMPC_aligned;
2958 SourceLocation EndLoc,
unsigned N)
2967 SourceLocation(), SourceLocation(),
2973 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
2976 MutableArrayRef<Expr *> getSourceExprs() {
2977 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2979 ArrayRef<const Expr *> getSourceExprs()
const {
2980 return llvm::makeArrayRef(varlist_end(), varlist_size());
2986 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
2989 MutableArrayRef<Expr *> getDestinationExprs() {
2990 return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
2992 ArrayRef<const Expr *> getDestinationExprs()
const {
2993 return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
3000 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
3003 MutableArrayRef<Expr *> getAssignmentOps() {
3004 return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
3006 ArrayRef<const Expr *> getAssignmentOps()
const {
3007 return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
3033 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
3034 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
3035 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
3047 llvm::iterator_range<helper_expr_const_iterator>;
3051 getSourceExprs().end());
3060 getDestinationExprs().end());
3065 getDestinationExprs().end());
3070 getAssignmentOps().end());
3075 getAssignmentOps().end());
3079 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3080 reinterpret_cast<Stmt **>(varlist_end()));
3084 return T->getClauseKind() == OMPC_copyin;
3110 SourceLocation EndLoc,
unsigned N)
3112 LParenLoc, EndLoc, N) {}
3119 OMPC_copyprivate, SourceLocation(), SourceLocation(),
3120 SourceLocation(), N) {}
3125 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
3128 MutableArrayRef<Expr *> getSourceExprs() {
3129 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
3131 ArrayRef<const Expr *> getSourceExprs()
const {
3132 return llvm::makeArrayRef(varlist_end(), varlist_size());
3138 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
3141 MutableArrayRef<Expr *> getDestinationExprs() {
3142 return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
3144 ArrayRef<const Expr *> getDestinationExprs()
const {
3145 return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
3152 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
3155 MutableArrayRef<Expr *> getAssignmentOps() {
3156 return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
3158 ArrayRef<const Expr *> getAssignmentOps()
const {
3159 return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
3184 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
3185 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
3186 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
3198 llvm::iterator_range<helper_expr_const_iterator>;
3202 getSourceExprs().end());
3211 getDestinationExprs().end());
3216 getDestinationExprs().end());
3221 getAssignmentOps().end());
3226 getAssignmentOps().end());
3230 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3231 reinterpret_cast<Stmt **>(varlist_end()));
3235 return T->getClauseKind() == OMPC_copyprivate;
3263 OMPFlushClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3264 SourceLocation EndLoc,
unsigned N)
3265 : OMPVarListClause<OMPFlushClause>(OMPC_flush, StartLoc, LParenLoc,
3272 : OMPVarListClause<OMPFlushClause>(OMPC_flush, SourceLocation(),
3273 SourceLocation(), SourceLocation(),
3285 SourceLocation LParenLoc, SourceLocation EndLoc,
3286 ArrayRef<Expr *> VL);
3295 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3296 reinterpret_cast<Stmt **>(varlist_end()));
3300 return T->getClauseKind() == OMPC_flush;
3323 SourceLocation DepLoc;
3329 unsigned NumLoops = 0;
3340 SourceLocation EndLoc,
unsigned N,
unsigned NumLoops)
3342 EndLoc, N), NumLoops(NumLoops) {}
3351 SourceLocation(), SourceLocation(),
3353 NumLoops(NumLoops) {}
3359 void setDependencyLoc(SourceLocation Loc) { DepLoc = Loc; }
3362 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
3378 SourceLocation LParenLoc,
3379 SourceLocation EndLoc,
3381 SourceLocation DepLoc, SourceLocation ColonLoc,
3382 ArrayRef<Expr *> VL,
unsigned NumLoops);
3407 void setLoopData(
unsigned NumLoop, Expr *Cnt);
3410 Expr *getLoopData(
unsigned NumLoop);
3411 const Expr *getLoopData(
unsigned NumLoop)
const;
3414 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3415 reinterpret_cast<Stmt **>(varlist_end()));
3419 return T->getClauseKind() == OMPC_depend;
3435 SourceLocation LParenLoc;
3438 Stmt *Device =
nullptr;
3443 void setDevice(Expr *E) { Device = E; }
3455 SourceLocation StartLoc, SourceLocation LParenLoc,
3456 SourceLocation EndLoc)
3457 :
OMPClause(OMPC_device, StartLoc, EndLoc), OMPClauseWithPreInit(this),
3458 LParenLoc(LParenLoc), Device(E) {
3459 setPreInitStmt(HelperE, CaptureRegion);
3464 :
OMPClause(OMPC_device, SourceLocation(), SourceLocation()),
3465 OMPClauseWithPreInit(this) {}
3482 return T->getClauseKind() == OMPC_device;
3499 :
OMPClause(OMPC_threads, StartLoc, EndLoc) {}
3503 :
OMPClause(OMPC_threads, SourceLocation(), SourceLocation()) {}
3510 return T->getClauseKind() == OMPC_threads;
3527 :
OMPClause(OMPC_simd, StartLoc, EndLoc) {}
3537 return T->getClauseKind() == OMPC_simd;
3553 Expr *AssociatedExpression =
nullptr;
3558 ValueDecl *AssociatedDeclaration =
nullptr;
3563 ValueDecl *AssociatedDeclaration)
3564 : AssociatedExpression(AssociatedExpression),
3565 AssociatedDeclaration(
3566 AssociatedDeclaration
3573 return AssociatedDeclaration;
3596 getUniqueDeclarationsTotalNumber(ArrayRef<const ValueDecl *> Declarations);
3609 unsigned NumUniqueDeclarations;
3612 unsigned NumComponentLists;
3615 unsigned NumComponents;
3633 SourceLocation LParenLoc, SourceLocation EndLoc,
3634 unsigned NumVars,
unsigned NumUniqueDeclarations,
3635 unsigned NumComponentLists,
unsigned NumComponents)
3637 NumUniqueDeclarations(NumUniqueDeclarations),
3638 NumComponentLists(NumComponentLists), NumComponents(NumComponents) {}
3643 return MutableArrayRef<ValueDecl *>(
3644 static_cast<T *
>(
this)->
template getTrailingObjects<ValueDecl *>(),
3645 NumUniqueDeclarations);
3651 return ArrayRef<ValueDecl *>(
3652 static_cast<const T *
>(
this)
3653 ->
template getTrailingObjects<ValueDecl *>(),
3654 NumUniqueDeclarations);
3660 assert(UDs.size() == NumUniqueDeclarations &&
3661 "Unexpected amount of unique declarations.");
3662 std::copy(UDs.begin(), UDs.end(), getUniqueDeclsRef().begin());
3668 return MutableArrayRef<unsigned>(
3669 static_cast<T *
>(
this)->
template getTrailingObjects<unsigned>(),
3670 NumUniqueDeclarations);
3676 return ArrayRef<unsigned>(
3677 static_cast<const T *
>(
this)->
template getTrailingObjects<unsigned>(),
3678 NumUniqueDeclarations);
3684 assert(DNLs.size() == NumUniqueDeclarations &&
3685 "Unexpected amount of list numbers.");
3686 std::copy(DNLs.begin(), DNLs.end(), getDeclNumListsRef().begin());
3692 return MutableArrayRef<unsigned>(
3693 static_cast<T *
>(
this)->
template getTrailingObjects<unsigned>() +
3694 NumUniqueDeclarations,
3701 return ArrayRef<unsigned>(
3702 static_cast<const T *
>(
this)->
template getTrailingObjects<unsigned>() +
3703 NumUniqueDeclarations,
3710 assert(CLSs.size() == NumComponentLists &&
3711 "Unexpected amount of component lists.");
3712 std::copy(CLSs.begin(), CLSs.end(), getComponentListSizesRef().begin());
3717 return MutableArrayRef<MappableComponent>(
3718 static_cast<T *
>(
this)
3719 ->
template getTrailingObjects<MappableComponent>(),
3725 return ArrayRef<MappableComponent>(
3726 static_cast<const T *
>(
this)
3727 ->
template getTrailingObjects<MappableComponent>(),
3735 ArrayRef<unsigned> CLSs) {
3736 assert(Components.size() == NumComponents &&
3737 "Unexpected amount of component lists.");
3738 assert(CLSs.size() == NumComponentLists &&
3739 "Unexpected amount of list sizes.");
3740 std::copy(Components.begin(), Components.end(), getComponentsRef().begin());
3749 assert(getUniqueDeclarationsTotalNumber(Declarations) ==
3750 NumUniqueDeclarations &&
3751 "Unexpected number of mappable expression info entries!");
3752 assert(getComponentsTotalNumber(ComponentLists) == NumComponents &&
3753 "Unexpected total number of components!");
3754 assert(Declarations.size() == ComponentLists.size() &&
3755 "Declaration and component lists size is not consistent!");
3756 assert(Declarations.size() == NumComponentLists &&
3757 "Unexpected declaration and component lists size!");
3762 llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
3765 auto CI = ComponentLists.begin();
3766 for (
auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
3768 assert(!CI->empty() &&
"Invalid component list!");
3769 ComponentListMap[*DI].push_back(*CI);
3774 auto UniqueDeclarations = getUniqueDeclsRef();
3775 auto UDI = UniqueDeclarations.begin();
3777 auto DeclNumLists = getDeclNumListsRef();
3778 auto DNLI = DeclNumLists.begin();
3780 auto ComponentListSizes = getComponentListSizesRef();
3781 auto CLSI = ComponentListSizes.begin();
3783 auto Components = getComponentsRef();
3784 auto CI = Components.begin();
3787 unsigned PrevSize = 0u;
3790 for (
auto &M : ComponentListMap) {
3807 PrevSize +=
C.size();
3814 CI = std::copy(
C.begin(),
C.end(), CI);
3833 :
public llvm::iterator_adaptor_base<
3834 const_component_lists_iterator,
3835 MappableExprComponentListRef::const_iterator,
3836 std::forward_iterator_tag, MappableComponent, ptrdiff_t,
3837 MappableComponent, MappableComponent> {
3839 ArrayRef<ValueDecl *>::iterator DeclCur;
3842 ArrayRef<unsigned>::iterator NumListsCur;
3845 unsigned RemainingLists = 0;
3849 unsigned PrevListSize = 0;
3853 ArrayRef<unsigned>::const_iterator ListSizeCur;
3854 ArrayRef<unsigned>::const_iterator ListSizeEnd;
3857 MappableExprComponentListRef::const_iterator
End;
3862 ArrayRef<ValueDecl *> UniqueDecls, ArrayRef<unsigned> DeclsListNum,
3863 ArrayRef<unsigned> CumulativeListSizes,
3866 Components.begin()),
3867 DeclCur(UniqueDecls.begin()), NumListsCur(DeclsListNum.begin()),
3868 ListSizeCur(CumulativeListSizes.begin()),
3869 ListSizeEnd(CumulativeListSizes.end()), End(Components.end()) {
3870 assert(UniqueDecls.size() == DeclsListNum.size() &&
3871 "Inconsistent number of declarations and list sizes!");
3872 if (!DeclsListNum.empty())
3873 RemainingLists = *NumListsCur;
3879 const ValueDecl *Declaration, ArrayRef<ValueDecl *> UniqueDecls,
3880 ArrayRef<unsigned> DeclsListNum, ArrayRef<unsigned> CumulativeListSizes,
3883 CumulativeListSizes, Components) {
3887 for (; DeclCur != UniqueDecls.end(); ++DeclCur, ++NumListsCur) {
3888 if (*DeclCur == Declaration)
3891 assert(*NumListsCur > 0 &&
"No lists associated with declaration??");
3895 std::advance(ListSizeCur, *NumListsCur - 1);
3896 PrevListSize = *ListSizeCur;
3902 if (ListSizeCur == CumulativeListSizes.end()) {
3904 RemainingLists = 0u;
3910 RemainingLists = *NumListsCur;
3913 ListSizeEnd = ListSizeCur;
3914 std::advance(ListSizeEnd, RemainingLists);
3918 std::advance(this->I, PrevListSize);
3923 std::pair<const ValueDecl *, MappableExprComponentListRef>
3925 assert(ListSizeCur != ListSizeEnd &&
"Invalid iterator!");
3926 return std::make_pair(
3930 std::pair<const ValueDecl *, MappableExprComponentListRef>
3937 assert(ListSizeCur != ListSizeEnd && RemainingLists &&
3938 "Invalid iterator!");
3942 if (std::next(ListSizeCur) == ListSizeEnd) {
3946 std::advance(this->I, *ListSizeCur - PrevListSize);
3947 PrevListSize = *ListSizeCur;
3950 if (!(--RemainingLists)) {
3953 RemainingLists = *NumListsCur;
3954 assert(RemainingLists &&
"No lists in the following declaration??");
3964 llvm::iterator_range<const_component_lists_iterator>;
3968 return const_component_lists_iterator(
3969 getUniqueDeclsRef(), getDeclNumListsRef(), getComponentListSizesRef(),
3970 getComponentsRef());
3973 return const_component_lists_iterator(
3974 ArrayRef<ValueDecl *>(), ArrayRef<unsigned>(), ArrayRef<unsigned>(),
3976 getComponentsRef().end()));
3979 return {component_lists_begin(), component_lists_end()};
3984 const_component_lists_iterator
3986 return const_component_lists_iterator(
3987 VD, getUniqueDeclsRef(), getDeclNumListsRef(),
3988 getComponentListSizesRef(), getComponentsRef());
3991 return component_lists_end();
3994 return {decl_component_lists_begin(VD), decl_component_lists_end()};
4003 auto A = getUniqueDeclsRef();
4009 llvm::iterator_range<const_all_num_lists_iterator>;
4012 auto A = getDeclNumListsRef();
4018 llvm::iterator_range<const_all_lists_sizes_iterator>;
4021 auto A = getComponentListSizesRef();
4027 llvm::iterator_range<const_all_components_iterator>;
4030 auto A = getComponentsRef();
4045 OMPMapClause, Expr *, ValueDecl *, unsigned,
4046 OMPClauseMappableExprCommon::MappableComponent> {
4054 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4055 return varlist_size();
4057 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
4058 return getUniqueDeclarationsNum();
4060 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
4061 return getUniqueDeclarationsNum() + getTotalComponentListNum();
4066 static constexpr
unsigned NumberOfModifiers =
4076 SourceLocation MapTypeModifiersLoc[NumberOfModifiers];
4082 bool MapTypeIsImplicit =
false;
4085 SourceLocation MapLoc;
4106 explicit OMPMapClause(ArrayRef<OpenMPMapModifierKind> MapModifiers,
4107 ArrayRef<SourceLocation> MapModifiersLoc,
4109 SourceLocation MapLoc, SourceLocation StartLoc,
4110 SourceLocation LParenLoc, SourceLocation EndLoc,
4111 unsigned NumVars,
unsigned NumUniqueDeclarations,
4112 unsigned NumComponentLists,
unsigned NumComponents)
4114 NumVars, NumUniqueDeclarations,
4115 NumComponentLists, NumComponents),
4116 MapType(MapType), MapTypeIsImplicit(MapTypeIsImplicit),
4118 assert(llvm::array_lengthof(MapTypeModifiers) == MapModifiers.size()
4119 &&
"Unexpected number of map type modifiers.");
4120 llvm::copy(MapModifiers, std::begin(MapTypeModifiers));
4122 assert(llvm::array_lengthof(MapTypeModifiersLoc) ==
4123 MapModifiersLoc.size() &&
4124 "Unexpected number of map type modifier locations.");
4125 llvm::copy(MapModifiersLoc, std::begin(MapTypeModifiersLoc));
4135 explicit OMPMapClause(
unsigned NumVars,
unsigned NumUniqueDeclarations,
4136 unsigned NumComponentLists,
unsigned NumComponents)
4138 OMPC_map, SourceLocation(), SourceLocation(), SourceLocation(),
4139 NumVars, NumUniqueDeclarations, NumComponentLists, NumComponents) {}
4146 assert(I < NumberOfModifiers &&
4147 "Unexpected index to store map type modifier, exceeds array size.");
4148 MapTypeModifiers[I] = T;
4155 void setMapTypeModifierLoc(
unsigned I, SourceLocation TLoc) {
4156 assert(I < NumberOfModifiers &&
4157 "Index to store map type modifier location exceeds array size.");
4158 MapTypeModifiersLoc[I] = TLoc;
4169 void setMapLoc(SourceLocation TLoc) { MapLoc = TLoc; }
4172 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
4189 SourceLocation LParenLoc, SourceLocation EndLoc,
4190 ArrayRef<Expr *> Vars,
4191 ArrayRef<ValueDecl *> Declarations,
4193 ArrayRef<OpenMPMapModifierKind> MapModifiers,
4194 ArrayRef<SourceLocation> MapModifiersLoc,
4196 SourceLocation TypeLoc);
4210 unsigned NumUniqueDeclarations,
4211 unsigned NumComponentLists,
4212 unsigned NumComponents);
4228 assert(Cnt < NumberOfModifiers &&
4229 "Requested modifier exceeds the total number of modifiers.");
4230 return MapTypeModifiers[Cnt];
4238 assert(Cnt < NumberOfModifiers &&
4239 "Requested modifier location exceeds total number of modifiers.");
4240 return MapTypeModifiersLoc[Cnt];
4245 return llvm::makeArrayRef(MapTypeModifiers);
4250 return llvm::makeArrayRef(MapTypeModifiersLoc);
4254 SourceLocation
getMapLoc() const LLVM_READONLY {
return MapLoc; }
4261 reinterpret_cast<Stmt **>(varlist_begin()),
4262 reinterpret_cast<Stmt **>(varlist_end()));
4266 return T->getClauseKind() == OMPC_map;
4282 SourceLocation LParenLoc;
4285 Stmt *NumTeams =
nullptr;
4290 void setNumTeams(Expr *E) { NumTeams = E; }
4303 SourceLocation StartLoc, SourceLocation LParenLoc,
4304 SourceLocation EndLoc)
4305 :
OMPClause(OMPC_num_teams, StartLoc, EndLoc), OMPClauseWithPreInit(this),
4306 LParenLoc(LParenLoc), NumTeams(E) {
4307 setPreInitStmt(HelperE, CaptureRegion);
4312 :
OMPClause(OMPC_num_teams, SourceLocation(), SourceLocation()),
4313 OMPClauseWithPreInit(this) {}
4330 return T->getClauseKind() == OMPC_num_teams;
4346 SourceLocation LParenLoc;
4349 Stmt *ThreadLimit =
nullptr;
4354 void setThreadLimit(Expr *E) { ThreadLimit = E; }
4368 SourceLocation StartLoc, SourceLocation LParenLoc,
4369 SourceLocation EndLoc)
4370 :
OMPClause(OMPC_thread_limit, StartLoc, EndLoc),
4371 OMPClauseWithPreInit(this), LParenLoc(LParenLoc), ThreadLimit(E) {
4372 setPreInitStmt(HelperE, CaptureRegion);
4377 :
OMPClause(OMPC_thread_limit, SourceLocation(), SourceLocation()),
4378 OMPClauseWithPreInit(this) {}
4395 return T->getClauseKind() == OMPC_thread_limit;
4411 SourceLocation LParenLoc;
4414 Stmt *Priority =
nullptr;
4419 void setPriority(Expr *E) { Priority = E; }
4429 SourceLocation EndLoc)
4430 :
OMPClause(OMPC_priority, StartLoc, EndLoc), LParenLoc(LParenLoc),
4435 :
OMPClause(OMPC_priority, SourceLocation(), SourceLocation()) {}
4452 return T->getClauseKind() == OMPC_priority;
4468 SourceLocation LParenLoc;
4471 Stmt *Grainsize =
nullptr;
4474 void setGrainsize(Expr *Size) { Grainsize = Size; }
4483 SourceLocation LParenLoc, SourceLocation EndLoc)
4484 :
OMPClause(OMPC_grainsize, StartLoc, EndLoc), LParenLoc(LParenLoc),
4489 :
OMPClause(OMPC_grainsize, SourceLocation(), SourceLocation()) {}
4503 return T->getClauseKind() == OMPC_grainsize;
4520 :
OMPClause(OMPC_nogroup, StartLoc, EndLoc) {}
4524 :
OMPClause(OMPC_nogroup, SourceLocation(), SourceLocation()) {}
4531 return T->getClauseKind() == OMPC_nogroup;
4547 SourceLocation LParenLoc;
4550 Stmt *NumTasks =
nullptr;
4553 void setNumTasks(Expr *Size) { NumTasks = Size; }
4562 SourceLocation LParenLoc, SourceLocation EndLoc)
4563 :
OMPClause(OMPC_num_tasks, StartLoc, EndLoc), LParenLoc(LParenLoc),
4568 :
OMPClause(OMPC_num_tasks, SourceLocation(), SourceLocation()) {}
4582 return T->getClauseKind() == OMPC_num_tasks;
4597 SourceLocation LParenLoc;
4600 Stmt *Hint =
nullptr;
4603 void setHint(Expr *H) { Hint = H; }
4613 SourceLocation EndLoc)
4614 :
OMPClause(OMPC_hint, StartLoc, EndLoc), LParenLoc(LParenLoc),
4627 Expr *
getHint()
const {
return cast_or_null<Expr>(Hint); }
4632 return T->getClauseKind() == OMPC_hint;
4648 SourceLocation LParenLoc;
4654 SourceLocation KindLoc;
4657 SourceLocation CommaLoc;
4660 Expr *ChunkSize =
nullptr;
4670 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
4675 void setDistScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
4680 void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
4685 void setChunkSize(Expr *E) { ChunkSize = E; }
4700 SourceLocation KLoc, SourceLocation CommaLoc,
4701 SourceLocation EndLoc,
4703 Stmt *HelperChunkSize)
4704 :
OMPClause(OMPC_dist_schedule, StartLoc, EndLoc),
4705 OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Kind(Kind),
4706 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
4707 setPreInitStmt(HelperChunkSize);
4712 :
OMPClause(OMPC_dist_schedule, SourceLocation(), SourceLocation()),
4713 OMPClauseWithPreInit(this) {}
4734 return child_range(reinterpret_cast<Stmt **>(&ChunkSize),
4735 reinterpret_cast<Stmt **>(&ChunkSize) + 1);
4739 return T->getClauseKind() == OMPC_dist_schedule;
4754 SourceLocation LParenLoc;
4766 SourceLocation KindLoc;
4781 void setDefaultmapModifierLoc(SourceLocation Loc) {
4788 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
4793 void setDefaultmapKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
4806 SourceLocation MLoc, SourceLocation KLoc,
4809 :
OMPClause(OMPC_defaultmap, StartLoc, EndLoc), LParenLoc(LParenLoc),
4810 Modifier(M), ModifierLoc(MLoc), Kind(Kind), KindLoc(KLoc) {}
4814 :
OMPClause(OMPC_defaultmap, SourceLocation(), SourceLocation()) {}
4840 return T->getClauseKind() == OMPC_defaultmap;
4854 OMPToClause, Expr *, ValueDecl *, unsigned,
4855 OMPClauseMappableExprCommon::MappableComponent> {
4870 explicit OMPToClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4871 SourceLocation EndLoc,
unsigned NumVars,
4872 unsigned NumUniqueDeclarations,
4873 unsigned NumComponentLists,
unsigned NumComponents)
4875 NumUniqueDeclarations, NumComponentLists,
4885 explicit OMPToClause(
unsigned NumVars,
unsigned NumUniqueDeclarations,
4886 unsigned NumComponentLists,
unsigned NumComponents)
4888 OMPC_to, SourceLocation(), SourceLocation(), SourceLocation(),
4889 NumVars, NumUniqueDeclarations, NumComponentLists, NumComponents) {}
4893 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4894 return varlist_size();
4896 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
4897 return getUniqueDeclarationsNum();
4899 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
4900 return getUniqueDeclarationsNum() + getTotalComponentListNum();
4913 SourceLocation LParenLoc, SourceLocation EndLoc,
4914 ArrayRef<Expr *> Vars,
4915 ArrayRef<ValueDecl *> Declarations,
4928 unsigned NumUniqueDeclarations,
4929 unsigned NumComponentLists,
4930 unsigned NumComponents);
4933 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
4934 reinterpret_cast<Stmt **>(varlist_end()));
4938 return T->getClauseKind() == OMPC_to;
4953 OMPFromClause, Expr *, ValueDecl *, unsigned,
4954 OMPClauseMappableExprCommon::MappableComponent> {
4969 explicit OMPFromClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4970 SourceLocation EndLoc,
unsigned NumVars,
4971 unsigned NumUniqueDeclarations,
4972 unsigned NumComponentLists,
unsigned NumComponents)
4974 NumVars, NumUniqueDeclarations,
4975 NumComponentLists, NumComponents) {}
4984 explicit OMPFromClause(
unsigned NumVars,
unsigned NumUniqueDeclarations,
4985 unsigned NumComponentLists,
unsigned NumComponents)
4987 OMPC_from, SourceLocation(), SourceLocation(), SourceLocation(),
4988 NumVars, NumUniqueDeclarations, NumComponentLists, NumComponents) {}
4992 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4993 return varlist_size();
4995 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
4996 return getUniqueDeclarationsNum();
4998 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
4999 return getUniqueDeclarationsNum() + getTotalComponentListNum();
5012 SourceLocation LParenLoc, SourceLocation EndLoc,
5013 ArrayRef<Expr *> Vars,
5014 ArrayRef<ValueDecl *> Declarations,
5027 unsigned NumUniqueDeclarations,
5028 unsigned NumComponentLists,
5029 unsigned NumComponents);
5032 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
5033 reinterpret_cast<Stmt **>(varlist_end()));
5037 return T->getClauseKind() == OMPC_from;
5052 OMPUseDevicePtrClause, Expr *, ValueDecl *, unsigned,
5053 OMPClauseMappableExprCommon::MappableComponent> {
5069 SourceLocation LParenLoc,
5070 SourceLocation EndLoc,
unsigned NumVars,
5071 unsigned NumUniqueDeclarations,
5072 unsigned NumComponentLists,
5073 unsigned NumComponents)
5075 EndLoc, NumVars, NumUniqueDeclarations,
5076 NumComponentLists, NumComponents) {}
5086 unsigned NumUniqueDeclarations,
5087 unsigned NumComponentLists,
5088 unsigned NumComponents)
5090 SourceLocation(), SourceLocation(), NumVars,
5091 NumUniqueDeclarations, NumComponentLists,
5096 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
5097 return 3 * varlist_size();
5099 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
5100 return getUniqueDeclarationsNum();
5102 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
5103 return getUniqueDeclarationsNum() + getTotalComponentListNum();
5109 void setPrivateCopies(ArrayRef<Expr *> VL);
5113 MutableArrayRef<Expr *> getPrivateCopies() {
5114 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
5116 ArrayRef<const Expr *> getPrivateCopies()
const {
5117 return llvm::makeArrayRef(varlist_end(), varlist_size());
5123 void setInits(ArrayRef<Expr *> VL);
5127 MutableArrayRef<Expr *>
getInits() {
5128 return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
5130 ArrayRef<const Expr *>
getInits()
const {
5131 return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
5146 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
5147 SourceLocation EndLoc, ArrayRef<Expr *> Vars,
5148 ArrayRef<Expr *> PrivateVars, ArrayRef<Expr *>
Inits,
5149 ArrayRef<ValueDecl *> Declarations,
5163 unsigned NumUniqueDeclarations,
5164 unsigned NumComponentLists,
5165 unsigned NumComponents);
5171 llvm::iterator_range<private_copies_const_iterator>;
5175 getPrivateCopies().end());
5180 getPrivateCopies().end());
5197 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
5198 reinterpret_cast<Stmt **>(varlist_end()));
5202 return T->getClauseKind() == OMPC_use_device_ptr;
5217 OMPIsDevicePtrClause, Expr *, ValueDecl *, unsigned,
5218 OMPClauseMappableExprCommon::MappableComponent> {
5234 SourceLocation LParenLoc, SourceLocation EndLoc,
5236 unsigned NumUniqueDeclarations,
5237 unsigned NumComponentLists,
5238 unsigned NumComponents)
5240 EndLoc, NumVars, NumUniqueDeclarations,
5241 NumComponentLists, NumComponents) {}
5251 unsigned NumUniqueDeclarations,
5252 unsigned NumComponentLists,
5253 unsigned NumComponents)
5255 SourceLocation(), SourceLocation(), NumVars,
5256 NumUniqueDeclarations, NumComponentLists,
5261 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
5262 return varlist_size();
5264 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
5265 return getUniqueDeclarationsNum();
5267 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
5268 return getUniqueDeclarationsNum() + getTotalComponentListNum();
5281 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
5282 SourceLocation EndLoc, ArrayRef<Expr *> Vars,
5283 ArrayRef<ValueDecl *> Declarations,
5297 unsigned NumUniqueDeclarations,
5298 unsigned NumComponentLists,
5299 unsigned NumComponents);
5302 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
5303 reinterpret_cast<Stmt **>(varlist_end()));
5307 return T->getClauseKind() == OMPC_is_device_ptr;
5313 template<
class ImplClass,
template <
typename>
class Ptr,
typename RetTy>
5316 #define PTR(CLASS) typename Ptr<CLASS>::type 5317 #define DISPATCH(CLASS) \ 5318 return static_cast<ImplClass*>(this)->Visit##CLASS(static_cast<PTR(CLASS)>(S)) 5320 #define OPENMP_CLAUSE(Name, Class) \ 5321 RetTy Visit ## Class (PTR(Class) S) { DISPATCH(Class); } 5322 #include "clang/Basic/OpenMPKinds.def" 5326 switch (S->getClauseKind()) {
5327 default: llvm_unreachable(
"Unknown clause kind!");
5328 #define OPENMP_CLAUSE(Name, Class) \ 5329 case OMPC_ ## Name : return Visit ## Class(static_cast<PTR(Class)>(S)); 5330 #include "clang/Basic/OpenMPKinds.def" 5339 template <
typename T>
5342 template<
class ImplClass,
typename RetTy =
void>
5345 template<
class ImplClass,
typename RetTy =
void>
5351 const PrintingPolicy &Policy;
5354 template <
typename T>
void VisitOMPClauseList(T *
Node,
char StartSym);
5358 : OS(OS), Policy(Policy) {}
5360 #define OPENMP_CLAUSE(Name, Class) void Visit##Class(Class *S); 5361 #include "clang/Basic/OpenMPKinds.def" 5366 #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.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
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.
typename std::add_pointer< typename std::add_const< T >::type > const_ptr
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.
This represents 'atomic_default_mem_order' clause in the '#pragma omp requires' directive.
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.
SourceLocation getAtomicDefaultMemOrderKindKwLoc() const
Returns location of clause kind.
OMPUnifiedAddressClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'unified_address' clause.
helper_expr_const_range assignment_ops() const
This class implements a simple visitor for OMPClause subclasses.
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.
OMPAtomicDefaultMemOrderClause()
Build an empty clause.
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.
OpenMPMapModifierKind getMapTypeModifier(unsigned Cnt) const LLVM_READONLY
Fetches the map-type-modifier at 'Cnt' index of array of modifiers.
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.
OMPAtomicDefaultMemOrderClause(OpenMPAtomicDefaultMemOrderClauseKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'atomic_default_mem_order' clause with argument A ('seq_cst', 'acq_rel' or 'relaxed').
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.
This represents 'reverse_offload' clause in the '#pragma omp requires' directive. ...
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
OpenMPMapModifierKind
OpenMP modifier kind for 'map' clause.
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()
RetTy Visit(PTR(OMPClause) S)
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.
ArrayRef< SourceLocation > getMapTypeModifiersLoc() const LLVM_READONLY
Fetches ArrayRef of location of map-type-modifiers.
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)
OMPUnifiedSharedMemoryClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'unified_shared_memory' clause.
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.
SourceLocation getMapTypeModifierLoc(unsigned Cnt) const LLVM_READONLY
Fetches the map-type-modifier location at 'Cnt' index of array of modifiers' locations.
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.
RetTy VisitOMPClause(PTR(OMPClause) Node)
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.
This represents 'dynamic_allocators' clause in the '#pragma omp requires' directive.
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.
SourceLocation getLParenLoc() const
Returns the locaiton of '('.
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.
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 '('.
OMPDynamicAllocatorsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'dynamic_allocators' clause.
static bool classof(const OMPClause *T)
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 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
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
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
static bool classof(const OMPClause *T)
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.
static bool classof(const OMPClause *T)
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)
This represents 'unified_address' clause in the '#pragma omp requires' directive. ...
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.
OMPClausePrinter(raw_ostream &OS, const PrintingPolicy &Policy)
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OpenMPDirectiveKind
OpenMP directives.
OMPDynamicAllocatorsClause()
Build an empty clause.
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
static bool classof(const OMPClause *T)
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.
void setVarRefs(ArrayRef< Expr *> VL)
Sets the list of variables for this clause.
OMPUnifiedSharedMemoryClause()
Build an empty 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
OpenMPDirectiveKind getCaptureRegion() const
Get capture region for the stmt in the clause.
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.
ast_type_traits::DynTypedNode Node
ArrayRef< OpenMPMapModifierKind > getMapTypeModifiers() const LLVM_READONLY
Fetches ArrayRef of map-type-modifiers.
llvm::iterator_range< const_all_decls_iterator > const_all_decls_range
Optional< types::ID > Type
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)
OpenMPAtomicDefaultMemOrderClauseKind
OpenMP attributes for 'atomic_default_mem_order' clause.
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 'unified_shared_memory' clause in the '#pragma omp requires' directive.
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
Returns the starting location of the clause.
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
Returns the ending location of the clause.
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
OMPUnifiedAddressClause()
Build an empty clause.
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.
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.
OMPReverseOffloadClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'reverse_offload' clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
OMPClauseWithPostUpdate(const OMPClause *This)
static bool classof(const OMPClause *T)
OMPReverseOffloadClause()
Build an empty clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
OpenMPAtomicDefaultMemOrderClauseKind getAtomicDefaultMemOrderKind() const
Returns kind of the clause.
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
SourceLocation ColonLoc
Location of ':'.
const_child_range children() const
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)