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;
6984class OMPNumTeamsClause final
6985 :
public OMPVarListClause<OMPNumTeamsClause>,
6987 private llvm::TrailingObjects<OMPNumTeamsClause, Expr *> {
6988 friend OMPVarListClause;
6989 friend TrailingObjects;
6992 SourceLocation LParenLoc;
6994 OMPNumTeamsClause(
const ASTContext &C, SourceLocation StartLoc,
6995 SourceLocation LParenLoc, SourceLocation EndLoc,
unsigned N)
6996 : OMPVarListClause(llvm::omp::OMPC_num_teams, StartLoc, LParenLoc, EndLoc,
7001 OMPNumTeamsClause(
unsigned N)
7002 : OMPVarListClause(llvm::omp::OMPC_num_teams, SourceLocation(),
7003 SourceLocation(), SourceLocation(), N),
7015 static OMPNumTeamsClause *
7017 SourceLocation StartLoc, SourceLocation LParenLoc,
7037 return const_cast<OMPNumTeamsClause *
>(
this)->
getNumTeams();
7041 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
7042 reinterpret_cast<Stmt **
>(varlist_end()));
7046 return const_cast<OMPNumTeamsClause *
>(
this)->
children();
7050 return child_range(child_iterator(), child_iterator());
7053 return const_child_range(const_child_iterator(), const_child_iterator());
7057 return T->getClauseKind() == llvm::omp::OMPC_num_teams;
7076class OMPThreadLimitClause final
7077 :
public OMPVarListClause<OMPThreadLimitClause>,
7079 private llvm::TrailingObjects<OMPThreadLimitClause, Expr *> {
7080 friend OMPVarListClause;
7081 friend TrailingObjects;
7084 SourceLocation LParenLoc;
7086 OMPThreadLimitClause(
const ASTContext &C, SourceLocation StartLoc,
7087 SourceLocation LParenLoc, SourceLocation EndLoc,
7089 : OMPVarListClause(llvm::omp::OMPC_thread_limit, StartLoc, LParenLoc,
7094 OMPThreadLimitClause(
unsigned N)
7095 : OMPVarListClause(llvm::omp::OMPC_thread_limit, SourceLocation(),
7096 SourceLocation(), SourceLocation(), N),
7108 static OMPThreadLimitClause *
7110 SourceLocation StartLoc, SourceLocation LParenLoc,
7130 return const_cast<OMPThreadLimitClause *
>(
this)->
getThreadLimit();
7134 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
7135 reinterpret_cast<Stmt **
>(varlist_end()));
7139 return const_cast<OMPThreadLimitClause *
>(
this)->
children();
7143 return child_range(child_iterator(), child_iterator());
7146 return const_child_range(const_child_iterator(), const_child_iterator());
7150 return T->getClauseKind() == llvm::omp::OMPC_thread_limit;
7166 SourceLocation LParenLoc;
7169 Stmt *Priority =
nullptr;
7174 void setPriority(Expr *E) { Priority = E; }
7187 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
7188 SourceLocation LParenLoc, SourceLocation EndLoc)
7191 setPreInitStmt(HelperPriority, CaptureRegion);
7196 :
OMPClause(
llvm::omp::OMPC_priority, SourceLocation(), SourceLocation()),
7211 child_range
children() {
return child_range(&Priority, &Priority + 1); }
7214 return const_child_range(&Priority, &Priority + 1);
7217 child_range used_children();
7223 return T->getClauseKind() == llvm::omp::OMPC_priority;
7239 SourceLocation LParenLoc;
7242 OpenMPGrainsizeClauseModifier Modifier = OMPC_GRAINSIZE_unknown;
7245 SourceLocation ModifierLoc;
7248 Stmt *Grainsize =
nullptr;
7251 void setGrainsize(Expr *Size) { Grainsize = Size; }
7254 void setModifier(OpenMPGrainsizeClauseModifier M) { Modifier = M; }
7272 Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion,
7273 SourceLocation StartLoc, SourceLocation LParenLoc,
7274 SourceLocation ModifierLoc, SourceLocation EndLoc)
7277 ModifierLoc(ModifierLoc), Grainsize(Size) {
7278 setPreInitStmt(HelperSize, CaptureRegion);
7297 OpenMPGrainsizeClauseModifier
getModifier()
const {
return Modifier; }
7302 child_range
children() {
return child_range(&Grainsize, &Grainsize + 1); }
7305 return const_child_range(&Grainsize, &Grainsize + 1);
7308 child_range used_children();
7314 return T->getClauseKind() == llvm::omp::OMPC_grainsize;
7335 :
OMPClause(
llvm::omp::OMPC_nogroup, SourceLocation(), SourceLocation()) {
7339 return child_range(child_iterator(), child_iterator());
7343 return const_child_range(const_child_iterator(), const_child_iterator());
7347 return child_range(child_iterator(), child_iterator());
7350 return const_child_range(const_child_iterator(), const_child_iterator());
7354 return T->getClauseKind() == llvm::omp::OMPC_nogroup;
7370 SourceLocation LParenLoc;
7373 OpenMPNumTasksClauseModifier Modifier = OMPC_NUMTASKS_unknown;
7376 SourceLocation ModifierLoc;
7379 Stmt *NumTasks =
nullptr;
7382 void setNumTasks(Expr *Size) { NumTasks = Size; }
7385 void setModifier(OpenMPNumTasksClauseModifier M) { Modifier = M; }
7403 Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion,
7404 SourceLocation StartLoc, SourceLocation LParenLoc,
7405 SourceLocation ModifierLoc, SourceLocation EndLoc)
7408 ModifierLoc(ModifierLoc), NumTasks(Size) {
7409 setPreInitStmt(HelperSize, CaptureRegion);
7433 child_range
children() {
return child_range(&NumTasks, &NumTasks + 1); }
7436 return const_child_range(&NumTasks, &NumTasks + 1);
7439 child_range used_children();
7445 return T->getClauseKind() == llvm::omp::OMPC_num_tasks;
7460 SourceLocation LParenLoc;
7463 Stmt *Hint =
nullptr;
7466 void setHint(Expr *H) { Hint = H; }
7476 SourceLocation EndLoc)
7477 :
OMPClause(
llvm::omp::OMPC_hint, StartLoc, EndLoc), LParenLoc(LParenLoc),
7482 :
OMPClause(
llvm::omp::OMPC_hint, SourceLocation(), SourceLocation()) {}
7491 Expr *
getHint()
const {
return cast_or_null<Expr>(Hint); }
7493 child_range
children() {
return child_range(&Hint, &Hint + 1); }
7496 return const_child_range(&Hint, &Hint + 1);
7500 return child_range(child_iterator(), child_iterator());
7503 return const_child_range(const_child_iterator(), const_child_iterator());
7507 return T->getClauseKind() == llvm::omp::OMPC_hint;
7523 SourceLocation LParenLoc;
7526 OpenMPDistScheduleClauseKind Kind = OMPC_DIST_SCHEDULE_unknown;
7529 SourceLocation KindLoc;
7532 SourceLocation CommaLoc;
7535 Expr *ChunkSize =
nullptr;
7540 void setDistScheduleKind(OpenMPDistScheduleClauseKind K) { Kind = K; }
7545 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
7550 void setDistScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
7555 void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
7560 void setChunkSize(Expr *E) { ChunkSize = E; }
7575 SourceLocation KLoc, SourceLocation CommaLoc,
7576 SourceLocation EndLoc,
7577 OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize,
7578 Stmt *HelperChunkSize)
7579 :
OMPClause(
llvm::omp::OMPC_dist_schedule, StartLoc, EndLoc),
7581 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
7582 setPreInitStmt(HelperChunkSize);
7587 :
OMPClause(
llvm::omp::OMPC_dist_schedule, SourceLocation(),
7610 return child_range(
reinterpret_cast<Stmt **
>(&ChunkSize),
7611 reinterpret_cast<Stmt **
>(&ChunkSize) + 1);
7619 return child_range(child_iterator(), child_iterator());
7622 return const_child_range(const_child_iterator(), const_child_iterator());
7626 return T->getClauseKind() == llvm::omp::OMPC_dist_schedule;
7641 SourceLocation LParenLoc;
7644 OpenMPDefaultmapClauseModifier Modifier = OMPC_DEFAULTMAP_MODIFIER_unknown;
7647 SourceLocation ModifierLoc;
7650 OpenMPDefaultmapClauseKind Kind = OMPC_DEFAULTMAP_unknown;
7653 SourceLocation KindLoc;
7658 void setDefaultmapKind(OpenMPDefaultmapClauseKind K) { Kind = K; }
7663 void setDefaultmapModifier(OpenMPDefaultmapClauseModifier M) {
7668 void setDefaultmapModifierLoc(SourceLocation Loc) {
7675 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
7680 void setDefaultmapKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
7693 SourceLocation MLoc, SourceLocation KLoc,
7694 SourceLocation EndLoc, OpenMPDefaultmapClauseKind Kind,
7695 OpenMPDefaultmapClauseModifier M)
7697 LParenLoc(LParenLoc), Modifier(M), ModifierLoc(MLoc), Kind(Kind),
7703 SourceLocation()) {}
7725 return child_range(child_iterator(), child_iterator());
7729 return const_child_range(const_child_iterator(), const_child_iterator());
7733 return child_range(child_iterator(), child_iterator());
7736 return const_child_range(const_child_iterator(), const_child_iterator());
7740 return T->getClauseKind() == llvm::omp::OMPC_defaultmap;
7752class OMPToClause final :
public OMPMappableExprListClause<OMPToClause>,
7753 private llvm::TrailingObjects<
7754 OMPToClause, Expr *, ValueDecl *, unsigned,
7755 OMPClauseMappableExprCommon::MappableComponent> {
7757 friend OMPMappableExprListClause;
7758 friend OMPVarListClause;
7759 friend TrailingObjects;
7762 OpenMPMotionModifierKind MotionModifiers[NumberOfOMPMotionModifiers] = {
7763 OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
7764 OMPC_MOTION_MODIFIER_unknown};
7767 SourceLocation MotionModifiersLoc[NumberOfOMPMotionModifiers];
7770 SourceLocation ColonLoc;
7789 NestedNameSpecifierLoc MapperQualifierLoc,
7790 DeclarationNameInfo MapperIdInfo,
7791 const OMPVarListLocTy &Locs,
7794 true, &MapperQualifierLoc,
7796 assert(std::size(MotionModifiers) == TheMotionModifiers.size() &&
7797 "Unexpected number of motion modifiers.");
7798 llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
7800 assert(std::size(MotionModifiersLoc) == TheMotionModifiersLoc.size() &&
7801 "Unexpected number of motion modifier locations.");
7802 llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
7812 explicit OMPToClause(
const OMPMappableExprListSizeTy &Sizes)
7813 : OMPMappableExprListClause(llvm::omp::OMPC_to, OMPVarListLocTy(), Sizes,
7820 void setMotionModifier(
unsigned I, OpenMPMotionModifierKind T) {
7821 assert(I < NumberOfOMPMotionModifiers &&
7822 "Unexpected index to store motion modifier, exceeds array size.");
7823 MotionModifiers[I] = T;
7830 void setMotionModifierLoc(
unsigned I, SourceLocation TLoc) {
7831 assert(I < NumberOfOMPMotionModifiers &&
7832 "Index to store motion modifier location exceeds array size.");
7833 MotionModifiersLoc[I] = TLoc;
7836 void setIteratorModifier(Expr *IteratorModifier) {
7837 getTrailingObjects<Expr *>()[2 * varlist_size()] = IteratorModifier;
7840 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
7844 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
7847 return 2 * varlist_size() + 1;
7849 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
7850 return getUniqueDeclarationsNum();
7852 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
7853 return getUniqueDeclarationsNum() + getTotalComponentListNum();
7873 static OMPToClause *
7874 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
7875 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
7876 MappableExprComponentListsRef ComponentLists,
7877 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorModifier,
7878 ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
7879 ArrayRef<SourceLocation> MotionModifiersLoc,
7880 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
7890 static OMPToClause *
CreateEmpty(
const ASTContext &C,
7891 const OMPMappableExprListSizeTy &Sizes);
7897 assert(Cnt < NumberOfOMPMotionModifiers &&
7898 "Requested modifier exceeds the total number of modifiers.");
7899 return MotionModifiers[Cnt];
7902 return getTrailingObjects<Expr *>()[2 * varlist_size()];
7909 assert(Cnt < NumberOfOMPMotionModifiers &&
7910 "Requested modifier location exceeds total number of modifiers.");
7911 return MotionModifiersLoc[Cnt];
7916 return MotionModifiers;
7921 return MotionModifiersLoc;
7928 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
7929 reinterpret_cast<Stmt **
>(varlist_end()));
7933 return const_cast<OMPToClause *
>(
this)->
children();
7937 return child_range(child_iterator(), child_iterator());
7940 return const_child_range(const_child_iterator(), const_child_iterator());
7944 return T->getClauseKind() == llvm::omp::OMPC_to;
7956class OMPFromClause final
7957 :
public OMPMappableExprListClause<OMPFromClause>,
7958 private llvm::TrailingObjects<
7959 OMPFromClause, Expr *, ValueDecl *, unsigned,
7960 OMPClauseMappableExprCommon::MappableComponent> {
7962 friend OMPMappableExprListClause;
7963 friend OMPVarListClause;
7964 friend TrailingObjects;
7967 OpenMPMotionModifierKind MotionModifiers[NumberOfOMPMotionModifiers] = {
7968 OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
7969 OMPC_MOTION_MODIFIER_unknown};
7972 SourceLocation MotionModifiersLoc[NumberOfOMPMotionModifiers];
7975 SourceLocation ColonLoc;
7994 NestedNameSpecifierLoc MapperQualifierLoc,
7995 DeclarationNameInfo MapperIdInfo,
7996 const OMPVarListLocTy &Locs,
7999 true, &MapperQualifierLoc,
8001 assert(std::size(MotionModifiers) == TheMotionModifiers.size() &&
8002 "Unexpected number of motion modifiers.");
8003 llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
8005 assert(std::size(MotionModifiersLoc) == TheMotionModifiersLoc.size() &&
8006 "Unexpected number of motion modifier locations.");
8007 llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
8017 explicit OMPFromClause(
const OMPMappableExprListSizeTy &Sizes)
8018 : OMPMappableExprListClause(llvm::omp::OMPC_from, OMPVarListLocTy(),
8025 void setMotionModifier(
unsigned I, OpenMPMotionModifierKind T) {
8026 assert(I < NumberOfOMPMotionModifiers &&
8027 "Unexpected index to store motion modifier, exceeds array size.");
8028 MotionModifiers[I] = T;
8030 void setIteratorModifier(Expr *IteratorModifier) {
8031 getTrailingObjects<Expr *>()[2 * varlist_size()] = IteratorModifier;
8037 void setMotionModifierLoc(
unsigned I, SourceLocation TLoc) {
8038 assert(I < NumberOfOMPMotionModifiers &&
8039 "Index to store motion modifier location exceeds array size.");
8040 MotionModifiersLoc[I] = TLoc;
8044 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
8048 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8051 return 2 * varlist_size() + 1;
8053 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8054 return getUniqueDeclarationsNum();
8056 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8057 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8077 static OMPFromClause *
8078 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8079 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8080 MappableExprComponentListsRef ComponentLists,
8081 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorExpr,
8082 ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
8083 ArrayRef<SourceLocation> MotionModifiersLoc,
8084 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
8094 static OMPFromClause *
CreateEmpty(
const ASTContext &C,
8095 const OMPMappableExprListSizeTy &Sizes);
8101 assert(Cnt < NumberOfOMPMotionModifiers &&
8102 "Requested modifier exceeds the total number of modifiers.");
8103 return MotionModifiers[Cnt];
8106 return getTrailingObjects<Expr *>()[2 * varlist_size()];
8113 assert(Cnt < NumberOfOMPMotionModifiers &&
8114 "Requested modifier location exceeds total number of modifiers.");
8115 return MotionModifiersLoc[Cnt];
8120 return MotionModifiers;
8125 return MotionModifiersLoc;
8132 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8133 reinterpret_cast<Stmt **
>(varlist_end()));
8137 return const_cast<OMPFromClause *
>(
this)->
children();
8141 return child_range(child_iterator(), child_iterator());
8144 return const_child_range(const_child_iterator(), const_child_iterator());
8148 return T->getClauseKind() == llvm::omp::OMPC_from;
8160class OMPUseDevicePtrClause final
8161 :
public OMPMappableExprListClause<OMPUseDevicePtrClause>,
8162 private llvm::TrailingObjects<
8163 OMPUseDevicePtrClause, Expr *, ValueDecl *, unsigned,
8164 OMPClauseMappableExprCommon::MappableComponent> {
8166 friend OMPMappableExprListClause;
8167 friend OMPVarListClause;
8168 friend TrailingObjects;
8171 OpenMPUseDevicePtrFallbackModifier FallbackModifier =
8172 OMPC_USE_DEVICE_PTR_FALLBACK_unknown;
8175 SourceLocation FallbackModifierLoc;
8189 explicit OMPUseDevicePtrClause(
8191 OpenMPUseDevicePtrFallbackModifier FallbackModifier,
8192 SourceLocation FallbackModifierLoc)
8193 : OMPMappableExprListClause(
llvm::omp::OMPC_use_device_ptr, Locs, Sizes),
8194 FallbackModifier(FallbackModifier),
8195 FallbackModifierLoc(FallbackModifierLoc) {}
8206 OMPVarListLocTy(), Sizes) {}
8210 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8211 return 3 * varlist_size();
8213 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8214 return getUniqueDeclarationsNum();
8216 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8217 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8223 void setPrivateCopies(ArrayRef<Expr *> VL);
8227 MutableArrayRef<Expr *> getPrivateCopies() {
8228 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
8230 ArrayRef<const Expr *> getPrivateCopies()
const {
8231 return {varlist_end(), varlist_size()};
8237 void setInits(ArrayRef<Expr *> VL);
8241 MutableArrayRef<Expr *>
getInits() {
8242 return {getPrivateCopies().end(), varlist_size()};
8244 ArrayRef<const Expr *>
getInits()
const {
8245 return {getPrivateCopies().end(), varlist_size()};
8249 void setFallbackModifier(OpenMPUseDevicePtrFallbackModifier M) {
8250 FallbackModifier = M;
8254 void setFallbackModifierLoc(SourceLocation Loc) { FallbackModifierLoc = Loc; }
8270 static OMPUseDevicePtrClause *
8271 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8272 ArrayRef<Expr *> Vars, ArrayRef<Expr *> PrivateVars,
8273 ArrayRef<Expr *> Inits, ArrayRef<ValueDecl *> Declarations,
8274 MappableExprComponentListsRef ComponentLists,
8275 OpenMPUseDevicePtrFallbackModifier FallbackModifier,
8276 SourceLocation FallbackModifierLoc);
8286 static OMPUseDevicePtrClause *
8287 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8291 return FallbackModifier;
8301 llvm::iterator_range<private_copies_const_iterator>;
8306 return getPrivateCopies();
8319 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8320 reinterpret_cast<Stmt **
>(varlist_end()));
8324 return const_cast<OMPUseDevicePtrClause *
>(
this)->
children();
8328 return child_range(child_iterator(), child_iterator());
8331 return const_child_range(const_child_iterator(), const_child_iterator());
8335 return T->getClauseKind() == llvm::omp::OMPC_use_device_ptr;
8347class OMPUseDeviceAddrClause final
8348 :
public OMPMappableExprListClause<OMPUseDeviceAddrClause>,
8349 private llvm::TrailingObjects<
8350 OMPUseDeviceAddrClause, Expr *, ValueDecl *, unsigned,
8351 OMPClauseMappableExprCommon::MappableComponent> {
8353 friend OMPMappableExprListClause;
8354 friend OMPVarListClause;
8355 friend TrailingObjects;
8367 explicit OMPUseDeviceAddrClause(
const OMPVarListLocTy &Locs,
8369 : OMPMappableExprListClause(
llvm::omp::OMPC_use_device_addr, Locs,
8381 OMPVarListLocTy(), Sizes) {}
8385 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8386 return varlist_size();
8388 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8389 return getUniqueDeclarationsNum();
8391 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8392 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8405 static OMPUseDeviceAddrClause *
8406 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8407 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8408 MappableExprComponentListsRef ComponentLists);
8418 static OMPUseDeviceAddrClause *
8419 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8422 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8423 reinterpret_cast<Stmt **
>(varlist_end()));
8427 return const_cast<OMPUseDeviceAddrClause *
>(
this)->
children();
8431 return child_range(child_iterator(), child_iterator());
8434 return const_child_range(const_child_iterator(), const_child_iterator());
8438 return T->getClauseKind() == llvm::omp::OMPC_use_device_addr;
8450class OMPIsDevicePtrClause final
8451 :
public OMPMappableExprListClause<OMPIsDevicePtrClause>,
8452 private llvm::TrailingObjects<
8453 OMPIsDevicePtrClause, Expr *, ValueDecl *, unsigned,
8454 OMPClauseMappableExprCommon::MappableComponent> {
8456 friend OMPMappableExprListClause;
8457 friend OMPVarListClause;
8458 friend TrailingObjects;
8470 explicit OMPIsDevicePtrClause(
const OMPVarListLocTy &Locs,
8472 : OMPMappableExprListClause(
llvm::omp::OMPC_is_device_ptr, Locs, Sizes) {}
8483 OMPVarListLocTy(), Sizes) {}
8487 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8488 return varlist_size();
8490 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8491 return getUniqueDeclarationsNum();
8493 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8494 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8507 static OMPIsDevicePtrClause *
8508 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8509 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8510 MappableExprComponentListsRef ComponentLists);
8520 static OMPIsDevicePtrClause *
8521 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8524 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8525 reinterpret_cast<Stmt **
>(varlist_end()));
8529 return const_cast<OMPIsDevicePtrClause *
>(
this)->
children();
8533 return child_range(child_iterator(), child_iterator());
8536 return const_child_range(const_child_iterator(), const_child_iterator());
8540 return T->getClauseKind() == llvm::omp::OMPC_is_device_ptr;
8552class OMPHasDeviceAddrClause final
8553 :
public OMPMappableExprListClause<OMPHasDeviceAddrClause>,
8554 private llvm::TrailingObjects<
8555 OMPHasDeviceAddrClause, Expr *, ValueDecl *, unsigned,
8556 OMPClauseMappableExprCommon::MappableComponent> {
8558 friend OMPMappableExprListClause;
8559 friend OMPVarListClause;
8560 friend TrailingObjects;
8572 explicit OMPHasDeviceAddrClause(
const OMPVarListLocTy &Locs,
8574 : OMPMappableExprListClause(
llvm::omp::OMPC_has_device_addr, Locs,
8586 OMPVarListLocTy(), Sizes) {}
8590 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8591 return varlist_size();
8593 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8594 return getUniqueDeclarationsNum();
8596 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8597 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8610 static OMPHasDeviceAddrClause *
8611 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8612 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8613 MappableExprComponentListsRef ComponentLists);
8623 static OMPHasDeviceAddrClause *
8624 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8627 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8628 reinterpret_cast<Stmt **
>(varlist_end()));
8632 return const_cast<OMPHasDeviceAddrClause *
>(
this)->
children();
8636 return child_range(child_iterator(), child_iterator());
8639 return const_child_range(const_child_iterator(), const_child_iterator());
8643 return T->getClauseKind() == llvm::omp::OMPC_has_device_addr;
8654class OMPNontemporalClause final
8655 :
public OMPVarListClause<OMPNontemporalClause>,
8656 private llvm::TrailingObjects<OMPNontemporalClause, Expr *> {
8658 friend OMPVarListClause;
8659 friend TrailingObjects;
8667 OMPNontemporalClause(SourceLocation StartLoc, SourceLocation LParenLoc,
8668 SourceLocation EndLoc,
unsigned N)
8669 : OMPVarListClause<OMPNontemporalClause>(
llvm::omp::OMPC_nontemporal,
8670 StartLoc, LParenLoc, EndLoc, N) {
8678 llvm::omp::OMPC_nontemporal, SourceLocation(), SourceLocation(),
8679 SourceLocation(), N) {}
8683 MutableArrayRef<Expr *> getPrivateRefs() {
8684 return {varlist_end(), varlist_size()};
8686 ArrayRef<const Expr *> getPrivateRefs()
const {
8687 return {varlist_end(), varlist_size()};
8698 static OMPNontemporalClause *
8699 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
8700 SourceLocation EndLoc, ArrayRef<Expr *> VL);
8706 static OMPNontemporalClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
8710 void setPrivateRefs(ArrayRef<Expr *> VL);
8713 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8714 reinterpret_cast<Stmt **
>(varlist_end()));
8718 return const_cast<OMPNontemporalClause *
>(
this)->
children();
8722 return child_range(
reinterpret_cast<Stmt **
>(getPrivateRefs().begin()),
8723 reinterpret_cast<Stmt **
>(getPrivateRefs().end()));
8727 return const_cast<OMPNontemporalClause *
>(
this)->
private_refs();
8731 return child_range(child_iterator(), child_iterator());
8734 return const_child_range(const_child_iterator(), const_child_iterator());
8738 return T->getClauseKind() == llvm::omp::OMPC_nontemporal;
8753 SourceLocation LParenLoc;
8756 OpenMPOrderClauseKind Kind = OMPC_ORDER_unknown;
8759 SourceLocation KindKwLoc;
8762 OpenMPOrderClauseModifier Modifier = OMPC_ORDER_MODIFIER_unknown;
8765 SourceLocation ModifierKwLoc;
8770 void setKind(OpenMPOrderClauseKind K) { Kind = K; }
8775 void setKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
8780 void setModifier(OpenMPOrderClauseModifier M) { Modifier = M; }
8785 void setModifierKwLoc(SourceLocation MLoc) { ModifierKwLoc = MLoc; }
8798 SourceLocation StartLoc, SourceLocation LParenLoc,
8799 SourceLocation EndLoc, OpenMPOrderClauseModifier Modifier,
8800 SourceLocation MLoc)
8802 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc), Modifier(Modifier),
8803 ModifierKwLoc(MLoc) {}
8807 :
OMPClause(
llvm::omp::OMPC_order, SourceLocation(), SourceLocation()) {}
8816 OpenMPOrderClauseKind
getKind()
const {
return Kind; }
8828 return child_range(child_iterator(), child_iterator());
8832 return const_child_range(const_child_iterator(), const_child_iterator());
8836 return child_range(child_iterator(), child_iterator());
8839 return const_child_range(const_child_iterator(), const_child_iterator());
8843 return T->getClauseKind() == llvm::omp::OMPC_order;
8852class OMPInitClause final
8853 :
public OMPVarListClause<OMPInitClause>,
8854 private llvm::TrailingObjects<OMPInitClause, Expr *> {
8856 friend OMPVarListClause;
8857 friend TrailingObjects;
8860 SourceLocation VarLoc;
8862 bool IsTarget =
false;
8863 bool IsTargetSync =
false;
8865 void setInteropVar(Expr *E) { varlist_begin()[0] = E; }
8867 void setIsTarget(
bool V) { IsTarget =
V; }
8869 void setIsTargetSync(
bool V) { IsTargetSync =
V; }
8872 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
8883 OMPInitClause(
bool IsTarget,
bool IsTargetSync, SourceLocation StartLoc,
8884 SourceLocation LParenLoc, SourceLocation VarLoc,
8885 SourceLocation EndLoc,
unsigned N)
8886 : OMPVarListClause<OMPInitClause>(llvm::omp::OMPC_init, StartLoc,
8887 LParenLoc, EndLoc, N),
8888 VarLoc(VarLoc), IsTarget(IsTarget), IsTargetSync(IsTargetSync) {}
8891 OMPInitClause(
unsigned N)
8892 : OMPVarListClause<OMPInitClause>(llvm::omp::OMPC_init, SourceLocation(),
8893 SourceLocation(), SourceLocation(), N) {
8906 static OMPInitClause *
Create(
const ASTContext &C, Expr *InteropVar,
8907 OMPInteropInfo &InteropInfo,
8908 SourceLocation StartLoc,
8909 SourceLocation LParenLoc, SourceLocation VarLoc,
8910 SourceLocation EndLoc);
8916 static OMPInitClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
8932 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8933 reinterpret_cast<Stmt **
>(varlist_end()));
8937 return const_cast<OMPInitClause *
>(
this)->
children();
8941 return child_range(child_iterator(), child_iterator());
8944 return const_child_range(const_child_iterator(), const_child_iterator());
8953 return prefs_range(
reinterpret_cast<Expr **
>(std::next(varlist_begin())),
8954 reinterpret_cast<Expr **
>(varlist_end()));
8962 return T->getClauseKind() == llvm::omp::OMPC_init;
8975 SourceLocation LParenLoc;
8978 SourceLocation VarLoc;
8981 Stmt *InteropVar =
nullptr;
8984 void setInteropVar(Expr *E) { InteropVar = E; }
8987 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
8990 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
9001 SourceLocation LParenLoc, SourceLocation VarLoc,
9002 SourceLocation EndLoc)
9003 :
OMPClause(
llvm::omp::OMPC_use, StartLoc, EndLoc), LParenLoc(LParenLoc),
9004 VarLoc(VarLoc), InteropVar(InteropVar) {}
9008 :
OMPClause(
llvm::omp::OMPC_use, SourceLocation(), SourceLocation()) {}
9019 child_range
children() {
return child_range(&InteropVar, &InteropVar + 1); }
9022 return const_child_range(&InteropVar, &InteropVar + 1);
9026 return child_range(child_iterator(), child_iterator());
9029 return const_child_range(const_child_iterator(), const_child_iterator());
9033 return T->getClauseKind() == llvm::omp::OMPC_use;
9050 SourceLocation LParenLoc;
9053 SourceLocation VarLoc;
9056 Stmt *InteropVar =
nullptr;
9059 void setInteropVar(Expr *E) { InteropVar = E; }
9062 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9065 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
9076 SourceLocation LParenLoc, SourceLocation VarLoc,
9077 SourceLocation EndLoc)
9079 LParenLoc(LParenLoc), VarLoc(VarLoc), InteropVar(InteropVar) {}
9090 :
OMPClause(
llvm::omp::OMPC_destroy, SourceLocation(), SourceLocation()) {
9104 return child_range(&InteropVar, &InteropVar + 1);
9105 return child_range(child_iterator(), child_iterator());
9110 return const_child_range(&InteropVar, &InteropVar + 1);
9111 return const_child_range(const_child_iterator(), const_child_iterator());
9115 return child_range(child_iterator(), child_iterator());
9118 return const_child_range(const_child_iterator(), const_child_iterator());
9122 return T->getClauseKind() == llvm::omp::OMPC_destroy;
9139 void setCondition(Expr *Cond) { setStmt(Cond); }
9152 OpenMPDirectiveKind CaptureRegion,
9153 SourceLocation StartLoc, SourceLocation LParenLoc,
9154 SourceLocation EndLoc)
9157 setPreInitStmt(HelperCond, CaptureRegion);
9166 child_range used_children();
9185 void setCondition(Expr *Cond) { setStmt(Cond); }
9198 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
9199 SourceLocation LParenLoc, SourceLocation EndLoc)
9202 setPreInitStmt(HelperCond, CaptureRegion);
9211 child_range used_children();
9229 void setEventHandler(Expr *E) { setStmt(E); }
9239 SourceLocation EndLoc)
9256class OMPInclusiveClause final
9257 :
public OMPVarListClause<OMPInclusiveClause>,
9258 private llvm::TrailingObjects<OMPInclusiveClause, Expr *> {
9260 friend OMPVarListClause;
9261 friend TrailingObjects;
9269 OMPInclusiveClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9270 SourceLocation EndLoc,
unsigned N)
9271 : OMPVarListClause<OMPInclusiveClause>(
llvm::omp::OMPC_inclusive,
9272 StartLoc, LParenLoc, EndLoc, N) {}
9279 SourceLocation(), SourceLocation(),
9280 SourceLocation(), N) {}
9290 static OMPInclusiveClause *
Create(
const ASTContext &C,
9291 SourceLocation StartLoc,
9292 SourceLocation LParenLoc,
9293 SourceLocation EndLoc, ArrayRef<Expr *> VL);
9299 static OMPInclusiveClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9302 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
9303 reinterpret_cast<Stmt **
>(varlist_end()));
9307 return const_cast<OMPInclusiveClause *
>(
this)->
children();
9311 return child_range(child_iterator(), child_iterator());
9314 return const_child_range(const_child_iterator(), const_child_iterator());
9318 return T->getClauseKind() == llvm::omp::OMPC_inclusive;
9329class OMPExclusiveClause final
9330 :
public OMPVarListClause<OMPExclusiveClause>,
9331 private llvm::TrailingObjects<OMPExclusiveClause, Expr *> {
9333 friend OMPVarListClause;
9334 friend TrailingObjects;
9342 OMPExclusiveClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9343 SourceLocation EndLoc,
unsigned N)
9344 : OMPVarListClause<OMPExclusiveClause>(
llvm::omp::OMPC_exclusive,
9345 StartLoc, LParenLoc, EndLoc, N) {}
9352 SourceLocation(), SourceLocation(),
9353 SourceLocation(), N) {}
9363 static OMPExclusiveClause *
Create(
const ASTContext &C,
9364 SourceLocation StartLoc,
9365 SourceLocation LParenLoc,
9366 SourceLocation EndLoc, ArrayRef<Expr *> VL);
9372 static OMPExclusiveClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9375 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
9376 reinterpret_cast<Stmt **
>(varlist_end()));
9380 return const_cast<OMPExclusiveClause *
>(
this)->
children();
9384 return child_range(child_iterator(), child_iterator());
9387 return const_child_range(const_child_iterator(), const_child_iterator());
9391 return T->getClauseKind() == llvm::omp::OMPC_exclusive;
9403class OMPUsesAllocatorsClause final
9405 private llvm::TrailingObjects<OMPUsesAllocatorsClause, Expr *,
9420 friend TrailingObjects;
9422 enum class ExprOffsets {
9428 enum class ParenLocsOffsets {
9435 SourceLocation LParenLoc;
9437 unsigned NumOfAllocators = 0;
9445 OMPUsesAllocatorsClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9446 SourceLocation EndLoc,
unsigned N)
9447 : OMPClause(llvm::omp::OMPC_uses_allocators, StartLoc, EndLoc),
9448 LParenLoc(LParenLoc), NumOfAllocators(N) {}
9453 explicit OMPUsesAllocatorsClause(
unsigned N)
9454 : OMPClause(llvm::omp::OMPC_uses_allocators, SourceLocation(),
9456 NumOfAllocators(N) {}
9458 unsigned numTrailingObjects(OverloadToken<Expr *>)
const {
9459 return NumOfAllocators *
static_cast<int>(ExprOffsets::Total);
9463 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9466 void setAllocatorsData(ArrayRef<OMPUsesAllocatorsClause::Data> Data);
9476 static OMPUsesAllocatorsClause *
9477 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
9478 SourceLocation EndLoc, ArrayRef<OMPUsesAllocatorsClause::Data> Data);
9484 static OMPUsesAllocatorsClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9497 Stmt **Begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
9498 return child_range(Begin, Begin + NumOfAllocators *
9499 static_cast<int>(ExprOffsets::Total));
9502 Stmt *
const *Begin =
9503 reinterpret_cast<Stmt *
const *
>(getTrailingObjects<Expr *>());
9504 return const_child_range(
9505 Begin, Begin + NumOfAllocators *
static_cast<int>(ExprOffsets::Total));
9509 return child_range(child_iterator(), child_iterator());
9512 return const_child_range(const_child_iterator(), const_child_iterator());
9516 return T->getClauseKind() == llvm::omp::OMPC_uses_allocators;
9529class OMPAffinityClause final
9530 :
public OMPVarListClause<OMPAffinityClause>,
9531 private llvm::TrailingObjects<OMPAffinityClause, Expr *> {
9533 friend OMPVarListClause;
9534 friend TrailingObjects;
9537 SourceLocation ColonLoc;
9546 OMPAffinityClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9547 SourceLocation ColonLoc, SourceLocation EndLoc,
unsigned N)
9548 : OMPVarListClause<OMPAffinityClause>(
llvm::omp::OMPC_affinity, StartLoc,
9549 LParenLoc, EndLoc, N) {}
9556 SourceLocation(), SourceLocation(),
9557 SourceLocation(), N) {}
9560 void setModifier(Expr *E) { getTrailingObjects()[varlist_size()] = E; }
9563 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
9574 static OMPAffinityClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
9575 SourceLocation LParenLoc,
9576 SourceLocation ColonLoc,
9577 SourceLocation EndLoc, Expr *Modifier,
9578 ArrayRef<Expr *> Locators);
9584 static OMPAffinityClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9588 Expr *
getModifier()
const {
return getTrailingObjects()[varlist_size()]; }
9596 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
9597 reinterpret_cast<Stmt **
>(varlist_end() + Offset));
9601 return const_cast<OMPAffinityClause *
>(
this)->
children();
9605 return child_range(child_iterator(), child_iterator());
9608 return const_child_range(const_child_iterator(), const_child_iterator());
9612 return T->getClauseKind() == llvm::omp::OMPC_affinity;
9629 void setThreadID(Expr *TID) { setStmt(TID); }
9642 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
9643 SourceLocation LParenLoc, SourceLocation EndLoc)
9646 setPreInitStmt(HelperE, CaptureRegion);
9668 SourceLocation LParenLoc;
9671 OpenMPBindClauseKind Kind = OMPC_BIND_unknown;
9674 SourceLocation KindLoc;
9677 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9680 void setBindKind(OpenMPBindClauseKind K) { Kind = K; }
9683 void setBindKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
9692 OMPBindClause(OpenMPBindClauseKind K, SourceLocation KLoc,
9693 SourceLocation StartLoc, SourceLocation LParenLoc,
9694 SourceLocation EndLoc)
9695 : OMPNoChildClause(StartLoc, EndLoc), LParenLoc(LParenLoc),
Kind(K),
9699 OMPBindClause() : OMPNoChildClause() {}
9710 static OMPBindClause *
Create(
const ASTContext &C, OpenMPBindClauseKind K,
9711 SourceLocation KLoc, SourceLocation StartLoc,
9712 SourceLocation LParenLoc, SourceLocation EndLoc);
9717 static OMPBindClause *
CreateEmpty(
const ASTContext &C);
9731template<
class ImplClass,
template <
typename>
class Ptr,
typename RetTy>
9734#define PTR(CLASS) Ptr<CLASS>
9735#define DISPATCH(CLASS) \
9736 return static_cast<ImplClass*>(this)->Visit##CLASS(static_cast<PTR(CLASS)>(S))
9738#define GEN_CLANG_CLAUSE_CLASS
9739#define CLAUSE_CLASS(Enum, Str, Class) \
9740 RetTy Visit##Class(PTR(Class) S) { \
9741 return static_cast<ImplClass *>(this)->VisitOMPClause(S); \
9743#include "llvm/Frontend/OpenMP/OMP.inc"
9747 switch (S->getClauseKind()) {
9748#define GEN_CLANG_CLAUSE_CLASS
9749#define CLAUSE_CLASS(Enum, Str, Class) \
9750 case llvm::omp::Clause::Enum: \
9752#define CLAUSE_NO_CLASS(Enum, Str) \
9753 case llvm::omp::Clause::Enum: \
9755#include "llvm/Frontend/OpenMP/OMP.inc"
9764template <
typename T>
using const_ptr = std::add_pointer_t<std::add_const_t<T>>;
9766template <
class ImplClass,
typename RetTy =
void>
9769template<
class ImplClass,
typename RetTy =
void>
9775 const PrintingPolicy &Policy;
9779 template <
typename T>
void VisitOMPClauseList(T *Node,
char StartSym);
9781 template <
typename T>
void VisitOMPMotionClause(T *Node);
9785 unsigned OpenMPVersion)
9786 : OS(OS), Policy(Policy), Version(OpenMPVersion) {}
9788#define GEN_CLANG_CLAUSE_CLASS
9789#define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(Class *S);
9790#include "llvm/Frontend/OpenMP/OMP.inc"
9794 llvm::omp::TraitProperty
Kind = llvm::omp::TraitProperty::invalid;
9803 llvm::omp::TraitSelector
Kind = llvm::omp::TraitSelector::invalid;
9808 llvm::omp::TraitSet
Kind = llvm::omp::TraitSet::invalid;
9824 OMPTraitInfo(StringRef MangledName);
9830 llvm::function_ref<
bool(Expr *&,
bool )> Cond) {
9832 return llvm::any_of(
9834 return Cond(Selector.ScoreOrCondition,
9836 llvm::omp::TraitSelector::user_condition);
9846 void getAsVariantMatchInfo(
ASTContext &ASTCtx,
9847 llvm::omp::VariantMatchInfo &VMI)
const;
9850 std::string getMangledName()
const;
9855 if (Set.Kind != llvm::omp::TraitSet::implementation)
9858 if (Selector.
Kind != llvm::omp::TraitSelector::implementation_extension)
9861 if (Property.Kind == TP)
9870 void print(llvm::raw_ostream &OS,
const PrintingPolicy &Policy)
const;
9879 const FunctionDecl *CurrentFunctionDecl,
9891 llvm::StringMap<bool> FeatureMap;
9897class OMPChildren final
9898 :
private llvm::TrailingObjects<OMPChildren, OMPClause *, Stmt *> {
9899 friend TrailingObjects;
9905 unsigned NumClauses = 0;
9907 unsigned NumChildren = 0;
9909 bool HasAssociatedStmt =
false;
9913 size_t numTrailingObjects(OverloadToken<OMPClause *>)
const {
9919 OMPChildren(
unsigned NumClauses,
unsigned NumChildren,
bool HasAssociatedStmt)
9920 : NumClauses(NumClauses), NumChildren(NumChildren),
9921 HasAssociatedStmt(HasAssociatedStmt) {}
9923 static size_t size(
unsigned NumClauses,
bool HasAssociatedStmt,
9924 unsigned NumChildren);
9926 static OMPChildren *
Create(
void *Mem, ArrayRef<OMPClause *> Clauses);
9927 static OMPChildren *
Create(
void *Mem, ArrayRef<OMPClause *> Clauses, Stmt *S,
9928 unsigned NumChildren = 0);
9929 static OMPChildren *
CreateEmpty(
void *Mem,
unsigned NumClauses,
9930 bool HasAssociatedStmt =
false,
9931 unsigned NumChildren = 0);
9940 getTrailingObjects<Stmt *>()[NumChildren] = S;
9956 assert(HasAssociatedStmt &&
9957 "Expected directive with the associated statement.");
9958 return getTrailingObjects<Stmt *>()[NumChildren];
9963 return getTrailingObjects<OMPClause *>(NumClauses);
9966 return const_cast<OMPChildren *
>(
this)->
getClauses();
9973 const CapturedStmt *
9976 assert(llvm::is_contained(CaptureRegions, RegionKind) &&
9977 "RegionKind not found in OpenMP CaptureRegions.");
9979 for (
auto ThisCaptureRegion : CaptureRegions) {
9980 if (ThisCaptureRegion == RegionKind)
9982 CS = cast<CapturedStmt>(CS->getCapturedStmt());
9984 llvm_unreachable(
"Incorrect RegionKind specified for directive.");
9991 assert(!CaptureRegions.empty() &&
9992 "At least one captured statement must be provided.");
9994 for (
unsigned Level = CaptureRegions.size(); Level > 1; --Level)
9995 CS = cast<CapturedStmt>(CS->getCapturedStmt());
9999 const CapturedStmt *
10005 MutableArrayRef<Stmt *> getChildren();
10007 return const_cast<OMPChildren *
>(
this)->
getChildren();
10011 assert(HasAssociatedStmt &&
10012 "Expected directive with the associated statement.");
10016 S = CS->getCapturedStmt();
10017 CS = dyn_cast<CapturedStmt>(S);
10024 return const_cast<OMPChildren *
>(
this)->
getRawStmt();
10028 if (!HasAssociatedStmt)
10029 return Stmt::child_range(Stmt::child_iterator(), Stmt::child_iterator());
10030 return Stmt::child_range(&getTrailingObjects<Stmt *>()[NumChildren],
10031 &getTrailingObjects<Stmt *>()[NumChildren + 1]);
10042 :
public OMPOneStmtClause<llvm::omp::OMPC_ompx_dyn_cgroup_mem, OMPClause>,
10047 void setSize(Expr *E) { setStmt(E); }
10059 OpenMPDirectiveKind CaptureRegion,
10060 SourceLocation StartLoc, SourceLocation LParenLoc,
10061 SourceLocation EndLoc)
10064 setPreInitStmt(HelperSize, CaptureRegion);
10087 SourceLocation LParenLoc;
10090 enum { SIMPLE, FALLBACK, NUM_MODIFIERS };
10091 unsigned Modifiers[NUM_MODIFIERS];
10094 SourceLocation ModifiersLoc[NUM_MODIFIERS];
10097 Expr *Size =
nullptr;
10102 void setDynGroupprivateModifier(OpenMPDynGroupprivateClauseModifier M) {
10103 Modifiers[SIMPLE] = M;
10109 void setDynGroupprivateFallbackModifier(
10110 OpenMPDynGroupprivateClauseFallbackModifier M) {
10111 Modifiers[FALLBACK] = M;
10115 void setDynGroupprivateModifierLoc(SourceLocation Loc) {
10116 ModifiersLoc[SIMPLE] = Loc;
10120 void setDynGroupprivateFallbackModifierLoc(SourceLocation Loc) {
10121 ModifiersLoc[FALLBACK] = Loc;
10127 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
10132 void setSize(Expr *E) {
Size = E; }
10146 SourceLocation EndLoc, Expr *Size, Stmt *HelperSize,
10147 OpenMPDirectiveKind CaptureRegion,
10148 OpenMPDynGroupprivateClauseModifier M1,
10149 SourceLocation M1Loc,
10150 OpenMPDynGroupprivateClauseFallbackModifier M2,
10151 SourceLocation M2Loc)
10152 :
OMPClause(
llvm::omp::OMPC_dyn_groupprivate, StartLoc, EndLoc),
10154 setPreInitStmt(HelperSize, CaptureRegion);
10155 Modifiers[SIMPLE] = M1;
10156 Modifiers[FALLBACK] = M2;
10157 ModifiersLoc[SIMPLE] = M1Loc;
10158 ModifiersLoc[FALLBACK] = M2Loc;
10163 :
OMPClause(
llvm::omp::OMPC_dyn_groupprivate, SourceLocation(),
10166 Modifiers[SIMPLE] = OMPC_DYN_GROUPPRIVATE_unknown;
10167 Modifiers[FALLBACK] = OMPC_DYN_GROUPPRIVATE_FALLBACK_unknown;
10172 return static_cast<OpenMPDynGroupprivateClauseModifier
>(Modifiers[SIMPLE]);
10176 OpenMPDynGroupprivateClauseFallbackModifier
10178 return static_cast<OpenMPDynGroupprivateClauseFallbackModifier
>(
10179 Modifiers[FALLBACK]);
10187 return ModifiersLoc[SIMPLE];
10192 return ModifiersLoc[FALLBACK];
10202 return child_range(
reinterpret_cast<Stmt **
>(&Size),
10203 reinterpret_cast<Stmt **
>(&Size) + 1);
10211 return child_range(child_iterator(), child_iterator());
10214 return const_child_range(const_child_iterator(), const_child_iterator());
10218 return T->getClauseKind() == llvm::omp::OMPC_dyn_groupprivate;
10230class OMPDoacrossClause final
10231 :
public OMPVarListClause<OMPDoacrossClause>,
10232 private llvm::TrailingObjects<OMPDoacrossClause, Expr *> {
10234 friend OMPVarListClause;
10235 friend TrailingObjects;
10238 OpenMPDoacrossClauseModifier DepType = OMPC_DOACROSS_unknown;
10241 SourceLocation DepLoc;
10244 SourceLocation ColonLoc;
10247 unsigned NumLoops = 0;
10256 OMPDoacrossClause(SourceLocation StartLoc, SourceLocation LParenLoc,
10257 SourceLocation EndLoc,
unsigned N,
unsigned NumLoops)
10258 : OMPVarListClause<OMPDoacrossClause>(
llvm::omp::OMPC_doacross, StartLoc,
10259 LParenLoc, EndLoc, N),
10260 NumLoops(NumLoops) {}
10268 SourceLocation(), SourceLocation(),
10269 SourceLocation(), N),
10270 NumLoops(NumLoops) {}
10273 void setDependenceType(OpenMPDoacrossClauseModifier M) { DepType = M; }
10276 void setDependenceLoc(SourceLocation Loc) { DepLoc = Loc; }
10279 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
10293 static OMPDoacrossClause *
10294 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
10295 SourceLocation EndLoc, OpenMPDoacrossClauseModifier DepType,
10296 SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VL,
10297 unsigned NumLoops);
10304 static OMPDoacrossClause *
CreateEmpty(
const ASTContext &C,
unsigned N,
10305 unsigned NumLoops);
10320 void setLoopData(
unsigned NumLoop, Expr *Cnt);
10323 Expr *getLoopData(
unsigned NumLoop);
10324 const Expr *getLoopData(
unsigned NumLoop)
const;
10327 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
10328 reinterpret_cast<Stmt **
>(varlist_end()));
10332 return const_cast<OMPDoacrossClause *
>(
this)->
children();
10336 return child_range(child_iterator(), child_iterator());
10339 return const_child_range(const_child_iterator(), const_child_iterator());
10343 return T->getClauseKind() == llvm::omp::OMPC_doacross;
10358 SourceLocation LParenLoc;
10371 SourceLocation LParenLoc, SourceLocation EndLoc)
10372 :
OMPNoChildClause(StartLoc, EndLoc), LParenLoc(LParenLoc), Attrs(Attrs) {
10391 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, ASTContext &ASTCtx, 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
const_child_range children() const
const_prefs_range prefs() const
llvm::iterator_range< prefs_iterator > prefs_range
MutableArrayRef< Expr * >::iterator prefs_iterator
ArrayRef< const Expr * >::iterator const_prefs_iterator
llvm::iterator_range< const_prefs_iterator > const_prefs_range
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)
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()
SourceLocation getLParenLoc() const
Returns the location of '('.
ArrayRef< Expr * > getNumTeams()
Return NumTeams expressions.
static bool classof(const OMPClause *T)
const_child_range children() const
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
ArrayRef< Expr * > getNumTeams() const
Return NumTeams expressions.
const_child_range used_children() const
friend class OMPClauseReader
SourceLocation getLParenLoc() const
Returns the location of '('.
SourceLocation getModifierKwLoc() const
Returns location of clause modifier.
OMPOrderClause(OpenMPOrderClauseKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, OpenMPOrderClauseModifier Modifier, SourceLocation MLoc)
Build 'order' clause with argument A ('concurrent').
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
SourceLocation getKindKwLoc() const
Returns location of clause kind.
const_child_range used_children() const
static bool classof(const OMPClause *T)
OMPOrderClause()
Build an empty clause.
const_child_range children() const
child_range used_children()
OpenMPOrderClauseKind getKind() const
Returns kind of the clause.
OpenMPOrderClauseModifier getModifier() const
Returns Modifier of the clause.
friend class OMPClauseReader
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
Expr * getPriority() const
Return Priority number.
child_range used_children()
SourceLocation getLParenLoc() const
Returns the location of '('.
const_child_range used_children() const
OMPPriorityClause(Expr *Priority, Stmt *HelperPriority, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'priority' clause.
OMPPriorityClause()
Build an empty clause.
static bool classof(const OMPClause *T)
const_child_range children() const
Expr * getPriority()
Return Priority number.
OMPSIMDClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'simd' clause.
const_child_range used_children() const
const_child_range children() const
OMPSIMDClause()
Build an empty clause.
child_range used_children()
static bool classof(const OMPClause *T)
const_child_range children() const
child_range used_children()
const_child_range used_children() const
ArrayRef< Expr * > getThreadLimit() const
Return ThreadLimit expressions.
SourceLocation getLParenLoc() const
Returns the location of '('.
ArrayRef< Expr * > getThreadLimit()
Return ThreadLimit expressions.
static bool classof(const OMPClause *T)
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
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'.
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)