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;
2978class OMPUpdateClause final
2980 private llvm::TrailingObjects<OMPUpdateClause, SourceLocation,
2981 OpenMPDependClauseKind> {
2982 friend class OMPClauseReader;
2983 friend TrailingObjects;
2986 bool IsExtended =
false;
2990 size_t numTrailingObjects(OverloadToken<SourceLocation>)
const {
2992 return IsExtended ? 2 : 0;
2996 void setLParenLoc(SourceLocation Loc) {
2997 assert(IsExtended &&
"Expected extended clause.");
2998 *getTrailingObjects<SourceLocation>() = Loc;
3002 void setArgumentLoc(SourceLocation Loc) {
3003 assert(IsExtended &&
"Expected extended clause.");
3004 *std::next(getTrailingObjects<SourceLocation>(), 1) = Loc;
3008 void setDependencyKind(OpenMPDependClauseKind DK) {
3009 assert(IsExtended &&
"Expected extended clause.");
3010 *getTrailingObjects<OpenMPDependClauseKind>() = DK;
3017 OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc,
3019 : OMPClause(llvm::omp::OMPC_update, StartLoc, EndLoc),
3020 IsExtended(IsExtended) {}
3023 OMPUpdateClause(
bool IsExtended)
3024 : OMPClause(llvm::omp::OMPC_update, SourceLocation(), SourceLocation()),
3025 IsExtended(IsExtended) {}
3033 static OMPUpdateClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
3034 SourceLocation EndLoc);
3044 static OMPUpdateClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
3045 SourceLocation LParenLoc,
3046 SourceLocation ArgumentLoc,
3047 OpenMPDependClauseKind DK,
3048 SourceLocation EndLoc);
3055 static OMPUpdateClause *
CreateEmpty(
const ASTContext &C,
bool IsExtended);
3058 bool isExtended()
const {
return IsExtended; }
3061 return child_range(child_iterator(), child_iterator());
3064 const_child_range
children()
const {
3065 return const_child_range(const_child_iterator(), const_child_iterator());
3069 return child_range(child_iterator(), child_iterator());
3072 return const_child_range(const_child_iterator(), const_child_iterator());
3076 SourceLocation getLParenLoc()
const {
3077 assert(IsExtended &&
"Expected extended clause.");
3078 return *getTrailingObjects<SourceLocation>();
3082 SourceLocation getArgumentLoc()
const {
3083 assert(IsExtended &&
"Expected extended clause.");
3084 return *std::next(getTrailingObjects<SourceLocation>(), 1);
3089 assert(IsExtended &&
"Expected extended clause.");
3090 return *getTrailingObjects<OpenMPDependClauseKind>();
3093 static bool classof(
const OMPClause *T) {
3094 return T->getClauseKind() == llvm::omp::OMPC_update;
3105class OMPCaptureClause :
public OMPClause {
3111 OMPCaptureClause(SourceLocation StartLoc, SourceLocation EndLoc)
3112 : OMPClause(llvm::omp::OMPC_capture, StartLoc, EndLoc) {}
3116 : OMPClause(llvm::omp::OMPC_capture, SourceLocation(), SourceLocation()) {
3120 return child_range(child_iterator(), child_iterator());
3123 const_child_range
children()
const {
3124 return const_child_range(const_child_iterator(), const_child_iterator());
3128 return child_range(child_iterator(), child_iterator());
3131 return const_child_range(const_child_iterator(), const_child_iterator());
3134 static bool classof(
const OMPClause *T) {
3135 return T->getClauseKind() == llvm::omp::OMPC_capture;
3146class OMPCompareClause final :
public OMPClause {
3152 OMPCompareClause(SourceLocation StartLoc, SourceLocation EndLoc)
3153 : OMPClause(llvm::omp::OMPC_compare, StartLoc, EndLoc) {}
3157 : OMPClause(llvm::omp::OMPC_compare, SourceLocation(), SourceLocation()) {
3161 return child_range(child_iterator(), child_iterator());
3164 const_child_range
children()
const {
3165 return const_child_range(const_child_iterator(), const_child_iterator());
3169 return child_range(child_iterator(), child_iterator());
3172 return const_child_range(const_child_iterator(), const_child_iterator());
3175 static bool classof(
const OMPClause *T) {
3176 return T->getClauseKind() == llvm::omp::OMPC_compare;
3187class OMPSeqCstClause :
public OMPClause {
3193 OMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc)
3194 : OMPClause(llvm::omp::OMPC_seq_cst, StartLoc, EndLoc) {}
3198 : OMPClause(llvm::omp::OMPC_seq_cst, SourceLocation(), SourceLocation()) {
3202 return child_range(child_iterator(), child_iterator());
3205 const_child_range
children()
const {
3206 return const_child_range(const_child_iterator(), const_child_iterator());
3210 return child_range(child_iterator(), child_iterator());
3213 return const_child_range(const_child_iterator(), const_child_iterator());
3216 static bool classof(
const OMPClause *T) {
3217 return T->getClauseKind() == llvm::omp::OMPC_seq_cst;
3228class OMPAcqRelClause final :
public OMPClause {
3234 OMPAcqRelClause(SourceLocation StartLoc, SourceLocation EndLoc)
3235 : OMPClause(llvm::omp::OMPC_acq_rel, StartLoc, EndLoc) {}
3239 : OMPClause(llvm::omp::OMPC_acq_rel, SourceLocation(), SourceLocation()) {
3243 return child_range(child_iterator(), child_iterator());
3246 const_child_range
children()
const {
3247 return const_child_range(const_child_iterator(), const_child_iterator());
3251 return child_range(child_iterator(), child_iterator());
3254 return const_child_range(const_child_iterator(), const_child_iterator());
3257 static bool classof(
const OMPClause *T) {
3258 return T->getClauseKind() == llvm::omp::OMPC_acq_rel;
3269class OMPAcquireClause final :
public OMPClause {
3275 OMPAcquireClause(SourceLocation StartLoc, SourceLocation EndLoc)
3276 : OMPClause(llvm::omp::OMPC_acquire, StartLoc, EndLoc) {}
3280 : OMPClause(llvm::omp::OMPC_acquire, SourceLocation(), SourceLocation()) {
3284 return child_range(child_iterator(), child_iterator());
3287 const_child_range
children()
const {
3288 return const_child_range(const_child_iterator(), const_child_iterator());
3292 return child_range(child_iterator(), child_iterator());
3295 return const_child_range(const_child_iterator(), const_child_iterator());
3298 static bool classof(
const OMPClause *T) {
3299 return T->getClauseKind() == llvm::omp::OMPC_acquire;
3310class OMPReleaseClause final :
public OMPClause {
3316 OMPReleaseClause(SourceLocation StartLoc, SourceLocation EndLoc)
3317 : OMPClause(llvm::omp::OMPC_release, StartLoc, EndLoc) {}
3321 : OMPClause(llvm::omp::OMPC_release, SourceLocation(), SourceLocation()) {
3325 return child_range(child_iterator(), child_iterator());
3328 const_child_range
children()
const {
3329 return const_child_range(const_child_iterator(), const_child_iterator());
3333 return child_range(child_iterator(), child_iterator());
3336 return const_child_range(const_child_iterator(), const_child_iterator());
3339 static bool classof(
const OMPClause *T) {
3340 return T->getClauseKind() == llvm::omp::OMPC_release;
3351class OMPRelaxedClause final :
public OMPClause {
3357 OMPRelaxedClause(SourceLocation StartLoc, SourceLocation EndLoc)
3358 : OMPClause(llvm::omp::OMPC_relaxed, StartLoc, EndLoc) {}
3362 : OMPClause(llvm::omp::OMPC_relaxed, SourceLocation(), SourceLocation()) {
3366 return child_range(child_iterator(), child_iterator());
3369 const_child_range
children()
const {
3370 return const_child_range(const_child_iterator(), const_child_iterator());
3374 return child_range(child_iterator(), child_iterator());
3377 return const_child_range(const_child_iterator(), const_child_iterator());
3380 static bool classof(
const OMPClause *T) {
3381 return T->getClauseKind() == llvm::omp::OMPC_relaxed;
3392class OMPWeakClause final :
public OMPClause {
3398 OMPWeakClause(SourceLocation StartLoc, SourceLocation EndLoc)
3399 : OMPClause(llvm::omp::OMPC_weak, StartLoc, EndLoc) {}
3403 : OMPClause(llvm::omp::OMPC_weak, SourceLocation(), SourceLocation()) {}
3406 return child_range(child_iterator(), child_iterator());
3409 const_child_range
children()
const {
3410 return const_child_range(const_child_iterator(), const_child_iterator());
3414 return child_range(child_iterator(), child_iterator());
3417 return const_child_range(const_child_iterator(), const_child_iterator());
3420 static bool classof(
const OMPClause *T) {
3421 return T->getClauseKind() == llvm::omp::OMPC_weak;
3432class OMPFailClause final :
public OMPClause {
3437 SourceLocation FailParameterLoc;
3438 SourceLocation LParenLoc;
3440 friend class OMPClauseReader;
3443 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
3446 void setFailParameterLoc(SourceLocation Loc) { FailParameterLoc = Loc; }
3449 void setFailParameter(OpenMPClauseKind FailParameter) {
3450 this->FailParameter = FailParameter;
3452 "Invalid fail clause parameter");
3460 OMPFailClause(SourceLocation StartLoc, SourceLocation EndLoc)
3461 : OMPClause(llvm::omp::OMPC_fail, StartLoc, EndLoc) {}
3463 OMPFailClause(OpenMPClauseKind FailParameter, SourceLocation FailParameterLoc,
3464 SourceLocation StartLoc, SourceLocation LParenLoc,
3465 SourceLocation EndLoc)
3466 : OMPClause(llvm::omp::OMPC_fail, StartLoc, EndLoc),
3467 FailParameterLoc(FailParameterLoc), LParenLoc(LParenLoc) {
3469 setFailParameter(FailParameter);
3474 : OMPClause(llvm::omp::OMPC_fail, SourceLocation(), SourceLocation()) {}
3477 return child_range(child_iterator(), child_iterator());
3480 const_child_range
children()
const {
3481 return const_child_range(const_child_iterator(), const_child_iterator());
3485 return child_range(child_iterator(), child_iterator());
3488 return const_child_range(const_child_iterator(), const_child_iterator());
3491 static bool classof(
const OMPClause *T) {
3492 return T->getClauseKind() == llvm::omp::OMPC_fail;
3496 SourceLocation getLParenLoc()
const {
3502 SourceLocation getFailParameterLoc()
const {
return FailParameterLoc; }
3515class OMPPrivateClause final
3517 private llvm::TrailingObjects<OMPPrivateClause, Expr *> {
3518 friend class OMPClauseReader;
3519 friend OMPVarListClause;
3520 friend TrailingObjects;
3528 OMPPrivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3529 SourceLocation EndLoc,
unsigned N)
3530 : OMPVarListClause<OMPPrivateClause>(llvm::omp::OMPC_private, StartLoc,
3531 LParenLoc, EndLoc, N) {}
3536 explicit OMPPrivateClause(
unsigned N)
3537 : OMPVarListClause<OMPPrivateClause>(llvm::omp::OMPC_private,
3538 SourceLocation(), SourceLocation(),
3539 SourceLocation(), N) {}
3544 void setPrivateCopies(ArrayRef<Expr *> VL);
3548 MutableArrayRef<Expr *> getPrivateCopies() {
3549 return {varlist_end(), varlist_size()};
3551 ArrayRef<const Expr *> getPrivateCopies()
const {
3552 return {varlist_end(), varlist_size()};
3564 static OMPPrivateClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
3565 SourceLocation LParenLoc,
3566 SourceLocation EndLoc, ArrayRef<Expr *> VL,
3567 ArrayRef<Expr *> PrivateVL);
3573 static OMPPrivateClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
3575 using private_copies_iterator = MutableArrayRef<Expr *>::iterator;
3576 using private_copies_const_iterator = ArrayRef<const Expr *>::iterator;
3577 using private_copies_range = llvm::iterator_range<private_copies_iterator>;
3578 using private_copies_const_range =
3579 llvm::iterator_range<private_copies_const_iterator>;
3581 private_copies_range private_copies() {
return getPrivateCopies(); }
3583 private_copies_const_range private_copies()
const {
3584 return getPrivateCopies();
3588 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3589 reinterpret_cast<Stmt **
>(varlist_end()));
3592 const_child_range
children()
const {
3593 return const_cast<OMPPrivateClause *
>(
this)->
children();
3597 return child_range(child_iterator(), child_iterator());
3600 return const_child_range(const_child_iterator(), const_child_iterator());
3603 static bool classof(
const OMPClause *T) {
3604 return T->getClauseKind() == llvm::omp::OMPC_private;
3616class OMPFirstprivateClause final
3619 private llvm::TrailingObjects<OMPFirstprivateClause, Expr *> {
3620 friend class OMPClauseReader;
3621 friend OMPVarListClause;
3622 friend TrailingObjects;
3630 OMPFirstprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3631 SourceLocation EndLoc,
unsigned N)
3632 : OMPVarListClause<OMPFirstprivateClause>(llvm::omp::OMPC_firstprivate,
3633 StartLoc, LParenLoc, EndLoc, N),
3634 OMPClauseWithPreInit(this) {}
3639 explicit OMPFirstprivateClause(
unsigned N)
3640 : OMPVarListClause<OMPFirstprivateClause>(
3641 llvm::omp::OMPC_firstprivate, SourceLocation(), SourceLocation(),
3642 SourceLocation(), N),
3643 OMPClauseWithPreInit(this) {}
3648 void setPrivateCopies(ArrayRef<Expr *> VL);
3652 MutableArrayRef<Expr *> getPrivateCopies() {
3653 return {varlist_end(), varlist_size()};
3655 ArrayRef<const Expr *> getPrivateCopies()
const {
3656 return {varlist_end(), varlist_size()};
3662 void setInits(ArrayRef<Expr *> VL);
3666 MutableArrayRef<Expr *>
getInits() {
3667 return {getPrivateCopies().end(), varlist_size()};
3669 ArrayRef<const Expr *>
getInits()
const {
3670 return {getPrivateCopies().end(), varlist_size()};
3687 static OMPFirstprivateClause *
3688 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
3689 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PrivateVL,
3690 ArrayRef<Expr *> InitVL, Stmt *PreInit);
3696 static OMPFirstprivateClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
3698 using private_copies_iterator = MutableArrayRef<Expr *>::iterator;
3699 using private_copies_const_iterator = ArrayRef<const Expr *>::iterator;
3700 using private_copies_range = llvm::iterator_range<private_copies_iterator>;
3701 using private_copies_const_range =
3702 llvm::iterator_range<private_copies_const_iterator>;
3704 private_copies_range private_copies() {
return getPrivateCopies(); }
3705 private_copies_const_range private_copies()
const {
3706 return getPrivateCopies();
3711 using inits_range = llvm::iterator_range<inits_iterator>;
3718 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3719 reinterpret_cast<Stmt **
>(varlist_end()));
3722 const_child_range
children()
const {
3723 return const_cast<OMPFirstprivateClause *
>(
this)->
children();
3727 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3728 reinterpret_cast<Stmt **
>(varlist_end()));
3731 return const_cast<OMPFirstprivateClause *
>(
this)->
used_children();
3734 static bool classof(
const OMPClause *T) {
3735 return T->getClauseKind() == llvm::omp::OMPC_firstprivate;
3747class OMPLastprivateClause final
3750 private llvm::TrailingObjects<OMPLastprivateClause, Expr *> {
3767 friend class OMPClauseReader;
3768 friend OMPVarListClause;
3769 friend TrailingObjects;
3774 SourceLocation LPKindLoc;
3776 SourceLocation ColonLoc;
3784 OMPLastprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3785 SourceLocation EndLoc, OpenMPLastprivateModifier LPKind,
3786 SourceLocation LPKindLoc, SourceLocation ColonLoc,
3788 : OMPVarListClause<OMPLastprivateClause>(llvm::omp::OMPC_lastprivate,
3789 StartLoc, LParenLoc, EndLoc, N),
3790 OMPClauseWithPostUpdate(this), LPKind(LPKind), LPKindLoc(LPKindLoc),
3791 ColonLoc(ColonLoc) {}
3796 explicit OMPLastprivateClause(
unsigned N)
3797 : OMPVarListClause<OMPLastprivateClause>(
3798 llvm::omp::OMPC_lastprivate, SourceLocation(), SourceLocation(),
3799 SourceLocation(), N),
3800 OMPClauseWithPostUpdate(this) {}
3804 MutableArrayRef<Expr *> getPrivateCopies() {
3805 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
3807 ArrayRef<const Expr *> getPrivateCopies()
const {
3808 return {varlist_end(), varlist_size()};
3815 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
3818 MutableArrayRef<Expr *> getSourceExprs() {
3819 return {getPrivateCopies().end(), varlist_size()};
3821 ArrayRef<const Expr *> getSourceExprs()
const {
3822 return {getPrivateCopies().end(), varlist_size()};
3829 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
3832 MutableArrayRef<Expr *> getDestinationExprs() {
3833 return {getSourceExprs().end(), varlist_size()};
3835 ArrayRef<const Expr *> getDestinationExprs()
const {
3836 return {getSourceExprs().end(), varlist_size()};
3842 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
3845 MutableArrayRef<Expr *> getAssignmentOps() {
3846 return {getDestinationExprs().end(), varlist_size()};
3848 ArrayRef<const Expr *> getAssignmentOps()
const {
3849 return {getDestinationExprs().end(), varlist_size()};
3853 void setKind(OpenMPLastprivateModifier Kind) { LPKind =
Kind; }
3855 void setKindLoc(SourceLocation Loc) { LPKindLoc = Loc; }
3857 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
3887 static OMPLastprivateClause *
3888 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
3889 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
3890 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps,
3891 OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc,
3892 SourceLocation ColonLoc, Stmt *PreInit, Expr *PostUpdate);
3898 static OMPLastprivateClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
3903 SourceLocation getKindLoc()
const {
return LPKindLoc; }
3905 SourceLocation
getColonLoc()
const {
return ColonLoc; }
3907 using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
3908 using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
3909 using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
3910 using helper_expr_const_range =
3911 llvm::iterator_range<helper_expr_const_iterator>;
3915 void setPrivateCopies(ArrayRef<Expr *> PrivateCopies);
3917 helper_expr_const_range private_copies()
const {
return getPrivateCopies(); }
3919 helper_expr_range private_copies() {
return getPrivateCopies(); }
3921 helper_expr_const_range source_exprs()
const {
return getSourceExprs(); }
3923 helper_expr_range source_exprs() {
return getSourceExprs(); }
3925 helper_expr_const_range destination_exprs()
const {
3926 return getDestinationExprs();
3929 helper_expr_range destination_exprs() {
return getDestinationExprs(); }
3931 helper_expr_const_range assignment_ops()
const {
return getAssignmentOps(); }
3933 helper_expr_range assignment_ops() {
return getAssignmentOps(); }
3936 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3937 reinterpret_cast<Stmt **
>(varlist_end()));
3940 const_child_range
children()
const {
3941 return const_cast<OMPLastprivateClause *
>(
this)->
children();
3945 return child_range(child_iterator(), child_iterator());
3948 return const_child_range(const_child_iterator(), const_child_iterator());
3951 static bool classof(
const OMPClause *T) {
3952 return T->getClauseKind() == llvm::omp::OMPC_lastprivate;
3963class OMPSharedClause final
3965 private llvm::TrailingObjects<OMPSharedClause, Expr *> {
3966 friend OMPVarListClause;
3967 friend TrailingObjects;
3975 OMPSharedClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3976 SourceLocation EndLoc,
unsigned N)
3977 : OMPVarListClause<OMPSharedClause>(llvm::omp::OMPC_shared, StartLoc,
3978 LParenLoc, EndLoc, N) {}
3983 explicit OMPSharedClause(
unsigned N)
3984 : OMPVarListClause<OMPSharedClause>(llvm::omp::OMPC_shared,
3985 SourceLocation(), SourceLocation(),
3986 SourceLocation(), N) {}
3996 static OMPSharedClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
3997 SourceLocation LParenLoc,
3998 SourceLocation EndLoc, ArrayRef<Expr *> VL);
4004 static OMPSharedClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
4007 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4008 reinterpret_cast<Stmt **
>(varlist_end()));
4011 const_child_range
children()
const {
4012 return const_cast<OMPSharedClause *
>(
this)->
children();
4016 return child_range(child_iterator(), child_iterator());
4019 return const_child_range(const_child_iterator(), const_child_iterator());
4022 static bool classof(
const OMPClause *T) {
4023 return T->getClauseKind() == llvm::omp::OMPC_shared;
4035class OMPReductionClause final
4038 private llvm::TrailingObjects<OMPReductionClause, Expr *, bool> {
4039 friend class OMPClauseReader;
4040 friend OMPVarListClause;
4041 friend TrailingObjects;
4048 OMPC_ORIGINAL_SHARING_default;
4051 SourceLocation ModifierLoc;
4054 SourceLocation ColonLoc;
4057 NestedNameSpecifierLoc QualifierLoc;
4060 DeclarationNameInfo NameInfo;
4072 OMPReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4073 SourceLocation ModifierLoc, SourceLocation ColonLoc,
4074 SourceLocation EndLoc,
4075 OpenMPReductionClauseModifier Modifier,
4076 OpenMPOriginalSharingModifier OriginalSharingModifier,
4077 unsigned N, NestedNameSpecifierLoc QualifierLoc,
4078 const DeclarationNameInfo &NameInfo)
4079 : OMPVarListClause<OMPReductionClause>(llvm::omp::OMPC_reduction,
4080 StartLoc, LParenLoc, EndLoc, N),
4081 OMPClauseWithPostUpdate(this), Modifier(Modifier),
4082 OriginalSharingModifier(OriginalSharingModifier),
4083 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc),
4084 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
4089 explicit OMPReductionClause(
unsigned N)
4090 : OMPVarListClause<OMPReductionClause>(llvm::omp::OMPC_reduction,
4091 SourceLocation(), SourceLocation(),
4092 SourceLocation(), N),
4093 OMPClauseWithPostUpdate(this) {}
4096 void setModifier(OpenMPReductionClauseModifier M) { Modifier = M; }
4099 void setOriginalSharingModifier(OpenMPOriginalSharingModifier M) {
4100 OriginalSharingModifier = M;
4107 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
4110 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
4113 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
4122 return {varlist_end(), varlist_size()};
4125 return {varlist_end(), varlist_size()};
4131 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
4134 MutableArrayRef<Expr *> getLHSExprs() {
4137 ArrayRef<const Expr *> getLHSExprs()
const {
4146 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
4149 void setPrivateVariableReductionFlags(ArrayRef<bool> Flags) {
4150 assert(Flags.size() == varlist_size() &&
4151 "Number of private flags does not match vars");
4152 llvm::copy(Flags, getTrailingObjects<bool>());
4156 MutableArrayRef<bool> getPrivateVariableReductionFlags() {
4157 return getTrailingObjects<bool>(varlist_size());
4159 ArrayRef<bool> getPrivateVariableReductionFlags()
const {
4160 return getTrailingObjects<bool>(varlist_size());
4164 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4165 return varlist_size() * (Modifier == OMPC_REDUCTION_inscan ? 8 : 5);
4169 size_t numTrailingObjects(OverloadToken<bool>)
const {
4170 return varlist_size();
4174 MutableArrayRef<Expr *> getRHSExprs() {
4175 return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
4177 ArrayRef<const Expr *> getRHSExprs()
const {
4178 return {getLHSExprs().end(), varlist_size()};
4185 void setReductionOps(ArrayRef<Expr *> ReductionOps);
4188 MutableArrayRef<Expr *> getReductionOps() {
4189 return {getRHSExprs().end(), varlist_size()};
4191 ArrayRef<const Expr *> getReductionOps()
const {
4192 return {getRHSExprs().end(), varlist_size()};
4197 void setInscanCopyOps(ArrayRef<Expr *> Ops);
4200 MutableArrayRef<Expr *> getInscanCopyOps() {
4201 return {getReductionOps().end(), varlist_size()};
4203 ArrayRef<const Expr *> getInscanCopyOps()
const {
4204 return {getReductionOps().end(), varlist_size()};
4208 void setInscanCopyArrayTemps(ArrayRef<Expr *> CopyArrayTemps);
4211 MutableArrayRef<Expr *> getInscanCopyArrayTemps() {
4212 return {getInscanCopyOps().end(), varlist_size()};
4214 ArrayRef<const Expr *> getInscanCopyArrayTemps()
const {
4215 return {getInscanCopyOps().end(), varlist_size()};
4219 void setInscanCopyArrayElems(ArrayRef<Expr *> CopyArrayElems);
4222 MutableArrayRef<Expr *> getInscanCopyArrayElems() {
4223 return {getInscanCopyArrayTemps().end(), varlist_size()};
4225 ArrayRef<const Expr *> getInscanCopyArrayElems()
const {
4226 return {getInscanCopyArrayTemps().end(), varlist_size()};
4270 static OMPReductionClause *
4271 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
4272 SourceLocation ModifierLoc, SourceLocation ColonLoc,
4273 SourceLocation EndLoc, OpenMPReductionClauseModifier Modifier,
4274 ArrayRef<Expr *> VL, NestedNameSpecifierLoc QualifierLoc,
4275 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
4276 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
4277 ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> CopyOps,
4278 ArrayRef<Expr *> CopyArrayTemps, ArrayRef<Expr *> CopyArrayElems,
4279 Stmt *PreInit, Expr *PostUpdate, ArrayRef<bool> IsPrivateVarReduction,
4280 OpenMPOriginalSharingModifier OriginalSharingModifier);
4287 static OMPReductionClause *
4289 OpenMPReductionClauseModifier Modifier);
4296 return OriginalSharingModifier;
4303 SourceLocation
getColonLoc()
const {
return ColonLoc; }
4306 const DeclarationNameInfo &getNameInfo()
const {
return NameInfo; }
4309 NestedNameSpecifierLoc getQualifierLoc()
const {
return QualifierLoc; }
4311 using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
4312 using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
4313 using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
4314 using helper_expr_const_range =
4315 llvm::iterator_range<helper_expr_const_iterator>;
4316 using helper_flag_iterator = MutableArrayRef<bool>::iterator;
4317 using helper_flag_const_iterator = ArrayRef<bool>::iterator;
4318 using helper_flag_range = llvm::iterator_range<helper_flag_iterator>;
4319 using helper_flag_const_range =
4320 llvm::iterator_range<helper_flag_const_iterator>;
4326 helper_expr_const_range lhs_exprs()
const {
return getLHSExprs(); }
4328 helper_expr_range lhs_exprs() {
return getLHSExprs(); }
4330 helper_expr_const_range rhs_exprs()
const {
return getRHSExprs(); }
4332 helper_expr_range rhs_exprs() {
return getRHSExprs(); }
4334 helper_flag_const_range private_var_reduction_flags()
const {
4335 return getPrivateVariableReductionFlags();
4338 helper_flag_range private_var_reduction_flags() {
4339 return getPrivateVariableReductionFlags();
4342 helper_expr_const_range reduction_ops()
const {
return getReductionOps(); }
4344 helper_expr_range reduction_ops() {
return getReductionOps(); }
4346 helper_expr_const_range copy_ops()
const {
return getInscanCopyOps(); }
4348 helper_expr_range copy_ops() {
return getInscanCopyOps(); }
4350 helper_expr_const_range copy_array_temps()
const {
4351 return getInscanCopyArrayTemps();
4354 helper_expr_range copy_array_temps() {
return getInscanCopyArrayTemps(); }
4356 helper_expr_const_range copy_array_elems()
const {
4357 return getInscanCopyArrayElems();
4360 helper_expr_range copy_array_elems() {
return getInscanCopyArrayElems(); }
4363 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4364 reinterpret_cast<Stmt **
>(varlist_end()));
4367 const_child_range
children()
const {
4368 return const_cast<OMPReductionClause *
>(
this)->
children();
4372 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4373 reinterpret_cast<Stmt **
>(varlist_end()));
4376 return const_cast<OMPReductionClause *
>(
this)->
used_children();
4379 static bool classof(
const OMPClause *T) {
4380 return T->getClauseKind() == llvm::omp::OMPC_reduction;
4392class OMPTaskReductionClause final
4395 private llvm::TrailingObjects<OMPTaskReductionClause, Expr *> {
4396 friend class OMPClauseReader;
4397 friend OMPVarListClause;
4398 friend TrailingObjects;
4401 SourceLocation ColonLoc;
4404 NestedNameSpecifierLoc QualifierLoc;
4407 DeclarationNameInfo NameInfo;
4418 OMPTaskReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4419 SourceLocation ColonLoc, SourceLocation EndLoc,
4420 unsigned N, NestedNameSpecifierLoc QualifierLoc,
4421 const DeclarationNameInfo &NameInfo)
4422 : OMPVarListClause<OMPTaskReductionClause>(
4423 llvm::omp::OMPC_task_reduction, StartLoc, LParenLoc, EndLoc, N),
4424 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
4425 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
4430 explicit OMPTaskReductionClause(
unsigned N)
4431 : OMPVarListClause<OMPTaskReductionClause>(
4432 llvm::omp::OMPC_task_reduction, SourceLocation(), SourceLocation(),
4433 SourceLocation(), N),
4434 OMPClauseWithPostUpdate(this) {}
4437 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
4440 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
4443 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
4451 return {varlist_end(), varlist_size()};
4454 return {varlist_end(), varlist_size()};
4460 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
4463 MutableArrayRef<Expr *> getLHSExprs() {
4466 ArrayRef<const Expr *> getLHSExprs()
const {
4474 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
4477 MutableArrayRef<Expr *> getRHSExprs() {
4478 return {getLHSExprs().end(), varlist_size()};
4480 ArrayRef<const Expr *> getRHSExprs()
const {
4481 return {getLHSExprs().end(), varlist_size()};
4488 void setReductionOps(ArrayRef<Expr *> ReductionOps);
4491 MutableArrayRef<Expr *> getReductionOps() {
4492 return {getRHSExprs().end(), varlist_size()};
4494 ArrayRef<const Expr *> getReductionOps()
const {
4495 return {getRHSExprs().end(), varlist_size()};
4531 static OMPTaskReductionClause *
4532 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
4533 SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
4534 NestedNameSpecifierLoc QualifierLoc,
4535 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
4536 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
4537 ArrayRef<Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate);
4543 static OMPTaskReductionClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
4546 SourceLocation
getColonLoc()
const {
return ColonLoc; }
4549 const DeclarationNameInfo &getNameInfo()
const {
return NameInfo; }
4552 NestedNameSpecifierLoc getQualifierLoc()
const {
return QualifierLoc; }
4554 using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
4555 using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
4556 using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
4557 using helper_expr_const_range =
4558 llvm::iterator_range<helper_expr_const_iterator>;
4564 helper_expr_const_range lhs_exprs()
const {
return getLHSExprs(); }
4566 helper_expr_range lhs_exprs() {
return getLHSExprs(); }
4568 helper_expr_const_range rhs_exprs()
const {
return getRHSExprs(); }
4570 helper_expr_range rhs_exprs() {
return getRHSExprs(); }
4572 helper_expr_const_range reduction_ops()
const {
return getReductionOps(); }
4574 helper_expr_range reduction_ops() {
return getReductionOps(); }
4577 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4578 reinterpret_cast<Stmt **
>(varlist_end()));
4581 const_child_range
children()
const {
4582 return const_cast<OMPTaskReductionClause *
>(
this)->
children();
4586 return child_range(child_iterator(), child_iterator());
4589 return const_child_range(const_child_iterator(), const_child_iterator());
4592 static bool classof(
const OMPClause *T) {
4593 return T->getClauseKind() == llvm::omp::OMPC_task_reduction;
4604class OMPInReductionClause final
4607 private llvm::TrailingObjects<OMPInReductionClause, Expr *> {
4608 friend class OMPClauseReader;
4609 friend OMPVarListClause;
4610 friend TrailingObjects;
4613 SourceLocation ColonLoc;
4616 NestedNameSpecifierLoc QualifierLoc;
4619 DeclarationNameInfo NameInfo;
4630 OMPInReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4631 SourceLocation ColonLoc, SourceLocation EndLoc,
4632 unsigned N, NestedNameSpecifierLoc QualifierLoc,
4633 const DeclarationNameInfo &NameInfo)
4634 : OMPVarListClause<OMPInReductionClause>(llvm::omp::OMPC_in_reduction,
4635 StartLoc, LParenLoc, EndLoc, N),
4636 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
4637 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
4642 explicit OMPInReductionClause(
unsigned N)
4643 : OMPVarListClause<OMPInReductionClause>(
4644 llvm::omp::OMPC_in_reduction, SourceLocation(), SourceLocation(),
4645 SourceLocation(), N),
4646 OMPClauseWithPostUpdate(this) {}
4649 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
4652 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
4655 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
4663 return {varlist_end(), varlist_size()};
4666 return {varlist_end(), varlist_size()};
4672 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
4675 MutableArrayRef<Expr *> getLHSExprs() {
4678 ArrayRef<const Expr *> getLHSExprs()
const {
4686 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
4689 MutableArrayRef<Expr *> getRHSExprs() {
4690 return {getLHSExprs().end(), varlist_size()};
4692 ArrayRef<const Expr *> getRHSExprs()
const {
4693 return {getLHSExprs().end(), varlist_size()};
4700 void setReductionOps(ArrayRef<Expr *> ReductionOps);
4703 MutableArrayRef<Expr *> getReductionOps() {
4704 return {getRHSExprs().end(), varlist_size()};
4706 ArrayRef<const Expr *> getReductionOps()
const {
4707 return {getRHSExprs().end(), varlist_size()};
4711 void setTaskgroupDescriptors(ArrayRef<Expr *> ReductionOps);
4714 MutableArrayRef<Expr *> getTaskgroupDescriptors() {
4715 return {getReductionOps().end(), varlist_size()};
4717 ArrayRef<const Expr *> getTaskgroupDescriptors()
const {
4718 return {getReductionOps().end(), varlist_size()};
4756 static OMPInReductionClause *
4757 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
4758 SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
4759 NestedNameSpecifierLoc QualifierLoc,
4760 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
4761 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
4762 ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> TaskgroupDescriptors,
4763 Stmt *PreInit, Expr *PostUpdate);
4769 static OMPInReductionClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
4772 SourceLocation
getColonLoc()
const {
return ColonLoc; }
4775 const DeclarationNameInfo &getNameInfo()
const {
return NameInfo; }
4778 NestedNameSpecifierLoc getQualifierLoc()
const {
return QualifierLoc; }
4780 using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
4781 using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
4782 using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
4783 using helper_expr_const_range =
4784 llvm::iterator_range<helper_expr_const_iterator>;
4790 helper_expr_const_range lhs_exprs()
const {
return getLHSExprs(); }
4792 helper_expr_range lhs_exprs() {
return getLHSExprs(); }
4794 helper_expr_const_range rhs_exprs()
const {
return getRHSExprs(); }
4796 helper_expr_range rhs_exprs() {
return getRHSExprs(); }
4798 helper_expr_const_range reduction_ops()
const {
return getReductionOps(); }
4800 helper_expr_range reduction_ops() {
return getReductionOps(); }
4802 helper_expr_const_range taskgroup_descriptors()
const {
4803 return getTaskgroupDescriptors();
4806 helper_expr_range taskgroup_descriptors() {
4807 return getTaskgroupDescriptors();
4811 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4812 reinterpret_cast<Stmt **
>(varlist_end()));
4815 const_child_range
children()
const {
4816 return const_cast<OMPInReductionClause *
>(
this)->
children();
4820 return child_range(child_iterator(), child_iterator());
4823 return const_child_range(const_child_iterator(), const_child_iterator());
4826 static bool classof(
const OMPClause *T) {
4827 return T->getClauseKind() == llvm::omp::OMPC_in_reduction;
4839class OMPLinearClause final
4842 private llvm::TrailingObjects<OMPLinearClause, Expr *> {
4843 friend class OMPClauseReader;
4844 friend OMPVarListClause;
4845 friend TrailingObjects;
4851 SourceLocation ModifierLoc;
4854 SourceLocation ColonLoc;
4857 SourceLocation StepModifierLoc;
4860 void setStep(Expr *Step) { *(
getFinals().end()) = Step; }
4863 void setCalcStep(Expr *CalcStep) { *(
getFinals().end() + 1) = CalcStep; }
4873 OMPLinearClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4874 OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc,
4875 SourceLocation ColonLoc, SourceLocation StepModifierLoc,
4876 SourceLocation EndLoc,
unsigned NumVars)
4877 : OMPVarListClause<OMPLinearClause>(llvm::omp::OMPC_linear, StartLoc,
4878 LParenLoc, EndLoc, NumVars),
4879 OMPClauseWithPostUpdate(this), Modifier(Modifier),
4880 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc),
4881 StepModifierLoc(StepModifierLoc) {}
4886 explicit OMPLinearClause(
unsigned NumVars)
4887 : OMPVarListClause<OMPLinearClause>(llvm::omp::OMPC_linear,
4888 SourceLocation(), SourceLocation(),
4889 SourceLocation(), NumVars),
4890 OMPClauseWithPostUpdate(this) {}
4905 return {varlist_end(), varlist_size()};
4908 return {varlist_end(), varlist_size()};
4915 return {getPrivates().end(), varlist_size()};
4920 return {
getInits().end(), varlist_size()};
4923 return {getInits().end(), varlist_size()};
4931 return {getUpdates().end(), varlist_size()};
4936 return {
getFinals().end() + 2, varlist_size() + 1};
4939 return {getFinals().end() + 2, varlist_size() + 1};
4971 static OMPLinearClause *
5013 const Expr *getStep()
const {
return *(getFinals().end()); }
5019 const Expr *getCalcStep()
const {
return *(getFinals().end() + 1); }
5039 privates_const_range privates()
const {
return getPrivates(); }
5048 inits_const_range inits()
const {
return getInits(); }
5057 updates_const_range updates()
const {
return getUpdates(); }
5066 finals_const_range finals()
const {
return getFinals(); }
5071 llvm::iterator_range<used_expressions_iterator>;
5073 llvm::iterator_range<used_expressions_const_iterator>;
5079 used_expressions_const_range used_expressions()
const {
5080 return finals_const_range(getUsedExprs().begin(), getUsedExprs().end());
5084 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5085 reinterpret_cast<Stmt **
>(varlist_end()));
5088 const_child_range children()
const {
5089 return const_cast<OMPLinearClause *
>(
this)->children();
5095 return const_cast<OMPLinearClause *
>(
this)->
used_children();
5099 return T->getClauseKind() == llvm::omp::OMPC_linear;
5111class OMPAlignedClause final
5112 :
public OMPVarListClause<OMPAlignedClause>,
5113 private llvm::TrailingObjects<OMPAlignedClause, Expr *> {
5115 friend OMPVarListClause;
5116 friend TrailingObjects;
5119 SourceLocation ColonLoc;
5122 void setAlignment(Expr *A) { *varlist_end() = A; }
5132 SourceLocation ColonLoc, SourceLocation EndLoc,
5135 LParenLoc, EndLoc, NumVars),
5136 ColonLoc(ColonLoc) {}
5141 explicit OMPAlignedClause(
unsigned NumVars)
5142 : OMPVarListClause<OMPAlignedClause>(llvm::omp::OMPC_aligned,
5143 SourceLocation(), SourceLocation(),
5144 SourceLocation(), NumVars) {}
5156 static OMPAlignedClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
5157 SourceLocation LParenLoc,
5158 SourceLocation ColonLoc,
5159 SourceLocation EndLoc, ArrayRef<Expr *> VL,
5166 static OMPAlignedClause *
CreateEmpty(
const ASTContext &C,
unsigned NumVars);
5181 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5182 reinterpret_cast<Stmt **
>(varlist_end()));
5186 return const_cast<OMPAlignedClause *
>(
this)->
children();
5190 return child_range(child_iterator(), child_iterator());
5193 return const_child_range(const_child_iterator(), const_child_iterator());
5197 return T->getClauseKind() == llvm::omp::OMPC_aligned;
5208class OMPCopyinClause final
5209 :
public OMPVarListClause<OMPCopyinClause>,
5210 private llvm::TrailingObjects<OMPCopyinClause, Expr *> {
5225 friend OMPVarListClause;
5226 friend TrailingObjects;
5234 OMPCopyinClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5235 SourceLocation EndLoc,
unsigned N)
5236 : OMPVarListClause<OMPCopyinClause>(
llvm::omp::OMPC_copyin, StartLoc,
5237 LParenLoc, EndLoc, N) {}
5244 SourceLocation(), SourceLocation(),
5245 SourceLocation(), N) {}
5250 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
5253 MutableArrayRef<Expr *> getSourceExprs() {
5254 return {varlist_end(), varlist_size()};
5256 ArrayRef<const Expr *> getSourceExprs()
const {
5257 return {varlist_end(), varlist_size()};
5263 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
5266 MutableArrayRef<Expr *> getDestinationExprs() {
5267 return {getSourceExprs().end(), varlist_size()};
5269 ArrayRef<const Expr *> getDestinationExprs()
const {
5270 return {getSourceExprs().end(), varlist_size()};
5277 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
5280 MutableArrayRef<Expr *> getAssignmentOps() {
5281 return {getDestinationExprs().end(), varlist_size()};
5283 ArrayRef<const Expr *> getAssignmentOps()
const {
5284 return {getDestinationExprs().end(), varlist_size()};
5309 static OMPCopyinClause *
5310 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
5311 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
5312 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
5318 static OMPCopyinClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
5324 llvm::iterator_range<helper_expr_const_iterator>;
5331 return getDestinationExprs();
5341 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5342 reinterpret_cast<Stmt **
>(varlist_end()));
5346 return const_cast<OMPCopyinClause *
>(
this)->
children();
5350 return child_range(child_iterator(), child_iterator());
5353 return const_child_range(const_child_iterator(), const_child_iterator());
5357 return T->getClauseKind() == llvm::omp::OMPC_copyin;
5369class OMPCopyprivateClause final
5370 :
public OMPVarListClause<OMPCopyprivateClause>,
5371 private llvm::TrailingObjects<OMPCopyprivateClause, Expr *> {
5373 friend OMPVarListClause;
5374 friend TrailingObjects;
5382 OMPCopyprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5383 SourceLocation EndLoc,
unsigned N)
5384 : OMPVarListClause<OMPCopyprivateClause>(
llvm::omp::OMPC_copyprivate,
5385 StartLoc, LParenLoc, EndLoc, N) {
5393 llvm::omp::OMPC_copyprivate, SourceLocation(), SourceLocation(),
5394 SourceLocation(), N) {}
5399 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
5402 MutableArrayRef<Expr *> getSourceExprs() {
5403 return {varlist_end(), varlist_size()};
5405 ArrayRef<const Expr *> getSourceExprs()
const {
5406 return {varlist_end(), varlist_size()};
5412 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
5415 MutableArrayRef<Expr *> getDestinationExprs() {
5416 return {getSourceExprs().end(), varlist_size()};
5418 ArrayRef<const Expr *> getDestinationExprs()
const {
5419 return {getSourceExprs().end(), varlist_size()};
5426 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
5429 MutableArrayRef<Expr *> getAssignmentOps() {
5430 return {getDestinationExprs().end(), varlist_size()};
5432 ArrayRef<const Expr *> getAssignmentOps()
const {
5433 return {getDestinationExprs().end(), varlist_size()};
5457 static OMPCopyprivateClause *
5458 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
5459 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
5460 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
5466 static OMPCopyprivateClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
5472 llvm::iterator_range<helper_expr_const_iterator>;
5479 return getDestinationExprs();
5489 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5490 reinterpret_cast<Stmt **
>(varlist_end()));
5494 return const_cast<OMPCopyprivateClause *
>(
this)->
children();
5498 return child_range(child_iterator(), child_iterator());
5501 return const_child_range(const_child_iterator(), const_child_iterator());
5505 return T->getClauseKind() == llvm::omp::OMPC_copyprivate;
5521class OMPFlushClause final
5522 :
public OMPVarListClause<OMPFlushClause>,
5523 private llvm::TrailingObjects<OMPFlushClause, Expr *> {
5524 friend OMPVarListClause;
5525 friend TrailingObjects;
5533 OMPFlushClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5534 SourceLocation EndLoc,
unsigned N)
5535 : OMPVarListClause<OMPFlushClause>(llvm::omp::OMPC_flush, StartLoc,
5536 LParenLoc, EndLoc, N) {}
5541 explicit OMPFlushClause(
unsigned N)
5542 : OMPVarListClause<OMPFlushClause>(llvm::omp::OMPC_flush,
5543 SourceLocation(), SourceLocation(),
5544 SourceLocation(), N) {}
5554 static OMPFlushClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
5555 SourceLocation LParenLoc, SourceLocation EndLoc,
5565 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5566 reinterpret_cast<Stmt **
>(varlist_end()));
5570 return const_cast<OMPFlushClause *
>(
this)->
children();
5574 return child_range(child_iterator(), child_iterator());
5577 return const_child_range(const_child_iterator(), const_child_iterator());
5581 return T->getClauseKind() == llvm::omp::OMPC_flush;
5601 SourceLocation LParenLoc;
5604 Expr *Depobj =
nullptr;
5611 OMPDepobjClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5612 SourceLocation EndLoc)
5614 LParenLoc(LParenLoc) {}
5619 :
OMPClause(
llvm::omp::OMPC_depobj, SourceLocation(), SourceLocation()) {}
5621 void setDepobj(Expr *E) { Depobj = E; }
5624 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
5634 static OMPDepobjClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
5635 SourceLocation LParenLoc,
5636 SourceLocation EndLoc, Expr *Depobj);
5641 static OMPDepobjClause *
CreateEmpty(
const ASTContext &C);
5651 return child_range(
reinterpret_cast<Stmt **
>(&Depobj),
5652 reinterpret_cast<Stmt **
>(&Depobj) + 1);
5656 return const_cast<OMPDepobjClause *
>(
this)->
children();
5660 return child_range(child_iterator(), child_iterator());
5663 return const_child_range(const_child_iterator(), const_child_iterator());
5667 return T->getClauseKind() == llvm::omp::OMPC_depobj;
5679class OMPDependClause final
5680 :
public OMPVarListClause<OMPDependClause>,
5681 private llvm::TrailingObjects<OMPDependClause, Expr *> {
5683 friend OMPVarListClause;
5684 friend TrailingObjects;
5689 OpenMPDependClauseKind
DepKind = OMPC_DEPEND_unknown;
5706 unsigned NumLoops = 0;
5716 OMPDependClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5717 SourceLocation EndLoc,
unsigned N,
unsigned NumLoops)
5718 : OMPVarListClause<OMPDependClause>(
llvm::omp::OMPC_depend, StartLoc,
5719 LParenLoc, EndLoc, N),
5720 NumLoops(NumLoops) {}
5729 SourceLocation(), SourceLocation(),
5730 SourceLocation(), N),
5731 NumLoops(NumLoops) {}
5734 void setDependencyKind(OpenMPDependClauseKind K) {
Data.DepKind = K; }
5737 void setDependencyLoc(SourceLocation Loc) {
Data.DepLoc = Loc; }
5743 void setOmpAllMemoryLoc(SourceLocation Loc) {
Data.OmpAllMemoryLoc = Loc; }
5759 static OMPDependClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
5760 SourceLocation LParenLoc,
5761 SourceLocation EndLoc, DependDataTy Data,
5762 Expr *DepModifier, ArrayRef<Expr *> VL,
5771 static OMPDependClause *
CreateEmpty(
const ASTContext &C,
unsigned N,
5787 Expr *getModifier();
5789 return const_cast<OMPDependClause *
>(
this)->
getModifier();
5797 void setLoopData(
unsigned NumLoop, Expr *Cnt);
5800 Expr *getLoopData(
unsigned NumLoop);
5801 const Expr *getLoopData(
unsigned NumLoop)
const;
5804 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5805 reinterpret_cast<Stmt **
>(varlist_end()));
5809 return const_cast<OMPDependClause *
>(
this)->
children();
5813 return child_range(child_iterator(), child_iterator());
5816 return const_child_range(const_child_iterator(), const_child_iterator());
5820 return T->getClauseKind() == llvm::omp::OMPC_depend;
5836 SourceLocation LParenLoc;
5839 OpenMPDeviceClauseModifier Modifier = OMPC_DEVICE_unknown;
5842 SourceLocation ModifierLoc;
5845 Stmt *Device =
nullptr;
5850 void setDevice(Expr *E) { Device = E; }
5853 void setModifier(OpenMPDeviceClauseModifier M) { Modifier = M; }
5870 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
5871 SourceLocation LParenLoc, SourceLocation ModifierLoc,
5872 SourceLocation EndLoc)
5875 ModifierLoc(ModifierLoc), Device(E) {
5876 setPreInitStmt(HelperE, CaptureRegion);
5881 :
OMPClause(
llvm::omp::OMPC_device, SourceLocation(), SourceLocation()),
5902 child_range
children() {
return child_range(&Device, &Device + 1); }
5905 return const_child_range(&Device, &Device + 1);
5909 return child_range(child_iterator(), child_iterator());
5912 return const_child_range(const_child_iterator(), const_child_iterator());
5916 return T->getClauseKind() == llvm::omp::OMPC_device;
5957 :
OMPClause(
llvm::omp::OMPC_simd, SourceLocation(), SourceLocation()) {}
5960 return child_range(child_iterator(), child_iterator());
5964 return const_child_range(const_child_iterator(), const_child_iterator());
5968 return child_range(child_iterator(), child_iterator());
5971 return const_child_range(const_child_iterator(), const_child_iterator());
5975 return T->getClauseKind() == llvm::omp::OMPC_simd;
5992 llvm::PointerIntPair<Expr *, 1, bool> AssociatedExpressionNonContiguousPr;
5997 ValueDecl *AssociatedDeclaration =
nullptr;
6002 ValueDecl *AssociatedDeclaration,
6003 bool IsNonContiguous)
6004 : AssociatedExpressionNonContiguousPr(AssociatedExpression,
6006 AssociatedDeclaration(
6007 AssociatedDeclaration
6012 return AssociatedExpressionNonContiguousPr.getPointer();
6016 return AssociatedExpressionNonContiguousPr.getInt();
6020 return AssociatedDeclaration;
6024 return AssociatedExpressionNonContiguousPr ==
6025 Other.AssociatedExpressionNonContiguousPr &&
6026 AssociatedDeclaration == Other.AssociatedDeclaration;
6066 static QualType getComponentExprElementType(
const Expr *Exp);
6126 static std::pair<const Expr *, std::optional<size_t>>
6127 findAttachPtrExpr(MappableExprComponentListRef Components,
6128 OpenMPDirectiveKind CurDirKind);
6133 getComponentsTotalNumber(MappableExprComponentListsRef ComponentLists);
6169 unsigned NumUniqueDeclarations;
6172 unsigned NumComponentLists;
6175 unsigned NumComponents;
6180 const bool SupportsMapper;
6183 NestedNameSpecifierLoc MapperQualifierLoc;
6186 DeclarationNameInfo MapperIdInfo;
6208 OpenMPClauseKind K,
const OMPVarListLocTy &Locs,
6210 NestedNameSpecifierLoc *MapperQualifierLocPtr =
nullptr,
6211 DeclarationNameInfo *MapperIdInfoPtr =
nullptr)
6212 : OMPVarListClause<T>(K, Locs.StartLoc, Locs.LParenLoc, Locs.EndLoc,
6214 NumUniqueDeclarations(Sizes.NumUniqueDeclarations),
6215 NumComponentLists(Sizes.NumComponentLists),
6216 NumComponents(Sizes.NumComponents), SupportsMapper(SupportsMapper) {
6217 if (MapperQualifierLocPtr)
6218 MapperQualifierLoc = *MapperQualifierLocPtr;
6219 if (MapperIdInfoPtr)
6220 MapperIdInfo = *MapperIdInfoPtr;
6226 return static_cast<T *
>(
this)
6227 ->
template getTrailingObjectsNonStrict<ValueDecl *>(
6228 NumUniqueDeclarations);
6234 return static_cast<const T *
>(
this)
6235 ->
template getTrailingObjectsNonStrict<ValueDecl *>(
6236 NumUniqueDeclarations);
6242 assert(UDs.size() == NumUniqueDeclarations &&
6243 "Unexpected amount of unique declarations.");
6250 return static_cast<T *
>(
this)
6251 ->
template getTrailingObjectsNonStrict<unsigned>(NumUniqueDeclarations);
6257 return static_cast<const T *
>(
this)
6258 ->
template getTrailingObjectsNonStrict<unsigned>(NumUniqueDeclarations);
6264 assert(DNLs.size() == NumUniqueDeclarations &&
6265 "Unexpected amount of list numbers.");
6272 return MutableArrayRef<unsigned>(
6273 static_cast<T *
>(
this)
6274 ->
template getTrailingObjectsNonStrict<unsigned>() +
6275 NumUniqueDeclarations,
6283 static_cast<const T *
>(
this)
6284 ->
template getTrailingObjectsNonStrict<unsigned>() +
6285 NumUniqueDeclarations,
6292 assert(CLSs.size() == NumComponentLists &&
6293 "Unexpected amount of component lists.");
6299 return static_cast<T *
>(
this)
6300 ->
template getTrailingObjectsNonStrict<MappableComponent>(
6306 return static_cast<const T *
>(
this)
6307 ->
template getTrailingObjectsNonStrict<MappableComponent>(
6316 assert(Components.size() == NumComponents &&
6317 "Unexpected amount of component lists.");
6318 assert(CLSs.size() == NumComponentLists &&
6319 "Unexpected amount of list sizes.");
6330 NumUniqueDeclarations &&
6331 "Unexpected number of mappable expression info entries!");
6333 "Unexpected total number of components!");
6334 assert(Declarations.size() == ComponentLists.size() &&
6335 "Declaration and component lists size is not consistent!");
6336 assert(Declarations.size() == NumComponentLists &&
6337 "Unexpected declaration and component lists size!");
6342 llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
6345 auto CI = ComponentLists.begin();
6346 for (
auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
6348 assert(!CI->empty() &&
"Invalid component list!");
6349 ComponentListMap[*DI].push_back(*CI);
6355 auto UDI = UniqueDeclarations.begin();
6358 auto DNLI = DeclNumLists.begin();
6361 auto CLSI = ComponentListSizes.begin();
6364 auto CI = Components.begin();
6367 unsigned PrevSize = 0u;
6370 for (
auto &M : ComponentListMap) {
6387 PrevSize += C.size();
6394 CI = llvm::copy(C, CI);
6401 MapperQualifierLoc = NNSL;
6406 MapperIdInfo = MapperId;
6412 assert(SupportsMapper &&
6413 "Must be a clause that is possible to have user-defined mappers");
6414 return MutableArrayRef<Expr *>(
6415 static_cast<T *
>(
this)->
template getTrailingObjects<Expr *>() +
6416 OMPVarListClause<T>::varlist_size(),
6417 OMPVarListClause<T>::varlist_size());
6423 assert(SupportsMapper &&
6424 "Must be a clause that is possible to have user-defined mappers");
6426 static_cast<const T *
>(
this)->
template getTrailingObjects<Expr *>() +
6427 OMPVarListClause<T>::varlist_size(),
6428 OMPVarListClause<T>::varlist_size());
6434 assert(DMDs.size() == OMPVarListClause<T>::varlist_size() &&
6435 "Unexpected number of user-defined mappers.");
6436 assert(SupportsMapper &&
6437 "Must be a clause that is possible to have user-defined mappers");
6454 return MapperQualifierLoc;
6463 :
public llvm::iterator_adaptor_base<
6464 const_component_lists_iterator,
6465 MappableExprComponentListRef::const_iterator,
6466 std::forward_iterator_tag, MappableComponent, ptrdiff_t,
6467 MappableComponent, MappableComponent> {
6475 const bool SupportsMapper;
6481 unsigned RemainingLists = 0;
6485 unsigned PrevListSize = 0;
6493 MappableExprComponentListRef::const_iterator End;
6503 Components.begin()),
6504 DeclCur(UniqueDecls.begin()), NumListsCur(DeclsListNum.begin()),
6505 SupportsMapper(SupportsMapper),
6506 ListSizeCur(CumulativeListSizes.begin()),
6507 ListSizeEnd(CumulativeListSizes.end()), End(Components.end()) {
6508 assert(UniqueDecls.size() == DeclsListNum.size() &&
6509 "Inconsistent number of declarations and list sizes!");
6510 if (!DeclsListNum.empty())
6511 RemainingLists = *NumListsCur;
6513 MapperCur = Mappers.begin();
6524 CumulativeListSizes, Components,
6525 SupportsMapper, Mappers) {
6529 for (; DeclCur != UniqueDecls.end(); ++DeclCur, ++NumListsCur) {
6530 if (*DeclCur == Declaration)
6533 assert(*NumListsCur > 0 &&
"No lists associated with declaration??");
6537 std::advance(ListSizeCur, *NumListsCur - 1);
6538 PrevListSize = *ListSizeCur;
6547 if (ListSizeCur == CumulativeListSizes.end()) {
6549 RemainingLists = 0u;
6555 RemainingLists = *NumListsCur;
6558 ListSizeEnd = ListSizeCur;
6559 std::advance(ListSizeEnd, RemainingLists);
6563 std::advance(this->I, PrevListSize);
6571 assert(ListSizeCur != ListSizeEnd &&
"Invalid iterator!");
6572 const ValueDecl *Mapper =
nullptr;
6573 if (SupportsMapper && *MapperCur)
6574 Mapper = cast<ValueDecl>(cast<DeclRefExpr>(*MapperCur)->getDecl());
6575 return std::make_tuple(
6588 assert(ListSizeCur != ListSizeEnd && RemainingLists &&
6589 "Invalid iterator!");
6593 if (std::next(ListSizeCur) == ListSizeEnd) {
6597 std::advance(this->I, *ListSizeCur - PrevListSize);
6598 PrevListSize = *ListSizeCur;
6601 if (!(--RemainingLists)) {
6604 RemainingLists = *NumListsCur;
6605 assert(RemainingLists &&
"No lists in the following declaration??");
6617 llvm::iterator_range<const_component_lists_iterator>;
6631 SupportsMapper, {});
6639 const_component_lists_iterator
6662 llvm::iterator_range<const_all_num_lists_iterator>;
6670 llvm::iterator_range<const_all_lists_sizes_iterator>;
6678 llvm::iterator_range<const_all_components_iterator>;
6688 llvm::iterator_range<mapperlist_const_iterator>;
6714class OMPMapClause final :
public OMPMappableExprListClause<OMPMapClause>,
6715 private llvm::TrailingObjects<
6716 OMPMapClause, Expr *, ValueDecl *, unsigned,
6717 OMPClauseMappableExprCommon::MappableComponent> {
6719 friend OMPMappableExprListClause;
6720 friend OMPVarListClause;
6721 friend TrailingObjects;
6725 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
6728 return 2 * varlist_size() + 1;
6730 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
6731 return getUniqueDeclarationsNum();
6733 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
6734 return getUniqueDeclarationsNum() + getTotalComponentListNum();
6746 SourceLocation MapTypeModifiersLoc[NumberOfOMPMapClauseModifiers];
6752 bool MapTypeIsImplicit =
false;
6755 SourceLocation MapLoc;
6758 SourceLocation ColonLoc;
6780 explicit OMPMapClause(ArrayRef<OpenMPMapModifierKind> MapModifiers,
6781 ArrayRef<SourceLocation> MapModifiersLoc,
6782 NestedNameSpecifierLoc MapperQualifierLoc,
6783 DeclarationNameInfo MapperIdInfo,
6784 OpenMPMapClauseKind MapType,
bool MapTypeIsImplicit,
6785 SourceLocation MapLoc,
const OMPVarListLocTy &Locs,
6786 const OMPMappableExprListSizeTy &Sizes)
6787 : OMPMappableExprListClause(llvm::omp::OMPC_map, Locs, Sizes,
6788 true, &MapperQualifierLoc,
6790 MapType(MapType), MapTypeIsImplicit(MapTypeIsImplicit), MapLoc(MapLoc) {
6791 assert(std::size(MapTypeModifiers) == MapModifiers.size() &&
6792 "Unexpected number of map type modifiers.");
6793 llvm::copy(MapModifiers, std::begin(MapTypeModifiers));
6795 assert(std::size(MapTypeModifiersLoc) == MapModifiersLoc.size() &&
6796 "Unexpected number of map type modifier locations.");
6797 llvm::copy(MapModifiersLoc, std::begin(MapTypeModifiersLoc));
6807 explicit OMPMapClause(
const OMPMappableExprListSizeTy &Sizes)
6808 : OMPMappableExprListClause(llvm::omp::OMPC_map, OMPVarListLocTy(), Sizes,
6815 void setMapTypeModifier(
unsigned I, OpenMPMapModifierKind T) {
6816 assert(I < NumberOfOMPMapClauseModifiers &&
6817 "Unexpected index to store map type modifier, exceeds array size.");
6818 MapTypeModifiers[I] = T;
6825 void setMapTypeModifierLoc(
unsigned I, SourceLocation TLoc) {
6826 assert(I < NumberOfOMPMapClauseModifiers &&
6827 "Index to store map type modifier location exceeds array size.");
6828 MapTypeModifiersLoc[I] = TLoc;
6834 void setMapType(OpenMPMapClauseKind T) { MapType = T; }
6839 void setMapLoc(SourceLocation TLoc) { MapLoc = TLoc; }
6842 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
6845 void setIteratorModifier(Expr *IteratorModifier) {
6846 getTrailingObjects<Expr *>()[2 * varlist_size()] = IteratorModifier;
6870 static OMPMapClause *
6871 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
6872 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
6873 MappableExprComponentListsRef ComponentLists,
6874 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorModifier,
6875 ArrayRef<OpenMPMapModifierKind> MapModifiers,
6876 ArrayRef<SourceLocation> MapModifiersLoc,
6877 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId,
6878 OpenMPMapClauseKind Type,
bool TypeIsImplicit, SourceLocation TypeLoc);
6890 static OMPMapClause *
CreateEmpty(
const ASTContext &C,
6891 const OMPMappableExprListSizeTy &Sizes);
6895 return getTrailingObjects<Expr *>()[2 * varlist_size()];
6899 OpenMPMapClauseKind
getMapType() const LLVM_READONLY {
return MapType; }
6912 assert(Cnt < NumberOfOMPMapClauseModifiers &&
6913 "Requested modifier exceeds the total number of modifiers.");
6914 return MapTypeModifiers[Cnt];
6922 assert(Cnt < NumberOfOMPMapClauseModifiers &&
6923 "Requested modifier location exceeds total number of modifiers.");
6924 return MapTypeModifiersLoc[Cnt];
6929 return MapTypeModifiers;
6934 return MapTypeModifiersLoc;
6938 SourceLocation
getMapLoc() const LLVM_READONLY {
return MapLoc; }
6945 reinterpret_cast<Stmt **
>(varlist_begin()),
6946 reinterpret_cast<Stmt **
>(varlist_end()));
6950 return const_cast<OMPMapClause *
>(
this)->
children();
6954 if (MapType == OMPC_MAP_to || MapType == OMPC_MAP_tofrom)
6955 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
6956 reinterpret_cast<Stmt **
>(varlist_end()));
6957 return child_range(child_iterator(), child_iterator());
6965 return T->getClauseKind() == llvm::omp::OMPC_map;
6991class OMPNumTeamsClause final
6992 :
public OMPVarListClause<OMPNumTeamsClause>,
6994 private llvm::TrailingObjects<OMPNumTeamsClause, Expr *> {
6995 friend OMPVarListClause;
6996 friend TrailingObjects;
6999 OpenMPNumTeamsClauseModifier Modifier = OMPC_NUMTEAMS_unknown;
7002 SourceLocation ModifierLoc;
7004 OMPNumTeamsClause(
const ASTContext &C, SourceLocation StartLoc,
7005 SourceLocation LParenLoc, SourceLocation EndLoc,
unsigned N)
7006 : OMPVarListClause(llvm::omp::OMPC_num_teams, StartLoc, LParenLoc, EndLoc,
7011 OMPNumTeamsClause(
unsigned N)
7012 : OMPVarListClause(llvm::omp::OMPC_num_teams, SourceLocation(),
7013 SourceLocation(), SourceLocation(), N),
7028 static OMPNumTeamsClause *
7030 SourceLocation StartLoc, SourceLocation LParenLoc,
7032 OpenMPNumTeamsClauseModifier Modifier, Expr *ModifierExpr,
7033 SourceLocation ModifierLoc, Stmt *PreInit);
7046 return const_cast<OMPNumTeamsClause *
>(
this)->
getNumTeams();
7071 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
7072 reinterpret_cast<Stmt **
>(varlist_end()) + 1);
7076 return const_cast<OMPNumTeamsClause *
>(
this)->
children();
7080 return child_range(child_iterator(), child_iterator());
7083 return const_child_range(const_child_iterator(), const_child_iterator());
7087 return T->getClauseKind() == llvm::omp::OMPC_num_teams;
7106class OMPThreadLimitClause final
7107 :
public OMPVarListClause<OMPThreadLimitClause>,
7109 private llvm::TrailingObjects<OMPThreadLimitClause, Expr *> {
7110 friend OMPVarListClause;
7111 friend TrailingObjects;
7113 OMPThreadLimitClause(
const ASTContext &C, SourceLocation StartLoc,
7114 SourceLocation LParenLoc, SourceLocation EndLoc,
7116 : OMPVarListClause(llvm::omp::OMPC_thread_limit, StartLoc, LParenLoc,
7121 OMPThreadLimitClause(
unsigned N)
7122 : OMPVarListClause(llvm::omp::OMPC_thread_limit, SourceLocation(),
7123 SourceLocation(), SourceLocation(), N),
7135 static OMPThreadLimitClause *
7137 SourceLocation StartLoc, SourceLocation LParenLoc,
7151 return const_cast<OMPThreadLimitClause *
>(
this)->
getThreadLimit();
7155 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
7156 reinterpret_cast<Stmt **
>(varlist_end()));
7160 return const_cast<OMPThreadLimitClause *
>(
this)->
children();
7164 return child_range(child_iterator(), child_iterator());
7167 return const_child_range(const_child_iterator(), const_child_iterator());
7171 return T->getClauseKind() == llvm::omp::OMPC_thread_limit;
7187 SourceLocation LParenLoc;
7190 Stmt *Priority =
nullptr;
7195 void setPriority(Expr *E) { Priority = E; }
7208 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
7209 SourceLocation LParenLoc, SourceLocation EndLoc)
7212 setPreInitStmt(HelperPriority, CaptureRegion);
7217 :
OMPClause(
llvm::omp::OMPC_priority, SourceLocation(), SourceLocation()),
7232 child_range
children() {
return child_range(&Priority, &Priority + 1); }
7235 return const_child_range(&Priority, &Priority + 1);
7238 child_range used_children();
7244 return T->getClauseKind() == llvm::omp::OMPC_priority;
7260 SourceLocation LParenLoc;
7263 OpenMPGrainsizeClauseModifier Modifier = OMPC_GRAINSIZE_unknown;
7266 SourceLocation ModifierLoc;
7269 Stmt *Grainsize =
nullptr;
7272 void setGrainsize(Expr *Size) { Grainsize = Size; }
7275 void setModifier(OpenMPGrainsizeClauseModifier M) { Modifier = M; }
7293 Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion,
7294 SourceLocation StartLoc, SourceLocation LParenLoc,
7295 SourceLocation ModifierLoc, SourceLocation EndLoc)
7298 ModifierLoc(ModifierLoc), Grainsize(Size) {
7299 setPreInitStmt(HelperSize, CaptureRegion);
7318 OpenMPGrainsizeClauseModifier
getModifier()
const {
return Modifier; }
7323 child_range
children() {
return child_range(&Grainsize, &Grainsize + 1); }
7326 return const_child_range(&Grainsize, &Grainsize + 1);
7329 child_range used_children();
7335 return T->getClauseKind() == llvm::omp::OMPC_grainsize;
7356 :
OMPClause(
llvm::omp::OMPC_nogroup, SourceLocation(), SourceLocation()) {
7360 return child_range(child_iterator(), child_iterator());
7364 return const_child_range(const_child_iterator(), const_child_iterator());
7368 return child_range(child_iterator(), child_iterator());
7371 return const_child_range(const_child_iterator(), const_child_iterator());
7375 return T->getClauseKind() == llvm::omp::OMPC_nogroup;
7391 SourceLocation LParenLoc;
7394 OpenMPNumTasksClauseModifier Modifier = OMPC_NUMTASKS_unknown;
7397 SourceLocation ModifierLoc;
7400 Stmt *NumTasks =
nullptr;
7403 void setNumTasks(Expr *Size) { NumTasks = Size; }
7406 void setModifier(OpenMPNumTasksClauseModifier M) { Modifier = M; }
7424 Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion,
7425 SourceLocation StartLoc, SourceLocation LParenLoc,
7426 SourceLocation ModifierLoc, SourceLocation EndLoc)
7429 ModifierLoc(ModifierLoc), NumTasks(Size) {
7430 setPreInitStmt(HelperSize, CaptureRegion);
7454 child_range
children() {
return child_range(&NumTasks, &NumTasks + 1); }
7457 return const_child_range(&NumTasks, &NumTasks + 1);
7460 child_range used_children();
7466 return T->getClauseKind() == llvm::omp::OMPC_num_tasks;
7481 SourceLocation LParenLoc;
7484 Stmt *Hint =
nullptr;
7487 void setHint(Expr *H) { Hint = H; }
7497 SourceLocation EndLoc)
7498 :
OMPClause(
llvm::omp::OMPC_hint, StartLoc, EndLoc), LParenLoc(LParenLoc),
7503 :
OMPClause(
llvm::omp::OMPC_hint, SourceLocation(), SourceLocation()) {}
7512 Expr *
getHint()
const {
return cast_or_null<Expr>(Hint); }
7514 child_range
children() {
return child_range(&Hint, &Hint + 1); }
7517 return const_child_range(&Hint, &Hint + 1);
7521 return child_range(child_iterator(), child_iterator());
7524 return const_child_range(const_child_iterator(), const_child_iterator());
7528 return T->getClauseKind() == llvm::omp::OMPC_hint;
7544 SourceLocation LParenLoc;
7547 OpenMPDistScheduleClauseKind Kind = OMPC_DIST_SCHEDULE_unknown;
7550 SourceLocation KindLoc;
7553 SourceLocation CommaLoc;
7556 Expr *ChunkSize =
nullptr;
7561 void setDistScheduleKind(OpenMPDistScheduleClauseKind K) { Kind = K; }
7566 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
7571 void setDistScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
7576 void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
7581 void setChunkSize(Expr *E) { ChunkSize = E; }
7596 SourceLocation KLoc, SourceLocation CommaLoc,
7597 SourceLocation EndLoc,
7598 OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize,
7599 Stmt *HelperChunkSize)
7600 :
OMPClause(
llvm::omp::OMPC_dist_schedule, StartLoc, EndLoc),
7602 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
7603 setPreInitStmt(HelperChunkSize);
7608 :
OMPClause(
llvm::omp::OMPC_dist_schedule, SourceLocation(),
7631 return child_range(
reinterpret_cast<Stmt **
>(&ChunkSize),
7632 reinterpret_cast<Stmt **
>(&ChunkSize) + 1);
7640 return child_range(child_iterator(), child_iterator());
7643 return const_child_range(const_child_iterator(), const_child_iterator());
7647 return T->getClauseKind() == llvm::omp::OMPC_dist_schedule;
7662 SourceLocation LParenLoc;
7665 OpenMPDefaultmapClauseModifier Modifier = OMPC_DEFAULTMAP_MODIFIER_unknown;
7668 SourceLocation ModifierLoc;
7671 OpenMPDefaultmapClauseKind Kind = OMPC_DEFAULTMAP_unknown;
7674 SourceLocation KindLoc;
7679 void setDefaultmapKind(OpenMPDefaultmapClauseKind K) { Kind = K; }
7684 void setDefaultmapModifier(OpenMPDefaultmapClauseModifier M) {
7689 void setDefaultmapModifierLoc(SourceLocation Loc) {
7696 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
7701 void setDefaultmapKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
7714 SourceLocation MLoc, SourceLocation KLoc,
7715 SourceLocation EndLoc, OpenMPDefaultmapClauseKind Kind,
7716 OpenMPDefaultmapClauseModifier M)
7718 LParenLoc(LParenLoc), Modifier(M), ModifierLoc(MLoc), Kind(Kind),
7724 SourceLocation()) {}
7746 return child_range(child_iterator(), child_iterator());
7750 return const_child_range(const_child_iterator(), const_child_iterator());
7754 return child_range(child_iterator(), child_iterator());
7757 return const_child_range(const_child_iterator(), const_child_iterator());
7761 return T->getClauseKind() == llvm::omp::OMPC_defaultmap;
7773class OMPToClause final :
public OMPMappableExprListClause<OMPToClause>,
7774 private llvm::TrailingObjects<
7775 OMPToClause, Expr *, ValueDecl *, unsigned,
7776 OMPClauseMappableExprCommon::MappableComponent> {
7778 friend OMPMappableExprListClause;
7779 friend OMPVarListClause;
7780 friend TrailingObjects;
7783 OpenMPMotionModifierKind MotionModifiers[NumberOfOMPMotionModifiers] = {
7784 OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
7785 OMPC_MOTION_MODIFIER_unknown};
7788 SourceLocation MotionModifiersLoc[NumberOfOMPMotionModifiers];
7791 SourceLocation ColonLoc;
7810 NestedNameSpecifierLoc MapperQualifierLoc,
7811 DeclarationNameInfo MapperIdInfo,
7812 const OMPVarListLocTy &Locs,
7815 true, &MapperQualifierLoc,
7817 assert(std::size(MotionModifiers) == TheMotionModifiers.size() &&
7818 "Unexpected number of motion modifiers.");
7819 llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
7821 assert(std::size(MotionModifiersLoc) == TheMotionModifiersLoc.size() &&
7822 "Unexpected number of motion modifier locations.");
7823 llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
7833 explicit OMPToClause(
const OMPMappableExprListSizeTy &Sizes)
7834 : OMPMappableExprListClause(llvm::omp::OMPC_to, OMPVarListLocTy(), Sizes,
7841 void setMotionModifier(
unsigned I, OpenMPMotionModifierKind T) {
7842 assert(I < NumberOfOMPMotionModifiers &&
7843 "Unexpected index to store motion modifier, exceeds array size.");
7844 MotionModifiers[I] = T;
7851 void setMotionModifierLoc(
unsigned I, SourceLocation TLoc) {
7852 assert(I < NumberOfOMPMotionModifiers &&
7853 "Index to store motion modifier location exceeds array size.");
7854 MotionModifiersLoc[I] = TLoc;
7857 void setIteratorModifier(Expr *IteratorModifier) {
7858 getTrailingObjects<Expr *>()[2 * varlist_size()] = IteratorModifier;
7861 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
7865 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
7868 return 2 * varlist_size() + 1;
7870 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
7871 return getUniqueDeclarationsNum();
7873 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
7874 return getUniqueDeclarationsNum() + getTotalComponentListNum();
7894 static OMPToClause *
7895 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
7896 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
7897 MappableExprComponentListsRef ComponentLists,
7898 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorModifier,
7899 ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
7900 ArrayRef<SourceLocation> MotionModifiersLoc,
7901 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
7911 static OMPToClause *
CreateEmpty(
const ASTContext &C,
7912 const OMPMappableExprListSizeTy &Sizes);
7918 assert(Cnt < NumberOfOMPMotionModifiers &&
7919 "Requested modifier exceeds the total number of modifiers.");
7920 return MotionModifiers[Cnt];
7923 return getTrailingObjects<Expr *>()[2 * varlist_size()];
7930 assert(Cnt < NumberOfOMPMotionModifiers &&
7931 "Requested modifier location exceeds total number of modifiers.");
7932 return MotionModifiersLoc[Cnt];
7937 return MotionModifiers;
7942 return MotionModifiersLoc;
7949 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
7950 reinterpret_cast<Stmt **
>(varlist_end()));
7954 return const_cast<OMPToClause *
>(
this)->
children();
7958 return child_range(child_iterator(), child_iterator());
7961 return const_child_range(const_child_iterator(), const_child_iterator());
7965 return T->getClauseKind() == llvm::omp::OMPC_to;
7977class OMPFromClause final
7978 :
public OMPMappableExprListClause<OMPFromClause>,
7979 private llvm::TrailingObjects<
7980 OMPFromClause, Expr *, ValueDecl *, unsigned,
7981 OMPClauseMappableExprCommon::MappableComponent> {
7983 friend OMPMappableExprListClause;
7984 friend OMPVarListClause;
7985 friend TrailingObjects;
7988 OpenMPMotionModifierKind MotionModifiers[NumberOfOMPMotionModifiers] = {
7989 OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
7990 OMPC_MOTION_MODIFIER_unknown};
7993 SourceLocation MotionModifiersLoc[NumberOfOMPMotionModifiers];
7996 SourceLocation ColonLoc;
8015 NestedNameSpecifierLoc MapperQualifierLoc,
8016 DeclarationNameInfo MapperIdInfo,
8017 const OMPVarListLocTy &Locs,
8020 true, &MapperQualifierLoc,
8022 assert(std::size(MotionModifiers) == TheMotionModifiers.size() &&
8023 "Unexpected number of motion modifiers.");
8024 llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
8026 assert(std::size(MotionModifiersLoc) == TheMotionModifiersLoc.size() &&
8027 "Unexpected number of motion modifier locations.");
8028 llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
8038 explicit OMPFromClause(
const OMPMappableExprListSizeTy &Sizes)
8039 : OMPMappableExprListClause(llvm::omp::OMPC_from, OMPVarListLocTy(),
8046 void setMotionModifier(
unsigned I, OpenMPMotionModifierKind T) {
8047 assert(I < NumberOfOMPMotionModifiers &&
8048 "Unexpected index to store motion modifier, exceeds array size.");
8049 MotionModifiers[I] = T;
8051 void setIteratorModifier(Expr *IteratorModifier) {
8052 getTrailingObjects<Expr *>()[2 * varlist_size()] = IteratorModifier;
8058 void setMotionModifierLoc(
unsigned I, SourceLocation TLoc) {
8059 assert(I < NumberOfOMPMotionModifiers &&
8060 "Index to store motion modifier location exceeds array size.");
8061 MotionModifiersLoc[I] = TLoc;
8065 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
8069 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8072 return 2 * varlist_size() + 1;
8074 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8075 return getUniqueDeclarationsNum();
8077 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8078 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8098 static OMPFromClause *
8099 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8100 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8101 MappableExprComponentListsRef ComponentLists,
8102 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorExpr,
8103 ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
8104 ArrayRef<SourceLocation> MotionModifiersLoc,
8105 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
8115 static OMPFromClause *
CreateEmpty(
const ASTContext &C,
8116 const OMPMappableExprListSizeTy &Sizes);
8122 assert(Cnt < NumberOfOMPMotionModifiers &&
8123 "Requested modifier exceeds the total number of modifiers.");
8124 return MotionModifiers[Cnt];
8127 return getTrailingObjects<Expr *>()[2 * varlist_size()];
8134 assert(Cnt < NumberOfOMPMotionModifiers &&
8135 "Requested modifier location exceeds total number of modifiers.");
8136 return MotionModifiersLoc[Cnt];
8141 return MotionModifiers;
8146 return MotionModifiersLoc;
8153 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8154 reinterpret_cast<Stmt **
>(varlist_end()));
8158 return const_cast<OMPFromClause *
>(
this)->
children();
8162 return child_range(child_iterator(), child_iterator());
8165 return const_child_range(const_child_iterator(), const_child_iterator());
8169 return T->getClauseKind() == llvm::omp::OMPC_from;
8181class OMPUseDevicePtrClause final
8182 :
public OMPMappableExprListClause<OMPUseDevicePtrClause>,
8183 private llvm::TrailingObjects<
8184 OMPUseDevicePtrClause, Expr *, ValueDecl *, unsigned,
8185 OMPClauseMappableExprCommon::MappableComponent> {
8187 friend OMPMappableExprListClause;
8188 friend OMPVarListClause;
8189 friend TrailingObjects;
8192 OpenMPUseDevicePtrFallbackModifier FallbackModifier =
8193 OMPC_USE_DEVICE_PTR_FALLBACK_unknown;
8196 SourceLocation FallbackModifierLoc;
8210 explicit OMPUseDevicePtrClause(
8212 OpenMPUseDevicePtrFallbackModifier FallbackModifier,
8213 SourceLocation FallbackModifierLoc)
8214 : OMPMappableExprListClause(
llvm::omp::OMPC_use_device_ptr, Locs, Sizes),
8215 FallbackModifier(FallbackModifier),
8216 FallbackModifierLoc(FallbackModifierLoc) {}
8227 OMPVarListLocTy(), Sizes) {}
8231 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8232 return 3 * varlist_size();
8234 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8235 return getUniqueDeclarationsNum();
8237 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8238 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8244 void setPrivateCopies(ArrayRef<Expr *> VL);
8248 MutableArrayRef<Expr *> getPrivateCopies() {
8249 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
8251 ArrayRef<const Expr *> getPrivateCopies()
const {
8252 return {varlist_end(), varlist_size()};
8258 void setInits(ArrayRef<Expr *> VL);
8262 MutableArrayRef<Expr *>
getInits() {
8263 return {getPrivateCopies().end(), varlist_size()};
8265 ArrayRef<const Expr *>
getInits()
const {
8266 return {getPrivateCopies().end(), varlist_size()};
8270 void setFallbackModifier(OpenMPUseDevicePtrFallbackModifier M) {
8271 FallbackModifier = M;
8275 void setFallbackModifierLoc(SourceLocation Loc) { FallbackModifierLoc = Loc; }
8291 static OMPUseDevicePtrClause *
8292 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8293 ArrayRef<Expr *> Vars, ArrayRef<Expr *> PrivateVars,
8294 ArrayRef<Expr *> Inits, ArrayRef<ValueDecl *> Declarations,
8295 MappableExprComponentListsRef ComponentLists,
8296 OpenMPUseDevicePtrFallbackModifier FallbackModifier,
8297 SourceLocation FallbackModifierLoc);
8307 static OMPUseDevicePtrClause *
8308 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8312 return FallbackModifier;
8322 llvm::iterator_range<private_copies_const_iterator>;
8327 return getPrivateCopies();
8340 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8341 reinterpret_cast<Stmt **
>(varlist_end()));
8345 return const_cast<OMPUseDevicePtrClause *
>(
this)->
children();
8349 return child_range(child_iterator(), child_iterator());
8352 return const_child_range(const_child_iterator(), const_child_iterator());
8356 return T->getClauseKind() == llvm::omp::OMPC_use_device_ptr;
8368class OMPUseDeviceAddrClause final
8369 :
public OMPMappableExprListClause<OMPUseDeviceAddrClause>,
8370 private llvm::TrailingObjects<
8371 OMPUseDeviceAddrClause, Expr *, ValueDecl *, unsigned,
8372 OMPClauseMappableExprCommon::MappableComponent> {
8374 friend OMPMappableExprListClause;
8375 friend OMPVarListClause;
8376 friend TrailingObjects;
8388 explicit OMPUseDeviceAddrClause(
const OMPVarListLocTy &Locs,
8390 : OMPMappableExprListClause(
llvm::omp::OMPC_use_device_addr, Locs,
8402 OMPVarListLocTy(), Sizes) {}
8406 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8407 return varlist_size();
8409 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8410 return getUniqueDeclarationsNum();
8412 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8413 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8426 static OMPUseDeviceAddrClause *
8427 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8428 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8429 MappableExprComponentListsRef ComponentLists);
8439 static OMPUseDeviceAddrClause *
8440 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8443 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8444 reinterpret_cast<Stmt **
>(varlist_end()));
8448 return const_cast<OMPUseDeviceAddrClause *
>(
this)->
children();
8452 return child_range(child_iterator(), child_iterator());
8455 return const_child_range(const_child_iterator(), const_child_iterator());
8459 return T->getClauseKind() == llvm::omp::OMPC_use_device_addr;
8471class OMPIsDevicePtrClause final
8472 :
public OMPMappableExprListClause<OMPIsDevicePtrClause>,
8473 private llvm::TrailingObjects<
8474 OMPIsDevicePtrClause, Expr *, ValueDecl *, unsigned,
8475 OMPClauseMappableExprCommon::MappableComponent> {
8477 friend OMPMappableExprListClause;
8478 friend OMPVarListClause;
8479 friend TrailingObjects;
8491 explicit OMPIsDevicePtrClause(
const OMPVarListLocTy &Locs,
8493 : OMPMappableExprListClause(
llvm::omp::OMPC_is_device_ptr, Locs, Sizes) {}
8504 OMPVarListLocTy(), Sizes) {}
8508 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8509 return varlist_size();
8511 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8512 return getUniqueDeclarationsNum();
8514 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8515 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8528 static OMPIsDevicePtrClause *
8529 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8530 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8531 MappableExprComponentListsRef ComponentLists);
8541 static OMPIsDevicePtrClause *
8542 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8545 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8546 reinterpret_cast<Stmt **
>(varlist_end()));
8550 return const_cast<OMPIsDevicePtrClause *
>(
this)->
children();
8554 return child_range(child_iterator(), child_iterator());
8557 return const_child_range(const_child_iterator(), const_child_iterator());
8561 return T->getClauseKind() == llvm::omp::OMPC_is_device_ptr;
8573class OMPHasDeviceAddrClause final
8574 :
public OMPMappableExprListClause<OMPHasDeviceAddrClause>,
8575 private llvm::TrailingObjects<
8576 OMPHasDeviceAddrClause, Expr *, ValueDecl *, unsigned,
8577 OMPClauseMappableExprCommon::MappableComponent> {
8579 friend OMPMappableExprListClause;
8580 friend OMPVarListClause;
8581 friend TrailingObjects;
8593 explicit OMPHasDeviceAddrClause(
const OMPVarListLocTy &Locs,
8595 : OMPMappableExprListClause(
llvm::omp::OMPC_has_device_addr, Locs,
8607 OMPVarListLocTy(), Sizes) {}
8611 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8612 return varlist_size();
8614 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8615 return getUniqueDeclarationsNum();
8617 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8618 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8631 static OMPHasDeviceAddrClause *
8632 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8633 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8634 MappableExprComponentListsRef ComponentLists);
8644 static OMPHasDeviceAddrClause *
8645 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8648 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8649 reinterpret_cast<Stmt **
>(varlist_end()));
8653 return const_cast<OMPHasDeviceAddrClause *
>(
this)->
children();
8657 return child_range(child_iterator(), child_iterator());
8660 return const_child_range(const_child_iterator(), const_child_iterator());
8664 return T->getClauseKind() == llvm::omp::OMPC_has_device_addr;
8675class OMPNontemporalClause final
8676 :
public OMPVarListClause<OMPNontemporalClause>,
8677 private llvm::TrailingObjects<OMPNontemporalClause, Expr *> {
8679 friend OMPVarListClause;
8680 friend TrailingObjects;
8688 OMPNontemporalClause(SourceLocation StartLoc, SourceLocation LParenLoc,
8689 SourceLocation EndLoc,
unsigned N)
8690 : OMPVarListClause<OMPNontemporalClause>(
llvm::omp::OMPC_nontemporal,
8691 StartLoc, LParenLoc, EndLoc, N) {
8699 llvm::omp::OMPC_nontemporal, SourceLocation(), SourceLocation(),
8700 SourceLocation(), N) {}
8704 MutableArrayRef<Expr *> getPrivateRefs() {
8705 return {varlist_end(), varlist_size()};
8707 ArrayRef<const Expr *> getPrivateRefs()
const {
8708 return {varlist_end(), varlist_size()};
8719 static OMPNontemporalClause *
8720 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
8721 SourceLocation EndLoc, ArrayRef<Expr *> VL);
8727 static OMPNontemporalClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
8731 void setPrivateRefs(ArrayRef<Expr *> VL);
8734 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8735 reinterpret_cast<Stmt **
>(varlist_end()));
8739 return const_cast<OMPNontemporalClause *
>(
this)->
children();
8743 return child_range(
reinterpret_cast<Stmt **
>(getPrivateRefs().begin()),
8744 reinterpret_cast<Stmt **
>(getPrivateRefs().end()));
8748 return const_cast<OMPNontemporalClause *
>(
this)->
private_refs();
8752 return child_range(child_iterator(), child_iterator());
8755 return const_child_range(const_child_iterator(), const_child_iterator());
8759 return T->getClauseKind() == llvm::omp::OMPC_nontemporal;
8774 SourceLocation LParenLoc;
8777 OpenMPOrderClauseKind Kind = OMPC_ORDER_unknown;
8780 SourceLocation KindKwLoc;
8783 OpenMPOrderClauseModifier Modifier = OMPC_ORDER_MODIFIER_unknown;
8786 SourceLocation ModifierKwLoc;
8791 void setKind(OpenMPOrderClauseKind K) { Kind = K; }
8796 void setKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
8801 void setModifier(OpenMPOrderClauseModifier M) { Modifier = M; }
8806 void setModifierKwLoc(SourceLocation MLoc) { ModifierKwLoc = MLoc; }
8819 SourceLocation StartLoc, SourceLocation LParenLoc,
8820 SourceLocation EndLoc, OpenMPOrderClauseModifier Modifier,
8821 SourceLocation MLoc)
8823 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc), Modifier(Modifier),
8824 ModifierKwLoc(MLoc) {}
8828 :
OMPClause(
llvm::omp::OMPC_order, SourceLocation(), SourceLocation()) {}
8837 OpenMPOrderClauseKind
getKind()
const {
return Kind; }
8849 return child_range(child_iterator(), child_iterator());
8853 return const_child_range(const_child_iterator(), const_child_iterator());
8857 return child_range(child_iterator(), child_iterator());
8860 return const_child_range(const_child_iterator(), const_child_iterator());
8864 return T->getClauseKind() == llvm::omp::OMPC_order;
8873class OMPInitClause final
8874 :
public OMPVarListClause<OMPInitClause>,
8875 private llvm::TrailingObjects<OMPInitClause, Expr *, unsigned> {
8877 friend OMPVarListClause;
8878 friend TrailingObjects;
8881 SourceLocation VarLoc;
8883 bool IsTarget =
false;
8884 bool IsTargetSync =
false;
8885 bool HasPreferAttrs =
false;
8889 unsigned NumAttrs = 0;
8906 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8907 return varlist_size() + NumAttrs;
8909 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8910 return getNumPrefs();
8913 void setInteropVar(Expr *E) { varlist_begin()[0] = E; }
8915 void setIsTarget(
bool V) { IsTarget =
V; }
8917 void setIsTargetSync(
bool V) { IsTargetSync =
V; }
8919 void setHasPreferAttrs(
bool V) { HasPreferAttrs =
V; }
8921 void setAttrs(ArrayRef<unsigned> Counts, ArrayRef<Expr *> Attrs);
8924 unsigned getNumPrefs()
const {
return varlist_size() - 1; }
8928 ArrayRef<unsigned> getAttrEnds()
const {
8929 return getTrailingObjects<unsigned>(getNumPrefs());
8933 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
8944 OMPInitClause(
bool IsTarget,
bool IsTargetSync, SourceLocation StartLoc,
8945 SourceLocation LParenLoc, SourceLocation VarLoc,
8946 SourceLocation EndLoc,
unsigned N)
8947 : OMPVarListClause<OMPInitClause>(llvm::omp::OMPC_init, StartLoc,
8948 LParenLoc, EndLoc, N),
8949 VarLoc(VarLoc), IsTarget(IsTarget), IsTargetSync(IsTargetSync) {}
8952 OMPInitClause(
unsigned N)
8953 : OMPVarListClause<OMPInitClause>(llvm::omp::OMPC_init, SourceLocation(),
8954 SourceLocation(), SourceLocation(), N) {
8976 OMPInteropInfo &InteropInfo,
8977 SourceLocation StartLoc,
8978 SourceLocation LParenLoc, SourceLocation VarLoc,
8979 SourceLocation EndLoc);
9014 reinterpret_cast<Stmt **
>(varlist_begin()),
9015 reinterpret_cast<Stmt **
>(varlist_begin() + varlist_size() + NumAttrs));
9019 return const_cast<OMPInitClause *
>(
this)->
children();
9023 return child_range(child_iterator(), child_iterator());
9026 return const_child_range(const_child_iterator(), const_child_iterator());
9032 unsigned N = getNumPrefs();
9033 Expr *
const *E = getTrailingObjects<Expr *>();
9035 return llvm::map_range(llvm::seq<unsigned>(0, N), [=](
unsigned I) {
9036 unsigned Start = (I == 0) ? 0 : Ends[I - 1];
9038 const_cast<Expr *
>(E[1 + I]),
9045 return T->getClauseKind() == llvm::omp::OMPC_init;
9058 SourceLocation LParenLoc;
9061 SourceLocation VarLoc;
9064 Stmt *InteropVar =
nullptr;
9067 void setInteropVar(Expr *E) { InteropVar = E; }
9070 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9073 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
9084 SourceLocation LParenLoc, SourceLocation VarLoc,
9085 SourceLocation EndLoc)
9086 :
OMPClause(
llvm::omp::OMPC_use, StartLoc, EndLoc), LParenLoc(LParenLoc),
9087 VarLoc(VarLoc), InteropVar(InteropVar) {}
9091 :
OMPClause(
llvm::omp::OMPC_use, SourceLocation(), SourceLocation()) {}
9102 child_range
children() {
return child_range(&InteropVar, &InteropVar + 1); }
9105 return const_child_range(&InteropVar, &InteropVar + 1);
9109 return child_range(child_iterator(), child_iterator());
9112 return const_child_range(const_child_iterator(), const_child_iterator());
9116 return T->getClauseKind() == llvm::omp::OMPC_use;
9133 SourceLocation LParenLoc;
9136 SourceLocation VarLoc;
9139 Stmt *InteropVar =
nullptr;
9142 void setInteropVar(Expr *E) { InteropVar = E; }
9145 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9148 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
9159 SourceLocation LParenLoc, SourceLocation VarLoc,
9160 SourceLocation EndLoc)
9162 LParenLoc(LParenLoc), VarLoc(VarLoc), InteropVar(InteropVar) {}
9173 :
OMPClause(
llvm::omp::OMPC_destroy, SourceLocation(), SourceLocation()) {
9187 return child_range(&InteropVar, &InteropVar + 1);
9188 return child_range(child_iterator(), child_iterator());
9193 return const_child_range(&InteropVar, &InteropVar + 1);
9194 return const_child_range(const_child_iterator(), const_child_iterator());
9198 return child_range(child_iterator(), child_iterator());
9201 return const_child_range(const_child_iterator(), const_child_iterator());
9205 return T->getClauseKind() == llvm::omp::OMPC_destroy;
9222 void setCondition(Expr *Cond) { setStmt(Cond); }
9235 OpenMPDirectiveKind CaptureRegion,
9236 SourceLocation StartLoc, SourceLocation LParenLoc,
9237 SourceLocation EndLoc)
9240 setPreInitStmt(HelperCond, CaptureRegion);
9249 child_range used_children();
9268 void setCondition(Expr *Cond) { setStmt(Cond); }
9281 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
9282 SourceLocation LParenLoc, SourceLocation EndLoc)
9285 setPreInitStmt(HelperCond, CaptureRegion);
9294 child_range used_children();
9312 void setEventHandler(Expr *E) { setStmt(E); }
9322 SourceLocation EndLoc)
9339class OMPInclusiveClause final
9340 :
public OMPVarListClause<OMPInclusiveClause>,
9341 private llvm::TrailingObjects<OMPInclusiveClause, Expr *> {
9343 friend OMPVarListClause;
9344 friend TrailingObjects;
9352 OMPInclusiveClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9353 SourceLocation EndLoc,
unsigned N)
9354 : OMPVarListClause<OMPInclusiveClause>(
llvm::omp::OMPC_inclusive,
9355 StartLoc, LParenLoc, EndLoc, N) {}
9362 SourceLocation(), SourceLocation(),
9363 SourceLocation(), N) {}
9373 static OMPInclusiveClause *
Create(
const ASTContext &C,
9374 SourceLocation StartLoc,
9375 SourceLocation LParenLoc,
9376 SourceLocation EndLoc, ArrayRef<Expr *> VL);
9382 static OMPInclusiveClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9385 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
9386 reinterpret_cast<Stmt **
>(varlist_end()));
9390 return const_cast<OMPInclusiveClause *
>(
this)->
children();
9394 return child_range(child_iterator(), child_iterator());
9397 return const_child_range(const_child_iterator(), const_child_iterator());
9401 return T->getClauseKind() == llvm::omp::OMPC_inclusive;
9412class OMPExclusiveClause final
9413 :
public OMPVarListClause<OMPExclusiveClause>,
9414 private llvm::TrailingObjects<OMPExclusiveClause, Expr *> {
9416 friend OMPVarListClause;
9417 friend TrailingObjects;
9425 OMPExclusiveClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9426 SourceLocation EndLoc,
unsigned N)
9427 : OMPVarListClause<OMPExclusiveClause>(
llvm::omp::OMPC_exclusive,
9428 StartLoc, LParenLoc, EndLoc, N) {}
9435 SourceLocation(), SourceLocation(),
9436 SourceLocation(), N) {}
9446 static OMPExclusiveClause *
Create(
const ASTContext &C,
9447 SourceLocation StartLoc,
9448 SourceLocation LParenLoc,
9449 SourceLocation EndLoc, ArrayRef<Expr *> VL);
9455 static OMPExclusiveClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9458 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
9459 reinterpret_cast<Stmt **
>(varlist_end()));
9463 return const_cast<OMPExclusiveClause *
>(
this)->
children();
9467 return child_range(child_iterator(), child_iterator());
9470 return const_child_range(const_child_iterator(), const_child_iterator());
9474 return T->getClauseKind() == llvm::omp::OMPC_exclusive;
9486class OMPUsesAllocatorsClause final
9488 private llvm::TrailingObjects<OMPUsesAllocatorsClause, Expr *,
9503 friend TrailingObjects;
9505 enum class ExprOffsets {
9511 enum class ParenLocsOffsets {
9518 SourceLocation LParenLoc;
9520 unsigned NumOfAllocators = 0;
9528 OMPUsesAllocatorsClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9529 SourceLocation EndLoc,
unsigned N)
9530 : OMPClause(llvm::omp::OMPC_uses_allocators, StartLoc, EndLoc),
9531 LParenLoc(LParenLoc), NumOfAllocators(N) {}
9536 explicit OMPUsesAllocatorsClause(
unsigned N)
9537 : OMPClause(llvm::omp::OMPC_uses_allocators, SourceLocation(),
9539 NumOfAllocators(N) {}
9541 unsigned numTrailingObjects(OverloadToken<Expr *>)
const {
9542 return NumOfAllocators *
static_cast<int>(ExprOffsets::Total);
9546 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9549 void setAllocatorsData(ArrayRef<OMPUsesAllocatorsClause::Data> Data);
9559 static OMPUsesAllocatorsClause *
9560 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
9561 SourceLocation EndLoc, ArrayRef<OMPUsesAllocatorsClause::Data> Data);
9567 static OMPUsesAllocatorsClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9580 Stmt **Begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
9581 return child_range(Begin, Begin + NumOfAllocators *
9582 static_cast<int>(ExprOffsets::Total));
9585 Stmt *
const *Begin =
9586 reinterpret_cast<Stmt *
const *
>(getTrailingObjects<Expr *>());
9587 return const_child_range(
9588 Begin, Begin + NumOfAllocators *
static_cast<int>(ExprOffsets::Total));
9592 return child_range(child_iterator(), child_iterator());
9595 return const_child_range(const_child_iterator(), const_child_iterator());
9599 return T->getClauseKind() == llvm::omp::OMPC_uses_allocators;
9612class OMPAffinityClause final
9613 :
public OMPVarListClause<OMPAffinityClause>,
9614 private llvm::TrailingObjects<OMPAffinityClause, Expr *> {
9616 friend OMPVarListClause;
9617 friend TrailingObjects;
9620 SourceLocation ColonLoc;
9629 OMPAffinityClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9630 SourceLocation ColonLoc, SourceLocation EndLoc,
unsigned N)
9631 : OMPVarListClause<OMPAffinityClause>(
llvm::omp::OMPC_affinity, StartLoc,
9632 LParenLoc, EndLoc, N) {}
9639 SourceLocation(), SourceLocation(),
9640 SourceLocation(), N) {}
9643 void setModifier(Expr *E) { getTrailingObjects()[varlist_size()] = E; }
9646 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
9657 static OMPAffinityClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
9658 SourceLocation LParenLoc,
9659 SourceLocation ColonLoc,
9660 SourceLocation EndLoc, Expr *Modifier,
9661 ArrayRef<Expr *> Locators);
9667 static OMPAffinityClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9671 Expr *
getModifier()
const {
return getTrailingObjects()[varlist_size()]; }
9679 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
9680 reinterpret_cast<Stmt **
>(varlist_end() + Offset));
9684 return const_cast<OMPAffinityClause *
>(
this)->
children();
9688 return child_range(child_iterator(), child_iterator());
9691 return const_child_range(const_child_iterator(), const_child_iterator());
9695 return T->getClauseKind() == llvm::omp::OMPC_affinity;
9712 void setThreadID(Expr *TID) { setStmt(TID); }
9725 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
9726 SourceLocation LParenLoc, SourceLocation EndLoc)
9729 setPreInitStmt(HelperE, CaptureRegion);
9751 SourceLocation LParenLoc;
9754 OpenMPBindClauseKind Kind = OMPC_BIND_unknown;
9757 SourceLocation KindLoc;
9760 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9763 void setBindKind(OpenMPBindClauseKind K) { Kind = K; }
9766 void setBindKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
9775 OMPBindClause(OpenMPBindClauseKind K, SourceLocation KLoc,
9776 SourceLocation StartLoc, SourceLocation LParenLoc,
9777 SourceLocation EndLoc)
9778 : OMPNoChildClause(StartLoc, EndLoc), LParenLoc(LParenLoc),
Kind(K),
9782 OMPBindClause() : OMPNoChildClause() {}
9793 static OMPBindClause *
Create(
const ASTContext &C, OpenMPBindClauseKind K,
9794 SourceLocation KLoc, SourceLocation StartLoc,
9795 SourceLocation LParenLoc, SourceLocation EndLoc);
9800 static OMPBindClause *
CreateEmpty(
const ASTContext &C);
9814template<
class ImplClass,
template <
typename>
class Ptr,
typename RetTy>
9817#define PTR(CLASS) Ptr<CLASS>
9818#define DISPATCH(CLASS) \
9819 return static_cast<ImplClass*>(this)->Visit##CLASS(static_cast<PTR(CLASS)>(S))
9821#define GEN_CLANG_CLAUSE_CLASS
9822#define CLAUSE_CLASS(Enum, Str, Class) \
9823 RetTy Visit##Class(PTR(Class) S) { \
9824 return static_cast<ImplClass *>(this)->VisitOMPClause(S); \
9826#include "llvm/Frontend/OpenMP/OMP.inc"
9830 switch (S->getClauseKind()) {
9831#define GEN_CLANG_CLAUSE_CLASS
9832#define CLAUSE_CLASS(Enum, Str, Class) \
9833 case llvm::omp::Clause::Enum: \
9835#define CLAUSE_NO_CLASS(Enum, Str) \
9836 case llvm::omp::Clause::Enum: \
9838#include "llvm/Frontend/OpenMP/OMP.inc"
9847template <
typename T>
using const_ptr = std::add_pointer_t<std::add_const_t<T>>;
9849template <
class ImplClass,
typename RetTy =
void>
9852template<
class ImplClass,
typename RetTy =
void>
9858 const PrintingPolicy &Policy;
9862 template <
typename T>
void VisitOMPClauseList(T *Node,
char StartSym);
9864 template <
typename T>
void VisitOMPMotionClause(T *Node);
9868 unsigned OpenMPVersion)
9869 : OS(OS), Policy(Policy), Version(OpenMPVersion) {}
9871#define GEN_CLANG_CLAUSE_CLASS
9872#define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(Class *S);
9873#include "llvm/Frontend/OpenMP/OMP.inc"
9877 llvm::omp::TraitProperty
Kind = llvm::omp::TraitProperty::invalid;
9886 llvm::omp::TraitSelector
Kind = llvm::omp::TraitSelector::invalid;
9891 llvm::omp::TraitSet
Kind = llvm::omp::TraitSet::invalid;
9907 OMPTraitInfo(StringRef MangledName);
9913 llvm::function_ref<
bool(Expr *&,
bool )> Cond) {
9915 return llvm::any_of(
9917 return Cond(Selector.ScoreOrCondition,
9919 llvm::omp::TraitSelector::user_condition);
9929 void getAsVariantMatchInfo(
ASTContext &ASTCtx,
9930 llvm::omp::VariantMatchInfo &VMI)
const;
9933 std::string getMangledName()
const;
9938 if (Set.Kind != llvm::omp::TraitSet::implementation)
9941 if (Selector.
Kind != llvm::omp::TraitSelector::implementation_extension)
9944 if (Property.Kind == TP)
9953 void print(llvm::raw_ostream &OS,
const PrintingPolicy &Policy)
const;
9962 const FunctionDecl *CurrentFunctionDecl,
9974 llvm::StringMap<bool> FeatureMap;
9980class OMPChildren final
9981 :
private llvm::TrailingObjects<OMPChildren, OMPClause *, Stmt *> {
9982 friend TrailingObjects;
9988 unsigned NumClauses = 0;
9990 unsigned NumChildren = 0;
9992 bool HasAssociatedStmt =
false;
9996 size_t numTrailingObjects(OverloadToken<OMPClause *>)
const {
10002 OMPChildren(
unsigned NumClauses,
unsigned NumChildren,
bool HasAssociatedStmt)
10003 : NumClauses(NumClauses), NumChildren(NumChildren),
10004 HasAssociatedStmt(HasAssociatedStmt) {}
10006 static size_t size(
unsigned NumClauses,
bool HasAssociatedStmt,
10007 unsigned NumChildren);
10009 static OMPChildren *
Create(
void *Mem, ArrayRef<OMPClause *> Clauses);
10010 static OMPChildren *
Create(
void *Mem, ArrayRef<OMPClause *> Clauses, Stmt *S,
10011 unsigned NumChildren = 0);
10012 static OMPChildren *
CreateEmpty(
void *Mem,
unsigned NumClauses,
10013 bool HasAssociatedStmt =
false,
10014 unsigned NumChildren = 0);
10023 getTrailingObjects<Stmt *>()[NumChildren] = S;
10039 assert(HasAssociatedStmt &&
10040 "Expected directive with the associated statement.");
10041 return getTrailingObjects<Stmt *>()[NumChildren];
10046 return getTrailingObjects<OMPClause *>(NumClauses);
10049 return const_cast<OMPChildren *
>(
this)->
getClauses();
10056 const CapturedStmt *
10059 assert(llvm::is_contained(CaptureRegions, RegionKind) &&
10060 "RegionKind not found in OpenMP CaptureRegions.");
10062 for (
auto ThisCaptureRegion : CaptureRegions) {
10063 if (ThisCaptureRegion == RegionKind)
10065 CS = cast<CapturedStmt>(CS->getCapturedStmt());
10067 llvm_unreachable(
"Incorrect RegionKind specified for directive.");
10074 assert(!CaptureRegions.empty() &&
10075 "At least one captured statement must be provided.");
10077 for (
unsigned Level = CaptureRegions.size(); Level > 1; --Level)
10078 CS = cast<CapturedStmt>(CS->getCapturedStmt());
10082 const CapturedStmt *
10088 MutableArrayRef<Stmt *> getChildren();
10090 return const_cast<OMPChildren *
>(
this)->
getChildren();
10094 assert(HasAssociatedStmt &&
10095 "Expected directive with the associated statement.");
10099 S = CS->getCapturedStmt();
10100 CS = dyn_cast<CapturedStmt>(S);
10107 return const_cast<OMPChildren *
>(
this)->
getRawStmt();
10111 if (!HasAssociatedStmt)
10112 return Stmt::child_range(Stmt::child_iterator(), Stmt::child_iterator());
10113 return Stmt::child_range(&getTrailingObjects<Stmt *>()[NumChildren],
10114 &getTrailingObjects<Stmt *>()[NumChildren + 1]);
10125 :
public OMPOneStmtClause<llvm::omp::OMPC_ompx_dyn_cgroup_mem, OMPClause>,
10130 void setSize(Expr *E) { setStmt(E); }
10142 OpenMPDirectiveKind CaptureRegion,
10143 SourceLocation StartLoc, SourceLocation LParenLoc,
10144 SourceLocation EndLoc)
10147 setPreInitStmt(HelperSize, CaptureRegion);
10170 SourceLocation LParenLoc;
10173 enum { SIMPLE, FALLBACK, NUM_MODIFIERS };
10174 unsigned Modifiers[NUM_MODIFIERS];
10177 SourceLocation ModifiersLoc[NUM_MODIFIERS];
10180 Expr *Size =
nullptr;
10185 void setDynGroupprivateModifier(OpenMPDynGroupprivateClauseModifier M) {
10186 Modifiers[SIMPLE] = M;
10192 void setDynGroupprivateFallbackModifier(
10193 OpenMPDynGroupprivateClauseFallbackModifier M) {
10194 Modifiers[FALLBACK] = M;
10198 void setDynGroupprivateModifierLoc(SourceLocation Loc) {
10199 ModifiersLoc[SIMPLE] = Loc;
10203 void setDynGroupprivateFallbackModifierLoc(SourceLocation Loc) {
10204 ModifiersLoc[FALLBACK] = Loc;
10210 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
10215 void setSize(Expr *E) {
Size = E; }
10229 SourceLocation EndLoc, Expr *Size, Stmt *HelperSize,
10230 OpenMPDirectiveKind CaptureRegion,
10231 OpenMPDynGroupprivateClauseModifier M1,
10232 SourceLocation M1Loc,
10233 OpenMPDynGroupprivateClauseFallbackModifier M2,
10234 SourceLocation M2Loc)
10235 :
OMPClause(
llvm::omp::OMPC_dyn_groupprivate, StartLoc, EndLoc),
10237 setPreInitStmt(HelperSize, CaptureRegion);
10238 Modifiers[SIMPLE] = M1;
10239 Modifiers[FALLBACK] = M2;
10240 ModifiersLoc[SIMPLE] = M1Loc;
10241 ModifiersLoc[FALLBACK] = M2Loc;
10246 :
OMPClause(
llvm::omp::OMPC_dyn_groupprivate, SourceLocation(),
10249 Modifiers[SIMPLE] = OMPC_DYN_GROUPPRIVATE_unknown;
10250 Modifiers[FALLBACK] = OMPC_DYN_GROUPPRIVATE_FALLBACK_unknown;
10255 return static_cast<OpenMPDynGroupprivateClauseModifier
>(Modifiers[SIMPLE]);
10259 OpenMPDynGroupprivateClauseFallbackModifier
10261 return static_cast<OpenMPDynGroupprivateClauseFallbackModifier
>(
10262 Modifiers[FALLBACK]);
10270 return ModifiersLoc[SIMPLE];
10275 return ModifiersLoc[FALLBACK];
10285 return child_range(
reinterpret_cast<Stmt **
>(&Size),
10286 reinterpret_cast<Stmt **
>(&Size) + 1);
10294 return child_range(child_iterator(), child_iterator());
10297 return const_child_range(const_child_iterator(), const_child_iterator());
10301 return T->getClauseKind() == llvm::omp::OMPC_dyn_groupprivate;
10313class OMPDoacrossClause final
10314 :
public OMPVarListClause<OMPDoacrossClause>,
10315 private llvm::TrailingObjects<OMPDoacrossClause, Expr *> {
10317 friend OMPVarListClause;
10318 friend TrailingObjects;
10321 OpenMPDoacrossClauseModifier DepType = OMPC_DOACROSS_unknown;
10324 SourceLocation DepLoc;
10327 SourceLocation ColonLoc;
10330 unsigned NumLoops = 0;
10339 OMPDoacrossClause(SourceLocation StartLoc, SourceLocation LParenLoc,
10340 SourceLocation EndLoc,
unsigned N,
unsigned NumLoops)
10341 : OMPVarListClause<OMPDoacrossClause>(
llvm::omp::OMPC_doacross, StartLoc,
10342 LParenLoc, EndLoc, N),
10343 NumLoops(NumLoops) {}
10351 SourceLocation(), SourceLocation(),
10352 SourceLocation(), N),
10353 NumLoops(NumLoops) {}
10356 void setDependenceType(OpenMPDoacrossClauseModifier M) { DepType = M; }
10359 void setDependenceLoc(SourceLocation Loc) { DepLoc = Loc; }
10362 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
10376 static OMPDoacrossClause *
10377 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
10378 SourceLocation EndLoc, OpenMPDoacrossClauseModifier DepType,
10379 SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VL,
10380 unsigned NumLoops);
10387 static OMPDoacrossClause *
CreateEmpty(
const ASTContext &C,
unsigned N,
10388 unsigned NumLoops);
10403 void setLoopData(
unsigned NumLoop, Expr *Cnt);
10406 Expr *getLoopData(
unsigned NumLoop);
10407 const Expr *getLoopData(
unsigned NumLoop)
const;
10410 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
10411 reinterpret_cast<Stmt **
>(varlist_end()));
10415 return const_cast<OMPDoacrossClause *
>(
this)->
children();
10419 return child_range(child_iterator(), child_iterator());
10422 return const_child_range(const_child_iterator(), const_child_iterator());
10426 return T->getClauseKind() == llvm::omp::OMPC_doacross;
10441 SourceLocation LParenLoc;
10454 SourceLocation LParenLoc, SourceLocation EndLoc)
10455 :
OMPNoChildClause(StartLoc, EndLoc), LParenLoc(LParenLoc), Attrs(Attrs) {
10474 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.
child_range used_children()
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.
void setModifierLoc(SourceLocation Loc)
Set the location of the modifier.
void setModifierExpr(Expr *E)
Set the expression of the modifier.
const Expr * getModifierExpr() const
Get the expression of the modifier.
ArrayRef< Expr * > getNumTeams() const
Return NumTeams expressions.
void setModifier(OpenMPNumTeamsClauseModifier M)
Set the modifier.
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)
const_child_range children() const
child_range used_children()
const_child_range used_children() const
ArrayRef< Expr * > getThreadLimit() const
Return ThreadLimit expressions.
ArrayRef< Expr * > getThreadLimit()
Return ThreadLimit expressions.
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.
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)