16 #ifndef LLVM_CLANG_AST_OPENMPCLAUSE_H
17 #define LLVM_CLANG_AST_OPENMPCLAUSE_H
23 #include "llvm/ADT/MapVector.h"
43 : StartLoc(StartLoc), EndLoc(EndLoc),
Kind(K) {}
87 CaptureRegion = ThisRegion;
91 assert(
get(This) &&
"get is not tuned for pre-init.");
116 assert(
get(This) &&
"get is not tuned for post-update.");
142 static_cast<T *
>(
this)->
template getTrailingObjects<Expr *>(), NumVars);
147 assert(VL.size() == NumVars &&
148 "Number of variables is not the same as the preallocated buffer");
149 std::copy(VL.begin(), VL.end(),
150 static_cast<T *
>(
this)->
template getTrailingObjects<Expr *>());
163 :
OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
193 return llvm::makeArrayRef(
194 static_cast<const T *>(
this)->
template getTrailingObjects<Expr *>(),
222 void setCondition(
Expr *Cond) { Condition = Cond; }
228 void setNameModifierLoc(SourceLocation Loc) { NameModifierLoc = Loc; }
252 LParenLoc(LParenLoc), Condition(Cond), ColonLoc(ColonLoc),
253 NameModifier(NameModifier), NameModifierLoc(NameModifierLoc) {
304 void setCondition(
Expr *Cond) { Condition = Cond; }
316 :
OMPClause(OMPC_final, StartLoc, EndLoc), LParenLoc(LParenLoc),
358 void setNumThreads(
Expr *NThreads) { NumThreads = NThreads; }
375 :
OMPClause(OMPC_num_threads, StartLoc, EndLoc),
377 NumThreads(NumThreads) {
386 NumThreads(nullptr) {}
424 void setSafelen(
Expr *Len) { Safelen = Len; }
435 :
OMPClause(OMPC_safelen, StartLoc, EndLoc), LParenLoc(LParenLoc),
479 void setSimdlen(
Expr *Len) { Simdlen = Len; }
490 :
OMPClause(OMPC_simdlen, StartLoc, EndLoc), LParenLoc(LParenLoc),
534 void setNumForLoops(
Expr *Num) { NumForLoops = Num; }
546 :
OMPClause(OMPC_collapse, StartLoc, EndLoc), LParenLoc(LParenLoc),
597 void setDefaultKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
611 :
OMPClause(OMPC_default, StartLoc, EndLoc), LParenLoc(LParenLoc),
612 Kind(A), KindKwLoc(ALoc) {}
669 void setProcBindKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
684 :
OMPClause(OMPC_proc_bind, StartLoc, EndLoc), LParenLoc(LParenLoc),
685 Kind(A), KindKwLoc(ALoc) {}
729 enum {FIRST, SECOND, NUM_MODIFIERS};
750 Modifiers[FIRST] = M;
757 Modifiers[SECOND] = M;
761 void setFirstScheduleModifierLoc(SourceLocation Loc) {
762 ModifiersLoc[FIRST] = Loc;
766 void setSecondScheduleModifierLoc(SourceLocation Loc) {
767 ModifiersLoc[SECOND] = Loc;
775 Modifiers[FIRST] = M;
778 Modifiers[SECOND] = M;
785 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
790 void setScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
795 void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
800 void setChunkSize(Expr *
E) { ChunkSize =
E; }
822 Expr *ChunkSize,
Stmt *HelperChunkSize,
826 LParenLoc(LParenLoc), Kind(Kind), KindLoc(KLoc), CommaLoc(CommaLoc),
827 ChunkSize(ChunkSize) {
829 Modifiers[FIRST] = M1;
830 Modifiers[SECOND] = M2;
831 ModifiersLoc[FIRST] = M1Loc;
832 ModifiersLoc[SECOND] = M2Loc;
851 return Modifiers[FIRST];
856 return Modifiers[SECOND];
867 return ModifiersLoc[FIRST];
872 return ModifiersLoc[SECOND];
889 return child_range(reinterpret_cast<Stmt **>(&ChunkSize),
890 reinterpret_cast<Stmt **>(&ChunkSize) + 1);
910 void setNumForLoops(
Expr *Num) { NumForLoops = Num; }
922 :
OMPClause(OMPC_ordered, StartLoc, EndLoc), LParenLoc(LParenLoc),
961 :
OMPClause(OMPC_nowait, StartLoc, EndLoc) {}
992 :
OMPClause(OMPC_untied, StartLoc, EndLoc) {}
1024 :
OMPClause(OMPC_mergeable, StartLoc, EndLoc) {}
1055 :
OMPClause(OMPC_read, StartLoc, EndLoc) {}
1085 :
OMPClause(OMPC_write, StartLoc, EndLoc) {}
1117 :
OMPClause(OMPC_update, StartLoc, EndLoc) {}
1149 :
OMPClause(OMPC_capture, StartLoc, EndLoc) {}
1181 :
OMPClause(OMPC_seq_cst, StartLoc, EndLoc) {}
1208 friend TrailingObjects;
1235 void setPrivateCopies(ArrayRef<Expr *> VL);
1239 MutableArrayRef<Expr *> getPrivateCopies() {
1242 ArrayRef<const Expr *> getPrivateCopies()
const {
1256 static OMPPrivateClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
1257 SourceLocation LParenLoc,
1258 SourceLocation EndLoc, ArrayRef<Expr *> VL,
1259 ArrayRef<Expr *> PrivateVL);
1265 static OMPPrivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
1270 typedef llvm::iterator_range<private_copies_const_iterator>
1275 getPrivateCopies().end());
1279 getPrivateCopies().end());
1305 friend TrailingObjects;
1319 LParenLoc, EndLoc, N),
1334 void setPrivateCopies(ArrayRef<Expr *> VL);
1338 MutableArrayRef<Expr *> getPrivateCopies() {
1341 ArrayRef<const Expr *> getPrivateCopies()
const {
1348 void setInits(ArrayRef<Expr *> VL);
1352 MutableArrayRef<Expr *>
getInits() {
1353 return MutableArrayRef<Expr *>(getPrivateCopies().end(),
varlist_size());
1355 ArrayRef<const Expr *>
getInits()
const {
1356 return llvm::makeArrayRef(getPrivateCopies().end(),
varlist_size());
1374 static OMPFirstprivateClause *
1375 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
1376 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PrivateVL,
1377 ArrayRef<Expr *> InitVL, Stmt *PreInit);
1383 static OMPFirstprivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
1388 typedef llvm::iterator_range<private_copies_const_iterator>
1393 getPrivateCopies().end());
1397 getPrivateCopies().end());
1451 friend TrailingObjects;
1465 LParenLoc, EndLoc, N),
1480 MutableArrayRef<Expr *> getPrivateCopies() {
1483 ArrayRef<const Expr *> getPrivateCopies()
const {
1491 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
1494 MutableArrayRef<Expr *> getSourceExprs() {
1495 return MutableArrayRef<Expr *>(getPrivateCopies().end(),
varlist_size());
1497 ArrayRef<const Expr *> getSourceExprs()
const {
1498 return llvm::makeArrayRef(getPrivateCopies().end(),
varlist_size());
1505 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
1508 MutableArrayRef<Expr *> getDestinationExprs() {
1509 return MutableArrayRef<Expr *>(getSourceExprs().end(),
varlist_size());
1511 ArrayRef<const Expr *> getDestinationExprs()
const {
1512 return llvm::makeArrayRef(getSourceExprs().end(),
varlist_size());
1518 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
1521 MutableArrayRef<Expr *> getAssignmentOps() {
1522 return MutableArrayRef<Expr *>(getDestinationExprs().end(),
varlist_size());
1524 ArrayRef<const Expr *> getAssignmentOps()
const {
1525 return llvm::makeArrayRef(getDestinationExprs().end(),
varlist_size());
1554 static OMPLastprivateClause *
1555 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
1556 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
1557 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps,
1558 Stmt *PreInit, Expr *PostUpdate);
1564 static OMPLastprivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
1569 typedef llvm::iterator_range<helper_expr_const_iterator>
1578 getPrivateCopies().end());
1582 getPrivateCopies().end());
1586 getSourceExprs().end());
1593 getDestinationExprs().end());
1597 getDestinationExprs().end());
1601 getAssignmentOps().end());
1605 getAssignmentOps().end());
1629 friend TrailingObjects;
1694 friend TrailingObjects;
1719 LParenLoc, EndLoc, N),
1721 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
1736 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
1738 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
1756 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
1759 MutableArrayRef<Expr *> getLHSExprs() {
1762 ArrayRef<const Expr *> getLHSExprs()
const {
1771 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
1774 MutableArrayRef<Expr *> getRHSExprs() {
1775 return MutableArrayRef<Expr *>(getLHSExprs().end(),
varlist_size());
1777 ArrayRef<const Expr *> getRHSExprs()
const {
1778 return llvm::makeArrayRef(getLHSExprs().end(),
varlist_size());
1785 void setReductionOps(ArrayRef<Expr *> ReductionOps);
1788 MutableArrayRef<Expr *> getReductionOps() {
1789 return MutableArrayRef<Expr *>(getRHSExprs().end(),
varlist_size());
1791 ArrayRef<const Expr *> getReductionOps()
const {
1792 return llvm::makeArrayRef(getRHSExprs().end(),
varlist_size());
1829 static OMPReductionClause *
1830 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
1831 SourceLocation
ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
1832 NestedNameSpecifierLoc QualifierLoc,
1833 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *>
Privates,
1834 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
1835 ArrayRef<Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate);
1841 static OMPReductionClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
1853 typedef llvm::iterator_range<helper_expr_const_iterator>
1876 getReductionOps().end());
1880 getReductionOps().end());
1906 friend TrailingObjects;
1931 LParenLoc, EndLoc, N),
1933 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
1948 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
1950 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
1967 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
1970 MutableArrayRef<Expr *> getLHSExprs() {
1973 ArrayRef<const Expr *> getLHSExprs()
const {
1981 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
1984 MutableArrayRef<Expr *> getRHSExprs() {
1985 return MutableArrayRef<Expr *>(getLHSExprs().end(),
varlist_size());
1987 ArrayRef<const Expr *> getRHSExprs()
const {
1988 return llvm::makeArrayRef(getLHSExprs().end(),
varlist_size());
1995 void setReductionOps(ArrayRef<Expr *> ReductionOps);
1998 MutableArrayRef<Expr *> getReductionOps() {
1999 return MutableArrayRef<Expr *>(getRHSExprs().end(),
varlist_size());
2001 ArrayRef<const Expr *> getReductionOps()
const {
2002 return llvm::makeArrayRef(getRHSExprs().end(),
varlist_size());
2039 static OMPTaskReductionClause *
2040 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
2041 SourceLocation
ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
2042 NestedNameSpecifierLoc QualifierLoc,
2043 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *>
Privates,
2044 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
2045 ArrayRef<Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate);
2052 static OMPTaskReductionClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
2064 typedef llvm::iterator_range<helper_expr_const_iterator>
2087 getReductionOps().end());
2091 getReductionOps().end());
2117 friend TrailingObjects;
2143 SourceLocation
ColonLoc, SourceLocation EndLoc,
2148 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc) {}
2156 SourceLocation(), SourceLocation(),
2184 ArrayRef<const Expr *>
getInits()
const {
2200 ArrayRef<const Expr *>
getFinals()
const {
2210 void setInits(ArrayRef<Expr *> IL);
2233 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
2235 SourceLocation
ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
2236 ArrayRef<Expr *> PL, ArrayRef<Expr *> IL, Expr *Step, Expr *CalcStep,
2237 Stmt *PreInit, Expr *PostUpdate);
2355 void setAlignment(Expr *A) { *varlist_end() = A; }
2366 SourceLocation
ColonLoc, SourceLocation EndLoc,
2370 ColonLoc(ColonLoc) {}
2378 SourceLocation(), SourceLocation(),
2393 SourceLocation LParenLoc,
2395 SourceLocation EndLoc, ArrayRef<Expr *> VL,
2416 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2417 reinterpret_cast<Stmt **>(varlist_end()));
2421 return T->getClauseKind() == OMPC_aligned;
2460 SourceLocation EndLoc,
unsigned N)
2470 SourceLocation(), SourceLocation(),
2476 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
2479 MutableArrayRef<Expr *> getSourceExprs() {
2480 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2482 ArrayRef<const Expr *> getSourceExprs()
const {
2483 return llvm::makeArrayRef(varlist_end(), varlist_size());
2489 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
2492 MutableArrayRef<Expr *> getDestinationExprs() {
2493 return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
2495 ArrayRef<const Expr *> getDestinationExprs()
const {
2496 return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
2503 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
2506 MutableArrayRef<Expr *> getAssignmentOps() {
2507 return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
2509 ArrayRef<const Expr *> getAssignmentOps()
const {
2510 return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
2537 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
2538 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
2539 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
2550 typedef llvm::iterator_range<helper_expr_const_iterator>
2555 getSourceExprs().end());
2562 getDestinationExprs().end());
2566 getDestinationExprs().end());
2570 getAssignmentOps().end());
2574 getAssignmentOps().end());
2578 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2579 reinterpret_cast<Stmt **>(varlist_end()));
2583 return T->getClauseKind() == OMPC_copyin;
2610 SourceLocation EndLoc,
unsigned N)
2612 LParenLoc, EndLoc, N) {}
2620 OMPC_copyprivate, SourceLocation(), SourceLocation(),
2621 SourceLocation(), N) {}
2626 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
2629 MutableArrayRef<Expr *> getSourceExprs() {
2630 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2632 ArrayRef<const Expr *> getSourceExprs()
const {
2633 return llvm::makeArrayRef(varlist_end(), varlist_size());
2639 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
2642 MutableArrayRef<Expr *> getDestinationExprs() {
2643 return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
2645 ArrayRef<const Expr *> getDestinationExprs()
const {
2646 return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
2653 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
2656 MutableArrayRef<Expr *> getAssignmentOps() {
2657 return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
2659 ArrayRef<const Expr *> getAssignmentOps()
const {
2660 return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
2686 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
2687 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
2688 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
2699 typedef llvm::iterator_range<helper_expr_const_iterator>
2704 getSourceExprs().end());
2711 getDestinationExprs().end());
2715 getDestinationExprs().end());
2719 getAssignmentOps().end());
2723 getAssignmentOps().end());
2727 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2728 reinterpret_cast<Stmt **>(varlist_end()));
2732 return T->getClauseKind() == OMPC_copyprivate;
2761 OMPFlushClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2762 SourceLocation EndLoc,
unsigned N)
2763 : OMPVarListClause<OMPFlushClause>(OMPC_flush, StartLoc, LParenLoc,
2771 : OMPVarListClause<OMPFlushClause>(OMPC_flush, SourceLocation(),
2772 SourceLocation(), SourceLocation(),
2785 SourceLocation LParenLoc, SourceLocation EndLoc,
2786 ArrayRef<Expr *> VL);
2795 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2796 reinterpret_cast<Stmt **>(varlist_end()));
2800 return T->getClauseKind() == OMPC_flush;
2822 SourceLocation DepLoc;
2833 SourceLocation EndLoc,
unsigned N)
2844 SourceLocation(), SourceLocation(),
2851 void setDependencyLoc(SourceLocation Loc) { DepLoc = Loc; }
2868 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
2870 SourceLocation DepLoc, SourceLocation
ColonLoc, ArrayRef<Expr *> VL);
2887 void setCounterValue(Expr *V);
2889 Expr *getCounterValue();
2891 const Expr *getCounterValue()
const;
2894 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2895 reinterpret_cast<Stmt **>(varlist_end()));
2899 return T->getClauseKind() == OMPC_depend;
2915 SourceLocation LParenLoc;
2922 void setDevice(Expr *
E) { Device =
E; }
2933 SourceLocation EndLoc)
2934 :
OMPClause(OMPC_device, StartLoc, EndLoc), LParenLoc(LParenLoc),
2940 :
OMPClause(OMPC_device, SourceLocation(), SourceLocation()),
2941 LParenLoc(SourceLocation()), Device(nullptr) {}
2952 return T->getClauseKind() == OMPC_device;
2955 child_range
children() {
return child_range(&Device, &Device + 1); }
2973 :
OMPClause(OMPC_threads, StartLoc, EndLoc) {}
2978 :
OMPClause(OMPC_threads, SourceLocation(), SourceLocation()) {}
2981 return T->getClauseKind() == OMPC_threads;
2985 return child_range(child_iterator(), child_iterator());
3004 :
OMPClause(OMPC_simd, StartLoc, EndLoc) {}
3011 return T->getClauseKind() == OMPC_simd;
3015 return child_range(child_iterator(), child_iterator());
3031 Expr *AssociatedExpression =
nullptr;
3035 ValueDecl *AssociatedDeclaration =
nullptr;
3040 ValueDecl *AssociatedDeclaration)
3041 : AssociatedExpression(AssociatedExpression),
3042 AssociatedDeclaration(
3043 AssociatedDeclaration
3049 return AssociatedDeclaration;
3072 getUniqueDeclarationsTotalNumber(ArrayRef<ValueDecl *> Declarations);
3085 unsigned NumUniqueDeclarations;
3088 unsigned NumComponentLists;
3091 unsigned NumComponents;
3097 return MutableArrayRef<ValueDecl *>(
3098 static_cast<T *
>(
this)->
template getTrailingObjects<ValueDecl *>(),
3099 NumUniqueDeclarations);
3105 return ArrayRef<ValueDecl *>(
3106 static_cast<const T *
>(
this)
3107 ->
template getTrailingObjects<ValueDecl *>(),
3108 NumUniqueDeclarations);
3114 assert(UDs.size() == NumUniqueDeclarations &&
3115 "Unexpected amount of unique declarations.");
3116 std::copy(UDs.begin(), UDs.end(), getUniqueDeclsRef().begin());
3122 return MutableArrayRef<unsigned>(
3123 static_cast<T *
>(
this)->
template getTrailingObjects<unsigned>(),
3124 NumUniqueDeclarations);
3130 return ArrayRef<unsigned>(
3131 static_cast<const T *
>(
this)->
template getTrailingObjects<unsigned>(),
3132 NumUniqueDeclarations);
3138 assert(DNLs.size() == NumUniqueDeclarations &&
3139 "Unexpected amount of list numbers.");
3140 std::copy(DNLs.begin(), DNLs.end(), getDeclNumListsRef().begin());
3146 return MutableArrayRef<unsigned>(
3147 static_cast<T *
>(
this)->
template getTrailingObjects<unsigned>() +
3148 NumUniqueDeclarations,
3155 return ArrayRef<unsigned>(
3156 static_cast<const T *
>(
this)->
template getTrailingObjects<unsigned>() +
3157 NumUniqueDeclarations,
3164 assert(CLSs.size() == NumComponentLists &&
3165 "Unexpected amount of component lists.");
3166 std::copy(CLSs.begin(), CLSs.end(), getComponentListSizesRef().begin());
3171 return MutableArrayRef<MappableComponent>(
3172 static_cast<T *
>(
this)
3173 ->
template getTrailingObjects<MappableComponent>(),
3179 return ArrayRef<MappableComponent>(
3180 static_cast<const T *
>(
this)
3181 ->
template getTrailingObjects<MappableComponent>(),
3189 ArrayRef<unsigned> CLSs) {
3190 assert(Components.size() == NumComponents &&
3191 "Unexpected amount of component lists.");
3192 assert(CLSs.size() == NumComponentLists &&
3193 "Unexpected amount of list sizes.");
3194 std::copy(Components.begin(), Components.end(), getComponentsRef().begin());
3203 assert(getUniqueDeclarationsTotalNumber(Declarations) ==
3204 NumUniqueDeclarations &&
3205 "Unexpected number of mappable expression info entries!");
3206 assert(getComponentsTotalNumber(ComponentLists) == NumComponents &&
3207 "Unexpected total number of components!");
3208 assert(Declarations.size() == ComponentLists.size() &&
3209 "Declaration and component lists size is not consistent!");
3210 assert(Declarations.size() == NumComponentLists &&
3211 "Unexpected declaration and component lists size!");
3216 llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
3219 auto CI = ComponentLists.begin();
3220 for (
auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
3222 assert(!CI->empty() &&
"Invalid component list!");
3223 ComponentListMap[*DI].push_back(*CI);
3228 auto UniqueDeclarations = getUniqueDeclsRef();
3229 auto UDI = UniqueDeclarations.begin();
3231 auto DeclNumLists = getDeclNumListsRef();
3232 auto DNLI = DeclNumLists.begin();
3234 auto ComponentListSizes = getComponentListSizesRef();
3235 auto CLSI = ComponentListSizes.begin();
3237 auto Components = getComponentsRef();
3238 auto CI = Components.begin();
3241 unsigned PrevSize = 0u;
3244 for (
auto &M : ComponentListMap) {
3261 PrevSize +=
C.size();
3268 CI = std::copy(
C.begin(),
C.end(), CI);
3289 SourceLocation LParenLoc, SourceLocation EndLoc,
3290 unsigned NumVars,
unsigned NumUniqueDeclarations,
3291 unsigned NumComponentLists,
unsigned NumComponents)
3293 NumUniqueDeclarations(NumUniqueDeclarations),
3294 NumComponentLists(NumComponentLists), NumComponents(NumComponents) {}
3308 :
public llvm::iterator_adaptor_base<
3309 const_component_lists_iterator,
3310 MappableExprComponentListRef::const_iterator,
3311 std::forward_iterator_tag, MappableComponent, ptrdiff_t,
3312 MappableComponent, MappableComponent> {
3314 ArrayRef<ValueDecl *>::iterator DeclCur;
3317 ArrayRef<unsigned>::iterator NumListsCur;
3320 unsigned RemainingLists;
3324 unsigned PrevListSize;
3328 ArrayRef<unsigned>::const_iterator ListSizeCur;
3329 ArrayRef<unsigned>::const_iterator ListSizeEnd;
3332 MappableExprComponentListRef::const_iterator
End;
3337 ArrayRef<ValueDecl *> UniqueDecls, ArrayRef<unsigned> DeclsListNum,
3338 ArrayRef<unsigned> CumulativeListSizes,
3341 Components.begin()),
3342 DeclCur(UniqueDecls.begin()), NumListsCur(DeclsListNum.begin()),
3343 RemainingLists(0u), PrevListSize(0u),
3344 ListSizeCur(CumulativeListSizes.begin()),
3345 ListSizeEnd(CumulativeListSizes.end()),
End(Components.end()) {
3346 assert(UniqueDecls.size() == DeclsListNum.size() &&
3347 "Inconsistent number of declarations and list sizes!");
3348 if (!DeclsListNum.empty())
3349 RemainingLists = *NumListsCur;
3355 const ValueDecl *Declaration, ArrayRef<ValueDecl *> UniqueDecls,
3356 ArrayRef<unsigned> DeclsListNum, ArrayRef<unsigned> CumulativeListSizes,
3359 CumulativeListSizes, Components) {
3364 for (; DeclCur != UniqueDecls.end(); ++DeclCur, ++NumListsCur) {
3365 if (*DeclCur == Declaration)
3368 assert(*NumListsCur > 0 &&
"No lists associated with declaration??");
3372 std::advance(ListSizeCur, *NumListsCur - 1);
3373 PrevListSize = *ListSizeCur;
3379 if (ListSizeCur == CumulativeListSizes.end()) {
3381 RemainingLists = 0u;
3387 RemainingLists = *NumListsCur;
3390 ListSizeEnd = ListSizeCur;
3391 std::advance(ListSizeEnd, RemainingLists);
3395 std::advance(this->
I, PrevListSize);
3400 std::pair<const ValueDecl *, MappableExprComponentListRef>
3402 assert(ListSizeCur != ListSizeEnd &&
"Invalid iterator!");
3403 return std::make_pair(
3407 std::pair<const ValueDecl *, MappableExprComponentListRef>
3414 assert(ListSizeCur != ListSizeEnd && RemainingLists &&
3415 "Invalid iterator!");
3419 if (std::next(ListSizeCur) == ListSizeEnd) {
3423 std::advance(this->
I, *ListSizeCur - PrevListSize);
3424 PrevListSize = *ListSizeCur;
3427 if (!(--RemainingLists)) {
3430 RemainingLists = *NumListsCur;
3431 assert(RemainingLists &&
"No lists in the following declaration??");
3440 typedef llvm::iterator_range<const_component_lists_iterator>
3445 return const_component_lists_iterator(
3446 getUniqueDeclsRef(), getDeclNumListsRef(), getComponentListSizesRef(),
3447 getComponentsRef());
3450 return const_component_lists_iterator(
3451 ArrayRef<ValueDecl *>(), ArrayRef<unsigned>(), ArrayRef<unsigned>(),
3453 getComponentsRef().end()));
3456 return {component_lists_begin(), component_lists_end()};
3461 const_component_lists_iterator
3463 return const_component_lists_iterator(
3464 VD, getUniqueDeclsRef(), getDeclNumListsRef(),
3465 getComponentListSizesRef(), getComponentsRef());
3468 return component_lists_end();
3471 return {decl_component_lists_begin(VD), decl_component_lists_end()};
3479 auto A = getUniqueDeclsRef();
3484 typedef llvm::iterator_range<const_all_num_lists_iterator>
3487 auto A = getDeclNumListsRef();
3492 typedef llvm::iterator_range<const_all_lists_sizes_iterator>
3495 auto A = getComponentListSizesRef();
3500 typedef llvm::iterator_range<const_all_components_iterator>
3503 auto A = getComponentsRef();
3519 OMPMapClause, Expr *, ValueDecl *, unsigned,
3520 OMPClauseMappableExprCommon::MappableComponent> {
3528 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
3529 return varlist_size();
3531 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
3532 return getUniqueDeclarationsNum();
3534 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
3535 return getUniqueDeclarationsNum() + getTotalComponentListNum();
3543 bool MapTypeIsImplicit;
3545 SourceLocation MapLoc;
3565 void setMapLoc(SourceLocation TLoc) { MapLoc = TLoc; }
3588 SourceLocation MapLoc, SourceLocation StartLoc,
3589 SourceLocation LParenLoc, SourceLocation EndLoc,
3590 unsigned NumVars,
unsigned NumUniqueDeclarations,
3591 unsigned NumComponentLists,
unsigned NumComponents)
3593 NumVars, NumUniqueDeclarations,
3594 NumComponentLists, NumComponents),
3595 MapTypeModifier(MapTypeModifier), MapType(MapType),
3596 MapTypeIsImplicit(MapTypeIsImplicit), MapLoc(MapLoc) {}
3606 explicit OMPMapClause(
unsigned NumVars,
unsigned NumUniqueDeclarations,
3607 unsigned NumComponentLists,
unsigned NumComponents)
3609 OMPC_map, SourceLocation(), SourceLocation(), SourceLocation(),
3610 NumVars, NumUniqueDeclarations, NumComponentLists, NumComponents),
3612 MapTypeIsImplicit(
false), MapLoc() {}
3629 SourceLocation LParenLoc, SourceLocation EndLoc,
3630 ArrayRef<Expr *> Vars,
3631 ArrayRef<ValueDecl *> Declarations,
3632 MappableExprComponentListsRef ComponentLists,
3635 SourceLocation TypeLoc);
3649 unsigned NumUniqueDeclarations,
3650 unsigned NumComponentLists,
3651 unsigned NumComponents);
3665 return MapTypeModifier;
3669 SourceLocation
getMapLoc() const LLVM_READONLY {
return MapLoc; }
3675 return T->getClauseKind() == OMPC_map;
3680 reinterpret_cast<Stmt **>(varlist_begin()),
3681 reinterpret_cast<Stmt **>(varlist_end()));
3697 SourceLocation LParenLoc;
3704 void setNumTeams(Expr *
E) { NumTeams =
E; }
3718 SourceLocation StartLoc, SourceLocation LParenLoc,
3719 SourceLocation EndLoc)
3721 LParenLoc(LParenLoc), NumTeams(E) {
3722 setPreInitStmt(HelperE, CaptureRegion);
3728 :
OMPClause(OMPC_num_teams, SourceLocation(), SourceLocation()),
3730 NumTeams(nullptr) {}
3741 return T->getClauseKind() == OMPC_num_teams;
3744 child_range
children() {
return child_range(&NumTeams, &NumTeams + 1); }
3759 SourceLocation LParenLoc;
3766 void setThreadLimit(Expr *
E) { ThreadLimit =
E; }
3781 SourceLocation StartLoc, SourceLocation LParenLoc,
3782 SourceLocation EndLoc)
3783 :
OMPClause(OMPC_thread_limit, StartLoc, EndLoc),
3785 setPreInitStmt(HelperE, CaptureRegion);
3791 :
OMPClause(OMPC_thread_limit, SourceLocation(), SourceLocation()),
3793 ThreadLimit(nullptr) {}
3804 return T->getClauseKind() == OMPC_thread_limit;
3807 child_range
children() {
return child_range(&ThreadLimit, &ThreadLimit + 1); }
3822 SourceLocation LParenLoc;
3829 void setPriority(Expr *
E) { Priority =
E; }
3840 SourceLocation EndLoc)
3841 :
OMPClause(OMPC_priority, StartLoc, EndLoc), LParenLoc(LParenLoc),
3847 :
OMPClause(OMPC_priority, SourceLocation(), SourceLocation()),
3848 LParenLoc(SourceLocation()), Priority(nullptr) {}
3859 return T->getClauseKind() == OMPC_priority;
3862 child_range
children() {
return child_range(&Priority, &Priority + 1); }
3877 SourceLocation LParenLoc;
3882 void setGrainsize(Expr *Size) { Grainsize = Size; }
3892 SourceLocation LParenLoc, SourceLocation EndLoc)
3893 :
OMPClause(OMPC_grainsize, StartLoc, EndLoc), LParenLoc(LParenLoc),
3899 :
OMPClause(OMPC_grainsize, SourceLocation(), SourceLocation()),
3900 LParenLoc(SourceLocation()), Grainsize(nullptr) {}
3911 return T->getClauseKind() == OMPC_grainsize;
3914 child_range
children() {
return child_range(&Grainsize, &Grainsize + 1); }
3932 :
OMPClause(OMPC_nogroup, StartLoc, EndLoc) {}
3937 :
OMPClause(OMPC_nogroup, SourceLocation(), SourceLocation()) {}
3940 return T->getClauseKind() == OMPC_nogroup;
3944 return child_range(child_iterator(), child_iterator());
3960 SourceLocation LParenLoc;
3965 void setNumTasks(Expr *Size) { NumTasks = Size; }
3975 SourceLocation LParenLoc, SourceLocation EndLoc)
3976 :
OMPClause(OMPC_num_tasks, StartLoc, EndLoc), LParenLoc(LParenLoc),
3982 :
OMPClause(OMPC_num_tasks, SourceLocation(), SourceLocation()),
3983 LParenLoc(SourceLocation()), NumTasks(nullptr) {}
3994 return T->getClauseKind() == OMPC_num_tasks;
3997 child_range
children() {
return child_range(&NumTasks, &NumTasks + 1); }
4011 SourceLocation LParenLoc;
4017 void setHint(Expr *H) { Hint = H; }
4028 SourceLocation EndLoc)
4029 :
OMPClause(OMPC_hint, StartLoc, EndLoc), LParenLoc(LParenLoc),
4035 :
OMPClause(OMPC_hint, SourceLocation(), SourceLocation()),
4036 LParenLoc(SourceLocation()), Hint(nullptr) {}
4044 Expr *
getHint()
const {
return cast_or_null<Expr>(Hint); }
4047 return T->getClauseKind() == OMPC_hint;
4050 child_range
children() {
return child_range(&Hint, &Hint + 1); }
4065 SourceLocation LParenLoc;
4069 SourceLocation KindLoc;
4071 SourceLocation CommaLoc;
4084 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
4089 void setDistScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
4094 void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
4099 void setChunkSize(Expr *
E) { ChunkSize =
E; }
4115 SourceLocation KLoc, SourceLocation CommaLoc,
4116 SourceLocation EndLoc,
4118 Stmt *HelperChunkSize)
4119 :
OMPClause(OMPC_dist_schedule, StartLoc, EndLoc),
4121 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
4122 setPreInitStmt(HelperChunkSize);
4128 :
OMPClause(OMPC_dist_schedule, SourceLocation(), SourceLocation()),
4130 ChunkSize(nullptr) {}
4152 return T->getClauseKind() == OMPC_dist_schedule;
4156 return child_range(reinterpret_cast<Stmt **>(&ChunkSize),
4157 reinterpret_cast<Stmt **>(&ChunkSize) + 1);
4172 SourceLocation LParenLoc;
4180 SourceLocation KindLoc;
4196 void setDefaultmapModifierLoc(SourceLocation Loc) {
4203 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
4208 void setDefaultmapKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
4222 SourceLocation MLoc, SourceLocation KLoc,
4225 :
OMPClause(OMPC_defaultmap, StartLoc, EndLoc), LParenLoc(LParenLoc),
4231 :
OMPClause(OMPC_defaultmap, SourceLocation(), SourceLocation()),
4256 return T->getClauseKind() == OMPC_defaultmap;
4260 return child_range(child_iterator(), child_iterator());
4275 OMPToClause, Expr *, ValueDecl *, unsigned,
4276 OMPClauseMappableExprCommon::MappableComponent> {
4284 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4285 return varlist_size();
4287 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
4288 return getUniqueDeclarationsNum();
4290 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
4291 return getUniqueDeclarationsNum() + getTotalComponentListNum();
4304 explicit OMPToClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4305 SourceLocation EndLoc,
unsigned NumVars,
4306 unsigned NumUniqueDeclarations,
4307 unsigned NumComponentLists,
unsigned NumComponents)
4309 NumUniqueDeclarations, NumComponentLists,
4320 explicit OMPToClause(
unsigned NumVars,
unsigned NumUniqueDeclarations,
4321 unsigned NumComponentLists,
unsigned NumComponents)
4323 OMPC_to, SourceLocation(), SourceLocation(), SourceLocation(),
4324 NumVars, NumUniqueDeclarations, NumComponentLists, NumComponents) {}
4337 SourceLocation LParenLoc, SourceLocation EndLoc,
4338 ArrayRef<Expr *> Vars,
4339 ArrayRef<ValueDecl *> Declarations,
4340 MappableExprComponentListsRef ComponentLists);
4353 unsigned NumUniqueDeclarations,
4354 unsigned NumComponentLists,
4355 unsigned NumComponents);
4358 return T->getClauseKind() == OMPC_to;
4362 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
4363 reinterpret_cast<Stmt **>(varlist_end()));
4379 OMPFromClause, Expr *, ValueDecl *, unsigned,
4380 OMPClauseMappableExprCommon::MappableComponent> {
4388 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4389 return varlist_size();
4391 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
4392 return getUniqueDeclarationsNum();
4394 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
4395 return getUniqueDeclarationsNum() + getTotalComponentListNum();
4408 explicit OMPFromClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4409 SourceLocation EndLoc,
unsigned NumVars,
4410 unsigned NumUniqueDeclarations,
4411 unsigned NumComponentLists,
unsigned NumComponents)
4413 NumVars, NumUniqueDeclarations,
4414 NumComponentLists, NumComponents) {}
4424 explicit OMPFromClause(
unsigned NumVars,
unsigned NumUniqueDeclarations,
4425 unsigned NumComponentLists,
unsigned NumComponents)
4427 OMPC_from, SourceLocation(), SourceLocation(), SourceLocation(),
4428 NumVars, NumUniqueDeclarations, NumComponentLists, NumComponents) {}
4441 SourceLocation LParenLoc, SourceLocation EndLoc,
4442 ArrayRef<Expr *> Vars,
4443 ArrayRef<ValueDecl *> Declarations,
4444 MappableExprComponentListsRef ComponentLists);
4457 unsigned NumUniqueDeclarations,
4458 unsigned NumComponentLists,
4459 unsigned NumComponents);
4462 return T->getClauseKind() == OMPC_from;
4466 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
4467 reinterpret_cast<Stmt **>(varlist_end()));
4483 OMPUseDevicePtrClause, Expr *, ValueDecl *, unsigned,
4484 OMPClauseMappableExprCommon::MappableComponent> {
4492 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4493 return 3 * varlist_size();
4495 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
4496 return getUniqueDeclarationsNum();
4498 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
4499 return getUniqueDeclarationsNum() + getTotalComponentListNum();
4513 SourceLocation LParenLoc,
4514 SourceLocation EndLoc,
unsigned NumVars,
4515 unsigned NumUniqueDeclarations,
4516 unsigned NumComponentLists,
4517 unsigned NumComponents)
4519 EndLoc, NumVars, NumUniqueDeclarations,
4520 NumComponentLists, NumComponents) {}
4531 unsigned NumUniqueDeclarations,
4532 unsigned NumComponentLists,
4533 unsigned NumComponents)
4535 SourceLocation(), SourceLocation(), NumVars,
4536 NumUniqueDeclarations, NumComponentLists,
4542 void setPrivateCopies(ArrayRef<Expr *> VL);
4546 MutableArrayRef<Expr *> getPrivateCopies() {
4547 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
4549 ArrayRef<const Expr *> getPrivateCopies()
const {
4550 return llvm::makeArrayRef(varlist_end(), varlist_size());
4556 void setInits(ArrayRef<Expr *> VL);
4560 MutableArrayRef<Expr *>
getInits() {
4561 return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
4563 ArrayRef<const Expr *>
getInits()
const {
4564 return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
4580 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
4581 SourceLocation EndLoc, ArrayRef<Expr *> Vars,
4582 ArrayRef<Expr *> PrivateVars, ArrayRef<Expr *>
Inits,
4583 ArrayRef<ValueDecl *> Declarations,
4584 MappableExprComponentListsRef ComponentLists);
4598 unsigned NumUniqueDeclarations,
4599 unsigned NumComponentLists,
4600 unsigned NumComponents);
4605 typedef llvm::iterator_range<private_copies_const_iterator>
4610 getPrivateCopies().end());
4614 getPrivateCopies().end());
4630 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
4631 reinterpret_cast<Stmt **>(varlist_end()));
4635 return T->getClauseKind() == OMPC_use_device_ptr;
4651 OMPIsDevicePtrClause, Expr *, ValueDecl *, unsigned,
4652 OMPClauseMappableExprCommon::MappableComponent> {
4660 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4661 return varlist_size();
4663 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
4664 return getUniqueDeclarationsNum();
4666 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
4667 return getUniqueDeclarationsNum() + getTotalComponentListNum();
4680 SourceLocation LParenLoc, SourceLocation EndLoc,
4682 unsigned NumUniqueDeclarations,
4683 unsigned NumComponentLists,
4684 unsigned NumComponents)
4686 EndLoc, NumVars, NumUniqueDeclarations,
4687 NumComponentLists, NumComponents) {}
4698 unsigned NumUniqueDeclarations,
4699 unsigned NumComponentLists,
4700 unsigned NumComponents)
4702 SourceLocation(), SourceLocation(), NumVars,
4703 NumUniqueDeclarations, NumComponentLists,
4717 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
4718 SourceLocation EndLoc, ArrayRef<Expr *> Vars,
4719 ArrayRef<ValueDecl *> Declarations,
4720 MappableExprComponentListsRef ComponentLists);
4734 unsigned NumUniqueDeclarations,
4735 unsigned NumComponentLists,
4736 unsigned NumComponents);
4739 return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
4740 reinterpret_cast<Stmt **>(varlist_end()));
4744 return T->getClauseKind() == OMPC_is_device_ptr;
4749 #endif // LLVM_CLANG_AST_OPENMPCLAUSE_H
static OMPPrivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > PrivateVL)
Creates clause with a list of variables VL.
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.
private_copies_const_range private_copies() const
varlist_const_range varlists() const
helper_expr_range source_exprs()
OMPHintClause()
Build an empty clause.
static OMPReductionClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, ArrayRef< Expr * > Privates, ArrayRef< Expr * > LHSExprs, ArrayRef< Expr * > RHSExprs, ArrayRef< Expr * > ReductionOps, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL.
static const Decl * getCanonicalDecl(const Decl *D)
OMPUntiedClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'untied' clause.
OpenMPScheduleClauseModifier getSecondScheduleModifier() const
Get the second modifier of the clause.
llvm::iterator_range< private_copies_iterator > private_copies_range
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 getLParenLoc() const
Returns the location of '('.
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()
SourceLocation getColonLoc() const
Get colon location.
helper_expr_const_range source_exprs() const
const Expr * getChunkSize() const
Get chunk size.
static bool classof(const OMPClause *T)
std::pair< const ValueDecl *, MappableExprComponentListRef > operator*() const
MutableArrayRef< Expr * >::iterator inits_iterator
SourceLocation getCommaLoc()
Get location of ','.
helper_expr_range privates()
OpenMPDistScheduleClauseKind getDistScheduleKind() const
Get kind of the clause.
Expr * getSimdlen() const
Return safe iteration space distance.
OpenMPDefaultmapClauseKind
OpenMP attributes for 'defaultmap' clause.
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.
private_copies_range private_copies()
Stmt - This represents one statement.
static bool classof(const OMPClause *T)
Class that handles pre-initialization statement for some clauses, like 'shedule', 'firstprivate' etc...
static bool classof(const OMPClause *T)
ArrayRef< MappableComponent > MappableExprComponentListRef
helper_expr_range rhs_exprs()
OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'update' clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
OpenMPProcBindClauseKind getProcBindKind() const
Returns kind of the clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
static OMPFirstprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents 'grainsize' clause in the '#pragma omp ...' directive.
static bool classof(const OMPClause *T)
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
helper_expr_const_range lhs_exprs() const
llvm::iterator_range< child_iterator > child_range
This represents 'if' clause in the '#pragma omp ...' directive.
OpenMPDirectiveKind getCaptureRegion()
Get capture region for the stmt in the clause.
const_component_lists_range component_lists() const
private_copies_const_range private_copies() const
OMPSIMDClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'simd' clause.
This represents 'priority' clause in the '#pragma omp ...' directive.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
SourceLocation getColonLoc() const
Returns the location of ':'.
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.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
SourceLocation getLParenLoc() const
Returns the location of '('.
SourceLocation getColonLoc() const
Get colon location.
ArrayRef< const Expr * > getVarRefs() const
Fetches list of all variables in the clause.
OpenMPDefaultmapClauseModifier
OpenMP modifiers for 'defaultmap' clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
Expr * getAlignment()
Returns alignment.
OMPOrderedClause(Expr *Num, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'ordered' clause.
static OMPReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
llvm::iterator_range< const_all_decls_iterator > const_all_decls_range
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
static bool classof(const OMPClause *T)
This represents 'read' clause in the '#pragma omp atomic' directive.
OMPFinalClause()
Build an empty clause.
Expr * getNumTeams() const
Return NumTeams number.
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)
ArrayRef< const Expr * >::iterator private_copies_const_iterator
const Expr * getPostUpdateExpr() const
Get post-update expression for the clause.
This represents 'num_threads' clause in the '#pragma omp ...' directive.
This represents 'defaultmap' clause in the '#pragma omp ...' directive.
ArrayRef< MappableComponent >::iterator const_all_components_iterator
llvm::iterator_range< private_copies_iterator > private_copies_range
OpenMPDefaultmapClauseModifier getDefaultmapModifier() const
Get the modifier of the clause.
This represents clauses with a list of expressions that are mappable.
MutableArrayRef< Expr * >::iterator privates_iterator
bool varlist_empty() const
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
static bool classof(const OMPClause *T)
OMPNumTasksClause(Expr *Size, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'num_tasks' clause.
OMPNogroupClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'nogroup' clause.
Expr * getNumForLoops() const
Return the number of associated for-loops.
llvm::iterator_range< private_copies_iterator > private_copies_range
Struct that defines common infrastructure to handle mappable expressions used in OpenMP clauses...
static OMPTaskReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents 'nogroup' clause in the '#pragma omp ...' directive.
This represents 'safelen' clause in the '#pragma omp ...' directive.
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)
OMPHintClause(Expr *Hint, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'hint' clause with expression Hint.
SourceLocation getLParenLoc() const
Returns the location of '('.
Expr * getNumThreads() const
Returns number of threads.
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.
Expr * getAssociatedExpression() const
unsigned getTotalComponentListNum() const
Return the number of lists derived from the clause expressions.
SourceLocation getLParenLoc() const
Returns the location of '('.
static OMPSharedClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL)
Creates clause with a list of variables VL.
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
llvm::iterator_range< inits_iterator > inits_range
ArrayRef< const Expr * >::iterator updates_const_iterator
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.
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
ArrayRef< const Expr * >::iterator finals_const_iterator
ArrayRef< const Expr * >::iterator inits_const_iterator
This represents 'simd' clause in the '#pragma omp ...' directive.
const_component_lists_iterator(ArrayRef< ValueDecl * > UniqueDecls, ArrayRef< unsigned > DeclsListNum, ArrayRef< unsigned > CumulativeListSizes, MappableExprComponentListRef Components)
Construct an iterator that scans all lists.
OpenMPScheduleClauseModifier getFirstScheduleModifier() const
Get the first modifier of the clause.
static bool classof(const OMPClause *T)
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
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.
void setUpdates(ArrayRef< Expr * > UL)
Sets the list of update expressions for linear variables.
OMPPriorityClause(Expr *E, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'priority' clause.
SourceLocation getLocStart() const
Returns the starting location of the clause.
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
OMPVarListClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N)
Build a clause with N variables.
helper_expr_range privates()
varlist_iterator varlist_begin()
Expr * getChunkSize()
Get chunk size.
This represents clause 'map' in the '#pragma omp ...' directives.
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 ':'.
ArrayRef< const Expr * >::iterator private_copies_const_iterator
private_copies_const_range private_copies() const
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.
OMPPriorityClause()
Build an empty clause.
llvm::iterator_range< varlist_const_iterator > varlist_const_range
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
helper_expr_range lhs_exprs()
Expr * getNumTeams()
Return NumTeams number.
const_component_lists_iterator decl_component_lists_end() const
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
llvm::iterator_range< updates_iterator > updates_range
OMPDefaultmapClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc, SourceLocation KLoc, SourceLocation EndLoc, OpenMPDefaultmapClauseKind Kind, OpenMPDefaultmapClauseModifier M)
Build 'defaultmap' clause with defaultmap kind Kind.
llvm::iterator_range< private_copies_const_iterator > private_copies_const_range
unsigned getTotalComponentsNum() const
Return the total number of components in all lists derived from the clause.
MutableArrayRef< unsigned > getComponentListSizesRef()
Get the cumulative component lists sizes that are in the trailing objects of the class.
llvm::iterator_range< const_all_lists_sizes_iterator > const_all_lists_sizes_range
OMPSafelenClause()
Build an empty clause.
llvm::iterator_range< varlist_iterator > varlist_range
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
SourceLocation getFirstScheduleModifierLoc() const
Get the first modifier location.
llvm::iterator_range< const_component_lists_iterator > const_component_lists_range
void setModifierLoc(SourceLocation Loc)
Set modifier location.
void setCalcStep(Expr *CalcStep)
Sets the expression to calculate linear step for clause.
OpenMPLinearClauseKind getModifier() const
Return modifier.
helper_expr_range destination_exprs()
helper_expr_const_range private_copies() const
SourceLocation getDefaultmapKindLoc()
Get kind location.
void setFinals(ArrayRef< Expr * > FL)
Sets the list of final update expressions for linear variables.
llvm::iterator_range< privates_const_iterator > privates_const_range
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
llvm::iterator_range< inits_const_iterator > inits_const_range
static bool classof(const OMPClause *T)
helper_expr_const_range source_exprs() const
OpenMPScheduleClauseKind getScheduleKind() const
Get kind of the clause.
ArrayRef< ValueDecl * > getUniqueDeclsRef() const
Get the unique declarations that are in the trailing objects of the class.
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.
Expr * getThreadLimit() const
Return ThreadLimit number.
static bool classof(const OMPClause *T)
Class that handles post-update expression for some clauses, like 'lastprivate', 'reduction' etc...
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.
This represents 'final' clause in the '#pragma omp ...' directive.
This represents 'mergeable' clause in the '#pragma omp ...' directive.
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
SourceLocation getSecondScheduleModifierLoc() const
Get the second modifier location.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
llvm::iterator_range< helper_expr_iterator > helper_expr_range
This represents clause 'reduction' in the '#pragma omp ...' directives.
OMPNogroupClause()
Build an empty clause.
llvm::iterator_range< helper_expr_iterator > helper_expr_range
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.
Expr * getHint() const
Returns number of threads.
detail::InMemoryDirectory::const_iterator I
Expr * getPostUpdateExpr()
Get post-update expression for the clause.
static OMPTaskReductionClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, ArrayRef< Expr * > Privates, ArrayRef< Expr * > LHSExprs, ArrayRef< Expr * > RHSExprs, ArrayRef< Expr * > ReductionOps, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL.
static bool classof(const OMPClause *T)
llvm::iterator_range< finals_const_iterator > finals_const_range
OMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'seq_cst' clause.
void setModifier(OpenMPLinearClauseKind Kind)
Set modifier.
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.
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
OMPGrainsizeClause(Expr *Size, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'grainsize' clause.
OpenMPDefaultClauseKind getDefaultKind() const
Returns kind of the clause.
OpenMPClauseKind getClauseKind() const
Returns kind of OpenMP clause (private, shared, reduction, etc.).
OpenMPDependClauseKind getDependencyKind() const
Get dependency type.
OMPCollapseClause(Expr *Num, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'collapse' clause.
ArrayRef< unsigned >::iterator const_all_num_lists_iterator
SourceLocation getLocEnd() const
Returns the ending location of the clause.
static bool classof(const OMPClause *)
OMPDistScheduleClause()
Build an empty clause.
static bool classof(const OMPClause *T)
llvm::iterator_range< inits_const_iterator > inits_const_range
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.
const_child_range children() const
friend class OMPClauseReader
helper_expr_range assignment_ops()
SourceLocation getDefaultKindKwLoc() const
Returns location of clause kind.
OMPNowaitClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'nowait' clause.
This represents clause 'aligned' in the '#pragma omp ...' directives.
static bool classof(const OMPClause *T)
void setLocEnd(SourceLocation Loc)
Sets the ending location of the clause.
OMPWriteClause()
Build an empty clause.
MutableArrayRef< Expr * >::iterator varlist_iterator
static bool classof(const OMPClause *T)
OMPCaptureClause()
Build an empty clause.
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.
varlist_const_iterator varlist_end() const
static bool classof(const OMPClause *T)
helper_expr_range assignment_ops()
This represents implicit clause 'depend' for the '#pragma omp task' directive.
Expr * getStep()
Returns linear step.
SourceLocation getLParenLoc() const
Returns the location of '('.
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
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.
SourceLocation getMapLoc() const LLVM_READONLY
Fetches location of clause mapping kind.
llvm::iterator_range< inits_iterator > inits_range
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.
helper_expr_const_range assignment_ops() const
This represents 'simdlen' clause in the '#pragma omp ...' directive.
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
SourceLocation getScheduleKindLoc()
Get kind location.
ArrayRef< unsigned > getComponentListSizesRef() const
Get the cumulative component lists sizes that are in the trailing objects of the class.
SmallVector< MappableExprComponentList, 8 > MappableExprComponentLists
Expr * getCondition() const
Returns condition.
static bool classof(const OMPClause *T)
MutableArrayRef< Expr * > getVarRefs()
Fetches list of variables associated with this clause.
helper_expr_const_range reduction_ops() const
const Expr * getAlignment() const
Returns alignment.
void setInits(ArrayRef< Expr * > IL)
Sets the list of the initial values for linear variables.
OpenMPClauseKind
OpenMP clauses.
static bool classof(const OMPClause *T)
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
MutableArrayRef< Expr * >::iterator private_copies_iterator
SourceLocation getLParenLoc() const
Returns the location of '('.
inits_const_range inits() const
OpenMPDirectiveKind getNameModifier() const
Return directive name modifier associated with the clause.
static bool classof(const OMPClause *T)
llvm::iterator_range< const_child_iterator > const_child_range
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.
const_all_components_range all_components() const
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.
const_all_num_lists_range all_num_lists() const
SourceLocation getColonLoc() const
Return the location of ':'.
ArrayRef< const Expr * >::iterator varlist_const_iterator
static bool classof(const OMPClause *T)
SourceLocation getLParenLoc() const
Returns the location of '('.
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)
helper_expr_const_range rhs_exprs() const
void setPrivateCopies(ArrayRef< Expr * > PrivateCopies)
Set list of helper expressions, required for generation of private copies of original lastprivate var...
inits_const_range inits() const
ValueDecl * getAssociatedDeclaration() const
Expr * getDevice()
Return device number.
static OMPPrivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
SourceLocation getLParenLoc() const
Returns the location of '('.
This represents 'collapse' clause in the '#pragma omp ...' directive.
This represents clause 'firstprivate' in the '#pragma omp ...' directives.
SourceLocation getCommaLoc()
Get location of ','.
llvm::iterator_range< helper_expr_iterator > helper_expr_range
MutableArrayRef< Expr * >::iterator helper_expr_iterator
SourceLocation getProcBindKindKwLoc() const
Returns location of clause kind.
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
OpenMPProcBindClauseKind
OpenMP attributes for 'proc_bind' clause.
const_component_lists_range decl_component_lists(const ValueDecl *VD) const
const_component_lists_iterator component_lists_end() const
llvm::iterator_range< inits_const_iterator > inits_const_range
OMPThreadLimitClause()
Build an empty clause.
helper_expr_const_range privates() const
helper_expr_range destination_exprs()
helper_expr_const_range destination_exprs() const
This represents 'seq_cst' clause in the '#pragma omp atomic' directive.
This represents 'untied' clause in the '#pragma omp ...' directive.
SourceLocation getLParenLoc() const
Returns the location of '('.
helper_expr_range lhs_exprs()
static bool classof(const OMPClause *T)
ArrayRef< const Expr * >::iterator inits_const_iterator
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.
helper_expr_const_range privates() const
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()
void setUniqueDecls(ArrayRef< ValueDecl * > UDs)
Set the unique declarations that are in the trailing objects of the class.
This represents 'num_teams' clause in the '#pragma omp ...' directive.
OMPSimdlenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'simdlen' clause.
MutableArrayRef< Expr * >::iterator private_copies_iterator
SourceLocation getLParenLoc()
Get location of '('.
MappableComponent(Expr *AssociatedExpression, ValueDecl *AssociatedDeclaration)
helper_expr_range private_copies()
ArrayRef< const Expr * >::iterator inits_const_iterator
static OMPFirstprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > PrivateVL, ArrayRef< Expr * > InitVL, Stmt *PreInit)
Creates clause with a list of variables VL.
OMPCollapseClause()
Build an empty clause.
static bool classof(const OMPClause *T)
OMPThreadsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'threads' clause.
Expr * getNumForLoops() const
Return the number of associated for-loops.
Encodes a location in the source.
StmtIterator child_iterator
This represents 'hint' clause in the '#pragma omp ...' directive.
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
helper_expr_const_range reduction_ops() const
MutableArrayRef< Expr * > getInits()
helper_expr_range rhs_exprs()
SourceLocation getLParenLoc() const
Returns the location of '('.
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
private_copies_range private_copies()
void setVarRefs(ArrayRef< Expr * > VL)
Sets the list of variables for this clause.
const_component_lists_iterator decl_component_lists_begin(const ValueDecl *VD) const
Iterators for component lists associated with the provided declaration.
const_component_lists_iterator component_lists_begin() const
Iterators for all component lists.
Expr * getCondition() const
Returns condition.
helper_expr_const_range lhs_exprs() const
This represents 'schedule' clause in the '#pragma omp ...' directive.
OMPMergeableClause()
Build an empty clause.
MutableArrayRef< Expr * >::iterator inits_iterator
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.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OpenMPDirectiveKind
OpenMP directives.
This represents clause 'shared' in the '#pragma omp ...' directives.
OMPNumTeamsClause()
Build an empty clause.
varlist_const_iterator varlist_begin() const
const_all_lists_sizes_range all_lists_sizes() const
Expr * getPriority()
Return Priority number.
MutableArrayRef< Expr * >::iterator helper_expr_iterator
OpenMPLinearClauseKind Modifier
Modifier of 'linear' clause.
OpenMPMapClauseKind getMapType() const LLVM_READONLY
Fetches mapping kind for the clause.
static bool classof(const OMPClause *T)
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
const_component_lists_iterator & operator++()
This is a basic class for representing single OpenMP clause.
SourceLocation getDefaultmapModifierLoc() const
Get the modifier location.
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
OMPDeviceClause(Expr *E, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'device' clause.
OpenMPMapClauseKind getMapTypeModifier() const LLVM_READONLY
Fetches the map type modifier for the clause.
static bool classof(const OMPClause *T)
SourceLocation getLParenLoc() const
Returns the location of '('.
ArrayRef< const Expr * >::iterator privates_const_iterator
SourceLocation getDependencyLoc() const
Get dependency type location.
helper_expr_range reduction_ops()
llvm::iterator_range< private_copies_const_iterator > private_copies_const_range
static bool classof(const OMPClause *T)
llvm::iterator_range< helper_expr_iterator > helper_expr_range
Expr * getGrainsize() const
Return safe iteration space distance.
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
const Expr * getChunkSize() const
Get chunk size.
OMPDefaultmapClause()
Build an empty clause.
void setStep(Expr *Step)
Sets the linear step for clause.
llvm::iterator_range< const_all_num_lists_iterator > const_all_num_lists_range
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
const_all_decls_range all_decls() const
This represents 'device' clause in the '#pragma omp ...' directive.
helper_expr_const_range rhs_exprs() const
OMPThreadsClause()
Build an empty clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
SourceLocation ModifierLoc
Location of linear modifier if any.
Expr * getDevice() const
Return device number.
static bool classof(const OMPClause *T)
static bool classof(const OMPClause *T)
ArrayRef< MappableExprComponentList > MappableExprComponentListsRef
OMPNumThreadsClause()
Build an empty clause.
Expr * getNumTasks() const
Return safe iteration space distance.
MutableArrayRef< ValueDecl * > getUniqueDeclsRef()
Get the unique declarations that are in the trailing objects of the class.
SourceLocation getLParenLoc()
Get location of '('.
unsigned getUniqueDeclarationsNum() const
Return the number of unique base declarations in this clause.
Stmt * getPreInitStmt()
Get pre-initialization statement for the clause.
U cast(CodeGen::Address addr)
static bool classof(const OMPClause *T)
This represents clause 'linear' in the '#pragma omp ...' directives.
static bool classof(const OMPClause *T)
detail::InMemoryDirectory::const_iterator E
ArrayRef< const Expr * >::iterator private_copies_const_iterator
SourceLocation getColonLoc() const
Returns the location of ':'.
static bool classof(const OMPClause *T)
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
llvm::iterator_range< privates_iterator > privates_range
ArrayRef< ValueDecl * >::iterator const_all_decls_iterator
Iterators to access all the declarations, number of lists, list sizes, and components.
void setLocStart(SourceLocation Loc)
Sets the starting location of the clause.
static OMPSharedClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
static bool classof(const OMPClause *T)
std::pair< const ValueDecl *, MappableExprComponentListRef > operator->() const
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< inits_iterator > inits_range
SmallVector< MappableComponent, 8 > MappableExprComponentList
void setComponentListSizes(ArrayRef< unsigned > CLSs)
Set the cumulative component lists sizes that are in the trailing objects of the class.
llvm::iterator_range< helper_expr_iterator > helper_expr_range
Expr * getSafelen() const
Return safe iteration space distance.
Expr * getPriority() const
Return Priority number.
OMPDefaultClause(OpenMPDefaultClauseKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'default' clause with argument A ('none' or 'shared').
MutableArrayRef< Expr * >::iterator helper_expr_iterator
ConstStmtIterator const_child_iterator
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 '('.
static OMPLastprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > SrcExprs, ArrayRef< Expr * > DstExprs, ArrayRef< Expr * > AssignmentOps, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL.
SourceLocation getLParenLoc() const
Returns the location of '('.
OMPUntiedClause()
Build an empty clause.
ArrayRef< unsigned > getDeclNumListsRef() const
Get the number of lists per declaration that are in the trailing objects of the class.
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
OMPFinalClause(Expr *Cond, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'final' clause with condition Cond.
OpenMPDefaultClauseKind
OpenMP attributes for 'default' clause.
OMPDeviceClause()
Build an empty clause.
SourceLocation getDistScheduleKindLoc()
Get kind location.
OMPNowaitClause()
Build an empty clause.
privates_range privates()
MutableArrayRef< Expr * >::iterator helper_expr_iterator
This represents 'write' clause in the '#pragma omp atomic' directive.
MutableArrayRef< Expr * >::iterator inits_iterator
OMPNumTasksClause()
Build an empty clause.
MutableArrayRef< Expr * >::iterator private_copies_iterator
static bool classof(const OMPClause *T)
SourceLocation getLParenLoc() const
Returns the location of '('.
static bool classof(const OMPClause *T)
helper_expr_const_range destination_exprs() const
llvm::iterator_range< const_all_components_iterator > const_all_components_range
Defines the clang::SourceLocation class and associated facilities.
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()
This represents 'num_tasks' clause in the '#pragma omp ...' directive.
MutableArrayRef< Expr * >::iterator finals_iterator
MutableArrayRef< Expr * >::iterator helper_expr_iterator
Privates[]
Gets the list of initial values for linear variables.
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
MutableArrayRef< Expr * >::iterator updates_iterator
OMPClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation EndLoc)
OMPSimdlenClause()
Build an empty clause.
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
helper_expr_const_range assignment_ops() const
Expr * getThreadLimit()
Return ThreadLimit number.
OpenMPDefaultmapClauseKind getDefaultmapKind() const
Get kind of the clause.
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.
OMPUpdateClause()
Build an empty clause.
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
void setPrivates(ArrayRef< Expr * > PL)
Sets the list of the copies of original linear variables.
llvm::iterator_range< updates_const_iterator > updates_const_range
OMPGrainsizeClause()
Build an empty clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
static bool classof(const OMPClause *T)
Expr * getChunkSize()
Get chunk size.
llvm::iterator_range< finals_iterator > finals_range
const Stmt * getPreInitStmt() const
Get pre-initialization statement for the clause.
ArrayRef< unsigned >::iterator const_all_lists_sizes_iterator
OMPReadClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'read' clause.
helper_expr_const_range destination_exprs() const
SourceLocation getModifierLoc() const
Return modifier location.
OMPClauseWithPostUpdate(const OMPClause *This)
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
static bool classof(const OMPClause *T)
static OMPLastprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
SourceLocation getNameModifierLoc() const
Return the location of directive name modifier.
SourceLocation ColonLoc
Location of ':'.
ArrayRef< MappableComponent > getComponentsRef() const
Get the components that are in the trailing objects of the class.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
unsigned varlist_size() const
OMPOrderedClause()
Build an empty clause.
This represents clause 'use_device_ptr' in the '#pragma omp ...' directives.
OMPDefaultClause()
Build an empty clause.
static bool classof(const OMPClause *T)
helper_expr_const_range assignment_ops() const
OMPClauseWithPreInit(const OMPClause *This)
helper_expr_const_range source_exprs() const
static bool classof(const OMPClause *T)