16#ifndef LLVM_CLANG_AST_OPENMPCLAUSE_H
17#define LLVM_CLANG_AST_OPENMPCLAUSE_H
29#include "llvm/ADT/ArrayRef.h"
30#include "llvm/ADT/MapVector.h"
31#include "llvm/ADT/PointerIntPair.h"
32#include "llvm/ADT/SmallVector.h"
33#include "llvm/ADT/iterator.h"
34#include "llvm/ADT/iterator_range.h"
35#include "llvm/Frontend/OpenMP/OMPAssume.h"
36#include "llvm/Frontend/OpenMP/OMPConstants.h"
37#include "llvm/Frontend/OpenMP/OMPContext.h"
38#include "llvm/Support/Casting.h"
39#include "llvm/Support/Compiler.h"
40#include "llvm/Support/TrailingObjects.h"
68 : StartLoc(StartLoc), EndLoc(EndLoc), Kind(K) {}
109template <OpenMPClauseKind ClauseKind>
116 :
OMPClause(ClauseKind, StartLoc, EndLoc) {}
138 return T->getClauseKind() == ClauseKind;
142template <OpenMPClauseKind ClauseKind,
class Base>
157 :
Base(ClauseKind, StartLoc, EndLoc), LParenLoc(LParenLoc), S(S) {}
162 template <
typename T>
T *
getStmtAs()
const {
return cast_or_null<T>(S); }
188 return T->getClauseKind() == ClauseKind;
198 Stmt *PreInit =
nullptr;
205 assert(
get(
This) &&
"get is not tuned for pre-init.");
213 CaptureRegion = ThisRegion;
236 Expr *PostUpdate =
nullptr;
240 assert(
get(
This) &&
"get is not tuned for post-update.");
293 :
OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
297 return static_cast<T *
>(
this)->
template getTrailingObjectsNonStrict<Expr *>(
303 assert(VL.size() == NumVars &&
304 "Number of variables is not the same as the preallocated buffer");
333 return static_cast<const T *
>(
this)
334 ->
template getTrailingObjectsNonStrict<Expr *>(NumVars);
359 :
OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc),
378 return static_cast<T *
>(
this)
379 ->
template getTrailingObjectsNonStrict<OpenMPDirectiveKind>(
NumKinds);
385 "Number of directive kinds is not the same as the preallocated buffer");
436class OMPAlignClause final
463 static OMPAlignClause *
Create(
const ASTContext &
C, Expr *A,
464 SourceLocation StartLoc,
465 SourceLocation LParenLoc,
466 SourceLocation EndLoc);
480class OMPAllocateClause final
481 :
public OMPVarListClause<OMPAllocateClause>,
482 private llvm::TrailingObjects<OMPAllocateClause, Expr *> {
484 friend OMPVarListClause;
485 friend TrailingObjects;
489 Expr *Allocator =
nullptr;
492 Expr *Alignment =
nullptr;
503 enum { FIRST, SECOND, NUM_MODIFIERS };
513 Modifiers[FIRST] = M;
519 void setSecondAllocateModifier(OpenMPAllocateClauseModifier M) {
520 Modifiers[SECOND] = M;
524 void setFirstAllocateModifierLoc(SourceLocation Loc) {
525 ModifiersLoc[FIRST] = Loc;
529 void setSecondAllocateModifierLoc(SourceLocation Loc) {
530 ModifiersLoc[SECOND] = Loc;
543 OMPAllocateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
544 Expr *Allocator, Expr *Alignment, SourceLocation ColonLoc,
546 SourceLocation Modifier1Loc,
548 SourceLocation Modifier2Loc, SourceLocation EndLoc,
550 : OMPVarListClause<OMPAllocateClause>(llvm::omp::OMPC_allocate, StartLoc,
551 LParenLoc, EndLoc, N),
552 Allocator(Allocator), Alignment(Alignment), ColonLoc(ColonLoc) {
553 Modifiers[FIRST] = Modifier1;
554 Modifiers[SECOND] = Modifier2;
555 ModifiersLoc[FIRST] = Modifier1Loc;
556 ModifiersLoc[SECOND] = Modifier2Loc;
562 explicit OMPAllocateClause(
unsigned N)
563 : OMPVarListClause<OMPAllocateClause>(llvm::omp::OMPC_allocate,
564 SourceLocation(), SourceLocation(),
565 SourceLocation(), N) {
571 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
573 void setAllocator(Expr *A) { Allocator = A; }
575 AllocatorModifier = AM;
577 void setAlignment(Expr *A) { Alignment = A; }
591 static OMPAllocateClause *
592 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
593 Expr *Allocator, Expr *Alignment, SourceLocation ColonLoc,
596 SourceLocation EndLoc, ArrayRef<Expr *> VL);
606 return AllocatorModifier;
611 return Modifiers[FIRST];
616 return ModifiersLoc[FIRST];
621 return Modifiers[SECOND];
626 return ModifiersLoc[SECOND];
633 return AllocatorModifierLoc;
648 return const_cast<OMPAllocateClause *
>(
this)->
children();
659 return T->getClauseKind() == llvm::omp::OMPC_allocate;
677 Stmt *Condition =
nullptr;
695 void setNameModifierLoc(SourceLocation Loc) { NameModifierLoc = Loc; }
698 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
719 ColonLoc(ColonLoc), NameModifier(NameModifier),
720 NameModifierLoc(NameModifierLoc) {
759 return T->getClauseKind() == llvm::omp::OMPC_if;
833 void setNumThreads(Expr *NThreads) {
setStmt(NThreads); }
853 ModifierLoc(ModifierLoc) {
948class OMPSizesClause final
950 private llvm::TrailingObjects<OMPSizesClause, Expr *> {
952 friend class llvm::TrailingObjects<OMPSizesClause,
Expr *>;
961 explicit OMPSizesClause(
int NumSizes)
963 NumSizes(NumSizes) {}
994 return getTrailingObjects(NumSizes);
1000 assert(VL.size() == NumSizes);
1007 reinterpret_cast<Stmt **
>(Sizes.end()));
1012 reinterpret_cast<Stmt *
const *
>(Sizes.end()));
1023 return T->getClauseKind() == llvm::omp::OMPC_sizes;
1033class OMPCountsClause final
1035 private llvm::TrailingObjects<OMPCountsClause, Expr *> {
1037 friend class llvm::TrailingObjects<OMPCountsClause,
Expr *>;
1043 unsigned NumCounts = 0;
1046 std::optional<unsigned> OmpFillIndex;
1052 explicit OMPCountsClause(
int NumCounts)
1054 NumCounts(NumCounts) {}
1058 void setOmpFillIndex(std::optional<unsigned> Idx) { OmpFillIndex = Idx; }
1059 void setOmpFillLoc(SourceLocation Loc) { OmpFillLoc = Loc; }
1062 void setCountsRefs(ArrayRef<Expr *> VL) {
1063 assert(VL.size() == NumCounts);
1075 static OMPCountsClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
1076 SourceLocation LParenLoc,
1077 SourceLocation EndLoc, ArrayRef<Expr *> Counts,
1078 std::optional<unsigned> FillIdx,
1079 SourceLocation FillLoc);
1085 static OMPCountsClause *
CreateEmpty(
const ASTContext &
C,
unsigned NumCounts);
1099 return getTrailingObjects(NumCounts);
1102 return getTrailingObjects(NumCounts);
1108 reinterpret_cast<Stmt **
>(Counts.end()));
1113 reinterpret_cast<Stmt *
const *
>(Counts.end()));
1123 return T->getClauseKind() == llvm::omp::OMPC_counts;
1135class OMPPermutationClause final
1137 private llvm::TrailingObjects<OMPSizesClause, Expr *> {
1150 assert(VL.size() == NumLoops &&
"Expecting one expression per loop");
1151 llvm::copy(VL, getTrailingObjects());
1158 NumLoops(NumLoops) {}
1168 static OMPPermutationClause *
1197 reinterpret_cast<Stmt **
>(Args.end()));
1202 reinterpret_cast<Stmt *
const *
>(Args.end()));
1213 return T->getClauseKind() == llvm::omp::OMPC_permutation;
1263 enum { FirstExpr, CountExpr, NumArgs };
1264 Stmt *Args[NumArgs] = {
nullptr,
nullptr};
1267 void setFirst(Expr *E) { Args[FirstExpr] = E; }
1270 void setCount(Expr *E) { Args[CountExpr] = E; }
1273 explicit OMPLoopRangeClause()
1274 :
OMPClause(llvm::omp::OMPC_looprange, {}, {}) {}
1278 static OMPLoopRangeClause *
1279 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
1280 SourceLocation FirstLoc, SourceLocation CountLoc,
1281 SourceLocation EndLoc, Expr *
First, Expr *Count);
1284 static OMPLoopRangeClause *
CreateEmpty(
const ASTContext &
C);
1314 return T->getClauseKind() == llvm::omp::OMPC_looprange;
1335 explicit OMPPartialClause() :
OMPClause(
llvm::omp::OMPC_partial, {}, {}) {}
1338 void setFactor(Expr *E) { Factor = E; }
1341 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1351 static OMPPartialClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
1352 SourceLocation LParenLoc,
1353 SourceLocation EndLoc, Expr *Factor);
1358 static OMPPartialClause *
CreateEmpty(
const ASTContext &
C);
1379 return T->getClauseKind() == llvm::omp::OMPC_partial;
1433 llvm::omp::DefaultKind Kind = llvm::omp::OMP_DEFAULT_unknown;
1447 void setDefaultKind(llvm::omp::DefaultKind K) { Kind = K; }
1452 void setDefaultKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
1455 void setDefaultVariableCategory(OpenMPDefaultClauseVariableCategory VC) {
1459 void setDefaultVariableCategoryLocation(SourceLocation VCLoc) {
1460 this->VCLoc = VCLoc;
1476 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc), VC(VC), VCLoc(VCLoc) {}
1515 return T->getClauseKind() == llvm::omp::OMPC_default;
1546 void setThreadsetKindLoc(
SourceLocation KLoc) { KindLoc = KLoc; }
1560 LParenLoc(LParenLoc), Kind(A), KindLoc(ALoc) {}
1595 return T->getClauseKind() == llvm::omp::OMPC_threadset;
1610class OMPTransparentClause final
1613 friend class OMPClauseReader;
1616 SourceLocation LParenLoc;
1619 Expr *ImpexType =
nullptr;
1622 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1624 void setImpexTypeKind(Expr *E) { ImpexType = E; }
1636 OMPTransparentClause(Expr *ImpexTypeKind, Stmt *HelperValStmt,
1637 OpenMPDirectiveKind CaptureRegion,
1638 SourceLocation StartLoc, SourceLocation LParenLoc,
1639 SourceLocation EndLoc)
1640 : OMPOneStmtClause(ImpexTypeKind, StartLoc, LParenLoc, EndLoc),
1641 OMPClauseWithPreInit(this), LParenLoc(LParenLoc),
1642 ImpexType(ImpexTypeKind) {
1643 setPreInitStmt(HelperValStmt, CaptureRegion);
1647 OMPTransparentClause() : OMPOneStmtClause(), OMPClauseWithPreInit(this) {}
1650 SourceLocation getLParenLoc()
const {
return LParenLoc; }
1653 Expr *getImpexType()
const {
return ImpexType; }
1656 return child_range(
reinterpret_cast<Stmt **
>(&ImpexType),
1657 reinterpret_cast<Stmt **
>(&ImpexType) + 1);
1660 const_child_range
children()
const {
1661 return const_cast<OMPTransparentClause *
>(
this)->
children();
1665 return child_range(child_iterator(), child_iterator());
1668 return const_child_range(const_child_iterator(), const_child_iterator());
1671 static bool classof(
const OMPClause *T) {
1672 return T->getClauseKind() == llvm::omp::OMPC_transparent;
1684class OMPProcBindClause :
public OMPClause {
1685 friend class OMPClauseReader;
1688 SourceLocation LParenLoc;
1691 llvm::omp::ProcBindKind
Kind = llvm::omp::OMP_PROC_BIND_unknown;
1694 SourceLocation KindKwLoc;
1699 void setProcBindKind(llvm::omp::ProcBindKind K) {
Kind = K; }
1704 void setProcBindKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
1715 OMPProcBindClause(llvm::omp::ProcBindKind A, SourceLocation ALoc,
1716 SourceLocation StartLoc, SourceLocation LParenLoc,
1717 SourceLocation EndLoc)
1718 : OMPClause(llvm::omp::OMPC_proc_bind, StartLoc, EndLoc),
1719 LParenLoc(LParenLoc),
Kind(A), KindKwLoc(ALoc) {}
1723 : OMPClause(llvm::omp::OMPC_proc_bind, SourceLocation(),
1724 SourceLocation()) {}
1727 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1730 SourceLocation getLParenLoc()
const {
return LParenLoc; }
1733 llvm::omp::ProcBindKind getProcBindKind()
const {
return Kind; }
1736 SourceLocation getProcBindKindKwLoc()
const {
return KindKwLoc; }
1739 return child_range(child_iterator(), child_iterator());
1742 const_child_range
children()
const {
1743 return const_child_range(const_child_iterator(), const_child_iterator());
1747 return child_range(child_iterator(), child_iterator());
1750 return const_child_range(const_child_iterator(), const_child_iterator());
1753 static bool classof(
const OMPClause *T) {
1754 return T->getClauseKind() == llvm::omp::OMPC_proc_bind;
1766class OMPUnifiedAddressClause final
1769 friend class OMPClauseReader;
1774 OMPUnifiedAddressClause(SourceLocation StartLoc, SourceLocation EndLoc)
1775 : OMPNoChildClause(StartLoc, EndLoc) {}
1778 OMPUnifiedAddressClause() : OMPNoChildClause() {}
1789class OMPUnifiedSharedMemoryClause final :
public OMPClause {
1791 friend class OMPClauseReader;
1796 OMPUnifiedSharedMemoryClause(SourceLocation StartLoc, SourceLocation EndLoc)
1797 : OMPClause(llvm::omp::OMPC_unified_shared_memory, StartLoc, EndLoc) {}
1800 OMPUnifiedSharedMemoryClause()
1801 : OMPClause(llvm::omp::OMPC_unified_shared_memory, SourceLocation(),
1802 SourceLocation()) {}
1805 return child_range(child_iterator(), child_iterator());
1808 const_child_range
children()
const {
1809 return const_child_range(const_child_iterator(), const_child_iterator());
1813 return child_range(child_iterator(), child_iterator());
1816 return const_child_range(const_child_iterator(), const_child_iterator());
1819 static bool classof(
const OMPClause *T) {
1820 return T->getClauseKind() == llvm::omp::OMPC_unified_shared_memory;
1832class OMPReverseOffloadClause final :
public OMPClause {
1834 friend class OMPClauseReader;
1839 OMPReverseOffloadClause(SourceLocation StartLoc, SourceLocation EndLoc)
1840 : OMPClause(llvm::omp::OMPC_reverse_offload, StartLoc, EndLoc) {}
1843 OMPReverseOffloadClause()
1844 : OMPClause(llvm::omp::OMPC_reverse_offload, SourceLocation(),
1845 SourceLocation()) {}
1848 return child_range(child_iterator(), child_iterator());
1851 const_child_range
children()
const {
1852 return const_child_range(const_child_iterator(), const_child_iterator());
1856 return child_range(child_iterator(), child_iterator());
1859 return const_child_range(const_child_iterator(), const_child_iterator());
1862 static bool classof(
const OMPClause *T) {
1863 return T->getClauseKind() == llvm::omp::OMPC_reverse_offload;
1875class OMPDynamicAllocatorsClause final :
public OMPClause {
1877 friend class OMPClauseReader;
1882 OMPDynamicAllocatorsClause(SourceLocation StartLoc, SourceLocation EndLoc)
1883 : OMPClause(llvm::omp::OMPC_dynamic_allocators, StartLoc, EndLoc) {}
1886 OMPDynamicAllocatorsClause()
1887 : OMPClause(llvm::omp::OMPC_dynamic_allocators, SourceLocation(),
1888 SourceLocation()) {}
1891 return child_range(child_iterator(), child_iterator());
1894 const_child_range
children()
const {
1895 return const_child_range(const_child_iterator(), const_child_iterator());
1899 return child_range(child_iterator(), child_iterator());
1902 return const_child_range(const_child_iterator(), const_child_iterator());
1905 static bool classof(
const OMPClause *T) {
1906 return T->getClauseKind() == llvm::omp::OMPC_dynamic_allocators;
1918class OMPAtomicDefaultMemOrderClause final :
public OMPClause {
1919 friend class OMPClauseReader;
1922 SourceLocation LParenLoc;
1929 SourceLocation KindKwLoc;
1934 void setAtomicDefaultMemOrderKind(OpenMPAtomicDefaultMemOrderClauseKind K) {
1941 void setAtomicDefaultMemOrderKindKwLoc(SourceLocation KLoc) {
1954 OMPAtomicDefaultMemOrderClause(OpenMPAtomicDefaultMemOrderClauseKind A,
1955 SourceLocation ALoc, SourceLocation StartLoc,
1956 SourceLocation LParenLoc,
1957 SourceLocation EndLoc)
1958 : OMPClause(llvm::omp::OMPC_atomic_default_mem_order, StartLoc, EndLoc),
1959 LParenLoc(LParenLoc),
Kind(A), KindKwLoc(ALoc) {}
1962 OMPAtomicDefaultMemOrderClause()
1963 : OMPClause(llvm::omp::OMPC_atomic_default_mem_order, SourceLocation(),
1964 SourceLocation()) {}
1967 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1970 SourceLocation getLParenLoc()
const {
return LParenLoc; }
1978 SourceLocation getAtomicDefaultMemOrderKindKwLoc()
const {
return KindKwLoc; }
1981 return child_range(child_iterator(), child_iterator());
1984 const_child_range
children()
const {
1985 return const_child_range(const_child_iterator(), const_child_iterator());
1989 return child_range(child_iterator(), child_iterator());
1992 return const_child_range(const_child_iterator(), const_child_iterator());
1995 static bool classof(
const OMPClause *T) {
1996 return T->getClauseKind() == llvm::omp::OMPC_atomic_default_mem_order;
2008class OMPSelfMapsClause final :
public OMPClause {
2010 friend class OMPClauseReader;
2015 OMPSelfMapsClause(SourceLocation StartLoc, SourceLocation EndLoc)
2016 : OMPClause(llvm::omp::OMPC_self_maps, StartLoc, EndLoc) {}
2020 : OMPClause(llvm::omp::OMPC_self_maps, SourceLocation(),
2021 SourceLocation()) {}
2024 return child_range(child_iterator(), child_iterator());
2027 const_child_range
children()
const {
2028 return const_child_range(const_child_iterator(), const_child_iterator());
2032 return child_range(child_iterator(), child_iterator());
2035 return const_child_range(const_child_iterator(), const_child_iterator());
2038 static bool classof(
const OMPClause *T) {
2039 return T->getClauseKind() == llvm::omp::OMPC_self_maps;
2050class OMPAtClause final :
public OMPClause {
2051 friend class OMPClauseReader;
2054 SourceLocation LParenLoc;
2060 SourceLocation KindKwLoc;
2065 void setAtKind(OpenMPAtClauseKind K) {
Kind = K; }
2070 void setAtKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
2073 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
2083 OMPAtClause(OpenMPAtClauseKind A, SourceLocation ALoc,
2084 SourceLocation StartLoc, SourceLocation LParenLoc,
2085 SourceLocation EndLoc)
2086 : OMPClause(llvm::omp::OMPC_at, StartLoc, EndLoc), LParenLoc(LParenLoc),
2087 Kind(A), KindKwLoc(ALoc) {}
2091 : OMPClause(llvm::omp::OMPC_at, SourceLocation(), SourceLocation()) {}
2094 SourceLocation getLParenLoc()
const {
return LParenLoc; }
2100 SourceLocation getAtKindKwLoc()
const {
return KindKwLoc; }
2103 return child_range(child_iterator(), child_iterator());
2106 const_child_range
children()
const {
2107 return const_child_range(const_child_iterator(), const_child_iterator());
2111 return child_range(child_iterator(), child_iterator());
2114 return const_child_range(const_child_iterator(), const_child_iterator());
2117 static bool classof(
const OMPClause *T) {
2118 return T->getClauseKind() == llvm::omp::OMPC_at;
2130class OMPSeverityClause final :
public OMPClause {
2131 friend class OMPClauseReader;
2134 SourceLocation LParenLoc;
2140 SourceLocation KindKwLoc;
2145 void setSeverityKind(OpenMPSeverityClauseKind K) {
Kind = K; }
2150 void setSeverityKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
2153 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
2163 OMPSeverityClause(OpenMPSeverityClauseKind A, SourceLocation ALoc,
2164 SourceLocation StartLoc, SourceLocation LParenLoc,
2165 SourceLocation EndLoc)
2166 : OMPClause(llvm::omp::OMPC_severity, StartLoc, EndLoc),
2167 LParenLoc(LParenLoc),
Kind(A), KindKwLoc(ALoc) {}
2171 : OMPClause(llvm::omp::OMPC_severity, SourceLocation(),
2172 SourceLocation()) {}
2175 SourceLocation getLParenLoc()
const {
return LParenLoc; }
2181 SourceLocation getSeverityKindKwLoc()
const {
return KindKwLoc; }
2184 return child_range(child_iterator(), child_iterator());
2187 const_child_range
children()
const {
2188 return const_child_range(const_child_iterator(), const_child_iterator());
2192 return child_range(child_iterator(), child_iterator());
2195 return const_child_range(const_child_iterator(), const_child_iterator());
2198 static bool classof(
const OMPClause *T) {
2199 return T->getClauseKind() == llvm::omp::OMPC_severity;
2211class OMPMessageClause final
2214 friend class OMPClauseReader;
2217 void setMessageString(Expr *MS) { setStmt(MS); }
2229 OMPMessageClause(Expr *MS, Stmt *HelperMS, OpenMPDirectiveKind CaptureRegion,
2230 SourceLocation StartLoc, SourceLocation LParenLoc,
2231 SourceLocation EndLoc)
2232 : OMPOneStmtClause(MS, StartLoc, LParenLoc, EndLoc),
2233 OMPClauseWithPreInit(this) {
2234 setPreInitStmt(HelperMS, CaptureRegion);
2238 OMPMessageClause() : OMPOneStmtClause(), OMPClauseWithPreInit(this) {}
2241 Expr *getMessageString()
const {
return getStmtAs<Expr>(); }
2244 std::optional<std::string> tryEvaluateString(ASTContext &Ctx)
const {
2245 if (Expr *MessageExpr = getMessageString())
2246 return MessageExpr->tryEvaluateString(Ctx);
2247 return std::nullopt;
2259 friend class OMPClauseReader;
2262 SourceLocation LParenLoc;
2268 enum {FIRST, SECOND, NUM_MODIFIERS};
2272 SourceLocation ModifiersLoc[NUM_MODIFIERS];
2275 SourceLocation KindLoc;
2278 SourceLocation CommaLoc;
2281 Expr *ChunkSize =
nullptr;
2286 void setScheduleKind(OpenMPScheduleClauseKind K) {
Kind = K; }
2291 void setFirstScheduleModifier(OpenMPScheduleClauseModifier M) {
2292 Modifiers[FIRST] = M;
2298 void setSecondScheduleModifier(OpenMPScheduleClauseModifier M) {
2299 Modifiers[SECOND] = M;
2303 void setFirstScheduleModifierLoc(SourceLocation Loc) {
2304 ModifiersLoc[FIRST] = Loc;
2308 void setSecondScheduleModifierLoc(SourceLocation Loc) {
2309 ModifiersLoc[SECOND] = Loc;
2315 void setScheduleModifer(OpenMPScheduleClauseModifier M) {
2316 if (Modifiers[FIRST] == OMPC_SCHEDULE_MODIFIER_unknown)
2317 Modifiers[FIRST] = M;
2319 assert(Modifiers[SECOND] == OMPC_SCHEDULE_MODIFIER_unknown);
2320 Modifiers[SECOND] = M;
2327 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
2332 void setScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
2337 void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
2342 void setChunkSize(Expr *E) { ChunkSize = E; }
2360 OMPScheduleClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2361 SourceLocation KLoc, SourceLocation CommaLoc,
2362 SourceLocation EndLoc, OpenMPScheduleClauseKind Kind,
2363 Expr *ChunkSize, Stmt *HelperChunkSize,
2364 OpenMPScheduleClauseModifier M1, SourceLocation M1Loc,
2365 OpenMPScheduleClauseModifier M2, SourceLocation M2Loc)
2366 : OMPClause(llvm::omp::OMPC_schedule, StartLoc, EndLoc),
2367 OMPClauseWithPreInit(this), LParenLoc(LParenLoc),
Kind(
Kind),
2368 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
2369 setPreInitStmt(HelperChunkSize);
2370 Modifiers[FIRST] = M1;
2371 Modifiers[SECOND] = M2;
2372 ModifiersLoc[FIRST] = M1Loc;
2373 ModifiersLoc[SECOND] = M2Loc;
2377 explicit OMPScheduleClause()
2378 : OMPClause(llvm::omp::OMPC_schedule, SourceLocation(), SourceLocation()),
2379 OMPClauseWithPreInit(this) {
2389 return Modifiers[FIRST];
2394 return Modifiers[SECOND];
2398 SourceLocation getLParenLoc() {
return LParenLoc; }
2401 SourceLocation getScheduleKindLoc() {
return KindLoc; }
2404 SourceLocation getFirstScheduleModifierLoc()
const {
2405 return ModifiersLoc[FIRST];
2409 SourceLocation getSecondScheduleModifierLoc()
const {
2410 return ModifiersLoc[SECOND];
2414 SourceLocation getCommaLoc() {
return CommaLoc; }
2417 Expr *getChunkSize() {
return ChunkSize; }
2420 const Expr *getChunkSize()
const {
return ChunkSize; }
2423 return child_range(
reinterpret_cast<Stmt **
>(&ChunkSize),
2424 reinterpret_cast<Stmt **
>(&ChunkSize) + 1);
2427 const_child_range
children()
const {
2428 return const_cast<OMPScheduleClause *
>(
this)->
children();
2432 return child_range(child_iterator(), child_iterator());
2435 return const_child_range(const_child_iterator(), const_child_iterator());
2438 static bool classof(
const OMPClause *T) {
2439 return T->getClauseKind() == llvm::omp::OMPC_schedule;
2450class OMPOrderedClause final
2452 private llvm::TrailingObjects<OMPOrderedClause, Expr *> {
2453 friend class OMPClauseReader;
2454 friend TrailingObjects;
2457 SourceLocation LParenLoc;
2460 Stmt *NumForLoops =
nullptr;
2463 unsigned NumberOfLoops = 0;
2472 OMPOrderedClause(Expr *Num,
unsigned NumLoops, SourceLocation StartLoc,
2473 SourceLocation LParenLoc, SourceLocation EndLoc)
2474 : OMPClause(llvm::omp::OMPC_ordered, StartLoc, EndLoc),
2475 LParenLoc(LParenLoc), NumForLoops(
Num), NumberOfLoops(NumLoops) {}
2478 explicit OMPOrderedClause(
unsigned NumLoops)
2479 : OMPClause(llvm::omp::OMPC_ordered, SourceLocation(), SourceLocation()),
2480 NumberOfLoops(NumLoops) {}
2483 void setNumForLoops(Expr *Num) { NumForLoops =
Num; }
2493 static OMPOrderedClause *
Create(
const ASTContext &C, Expr *Num,
2494 unsigned NumLoops, SourceLocation StartLoc,
2495 SourceLocation LParenLoc,
2496 SourceLocation EndLoc);
2499 static OMPOrderedClause*
CreateEmpty(
const ASTContext &C,
unsigned NumLoops);
2502 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
2505 SourceLocation getLParenLoc()
const {
return LParenLoc; }
2508 Expr *getNumForLoops()
const {
return cast_or_null<Expr>(NumForLoops); }
2511 void setLoopNumIterations(
unsigned NumLoop, Expr *NumIterations);
2513 ArrayRef<Expr *> getLoopNumIterations()
const;
2516 void setLoopCounter(
unsigned NumLoop, Expr *Counter);
2518 Expr *getLoopCounter(
unsigned NumLoop);
2519 const Expr *getLoopCounter(
unsigned NumLoop)
const;
2521 child_range
children() {
return child_range(&NumForLoops, &NumForLoops + 1); }
2523 const_child_range
children()
const {
2524 return const_child_range(&NumForLoops, &NumForLoops + 1);
2528 return child_range(child_iterator(), child_iterator());
2531 return const_child_range(const_child_iterator(), const_child_iterator());
2534 static bool classof(
const OMPClause *T) {
2535 return T->getClauseKind() == llvm::omp::OMPC_ordered;
2546class OMPNowaitClause final :
public OMPClause {
2547 friend class OMPClauseReader;
2550 SourceLocation LParenLoc;
2565 OMPNowaitClause(Expr *Cond, SourceLocation StartLoc, SourceLocation LParenLoc,
2566 SourceLocation EndLoc)
2567 : OMPClause(llvm::omp::OMPC_nowait, StartLoc, EndLoc),
2572 : OMPClause(llvm::omp::OMPC_nowait, SourceLocation(), SourceLocation()) {}
2575 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
2578 SourceLocation getLParenLoc()
const {
return LParenLoc; }
2581 Expr *getCondition()
const {
return cast_or_null<Expr>(Condition); }
2585 return child_range(&Condition, &Condition + 1);
2586 return child_range(child_iterator(), child_iterator());
2589 const_child_range
children()
const {
2591 return const_child_range(&Condition, &Condition + 1);
2592 return const_child_range(const_child_iterator(), const_child_iterator());
2597 return const_cast<OMPNowaitClause *
>(
this)->
used_children();
2600 static bool classof(
const OMPClause *T) {
2601 return T->getClauseKind() == llvm::omp::OMPC_nowait;
2611class OMPUntiedClause :
public OMPClause {
2617 OMPUntiedClause(SourceLocation StartLoc, SourceLocation EndLoc)
2618 : OMPClause(llvm::omp::OMPC_untied, StartLoc, EndLoc) {}
2622 : OMPClause(llvm::omp::OMPC_untied, SourceLocation(), SourceLocation()) {}
2625 return child_range(child_iterator(), child_iterator());
2628 const_child_range
children()
const {
2629 return const_child_range(const_child_iterator(), const_child_iterator());
2633 return child_range(child_iterator(), child_iterator());
2636 return const_child_range(const_child_iterator(), const_child_iterator());
2639 static bool classof(
const OMPClause *T) {
2640 return T->getClauseKind() == llvm::omp::OMPC_untied;
2651class OMPMergeableClause :
public OMPClause {
2657 OMPMergeableClause(SourceLocation StartLoc, SourceLocation EndLoc)
2658 : OMPClause(llvm::omp::OMPC_mergeable, StartLoc, EndLoc) {}
2661 OMPMergeableClause()
2662 : OMPClause(llvm::omp::OMPC_mergeable, SourceLocation(),
2663 SourceLocation()) {}
2666 return child_range(child_iterator(), child_iterator());
2669 const_child_range
children()
const {
2670 return const_child_range(const_child_iterator(), const_child_iterator());
2674 return child_range(child_iterator(), child_iterator());
2677 return const_child_range(const_child_iterator(), const_child_iterator());
2680 static bool classof(
const OMPClause *T) {
2681 return T->getClauseKind() == llvm::omp::OMPC_mergeable;
2692class OMPAbsentClause final
2694 private llvm::TrailingObjects<OMPAbsentClause, OpenMPDirectiveKind> {
2695 friend OMPDirectiveListClause;
2696 friend TrailingObjects;
2704 OMPAbsentClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2705 SourceLocation EndLoc,
unsigned NumKinds)
2706 : OMPDirectiveListClause<OMPAbsentClause>(
2707 llvm::omp::OMPC_absent, StartLoc, LParenLoc, EndLoc, NumKinds) {}
2710 OMPAbsentClause(
unsigned NumKinds)
2711 : OMPDirectiveListClause<OMPAbsentClause>(
2712 llvm::omp::OMPC_absent, SourceLocation(), SourceLocation(),
2713 SourceLocation(), NumKinds) {}
2716 static OMPAbsentClause *
Create(
const ASTContext &C,
2717 ArrayRef<OpenMPDirectiveKind> DKVec,
2718 SourceLocation Loc, SourceLocation LLoc,
2719 SourceLocation RLoc);
2721 static OMPAbsentClause *
CreateEmpty(
const ASTContext &C,
unsigned NumKinds);
2723 static bool classof(
const OMPClause *C) {
2724 return C->getClauseKind() == llvm::omp::OMPC_absent;
2735class OMPContainsClause final
2737 private llvm::TrailingObjects<OMPContainsClause, OpenMPDirectiveKind> {
2738 friend OMPDirectiveListClause;
2739 friend TrailingObjects;
2747 OMPContainsClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2748 SourceLocation EndLoc,
unsigned NumKinds)
2749 : OMPDirectiveListClause<OMPContainsClause>(
2750 llvm::omp::OMPC_contains, StartLoc, LParenLoc, EndLoc, NumKinds) {}
2753 OMPContainsClause(
unsigned NumKinds)
2754 : OMPDirectiveListClause<OMPContainsClause>(
2755 llvm::omp::OMPC_contains, SourceLocation(), SourceLocation(),
2756 SourceLocation(), NumKinds) {}
2759 static OMPContainsClause *
Create(
const ASTContext &C,
2760 ArrayRef<OpenMPDirectiveKind> DKVec,
2761 SourceLocation Loc, SourceLocation LLoc,
2762 SourceLocation RLoc);
2764 static OMPContainsClause *
CreateEmpty(
const ASTContext &C,
unsigned NumKinds);
2766 static bool classof(
const OMPClause *C) {
2767 return C->getClauseKind() == llvm::omp::OMPC_contains;
2778class OMPHoldsClause final
2780 friend class OMPClauseReader;
2787 OMPHoldsClause(Expr *E, SourceLocation StartLoc, SourceLocation LParenLoc,
2788 SourceLocation EndLoc)
2789 : OMPOneStmtClause(E, StartLoc, LParenLoc, EndLoc) {}
2792 OMPHoldsClause() : OMPOneStmtClause() {}
2794 Expr *
getExpr()
const {
return getStmtAs<Expr>(); }
2795 void setExpr(Expr *E) { setStmt(E); }
2805class OMPNoOpenMPClause final
2812 OMPNoOpenMPClause(SourceLocation StartLoc, SourceLocation EndLoc)
2813 : OMPNoChildClause(StartLoc, EndLoc) {}
2816 OMPNoOpenMPClause() : OMPNoChildClause() {}
2827class OMPNoOpenMPRoutinesClause final
2834 OMPNoOpenMPRoutinesClause(SourceLocation StartLoc, SourceLocation EndLoc)
2835 : OMPNoChildClause(StartLoc, EndLoc) {}
2838 OMPNoOpenMPRoutinesClause() : OMPNoChildClause() {}
2849class OMPNoOpenMPConstructsClause final
2856 OMPNoOpenMPConstructsClause(SourceLocation StartLoc, SourceLocation EndLoc)
2857 : OMPNoChildClause(StartLoc, EndLoc) {}
2860 OMPNoOpenMPConstructsClause() : OMPNoChildClause() {}
2871class OMPNoParallelismClause final
2878 OMPNoParallelismClause(SourceLocation StartLoc, SourceLocation EndLoc)
2879 : OMPNoChildClause(StartLoc, EndLoc) {}
2882 OMPNoParallelismClause() : OMPNoChildClause() {}
2897 OMPReadClause(SourceLocation StartLoc, SourceLocation EndLoc)
2898 : OMPClause(llvm::omp::OMPC_read, StartLoc, EndLoc) {}
2902 : OMPClause(llvm::omp::OMPC_read, SourceLocation(), SourceLocation()) {}
2905 return child_range(child_iterator(), child_iterator());
2908 const_child_range
children()
const {
2909 return const_child_range(const_child_iterator(), const_child_iterator());
2913 return child_range(child_iterator(), child_iterator());
2916 return const_child_range(const_child_iterator(), const_child_iterator());
2919 static bool classof(
const OMPClause *T) {
2920 return T->getClauseKind() == llvm::omp::OMPC_read;
2930class OMPWriteClause :
public OMPClause {
2936 OMPWriteClause(SourceLocation StartLoc, SourceLocation EndLoc)
2937 : OMPClause(llvm::omp::OMPC_write, StartLoc, EndLoc) {}
2941 : OMPClause(llvm::omp::OMPC_write, SourceLocation(), SourceLocation()) {}
2944 return child_range(child_iterator(), child_iterator());
2947 const_child_range
children()
const {
2948 return const_child_range(const_child_iterator(), const_child_iterator());
2952 return child_range(child_iterator(), child_iterator());
2955 return const_child_range(const_child_iterator(), const_child_iterator());
2958 static bool classof(
const OMPClause *T) {
2959 return T->getClauseKind() == llvm::omp::OMPC_write;
2970class OMPUpdateClause :
public OMPClause {
2976 OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc)
2977 : OMPClause(llvm::omp::OMPC_update, StartLoc, EndLoc) {}
2981 : OMPClause(llvm::omp::OMPC_update, SourceLocation(), SourceLocation()) {}
2984 return child_range(child_iterator(), child_iterator());
2987 const_child_range
children()
const {
2988 return const_child_range(const_child_iterator(), const_child_iterator());
2992 return child_range(child_iterator(), child_iterator());
2995 return const_child_range(const_child_iterator(), const_child_iterator());
2998 static bool classof(
const OMPClause *T) {
2999 return T->getClauseKind() == llvm::omp::OMPC_update;
3011class OMPUpdateDependObjectsClause final
3013 private llvm::TrailingObjects<OMPUpdateDependObjectsClause,
3014 SourceLocation, OpenMPDependClauseKind> {
3015 friend class OMPClauseReader;
3016 friend TrailingObjects;
3020 size_t numTrailingObjects(OverloadToken<SourceLocation>)
const {
3026 void setLParenLoc(SourceLocation Loc) {
3027 *getTrailingObjects<SourceLocation>() = Loc;
3031 void setArgumentLoc(SourceLocation Loc) {
3032 *std::next(getTrailingObjects<SourceLocation>(), 1) = Loc;
3036 void setDependencyKind(OpenMPDependClauseKind DK) {
3037 *getTrailingObjects<OpenMPDependClauseKind>() = DK;
3044 OMPUpdateDependObjectsClause(SourceLocation StartLoc, SourceLocation EndLoc)
3045 : OMPClause(llvm::omp::OMPC_update_depend_objects, StartLoc, EndLoc) {}
3048 OMPUpdateDependObjectsClause()
3049 : OMPClause(llvm::omp::OMPC_update_depend_objects, SourceLocation(),
3050 SourceLocation()) {}
3061 static OMPUpdateDependObjectsClause *
3062 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
3063 SourceLocation ArgumentLoc, OpenMPDependClauseKind DK,
3064 SourceLocation EndLoc);
3069 static OMPUpdateDependObjectsClause *
CreateEmpty(
const ASTContext &C);
3072 return child_range(child_iterator(), child_iterator());
3075 const_child_range
children()
const {
3076 return const_child_range(const_child_iterator(), const_child_iterator());
3080 return child_range(child_iterator(), child_iterator());
3083 return const_child_range(const_child_iterator(), const_child_iterator());
3087 SourceLocation getLParenLoc()
const {
3088 return *getTrailingObjects<SourceLocation>();
3092 SourceLocation getArgumentLoc()
const {
3093 return *std::next(getTrailingObjects<SourceLocation>(), 1);
3098 return *getTrailingObjects<OpenMPDependClauseKind>();
3101 static bool classof(
const OMPClause *T) {
3102 return T->getClauseKind() == llvm::omp::OMPC_update_depend_objects;
3113class OMPCaptureClause :
public OMPClause {
3119 OMPCaptureClause(SourceLocation StartLoc, SourceLocation EndLoc)
3120 : OMPClause(llvm::omp::OMPC_capture, StartLoc, EndLoc) {}
3124 : OMPClause(llvm::omp::OMPC_capture, SourceLocation(), SourceLocation()) {
3128 return child_range(child_iterator(), child_iterator());
3131 const_child_range
children()
const {
3132 return const_child_range(const_child_iterator(), const_child_iterator());
3136 return child_range(child_iterator(), child_iterator());
3139 return const_child_range(const_child_iterator(), const_child_iterator());
3142 static bool classof(
const OMPClause *T) {
3143 return T->getClauseKind() == llvm::omp::OMPC_capture;
3154class OMPCompareClause final :
public OMPClause {
3160 OMPCompareClause(SourceLocation StartLoc, SourceLocation EndLoc)
3161 : OMPClause(llvm::omp::OMPC_compare, StartLoc, EndLoc) {}
3165 : OMPClause(llvm::omp::OMPC_compare, SourceLocation(), SourceLocation()) {
3169 return child_range(child_iterator(), child_iterator());
3172 const_child_range
children()
const {
3173 return const_child_range(const_child_iterator(), const_child_iterator());
3177 return child_range(child_iterator(), child_iterator());
3180 return const_child_range(const_child_iterator(), const_child_iterator());
3183 static bool classof(
const OMPClause *T) {
3184 return T->getClauseKind() == llvm::omp::OMPC_compare;
3195class OMPSeqCstClause :
public OMPClause {
3201 OMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc)
3202 : OMPClause(llvm::omp::OMPC_seq_cst, StartLoc, EndLoc) {}
3206 : OMPClause(llvm::omp::OMPC_seq_cst, SourceLocation(), SourceLocation()) {
3210 return child_range(child_iterator(), child_iterator());
3213 const_child_range
children()
const {
3214 return const_child_range(const_child_iterator(), const_child_iterator());
3218 return child_range(child_iterator(), child_iterator());
3221 return const_child_range(const_child_iterator(), const_child_iterator());
3224 static bool classof(
const OMPClause *T) {
3225 return T->getClauseKind() == llvm::omp::OMPC_seq_cst;
3236class OMPAcqRelClause final :
public OMPClause {
3242 OMPAcqRelClause(SourceLocation StartLoc, SourceLocation EndLoc)
3243 : OMPClause(llvm::omp::OMPC_acq_rel, StartLoc, EndLoc) {}
3247 : OMPClause(llvm::omp::OMPC_acq_rel, SourceLocation(), SourceLocation()) {
3251 return child_range(child_iterator(), child_iterator());
3254 const_child_range
children()
const {
3255 return const_child_range(const_child_iterator(), const_child_iterator());
3259 return child_range(child_iterator(), child_iterator());
3262 return const_child_range(const_child_iterator(), const_child_iterator());
3265 static bool classof(
const OMPClause *T) {
3266 return T->getClauseKind() == llvm::omp::OMPC_acq_rel;
3277class OMPAcquireClause final :
public OMPClause {
3283 OMPAcquireClause(SourceLocation StartLoc, SourceLocation EndLoc)
3284 : OMPClause(llvm::omp::OMPC_acquire, StartLoc, EndLoc) {}
3288 : OMPClause(llvm::omp::OMPC_acquire, SourceLocation(), SourceLocation()) {
3292 return child_range(child_iterator(), child_iterator());
3295 const_child_range
children()
const {
3296 return const_child_range(const_child_iterator(), const_child_iterator());
3300 return child_range(child_iterator(), child_iterator());
3303 return const_child_range(const_child_iterator(), const_child_iterator());
3306 static bool classof(
const OMPClause *T) {
3307 return T->getClauseKind() == llvm::omp::OMPC_acquire;
3318class OMPReleaseClause final :
public OMPClause {
3324 OMPReleaseClause(SourceLocation StartLoc, SourceLocation EndLoc)
3325 : OMPClause(llvm::omp::OMPC_release, StartLoc, EndLoc) {}
3329 : OMPClause(llvm::omp::OMPC_release, SourceLocation(), SourceLocation()) {
3333 return child_range(child_iterator(), child_iterator());
3336 const_child_range
children()
const {
3337 return const_child_range(const_child_iterator(), const_child_iterator());
3341 return child_range(child_iterator(), child_iterator());
3344 return const_child_range(const_child_iterator(), const_child_iterator());
3347 static bool classof(
const OMPClause *T) {
3348 return T->getClauseKind() == llvm::omp::OMPC_release;
3359class OMPRelaxedClause final :
public OMPClause {
3365 OMPRelaxedClause(SourceLocation StartLoc, SourceLocation EndLoc)
3366 : OMPClause(llvm::omp::OMPC_relaxed, StartLoc, EndLoc) {}
3370 : OMPClause(llvm::omp::OMPC_relaxed, SourceLocation(), SourceLocation()) {
3374 return child_range(child_iterator(), child_iterator());
3377 const_child_range
children()
const {
3378 return const_child_range(const_child_iterator(), const_child_iterator());
3382 return child_range(child_iterator(), child_iterator());
3385 return const_child_range(const_child_iterator(), const_child_iterator());
3388 static bool classof(
const OMPClause *T) {
3389 return T->getClauseKind() == llvm::omp::OMPC_relaxed;
3400class OMPWeakClause final :
public OMPClause {
3406 OMPWeakClause(SourceLocation StartLoc, SourceLocation EndLoc)
3407 : OMPClause(llvm::omp::OMPC_weak, StartLoc, EndLoc) {}
3411 : OMPClause(llvm::omp::OMPC_weak, SourceLocation(), SourceLocation()) {}
3414 return child_range(child_iterator(), child_iterator());
3417 const_child_range
children()
const {
3418 return const_child_range(const_child_iterator(), const_child_iterator());
3422 return child_range(child_iterator(), child_iterator());
3425 return const_child_range(const_child_iterator(), const_child_iterator());
3428 static bool classof(
const OMPClause *T) {
3429 return T->getClauseKind() == llvm::omp::OMPC_weak;
3440class OMPFailClause final :
public OMPClause {
3445 SourceLocation FailParameterLoc;
3446 SourceLocation LParenLoc;
3448 friend class OMPClauseReader;
3451 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
3454 void setFailParameterLoc(SourceLocation Loc) { FailParameterLoc = Loc; }
3457 void setFailParameter(OpenMPClauseKind FailParameter) {
3458 this->FailParameter = FailParameter;
3460 "Invalid fail clause parameter");
3468 OMPFailClause(SourceLocation StartLoc, SourceLocation EndLoc)
3469 : OMPClause(llvm::omp::OMPC_fail, StartLoc, EndLoc) {}
3471 OMPFailClause(OpenMPClauseKind FailParameter, SourceLocation FailParameterLoc,
3472 SourceLocation StartLoc, SourceLocation LParenLoc,
3473 SourceLocation EndLoc)
3474 : OMPClause(llvm::omp::OMPC_fail, StartLoc, EndLoc),
3475 FailParameterLoc(FailParameterLoc), LParenLoc(LParenLoc) {
3477 setFailParameter(FailParameter);
3482 : OMPClause(llvm::omp::OMPC_fail, SourceLocation(), SourceLocation()) {}
3485 return child_range(child_iterator(), child_iterator());
3488 const_child_range
children()
const {
3489 return const_child_range(const_child_iterator(), const_child_iterator());
3493 return child_range(child_iterator(), child_iterator());
3496 return const_child_range(const_child_iterator(), const_child_iterator());
3499 static bool classof(
const OMPClause *T) {
3500 return T->getClauseKind() == llvm::omp::OMPC_fail;
3504 SourceLocation getLParenLoc()
const {
3510 SourceLocation getFailParameterLoc()
const {
return FailParameterLoc; }
3523class OMPPrivateClause final
3525 private llvm::TrailingObjects<OMPPrivateClause, Expr *> {
3526 friend class OMPClauseReader;
3527 friend OMPVarListClause;
3528 friend TrailingObjects;
3536 OMPPrivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3537 SourceLocation EndLoc,
unsigned N)
3538 : OMPVarListClause<OMPPrivateClause>(llvm::omp::OMPC_private, StartLoc,
3539 LParenLoc, EndLoc, N) {}
3544 explicit OMPPrivateClause(
unsigned N)
3545 : OMPVarListClause<OMPPrivateClause>(llvm::omp::OMPC_private,
3546 SourceLocation(), SourceLocation(),
3547 SourceLocation(), N) {}
3552 void setPrivateCopies(ArrayRef<Expr *> VL);
3556 MutableArrayRef<Expr *> getPrivateCopies() {
3557 return {varlist_end(), varlist_size()};
3559 ArrayRef<const Expr *> getPrivateCopies()
const {
3560 return {varlist_end(), varlist_size()};
3572 static OMPPrivateClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
3573 SourceLocation LParenLoc,
3574 SourceLocation EndLoc, ArrayRef<Expr *> VL,
3575 ArrayRef<Expr *> PrivateVL);
3581 static OMPPrivateClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
3583 using private_copies_iterator = MutableArrayRef<Expr *>::iterator;
3584 using private_copies_const_iterator = ArrayRef<const Expr *>::iterator;
3585 using private_copies_range = llvm::iterator_range<private_copies_iterator>;
3586 using private_copies_const_range =
3587 llvm::iterator_range<private_copies_const_iterator>;
3589 private_copies_range private_copies() {
return getPrivateCopies(); }
3591 private_copies_const_range private_copies()
const {
3592 return getPrivateCopies();
3596 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3597 reinterpret_cast<Stmt **
>(varlist_end()));
3600 const_child_range
children()
const {
3601 return const_cast<OMPPrivateClause *
>(
this)->
children();
3605 return child_range(child_iterator(), child_iterator());
3608 return const_child_range(const_child_iterator(), const_child_iterator());
3611 static bool classof(
const OMPClause *T) {
3612 return T->getClauseKind() == llvm::omp::OMPC_private;
3624class OMPFirstprivateClause final
3627 private llvm::TrailingObjects<OMPFirstprivateClause, Expr *> {
3628 friend class OMPClauseReader;
3629 friend OMPVarListClause;
3630 friend TrailingObjects;
3638 OMPFirstprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3639 SourceLocation EndLoc,
unsigned N)
3640 : OMPVarListClause<OMPFirstprivateClause>(llvm::omp::OMPC_firstprivate,
3641 StartLoc, LParenLoc, EndLoc, N),
3642 OMPClauseWithPreInit(this) {}
3647 explicit OMPFirstprivateClause(
unsigned N)
3648 : OMPVarListClause<OMPFirstprivateClause>(
3649 llvm::omp::OMPC_firstprivate, SourceLocation(), SourceLocation(),
3650 SourceLocation(), N),
3651 OMPClauseWithPreInit(this) {}
3656 void setPrivateCopies(ArrayRef<Expr *> VL);
3660 MutableArrayRef<Expr *> getPrivateCopies() {
3661 return {varlist_end(), varlist_size()};
3663 ArrayRef<const Expr *> getPrivateCopies()
const {
3664 return {varlist_end(), varlist_size()};
3670 void setInits(ArrayRef<Expr *> VL);
3674 MutableArrayRef<Expr *>
getInits() {
3675 return {getPrivateCopies().end(), varlist_size()};
3677 ArrayRef<const Expr *>
getInits()
const {
3678 return {getPrivateCopies().end(), varlist_size()};
3695 static OMPFirstprivateClause *
3696 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
3697 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PrivateVL,
3698 ArrayRef<Expr *> InitVL, Stmt *PreInit);
3704 static OMPFirstprivateClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
3706 using private_copies_iterator = MutableArrayRef<Expr *>::iterator;
3707 using private_copies_const_iterator = ArrayRef<const Expr *>::iterator;
3708 using private_copies_range = llvm::iterator_range<private_copies_iterator>;
3709 using private_copies_const_range =
3710 llvm::iterator_range<private_copies_const_iterator>;
3712 private_copies_range private_copies() {
return getPrivateCopies(); }
3713 private_copies_const_range private_copies()
const {
3714 return getPrivateCopies();
3719 using inits_range = llvm::iterator_range<inits_iterator>;
3726 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3727 reinterpret_cast<Stmt **
>(varlist_end()));
3730 const_child_range
children()
const {
3731 return const_cast<OMPFirstprivateClause *
>(
this)->
children();
3735 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3736 reinterpret_cast<Stmt **
>(varlist_end()));
3739 return const_cast<OMPFirstprivateClause *
>(
this)->
used_children();
3742 static bool classof(
const OMPClause *T) {
3743 return T->getClauseKind() == llvm::omp::OMPC_firstprivate;
3755class OMPLastprivateClause final
3758 private llvm::TrailingObjects<OMPLastprivateClause, Expr *> {
3775 friend class OMPClauseReader;
3776 friend OMPVarListClause;
3777 friend TrailingObjects;
3782 SourceLocation LPKindLoc;
3784 SourceLocation ColonLoc;
3792 OMPLastprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3793 SourceLocation EndLoc, OpenMPLastprivateModifier LPKind,
3794 SourceLocation LPKindLoc, SourceLocation ColonLoc,
3796 : OMPVarListClause<OMPLastprivateClause>(llvm::omp::OMPC_lastprivate,
3797 StartLoc, LParenLoc, EndLoc, N),
3798 OMPClauseWithPostUpdate(this), LPKind(LPKind), LPKindLoc(LPKindLoc),
3799 ColonLoc(ColonLoc) {}
3804 explicit OMPLastprivateClause(
unsigned N)
3805 : OMPVarListClause<OMPLastprivateClause>(
3806 llvm::omp::OMPC_lastprivate, SourceLocation(), SourceLocation(),
3807 SourceLocation(), N),
3808 OMPClauseWithPostUpdate(this) {}
3812 MutableArrayRef<Expr *> getPrivateCopies() {
3813 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
3815 ArrayRef<const Expr *> getPrivateCopies()
const {
3816 return {varlist_end(), varlist_size()};
3823 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
3826 MutableArrayRef<Expr *> getSourceExprs() {
3827 return {getPrivateCopies().end(), varlist_size()};
3829 ArrayRef<const Expr *> getSourceExprs()
const {
3830 return {getPrivateCopies().end(), varlist_size()};
3837 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
3840 MutableArrayRef<Expr *> getDestinationExprs() {
3841 return {getSourceExprs().end(), varlist_size()};
3843 ArrayRef<const Expr *> getDestinationExprs()
const {
3844 return {getSourceExprs().end(), varlist_size()};
3850 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
3853 MutableArrayRef<Expr *> getAssignmentOps() {
3854 return {getDestinationExprs().end(), varlist_size()};
3856 ArrayRef<const Expr *> getAssignmentOps()
const {
3857 return {getDestinationExprs().end(), varlist_size()};
3861 void setKind(OpenMPLastprivateModifier Kind) { LPKind =
Kind; }
3863 void setKindLoc(SourceLocation Loc) { LPKindLoc = Loc; }
3865 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
3895 static OMPLastprivateClause *
3896 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
3897 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
3898 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps,
3899 OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc,
3900 SourceLocation ColonLoc, Stmt *PreInit, Expr *PostUpdate);
3906 static OMPLastprivateClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
3911 SourceLocation getKindLoc()
const {
return LPKindLoc; }
3913 SourceLocation
getColonLoc()
const {
return ColonLoc; }
3915 using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
3916 using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
3917 using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
3918 using helper_expr_const_range =
3919 llvm::iterator_range<helper_expr_const_iterator>;
3923 void setPrivateCopies(ArrayRef<Expr *> PrivateCopies);
3925 helper_expr_const_range private_copies()
const {
return getPrivateCopies(); }
3927 helper_expr_range private_copies() {
return getPrivateCopies(); }
3929 helper_expr_const_range source_exprs()
const {
return getSourceExprs(); }
3931 helper_expr_range source_exprs() {
return getSourceExprs(); }
3933 helper_expr_const_range destination_exprs()
const {
3934 return getDestinationExprs();
3937 helper_expr_range destination_exprs() {
return getDestinationExprs(); }
3939 helper_expr_const_range assignment_ops()
const {
return getAssignmentOps(); }
3941 helper_expr_range assignment_ops() {
return getAssignmentOps(); }
3944 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3945 reinterpret_cast<Stmt **
>(varlist_end()));
3948 const_child_range
children()
const {
3949 return const_cast<OMPLastprivateClause *
>(
this)->
children();
3953 return child_range(child_iterator(), child_iterator());
3956 return const_child_range(const_child_iterator(), const_child_iterator());
3959 static bool classof(
const OMPClause *T) {
3960 return T->getClauseKind() == llvm::omp::OMPC_lastprivate;
3971class OMPSharedClause final
3973 private llvm::TrailingObjects<OMPSharedClause, Expr *> {
3974 friend OMPVarListClause;
3975 friend TrailingObjects;
3983 OMPSharedClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3984 SourceLocation EndLoc,
unsigned N)
3985 : OMPVarListClause<OMPSharedClause>(llvm::omp::OMPC_shared, StartLoc,
3986 LParenLoc, EndLoc, N) {}
3991 explicit OMPSharedClause(
unsigned N)
3992 : OMPVarListClause<OMPSharedClause>(llvm::omp::OMPC_shared,
3993 SourceLocation(), SourceLocation(),
3994 SourceLocation(), N) {}
4004 static OMPSharedClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
4005 SourceLocation LParenLoc,
4006 SourceLocation EndLoc, ArrayRef<Expr *> VL);
4012 static OMPSharedClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
4015 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4016 reinterpret_cast<Stmt **
>(varlist_end()));
4019 const_child_range
children()
const {
4020 return const_cast<OMPSharedClause *
>(
this)->
children();
4024 return child_range(child_iterator(), child_iterator());
4027 return const_child_range(const_child_iterator(), const_child_iterator());
4030 static bool classof(
const OMPClause *T) {
4031 return T->getClauseKind() == llvm::omp::OMPC_shared;
4043class OMPReductionClause final
4046 private llvm::TrailingObjects<OMPReductionClause, Expr *, bool> {
4047 friend class OMPClauseReader;
4048 friend OMPVarListClause;
4049 friend TrailingObjects;
4056 OMPC_ORIGINAL_SHARING_default;
4059 SourceLocation ModifierLoc;
4062 SourceLocation ColonLoc;
4065 NestedNameSpecifierLoc QualifierLoc;
4068 DeclarationNameInfo NameInfo;
4080 OMPReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4081 SourceLocation ModifierLoc, SourceLocation ColonLoc,
4082 SourceLocation EndLoc,
4083 OpenMPReductionClauseModifier Modifier,
4084 OpenMPOriginalSharingModifier OriginalSharingModifier,
4085 unsigned N, NestedNameSpecifierLoc QualifierLoc,
4086 const DeclarationNameInfo &NameInfo)
4087 : OMPVarListClause<OMPReductionClause>(llvm::omp::OMPC_reduction,
4088 StartLoc, LParenLoc, EndLoc, N),
4089 OMPClauseWithPostUpdate(this), Modifier(Modifier),
4090 OriginalSharingModifier(OriginalSharingModifier),
4091 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc),
4092 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
4097 explicit OMPReductionClause(
unsigned N)
4098 : OMPVarListClause<OMPReductionClause>(llvm::omp::OMPC_reduction,
4099 SourceLocation(), SourceLocation(),
4100 SourceLocation(), N),
4101 OMPClauseWithPostUpdate(this) {}
4104 void setModifier(OpenMPReductionClauseModifier M) { Modifier = M; }
4107 void setOriginalSharingModifier(OpenMPOriginalSharingModifier M) {
4108 OriginalSharingModifier = M;
4115 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
4118 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
4121 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
4130 return {varlist_end(), varlist_size()};
4133 return {varlist_end(), varlist_size()};
4139 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
4142 MutableArrayRef<Expr *> getLHSExprs() {
4145 ArrayRef<const Expr *> getLHSExprs()
const {
4154 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
4157 void setPrivateVariableReductionFlags(ArrayRef<bool> Flags) {
4158 assert(Flags.size() == varlist_size() &&
4159 "Number of private flags does not match vars");
4160 llvm::copy(Flags, getTrailingObjects<bool>());
4164 MutableArrayRef<bool> getPrivateVariableReductionFlags() {
4165 return getTrailingObjects<bool>(varlist_size());
4167 ArrayRef<bool> getPrivateVariableReductionFlags()
const {
4168 return getTrailingObjects<bool>(varlist_size());
4172 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4173 return varlist_size() * (Modifier == OMPC_REDUCTION_inscan ? 8 : 5);
4177 size_t numTrailingObjects(OverloadToken<bool>)
const {
4178 return varlist_size();
4182 MutableArrayRef<Expr *> getRHSExprs() {
4183 return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
4185 ArrayRef<const Expr *> getRHSExprs()
const {
4186 return {getLHSExprs().end(), varlist_size()};
4193 void setReductionOps(ArrayRef<Expr *> ReductionOps);
4196 MutableArrayRef<Expr *> getReductionOps() {
4197 return {getRHSExprs().end(), varlist_size()};
4199 ArrayRef<const Expr *> getReductionOps()
const {
4200 return {getRHSExprs().end(), varlist_size()};
4205 void setInscanCopyOps(ArrayRef<Expr *> Ops);
4208 MutableArrayRef<Expr *> getInscanCopyOps() {
4209 return {getReductionOps().end(), varlist_size()};
4211 ArrayRef<const Expr *> getInscanCopyOps()
const {
4212 return {getReductionOps().end(), varlist_size()};
4216 void setInscanCopyArrayTemps(ArrayRef<Expr *> CopyArrayTemps);
4219 MutableArrayRef<Expr *> getInscanCopyArrayTemps() {
4220 return {getInscanCopyOps().end(), varlist_size()};
4222 ArrayRef<const Expr *> getInscanCopyArrayTemps()
const {
4223 return {getInscanCopyOps().end(), varlist_size()};
4227 void setInscanCopyArrayElems(ArrayRef<Expr *> CopyArrayElems);
4230 MutableArrayRef<Expr *> getInscanCopyArrayElems() {
4231 return {getInscanCopyArrayTemps().end(), varlist_size()};
4233 ArrayRef<const Expr *> getInscanCopyArrayElems()
const {
4234 return {getInscanCopyArrayTemps().end(), varlist_size()};
4278 static OMPReductionClause *
4279 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
4280 SourceLocation ModifierLoc, SourceLocation ColonLoc,
4281 SourceLocation EndLoc, OpenMPReductionClauseModifier Modifier,
4282 ArrayRef<Expr *> VL, NestedNameSpecifierLoc QualifierLoc,
4283 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
4284 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
4285 ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> CopyOps,
4286 ArrayRef<Expr *> CopyArrayTemps, ArrayRef<Expr *> CopyArrayElems,
4287 Stmt *PreInit, Expr *PostUpdate, ArrayRef<bool> IsPrivateVarReduction,
4288 OpenMPOriginalSharingModifier OriginalSharingModifier);
4295 static OMPReductionClause *
4297 OpenMPReductionClauseModifier Modifier);
4304 return OriginalSharingModifier;
4311 SourceLocation
getColonLoc()
const {
return ColonLoc; }
4314 const DeclarationNameInfo &getNameInfo()
const {
return NameInfo; }
4317 NestedNameSpecifierLoc getQualifierLoc()
const {
return QualifierLoc; }
4319 using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
4320 using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
4321 using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
4322 using helper_expr_const_range =
4323 llvm::iterator_range<helper_expr_const_iterator>;
4324 using helper_flag_iterator = MutableArrayRef<bool>::iterator;
4325 using helper_flag_const_iterator = ArrayRef<bool>::iterator;
4326 using helper_flag_range = llvm::iterator_range<helper_flag_iterator>;
4327 using helper_flag_const_range =
4328 llvm::iterator_range<helper_flag_const_iterator>;
4334 helper_expr_const_range lhs_exprs()
const {
return getLHSExprs(); }
4336 helper_expr_range lhs_exprs() {
return getLHSExprs(); }
4338 helper_expr_const_range rhs_exprs()
const {
return getRHSExprs(); }
4340 helper_expr_range rhs_exprs() {
return getRHSExprs(); }
4342 helper_flag_const_range private_var_reduction_flags()
const {
4343 return getPrivateVariableReductionFlags();
4346 helper_flag_range private_var_reduction_flags() {
4347 return getPrivateVariableReductionFlags();
4350 helper_expr_const_range reduction_ops()
const {
return getReductionOps(); }
4352 helper_expr_range reduction_ops() {
return getReductionOps(); }
4354 helper_expr_const_range copy_ops()
const {
return getInscanCopyOps(); }
4356 helper_expr_range copy_ops() {
return getInscanCopyOps(); }
4358 helper_expr_const_range copy_array_temps()
const {
4359 return getInscanCopyArrayTemps();
4362 helper_expr_range copy_array_temps() {
return getInscanCopyArrayTemps(); }
4364 helper_expr_const_range copy_array_elems()
const {
4365 return getInscanCopyArrayElems();
4368 helper_expr_range copy_array_elems() {
return getInscanCopyArrayElems(); }
4371 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4372 reinterpret_cast<Stmt **
>(varlist_end()));
4375 const_child_range
children()
const {
4376 return const_cast<OMPReductionClause *
>(
this)->
children();
4380 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4381 reinterpret_cast<Stmt **
>(varlist_end()));
4384 return const_cast<OMPReductionClause *
>(
this)->
used_children();
4387 static bool classof(
const OMPClause *T) {
4388 return T->getClauseKind() == llvm::omp::OMPC_reduction;
4400class OMPTaskReductionClause final
4403 private llvm::TrailingObjects<OMPTaskReductionClause, Expr *> {
4404 friend class OMPClauseReader;
4405 friend OMPVarListClause;
4406 friend TrailingObjects;
4409 SourceLocation ColonLoc;
4412 NestedNameSpecifierLoc QualifierLoc;
4415 DeclarationNameInfo NameInfo;
4426 OMPTaskReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4427 SourceLocation ColonLoc, SourceLocation EndLoc,
4428 unsigned N, NestedNameSpecifierLoc QualifierLoc,
4429 const DeclarationNameInfo &NameInfo)
4430 : OMPVarListClause<OMPTaskReductionClause>(
4431 llvm::omp::OMPC_task_reduction, StartLoc, LParenLoc, EndLoc, N),
4432 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
4433 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
4438 explicit OMPTaskReductionClause(
unsigned N)
4439 : OMPVarListClause<OMPTaskReductionClause>(
4440 llvm::omp::OMPC_task_reduction, SourceLocation(), SourceLocation(),
4441 SourceLocation(), N),
4442 OMPClauseWithPostUpdate(this) {}
4445 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
4448 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
4451 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
4459 return {varlist_end(), varlist_size()};
4462 return {varlist_end(), varlist_size()};
4468 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
4471 MutableArrayRef<Expr *> getLHSExprs() {
4474 ArrayRef<const Expr *> getLHSExprs()
const {
4482 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
4485 MutableArrayRef<Expr *> getRHSExprs() {
4486 return {getLHSExprs().end(), varlist_size()};
4488 ArrayRef<const Expr *> getRHSExprs()
const {
4489 return {getLHSExprs().end(), varlist_size()};
4496 void setReductionOps(ArrayRef<Expr *> ReductionOps);
4499 MutableArrayRef<Expr *> getReductionOps() {
4500 return {getRHSExprs().end(), varlist_size()};
4502 ArrayRef<const Expr *> getReductionOps()
const {
4503 return {getRHSExprs().end(), varlist_size()};
4539 static OMPTaskReductionClause *
4540 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
4541 SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
4542 NestedNameSpecifierLoc QualifierLoc,
4543 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
4544 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
4545 ArrayRef<Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate);
4551 static OMPTaskReductionClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
4554 SourceLocation
getColonLoc()
const {
return ColonLoc; }
4557 const DeclarationNameInfo &getNameInfo()
const {
return NameInfo; }
4560 NestedNameSpecifierLoc getQualifierLoc()
const {
return QualifierLoc; }
4562 using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
4563 using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
4564 using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
4565 using helper_expr_const_range =
4566 llvm::iterator_range<helper_expr_const_iterator>;
4572 helper_expr_const_range lhs_exprs()
const {
return getLHSExprs(); }
4574 helper_expr_range lhs_exprs() {
return getLHSExprs(); }
4576 helper_expr_const_range rhs_exprs()
const {
return getRHSExprs(); }
4578 helper_expr_range rhs_exprs() {
return getRHSExprs(); }
4580 helper_expr_const_range reduction_ops()
const {
return getReductionOps(); }
4582 helper_expr_range reduction_ops() {
return getReductionOps(); }
4585 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4586 reinterpret_cast<Stmt **
>(varlist_end()));
4589 const_child_range
children()
const {
4590 return const_cast<OMPTaskReductionClause *
>(
this)->
children();
4594 return child_range(child_iterator(), child_iterator());
4597 return const_child_range(const_child_iterator(), const_child_iterator());
4600 static bool classof(
const OMPClause *T) {
4601 return T->getClauseKind() == llvm::omp::OMPC_task_reduction;
4612class OMPInReductionClause final
4615 private llvm::TrailingObjects<OMPInReductionClause, Expr *> {
4616 friend class OMPClauseReader;
4617 friend OMPVarListClause;
4618 friend TrailingObjects;
4621 SourceLocation ColonLoc;
4624 NestedNameSpecifierLoc QualifierLoc;
4627 DeclarationNameInfo NameInfo;
4638 OMPInReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4639 SourceLocation ColonLoc, SourceLocation EndLoc,
4640 unsigned N, NestedNameSpecifierLoc QualifierLoc,
4641 const DeclarationNameInfo &NameInfo)
4642 : OMPVarListClause<OMPInReductionClause>(llvm::omp::OMPC_in_reduction,
4643 StartLoc, LParenLoc, EndLoc, N),
4644 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
4645 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
4650 explicit OMPInReductionClause(
unsigned N)
4651 : OMPVarListClause<OMPInReductionClause>(
4652 llvm::omp::OMPC_in_reduction, SourceLocation(), SourceLocation(),
4653 SourceLocation(), N),
4654 OMPClauseWithPostUpdate(this) {}
4657 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
4660 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
4663 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
4671 return {varlist_end(), varlist_size()};
4674 return {varlist_end(), varlist_size()};
4680 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
4683 MutableArrayRef<Expr *> getLHSExprs() {
4686 ArrayRef<const Expr *> getLHSExprs()
const {
4694 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
4697 MutableArrayRef<Expr *> getRHSExprs() {
4698 return {getLHSExprs().end(), varlist_size()};
4700 ArrayRef<const Expr *> getRHSExprs()
const {
4701 return {getLHSExprs().end(), varlist_size()};
4708 void setReductionOps(ArrayRef<Expr *> ReductionOps);
4711 MutableArrayRef<Expr *> getReductionOps() {
4712 return {getRHSExprs().end(), varlist_size()};
4714 ArrayRef<const Expr *> getReductionOps()
const {
4715 return {getRHSExprs().end(), varlist_size()};
4719 void setTaskgroupDescriptors(ArrayRef<Expr *> ReductionOps);
4722 MutableArrayRef<Expr *> getTaskgroupDescriptors() {
4723 return {getReductionOps().end(), varlist_size()};
4725 ArrayRef<const Expr *> getTaskgroupDescriptors()
const {
4726 return {getReductionOps().end(), varlist_size()};
4764 static OMPInReductionClause *
4765 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
4766 SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
4767 NestedNameSpecifierLoc QualifierLoc,
4768 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
4769 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
4770 ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> TaskgroupDescriptors,
4771 Stmt *PreInit, Expr *PostUpdate);
4777 static OMPInReductionClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
4780 SourceLocation
getColonLoc()
const {
return ColonLoc; }
4783 const DeclarationNameInfo &getNameInfo()
const {
return NameInfo; }
4786 NestedNameSpecifierLoc getQualifierLoc()
const {
return QualifierLoc; }
4788 using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
4789 using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
4790 using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
4791 using helper_expr_const_range =
4792 llvm::iterator_range<helper_expr_const_iterator>;
4798 helper_expr_const_range lhs_exprs()
const {
return getLHSExprs(); }
4800 helper_expr_range lhs_exprs() {
return getLHSExprs(); }
4802 helper_expr_const_range rhs_exprs()
const {
return getRHSExprs(); }
4804 helper_expr_range rhs_exprs() {
return getRHSExprs(); }
4806 helper_expr_const_range reduction_ops()
const {
return getReductionOps(); }
4808 helper_expr_range reduction_ops() {
return getReductionOps(); }
4810 helper_expr_const_range taskgroup_descriptors()
const {
4811 return getTaskgroupDescriptors();
4814 helper_expr_range taskgroup_descriptors() {
4815 return getTaskgroupDescriptors();
4819 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4820 reinterpret_cast<Stmt **
>(varlist_end()));
4823 const_child_range
children()
const {
4824 return const_cast<OMPInReductionClause *
>(
this)->
children();
4828 return child_range(child_iterator(), child_iterator());
4831 return const_child_range(const_child_iterator(), const_child_iterator());
4834 static bool classof(
const OMPClause *T) {
4835 return T->getClauseKind() == llvm::omp::OMPC_in_reduction;
4847class OMPLinearClause final
4850 private llvm::TrailingObjects<OMPLinearClause, Expr *> {
4851 friend class OMPClauseReader;
4852 friend OMPVarListClause;
4853 friend TrailingObjects;
4859 SourceLocation ModifierLoc;
4862 SourceLocation ColonLoc;
4865 SourceLocation StepModifierLoc;
4868 void setStep(Expr *Step) { *(
getFinals().end()) = Step; }
4871 void setCalcStep(Expr *CalcStep) { *(
getFinals().end() + 1) = CalcStep; }
4881 OMPLinearClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4882 OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc,
4883 SourceLocation ColonLoc, SourceLocation StepModifierLoc,
4884 SourceLocation EndLoc,
unsigned NumVars)
4885 : OMPVarListClause<OMPLinearClause>(llvm::omp::OMPC_linear, StartLoc,
4886 LParenLoc, EndLoc, NumVars),
4887 OMPClauseWithPostUpdate(this), Modifier(Modifier),
4888 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc),
4889 StepModifierLoc(StepModifierLoc) {}
4894 explicit OMPLinearClause(
unsigned NumVars)
4895 : OMPVarListClause<OMPLinearClause>(llvm::omp::OMPC_linear,
4896 SourceLocation(), SourceLocation(),
4897 SourceLocation(), NumVars),
4898 OMPClauseWithPostUpdate(this) {}
4913 return {varlist_end(), varlist_size()};
4916 return {varlist_end(), varlist_size()};
4923 return {getPrivates().end(), varlist_size()};
4928 return {
getInits().end(), varlist_size()};
4931 return {getInits().end(), varlist_size()};
4939 return {getUpdates().end(), varlist_size()};
4944 return {
getFinals().end() + 2, varlist_size() + 1};
4947 return {getFinals().end() + 2, varlist_size() + 1};
4979 static OMPLinearClause *
5021 const Expr *getStep()
const {
return *(getFinals().end()); }
5027 const Expr *getCalcStep()
const {
return *(getFinals().end() + 1); }
5047 privates_const_range privates()
const {
return getPrivates(); }
5056 inits_const_range inits()
const {
return getInits(); }
5065 updates_const_range updates()
const {
return getUpdates(); }
5074 finals_const_range finals()
const {
return getFinals(); }
5079 llvm::iterator_range<used_expressions_iterator>;
5081 llvm::iterator_range<used_expressions_const_iterator>;
5087 used_expressions_const_range used_expressions()
const {
5088 return finals_const_range(getUsedExprs().begin(), getUsedExprs().end());
5092 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5093 reinterpret_cast<Stmt **
>(varlist_end()));
5096 const_child_range children()
const {
5097 return const_cast<OMPLinearClause *
>(
this)->children();
5103 return const_cast<OMPLinearClause *
>(
this)->
used_children();
5107 return T->getClauseKind() == llvm::omp::OMPC_linear;
5119class OMPAlignedClause final
5120 :
public OMPVarListClause<OMPAlignedClause>,
5121 private llvm::TrailingObjects<OMPAlignedClause, Expr *> {
5123 friend OMPVarListClause;
5124 friend TrailingObjects;
5127 SourceLocation ColonLoc;
5130 void setAlignment(Expr *A) { *varlist_end() = A; }
5140 SourceLocation ColonLoc, SourceLocation EndLoc,
5143 LParenLoc, EndLoc, NumVars),
5144 ColonLoc(ColonLoc) {}
5149 explicit OMPAlignedClause(
unsigned NumVars)
5150 : OMPVarListClause<OMPAlignedClause>(llvm::omp::OMPC_aligned,
5151 SourceLocation(), SourceLocation(),
5152 SourceLocation(), NumVars) {}
5164 static OMPAlignedClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
5165 SourceLocation LParenLoc,
5166 SourceLocation ColonLoc,
5167 SourceLocation EndLoc, ArrayRef<Expr *> VL,
5174 static OMPAlignedClause *
CreateEmpty(
const ASTContext &C,
unsigned NumVars);
5189 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5190 reinterpret_cast<Stmt **
>(varlist_end()));
5194 return const_cast<OMPAlignedClause *
>(
this)->
children();
5198 return child_range(child_iterator(), child_iterator());
5201 return const_child_range(const_child_iterator(), const_child_iterator());
5205 return T->getClauseKind() == llvm::omp::OMPC_aligned;
5216class OMPCopyinClause final
5217 :
public OMPVarListClause<OMPCopyinClause>,
5218 private llvm::TrailingObjects<OMPCopyinClause, Expr *> {
5233 friend OMPVarListClause;
5234 friend TrailingObjects;
5242 OMPCopyinClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5243 SourceLocation EndLoc,
unsigned N)
5244 : OMPVarListClause<OMPCopyinClause>(
llvm::omp::OMPC_copyin, StartLoc,
5245 LParenLoc, EndLoc, N) {}
5252 SourceLocation(), SourceLocation(),
5253 SourceLocation(), N) {}
5258 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
5261 MutableArrayRef<Expr *> getSourceExprs() {
5262 return {varlist_end(), varlist_size()};
5264 ArrayRef<const Expr *> getSourceExprs()
const {
5265 return {varlist_end(), varlist_size()};
5271 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
5274 MutableArrayRef<Expr *> getDestinationExprs() {
5275 return {getSourceExprs().end(), varlist_size()};
5277 ArrayRef<const Expr *> getDestinationExprs()
const {
5278 return {getSourceExprs().end(), varlist_size()};
5285 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
5288 MutableArrayRef<Expr *> getAssignmentOps() {
5289 return {getDestinationExprs().end(), varlist_size()};
5291 ArrayRef<const Expr *> getAssignmentOps()
const {
5292 return {getDestinationExprs().end(), varlist_size()};
5317 static OMPCopyinClause *
5318 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
5319 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
5320 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
5326 static OMPCopyinClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
5332 llvm::iterator_range<helper_expr_const_iterator>;
5339 return getDestinationExprs();
5349 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5350 reinterpret_cast<Stmt **
>(varlist_end()));
5354 return const_cast<OMPCopyinClause *
>(
this)->
children();
5358 return child_range(child_iterator(), child_iterator());
5361 return const_child_range(const_child_iterator(), const_child_iterator());
5365 return T->getClauseKind() == llvm::omp::OMPC_copyin;
5377class OMPCopyprivateClause final
5378 :
public OMPVarListClause<OMPCopyprivateClause>,
5379 private llvm::TrailingObjects<OMPCopyprivateClause, Expr *> {
5381 friend OMPVarListClause;
5382 friend TrailingObjects;
5390 OMPCopyprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5391 SourceLocation EndLoc,
unsigned N)
5392 : OMPVarListClause<OMPCopyprivateClause>(
llvm::omp::OMPC_copyprivate,
5393 StartLoc, LParenLoc, EndLoc, N) {
5401 llvm::omp::OMPC_copyprivate, SourceLocation(), SourceLocation(),
5402 SourceLocation(), N) {}
5407 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
5410 MutableArrayRef<Expr *> getSourceExprs() {
5411 return {varlist_end(), varlist_size()};
5413 ArrayRef<const Expr *> getSourceExprs()
const {
5414 return {varlist_end(), varlist_size()};
5420 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
5423 MutableArrayRef<Expr *> getDestinationExprs() {
5424 return {getSourceExprs().end(), varlist_size()};
5426 ArrayRef<const Expr *> getDestinationExprs()
const {
5427 return {getSourceExprs().end(), varlist_size()};
5434 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
5437 MutableArrayRef<Expr *> getAssignmentOps() {
5438 return {getDestinationExprs().end(), varlist_size()};
5440 ArrayRef<const Expr *> getAssignmentOps()
const {
5441 return {getDestinationExprs().end(), varlist_size()};
5465 static OMPCopyprivateClause *
5466 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
5467 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
5468 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
5474 static OMPCopyprivateClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
5480 llvm::iterator_range<helper_expr_const_iterator>;
5487 return getDestinationExprs();
5497 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5498 reinterpret_cast<Stmt **
>(varlist_end()));
5502 return const_cast<OMPCopyprivateClause *
>(
this)->
children();
5506 return child_range(child_iterator(), child_iterator());
5509 return const_child_range(const_child_iterator(), const_child_iterator());
5513 return T->getClauseKind() == llvm::omp::OMPC_copyprivate;
5529class OMPFlushClause final
5530 :
public OMPVarListClause<OMPFlushClause>,
5531 private llvm::TrailingObjects<OMPFlushClause, Expr *> {
5532 friend OMPVarListClause;
5533 friend TrailingObjects;
5541 OMPFlushClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5542 SourceLocation EndLoc,
unsigned N)
5543 : OMPVarListClause<OMPFlushClause>(llvm::omp::OMPC_flush, StartLoc,
5544 LParenLoc, EndLoc, N) {}
5549 explicit OMPFlushClause(
unsigned N)
5550 : OMPVarListClause<OMPFlushClause>(llvm::omp::OMPC_flush,
5551 SourceLocation(), SourceLocation(),
5552 SourceLocation(), N) {}
5562 static OMPFlushClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
5563 SourceLocation LParenLoc, SourceLocation EndLoc,
5573 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5574 reinterpret_cast<Stmt **
>(varlist_end()));
5578 return const_cast<OMPFlushClause *
>(
this)->
children();
5582 return child_range(child_iterator(), child_iterator());
5585 return const_child_range(const_child_iterator(), const_child_iterator());
5589 return T->getClauseKind() == llvm::omp::OMPC_flush;
5609 SourceLocation LParenLoc;
5612 Expr *Depobj =
nullptr;
5619 OMPDepobjClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5620 SourceLocation EndLoc)
5622 LParenLoc(LParenLoc) {}
5627 :
OMPClause(
llvm::omp::OMPC_depobj, SourceLocation(), SourceLocation()) {}
5629 void setDepobj(Expr *E) { Depobj = E; }
5632 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
5642 static OMPDepobjClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
5643 SourceLocation LParenLoc,
5644 SourceLocation EndLoc, Expr *Depobj);
5649 static OMPDepobjClause *
CreateEmpty(
const ASTContext &C);
5659 return child_range(
reinterpret_cast<Stmt **
>(&Depobj),
5660 reinterpret_cast<Stmt **
>(&Depobj) + 1);
5664 return const_cast<OMPDepobjClause *
>(
this)->
children();
5668 return child_range(child_iterator(), child_iterator());
5671 return const_child_range(const_child_iterator(), const_child_iterator());
5675 return T->getClauseKind() == llvm::omp::OMPC_depobj;
5687class OMPDependClause final
5688 :
public OMPVarListClause<OMPDependClause>,
5689 private llvm::TrailingObjects<OMPDependClause, Expr *> {
5691 friend OMPVarListClause;
5692 friend TrailingObjects;
5697 OpenMPDependClauseKind
DepKind = OMPC_DEPEND_unknown;
5714 unsigned NumLoops = 0;
5724 OMPDependClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5725 SourceLocation EndLoc,
unsigned N,
unsigned NumLoops)
5726 : OMPVarListClause<OMPDependClause>(
llvm::omp::OMPC_depend, StartLoc,
5727 LParenLoc, EndLoc, N),
5728 NumLoops(NumLoops) {}
5737 SourceLocation(), SourceLocation(),
5738 SourceLocation(), N),
5739 NumLoops(NumLoops) {}
5742 void setDependencyKind(OpenMPDependClauseKind K) {
Data.DepKind = K; }
5745 void setDependencyLoc(SourceLocation Loc) {
Data.DepLoc = Loc; }
5751 void setOmpAllMemoryLoc(SourceLocation Loc) {
Data.OmpAllMemoryLoc = Loc; }
5767 static OMPDependClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
5768 SourceLocation LParenLoc,
5769 SourceLocation EndLoc, DependDataTy Data,
5770 Expr *DepModifier, ArrayRef<Expr *> VL,
5779 static OMPDependClause *
CreateEmpty(
const ASTContext &C,
unsigned N,
5795 Expr *getModifier();
5797 return const_cast<OMPDependClause *
>(
this)->
getModifier();
5805 void setLoopData(
unsigned NumLoop, Expr *Cnt);
5808 Expr *getLoopData(
unsigned NumLoop);
5809 const Expr *getLoopData(
unsigned NumLoop)
const;
5812 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5813 reinterpret_cast<Stmt **
>(varlist_end()));
5817 return const_cast<OMPDependClause *
>(
this)->
children();
5821 return child_range(child_iterator(), child_iterator());
5824 return const_child_range(const_child_iterator(), const_child_iterator());
5828 return T->getClauseKind() == llvm::omp::OMPC_depend;
5844 SourceLocation LParenLoc;
5847 OpenMPDeviceClauseModifier Modifier = OMPC_DEVICE_unknown;
5850 SourceLocation ModifierLoc;
5853 Stmt *Device =
nullptr;
5858 void setDevice(Expr *E) { Device = E; }
5861 void setModifier(OpenMPDeviceClauseModifier M) { Modifier = M; }
5878 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
5879 SourceLocation LParenLoc, SourceLocation ModifierLoc,
5880 SourceLocation EndLoc)
5883 ModifierLoc(ModifierLoc), Device(E) {
5884 setPreInitStmt(HelperE, CaptureRegion);
5889 :
OMPClause(
llvm::omp::OMPC_device, SourceLocation(), SourceLocation()),
5910 child_range
children() {
return child_range(&Device, &Device + 1); }
5913 return const_child_range(&Device, &Device + 1);
5917 return child_range(child_iterator(), child_iterator());
5920 return const_child_range(const_child_iterator(), const_child_iterator());
5924 return T->getClauseKind() == llvm::omp::OMPC_device;
5965 :
OMPClause(
llvm::omp::OMPC_simd, SourceLocation(), SourceLocation()) {}
5968 return child_range(child_iterator(), child_iterator());
5972 return const_child_range(const_child_iterator(), const_child_iterator());
5976 return child_range(child_iterator(), child_iterator());
5979 return const_child_range(const_child_iterator(), const_child_iterator());
5983 return T->getClauseKind() == llvm::omp::OMPC_simd;
6000 llvm::PointerIntPair<Expr *, 1, bool> AssociatedExpressionNonContiguousPr;
6005 ValueDecl *AssociatedDeclaration =
nullptr;
6010 ValueDecl *AssociatedDeclaration,
6011 bool IsNonContiguous)
6012 : AssociatedExpressionNonContiguousPr(AssociatedExpression,
6014 AssociatedDeclaration(
6015 AssociatedDeclaration
6020 return AssociatedExpressionNonContiguousPr.getPointer();
6024 return AssociatedExpressionNonContiguousPr.getInt();
6028 return AssociatedDeclaration;
6032 return AssociatedExpressionNonContiguousPr ==
6033 Other.AssociatedExpressionNonContiguousPr &&
6034 AssociatedDeclaration == Other.AssociatedDeclaration;
6074 static QualType getComponentExprElementType(
const Expr *Exp);
6134 static std::pair<const Expr *, std::optional<size_t>>
6135 findAttachPtrExpr(MappableExprComponentListRef Components,
6136 OpenMPDirectiveKind CurDirKind);
6141 getComponentsTotalNumber(MappableExprComponentListsRef ComponentLists);
6177 unsigned NumUniqueDeclarations;
6180 unsigned NumComponentLists;
6183 unsigned NumComponents;
6188 const bool SupportsMapper;
6191 NestedNameSpecifierLoc MapperQualifierLoc;
6194 DeclarationNameInfo MapperIdInfo;
6216 OpenMPClauseKind K,
const OMPVarListLocTy &Locs,
6218 NestedNameSpecifierLoc *MapperQualifierLocPtr =
nullptr,
6219 DeclarationNameInfo *MapperIdInfoPtr =
nullptr)
6220 : OMPVarListClause<T>(K, Locs.StartLoc, Locs.LParenLoc, Locs.EndLoc,
6222 NumUniqueDeclarations(Sizes.NumUniqueDeclarations),
6223 NumComponentLists(Sizes.NumComponentLists),
6224 NumComponents(Sizes.NumComponents), SupportsMapper(SupportsMapper) {
6225 if (MapperQualifierLocPtr)
6226 MapperQualifierLoc = *MapperQualifierLocPtr;
6227 if (MapperIdInfoPtr)
6228 MapperIdInfo = *MapperIdInfoPtr;
6234 return static_cast<T *
>(
this)
6235 ->
template getTrailingObjectsNonStrict<ValueDecl *>(
6236 NumUniqueDeclarations);
6242 return static_cast<const T *
>(
this)
6243 ->
template getTrailingObjectsNonStrict<ValueDecl *>(
6244 NumUniqueDeclarations);
6250 assert(UDs.size() == NumUniqueDeclarations &&
6251 "Unexpected amount of unique declarations.");
6258 return static_cast<T *
>(
this)
6259 ->
template getTrailingObjectsNonStrict<unsigned>(NumUniqueDeclarations);
6265 return static_cast<const T *
>(
this)
6266 ->
template getTrailingObjectsNonStrict<unsigned>(NumUniqueDeclarations);
6272 assert(DNLs.size() == NumUniqueDeclarations &&
6273 "Unexpected amount of list numbers.");
6280 return MutableArrayRef<unsigned>(
6281 static_cast<T *
>(
this)
6282 ->
template getTrailingObjectsNonStrict<unsigned>() +
6283 NumUniqueDeclarations,
6291 static_cast<const T *
>(
this)
6292 ->
template getTrailingObjectsNonStrict<unsigned>() +
6293 NumUniqueDeclarations,
6300 assert(CLSs.size() == NumComponentLists &&
6301 "Unexpected amount of component lists.");
6307 return static_cast<T *
>(
this)
6308 ->
template getTrailingObjectsNonStrict<MappableComponent>(
6314 return static_cast<const T *
>(
this)
6315 ->
template getTrailingObjectsNonStrict<MappableComponent>(
6324 assert(Components.size() == NumComponents &&
6325 "Unexpected amount of component lists.");
6326 assert(CLSs.size() == NumComponentLists &&
6327 "Unexpected amount of list sizes.");
6338 NumUniqueDeclarations &&
6339 "Unexpected number of mappable expression info entries!");
6341 "Unexpected total number of components!");
6342 assert(Declarations.size() == ComponentLists.size() &&
6343 "Declaration and component lists size is not consistent!");
6344 assert(Declarations.size() == NumComponentLists &&
6345 "Unexpected declaration and component lists size!");
6350 llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
6353 auto CI = ComponentLists.begin();
6354 for (
auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
6356 assert(!CI->empty() &&
"Invalid component list!");
6357 ComponentListMap[*DI].push_back(*CI);
6363 auto UDI = UniqueDeclarations.begin();
6366 auto DNLI = DeclNumLists.begin();
6369 auto CLSI = ComponentListSizes.begin();
6372 auto CI = Components.begin();
6375 unsigned PrevSize = 0u;
6378 for (
auto &M : ComponentListMap) {
6395 PrevSize += C.size();
6402 CI = llvm::copy(C, CI);
6409 MapperQualifierLoc = NNSL;
6414 MapperIdInfo = MapperId;
6420 assert(SupportsMapper &&
6421 "Must be a clause that is possible to have user-defined mappers");
6422 return MutableArrayRef<Expr *>(
6423 static_cast<T *
>(
this)->
template getTrailingObjects<Expr *>() +
6424 OMPVarListClause<T>::varlist_size(),
6425 OMPVarListClause<T>::varlist_size());
6431 assert(SupportsMapper &&
6432 "Must be a clause that is possible to have user-defined mappers");
6434 static_cast<const T *
>(
this)->
template getTrailingObjects<Expr *>() +
6435 OMPVarListClause<T>::varlist_size(),
6436 OMPVarListClause<T>::varlist_size());
6442 assert(DMDs.size() == OMPVarListClause<T>::varlist_size() &&
6443 "Unexpected number of user-defined mappers.");
6444 assert(SupportsMapper &&
6445 "Must be a clause that is possible to have user-defined mappers");
6462 return MapperQualifierLoc;
6471 :
public llvm::iterator_adaptor_base<
6472 const_component_lists_iterator,
6473 MappableExprComponentListRef::const_iterator,
6474 std::forward_iterator_tag, MappableComponent, ptrdiff_t,
6475 MappableComponent, MappableComponent> {
6483 const bool SupportsMapper;
6489 unsigned RemainingLists = 0;
6493 unsigned PrevListSize = 0;
6501 MappableExprComponentListRef::const_iterator End;
6511 Components.begin()),
6512 DeclCur(UniqueDecls.begin()), NumListsCur(DeclsListNum.begin()),
6513 SupportsMapper(SupportsMapper),
6514 ListSizeCur(CumulativeListSizes.begin()),
6515 ListSizeEnd(CumulativeListSizes.end()), End(Components.end()) {
6516 assert(UniqueDecls.size() == DeclsListNum.size() &&
6517 "Inconsistent number of declarations and list sizes!");
6518 if (!DeclsListNum.empty())
6519 RemainingLists = *NumListsCur;
6521 MapperCur = Mappers.begin();
6532 CumulativeListSizes, Components,
6533 SupportsMapper, Mappers) {
6537 for (; DeclCur != UniqueDecls.end(); ++DeclCur, ++NumListsCur) {
6538 if (*DeclCur == Declaration)
6541 assert(*NumListsCur > 0 &&
"No lists associated with declaration??");
6545 std::advance(ListSizeCur, *NumListsCur - 1);
6546 PrevListSize = *ListSizeCur;
6555 if (ListSizeCur == CumulativeListSizes.end()) {
6557 RemainingLists = 0u;
6563 RemainingLists = *NumListsCur;
6566 ListSizeEnd = ListSizeCur;
6567 std::advance(ListSizeEnd, RemainingLists);
6571 std::advance(this->I, PrevListSize);
6579 assert(ListSizeCur != ListSizeEnd &&
"Invalid iterator!");
6580 const ValueDecl *Mapper =
nullptr;
6581 if (SupportsMapper && *MapperCur)
6582 Mapper = cast<ValueDecl>(cast<DeclRefExpr>(*MapperCur)->getDecl());
6583 return std::make_tuple(
6596 assert(ListSizeCur != ListSizeEnd && RemainingLists &&
6597 "Invalid iterator!");
6601 if (std::next(ListSizeCur) == ListSizeEnd) {
6605 std::advance(this->I, *ListSizeCur - PrevListSize);
6606 PrevListSize = *ListSizeCur;
6609 if (!(--RemainingLists)) {
6612 RemainingLists = *NumListsCur;
6613 assert(RemainingLists &&
"No lists in the following declaration??");
6625 llvm::iterator_range<const_component_lists_iterator>;
6639 SupportsMapper, {});
6647 const_component_lists_iterator
6670 llvm::iterator_range<const_all_num_lists_iterator>;
6678 llvm::iterator_range<const_all_lists_sizes_iterator>;
6686 llvm::iterator_range<const_all_components_iterator>;
6696 llvm::iterator_range<mapperlist_const_iterator>;
6722class OMPMapClause final :
public OMPMappableExprListClause<OMPMapClause>,
6723 private llvm::TrailingObjects<
6724 OMPMapClause, Expr *, ValueDecl *, unsigned,
6725 OMPClauseMappableExprCommon::MappableComponent> {
6727 friend OMPMappableExprListClause;
6728 friend OMPVarListClause;
6729 friend TrailingObjects;
6733 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
6736 return 2 * varlist_size() + 1;
6738 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
6739 return getUniqueDeclarationsNum();
6741 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
6742 return getUniqueDeclarationsNum() + getTotalComponentListNum();
6754 SourceLocation MapTypeModifiersLoc[NumberOfOMPMapClauseModifiers];
6760 bool MapTypeIsImplicit =
false;
6763 SourceLocation MapLoc;
6766 SourceLocation ColonLoc;
6788 explicit OMPMapClause(ArrayRef<OpenMPMapModifierKind> MapModifiers,
6789 ArrayRef<SourceLocation> MapModifiersLoc,
6790 NestedNameSpecifierLoc MapperQualifierLoc,
6791 DeclarationNameInfo MapperIdInfo,
6792 OpenMPMapClauseKind MapType,
bool MapTypeIsImplicit,
6793 SourceLocation MapLoc,
const OMPVarListLocTy &Locs,
6794 const OMPMappableExprListSizeTy &Sizes)
6795 : OMPMappableExprListClause(llvm::omp::OMPC_map, Locs, Sizes,
6796 true, &MapperQualifierLoc,
6798 MapType(MapType), MapTypeIsImplicit(MapTypeIsImplicit), MapLoc(MapLoc) {
6799 assert(std::size(MapTypeModifiers) == MapModifiers.size() &&
6800 "Unexpected number of map type modifiers.");
6801 llvm::copy(MapModifiers, std::begin(MapTypeModifiers));
6803 assert(std::size(MapTypeModifiersLoc) == MapModifiersLoc.size() &&
6804 "Unexpected number of map type modifier locations.");
6805 llvm::copy(MapModifiersLoc, std::begin(MapTypeModifiersLoc));
6815 explicit OMPMapClause(
const OMPMappableExprListSizeTy &Sizes)
6816 : OMPMappableExprListClause(llvm::omp::OMPC_map, OMPVarListLocTy(), Sizes,
6823 void setMapTypeModifier(
unsigned I, OpenMPMapModifierKind T) {
6824 assert(I < NumberOfOMPMapClauseModifiers &&
6825 "Unexpected index to store map type modifier, exceeds array size.");
6826 MapTypeModifiers[I] =
T;
6833 void setMapTypeModifierLoc(
unsigned I, SourceLocation TLoc) {
6834 assert(I < NumberOfOMPMapClauseModifiers &&
6835 "Index to store map type modifier location exceeds array size.");
6836 MapTypeModifiersLoc[I] = TLoc;
6842 void setMapType(OpenMPMapClauseKind T) { MapType =
T; }
6847 void setMapLoc(SourceLocation TLoc) { MapLoc = TLoc; }
6850 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
6853 void setIteratorModifier(Expr *IteratorModifier) {
6854 getTrailingObjects<Expr *>()[2 * varlist_size()] = IteratorModifier;
6878 static OMPMapClause *
6879 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
6880 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
6881 MappableExprComponentListsRef ComponentLists,
6882 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorModifier,
6883 ArrayRef<OpenMPMapModifierKind> MapModifiers,
6884 ArrayRef<SourceLocation> MapModifiersLoc,
6885 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId,
6886 OpenMPMapClauseKind Type,
bool TypeIsImplicit, SourceLocation TypeLoc);
6898 static OMPMapClause *
CreateEmpty(
const ASTContext &C,
6899 const OMPMappableExprListSizeTy &Sizes);
6903 return getTrailingObjects<Expr *>()[2 * varlist_size()];
6907 OpenMPMapClauseKind
getMapType() const LLVM_READONLY {
return MapType; }
6920 assert(Cnt < NumberOfOMPMapClauseModifiers &&
6921 "Requested modifier exceeds the total number of modifiers.");
6922 return MapTypeModifiers[Cnt];
6930 assert(Cnt < NumberOfOMPMapClauseModifiers &&
6931 "Requested modifier location exceeds total number of modifiers.");
6932 return MapTypeModifiersLoc[Cnt];
6937 return MapTypeModifiers;
6942 return MapTypeModifiersLoc;
6946 SourceLocation
getMapLoc() const LLVM_READONLY {
return MapLoc; }
6953 reinterpret_cast<Stmt **
>(varlist_begin()),
6954 reinterpret_cast<Stmt **
>(varlist_end()));
6958 return const_cast<OMPMapClause *
>(
this)->
children();
6962 if (MapType == OMPC_MAP_to || MapType == OMPC_MAP_tofrom)
6963 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
6964 reinterpret_cast<Stmt **
>(varlist_end()));
6965 return child_range(child_iterator(), child_iterator());
6973 return T->getClauseKind() == llvm::omp::OMPC_map;
7006class OMPNumTeamsClause final
7007 :
public OMPVarListClause<OMPNumTeamsClause>,
7009 private llvm::TrailingObjects<OMPNumTeamsClause, Expr *> {
7011 friend OMPVarListClause;
7012 friend TrailingObjects;
7015 OpenMPNumTeamsClauseModifier Modifier = OMPC_NUMTEAMS_unknown;
7018 SourceLocation ModifierLoc;
7020 OMPNumTeamsClause(
const ASTContext &C, SourceLocation StartLoc,
7021 SourceLocation LParenLoc, SourceLocation EndLoc,
unsigned N)
7022 : OMPVarListClause(
llvm::omp::OMPC_num_teams, StartLoc, LParenLoc, EndLoc,
7028 : OMPVarListClause(
llvm::omp::OMPC_num_teams, SourceLocation(),
7029 SourceLocation(), SourceLocation(), N),
7033 void setModifier(OpenMPNumTeamsClauseModifier M) { Modifier = M; }
7036 void setModifierExpr(Expr *E) { *varlist_end() = E; }
7053 static OMPNumTeamsClause *
7054 Create(
const ASTContext &C, OpenMPDirectiveKind CaptureRegion,
7055 SourceLocation StartLoc, SourceLocation LParenLoc,
7056 SourceLocation EndLoc, ArrayRef<Expr *> VL,
7057 OpenMPNumTeamsClauseModifier Modifier, Expr *ModifierExpr,
7058 SourceLocation ModifierLoc, Stmt *PreInit);
7064 static OMPNumTeamsClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
7071 return const_cast<OMPNumTeamsClause *
>(
this)->
getNumTeams();
7085 if (Modifier == OMPC_NUMTEAMS_dims)
7094 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
7095 reinterpret_cast<Stmt **
>(varlist_end()) + 1);
7099 return const_cast<OMPNumTeamsClause *
>(
this)->
children();
7103 return child_range(child_iterator(), child_iterator());
7106 return const_child_range(const_child_iterator(), const_child_iterator());
7110 return T->getClauseKind() == llvm::omp::OMPC_num_teams;
7136class OMPThreadLimitClause final
7137 :
public OMPVarListClause<OMPThreadLimitClause>,
7139 private llvm::TrailingObjects<OMPThreadLimitClause, Expr *> {
7141 friend OMPVarListClause;
7142 friend TrailingObjects;
7145 OpenMPThreadLimitClauseModifier Modifier = OMPC_THREADLIMIT_unknown;
7148 SourceLocation ModifierLoc;
7150 OMPThreadLimitClause(
const ASTContext &C, SourceLocation StartLoc,
7151 SourceLocation LParenLoc, SourceLocation EndLoc,
7153 : OMPVarListClause(
llvm::omp::OMPC_thread_limit, StartLoc, LParenLoc,
7159 : OMPVarListClause(
llvm::omp::OMPC_thread_limit, SourceLocation(),
7160 SourceLocation(), SourceLocation(), N),
7164 void setModifier(OpenMPThreadLimitClauseModifier M) { Modifier = M; }
7170 void setModifierExpr(Expr *E) { *varlist_end() = E; }
7184 static OMPThreadLimitClause *
7185 Create(
const ASTContext &C, OpenMPDirectiveKind CaptureRegion,
7186 SourceLocation StartLoc, SourceLocation LParenLoc,
7187 SourceLocation EndLoc, ArrayRef<Expr *> VL,
7188 OpenMPThreadLimitClauseModifier Modifier, Expr *ModifierExpr,
7189 SourceLocation ModifierLoc, Stmt *PreInit);
7195 static OMPThreadLimitClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
7202 return const_cast<OMPThreadLimitClause *
>(
this)->
getThreadLimit();
7206 OpenMPThreadLimitClauseModifier
getModifier()
const {
return Modifier; }
7216 if (Modifier == OMPC_THREADLIMIT_dims)
7225 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
7226 reinterpret_cast<Stmt **
>(varlist_end()) + 1);
7230 return const_cast<OMPThreadLimitClause *
>(
this)->
children();
7234 return child_range(child_iterator(), child_iterator());
7237 return const_child_range(const_child_iterator(), const_child_iterator());
7241 return T->getClauseKind() == llvm::omp::OMPC_thread_limit;
7257 SourceLocation LParenLoc;
7260 Stmt *Priority =
nullptr;
7265 void setPriority(Expr *E) { Priority = E; }
7278 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
7279 SourceLocation LParenLoc, SourceLocation EndLoc)
7282 setPreInitStmt(HelperPriority, CaptureRegion);
7287 :
OMPClause(
llvm::omp::OMPC_priority, SourceLocation(), SourceLocation()),
7302 child_range
children() {
return child_range(&Priority, &Priority + 1); }
7305 return const_child_range(&Priority, &Priority + 1);
7308 child_range used_children();
7314 return T->getClauseKind() == llvm::omp::OMPC_priority;
7330 SourceLocation LParenLoc;
7333 OpenMPGrainsizeClauseModifier Modifier = OMPC_GRAINSIZE_unknown;
7336 SourceLocation ModifierLoc;
7339 Stmt *Grainsize =
nullptr;
7342 void setGrainsize(Expr *Size) { Grainsize = Size; }
7345 void setModifier(OpenMPGrainsizeClauseModifier M) { Modifier = M; }
7363 Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion,
7364 SourceLocation StartLoc, SourceLocation LParenLoc,
7365 SourceLocation ModifierLoc, SourceLocation EndLoc)
7368 ModifierLoc(ModifierLoc), Grainsize(Size) {
7369 setPreInitStmt(HelperSize, CaptureRegion);
7388 OpenMPGrainsizeClauseModifier
getModifier()
const {
return Modifier; }
7393 child_range
children() {
return child_range(&Grainsize, &Grainsize + 1); }
7396 return const_child_range(&Grainsize, &Grainsize + 1);
7399 child_range used_children();
7405 return T->getClauseKind() == llvm::omp::OMPC_grainsize;
7426 :
OMPClause(
llvm::omp::OMPC_nogroup, SourceLocation(), SourceLocation()) {
7430 return child_range(child_iterator(), child_iterator());
7434 return const_child_range(const_child_iterator(), const_child_iterator());
7438 return child_range(child_iterator(), child_iterator());
7441 return const_child_range(const_child_iterator(), const_child_iterator());
7445 return T->getClauseKind() == llvm::omp::OMPC_nogroup;
7461 SourceLocation LParenLoc;
7464 OpenMPNumTasksClauseModifier Modifier = OMPC_NUMTASKS_unknown;
7467 SourceLocation ModifierLoc;
7470 Stmt *NumTasks =
nullptr;
7473 void setNumTasks(Expr *Size) { NumTasks = Size; }
7476 void setModifier(OpenMPNumTasksClauseModifier M) { Modifier = M; }
7494 Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion,
7495 SourceLocation StartLoc, SourceLocation LParenLoc,
7496 SourceLocation ModifierLoc, SourceLocation EndLoc)
7499 ModifierLoc(ModifierLoc), NumTasks(Size) {
7500 setPreInitStmt(HelperSize, CaptureRegion);
7524 child_range
children() {
return child_range(&NumTasks, &NumTasks + 1); }
7527 return const_child_range(&NumTasks, &NumTasks + 1);
7530 child_range used_children();
7536 return T->getClauseKind() == llvm::omp::OMPC_num_tasks;
7551 SourceLocation LParenLoc;
7554 Stmt *Hint =
nullptr;
7557 void setHint(Expr *H) { Hint = H; }
7567 SourceLocation EndLoc)
7568 :
OMPClause(
llvm::omp::OMPC_hint, StartLoc, EndLoc), LParenLoc(LParenLoc),
7573 :
OMPClause(
llvm::omp::OMPC_hint, SourceLocation(), SourceLocation()) {}
7582 Expr *
getHint()
const {
return cast_or_null<Expr>(Hint); }
7584 child_range
children() {
return child_range(&Hint, &Hint + 1); }
7587 return const_child_range(&Hint, &Hint + 1);
7591 return child_range(child_iterator(), child_iterator());
7594 return const_child_range(const_child_iterator(), const_child_iterator());
7598 return T->getClauseKind() == llvm::omp::OMPC_hint;
7614 SourceLocation LParenLoc;
7617 OpenMPDistScheduleClauseKind Kind = OMPC_DIST_SCHEDULE_unknown;
7620 SourceLocation KindLoc;
7623 SourceLocation CommaLoc;
7626 Expr *ChunkSize =
nullptr;
7631 void setDistScheduleKind(OpenMPDistScheduleClauseKind K) { Kind = K; }
7636 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
7641 void setDistScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
7646 void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
7651 void setChunkSize(Expr *E) { ChunkSize = E; }
7666 SourceLocation KLoc, SourceLocation CommaLoc,
7667 SourceLocation EndLoc,
7668 OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize,
7669 Stmt *HelperChunkSize)
7670 :
OMPClause(
llvm::omp::OMPC_dist_schedule, StartLoc, EndLoc),
7672 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
7673 setPreInitStmt(HelperChunkSize);
7678 :
OMPClause(
llvm::omp::OMPC_dist_schedule, SourceLocation(),
7701 return child_range(
reinterpret_cast<Stmt **
>(&ChunkSize),
7702 reinterpret_cast<Stmt **
>(&ChunkSize) + 1);
7710 return child_range(child_iterator(), child_iterator());
7713 return const_child_range(const_child_iterator(), const_child_iterator());
7717 return T->getClauseKind() == llvm::omp::OMPC_dist_schedule;
7732 SourceLocation LParenLoc;
7735 OpenMPDefaultmapClauseModifier Modifier = OMPC_DEFAULTMAP_MODIFIER_unknown;
7738 SourceLocation ModifierLoc;
7741 OpenMPDefaultmapClauseKind Kind = OMPC_DEFAULTMAP_unknown;
7744 SourceLocation KindLoc;
7749 void setDefaultmapKind(OpenMPDefaultmapClauseKind K) { Kind = K; }
7754 void setDefaultmapModifier(OpenMPDefaultmapClauseModifier M) {
7759 void setDefaultmapModifierLoc(SourceLocation Loc) {
7766 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
7771 void setDefaultmapKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
7784 SourceLocation MLoc, SourceLocation KLoc,
7785 SourceLocation EndLoc, OpenMPDefaultmapClauseKind Kind,
7786 OpenMPDefaultmapClauseModifier M)
7788 LParenLoc(LParenLoc), Modifier(M), ModifierLoc(MLoc), Kind(Kind),
7794 SourceLocation()) {}
7816 return child_range(child_iterator(), child_iterator());
7820 return const_child_range(const_child_iterator(), const_child_iterator());
7824 return child_range(child_iterator(), child_iterator());
7827 return const_child_range(const_child_iterator(), const_child_iterator());
7831 return T->getClauseKind() == llvm::omp::OMPC_defaultmap;
7843class OMPToClause final :
public OMPMappableExprListClause<OMPToClause>,
7844 private llvm::TrailingObjects<
7845 OMPToClause, Expr *, ValueDecl *, unsigned,
7846 OMPClauseMappableExprCommon::MappableComponent> {
7848 friend OMPMappableExprListClause;
7849 friend OMPVarListClause;
7850 friend TrailingObjects;
7853 OpenMPMotionModifierKind MotionModifiers[NumberOfOMPMotionModifiers] = {
7854 OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
7855 OMPC_MOTION_MODIFIER_unknown};
7858 SourceLocation MotionModifiersLoc[NumberOfOMPMotionModifiers];
7861 SourceLocation ColonLoc;
7880 NestedNameSpecifierLoc MapperQualifierLoc,
7881 DeclarationNameInfo MapperIdInfo,
7882 const OMPVarListLocTy &Locs,
7885 true, &MapperQualifierLoc,
7887 assert(std::size(MotionModifiers) == TheMotionModifiers.size() &&
7888 "Unexpected number of motion modifiers.");
7889 llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
7891 assert(std::size(MotionModifiersLoc) == TheMotionModifiersLoc.size() &&
7892 "Unexpected number of motion modifier locations.");
7893 llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
7903 explicit OMPToClause(
const OMPMappableExprListSizeTy &Sizes)
7904 : OMPMappableExprListClause(llvm::omp::OMPC_to, OMPVarListLocTy(), Sizes,
7911 void setMotionModifier(
unsigned I, OpenMPMotionModifierKind T) {
7912 assert(I < NumberOfOMPMotionModifiers &&
7913 "Unexpected index to store motion modifier, exceeds array size.");
7914 MotionModifiers[I] =
T;
7921 void setMotionModifierLoc(
unsigned I, SourceLocation TLoc) {
7922 assert(I < NumberOfOMPMotionModifiers &&
7923 "Index to store motion modifier location exceeds array size.");
7924 MotionModifiersLoc[I] = TLoc;
7927 void setIteratorModifier(Expr *IteratorModifier) {
7928 getTrailingObjects<Expr *>()[2 * varlist_size()] = IteratorModifier;
7931 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
7935 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
7938 return 2 * varlist_size() + 1;
7940 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
7941 return getUniqueDeclarationsNum();
7943 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
7944 return getUniqueDeclarationsNum() + getTotalComponentListNum();
7964 static OMPToClause *
7965 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
7966 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
7967 MappableExprComponentListsRef ComponentLists,
7968 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorModifier,
7969 ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
7970 ArrayRef<SourceLocation> MotionModifiersLoc,
7971 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
7981 static OMPToClause *
CreateEmpty(
const ASTContext &C,
7982 const OMPMappableExprListSizeTy &Sizes);
7988 assert(Cnt < NumberOfOMPMotionModifiers &&
7989 "Requested modifier exceeds the total number of modifiers.");
7990 return MotionModifiers[Cnt];
7993 return getTrailingObjects<Expr *>()[2 * varlist_size()];
8000 assert(Cnt < NumberOfOMPMotionModifiers &&
8001 "Requested modifier location exceeds total number of modifiers.");
8002 return MotionModifiersLoc[Cnt];
8007 return MotionModifiers;
8012 return MotionModifiersLoc;
8019 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8020 reinterpret_cast<Stmt **
>(varlist_end()));
8024 return const_cast<OMPToClause *
>(
this)->
children();
8028 return child_range(child_iterator(), child_iterator());
8031 return const_child_range(const_child_iterator(), const_child_iterator());
8035 return T->getClauseKind() == llvm::omp::OMPC_to;
8047class OMPFromClause final
8048 :
public OMPMappableExprListClause<OMPFromClause>,
8049 private llvm::TrailingObjects<
8050 OMPFromClause, Expr *, ValueDecl *, unsigned,
8051 OMPClauseMappableExprCommon::MappableComponent> {
8053 friend OMPMappableExprListClause;
8054 friend OMPVarListClause;
8055 friend TrailingObjects;
8058 OpenMPMotionModifierKind MotionModifiers[NumberOfOMPMotionModifiers] = {
8059 OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
8060 OMPC_MOTION_MODIFIER_unknown};
8063 SourceLocation MotionModifiersLoc[NumberOfOMPMotionModifiers];
8066 SourceLocation ColonLoc;
8085 NestedNameSpecifierLoc MapperQualifierLoc,
8086 DeclarationNameInfo MapperIdInfo,
8087 const OMPVarListLocTy &Locs,
8090 true, &MapperQualifierLoc,
8092 assert(std::size(MotionModifiers) == TheMotionModifiers.size() &&
8093 "Unexpected number of motion modifiers.");
8094 llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
8096 assert(std::size(MotionModifiersLoc) == TheMotionModifiersLoc.size() &&
8097 "Unexpected number of motion modifier locations.");
8098 llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
8108 explicit OMPFromClause(
const OMPMappableExprListSizeTy &Sizes)
8109 : OMPMappableExprListClause(llvm::omp::OMPC_from, OMPVarListLocTy(),
8116 void setMotionModifier(
unsigned I, OpenMPMotionModifierKind T) {
8117 assert(I < NumberOfOMPMotionModifiers &&
8118 "Unexpected index to store motion modifier, exceeds array size.");
8119 MotionModifiers[I] =
T;
8121 void setIteratorModifier(Expr *IteratorModifier) {
8122 getTrailingObjects<Expr *>()[2 * varlist_size()] = IteratorModifier;
8128 void setMotionModifierLoc(
unsigned I, SourceLocation TLoc) {
8129 assert(I < NumberOfOMPMotionModifiers &&
8130 "Index to store motion modifier location exceeds array size.");
8131 MotionModifiersLoc[I] = TLoc;
8135 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
8139 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8142 return 2 * varlist_size() + 1;
8144 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8145 return getUniqueDeclarationsNum();
8147 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8148 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8168 static OMPFromClause *
8169 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8170 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8171 MappableExprComponentListsRef ComponentLists,
8172 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorExpr,
8173 ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
8174 ArrayRef<SourceLocation> MotionModifiersLoc,
8175 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
8185 static OMPFromClause *
CreateEmpty(
const ASTContext &C,
8186 const OMPMappableExprListSizeTy &Sizes);
8192 assert(Cnt < NumberOfOMPMotionModifiers &&
8193 "Requested modifier exceeds the total number of modifiers.");
8194 return MotionModifiers[Cnt];
8197 return getTrailingObjects<Expr *>()[2 * varlist_size()];
8204 assert(Cnt < NumberOfOMPMotionModifiers &&
8205 "Requested modifier location exceeds total number of modifiers.");
8206 return MotionModifiersLoc[Cnt];
8211 return MotionModifiers;
8216 return MotionModifiersLoc;
8223 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8224 reinterpret_cast<Stmt **
>(varlist_end()));
8228 return const_cast<OMPFromClause *
>(
this)->
children();
8232 return child_range(child_iterator(), child_iterator());
8235 return const_child_range(const_child_iterator(), const_child_iterator());
8239 return T->getClauseKind() == llvm::omp::OMPC_from;
8251class OMPUseDevicePtrClause final
8252 :
public OMPMappableExprListClause<OMPUseDevicePtrClause>,
8253 private llvm::TrailingObjects<
8254 OMPUseDevicePtrClause, Expr *, ValueDecl *, unsigned,
8255 OMPClauseMappableExprCommon::MappableComponent> {
8257 friend OMPMappableExprListClause;
8258 friend OMPVarListClause;
8259 friend TrailingObjects;
8262 OpenMPUseDevicePtrFallbackModifier FallbackModifier =
8263 OMPC_USE_DEVICE_PTR_FALLBACK_unknown;
8266 SourceLocation FallbackModifierLoc;
8280 explicit OMPUseDevicePtrClause(
8282 OpenMPUseDevicePtrFallbackModifier FallbackModifier,
8283 SourceLocation FallbackModifierLoc)
8284 : OMPMappableExprListClause(
llvm::omp::OMPC_use_device_ptr, Locs, Sizes),
8285 FallbackModifier(FallbackModifier),
8286 FallbackModifierLoc(FallbackModifierLoc) {}
8297 OMPVarListLocTy(), Sizes) {}
8301 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8302 return 3 * varlist_size();
8304 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8305 return getUniqueDeclarationsNum();
8307 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8308 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8314 void setPrivateCopies(ArrayRef<Expr *> VL);
8318 MutableArrayRef<Expr *> getPrivateCopies() {
8319 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
8321 ArrayRef<const Expr *> getPrivateCopies()
const {
8322 return {varlist_end(), varlist_size()};
8328 void setInits(ArrayRef<Expr *> VL);
8332 MutableArrayRef<Expr *>
getInits() {
8333 return {getPrivateCopies().end(), varlist_size()};
8335 ArrayRef<const Expr *>
getInits()
const {
8336 return {getPrivateCopies().end(), varlist_size()};
8340 void setFallbackModifier(OpenMPUseDevicePtrFallbackModifier M) {
8341 FallbackModifier = M;
8345 void setFallbackModifierLoc(SourceLocation Loc) { FallbackModifierLoc = Loc; }
8361 static OMPUseDevicePtrClause *
8362 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8363 ArrayRef<Expr *> Vars, ArrayRef<Expr *> PrivateVars,
8364 ArrayRef<Expr *> Inits, ArrayRef<ValueDecl *> Declarations,
8365 MappableExprComponentListsRef ComponentLists,
8366 OpenMPUseDevicePtrFallbackModifier FallbackModifier,
8367 SourceLocation FallbackModifierLoc);
8377 static OMPUseDevicePtrClause *
8378 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8382 return FallbackModifier;
8392 llvm::iterator_range<private_copies_const_iterator>;
8397 return getPrivateCopies();
8410 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8411 reinterpret_cast<Stmt **
>(varlist_end()));
8415 return const_cast<OMPUseDevicePtrClause *
>(
this)->
children();
8419 return child_range(child_iterator(), child_iterator());
8422 return const_child_range(const_child_iterator(), const_child_iterator());
8426 return T->getClauseKind() == llvm::omp::OMPC_use_device_ptr;
8438class OMPUseDeviceAddrClause final
8439 :
public OMPMappableExprListClause<OMPUseDeviceAddrClause>,
8440 private llvm::TrailingObjects<
8441 OMPUseDeviceAddrClause, Expr *, ValueDecl *, unsigned,
8442 OMPClauseMappableExprCommon::MappableComponent> {
8444 friend OMPMappableExprListClause;
8445 friend OMPVarListClause;
8446 friend TrailingObjects;
8458 explicit OMPUseDeviceAddrClause(
const OMPVarListLocTy &Locs,
8460 : OMPMappableExprListClause(
llvm::omp::OMPC_use_device_addr, Locs,
8472 OMPVarListLocTy(), Sizes) {}
8476 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8477 return varlist_size();
8479 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8480 return getUniqueDeclarationsNum();
8482 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8483 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8496 static OMPUseDeviceAddrClause *
8497 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8498 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8499 MappableExprComponentListsRef ComponentLists);
8509 static OMPUseDeviceAddrClause *
8510 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8513 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8514 reinterpret_cast<Stmt **
>(varlist_end()));
8518 return const_cast<OMPUseDeviceAddrClause *
>(
this)->
children();
8522 return child_range(child_iterator(), child_iterator());
8525 return const_child_range(const_child_iterator(), const_child_iterator());
8529 return T->getClauseKind() == llvm::omp::OMPC_use_device_addr;
8541class OMPIsDevicePtrClause final
8542 :
public OMPMappableExprListClause<OMPIsDevicePtrClause>,
8543 private llvm::TrailingObjects<
8544 OMPIsDevicePtrClause, Expr *, ValueDecl *, unsigned,
8545 OMPClauseMappableExprCommon::MappableComponent> {
8547 friend OMPMappableExprListClause;
8548 friend OMPVarListClause;
8549 friend TrailingObjects;
8561 explicit OMPIsDevicePtrClause(
const OMPVarListLocTy &Locs,
8563 : OMPMappableExprListClause(
llvm::omp::OMPC_is_device_ptr, Locs, Sizes) {}
8574 OMPVarListLocTy(), Sizes) {}
8578 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8579 return varlist_size();
8581 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8582 return getUniqueDeclarationsNum();
8584 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8585 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8598 static OMPIsDevicePtrClause *
8599 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8600 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8601 MappableExprComponentListsRef ComponentLists);
8611 static OMPIsDevicePtrClause *
8612 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8615 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8616 reinterpret_cast<Stmt **
>(varlist_end()));
8620 return const_cast<OMPIsDevicePtrClause *
>(
this)->
children();
8624 return child_range(child_iterator(), child_iterator());
8627 return const_child_range(const_child_iterator(), const_child_iterator());
8631 return T->getClauseKind() == llvm::omp::OMPC_is_device_ptr;
8643class OMPHasDeviceAddrClause final
8644 :
public OMPMappableExprListClause<OMPHasDeviceAddrClause>,
8645 private llvm::TrailingObjects<
8646 OMPHasDeviceAddrClause, Expr *, ValueDecl *, unsigned,
8647 OMPClauseMappableExprCommon::MappableComponent> {
8649 friend OMPMappableExprListClause;
8650 friend OMPVarListClause;
8651 friend TrailingObjects;
8663 explicit OMPHasDeviceAddrClause(
const OMPVarListLocTy &Locs,
8665 : OMPMappableExprListClause(
llvm::omp::OMPC_has_device_addr, Locs,
8677 OMPVarListLocTy(), Sizes) {}
8681 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8682 return varlist_size();
8684 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8685 return getUniqueDeclarationsNum();
8687 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8688 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8701 static OMPHasDeviceAddrClause *
8702 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8703 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8704 MappableExprComponentListsRef ComponentLists);
8714 static OMPHasDeviceAddrClause *
8715 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8718 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8719 reinterpret_cast<Stmt **
>(varlist_end()));
8723 return const_cast<OMPHasDeviceAddrClause *
>(
this)->
children();
8727 return child_range(child_iterator(), child_iterator());
8730 return const_child_range(const_child_iterator(), const_child_iterator());
8734 return T->getClauseKind() == llvm::omp::OMPC_has_device_addr;
8745class OMPNontemporalClause final
8746 :
public OMPVarListClause<OMPNontemporalClause>,
8747 private llvm::TrailingObjects<OMPNontemporalClause, Expr *> {
8749 friend OMPVarListClause;
8750 friend TrailingObjects;
8758 OMPNontemporalClause(SourceLocation StartLoc, SourceLocation LParenLoc,
8759 SourceLocation EndLoc,
unsigned N)
8760 : OMPVarListClause<OMPNontemporalClause>(
llvm::omp::OMPC_nontemporal,
8761 StartLoc, LParenLoc, EndLoc, N) {
8769 llvm::omp::OMPC_nontemporal, SourceLocation(), SourceLocation(),
8770 SourceLocation(), N) {}
8774 MutableArrayRef<Expr *> getPrivateRefs() {
8775 return {varlist_end(), varlist_size()};
8777 ArrayRef<const Expr *> getPrivateRefs()
const {
8778 return {varlist_end(), varlist_size()};
8789 static OMPNontemporalClause *
8790 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
8791 SourceLocation EndLoc, ArrayRef<Expr *> VL);
8797 static OMPNontemporalClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
8801 void setPrivateRefs(ArrayRef<Expr *> VL);
8804 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8805 reinterpret_cast<Stmt **
>(varlist_end()));
8809 return const_cast<OMPNontemporalClause *
>(
this)->
children();
8813 return child_range(
reinterpret_cast<Stmt **
>(getPrivateRefs().begin()),
8814 reinterpret_cast<Stmt **
>(getPrivateRefs().end()));
8818 return const_cast<OMPNontemporalClause *
>(
this)->
private_refs();
8822 return child_range(child_iterator(), child_iterator());
8825 return const_child_range(const_child_iterator(), const_child_iterator());
8829 return T->getClauseKind() == llvm::omp::OMPC_nontemporal;
8844 SourceLocation LParenLoc;
8847 OpenMPOrderClauseKind Kind = OMPC_ORDER_unknown;
8850 SourceLocation KindKwLoc;
8853 OpenMPOrderClauseModifier Modifier = OMPC_ORDER_MODIFIER_unknown;
8856 SourceLocation ModifierKwLoc;
8861 void setKind(OpenMPOrderClauseKind K) { Kind = K; }
8866 void setKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
8871 void setModifier(OpenMPOrderClauseModifier M) { Modifier = M; }
8876 void setModifierKwLoc(SourceLocation MLoc) { ModifierKwLoc = MLoc; }
8889 SourceLocation StartLoc, SourceLocation LParenLoc,
8890 SourceLocation EndLoc, OpenMPOrderClauseModifier Modifier,
8891 SourceLocation MLoc)
8893 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc), Modifier(Modifier),
8894 ModifierKwLoc(MLoc) {}
8898 :
OMPClause(
llvm::omp::OMPC_order, SourceLocation(), SourceLocation()) {}
8907 OpenMPOrderClauseKind
getKind()
const {
return Kind; }
8919 return child_range(child_iterator(), child_iterator());
8923 return const_child_range(const_child_iterator(), const_child_iterator());
8927 return child_range(child_iterator(), child_iterator());
8930 return const_child_range(const_child_iterator(), const_child_iterator());
8934 return T->getClauseKind() == llvm::omp::OMPC_order;
8943class OMPInitClause final
8944 :
public OMPVarListClause<OMPInitClause>,
8945 private llvm::TrailingObjects<OMPInitClause, Expr *, unsigned> {
8947 friend OMPVarListClause;
8948 friend TrailingObjects;
8951 SourceLocation VarLoc;
8953 bool IsTarget =
false;
8954 bool IsTargetSync =
false;
8955 bool HasPreferAttrs =
false;
8959 unsigned NumAttrs = 0;
8976 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8977 return varlist_size() + NumAttrs;
8979 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8980 return getNumPrefs();
8983 void setInteropVar(Expr *E) { varlist_begin()[0] = E; }
8985 void setIsTarget(
bool V) { IsTarget =
V; }
8987 void setIsTargetSync(
bool V) { IsTargetSync =
V; }
8989 void setHasPreferAttrs(
bool V) { HasPreferAttrs =
V; }
8991 void setAttrs(ArrayRef<unsigned> Counts, ArrayRef<Expr *> Attrs);
8994 unsigned getNumPrefs()
const {
return varlist_size() - 1; }
8998 ArrayRef<unsigned> getAttrEnds()
const {
8999 return getTrailingObjects<unsigned>(getNumPrefs());
9003 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
9014 OMPInitClause(
bool IsTarget,
bool IsTargetSync, SourceLocation StartLoc,
9015 SourceLocation LParenLoc, SourceLocation VarLoc,
9016 SourceLocation EndLoc,
unsigned N)
9017 : OMPVarListClause<OMPInitClause>(llvm::omp::OMPC_init, StartLoc,
9018 LParenLoc, EndLoc, N),
9019 VarLoc(VarLoc), IsTarget(IsTarget), IsTargetSync(IsTargetSync) {}
9022 OMPInitClause(
unsigned N)
9023 : OMPVarListClause<OMPInitClause>(llvm::omp::OMPC_init, SourceLocation(),
9024 SourceLocation(), SourceLocation(), N) {
9046 OMPInteropInfo &InteropInfo,
9047 SourceLocation StartLoc,
9048 SourceLocation LParenLoc, SourceLocation VarLoc,
9049 SourceLocation EndLoc);
9084 reinterpret_cast<Stmt **
>(varlist_begin()),
9085 reinterpret_cast<Stmt **
>(varlist_begin() + varlist_size() + NumAttrs));
9089 return const_cast<OMPInitClause *
>(
this)->
children();
9093 return child_range(child_iterator(), child_iterator());
9096 return const_child_range(const_child_iterator(), const_child_iterator());
9102 unsigned N = getNumPrefs();
9103 Expr *
const *E = getTrailingObjects<Expr *>();
9105 return llvm::map_range(llvm::seq<unsigned>(0, N), [=](
unsigned I) {
9106 unsigned Start = (I == 0) ? 0 : Ends[I - 1];
9108 const_cast<Expr *
>(E[1 + I]),
9115 return T->getClauseKind() == llvm::omp::OMPC_init;
9128 SourceLocation LParenLoc;
9131 SourceLocation VarLoc;
9134 Stmt *InteropVar =
nullptr;
9137 void setInteropVar(Expr *E) { InteropVar = E; }
9140 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9143 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
9154 SourceLocation LParenLoc, SourceLocation VarLoc,
9155 SourceLocation EndLoc)
9156 :
OMPClause(
llvm::omp::OMPC_use, StartLoc, EndLoc), LParenLoc(LParenLoc),
9157 VarLoc(VarLoc), InteropVar(InteropVar) {}
9161 :
OMPClause(
llvm::omp::OMPC_use, SourceLocation(), SourceLocation()) {}
9172 child_range
children() {
return child_range(&InteropVar, &InteropVar + 1); }
9175 return const_child_range(&InteropVar, &InteropVar + 1);
9179 return child_range(child_iterator(), child_iterator());
9182 return const_child_range(const_child_iterator(), const_child_iterator());
9186 return T->getClauseKind() == llvm::omp::OMPC_use;
9203 SourceLocation LParenLoc;
9206 SourceLocation VarLoc;
9209 Stmt *InteropVar =
nullptr;
9212 void setInteropVar(Expr *E) { InteropVar = E; }
9215 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9218 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
9229 SourceLocation LParenLoc, SourceLocation VarLoc,
9230 SourceLocation EndLoc)
9232 LParenLoc(LParenLoc), VarLoc(VarLoc), InteropVar(InteropVar) {}
9243 :
OMPClause(
llvm::omp::OMPC_destroy, SourceLocation(), SourceLocation()) {
9257 return child_range(&InteropVar, &InteropVar + 1);
9258 return child_range(child_iterator(), child_iterator());
9263 return const_child_range(&InteropVar, &InteropVar + 1);
9264 return const_child_range(const_child_iterator(), const_child_iterator());
9268 return child_range(child_iterator(), child_iterator());
9271 return const_child_range(const_child_iterator(), const_child_iterator());
9275 return T->getClauseKind() == llvm::omp::OMPC_destroy;
9292 void setCondition(Expr *Cond) { setStmt(Cond); }
9305 OpenMPDirectiveKind CaptureRegion,
9306 SourceLocation StartLoc, SourceLocation LParenLoc,
9307 SourceLocation EndLoc)
9310 setPreInitStmt(HelperCond, CaptureRegion);
9319 child_range used_children();
9338 void setCondition(Expr *Cond) { setStmt(Cond); }
9351 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
9352 SourceLocation LParenLoc, SourceLocation EndLoc)
9355 setPreInitStmt(HelperCond, CaptureRegion);
9364 child_range used_children();
9382 void setEventHandler(Expr *E) { setStmt(E); }
9392 SourceLocation EndLoc)
9409class OMPInclusiveClause final
9410 :
public OMPVarListClause<OMPInclusiveClause>,
9411 private llvm::TrailingObjects<OMPInclusiveClause, Expr *> {
9413 friend OMPVarListClause;
9414 friend TrailingObjects;
9422 OMPInclusiveClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9423 SourceLocation EndLoc,
unsigned N)
9424 : OMPVarListClause<OMPInclusiveClause>(
llvm::omp::OMPC_inclusive,
9425 StartLoc, LParenLoc, EndLoc, N) {}
9432 SourceLocation(), SourceLocation(),
9433 SourceLocation(), N) {}
9443 static OMPInclusiveClause *
Create(
const ASTContext &C,
9444 SourceLocation StartLoc,
9445 SourceLocation LParenLoc,
9446 SourceLocation EndLoc, ArrayRef<Expr *> VL);
9452 static OMPInclusiveClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9455 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
9456 reinterpret_cast<Stmt **
>(varlist_end()));
9460 return const_cast<OMPInclusiveClause *
>(
this)->
children();
9464 return child_range(child_iterator(), child_iterator());
9467 return const_child_range(const_child_iterator(), const_child_iterator());
9471 return T->getClauseKind() == llvm::omp::OMPC_inclusive;
9482class OMPExclusiveClause final
9483 :
public OMPVarListClause<OMPExclusiveClause>,
9484 private llvm::TrailingObjects<OMPExclusiveClause, Expr *> {
9486 friend OMPVarListClause;
9487 friend TrailingObjects;
9495 OMPExclusiveClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9496 SourceLocation EndLoc,
unsigned N)
9497 : OMPVarListClause<OMPExclusiveClause>(
llvm::omp::OMPC_exclusive,
9498 StartLoc, LParenLoc, EndLoc, N) {}
9505 SourceLocation(), SourceLocation(),
9506 SourceLocation(), N) {}
9516 static OMPExclusiveClause *
Create(
const ASTContext &C,
9517 SourceLocation StartLoc,
9518 SourceLocation LParenLoc,
9519 SourceLocation EndLoc, ArrayRef<Expr *> VL);
9525 static OMPExclusiveClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9528 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
9529 reinterpret_cast<Stmt **
>(varlist_end()));
9533 return const_cast<OMPExclusiveClause *
>(
this)->
children();
9537 return child_range(child_iterator(), child_iterator());
9540 return const_child_range(const_child_iterator(), const_child_iterator());
9544 return T->getClauseKind() == llvm::omp::OMPC_exclusive;
9556class OMPUsesAllocatorsClause final
9558 private llvm::TrailingObjects<OMPUsesAllocatorsClause, Expr *,
9573 friend TrailingObjects;
9575 enum class ExprOffsets {
9581 enum class ParenLocsOffsets {
9588 SourceLocation LParenLoc;
9590 unsigned NumOfAllocators = 0;
9598 OMPUsesAllocatorsClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9599 SourceLocation EndLoc,
unsigned N)
9600 : OMPClause(llvm::omp::OMPC_uses_allocators, StartLoc, EndLoc),
9601 LParenLoc(LParenLoc), NumOfAllocators(N) {}
9606 explicit OMPUsesAllocatorsClause(
unsigned N)
9607 : OMPClause(llvm::omp::OMPC_uses_allocators, SourceLocation(),
9609 NumOfAllocators(N) {}
9611 unsigned numTrailingObjects(OverloadToken<Expr *>)
const {
9612 return NumOfAllocators *
static_cast<int>(ExprOffsets::Total);
9616 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9619 void setAllocatorsData(ArrayRef<OMPUsesAllocatorsClause::Data> Data);
9629 static OMPUsesAllocatorsClause *
9630 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
9631 SourceLocation EndLoc, ArrayRef<OMPUsesAllocatorsClause::Data> Data);
9637 static OMPUsesAllocatorsClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9650 Stmt **Begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
9651 return child_range(Begin, Begin + NumOfAllocators *
9652 static_cast<int>(ExprOffsets::Total));
9655 Stmt *
const *Begin =
9656 reinterpret_cast<Stmt *
const *
>(getTrailingObjects<Expr *>());
9657 return const_child_range(
9658 Begin, Begin + NumOfAllocators *
static_cast<int>(ExprOffsets::Total));
9662 return child_range(child_iterator(), child_iterator());
9665 return const_child_range(const_child_iterator(), const_child_iterator());
9669 return T->getClauseKind() == llvm::omp::OMPC_uses_allocators;
9682class OMPAffinityClause final
9683 :
public OMPVarListClause<OMPAffinityClause>,
9684 private llvm::TrailingObjects<OMPAffinityClause, Expr *> {
9686 friend OMPVarListClause;
9687 friend TrailingObjects;
9690 SourceLocation ColonLoc;
9699 OMPAffinityClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9700 SourceLocation ColonLoc, SourceLocation EndLoc,
unsigned N)
9701 : OMPVarListClause<OMPAffinityClause>(
llvm::omp::OMPC_affinity, StartLoc,
9702 LParenLoc, EndLoc, N) {}
9709 SourceLocation(), SourceLocation(),
9710 SourceLocation(), N) {}
9713 void setModifier(Expr *E) { getTrailingObjects()[varlist_size()] = E; }
9716 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
9727 static OMPAffinityClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
9728 SourceLocation LParenLoc,
9729 SourceLocation ColonLoc,
9730 SourceLocation EndLoc, Expr *Modifier,
9731 ArrayRef<Expr *> Locators);
9737 static OMPAffinityClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9741 Expr *
getModifier()
const {
return getTrailingObjects()[varlist_size()]; }
9749 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
9750 reinterpret_cast<Stmt **
>(varlist_end() + Offset));
9754 return const_cast<OMPAffinityClause *
>(
this)->
children();
9758 return child_range(child_iterator(), child_iterator());
9761 return const_child_range(const_child_iterator(), const_child_iterator());
9765 return T->getClauseKind() == llvm::omp::OMPC_affinity;
9782 void setThreadID(Expr *TID) { setStmt(TID); }
9795 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
9796 SourceLocation LParenLoc, SourceLocation EndLoc)
9799 setPreInitStmt(HelperE, CaptureRegion);
9821 SourceLocation LParenLoc;
9824 OpenMPBindClauseKind Kind = OMPC_BIND_unknown;
9827 SourceLocation KindLoc;
9830 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9833 void setBindKind(OpenMPBindClauseKind K) { Kind = K; }
9836 void setBindKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
9845 OMPBindClause(OpenMPBindClauseKind K, SourceLocation KLoc,
9846 SourceLocation StartLoc, SourceLocation LParenLoc,
9847 SourceLocation EndLoc)
9848 : OMPNoChildClause(StartLoc, EndLoc), LParenLoc(LParenLoc),
Kind(K),
9852 OMPBindClause() : OMPNoChildClause() {}
9863 static OMPBindClause *
Create(
const ASTContext &C, OpenMPBindClauseKind K,
9864 SourceLocation KLoc, SourceLocation StartLoc,
9865 SourceLocation LParenLoc, SourceLocation EndLoc);
9870 static OMPBindClause *
CreateEmpty(
const ASTContext &C);
9884template<
class ImplClass,
template <
typename>
class Ptr,
typename RetTy>
9887#define PTR(CLASS) Ptr<CLASS>
9888#define DISPATCH(CLASS) \
9889 return static_cast<ImplClass*>(this)->Visit##CLASS(static_cast<PTR(CLASS)>(S))
9891#define GEN_CLANG_CLAUSE_CLASS
9892#define CLAUSE_CLASS(Enum, Str, Class) \
9893 RetTy Visit##Class(PTR(Class) S) { \
9894 return static_cast<ImplClass *>(this)->VisitOMPClause(S); \
9896#include "llvm/Frontend/OpenMP/OMP.inc"
9900 switch (S->getClauseKind()) {
9901#define GEN_CLANG_CLAUSE_CLASS
9902#define CLAUSE_CLASS(Enum, Str, Class) \
9903 case llvm::omp::Clause::Enum: \
9905#define CLAUSE_NO_CLASS(Enum, Str) \
9906 case llvm::omp::Clause::Enum: \
9908#include "llvm/Frontend/OpenMP/OMP.inc"
9917template <
typename T>
using const_ptr = std::add_pointer_t<std::add_const_t<T>>;
9919template <
class ImplClass,
typename RetTy =
void>
9922template<
class ImplClass,
typename RetTy =
void>
9928 const PrintingPolicy &Policy;
9932 template <
typename T>
void VisitOMPClauseList(T *Node,
char StartSym);
9934 template <
typename T>
void VisitOMPMotionClause(T *Node);
9938 unsigned OpenMPVersion)
9939 : OS(OS), Policy(Policy), Version(OpenMPVersion) {}
9941#define GEN_CLANG_CLAUSE_CLASS
9942#define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(Class *S);
9943#include "llvm/Frontend/OpenMP/OMP.inc"
9947 llvm::omp::TraitProperty
Kind = llvm::omp::TraitProperty::invalid;
9956 llvm::omp::TraitSelector
Kind = llvm::omp::TraitSelector::invalid;
9961 llvm::omp::TraitSet
Kind = llvm::omp::TraitSet::invalid;
9977 OMPTraitInfo(StringRef MangledName);
9983 llvm::function_ref<
bool(Expr *&,
bool )> Cond) {
9985 return llvm::any_of(
9987 return Cond(Selector.ScoreOrCondition,
9989 llvm::omp::TraitSelector::user_condition);
9999 void getAsVariantMatchInfo(
ASTContext &ASTCtx,
10000 llvm::omp::VariantMatchInfo &VMI)
const;
10003 std::string getMangledName()
const;
10008 if (Set.Kind != llvm::omp::TraitSet::implementation)
10011 if (Selector.
Kind != llvm::omp::TraitSelector::implementation_extension)
10014 if (Property.Kind == TP)
10023 void print(llvm::raw_ostream &OS,
const PrintingPolicy &Policy)
const;
10032 const FunctionDecl *CurrentFunctionDecl,
10044 llvm::StringMap<bool> FeatureMap;
10050class OMPChildren final
10051 :
private llvm::TrailingObjects<OMPChildren, OMPClause *, Stmt *> {
10052 friend TrailingObjects;
10058 unsigned NumClauses = 0;
10060 unsigned NumChildren = 0;
10062 bool HasAssociatedStmt =
false;
10066 size_t numTrailingObjects(OverloadToken<OMPClause *>)
const {
10072 OMPChildren(
unsigned NumClauses,
unsigned NumChildren,
bool HasAssociatedStmt)
10073 : NumClauses(NumClauses), NumChildren(NumChildren),
10074 HasAssociatedStmt(HasAssociatedStmt) {}
10076 static size_t size(
unsigned NumClauses,
bool HasAssociatedStmt,
10077 unsigned NumChildren);
10079 static OMPChildren *
Create(
void *Mem, ArrayRef<OMPClause *> Clauses);
10080 static OMPChildren *
Create(
void *Mem, ArrayRef<OMPClause *> Clauses, Stmt *S,
10081 unsigned NumChildren = 0);
10082 static OMPChildren *
CreateEmpty(
void *Mem,
unsigned NumClauses,
10083 bool HasAssociatedStmt =
false,
10084 unsigned NumChildren = 0);
10093 getTrailingObjects<Stmt *>()[NumChildren] = S;
10109 assert(HasAssociatedStmt &&
10110 "Expected directive with the associated statement.");
10111 return getTrailingObjects<Stmt *>()[NumChildren];
10116 return getTrailingObjects<OMPClause *>(NumClauses);
10119 return const_cast<OMPChildren *
>(
this)->
getClauses();
10126 const CapturedStmt *
10129 assert(llvm::is_contained(CaptureRegions, RegionKind) &&
10130 "RegionKind not found in OpenMP CaptureRegions.");
10132 for (
auto ThisCaptureRegion : CaptureRegions) {
10133 if (ThisCaptureRegion == RegionKind)
10135 CS = cast<CapturedStmt>(CS->getCapturedStmt());
10137 llvm_unreachable(
"Incorrect RegionKind specified for directive.");
10144 assert(!CaptureRegions.empty() &&
10145 "At least one captured statement must be provided.");
10147 for (
unsigned Level = CaptureRegions.size(); Level > 1; --Level)
10148 CS = cast<CapturedStmt>(CS->getCapturedStmt());
10152 const CapturedStmt *
10158 MutableArrayRef<Stmt *> getChildren();
10160 return const_cast<OMPChildren *
>(
this)->
getChildren();
10164 assert(HasAssociatedStmt &&
10165 "Expected directive with the associated statement.");
10169 S = CS->getCapturedStmt();
10170 CS = dyn_cast<CapturedStmt>(S);
10177 return const_cast<OMPChildren *
>(
this)->
getRawStmt();
10181 if (!HasAssociatedStmt)
10182 return Stmt::child_range(Stmt::child_iterator(), Stmt::child_iterator());
10183 return Stmt::child_range(&getTrailingObjects<Stmt *>()[NumChildren],
10184 &getTrailingObjects<Stmt *>()[NumChildren + 1]);
10195 :
public OMPOneStmtClause<llvm::omp::OMPC_ompx_dyn_cgroup_mem, OMPClause>,
10200 void setSize(Expr *E) { setStmt(E); }
10212 OpenMPDirectiveKind CaptureRegion,
10213 SourceLocation StartLoc, SourceLocation LParenLoc,
10214 SourceLocation EndLoc)
10217 setPreInitStmt(HelperSize, CaptureRegion);
10240 SourceLocation LParenLoc;
10243 enum { SIMPLE, FALLBACK, NUM_MODIFIERS };
10244 unsigned Modifiers[NUM_MODIFIERS];
10247 SourceLocation ModifiersLoc[NUM_MODIFIERS];
10250 Expr *Size =
nullptr;
10255 void setDynGroupprivateModifier(OpenMPDynGroupprivateClauseModifier M) {
10256 Modifiers[SIMPLE] = M;
10262 void setDynGroupprivateFallbackModifier(
10263 OpenMPDynGroupprivateClauseFallbackModifier M) {
10264 Modifiers[FALLBACK] = M;
10268 void setDynGroupprivateModifierLoc(SourceLocation Loc) {
10269 ModifiersLoc[SIMPLE] = Loc;
10273 void setDynGroupprivateFallbackModifierLoc(SourceLocation Loc) {
10274 ModifiersLoc[FALLBACK] = Loc;
10280 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
10285 void setSize(Expr *E) {
Size = E; }
10299 SourceLocation EndLoc, Expr *Size, Stmt *HelperSize,
10300 OpenMPDirectiveKind CaptureRegion,
10301 OpenMPDynGroupprivateClauseModifier M1,
10302 SourceLocation M1Loc,
10303 OpenMPDynGroupprivateClauseFallbackModifier M2,
10304 SourceLocation M2Loc)
10305 :
OMPClause(
llvm::omp::OMPC_dyn_groupprivate, StartLoc, EndLoc),
10307 setPreInitStmt(HelperSize, CaptureRegion);
10308 Modifiers[SIMPLE] = M1;
10309 Modifiers[FALLBACK] = M2;
10310 ModifiersLoc[SIMPLE] = M1Loc;
10311 ModifiersLoc[FALLBACK] = M2Loc;
10316 :
OMPClause(
llvm::omp::OMPC_dyn_groupprivate, SourceLocation(),
10319 Modifiers[SIMPLE] = OMPC_DYN_GROUPPRIVATE_unknown;
10320 Modifiers[FALLBACK] = OMPC_DYN_GROUPPRIVATE_FALLBACK_unknown;
10325 return static_cast<OpenMPDynGroupprivateClauseModifier
>(Modifiers[SIMPLE]);
10329 OpenMPDynGroupprivateClauseFallbackModifier
10331 return static_cast<OpenMPDynGroupprivateClauseFallbackModifier
>(
10332 Modifiers[FALLBACK]);
10340 return ModifiersLoc[SIMPLE];
10345 return ModifiersLoc[FALLBACK];
10355 return child_range(
reinterpret_cast<Stmt **
>(&Size),
10356 reinterpret_cast<Stmt **
>(&Size) + 1);
10364 return child_range(child_iterator(), child_iterator());
10367 return const_child_range(const_child_iterator(), const_child_iterator());
10371 return T->getClauseKind() == llvm::omp::OMPC_dyn_groupprivate;
10383class OMPDoacrossClause final
10384 :
public OMPVarListClause<OMPDoacrossClause>,
10385 private llvm::TrailingObjects<OMPDoacrossClause, Expr *> {
10387 friend OMPVarListClause;
10388 friend TrailingObjects;
10391 OpenMPDoacrossClauseModifier DepType = OMPC_DOACROSS_unknown;
10394 SourceLocation DepLoc;
10397 SourceLocation ColonLoc;
10400 unsigned NumLoops = 0;
10409 OMPDoacrossClause(SourceLocation StartLoc, SourceLocation LParenLoc,
10410 SourceLocation EndLoc,
unsigned N,
unsigned NumLoops)
10411 : OMPVarListClause<OMPDoacrossClause>(
llvm::omp::OMPC_doacross, StartLoc,
10412 LParenLoc, EndLoc, N),
10413 NumLoops(NumLoops) {}
10421 SourceLocation(), SourceLocation(),
10422 SourceLocation(), N),
10423 NumLoops(NumLoops) {}
10426 void setDependenceType(OpenMPDoacrossClauseModifier M) { DepType = M; }
10429 void setDependenceLoc(SourceLocation Loc) { DepLoc = Loc; }
10432 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
10446 static OMPDoacrossClause *
10447 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
10448 SourceLocation EndLoc, OpenMPDoacrossClauseModifier DepType,
10449 SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VL,
10450 unsigned NumLoops);
10457 static OMPDoacrossClause *
CreateEmpty(
const ASTContext &C,
unsigned N,
10458 unsigned NumLoops);
10473 void setLoopData(
unsigned NumLoop, Expr *Cnt);
10476 Expr *getLoopData(
unsigned NumLoop);
10477 const Expr *getLoopData(
unsigned NumLoop)
const;
10480 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
10481 reinterpret_cast<Stmt **
>(varlist_end()));
10485 return const_cast<OMPDoacrossClause *
>(
this)->
children();
10489 return child_range(child_iterator(), child_iterator());
10492 return const_child_range(const_child_iterator(), const_child_iterator());
10496 return T->getClauseKind() == llvm::omp::OMPC_doacross;
10511 SourceLocation LParenLoc;
10524 SourceLocation LParenLoc, SourceLocation EndLoc)
10525 :
OMPNoChildClause(StartLoc, EndLoc), LParenLoc(LParenLoc), Attrs(Attrs) {
10544 Attrs.append(NewAttrs.begin(), NewAttrs.end());
Forward declaration of all AST node types.
static Decl::Kind getKind(const Decl *D)
static const Decl * getCanonicalDecl(const Decl *D)
static void print(llvm::raw_ostream &OS, const T &V, const Context &Ctx, QualType Ty)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
std::add_pointer_t< std::add_const_t< T > > const_ptr
Defines some OpenMP-specific enums and functions.
Defines the clang::SourceLocation class and associated facilities.
Expr * getExpr()
Get 'expr' part of the associated expression/statement.
static OMPAtomicDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expressions Exprs)
Creates directive with a list of Clauses and 'x', 'v' and 'expr' parts of the atomic construct (see S...
static bool classof(const Stmt *T)
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
This represents clause 'affinity' in the 'pragma omp task'-based directives.
friend class OMPClauseReader
Expr * getModifier()
Gets affinity modifier.
child_range used_children()
SourceLocation getColonLoc() const
Gets the location of ':' symbol.
const_child_range children() const
Expr * getModifier() const
static bool classof(const OMPClause *T)
const_child_range used_children() const
This represents clause 'aligned' in the 'pragma omp ...' directives.
friend class OMPClauseReader
void setColonLoc(SourceLocation Loc)
Sets the location of ':'.
SourceLocation getColonLoc() const
Returns the location of ':'.
const Expr * getAlignment() const
Returns alignment.
const_child_range children() const
static bool classof(const OMPClause *T)
Expr * getAlignment()
Returns alignment.
child_range used_children()
const_child_range used_children() const
friend class OMPClauseReader
SourceLocation getBindKindLoc() const
Returns location of clause kind.
SourceLocation getLParenLoc() const
Returns the location of '('.
OpenMPBindClauseKind getBindKind() const
Returns kind of the clause.
Contains data for OpenMP directives: clauses, children expressions/statements (helpers for codegen) a...
friend class OMPClauseReader
void setChildren(ArrayRef< Stmt * > Children)
Stmt::child_range getAssociatedStmtAsRange()
MutableArrayRef< OMPClause * > getClauses()
Get the clauses storage.
void setClauses(ArrayRef< OMPClause * > Clauses)
Sets the list of variables for this clause.
friend class OMPDeclarativeDirective
bool hasAssociatedStmt() const
const CapturedStmt * getInnermostCapturedStmt(ArrayRef< OpenMPDirectiveKind > CaptureRegions) const
ArrayRef< Stmt * > getChildren() const
void setAssociatedStmt(Stmt *S)
Set associated statement.
const Stmt * getRawStmt() const
unsigned getNumChildren() const
CapturedStmt * getInnermostCapturedStmt(ArrayRef< OpenMPDirectiveKind > CaptureRegions)
Get innermost captured statement for the construct.
friend class OMPExecutableDirective
const Stmt * getAssociatedStmt() const
Returns statement associated with the directive.
ArrayRef< OMPClause * > getClauses() const
MutableArrayRef< Stmt * > getChildren()
const CapturedStmt * getCapturedStmt(OpenMPDirectiveKind RegionKind, ArrayRef< OpenMPDirectiveKind > CaptureRegions) const
Returns the captured statement associated with the component region within the (combined) directive.
Stmt * getAssociatedStmt()
unsigned getNumClauses() const
Class that represents a component of a mappable expression. E.g. for an expression S....
bool isNonContiguous() const
bool operator==(const MappableComponent &Other) const
MappableComponent(Expr *AssociatedExpression, ValueDecl *AssociatedDeclaration, bool IsNonContiguous)
MappableComponent()=default
ValueDecl * getAssociatedDeclaration() const
Expr * getAssociatedExpression() const
Struct that defines common infrastructure to handle mappable expressions used in OpenMP clauses.
static unsigned getUniqueDeclarationsTotalNumber(ArrayRef< const ValueDecl * > Declarations)
static unsigned getComponentsTotalNumber(MappableExprComponentListsRef ComponentLists)
friend llvm::hash_code hash_value(const MappableComponent &MC)
ArrayRef< MappableExprComponentList > MappableExprComponentListsRef
SmallVector< MappableComponent, 8 > MappableExprComponentList
ArrayRef< MappableComponent > MappableExprComponentListRef
SmallVector< MappableExprComponentList, 8 > MappableExprComponentLists
OMPClausePrinter(raw_ostream &OS, const PrintingPolicy &Policy, unsigned OpenMPVersion)
This class implements a simple visitor for OMPClause subclasses.
RetTy VisitOMPClause(PTR(OMPClause) Node)
RetTy Visit(PTR(OMPClause) S)
This represents clause 'copyin' in the 'pragma omp ...' directives.
friend class OMPClauseReader
llvm::iterator_range< helper_expr_iterator > helper_expr_range
helper_expr_const_range assignment_ops() const
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
helper_expr_range assignment_ops()
helper_expr_range source_exprs()
helper_expr_const_range source_exprs() const
MutableArrayRef< Expr * >::iterator helper_expr_iterator
const_child_range children() const
static bool classof(const OMPClause *T)
helper_expr_range destination_exprs()
child_range used_children()
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
const_child_range used_children() const
helper_expr_const_range destination_exprs() const
This represents clause 'copyprivate' in the 'pragma omp ...' directives.
llvm::iterator_range< helper_expr_iterator > helper_expr_range
friend class OMPClauseReader
const_child_range used_children() const
helper_expr_range destination_exprs()
helper_expr_range source_exprs()
const_child_range children() const
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
child_range used_children()
static bool classof(const OMPClause *T)
helper_expr_const_range destination_exprs() const
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
MutableArrayRef< Expr * >::iterator helper_expr_iterator
helper_expr_const_range source_exprs() const
helper_expr_range assignment_ops()
helper_expr_const_range assignment_ops() const
friend class OMPClauseReader
const_child_range children() const
OMPDefaultmapClause()
Build an empty clause.
OMPDefaultmapClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc, SourceLocation KLoc, SourceLocation EndLoc, OpenMPDefaultmapClauseKind Kind, OpenMPDefaultmapClauseModifier M)
Build 'defaultmap' clause with defaultmap kind Kind.
static bool classof(const OMPClause *T)
child_range used_children()
SourceLocation getDefaultmapModifierLoc() const
Get the modifier location.
OpenMPDefaultmapClauseKind getDefaultmapKind() const
Get kind of the clause.
const_child_range used_children() const
SourceLocation getDefaultmapKindLoc()
Get kind location.
OpenMPDefaultmapClauseModifier getDefaultmapModifier() const
Get the modifier of the clause.
SourceLocation getLParenLoc()
Get location of '('.
This represents implicit clause 'depend' for the 'pragma omp task' directive.
const_child_range children() const
friend class OMPClauseReader
SourceLocation getDependencyLoc() const
Get dependency type location.
Expr * getModifier()
Return optional depend modifier.
unsigned getNumLoops() const
Get number of loops associated with the clause.
const Expr * getModifier() const
SourceLocation getColonLoc() const
Get colon location.
SourceLocation getOmpAllMemoryLoc() const
Get 'omp_all_memory' location.
const_child_range used_children() const
static bool classof(const OMPClause *T)
OpenMPDependClauseKind getDependencyKind() const
Get dependency type.
child_range used_children()
This represents implicit clause 'depobj' for the 'pragma omp depobj' directive. This clause does not ...
const Expr * getDepobj() const
friend class OMPClauseReader
SourceLocation getLParenLoc() const
Returns the location of '('.
const_child_range children() const
Expr * getDepobj()
Returns depobj expression associated with the clause.
static bool classof(const OMPClause *T)
const_child_range used_children() const
child_range used_children()
SourceLocation getLParenLoc() const
Returns the location of '('.
OMPDestroyClause(Expr *InteropVar, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Build 'destroy' clause with an interop variable expression InteropVar.
friend class OMPClauseReader
const_child_range children() const
const_child_range used_children() const
static bool classof(const OMPClause *T)
SourceLocation getVarLoc() const
Returns the location of the interop variable.
Expr * getInteropVar() const
Returns the interop variable.
child_range used_children()
OMPDestroyClause()
Build an empty clause.
OMPDestroyClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'destroy' clause.
friend class OMPClauseReader
Expr * getEventHandler() const
Returns event-handler expression.
OMPDetachClause()
Build an empty clause.
OMPDetachClause(Expr *Evt, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'detach' clause with event-handler Evt.
OpenMPDeviceClauseModifier getModifier() const
Gets modifier.
friend class OMPClauseReader
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
child_range used_children()
Expr * getDevice()
Return device number.
OMPDeviceClause(OpenMPDeviceClauseModifier Modifier, Expr *E, Stmt *HelperE, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Build 'device' clause.
OMPDeviceClause()
Build an empty clause.
SourceLocation getModifierLoc() const
Gets modifier location.
Expr * getDevice() const
Return device number.
SourceLocation getLParenLoc() const
Returns the location of '('.
const_child_range used_children() const
const_child_range children() const
static bool classof(const OMPClause *T)
SourceLocation getDistScheduleKindLoc()
Get kind location.
friend class OMPClauseReader
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 getLParenLoc()
Get location of '('.
child_range used_children()
const_child_range used_children() const
SourceLocation getCommaLoc()
Get location of ','.
static bool classof(const OMPClause *T)
const_child_range children() const
Expr * getChunkSize()
Get chunk size.
OpenMPDistScheduleClauseKind getDistScheduleKind() const
Get kind of the clause.
OMPDistScheduleClause()
Build an empty clause.
const Expr * getChunkSize() const
Get chunk size.
This represents the 'doacross' clause for the 'pragma omp ordered' directive.
const_child_range children() const
friend class OMPClauseReader
SourceLocation getDependenceLoc() const
Get dependence type location.
SourceLocation getColonLoc() const
Get colon location.
OpenMPDoacrossClauseModifier getDependenceType() const
Get dependence type.
static bool classof(const OMPClause *T)
const_child_range used_children() const
child_range used_children()
unsigned getNumLoops() const
Get number of loops associated with the clause.
child_range used_children()
friend class OMPClauseReader
OMPDynGroupprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, Expr *Size, Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion, OpenMPDynGroupprivateClauseModifier M1, SourceLocation M1Loc, OpenMPDynGroupprivateClauseFallbackModifier M2, SourceLocation M2Loc)
Build 'dyn_groupprivate' clause with a size expression Size.
static bool classof(const OMPClause *T)
const Expr * getSize() const
Get size.
Expr * getSize()
Get size.
SourceLocation getLParenLoc()
Get location of '('.
OpenMPDynGroupprivateClauseFallbackModifier getDynGroupprivateFallbackModifier() const
Get the second modifier of the clause.
OMPDynGroupprivateClause()
Build an empty clause.
SourceLocation getDynGroupprivateFallbackModifierLoc() const
Get the second modifier location.
SourceLocation getDynGroupprivateModifierLoc() const
Get the first modifier location.
OpenMPDynGroupprivateClauseModifier getDynGroupprivateModifier() const
Get the first modifier of the clause.
const_child_range children() const
const_child_range used_children() const
This represents clause 'exclusive' in the 'pragma omp scan' directive.
const_child_range children() const
friend class OMPClauseReader
static bool classof(const OMPClause *T)
child_range used_children()
const_child_range used_children() const
OMPFilterClause()
Build an empty clause.
friend class OMPClauseReader
Expr * getThreadID() const
Return thread identifier.
Expr * getThreadID()
Return thread identifier.
OMPFilterClause(Expr *ThreadID, Stmt *HelperE, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'filter' clause with thread-id ThreadID.
static bool classof(const OMPClause *T)
child_range used_children()
const_child_range used_children() const
const_child_range children() const
This represents clause 'from' in the 'pragma omp ...' directives.
const_child_range children() const
friend class OMPClauseReader
const_child_range used_children() const
child_range used_children()
ArrayRef< SourceLocation > getMotionModifiersLoc() const LLVM_READONLY
Fetches ArrayRef of location of motion-modifiers.
static bool classof(const OMPClause *T)
ArrayRef< OpenMPMotionModifierKind > getMotionModifiers() const LLVM_READONLY
Fetches ArrayRef of motion-modifiers.
SourceLocation getMotionModifierLoc(unsigned Cnt) const LLVM_READONLY
Fetches the motion-modifier location at 'Cnt' index of array of modifiers' locations.
SourceLocation getColonLoc() const
Get colon location.
Expr * getIteratorModifier() const
OpenMPMotionModifierKind getMotionModifier(unsigned Cnt) const LLVM_READONLY
Fetches the motion-modifier at 'Cnt' index of array of modifiers.
const_child_range children() const
OpenMPGrainsizeClauseModifier getModifier() const
Gets modifier.
friend class OMPClauseReader
OMPGrainsizeClause()
Build an empty clause.
SourceLocation getModifierLoc() const
Gets modifier location.
const_child_range used_children() const
Expr * getGrainsize() const
Return safe iteration space distance.
child_range used_children()
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
static bool classof(const OMPClause *T)
SourceLocation getLParenLoc() const
Returns the location of '('.
OMPGrainsizeClause(OpenMPGrainsizeClauseModifier Modifier, Expr *Size, Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Build 'grainsize' clause.
This represents clause 'has_device_ptr' in the 'pragma omp ...' directives.
static bool classof(const OMPClause *T)
friend class OMPClauseReader
const_child_range used_children() const
const_child_range children() const
child_range used_children()
SourceLocation getLParenLoc() const
Returns the location of '('.
friend class OMPClauseReader
child_range used_children()
OMPHintClause(Expr *Hint, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'hint' clause with expression Hint.
Expr * getHint() const
Returns number of threads.
const_child_range used_children() const
const_child_range children() const
static bool classof(const OMPClause *T)
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OMPHintClause()
Build an empty clause.
This represents clause 'inclusive' in the 'pragma omp scan' directive.
const_child_range children() const
friend class OMPClauseReader
static bool classof(const OMPClause *T)
const_child_range used_children() const
child_range used_children()
bool getIsTarget() const
Returns true is interop-type 'target' is used.
friend class OMPClauseReader
ArrayRef< Expr * > attrs() const
All attr() exprs across every pref-spec, in pref-spec order (flat block).
const_child_range children() const
bool hasPreferAttrs() const
Returns true if OMP 6.0 {fr/attr} syntax is used.
child_range used_children()
Expr * getInteropVar()
Returns the interop variable.
const_child_range used_children() const
SourceLocation getVarLoc() const
Returns the location of the interop variable.
bool getIsTargetSync() const
Returns true is interop-type 'targetsync' is used.
const Expr * getInteropVar() const
static bool classof(const OMPClause *T)
auto prefs() const
Returns a range of PrefView objects, one per preference-specification, each carrying the fr() express...
This represents clause 'is_device_ptr' in the 'pragma omp ...' directives.
friend class OMPClauseReader
static bool classof(const OMPClause *T)
child_range used_children()
const_child_range children() const
const_child_range used_children() const
OpenMPMapClauseKind getMapType() const LLVM_READONLY
Fetches mapping kind for the clause.
friend class OMPClauseReader
const_child_range children() const
OpenMPMapModifierKind getMapTypeModifier(unsigned Cnt) const LLVM_READONLY
Fetches the map-type-modifier at 'Cnt' index of array of modifiers.
SourceLocation getMapTypeModifierLoc(unsigned Cnt) const LLVM_READONLY
Fetches the map-type-modifier location at 'Cnt' index of array of modifiers' locations.
SourceLocation getMapLoc() const LLVM_READONLY
Fetches location of clause mapping kind.
child_range used_children()
ArrayRef< SourceLocation > getMapTypeModifiersLoc() const LLVM_READONLY
Fetches ArrayRef of location of map-type-modifiers.
static bool classof(const OMPClause *T)
SourceLocation getColonLoc() const
Get colon location.
ArrayRef< OpenMPMapModifierKind > getMapTypeModifiers() const LLVM_READONLY
Fetches ArrayRef of map-type-modifiers.
const_child_range used_children() const
bool isImplicitMapType() const LLVM_READONLY
Is this an implicit map type? We have to capture 'IsMapTypeImplicit' from the parser for more informa...
Expr * getIteratorModifier()
Fetches Expr * of iterator modifier.
Iterator that browse the components by lists. It also allows browsing components of a single declarat...
std::tuple< const ValueDecl *, MappableExprComponentListRef, const ValueDecl * > operator->() const
std::tuple< const ValueDecl *, MappableExprComponentListRef, const ValueDecl * > operator*() const
const_component_lists_iterator & operator++()
const_component_lists_iterator(const ValueDecl *Declaration, ArrayRef< ValueDecl * > UniqueDecls, ArrayRef< unsigned > DeclsListNum, ArrayRef< unsigned > CumulativeListSizes, MappableExprComponentListRef Components, bool SupportsMapper, ArrayRef< Expr * > Mappers)
Construct an iterator that scan lists for a given declaration Declaration.
const_component_lists_iterator(ArrayRef< ValueDecl * > UniqueDecls, ArrayRef< unsigned > DeclsListNum, ArrayRef< unsigned > CumulativeListSizes, MappableExprComponentListRef Components, bool SupportsMapper, ArrayRef< Expr * > Mappers)
Construct an iterator that scans all lists.
This represents clauses with a list of expressions that are mappable. Examples of these clauses are '...
MutableArrayRef< ValueDecl * > getUniqueDeclsRef()
Get the unique declarations that are in the trailing objects of the class.
const DeclarationNameInfo & getMapperIdInfo() const
Gets the name info for associated user-defined mapper.
const_all_lists_sizes_range all_lists_sizes() const
const_component_lists_range decl_component_lists(const ValueDecl *VD) const
llvm::iterator_range< const_all_components_iterator > const_all_components_range
unsigned getTotalComponentsNum() const
Return the total number of components in all lists derived from the clause.
void setComponents(ArrayRef< MappableComponent > Components, ArrayRef< unsigned > CLSs)
Set the components that are in the trailing objects of the class. This requires the list sizes so tha...
friend class OMPClauseReader
mapperlist_const_iterator mapperlist_end() const
const_component_lists_iterator component_lists_end() const
llvm::iterator_range< const_all_lists_sizes_iterator > const_all_lists_sizes_range
mapperlist_iterator mapperlist_begin()
ArrayRef< ValueDecl * > getUniqueDeclsRef() const
Get the unique declarations that are in the trailing objects of the class.
mapperlist_iterator mapperlist_end()
ArrayRef< ValueDecl * >::iterator const_all_decls_iterator
Iterators to access all the declarations, number of lists, list sizes, and components.
MutableArrayRef< Expr * >::iterator mapperlist_iterator
ArrayRef< unsigned > getComponentListSizesRef() const
Get the cumulative component lists sizes that are in the trailing objects of the class....
MutableArrayRef< unsigned > getDeclNumListsRef()
Get the number of lists per declaration that are in the trailing objects of the class.
ArrayRef< Expr * > getUDMapperRefs() const
Get the user-defined mappers references that are in the trailing objects of the class.
const_component_lists_range component_lists() const
void setDeclNumLists(ArrayRef< unsigned > DNLs)
Set the number of lists per declaration that are in the trailing objects of the class.
const_all_components_range all_components() const
ArrayRef< unsigned >::iterator const_all_num_lists_iterator
mapperlist_const_range mapperlists() const
OMPMappableExprListClause(OpenMPClauseKind K, const OMPVarListLocTy &Locs, const OMPMappableExprListSizeTy &Sizes, bool SupportsMapper=false, NestedNameSpecifierLoc *MapperQualifierLocPtr=nullptr, DeclarationNameInfo *MapperIdInfoPtr=nullptr)
Build a clause for NumUniqueDeclarations declarations, NumComponentLists total component lists,...
ArrayRef< const Expr * >::iterator mapperlist_const_iterator
mapperlist_const_iterator mapperlist_begin() const
void setMapperIdInfo(DeclarationNameInfo MapperId)
Set the name of associated user-defined mapper.
void setUDMapperRefs(ArrayRef< Expr * > DMDs)
Set the user-defined mappers that are in the trailing objects of the class.
void setComponentListSizes(ArrayRef< unsigned > CLSs)
Set the cumulative component lists sizes that are in the trailing objects of the class.
const_all_num_lists_range all_num_lists() const
ArrayRef< unsigned >::iterator const_all_lists_sizes_iterator
unsigned getTotalComponentListNum() const
Return the number of lists derived from the clause expressions.
void setMapperQualifierLoc(NestedNameSpecifierLoc NNSL)
Set the nested name specifier of associated user-defined mapper.
MutableArrayRef< Expr * > getUDMapperRefs()
Get the user-defined mapper references that are in the trailing objects of the class.
unsigned getUniqueDeclarationsNum() const
Return the number of unique base declarations in this clause.
const_component_lists_iterator decl_component_lists_end() const
ArrayRef< unsigned > getDeclNumListsRef() const
Get the number of lists per declaration that are in the trailing objects of the class.
NestedNameSpecifierLoc getMapperQualifierLoc() const
Gets the nested name specifier for associated user-defined mapper.
llvm::iterator_range< const_all_num_lists_iterator > const_all_num_lists_range
mapperlist_range mapperlists()
MutableArrayRef< unsigned > getComponentListSizesRef()
Get the cumulative component lists sizes that are in the trailing objects of the class....
void setClauseInfo(ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists)
Fill the clause information from the list of declarations and associated component lists.
MutableArrayRef< MappableComponent > getComponentsRef()
Get the components that are in the trailing objects of the class.
const_component_lists_iterator component_lists_begin() const
Iterators for all component lists.
llvm::iterator_range< const_component_lists_iterator > const_component_lists_range
llvm::iterator_range< mapperlist_const_iterator > mapperlist_const_range
const_component_lists_iterator decl_component_lists_begin(const ValueDecl *VD) const
Iterators for component lists associated with the provided declaration.
ArrayRef< MappableComponent > getComponentsRef() const
Get the components that are in the trailing objects of the class.
llvm::iterator_range< mapperlist_iterator > mapperlist_range
llvm::iterator_range< const_all_decls_iterator > const_all_decls_range
ArrayRef< MappableComponent >::iterator const_all_components_iterator
void setUniqueDecls(ArrayRef< ValueDecl * > UDs)
Set the unique declarations that are in the trailing objects of the class.
const_all_decls_range all_decls() const
friend class OMPClauseReader
OMPNocontextClause()
Build an empty clause.
const_child_range used_children() const
Expr * getCondition() const
Returns condition.
OMPNocontextClause(Expr *Cond, Stmt *HelperCond, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'nocontext' clause with condition Cond.
child_range used_children()
static bool classof(const OMPClause *T)
const_child_range children() const
const_child_range used_children() const
OMPNogroupClause()
Build an empty clause.
OMPNogroupClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'nogroup' clause.
child_range used_children()
This represents clause 'nontemporal' in the 'pragma omp ...' directives.
friend class OMPClauseReader
child_range used_children()
static bool classof(const OMPClause *T)
const_child_range used_children() const
const_child_range children() const
const_child_range private_refs() const
child_range private_refs()
Expr * getCondition() const
Returns condition.
friend class OMPClauseReader
const_child_range used_children() const
child_range used_children()
OMPNovariantsClause()
Build an empty clause.
OMPNovariantsClause(Expr *Cond, Stmt *HelperCond, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'novariants' clause with condition Cond.
friend class OMPClauseReader
const_child_range children() const
SourceLocation getModifierLoc() const
Gets modifier location.
OMPNumTasksClause()
Build an empty clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
SourceLocation getLParenLoc() const
Returns the location of '('.
const_child_range used_children() const
OpenMPNumTasksClauseModifier getModifier() const
Gets modifier.
OMPNumTasksClause(OpenMPNumTasksClauseModifier Modifier, Expr *Size, Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Build 'num_tasks' clause.
static bool classof(const OMPClause *T)
child_range used_children()
Expr * getNumTasks() const
Return safe iteration space distance.
This represents 'num_teams' clause in the 'pragma omp ...' directive.
child_range used_children()
friend class OMPClauseReader
const Expr * getDimsModifierExpr() const
Get the expression of the modifier if it is the dims modifier.
ArrayRef< Expr * > getNumTeams()
Return NumTeams expressions.
Expr * getModifierExpr()
Get the expression of the modifier.
static bool classof(const OMPClause *T)
const_child_range children() const
SourceLocation getModifierLoc() const
Get the location of the modifier.
OpenMPNumTeamsClauseModifier getModifier() const
Get the modifier.
const Expr * getModifierExpr() const
Get the expression of the modifier.
ArrayRef< Expr * > getNumTeams() const
Return NumTeams expressions.
const_child_range used_children() const
friend class OMPClauseReader
SourceLocation getLParenLoc() const
Returns the location of '('.
SourceLocation getModifierKwLoc() const
Returns location of clause modifier.
OMPOrderClause(OpenMPOrderClauseKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, OpenMPOrderClauseModifier Modifier, SourceLocation MLoc)
Build 'order' clause with argument A ('concurrent').
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
SourceLocation getKindKwLoc() const
Returns location of clause kind.
const_child_range used_children() const
static bool classof(const OMPClause *T)
OMPOrderClause()
Build an empty clause.
const_child_range children() const
child_range used_children()
OpenMPOrderClauseKind getKind() const
Returns kind of the clause.
OpenMPOrderClauseModifier getModifier() const
Returns Modifier of the clause.
friend class OMPClauseReader
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
Expr * getPriority() const
Return Priority number.
child_range used_children()
SourceLocation getLParenLoc() const
Returns the location of '('.
const_child_range used_children() const
OMPPriorityClause(Expr *Priority, Stmt *HelperPriority, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'priority' clause.
OMPPriorityClause()
Build an empty clause.
static bool classof(const OMPClause *T)
const_child_range children() const
Expr * getPriority()
Return Priority number.
OMPSIMDClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'simd' clause.
const_child_range used_children() const
const_child_range children() const
OMPSIMDClause()
Build an empty clause.
child_range used_children()
static bool classof(const OMPClause *T)
This represents 'thread_limit' clause in the 'pragma omp ...' directive.
const_child_range children() const
friend class OMPClauseReader
SourceLocation getModifierLoc() const
Get the location of the modifier.
Expr * getModifierExpr()
Get the expression of the modifier.
child_range used_children()
const_child_range used_children() const
ArrayRef< Expr * > getThreadLimit() const
Return ThreadLimit expressions.
const Expr * getDimsModifierExpr() const
Get the expression of the modifier if it is the dims modifier.
ArrayRef< Expr * > getThreadLimit()
Return ThreadLimit expressions.
const Expr * getModifierExpr() const
Get the expression of the modifier.
OpenMPThreadLimitClauseModifier getModifier() const
Get the modifier.
static bool classof(const OMPClause *T)
OMPThreadsClause()
Build an empty clause.
OMPThreadsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'threads' clause.
This represents clause 'to' in the 'pragma omp ...' directives.
ArrayRef< SourceLocation > getMotionModifiersLoc() const LLVM_READONLY
Fetches ArrayRef of location of motion-modifiers.
friend class OMPClauseReader
Expr * getIteratorModifier() const
SourceLocation getMotionModifierLoc(unsigned Cnt) const LLVM_READONLY
Fetches the motion-modifier location at 'Cnt' index of array of modifiers' locations.
ArrayRef< OpenMPMotionModifierKind > getMotionModifiers() const LLVM_READONLY
Fetches ArrayRef of motion-modifiers.
static bool classof(const OMPClause *T)
child_range used_children()
OpenMPMotionModifierKind getMotionModifier(unsigned Cnt) const LLVM_READONLY
Fetches the motion-modifier at 'Cnt' index of array of modifiers.
const_child_range used_children() const
const_child_range children() const
SourceLocation getColonLoc() const
Get colon location.
bool isExtensionActive(llvm::omp::TraitProperty TP)
Check the extension trait TP is active.
llvm::SmallVector< OMPTraitSet, 2 > Sets
The outermost level of selector sets.
bool anyScoreOrCondition(llvm::function_ref< bool(Expr *&, bool)> Cond)
friend class OMPClauseReader
static bool classof(const OMPClause *T)
child_range used_children()
SourceLocation getVarLoc() const
Returns the location of the interop variable.
Expr * getInteropVar() const
Returns the interop variable.
OMPUseClause()
Build an empty clause.
const_child_range children() const
const_child_range used_children() const
OMPUseClause(Expr *InteropVar, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Build 'use' clause with and interop variable expression InteropVar.
SourceLocation getLParenLoc() const
Returns the location of '('.
This represents clause 'use_device_addr' in the 'pragma omp ...' directives.
friend class OMPClauseReader
const_child_range used_children() const
child_range used_children()
static bool classof(const OMPClause *T)
const_child_range children() const
This represents clause 'use_device_ptr' in the 'pragma omp ...' directives.
SourceLocation getFallbackModifierLoc() const
Get the location of the fallback modifier.
friend class OMPClauseReader
ArrayRef< const Expr * >::iterator inits_const_iterator
static bool classof(const OMPClause *T)
MutableArrayRef< Expr * >::iterator private_copies_iterator
llvm::iterator_range< private_copies_iterator > private_copies_range
llvm::iterator_range< inits_iterator > inits_range
const_child_range used_children() const
child_range used_children()
OpenMPUseDevicePtrFallbackModifier getFallbackModifier() const
Get the fallback modifier for the clause.
const_child_range children() const
private_copies_const_range private_copies() const
private_copies_range private_copies()
MutableArrayRef< Expr * >::iterator inits_iterator
ArrayRef< const Expr * >::iterator private_copies_const_iterator
llvm::iterator_range< inits_const_iterator > inits_const_range
inits_const_range inits() const
llvm::iterator_range< private_copies_const_iterator > private_copies_const_range
friend class OMPClauseReader
const_child_range used_children() const
child_range used_children()
const_child_range children() const
SourceLocation getLParenLoc() const
Returns the location of '('.
static bool classof(const OMPClause *T)
unsigned getNumberOfAllocators() const
Returns number of allocators associated with the clause.
ArrayRef< const Attr * > getAttrs() const
Returned the attributes parsed from this clause.
friend class OMPClauseReader
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OMPXAttributeClause()
Build an empty clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
OMPXAttributeClause(ArrayRef< const Attr * > Attrs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'ompx_attribute' clause.
OMPXBareClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'ompx_bare' clause.
OMPXBareClause()=default
Build an empty clause.
friend class OMPClauseReader
Expr * getSize()
Return the size expression.
Expr * getSize() const
Return the size expression.
OMPXDynCGroupMemClause(Expr *Size, Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'ompx_dyn_cgroup_mem' clause.
OMPXDynCGroupMemClause()
Build an empty clause.
a trap message and trap category.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
This represents one expression.
This represents the 'align' clause in the 'pragma omp allocate' directive.
friend class OMPClauseReader
Expr * getAlignment() const
Returns alignment.
This represents clause 'allocate' in the 'pragma omp ...' directives.
const_child_range children() const
friend class OMPClauseReader
SourceLocation getAllocatorModifierLoc() const
Return the location of the modifier.
const_child_range used_children() const
OpenMPAllocateClauseModifier getAllocatorModifier() const
Return 'allocate' modifier.
OpenMPAllocateClauseModifier getSecondAllocateModifier() const
Get the second modifier of the clause.
SourceLocation getColonLoc() const
Returns the location of the ':' delimiter.
Expr * getAlignment() const
Returns the alignment expression or nullptr, if no alignment specified.
OpenMPAllocateClauseModifier getFirstAllocateModifier() const
Get the first modifier of the clause.
Expr * getAllocator() const
Returns the allocator expression or nullptr, if no allocator is specified.
SourceLocation getSecondAllocateModifierLoc() const
Get location of second modifier of the clause.
child_range used_children()
SourceLocation getFirstAllocateModifierLoc() const
Get location of first modifier of the clause.
static OMPAllocateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
static bool classof(const OMPClause *T)
friend class OMPClauseReader
OMPAllocatorClause(Expr *A, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'allocator' clause with the given allocator.
OMPAllocatorClause()
Build an empty clause.
Expr * getAllocator() const
Returns allocator.
Class that handles post-update expression for some clauses, like 'lastprivate', 'reduction' etc.
friend class OMPClauseReader
void setPostUpdateExpr(Expr *S)
Set pre-initialization statement for the clause.
static OMPClauseWithPostUpdate * get(OMPClause *C)
Expr * getPostUpdateExpr()
Get post-update expression for the clause.
OMPClauseWithPostUpdate(const OMPClause *This)
const Expr * getPostUpdateExpr() const
Get post-update expression for the clause.
Class that handles pre-initialization statement for some clauses, like 'schedule',...
friend class OMPClauseReader
const Stmt * getPreInitStmt() const
Get pre-initialization statement for the clause.
OMPClauseWithPreInit(const OMPClause *This)
OpenMPDirectiveKind getCaptureRegion() const
Get capture region for the stmt in the clause.
Stmt * getPreInitStmt()
Get pre-initialization statement for the clause.
static OMPClauseWithPreInit * get(OMPClause *C)
void setPreInitStmt(Stmt *S, OpenMPDirectiveKind ThisRegion=llvm::omp::OMPD_unknown)
Set pre-initialization statement for the clause.
This is a basic class for representing single OpenMP clause.
const_child_range children() const
void setLocStart(SourceLocation Loc)
Sets the starting location of the clause.
static bool classof(const OMPClause *)
SourceLocation getBeginLoc() const
Returns the starting location of the clause.
llvm::iterator_range< const_child_iterator > const_child_range
ConstStmtIterator const_child_iterator
child_range used_children()
Get the iterator range for the expressions used in the clauses.
llvm::iterator_range< child_iterator > child_range
OMPClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation EndLoc)
void setLocEnd(SourceLocation Loc)
Sets the ending location of the clause.
StmtIterator child_iterator
SourceLocation getEndLoc() const
Returns the ending location of the clause.
OpenMPClauseKind getClauseKind() const
Returns kind of OpenMP clause (private, shared, reduction, etc.).
const_child_range used_children() const
friend class OMPClauseReader
OMPCollapseClause()
Build an empty clause.
Expr * getNumForLoops() const
Return the number of associated for-loops.
OMPCollapseClause(Expr *Num, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'collapse' clause.
static bool classof(const OMPClause *T)
std::optional< unsigned > getOmpFillIndex() const
friend class OMPClauseReader
child_range used_children()
SourceLocation getOmpFillLoc() const
ArrayRef< Expr * > getCountsRefs() const
const_child_range used_children() const
const_child_range children() const
unsigned getNumCounts() const
Returns the number of list items.
static OMPCountsClause * CreateEmpty(const ASTContext &C, unsigned NumCounts)
Build an empty 'counts' AST node for deserialization.
SourceLocation getLParenLoc() const
Returns the location of '('.
MutableArrayRef< Expr * > getCountsRefs()
Returns the count expressions.
friend class OMPClauseReader
const_child_range used_children() const
OMPDefaultClause(llvm::omp::DefaultKind A, SourceLocation ALoc, OpenMPDefaultClauseVariableCategory VC, SourceLocation VCLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'default' clause with argument A ('none' or 'shared').
SourceLocation getLParenLoc() const
Returns the location of '('.
llvm::omp::DefaultKind getDefaultKind() const
Returns kind of the clause.
SourceLocation getDefaultKindKwLoc() const
Returns location of clause kind.
OpenMPDefaultClauseVariableCategory getDefaultVC() const
static bool classof(const OMPClause *T)
child_range used_children()
const_child_range children() const
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OMPDefaultClause()
Build an empty clause.
SourceLocation getDefaultVCLoc() const
Class that represents a list of directive kinds (parallel, target, etc.) as used in absent,...
MutableArrayRef< OpenMPDirectiveKind > getDirectiveKinds()
void setDirectiveKinds(ArrayRef< OpenMPDirectiveKind > DK)
SourceLocation getLParenLoc()
const_child_range children() const
unsigned NumKinds
Number of directive kinds listed in the clause.
void setLParenLoc(SourceLocation S)
const_child_range used_children() const
OMPDirectiveListClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned NumKinds)
Build a clause with NumKinds directive kinds.
child_range used_children()
child_range used_children()
friend class OMPClauseReader
Expr * getCondition() const
Returns condition.
OMPFinalClause(Expr *Cond, Stmt *HelperCond, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'final' clause with condition Cond.
OMPFinalClause()
Build an empty clause.
const_child_range used_children() const
Representation of the 'full' clause of the 'pragma omp unroll' directive.
friend class OMPClauseReader
static OMPFullClause * CreateEmpty(const ASTContext &C)
Build an empty 'full' AST node for deserialization.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
friend class OMPClauseReader
const_child_range used_children() const
SourceLocation getLParenLoc() const
Returns the location of '('.
SourceLocation getColonLoc() const
Return the location of ':'.
static bool classof(const OMPClause *T)
child_range used_children()
Expr * getCondition() const
Returns condition.
OpenMPDirectiveKind getNameModifier() const
Return directive name modifier associated with the clause.
OMPIfClause()
Build an empty clause.
const_child_range children() const
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.
SourceLocation getNameModifierLoc() const
Return the location of directive name modifier.
friend class OMPClauseReader
Expr * getFirst() const
Get looprange 'first' expression.
static OMPLoopRangeClause * CreateEmpty(const ASTContext &C)
Build an empty 'looprange' clause node.
const_child_range used_children() const
void setFirstLoc(SourceLocation Loc)
child_range used_children()
void setCountLoc(SourceLocation Loc)
SourceLocation getFirstLoc() const
SourceLocation getLParenLoc() const
static bool classof(const OMPClause *T)
SourceLocation getCountLoc() const
const_child_range children() const
Expr * getCount() const
Get looprange 'count' expression.
void setLParenLoc(SourceLocation Loc)
OpenMPNumThreadsClauseModifier getModifier() const
Gets modifier.
friend class OMPClauseReader
SourceLocation getModifierLoc() const
Gets modifier location.
OMPNumThreadsClause()
Build an empty clause.
OMPNumThreadsClause(OpenMPNumThreadsClauseModifier Modifier, Expr *NumThreads, Stmt *HelperNumThreads, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Build 'num_threads' clause with condition NumThreads.
Expr * getNumThreads() const
Returns number of threads.
const_child_range used_children() const
child_range used_children()
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OMPOneStmtClause(Stmt *S, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
static bool classof(const OMPClause *T)
ConstStmtIterator const_child_iterator
const_child_range children() const
StmtIterator child_iterator
llvm::iterator_range< child_iterator > child_range
SourceLocation getLParenLoc() const
Returns the location of '('.
llvm::iterator_range< const_child_iterator > const_child_range
T * getStmtAs() const
Return the associated statement, potentially casted to T.
child_range used_children()
friend class OMPClauseReader
static OMPPartialClause * CreateEmpty(const ASTContext &C)
Build an empty 'partial' AST node for deserialization.
const_child_range used_children() const
SourceLocation getLParenLoc() const
Returns the location of '('.
const_child_range children() const
static bool classof(const OMPClause *T)
Expr * getFactor() const
Returns the argument of the clause or nullptr if not set.
This class represents the 'permutation' clause in the 'pragma omp interchange' directive.
static bool classof(const OMPClause *T)
friend class OMPClauseReader
ArrayRef< Expr * > getArgsRefs() const
unsigned getNumLoops() const
Returns the number of list items.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
SourceLocation getLParenLoc() const
Returns the location of '('.
child_range used_children()
MutableArrayRef< Expr * > getArgsRefs()
Returns the permutation index expressions.
static OMPPermutationClause * CreateEmpty(const ASTContext &C, unsigned NumLoops)
Build an empty 'permutation' AST node for deserialization.
const_child_range used_children() const
const_child_range children() const
friend class OMPClauseReader
OMPSafelenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'safelen' clause.
Expr * getSafelen() const
Return safe iteration space distance.
OMPSafelenClause()
Build an empty clause.
friend class OMPClauseReader
OMPSimdlenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'simdlen' clause.
Expr * getSimdlen() const
Return safe iteration space distance.
OMPSimdlenClause()
Build an empty clause.
This represents the 'sizes' clause in the 'pragma omp tile' directive.
SourceLocation getLParenLoc() const
Returns the location of '('.
friend class OMPClauseReader
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
static bool classof(const OMPClause *T)
const_child_range used_children() const
void setSizesRefs(ArrayRef< Expr * > VL)
Sets the tile size expressions.
unsigned getNumSizes() const
Returns the number of list items.
child_range used_children()
MutableArrayRef< Expr * > getSizesRefs()
Returns the tile size expressions.
ArrayRef< Expr * > getSizesRefs() const
const_child_range children() const
static OMPSizesClause * CreateEmpty(const ASTContext &C, unsigned NumSizes)
Build an empty 'sizes' AST node for deserialization.
friend class OMPClauseReader
static bool classof(const OMPClause *T)
OpenMPThreadsetKind getThreadsetKind() const
Returns kind of the clause.
const_child_range children() const
OMPThreadsetClause(OpenMPThreadsetKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'threadset' clause with argument A ('omp_team' or 'omp_pool').
child_range used_children()
const_child_range used_children() const
SourceLocation getThreadsetKindLoc() const
Returns location of clause kind.
SourceLocation getLParenLoc() const
Returns the location of '('.
OMPThreadsetClause()
Build an empty clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
This represents clauses with the list of variables like 'private', 'firstprivate',...
varlist_const_range varlist() const
friend class OMPClauseReader
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
ArrayRef< const Expr * > getVarRefs() const
Fetches list of all variables in the clause.
OMPVarListClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N)
Build a clause with N variables.
MutableArrayRef< Expr * > getVarRefs()
Fetches list of variables associated with this clause.
varlist_const_iterator varlist_end() const
varlist_iterator varlist_end()
llvm::iterator_range< varlist_const_iterator > varlist_const_range
MutableArrayRef< Expr * >::iterator varlist_iterator
varlist_iterator varlist_begin()
ArrayRef< const Expr * >::iterator varlist_const_iterator
SourceLocation getLParenLoc() const
Returns the location of '('.
bool varlist_empty() const
unsigned varlist_size() const
varlist_const_iterator varlist_begin() const
llvm::iterator_range< varlist_iterator > varlist_range
void setVarRefs(ArrayRef< Expr * > VL)
Sets the list of variables for this clause.
Encodes a location in the source.
Stmt - This represents one statement.
The JSON file list parser is used to communicate input to InstallAPI.
OpenMPOriginalSharingModifier
OpenMP 6.0 original sharing modifiers.
ArrayRef< const Expr * >::iterator used_expressions_const_iterator
bool checkFailClauseParameter(OpenMPClauseKind FailClauseParameter)
Checks if the parameter to the fail clause in "#pragma atomic compare fail" is restricted only to mem...
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
llvm::iterator_range< inits_iterator > inits_range
privates_range privates()
OpenMPDefaultClauseVariableCategory
OpenMP variable-category for 'default' clause.
MutableArrayRef< Expr * >::iterator privates_iterator
llvm::iterator_range< finals_const_iterator > finals_const_range
MutableArrayRef< Expr * > getPrivates()
Finals[]; Step; CalcStep; }.
void setColonLoc(SourceLocation Loc)
Sets the location of ':'.
MutableArrayRef< Expr * >::iterator inits_iterator
OpenMPLinearClauseKind getModifier() const
Return modifier.
llvm::iterator_range< privates_const_iterator > privates_const_range
void setUsedExprs(ArrayRef< Expr * > UE)
Sets the list of used expressions for the linear clause.
OpenMPAtClauseKind
OpenMP attributes for 'at' clause.
OpenMPReductionClauseModifier
OpenMP modifiers for 'reduction' clause.
void setUpdates(ArrayRef< Expr * > UL)
Sets the list of update expressions for linear variables.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
@ OMPC_SCHEDULE_MODIFIER_unknown
llvm::iterator_range< inits_const_iterator > inits_const_range
llvm::iterator_range< updates_iterator > updates_range
llvm::iterator_range< used_expressions_iterator > used_expressions_range
MutableArrayRef< Expr * >::iterator updates_iterator
SourceLocation getStepModifierLoc() const
Returns the location of 'step' modifier.
const FunctionProtoType * T
OpenMPLastprivateModifier
OpenMP 'lastprivate' clause modifier.
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Expr * getStep()
Returns linear step.
ArrayRef< const Expr * >::iterator updates_const_iterator
child_range used_children()
llvm::iterator_range< privates_iterator > privates_range
OpenMPSeverityClauseKind
OpenMP attributes for 'severity' clause.
void setPrivates(ArrayRef< Expr * > PL)
Sets the list of the copies of original linear variables.
MutableArrayRef< Expr * > getUsedExprs()
Gets the list of used expressions for linear variables.
MutableArrayRef< Expr * >::iterator used_expressions_iterator
void setInits(ArrayRef< Expr * > IL)
Sets the list of the initial values for linear variables.
OpenMPAllocateClauseModifier
OpenMP modifiers for 'allocate' clause.
void setModifierLoc(SourceLocation Loc)
Set modifier location.
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
void setStepModifierLoc(SourceLocation Loc)
Sets the location of 'step' modifier.
SourceLocation getColonLoc() const
Returns the location of ':'.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
void setFinals(ArrayRef< Expr * > FL)
Sets the list of final update expressions for linear variables.
void setModifier(OpenMPLinearClauseKind Kind)
Set modifier.
SourceLocation getModifierLoc() const
Return modifier location.
llvm::iterator_range< used_expressions_const_iterator > used_expressions_const_range
MutableArrayRef< Expr * > getInits()
OpenMPNumThreadsClauseModifier
@ OMPC_NUMTHREADS_unknown
ArrayRef< const Expr * >::iterator privates_const_iterator
OpenMPAtomicDefaultMemOrderClauseKind
OpenMP attributes for 'atomic_default_mem_order' clause.
@ OMPC_ATOMIC_DEFAULT_MEM_ORDER_unknown
ArrayRef< const Expr * >::iterator finals_const_iterator
MutableArrayRef< Expr * >::iterator finals_iterator
ArrayRef< const Expr * >::iterator inits_const_iterator
used_expressions_range used_expressions()
Expr * getCalcStep()
Returns expression to calculate linear step.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ConceptReference *C)
Insertion operator for diagnostics.
OpenMPMapModifierKind
OpenMP modifier kind for 'map' clause.
@ OMPC_MAP_MODIFIER_unknown
llvm::omp::Clause OpenMPClauseKind
OpenMP clauses.
llvm::iterator_range< updates_const_iterator > updates_const_range
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
llvm::iterator_range< finals_iterator > finals_range
OpenMPThreadsetKind
OpenMP modifiers for 'threadset' clause.
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
Diagnostic wrappers for TextAPI types for error reporting.
int const char * function
OpenMPDependClauseKind DepKind
Dependency type (one of in, out, inout).
SourceLocation DepLoc
Dependency type location.
SourceLocation ColonLoc
Colon location.
SourceLocation OmpAllMemoryLoc
Location of 'omp_all_memory'.
ArrayRef< Expr * > Attrs
attr() string-literal expressions. Empty for fr-only or OMP 5.1 flat specs.
Expr * Fr
Foreign-runtime-id expression. Null for attr-only specs.
This structure contains all sizes needed for by an OMPMappableExprListClause.
OMPMappableExprListSizeTy(unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
OMPMappableExprListSizeTy()=default
unsigned NumComponents
Total number of expression components.
unsigned NumUniqueDeclarations
Number of unique base declarations.
unsigned NumVars
Number of expressions listed.
unsigned NumComponentLists
Number of component lists.
llvm::omp::TraitProperty Kind
StringRef RawString
The raw string as we parsed it. This is needed for the isa trait set (which accepts anything) and (la...
llvm::omp::TraitSelector Kind
SmallVector< OMPTraitProperty, 1 > Properties
SmallVector< OMPTraitSelector, 2 > Selectors
Data for list of allocators.
Expr * AllocatorTraits
Allocator traits.
Expr * Allocator
Allocator.
SourceLocation LParenLoc
Locations of '(' and ')' symbols.
TargetOMPContext(ASTContext &ASTCtx, std::function< void(StringRef)> &&DiagUnknownTrait, const FunctionDecl *CurrentFunctionDecl, ArrayRef< llvm::omp::TraitProperty > ConstructTraits, int DeviceNum)
bool matchesISATrait(StringRef RawString) const override
See llvm::omp::OMPContext::matchesISATrait.
virtual ~TargetOMPContext()=default
const_child_range used_children() const
static bool classof(const OMPClause *T)
OMPNoChildClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'ClauseKind' clause.
child_range used_children()
OMPNoChildClause()
Build an empty clause.
const_child_range children() const
SourceLocation StartLoc
Starting location of the clause (the clause keyword).
SourceLocation LParenLoc
Location of '('.
SourceLocation EndLoc
Ending location of the clause.
OMPVarListLocTy()=default
OMPVarListLocTy(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)