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"
67 : StartLoc(StartLoc), EndLoc(EndLoc), Kind(K) {}
108template <OpenMPClauseKind ClauseKind>
115 :
OMPClause(ClauseKind, StartLoc, EndLoc) {}
137 return T->getClauseKind() == ClauseKind;
141template <OpenMPClauseKind ClauseKind,
class Base>
156 :
Base(ClauseKind, StartLoc, EndLoc), LParenLoc(LParenLoc), S(S) {}
161 template <
typename T>
T *
getStmtAs()
const {
return cast_or_null<T>(S); }
187 return T->getClauseKind() == ClauseKind;
197 Stmt *PreInit =
nullptr;
204 assert(
get(
This) &&
"get is not tuned for pre-init.");
212 CaptureRegion = ThisRegion;
235 Expr *PostUpdate =
nullptr;
239 assert(
get(
This) &&
"get is not tuned for post-update.");
292 :
OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
296 return static_cast<T *
>(
this)->
template getTrailingObjectsNonStrict<Expr *>(
302 assert(VL.size() == NumVars &&
303 "Number of variables is not the same as the preallocated buffer");
332 return static_cast<const T *
>(
this)
333 ->
template getTrailingObjectsNonStrict<Expr *>(NumVars);
358 :
OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc),
377 return static_cast<T *
>(
this)
378 ->
template getTrailingObjectsNonStrict<OpenMPDirectiveKind>(
NumKinds);
384 "Number of directive kinds is not the same as the preallocated buffer");
435class OMPAlignClause final
462 static OMPAlignClause *
Create(
const ASTContext &
C, Expr *A,
463 SourceLocation StartLoc,
464 SourceLocation LParenLoc,
465 SourceLocation EndLoc);
479class OMPAllocateClause final
480 :
public OMPVarListClause<OMPAllocateClause>,
481 private llvm::TrailingObjects<OMPAllocateClause, Expr *> {
483 friend OMPVarListClause;
484 friend TrailingObjects;
488 Expr *Allocator =
nullptr;
491 Expr *Alignment =
nullptr;
502 enum { FIRST, SECOND, NUM_MODIFIERS };
512 Modifiers[FIRST] = M;
518 void setSecondAllocateModifier(OpenMPAllocateClauseModifier M) {
519 Modifiers[SECOND] = M;
523 void setFirstAllocateModifierLoc(SourceLocation Loc) {
524 ModifiersLoc[FIRST] = Loc;
528 void setSecondAllocateModifierLoc(SourceLocation Loc) {
529 ModifiersLoc[SECOND] = Loc;
542 OMPAllocateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
543 Expr *Allocator, Expr *Alignment, SourceLocation ColonLoc,
545 SourceLocation Modifier1Loc,
547 SourceLocation Modifier2Loc, SourceLocation EndLoc,
549 : OMPVarListClause<OMPAllocateClause>(llvm::omp::OMPC_allocate, StartLoc,
550 LParenLoc, EndLoc, N),
551 Allocator(Allocator), Alignment(Alignment), ColonLoc(ColonLoc) {
552 Modifiers[FIRST] = Modifier1;
553 Modifiers[SECOND] = Modifier2;
554 ModifiersLoc[FIRST] = Modifier1Loc;
555 ModifiersLoc[SECOND] = Modifier2Loc;
561 explicit OMPAllocateClause(
unsigned N)
562 : OMPVarListClause<OMPAllocateClause>(llvm::omp::OMPC_allocate,
563 SourceLocation(), SourceLocation(),
564 SourceLocation(), N) {
570 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
572 void setAllocator(Expr *A) { Allocator = A; }
574 AllocatorModifier = AM;
576 void setAlignment(Expr *A) { Alignment = A; }
590 static OMPAllocateClause *
591 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
592 Expr *Allocator, Expr *Alignment, SourceLocation ColonLoc,
595 SourceLocation EndLoc, ArrayRef<Expr *> VL);
605 return AllocatorModifier;
610 return Modifiers[FIRST];
615 return ModifiersLoc[FIRST];
620 return Modifiers[SECOND];
625 return ModifiersLoc[SECOND];
632 return AllocatorModifierLoc;
647 return const_cast<OMPAllocateClause *
>(
this)->
children();
658 return T->getClauseKind() == llvm::omp::OMPC_allocate;
676 Stmt *Condition =
nullptr;
694 void setNameModifierLoc(SourceLocation Loc) { NameModifierLoc = Loc; }
697 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
718 ColonLoc(ColonLoc), NameModifier(NameModifier),
719 NameModifierLoc(NameModifierLoc) {
758 return T->getClauseKind() == llvm::omp::OMPC_if;
832 void setNumThreads(Expr *NThreads) {
setStmt(NThreads); }
852 ModifierLoc(ModifierLoc) {
947class OMPSizesClause final
949 private llvm::TrailingObjects<OMPSizesClause, Expr *> {
951 friend class llvm::TrailingObjects<OMPSizesClause,
Expr *>;
960 explicit OMPSizesClause(
int NumSizes)
962 NumSizes(NumSizes) {}
993 return getTrailingObjects(NumSizes);
999 assert(VL.size() == NumSizes);
1006 reinterpret_cast<Stmt **
>(Sizes.end()));
1011 reinterpret_cast<Stmt *
const *
>(Sizes.end()));
1022 return T->getClauseKind() == llvm::omp::OMPC_sizes;
1034class OMPPermutationClause final
1036 private llvm::TrailingObjects<OMPSizesClause, Expr *> {
1049 assert(VL.size() == NumLoops &&
"Expecting one expression per loop");
1050 llvm::copy(VL, getTrailingObjects());
1057 NumLoops(NumLoops) {}
1067 static OMPPermutationClause *
1096 reinterpret_cast<Stmt **
>(Args.end()));
1101 reinterpret_cast<Stmt *
const *
>(Args.end()));
1112 return T->getClauseKind() == llvm::omp::OMPC_permutation;
1162 enum { FirstExpr, CountExpr, NumArgs };
1163 Stmt *Args[NumArgs] = {
nullptr,
nullptr};
1166 void setFirst(Expr *E) { Args[FirstExpr] = E; }
1169 void setCount(Expr *E) { Args[CountExpr] = E; }
1172 explicit OMPLoopRangeClause()
1173 :
OMPClause(llvm::omp::OMPC_looprange, {}, {}) {}
1177 static OMPLoopRangeClause *
1178 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
1179 SourceLocation FirstLoc, SourceLocation CountLoc,
1180 SourceLocation EndLoc, Expr *
First, Expr *Count);
1183 static OMPLoopRangeClause *
CreateEmpty(
const ASTContext &
C);
1213 return T->getClauseKind() == llvm::omp::OMPC_looprange;
1234 explicit OMPPartialClause() :
OMPClause(
llvm::omp::OMPC_partial, {}, {}) {}
1237 void setFactor(Expr *E) { Factor = E; }
1240 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1250 static OMPPartialClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
1251 SourceLocation LParenLoc,
1252 SourceLocation EndLoc, Expr *Factor);
1257 static OMPPartialClause *
CreateEmpty(
const ASTContext &
C);
1278 return T->getClauseKind() == llvm::omp::OMPC_partial;
1332 llvm::omp::DefaultKind Kind = llvm::omp::OMP_DEFAULT_unknown;
1346 void setDefaultKind(llvm::omp::DefaultKind K) { Kind = K; }
1351 void setDefaultKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
1354 void setDefaultVariableCategory(OpenMPDefaultClauseVariableCategory VC) {
1358 void setDefaultVariableCategoryLocation(SourceLocation VCLoc) {
1359 this->VCLoc = VCLoc;
1375 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc), VC(VC), VCLoc(VCLoc) {}
1414 return T->getClauseKind() == llvm::omp::OMPC_default;
1445 void setThreadsetKindLoc(
SourceLocation KLoc) { KindLoc = KLoc; }
1459 LParenLoc(LParenLoc), Kind(A), KindLoc(ALoc) {}
1494 return T->getClauseKind() == llvm::omp::OMPC_threadset;
1509class OMPTransparentClause final :
public OMPClause {
1510 friend class OMPClauseReader;
1513 SourceLocation LParenLoc;
1516 Expr *ImpexType =
nullptr;
1519 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1521 void setImpexTypeKind(Expr *E) { ImpexType = E; }
1533 OMPTransparentClause(Expr *ImpexTypeKind, SourceLocation StartLoc,
1534 SourceLocation LParenLoc, SourceLocation EndLoc)
1535 : OMPClause(llvm::omp::OMPC_transparent, StartLoc, EndLoc),
1536 LParenLoc(LParenLoc), ImpexType(ImpexTypeKind) {}
1539 OMPTransparentClause()
1540 : OMPClause(llvm::omp::OMPC_transparent, SourceLocation(),
1541 SourceLocation()) {}
1544 SourceLocation getLParenLoc()
const {
return LParenLoc; }
1547 Expr *getImpexType()
const {
return ImpexType; }
1550 return child_range(
reinterpret_cast<Stmt **
>(&ImpexType),
1551 reinterpret_cast<Stmt **
>(&ImpexType) + 1);
1554 const_child_range
children()
const {
1555 return const_cast<OMPTransparentClause *
>(
this)->
children();
1559 return child_range(child_iterator(), child_iterator());
1562 return const_child_range(const_child_iterator(), const_child_iterator());
1565 static bool classof(
const OMPClause *T) {
1566 return T->getClauseKind() == llvm::omp::OMPC_transparent;
1578class OMPProcBindClause :
public OMPClause {
1579 friend class OMPClauseReader;
1582 SourceLocation LParenLoc;
1585 llvm::omp::ProcBindKind
Kind = llvm::omp::OMP_PROC_BIND_unknown;
1588 SourceLocation KindKwLoc;
1593 void setProcBindKind(llvm::omp::ProcBindKind K) {
Kind = K; }
1598 void setProcBindKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
1609 OMPProcBindClause(llvm::omp::ProcBindKind A, SourceLocation ALoc,
1610 SourceLocation StartLoc, SourceLocation LParenLoc,
1611 SourceLocation EndLoc)
1612 : OMPClause(llvm::omp::OMPC_proc_bind, StartLoc, EndLoc),
1613 LParenLoc(LParenLoc),
Kind(A), KindKwLoc(ALoc) {}
1617 : OMPClause(llvm::omp::OMPC_proc_bind, SourceLocation(),
1618 SourceLocation()) {}
1621 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1624 SourceLocation getLParenLoc()
const {
return LParenLoc; }
1627 llvm::omp::ProcBindKind getProcBindKind()
const {
return Kind; }
1630 SourceLocation getProcBindKindKwLoc()
const {
return KindKwLoc; }
1633 return child_range(child_iterator(), child_iterator());
1636 const_child_range
children()
const {
1637 return const_child_range(const_child_iterator(), const_child_iterator());
1641 return child_range(child_iterator(), child_iterator());
1644 return const_child_range(const_child_iterator(), const_child_iterator());
1647 static bool classof(
const OMPClause *T) {
1648 return T->getClauseKind() == llvm::omp::OMPC_proc_bind;
1660class OMPUnifiedAddressClause final
1663 friend class OMPClauseReader;
1668 OMPUnifiedAddressClause(SourceLocation StartLoc, SourceLocation EndLoc)
1669 : OMPNoChildClause(StartLoc, EndLoc) {}
1672 OMPUnifiedAddressClause() : OMPNoChildClause() {}
1683class OMPUnifiedSharedMemoryClause final :
public OMPClause {
1685 friend class OMPClauseReader;
1690 OMPUnifiedSharedMemoryClause(SourceLocation StartLoc, SourceLocation EndLoc)
1691 : OMPClause(llvm::omp::OMPC_unified_shared_memory, StartLoc, EndLoc) {}
1694 OMPUnifiedSharedMemoryClause()
1695 : OMPClause(llvm::omp::OMPC_unified_shared_memory, SourceLocation(),
1696 SourceLocation()) {}
1699 return child_range(child_iterator(), child_iterator());
1702 const_child_range
children()
const {
1703 return const_child_range(const_child_iterator(), const_child_iterator());
1707 return child_range(child_iterator(), child_iterator());
1710 return const_child_range(const_child_iterator(), const_child_iterator());
1713 static bool classof(
const OMPClause *T) {
1714 return T->getClauseKind() == llvm::omp::OMPC_unified_shared_memory;
1726class OMPReverseOffloadClause final :
public OMPClause {
1728 friend class OMPClauseReader;
1733 OMPReverseOffloadClause(SourceLocation StartLoc, SourceLocation EndLoc)
1734 : OMPClause(llvm::omp::OMPC_reverse_offload, StartLoc, EndLoc) {}
1737 OMPReverseOffloadClause()
1738 : OMPClause(llvm::omp::OMPC_reverse_offload, SourceLocation(),
1739 SourceLocation()) {}
1742 return child_range(child_iterator(), child_iterator());
1745 const_child_range
children()
const {
1746 return const_child_range(const_child_iterator(), const_child_iterator());
1750 return child_range(child_iterator(), child_iterator());
1753 return const_child_range(const_child_iterator(), const_child_iterator());
1756 static bool classof(
const OMPClause *T) {
1757 return T->getClauseKind() == llvm::omp::OMPC_reverse_offload;
1769class OMPDynamicAllocatorsClause final :
public OMPClause {
1771 friend class OMPClauseReader;
1776 OMPDynamicAllocatorsClause(SourceLocation StartLoc, SourceLocation EndLoc)
1777 : OMPClause(llvm::omp::OMPC_dynamic_allocators, StartLoc, EndLoc) {}
1780 OMPDynamicAllocatorsClause()
1781 : OMPClause(llvm::omp::OMPC_dynamic_allocators, SourceLocation(),
1782 SourceLocation()) {}
1785 return child_range(child_iterator(), child_iterator());
1788 const_child_range
children()
const {
1789 return const_child_range(const_child_iterator(), const_child_iterator());
1793 return child_range(child_iterator(), child_iterator());
1796 return const_child_range(const_child_iterator(), const_child_iterator());
1799 static bool classof(
const OMPClause *T) {
1800 return T->getClauseKind() == llvm::omp::OMPC_dynamic_allocators;
1812class OMPAtomicDefaultMemOrderClause final :
public OMPClause {
1813 friend class OMPClauseReader;
1816 SourceLocation LParenLoc;
1823 SourceLocation KindKwLoc;
1828 void setAtomicDefaultMemOrderKind(OpenMPAtomicDefaultMemOrderClauseKind K) {
1835 void setAtomicDefaultMemOrderKindKwLoc(SourceLocation KLoc) {
1848 OMPAtomicDefaultMemOrderClause(OpenMPAtomicDefaultMemOrderClauseKind A,
1849 SourceLocation ALoc, SourceLocation StartLoc,
1850 SourceLocation LParenLoc,
1851 SourceLocation EndLoc)
1852 : OMPClause(llvm::omp::OMPC_atomic_default_mem_order, StartLoc, EndLoc),
1853 LParenLoc(LParenLoc),
Kind(A), KindKwLoc(ALoc) {}
1856 OMPAtomicDefaultMemOrderClause()
1857 : OMPClause(llvm::omp::OMPC_atomic_default_mem_order, SourceLocation(),
1858 SourceLocation()) {}
1861 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1864 SourceLocation getLParenLoc()
const {
return LParenLoc; }
1872 SourceLocation getAtomicDefaultMemOrderKindKwLoc()
const {
return KindKwLoc; }
1875 return child_range(child_iterator(), child_iterator());
1878 const_child_range
children()
const {
1879 return const_child_range(const_child_iterator(), const_child_iterator());
1883 return child_range(child_iterator(), child_iterator());
1886 return const_child_range(const_child_iterator(), const_child_iterator());
1889 static bool classof(
const OMPClause *T) {
1890 return T->getClauseKind() == llvm::omp::OMPC_atomic_default_mem_order;
1902class OMPSelfMapsClause final :
public OMPClause {
1904 friend class OMPClauseReader;
1909 OMPSelfMapsClause(SourceLocation StartLoc, SourceLocation EndLoc)
1910 : OMPClause(llvm::omp::OMPC_self_maps, StartLoc, EndLoc) {}
1914 : OMPClause(llvm::omp::OMPC_self_maps, SourceLocation(),
1915 SourceLocation()) {}
1918 return child_range(child_iterator(), child_iterator());
1921 const_child_range
children()
const {
1922 return const_child_range(const_child_iterator(), const_child_iterator());
1926 return child_range(child_iterator(), child_iterator());
1929 return const_child_range(const_child_iterator(), const_child_iterator());
1932 static bool classof(
const OMPClause *T) {
1933 return T->getClauseKind() == llvm::omp::OMPC_self_maps;
1944class OMPAtClause final :
public OMPClause {
1945 friend class OMPClauseReader;
1948 SourceLocation LParenLoc;
1954 SourceLocation KindKwLoc;
1959 void setAtKind(OpenMPAtClauseKind K) {
Kind = K; }
1964 void setAtKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
1967 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1977 OMPAtClause(OpenMPAtClauseKind A, SourceLocation ALoc,
1978 SourceLocation StartLoc, SourceLocation LParenLoc,
1979 SourceLocation EndLoc)
1980 : OMPClause(llvm::omp::OMPC_at, StartLoc, EndLoc), LParenLoc(LParenLoc),
1981 Kind(A), KindKwLoc(ALoc) {}
1985 : OMPClause(llvm::omp::OMPC_at, SourceLocation(), SourceLocation()) {}
1988 SourceLocation getLParenLoc()
const {
return LParenLoc; }
1994 SourceLocation getAtKindKwLoc()
const {
return KindKwLoc; }
1997 return child_range(child_iterator(), child_iterator());
2000 const_child_range
children()
const {
2001 return const_child_range(const_child_iterator(), const_child_iterator());
2005 return child_range(child_iterator(), child_iterator());
2008 return const_child_range(const_child_iterator(), const_child_iterator());
2011 static bool classof(
const OMPClause *T) {
2012 return T->getClauseKind() == llvm::omp::OMPC_at;
2024class OMPSeverityClause final :
public OMPClause {
2025 friend class OMPClauseReader;
2028 SourceLocation LParenLoc;
2034 SourceLocation KindKwLoc;
2039 void setSeverityKind(OpenMPSeverityClauseKind K) {
Kind = K; }
2044 void setSeverityKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
2047 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
2057 OMPSeverityClause(OpenMPSeverityClauseKind A, SourceLocation ALoc,
2058 SourceLocation StartLoc, SourceLocation LParenLoc,
2059 SourceLocation EndLoc)
2060 : OMPClause(llvm::omp::OMPC_severity, StartLoc, EndLoc),
2061 LParenLoc(LParenLoc),
Kind(A), KindKwLoc(ALoc) {}
2065 : OMPClause(llvm::omp::OMPC_severity, SourceLocation(),
2066 SourceLocation()) {}
2069 SourceLocation getLParenLoc()
const {
return LParenLoc; }
2075 SourceLocation getSeverityKindKwLoc()
const {
return KindKwLoc; }
2078 return child_range(child_iterator(), child_iterator());
2081 const_child_range
children()
const {
2082 return const_child_range(const_child_iterator(), const_child_iterator());
2086 return child_range(child_iterator(), child_iterator());
2089 return const_child_range(const_child_iterator(), const_child_iterator());
2092 static bool classof(
const OMPClause *T) {
2093 return T->getClauseKind() == llvm::omp::OMPC_severity;
2105class OMPMessageClause final
2108 friend class OMPClauseReader;
2111 void setMessageString(Expr *MS) { setStmt(MS); }
2123 OMPMessageClause(Expr *MS, Stmt *HelperMS, OpenMPDirectiveKind CaptureRegion,
2124 SourceLocation StartLoc, SourceLocation LParenLoc,
2125 SourceLocation EndLoc)
2126 : OMPOneStmtClause(MS, StartLoc, LParenLoc, EndLoc),
2127 OMPClauseWithPreInit(this) {
2128 setPreInitStmt(HelperMS, CaptureRegion);
2132 OMPMessageClause() : OMPOneStmtClause(), OMPClauseWithPreInit(this) {}
2135 Expr *getMessageString()
const {
return getStmtAs<Expr>(); }
2138 std::optional<std::string> tryEvaluateString(ASTContext &Ctx)
const {
2139 if (Expr *MessageExpr = getMessageString())
2140 return MessageExpr->tryEvaluateString(Ctx);
2141 return std::nullopt;
2153 friend class OMPClauseReader;
2156 SourceLocation LParenLoc;
2162 enum {FIRST, SECOND, NUM_MODIFIERS};
2166 SourceLocation ModifiersLoc[NUM_MODIFIERS];
2169 SourceLocation KindLoc;
2172 SourceLocation CommaLoc;
2175 Expr *ChunkSize =
nullptr;
2180 void setScheduleKind(OpenMPScheduleClauseKind K) {
Kind = K; }
2185 void setFirstScheduleModifier(OpenMPScheduleClauseModifier M) {
2186 Modifiers[FIRST] = M;
2192 void setSecondScheduleModifier(OpenMPScheduleClauseModifier M) {
2193 Modifiers[SECOND] = M;
2197 void setFirstScheduleModifierLoc(SourceLocation Loc) {
2198 ModifiersLoc[FIRST] = Loc;
2202 void setSecondScheduleModifierLoc(SourceLocation Loc) {
2203 ModifiersLoc[SECOND] = Loc;
2209 void setScheduleModifer(OpenMPScheduleClauseModifier M) {
2210 if (Modifiers[FIRST] == OMPC_SCHEDULE_MODIFIER_unknown)
2211 Modifiers[FIRST] = M;
2213 assert(Modifiers[SECOND] == OMPC_SCHEDULE_MODIFIER_unknown);
2214 Modifiers[SECOND] = M;
2221 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
2226 void setScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
2231 void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
2236 void setChunkSize(Expr *E) { ChunkSize = E; }
2254 OMPScheduleClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2255 SourceLocation KLoc, SourceLocation CommaLoc,
2256 SourceLocation EndLoc, OpenMPScheduleClauseKind Kind,
2257 Expr *ChunkSize, Stmt *HelperChunkSize,
2258 OpenMPScheduleClauseModifier M1, SourceLocation M1Loc,
2259 OpenMPScheduleClauseModifier M2, SourceLocation M2Loc)
2260 : OMPClause(llvm::omp::OMPC_schedule, StartLoc, EndLoc),
2261 OMPClauseWithPreInit(this), LParenLoc(LParenLoc),
Kind(
Kind),
2262 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
2263 setPreInitStmt(HelperChunkSize);
2264 Modifiers[FIRST] = M1;
2265 Modifiers[SECOND] = M2;
2266 ModifiersLoc[FIRST] = M1Loc;
2267 ModifiersLoc[SECOND] = M2Loc;
2271 explicit OMPScheduleClause()
2272 : OMPClause(llvm::omp::OMPC_schedule, SourceLocation(), SourceLocation()),
2273 OMPClauseWithPreInit(this) {
2283 return Modifiers[FIRST];
2288 return Modifiers[SECOND];
2292 SourceLocation getLParenLoc() {
return LParenLoc; }
2295 SourceLocation getScheduleKindLoc() {
return KindLoc; }
2298 SourceLocation getFirstScheduleModifierLoc()
const {
2299 return ModifiersLoc[FIRST];
2303 SourceLocation getSecondScheduleModifierLoc()
const {
2304 return ModifiersLoc[SECOND];
2308 SourceLocation getCommaLoc() {
return CommaLoc; }
2311 Expr *getChunkSize() {
return ChunkSize; }
2314 const Expr *getChunkSize()
const {
return ChunkSize; }
2317 return child_range(
reinterpret_cast<Stmt **
>(&ChunkSize),
2318 reinterpret_cast<Stmt **
>(&ChunkSize) + 1);
2321 const_child_range
children()
const {
2322 return const_cast<OMPScheduleClause *
>(
this)->
children();
2326 return child_range(child_iterator(), child_iterator());
2329 return const_child_range(const_child_iterator(), const_child_iterator());
2332 static bool classof(
const OMPClause *T) {
2333 return T->getClauseKind() == llvm::omp::OMPC_schedule;
2344class OMPOrderedClause final
2346 private llvm::TrailingObjects<OMPOrderedClause, Expr *> {
2347 friend class OMPClauseReader;
2348 friend TrailingObjects;
2351 SourceLocation LParenLoc;
2354 Stmt *NumForLoops =
nullptr;
2357 unsigned NumberOfLoops = 0;
2366 OMPOrderedClause(Expr *Num,
unsigned NumLoops, SourceLocation StartLoc,
2367 SourceLocation LParenLoc, SourceLocation EndLoc)
2368 : OMPClause(llvm::omp::OMPC_ordered, StartLoc, EndLoc),
2369 LParenLoc(LParenLoc), NumForLoops(
Num), NumberOfLoops(NumLoops) {}
2372 explicit OMPOrderedClause(
unsigned NumLoops)
2373 : OMPClause(llvm::omp::OMPC_ordered, SourceLocation(), SourceLocation()),
2374 NumberOfLoops(NumLoops) {}
2377 void setNumForLoops(Expr *Num) { NumForLoops =
Num; }
2387 static OMPOrderedClause *
Create(
const ASTContext &C, Expr *Num,
2388 unsigned NumLoops, SourceLocation StartLoc,
2389 SourceLocation LParenLoc,
2390 SourceLocation EndLoc);
2393 static OMPOrderedClause*
CreateEmpty(
const ASTContext &C,
unsigned NumLoops);
2396 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
2399 SourceLocation getLParenLoc()
const {
return LParenLoc; }
2402 Expr *getNumForLoops()
const {
return cast_or_null<Expr>(NumForLoops); }
2405 void setLoopNumIterations(
unsigned NumLoop, Expr *NumIterations);
2407 ArrayRef<Expr *> getLoopNumIterations()
const;
2410 void setLoopCounter(
unsigned NumLoop, Expr *Counter);
2412 Expr *getLoopCounter(
unsigned NumLoop);
2413 const Expr *getLoopCounter(
unsigned NumLoop)
const;
2415 child_range
children() {
return child_range(&NumForLoops, &NumForLoops + 1); }
2417 const_child_range
children()
const {
2418 return const_child_range(&NumForLoops, &NumForLoops + 1);
2422 return child_range(child_iterator(), child_iterator());
2425 return const_child_range(const_child_iterator(), const_child_iterator());
2428 static bool classof(
const OMPClause *T) {
2429 return T->getClauseKind() == llvm::omp::OMPC_ordered;
2440class OMPNowaitClause final :
public OMPClause {
2441 friend class OMPClauseReader;
2444 SourceLocation LParenLoc;
2459 OMPNowaitClause(Expr *Cond, SourceLocation StartLoc, SourceLocation LParenLoc,
2460 SourceLocation EndLoc)
2461 : OMPClause(llvm::omp::OMPC_nowait, StartLoc, EndLoc),
2466 : OMPClause(llvm::omp::OMPC_nowait, SourceLocation(), SourceLocation()) {}
2469 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
2472 SourceLocation getLParenLoc()
const {
return LParenLoc; }
2475 Expr *getCondition()
const {
return cast_or_null<Expr>(Condition); }
2479 return child_range(&Condition, &Condition + 1);
2480 return child_range(child_iterator(), child_iterator());
2483 const_child_range
children()
const {
2485 return const_child_range(&Condition, &Condition + 1);
2486 return const_child_range(const_child_iterator(), const_child_iterator());
2491 return const_cast<OMPNowaitClause *
>(
this)->
used_children();
2494 static bool classof(
const OMPClause *T) {
2495 return T->getClauseKind() == llvm::omp::OMPC_nowait;
2505class OMPUntiedClause :
public OMPClause {
2511 OMPUntiedClause(SourceLocation StartLoc, SourceLocation EndLoc)
2512 : OMPClause(llvm::omp::OMPC_untied, StartLoc, EndLoc) {}
2516 : OMPClause(llvm::omp::OMPC_untied, SourceLocation(), SourceLocation()) {}
2519 return child_range(child_iterator(), child_iterator());
2522 const_child_range
children()
const {
2523 return const_child_range(const_child_iterator(), const_child_iterator());
2527 return child_range(child_iterator(), child_iterator());
2530 return const_child_range(const_child_iterator(), const_child_iterator());
2533 static bool classof(
const OMPClause *T) {
2534 return T->getClauseKind() == llvm::omp::OMPC_untied;
2545class OMPMergeableClause :
public OMPClause {
2551 OMPMergeableClause(SourceLocation StartLoc, SourceLocation EndLoc)
2552 : OMPClause(llvm::omp::OMPC_mergeable, StartLoc, EndLoc) {}
2555 OMPMergeableClause()
2556 : OMPClause(llvm::omp::OMPC_mergeable, SourceLocation(),
2557 SourceLocation()) {}
2560 return child_range(child_iterator(), child_iterator());
2563 const_child_range
children()
const {
2564 return const_child_range(const_child_iterator(), const_child_iterator());
2568 return child_range(child_iterator(), child_iterator());
2571 return const_child_range(const_child_iterator(), const_child_iterator());
2574 static bool classof(
const OMPClause *T) {
2575 return T->getClauseKind() == llvm::omp::OMPC_mergeable;
2586class OMPAbsentClause final
2588 private llvm::TrailingObjects<OMPAbsentClause, OpenMPDirectiveKind> {
2589 friend OMPDirectiveListClause;
2590 friend TrailingObjects;
2598 OMPAbsentClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2599 SourceLocation EndLoc,
unsigned NumKinds)
2600 : OMPDirectiveListClause<OMPAbsentClause>(
2601 llvm::omp::OMPC_absent, StartLoc, LParenLoc, EndLoc, NumKinds) {}
2604 OMPAbsentClause(
unsigned NumKinds)
2605 : OMPDirectiveListClause<OMPAbsentClause>(
2606 llvm::omp::OMPC_absent, SourceLocation(), SourceLocation(),
2607 SourceLocation(), NumKinds) {}
2610 static OMPAbsentClause *
Create(
const ASTContext &C,
2611 ArrayRef<OpenMPDirectiveKind> DKVec,
2612 SourceLocation Loc, SourceLocation LLoc,
2613 SourceLocation RLoc);
2615 static OMPAbsentClause *
CreateEmpty(
const ASTContext &C,
unsigned NumKinds);
2617 static bool classof(
const OMPClause *C) {
2618 return C->getClauseKind() == llvm::omp::OMPC_absent;
2629class OMPContainsClause final
2631 private llvm::TrailingObjects<OMPContainsClause, OpenMPDirectiveKind> {
2632 friend OMPDirectiveListClause;
2633 friend TrailingObjects;
2641 OMPContainsClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2642 SourceLocation EndLoc,
unsigned NumKinds)
2643 : OMPDirectiveListClause<OMPContainsClause>(
2644 llvm::omp::OMPC_contains, StartLoc, LParenLoc, EndLoc, NumKinds) {}
2647 OMPContainsClause(
unsigned NumKinds)
2648 : OMPDirectiveListClause<OMPContainsClause>(
2649 llvm::omp::OMPC_contains, SourceLocation(), SourceLocation(),
2650 SourceLocation(), NumKinds) {}
2653 static OMPContainsClause *
Create(
const ASTContext &C,
2654 ArrayRef<OpenMPDirectiveKind> DKVec,
2655 SourceLocation Loc, SourceLocation LLoc,
2656 SourceLocation RLoc);
2658 static OMPContainsClause *
CreateEmpty(
const ASTContext &C,
unsigned NumKinds);
2660 static bool classof(
const OMPClause *C) {
2661 return C->getClauseKind() == llvm::omp::OMPC_contains;
2672class OMPHoldsClause final
2674 friend class OMPClauseReader;
2681 OMPHoldsClause(Expr *E, SourceLocation StartLoc, SourceLocation LParenLoc,
2682 SourceLocation EndLoc)
2683 : OMPOneStmtClause(E, StartLoc, LParenLoc, EndLoc) {}
2686 OMPHoldsClause() : OMPOneStmtClause() {}
2688 Expr *
getExpr()
const {
return getStmtAs<Expr>(); }
2689 void setExpr(Expr *E) { setStmt(E); }
2699class OMPNoOpenMPClause final
2706 OMPNoOpenMPClause(SourceLocation StartLoc, SourceLocation EndLoc)
2707 : OMPNoChildClause(StartLoc, EndLoc) {}
2710 OMPNoOpenMPClause() : OMPNoChildClause() {}
2721class OMPNoOpenMPRoutinesClause final
2728 OMPNoOpenMPRoutinesClause(SourceLocation StartLoc, SourceLocation EndLoc)
2729 : OMPNoChildClause(StartLoc, EndLoc) {}
2732 OMPNoOpenMPRoutinesClause() : OMPNoChildClause() {}
2743class OMPNoOpenMPConstructsClause final
2750 OMPNoOpenMPConstructsClause(SourceLocation StartLoc, SourceLocation EndLoc)
2751 : OMPNoChildClause(StartLoc, EndLoc) {}
2754 OMPNoOpenMPConstructsClause() : OMPNoChildClause() {}
2765class OMPNoParallelismClause final
2772 OMPNoParallelismClause(SourceLocation StartLoc, SourceLocation EndLoc)
2773 : OMPNoChildClause(StartLoc, EndLoc) {}
2776 OMPNoParallelismClause() : OMPNoChildClause() {}
2791 OMPReadClause(SourceLocation StartLoc, SourceLocation EndLoc)
2792 : OMPClause(llvm::omp::OMPC_read, StartLoc, EndLoc) {}
2796 : OMPClause(llvm::omp::OMPC_read, SourceLocation(), SourceLocation()) {}
2799 return child_range(child_iterator(), child_iterator());
2802 const_child_range
children()
const {
2803 return const_child_range(const_child_iterator(), const_child_iterator());
2807 return child_range(child_iterator(), child_iterator());
2810 return const_child_range(const_child_iterator(), const_child_iterator());
2813 static bool classof(
const OMPClause *T) {
2814 return T->getClauseKind() == llvm::omp::OMPC_read;
2824class OMPWriteClause :
public OMPClause {
2830 OMPWriteClause(SourceLocation StartLoc, SourceLocation EndLoc)
2831 : OMPClause(llvm::omp::OMPC_write, StartLoc, EndLoc) {}
2835 : OMPClause(llvm::omp::OMPC_write, SourceLocation(), SourceLocation()) {}
2838 return child_range(child_iterator(), child_iterator());
2841 const_child_range
children()
const {
2842 return const_child_range(const_child_iterator(), const_child_iterator());
2846 return child_range(child_iterator(), child_iterator());
2849 return const_child_range(const_child_iterator(), const_child_iterator());
2852 static bool classof(
const OMPClause *T) {
2853 return T->getClauseKind() == llvm::omp::OMPC_write;
2872class OMPUpdateClause final
2874 private llvm::TrailingObjects<OMPUpdateClause, SourceLocation,
2875 OpenMPDependClauseKind> {
2876 friend class OMPClauseReader;
2877 friend TrailingObjects;
2880 bool IsExtended =
false;
2884 size_t numTrailingObjects(OverloadToken<SourceLocation>)
const {
2886 return IsExtended ? 2 : 0;
2890 void setLParenLoc(SourceLocation Loc) {
2891 assert(IsExtended &&
"Expected extended clause.");
2892 *getTrailingObjects<SourceLocation>() = Loc;
2896 void setArgumentLoc(SourceLocation Loc) {
2897 assert(IsExtended &&
"Expected extended clause.");
2898 *std::next(getTrailingObjects<SourceLocation>(), 1) = Loc;
2902 void setDependencyKind(OpenMPDependClauseKind DK) {
2903 assert(IsExtended &&
"Expected extended clause.");
2904 *getTrailingObjects<OpenMPDependClauseKind>() = DK;
2911 OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc,
2913 : OMPClause(llvm::omp::OMPC_update, StartLoc, EndLoc),
2914 IsExtended(IsExtended) {}
2917 OMPUpdateClause(
bool IsExtended)
2918 : OMPClause(llvm::omp::OMPC_update, SourceLocation(), SourceLocation()),
2919 IsExtended(IsExtended) {}
2927 static OMPUpdateClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
2928 SourceLocation EndLoc);
2938 static OMPUpdateClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
2939 SourceLocation LParenLoc,
2940 SourceLocation ArgumentLoc,
2941 OpenMPDependClauseKind DK,
2942 SourceLocation EndLoc);
2949 static OMPUpdateClause *
CreateEmpty(
const ASTContext &C,
bool IsExtended);
2952 bool isExtended()
const {
return IsExtended; }
2955 return child_range(child_iterator(), child_iterator());
2958 const_child_range
children()
const {
2959 return const_child_range(const_child_iterator(), const_child_iterator());
2963 return child_range(child_iterator(), child_iterator());
2966 return const_child_range(const_child_iterator(), const_child_iterator());
2970 SourceLocation getLParenLoc()
const {
2971 assert(IsExtended &&
"Expected extended clause.");
2972 return *getTrailingObjects<SourceLocation>();
2976 SourceLocation getArgumentLoc()
const {
2977 assert(IsExtended &&
"Expected extended clause.");
2978 return *std::next(getTrailingObjects<SourceLocation>(), 1);
2983 assert(IsExtended &&
"Expected extended clause.");
2984 return *getTrailingObjects<OpenMPDependClauseKind>();
2987 static bool classof(
const OMPClause *T) {
2988 return T->getClauseKind() == llvm::omp::OMPC_update;
2999class OMPCaptureClause :
public OMPClause {
3005 OMPCaptureClause(SourceLocation StartLoc, SourceLocation EndLoc)
3006 : OMPClause(llvm::omp::OMPC_capture, StartLoc, EndLoc) {}
3010 : OMPClause(llvm::omp::OMPC_capture, SourceLocation(), SourceLocation()) {
3014 return child_range(child_iterator(), child_iterator());
3017 const_child_range
children()
const {
3018 return const_child_range(const_child_iterator(), const_child_iterator());
3022 return child_range(child_iterator(), child_iterator());
3025 return const_child_range(const_child_iterator(), const_child_iterator());
3028 static bool classof(
const OMPClause *T) {
3029 return T->getClauseKind() == llvm::omp::OMPC_capture;
3040class OMPCompareClause final :
public OMPClause {
3046 OMPCompareClause(SourceLocation StartLoc, SourceLocation EndLoc)
3047 : OMPClause(llvm::omp::OMPC_compare, StartLoc, EndLoc) {}
3051 : OMPClause(llvm::omp::OMPC_compare, SourceLocation(), SourceLocation()) {
3055 return child_range(child_iterator(), child_iterator());
3058 const_child_range
children()
const {
3059 return const_child_range(const_child_iterator(), const_child_iterator());
3063 return child_range(child_iterator(), child_iterator());
3066 return const_child_range(const_child_iterator(), const_child_iterator());
3069 static bool classof(
const OMPClause *T) {
3070 return T->getClauseKind() == llvm::omp::OMPC_compare;
3081class OMPSeqCstClause :
public OMPClause {
3087 OMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc)
3088 : OMPClause(llvm::omp::OMPC_seq_cst, StartLoc, EndLoc) {}
3092 : OMPClause(llvm::omp::OMPC_seq_cst, SourceLocation(), SourceLocation()) {
3096 return child_range(child_iterator(), child_iterator());
3099 const_child_range
children()
const {
3100 return const_child_range(const_child_iterator(), const_child_iterator());
3104 return child_range(child_iterator(), child_iterator());
3107 return const_child_range(const_child_iterator(), const_child_iterator());
3110 static bool classof(
const OMPClause *T) {
3111 return T->getClauseKind() == llvm::omp::OMPC_seq_cst;
3122class OMPAcqRelClause final :
public OMPClause {
3128 OMPAcqRelClause(SourceLocation StartLoc, SourceLocation EndLoc)
3129 : OMPClause(llvm::omp::OMPC_acq_rel, StartLoc, EndLoc) {}
3133 : OMPClause(llvm::omp::OMPC_acq_rel, SourceLocation(), SourceLocation()) {
3137 return child_range(child_iterator(), child_iterator());
3140 const_child_range
children()
const {
3141 return const_child_range(const_child_iterator(), const_child_iterator());
3145 return child_range(child_iterator(), child_iterator());
3148 return const_child_range(const_child_iterator(), const_child_iterator());
3151 static bool classof(
const OMPClause *T) {
3152 return T->getClauseKind() == llvm::omp::OMPC_acq_rel;
3163class OMPAcquireClause final :
public OMPClause {
3169 OMPAcquireClause(SourceLocation StartLoc, SourceLocation EndLoc)
3170 : OMPClause(llvm::omp::OMPC_acquire, StartLoc, EndLoc) {}
3174 : OMPClause(llvm::omp::OMPC_acquire, SourceLocation(), SourceLocation()) {
3178 return child_range(child_iterator(), child_iterator());
3181 const_child_range
children()
const {
3182 return const_child_range(const_child_iterator(), const_child_iterator());
3186 return child_range(child_iterator(), child_iterator());
3189 return const_child_range(const_child_iterator(), const_child_iterator());
3192 static bool classof(
const OMPClause *T) {
3193 return T->getClauseKind() == llvm::omp::OMPC_acquire;
3204class OMPReleaseClause final :
public OMPClause {
3210 OMPReleaseClause(SourceLocation StartLoc, SourceLocation EndLoc)
3211 : OMPClause(llvm::omp::OMPC_release, StartLoc, EndLoc) {}
3215 : OMPClause(llvm::omp::OMPC_release, SourceLocation(), SourceLocation()) {
3219 return child_range(child_iterator(), child_iterator());
3222 const_child_range
children()
const {
3223 return const_child_range(const_child_iterator(), const_child_iterator());
3227 return child_range(child_iterator(), child_iterator());
3230 return const_child_range(const_child_iterator(), const_child_iterator());
3233 static bool classof(
const OMPClause *T) {
3234 return T->getClauseKind() == llvm::omp::OMPC_release;
3245class OMPRelaxedClause final :
public OMPClause {
3251 OMPRelaxedClause(SourceLocation StartLoc, SourceLocation EndLoc)
3252 : OMPClause(llvm::omp::OMPC_relaxed, StartLoc, EndLoc) {}
3256 : OMPClause(llvm::omp::OMPC_relaxed, SourceLocation(), SourceLocation()) {
3260 return child_range(child_iterator(), child_iterator());
3263 const_child_range
children()
const {
3264 return const_child_range(const_child_iterator(), const_child_iterator());
3268 return child_range(child_iterator(), child_iterator());
3271 return const_child_range(const_child_iterator(), const_child_iterator());
3274 static bool classof(
const OMPClause *T) {
3275 return T->getClauseKind() == llvm::omp::OMPC_relaxed;
3286class OMPWeakClause final :
public OMPClause {
3292 OMPWeakClause(SourceLocation StartLoc, SourceLocation EndLoc)
3293 : OMPClause(llvm::omp::OMPC_weak, StartLoc, EndLoc) {}
3297 : OMPClause(llvm::omp::OMPC_weak, SourceLocation(), SourceLocation()) {}
3300 return child_range(child_iterator(), child_iterator());
3303 const_child_range
children()
const {
3304 return const_child_range(const_child_iterator(), const_child_iterator());
3308 return child_range(child_iterator(), child_iterator());
3311 return const_child_range(const_child_iterator(), const_child_iterator());
3314 static bool classof(
const OMPClause *T) {
3315 return T->getClauseKind() == llvm::omp::OMPC_weak;
3326class OMPFailClause final :
public OMPClause {
3331 SourceLocation FailParameterLoc;
3332 SourceLocation LParenLoc;
3334 friend class OMPClauseReader;
3337 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
3340 void setFailParameterLoc(SourceLocation Loc) { FailParameterLoc = Loc; }
3343 void setFailParameter(OpenMPClauseKind FailParameter) {
3344 this->FailParameter = FailParameter;
3346 "Invalid fail clause parameter");
3354 OMPFailClause(SourceLocation StartLoc, SourceLocation EndLoc)
3355 : OMPClause(llvm::omp::OMPC_fail, StartLoc, EndLoc) {}
3357 OMPFailClause(OpenMPClauseKind FailParameter, SourceLocation FailParameterLoc,
3358 SourceLocation StartLoc, SourceLocation LParenLoc,
3359 SourceLocation EndLoc)
3360 : OMPClause(llvm::omp::OMPC_fail, StartLoc, EndLoc),
3361 FailParameterLoc(FailParameterLoc), LParenLoc(LParenLoc) {
3363 setFailParameter(FailParameter);
3368 : OMPClause(llvm::omp::OMPC_fail, SourceLocation(), SourceLocation()) {}
3371 return child_range(child_iterator(), child_iterator());
3374 const_child_range
children()
const {
3375 return const_child_range(const_child_iterator(), const_child_iterator());
3379 return child_range(child_iterator(), child_iterator());
3382 return const_child_range(const_child_iterator(), const_child_iterator());
3385 static bool classof(
const OMPClause *T) {
3386 return T->getClauseKind() == llvm::omp::OMPC_fail;
3390 SourceLocation getLParenLoc()
const {
3396 SourceLocation getFailParameterLoc()
const {
return FailParameterLoc; }
3409class OMPPrivateClause final
3411 private llvm::TrailingObjects<OMPPrivateClause, Expr *> {
3412 friend class OMPClauseReader;
3413 friend OMPVarListClause;
3414 friend TrailingObjects;
3422 OMPPrivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3423 SourceLocation EndLoc,
unsigned N)
3424 : OMPVarListClause<OMPPrivateClause>(llvm::omp::OMPC_private, StartLoc,
3425 LParenLoc, EndLoc, N) {}
3430 explicit OMPPrivateClause(
unsigned N)
3431 : OMPVarListClause<OMPPrivateClause>(llvm::omp::OMPC_private,
3432 SourceLocation(), SourceLocation(),
3433 SourceLocation(), N) {}
3438 void setPrivateCopies(ArrayRef<Expr *> VL);
3442 MutableArrayRef<Expr *> getPrivateCopies() {
3443 return {varlist_end(), varlist_size()};
3445 ArrayRef<const Expr *> getPrivateCopies()
const {
3446 return {varlist_end(), varlist_size()};
3458 static OMPPrivateClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
3459 SourceLocation LParenLoc,
3460 SourceLocation EndLoc, ArrayRef<Expr *> VL,
3461 ArrayRef<Expr *> PrivateVL);
3467 static OMPPrivateClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
3469 using private_copies_iterator = MutableArrayRef<Expr *>::iterator;
3470 using private_copies_const_iterator = ArrayRef<const Expr *>::iterator;
3471 using private_copies_range = llvm::iterator_range<private_copies_iterator>;
3472 using private_copies_const_range =
3473 llvm::iterator_range<private_copies_const_iterator>;
3475 private_copies_range private_copies() {
return getPrivateCopies(); }
3477 private_copies_const_range private_copies()
const {
3478 return getPrivateCopies();
3482 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3483 reinterpret_cast<Stmt **
>(varlist_end()));
3486 const_child_range
children()
const {
3487 return const_cast<OMPPrivateClause *
>(
this)->
children();
3491 return child_range(child_iterator(), child_iterator());
3494 return const_child_range(const_child_iterator(), const_child_iterator());
3497 static bool classof(
const OMPClause *T) {
3498 return T->getClauseKind() == llvm::omp::OMPC_private;
3510class OMPFirstprivateClause final
3513 private llvm::TrailingObjects<OMPFirstprivateClause, Expr *> {
3514 friend class OMPClauseReader;
3515 friend OMPVarListClause;
3516 friend TrailingObjects;
3524 OMPFirstprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3525 SourceLocation EndLoc,
unsigned N)
3526 : OMPVarListClause<OMPFirstprivateClause>(llvm::omp::OMPC_firstprivate,
3527 StartLoc, LParenLoc, EndLoc, N),
3528 OMPClauseWithPreInit(this) {}
3533 explicit OMPFirstprivateClause(
unsigned N)
3534 : OMPVarListClause<OMPFirstprivateClause>(
3535 llvm::omp::OMPC_firstprivate, SourceLocation(), SourceLocation(),
3536 SourceLocation(), N),
3537 OMPClauseWithPreInit(this) {}
3542 void setPrivateCopies(ArrayRef<Expr *> VL);
3546 MutableArrayRef<Expr *> getPrivateCopies() {
3547 return {varlist_end(), varlist_size()};
3549 ArrayRef<const Expr *> getPrivateCopies()
const {
3550 return {varlist_end(), varlist_size()};
3556 void setInits(ArrayRef<Expr *> VL);
3560 MutableArrayRef<Expr *>
getInits() {
3561 return {getPrivateCopies().end(), varlist_size()};
3563 ArrayRef<const Expr *>
getInits()
const {
3564 return {getPrivateCopies().end(), varlist_size()};
3581 static OMPFirstprivateClause *
3582 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
3583 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PrivateVL,
3584 ArrayRef<Expr *> InitVL, Stmt *PreInit);
3590 static OMPFirstprivateClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
3592 using private_copies_iterator = MutableArrayRef<Expr *>::iterator;
3593 using private_copies_const_iterator = ArrayRef<const Expr *>::iterator;
3594 using private_copies_range = llvm::iterator_range<private_copies_iterator>;
3595 using private_copies_const_range =
3596 llvm::iterator_range<private_copies_const_iterator>;
3598 private_copies_range private_copies() {
return getPrivateCopies(); }
3599 private_copies_const_range private_copies()
const {
3600 return getPrivateCopies();
3605 using inits_range = llvm::iterator_range<inits_iterator>;
3612 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3613 reinterpret_cast<Stmt **
>(varlist_end()));
3616 const_child_range
children()
const {
3617 return const_cast<OMPFirstprivateClause *
>(
this)->
children();
3621 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3622 reinterpret_cast<Stmt **
>(varlist_end()));
3625 return const_cast<OMPFirstprivateClause *
>(
this)->
used_children();
3628 static bool classof(
const OMPClause *T) {
3629 return T->getClauseKind() == llvm::omp::OMPC_firstprivate;
3641class OMPLastprivateClause final
3644 private llvm::TrailingObjects<OMPLastprivateClause, Expr *> {
3661 friend class OMPClauseReader;
3662 friend OMPVarListClause;
3663 friend TrailingObjects;
3668 SourceLocation LPKindLoc;
3670 SourceLocation ColonLoc;
3678 OMPLastprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3679 SourceLocation EndLoc, OpenMPLastprivateModifier LPKind,
3680 SourceLocation LPKindLoc, SourceLocation ColonLoc,
3682 : OMPVarListClause<OMPLastprivateClause>(llvm::omp::OMPC_lastprivate,
3683 StartLoc, LParenLoc, EndLoc, N),
3684 OMPClauseWithPostUpdate(this), LPKind(LPKind), LPKindLoc(LPKindLoc),
3685 ColonLoc(ColonLoc) {}
3690 explicit OMPLastprivateClause(
unsigned N)
3691 : OMPVarListClause<OMPLastprivateClause>(
3692 llvm::omp::OMPC_lastprivate, SourceLocation(), SourceLocation(),
3693 SourceLocation(), N),
3694 OMPClauseWithPostUpdate(this) {}
3698 MutableArrayRef<Expr *> getPrivateCopies() {
3699 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
3701 ArrayRef<const Expr *> getPrivateCopies()
const {
3702 return {varlist_end(), varlist_size()};
3709 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
3712 MutableArrayRef<Expr *> getSourceExprs() {
3713 return {getPrivateCopies().end(), varlist_size()};
3715 ArrayRef<const Expr *> getSourceExprs()
const {
3716 return {getPrivateCopies().end(), varlist_size()};
3723 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
3726 MutableArrayRef<Expr *> getDestinationExprs() {
3727 return {getSourceExprs().end(), varlist_size()};
3729 ArrayRef<const Expr *> getDestinationExprs()
const {
3730 return {getSourceExprs().end(), varlist_size()};
3736 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
3739 MutableArrayRef<Expr *> getAssignmentOps() {
3740 return {getDestinationExprs().end(), varlist_size()};
3742 ArrayRef<const Expr *> getAssignmentOps()
const {
3743 return {getDestinationExprs().end(), varlist_size()};
3747 void setKind(OpenMPLastprivateModifier Kind) { LPKind =
Kind; }
3749 void setKindLoc(SourceLocation Loc) { LPKindLoc = Loc; }
3751 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
3781 static OMPLastprivateClause *
3782 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
3783 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
3784 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps,
3785 OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc,
3786 SourceLocation ColonLoc, Stmt *PreInit, Expr *PostUpdate);
3792 static OMPLastprivateClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
3797 SourceLocation getKindLoc()
const {
return LPKindLoc; }
3799 SourceLocation
getColonLoc()
const {
return ColonLoc; }
3801 using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
3802 using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
3803 using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
3804 using helper_expr_const_range =
3805 llvm::iterator_range<helper_expr_const_iterator>;
3809 void setPrivateCopies(ArrayRef<Expr *> PrivateCopies);
3811 helper_expr_const_range private_copies()
const {
return getPrivateCopies(); }
3813 helper_expr_range private_copies() {
return getPrivateCopies(); }
3815 helper_expr_const_range source_exprs()
const {
return getSourceExprs(); }
3817 helper_expr_range source_exprs() {
return getSourceExprs(); }
3819 helper_expr_const_range destination_exprs()
const {
3820 return getDestinationExprs();
3823 helper_expr_range destination_exprs() {
return getDestinationExprs(); }
3825 helper_expr_const_range assignment_ops()
const {
return getAssignmentOps(); }
3827 helper_expr_range assignment_ops() {
return getAssignmentOps(); }
3830 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3831 reinterpret_cast<Stmt **
>(varlist_end()));
3834 const_child_range
children()
const {
3835 return const_cast<OMPLastprivateClause *
>(
this)->
children();
3839 return child_range(child_iterator(), child_iterator());
3842 return const_child_range(const_child_iterator(), const_child_iterator());
3845 static bool classof(
const OMPClause *T) {
3846 return T->getClauseKind() == llvm::omp::OMPC_lastprivate;
3857class OMPSharedClause final
3859 private llvm::TrailingObjects<OMPSharedClause, Expr *> {
3860 friend OMPVarListClause;
3861 friend TrailingObjects;
3869 OMPSharedClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3870 SourceLocation EndLoc,
unsigned N)
3871 : OMPVarListClause<OMPSharedClause>(llvm::omp::OMPC_shared, StartLoc,
3872 LParenLoc, EndLoc, N) {}
3877 explicit OMPSharedClause(
unsigned N)
3878 : OMPVarListClause<OMPSharedClause>(llvm::omp::OMPC_shared,
3879 SourceLocation(), SourceLocation(),
3880 SourceLocation(), N) {}
3890 static OMPSharedClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
3891 SourceLocation LParenLoc,
3892 SourceLocation EndLoc, ArrayRef<Expr *> VL);
3898 static OMPSharedClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
3901 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3902 reinterpret_cast<Stmt **
>(varlist_end()));
3905 const_child_range
children()
const {
3906 return const_cast<OMPSharedClause *
>(
this)->
children();
3910 return child_range(child_iterator(), child_iterator());
3913 return const_child_range(const_child_iterator(), const_child_iterator());
3916 static bool classof(
const OMPClause *T) {
3917 return T->getClauseKind() == llvm::omp::OMPC_shared;
3929class OMPReductionClause final
3932 private llvm::TrailingObjects<OMPReductionClause, Expr *, bool> {
3933 friend class OMPClauseReader;
3934 friend OMPVarListClause;
3935 friend TrailingObjects;
3942 OMPC_ORIGINAL_SHARING_default;
3945 SourceLocation ModifierLoc;
3948 SourceLocation ColonLoc;
3951 NestedNameSpecifierLoc QualifierLoc;
3954 DeclarationNameInfo NameInfo;
3966 OMPReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3967 SourceLocation ModifierLoc, SourceLocation ColonLoc,
3968 SourceLocation EndLoc,
3969 OpenMPReductionClauseModifier Modifier,
3970 OpenMPOriginalSharingModifier OriginalSharingModifier,
3971 unsigned N, NestedNameSpecifierLoc QualifierLoc,
3972 const DeclarationNameInfo &NameInfo)
3973 : OMPVarListClause<OMPReductionClause>(llvm::omp::OMPC_reduction,
3974 StartLoc, LParenLoc, EndLoc, N),
3975 OMPClauseWithPostUpdate(this), Modifier(Modifier),
3976 OriginalSharingModifier(OriginalSharingModifier),
3977 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc),
3978 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
3983 explicit OMPReductionClause(
unsigned N)
3984 : OMPVarListClause<OMPReductionClause>(llvm::omp::OMPC_reduction,
3985 SourceLocation(), SourceLocation(),
3986 SourceLocation(), N),
3987 OMPClauseWithPostUpdate(this) {}
3990 void setModifier(OpenMPReductionClauseModifier M) { Modifier = M; }
3993 void setOriginalSharingModifier(OpenMPOriginalSharingModifier M) {
3994 OriginalSharingModifier = M;
4001 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
4004 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
4007 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
4016 return {varlist_end(), varlist_size()};
4019 return {varlist_end(), varlist_size()};
4025 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
4028 MutableArrayRef<Expr *> getLHSExprs() {
4031 ArrayRef<const Expr *> getLHSExprs()
const {
4040 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
4043 void setPrivateVariableReductionFlags(ArrayRef<bool> Flags) {
4044 assert(Flags.size() == varlist_size() &&
4045 "Number of private flags does not match vars");
4046 llvm::copy(Flags, getTrailingObjects<bool>());
4050 MutableArrayRef<bool> getPrivateVariableReductionFlags() {
4051 return getTrailingObjects<bool>(varlist_size());
4053 ArrayRef<bool> getPrivateVariableReductionFlags()
const {
4054 return getTrailingObjects<bool>(varlist_size());
4058 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4059 return varlist_size() * (Modifier == OMPC_REDUCTION_inscan ? 8 : 5);
4063 size_t numTrailingObjects(OverloadToken<bool>)
const {
4064 return varlist_size();
4068 MutableArrayRef<Expr *> getRHSExprs() {
4069 return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
4071 ArrayRef<const Expr *> getRHSExprs()
const {
4072 return {getLHSExprs().end(), varlist_size()};
4079 void setReductionOps(ArrayRef<Expr *> ReductionOps);
4082 MutableArrayRef<Expr *> getReductionOps() {
4083 return {getRHSExprs().end(), varlist_size()};
4085 ArrayRef<const Expr *> getReductionOps()
const {
4086 return {getRHSExprs().end(), varlist_size()};
4091 void setInscanCopyOps(ArrayRef<Expr *> Ops);
4094 MutableArrayRef<Expr *> getInscanCopyOps() {
4095 return {getReductionOps().end(), varlist_size()};
4097 ArrayRef<const Expr *> getInscanCopyOps()
const {
4098 return {getReductionOps().end(), varlist_size()};
4102 void setInscanCopyArrayTemps(ArrayRef<Expr *> CopyArrayTemps);
4105 MutableArrayRef<Expr *> getInscanCopyArrayTemps() {
4106 return {getInscanCopyOps().end(), varlist_size()};
4108 ArrayRef<const Expr *> getInscanCopyArrayTemps()
const {
4109 return {getInscanCopyOps().end(), varlist_size()};
4113 void setInscanCopyArrayElems(ArrayRef<Expr *> CopyArrayElems);
4116 MutableArrayRef<Expr *> getInscanCopyArrayElems() {
4117 return {getInscanCopyArrayTemps().end(), varlist_size()};
4119 ArrayRef<const Expr *> getInscanCopyArrayElems()
const {
4120 return {getInscanCopyArrayTemps().end(), varlist_size()};
4164 static OMPReductionClause *
4165 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
4166 SourceLocation ModifierLoc, SourceLocation ColonLoc,
4167 SourceLocation EndLoc, OpenMPReductionClauseModifier Modifier,
4168 ArrayRef<Expr *> VL, NestedNameSpecifierLoc QualifierLoc,
4169 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
4170 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
4171 ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> CopyOps,
4172 ArrayRef<Expr *> CopyArrayTemps, ArrayRef<Expr *> CopyArrayElems,
4173 Stmt *PreInit, Expr *PostUpdate, ArrayRef<bool> IsPrivateVarReduction,
4174 OpenMPOriginalSharingModifier OriginalSharingModifier);
4181 static OMPReductionClause *
4183 OpenMPReductionClauseModifier Modifier);
4190 return OriginalSharingModifier;
4197 SourceLocation
getColonLoc()
const {
return ColonLoc; }
4200 const DeclarationNameInfo &getNameInfo()
const {
return NameInfo; }
4203 NestedNameSpecifierLoc getQualifierLoc()
const {
return QualifierLoc; }
4205 using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
4206 using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
4207 using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
4208 using helper_expr_const_range =
4209 llvm::iterator_range<helper_expr_const_iterator>;
4210 using helper_flag_iterator = MutableArrayRef<bool>::iterator;
4211 using helper_flag_const_iterator = ArrayRef<bool>::iterator;
4212 using helper_flag_range = llvm::iterator_range<helper_flag_iterator>;
4213 using helper_flag_const_range =
4214 llvm::iterator_range<helper_flag_const_iterator>;
4220 helper_expr_const_range lhs_exprs()
const {
return getLHSExprs(); }
4222 helper_expr_range lhs_exprs() {
return getLHSExprs(); }
4224 helper_expr_const_range rhs_exprs()
const {
return getRHSExprs(); }
4226 helper_expr_range rhs_exprs() {
return getRHSExprs(); }
4228 helper_flag_const_range private_var_reduction_flags()
const {
4229 return getPrivateVariableReductionFlags();
4232 helper_flag_range private_var_reduction_flags() {
4233 return getPrivateVariableReductionFlags();
4236 helper_expr_const_range reduction_ops()
const {
return getReductionOps(); }
4238 helper_expr_range reduction_ops() {
return getReductionOps(); }
4240 helper_expr_const_range copy_ops()
const {
return getInscanCopyOps(); }
4242 helper_expr_range copy_ops() {
return getInscanCopyOps(); }
4244 helper_expr_const_range copy_array_temps()
const {
4245 return getInscanCopyArrayTemps();
4248 helper_expr_range copy_array_temps() {
return getInscanCopyArrayTemps(); }
4250 helper_expr_const_range copy_array_elems()
const {
4251 return getInscanCopyArrayElems();
4254 helper_expr_range copy_array_elems() {
return getInscanCopyArrayElems(); }
4257 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4258 reinterpret_cast<Stmt **
>(varlist_end()));
4261 const_child_range
children()
const {
4262 return const_cast<OMPReductionClause *
>(
this)->
children();
4266 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4267 reinterpret_cast<Stmt **
>(varlist_end()));
4270 return const_cast<OMPReductionClause *
>(
this)->
used_children();
4273 static bool classof(
const OMPClause *T) {
4274 return T->getClauseKind() == llvm::omp::OMPC_reduction;
4286class OMPTaskReductionClause final
4289 private llvm::TrailingObjects<OMPTaskReductionClause, Expr *> {
4290 friend class OMPClauseReader;
4291 friend OMPVarListClause;
4292 friend TrailingObjects;
4295 SourceLocation ColonLoc;
4298 NestedNameSpecifierLoc QualifierLoc;
4301 DeclarationNameInfo NameInfo;
4312 OMPTaskReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4313 SourceLocation ColonLoc, SourceLocation EndLoc,
4314 unsigned N, NestedNameSpecifierLoc QualifierLoc,
4315 const DeclarationNameInfo &NameInfo)
4316 : OMPVarListClause<OMPTaskReductionClause>(
4317 llvm::omp::OMPC_task_reduction, StartLoc, LParenLoc, EndLoc, N),
4318 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
4319 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
4324 explicit OMPTaskReductionClause(
unsigned N)
4325 : OMPVarListClause<OMPTaskReductionClause>(
4326 llvm::omp::OMPC_task_reduction, SourceLocation(), SourceLocation(),
4327 SourceLocation(), N),
4328 OMPClauseWithPostUpdate(this) {}
4331 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
4334 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
4337 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
4345 return {varlist_end(), varlist_size()};
4348 return {varlist_end(), varlist_size()};
4354 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
4357 MutableArrayRef<Expr *> getLHSExprs() {
4360 ArrayRef<const Expr *> getLHSExprs()
const {
4368 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
4371 MutableArrayRef<Expr *> getRHSExprs() {
4372 return {getLHSExprs().end(), varlist_size()};
4374 ArrayRef<const Expr *> getRHSExprs()
const {
4375 return {getLHSExprs().end(), varlist_size()};
4382 void setReductionOps(ArrayRef<Expr *> ReductionOps);
4385 MutableArrayRef<Expr *> getReductionOps() {
4386 return {getRHSExprs().end(), varlist_size()};
4388 ArrayRef<const Expr *> getReductionOps()
const {
4389 return {getRHSExprs().end(), varlist_size()};
4425 static OMPTaskReductionClause *
4426 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
4427 SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
4428 NestedNameSpecifierLoc QualifierLoc,
4429 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
4430 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
4431 ArrayRef<Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate);
4437 static OMPTaskReductionClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
4440 SourceLocation
getColonLoc()
const {
return ColonLoc; }
4443 const DeclarationNameInfo &getNameInfo()
const {
return NameInfo; }
4446 NestedNameSpecifierLoc getQualifierLoc()
const {
return QualifierLoc; }
4448 using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
4449 using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
4450 using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
4451 using helper_expr_const_range =
4452 llvm::iterator_range<helper_expr_const_iterator>;
4458 helper_expr_const_range lhs_exprs()
const {
return getLHSExprs(); }
4460 helper_expr_range lhs_exprs() {
return getLHSExprs(); }
4462 helper_expr_const_range rhs_exprs()
const {
return getRHSExprs(); }
4464 helper_expr_range rhs_exprs() {
return getRHSExprs(); }
4466 helper_expr_const_range reduction_ops()
const {
return getReductionOps(); }
4468 helper_expr_range reduction_ops() {
return getReductionOps(); }
4471 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4472 reinterpret_cast<Stmt **
>(varlist_end()));
4475 const_child_range
children()
const {
4476 return const_cast<OMPTaskReductionClause *
>(
this)->
children();
4480 return child_range(child_iterator(), child_iterator());
4483 return const_child_range(const_child_iterator(), const_child_iterator());
4486 static bool classof(
const OMPClause *T) {
4487 return T->getClauseKind() == llvm::omp::OMPC_task_reduction;
4498class OMPInReductionClause final
4501 private llvm::TrailingObjects<OMPInReductionClause, Expr *> {
4502 friend class OMPClauseReader;
4503 friend OMPVarListClause;
4504 friend TrailingObjects;
4507 SourceLocation ColonLoc;
4510 NestedNameSpecifierLoc QualifierLoc;
4513 DeclarationNameInfo NameInfo;
4524 OMPInReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4525 SourceLocation ColonLoc, SourceLocation EndLoc,
4526 unsigned N, NestedNameSpecifierLoc QualifierLoc,
4527 const DeclarationNameInfo &NameInfo)
4528 : OMPVarListClause<OMPInReductionClause>(llvm::omp::OMPC_in_reduction,
4529 StartLoc, LParenLoc, EndLoc, N),
4530 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
4531 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
4536 explicit OMPInReductionClause(
unsigned N)
4537 : OMPVarListClause<OMPInReductionClause>(
4538 llvm::omp::OMPC_in_reduction, SourceLocation(), SourceLocation(),
4539 SourceLocation(), N),
4540 OMPClauseWithPostUpdate(this) {}
4543 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
4546 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
4549 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
4557 return {varlist_end(), varlist_size()};
4560 return {varlist_end(), varlist_size()};
4566 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
4569 MutableArrayRef<Expr *> getLHSExprs() {
4572 ArrayRef<const Expr *> getLHSExprs()
const {
4580 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
4583 MutableArrayRef<Expr *> getRHSExprs() {
4584 return {getLHSExprs().end(), varlist_size()};
4586 ArrayRef<const Expr *> getRHSExprs()
const {
4587 return {getLHSExprs().end(), varlist_size()};
4594 void setReductionOps(ArrayRef<Expr *> ReductionOps);
4597 MutableArrayRef<Expr *> getReductionOps() {
4598 return {getRHSExprs().end(), varlist_size()};
4600 ArrayRef<const Expr *> getReductionOps()
const {
4601 return {getRHSExprs().end(), varlist_size()};
4605 void setTaskgroupDescriptors(ArrayRef<Expr *> ReductionOps);
4608 MutableArrayRef<Expr *> getTaskgroupDescriptors() {
4609 return {getReductionOps().end(), varlist_size()};
4611 ArrayRef<const Expr *> getTaskgroupDescriptors()
const {
4612 return {getReductionOps().end(), varlist_size()};
4650 static OMPInReductionClause *
4651 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
4652 SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
4653 NestedNameSpecifierLoc QualifierLoc,
4654 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
4655 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
4656 ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> TaskgroupDescriptors,
4657 Stmt *PreInit, Expr *PostUpdate);
4663 static OMPInReductionClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
4666 SourceLocation
getColonLoc()
const {
return ColonLoc; }
4669 const DeclarationNameInfo &getNameInfo()
const {
return NameInfo; }
4672 NestedNameSpecifierLoc getQualifierLoc()
const {
return QualifierLoc; }
4674 using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
4675 using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
4676 using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
4677 using helper_expr_const_range =
4678 llvm::iterator_range<helper_expr_const_iterator>;
4684 helper_expr_const_range lhs_exprs()
const {
return getLHSExprs(); }
4686 helper_expr_range lhs_exprs() {
return getLHSExprs(); }
4688 helper_expr_const_range rhs_exprs()
const {
return getRHSExprs(); }
4690 helper_expr_range rhs_exprs() {
return getRHSExprs(); }
4692 helper_expr_const_range reduction_ops()
const {
return getReductionOps(); }
4694 helper_expr_range reduction_ops() {
return getReductionOps(); }
4696 helper_expr_const_range taskgroup_descriptors()
const {
4697 return getTaskgroupDescriptors();
4700 helper_expr_range taskgroup_descriptors() {
4701 return getTaskgroupDescriptors();
4705 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4706 reinterpret_cast<Stmt **
>(varlist_end()));
4709 const_child_range
children()
const {
4710 return const_cast<OMPInReductionClause *
>(
this)->
children();
4714 return child_range(child_iterator(), child_iterator());
4717 return const_child_range(const_child_iterator(), const_child_iterator());
4720 static bool classof(
const OMPClause *T) {
4721 return T->getClauseKind() == llvm::omp::OMPC_in_reduction;
4733class OMPLinearClause final
4736 private llvm::TrailingObjects<OMPLinearClause, Expr *> {
4737 friend class OMPClauseReader;
4738 friend OMPVarListClause;
4739 friend TrailingObjects;
4745 SourceLocation ModifierLoc;
4748 SourceLocation ColonLoc;
4751 SourceLocation StepModifierLoc;
4754 void setStep(Expr *Step) { *(
getFinals().end()) = Step; }
4757 void setCalcStep(Expr *CalcStep) { *(
getFinals().end() + 1) = CalcStep; }
4767 OMPLinearClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4768 OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc,
4769 SourceLocation ColonLoc, SourceLocation StepModifierLoc,
4770 SourceLocation EndLoc,
unsigned NumVars)
4771 : OMPVarListClause<OMPLinearClause>(llvm::omp::OMPC_linear, StartLoc,
4772 LParenLoc, EndLoc, NumVars),
4773 OMPClauseWithPostUpdate(this), Modifier(Modifier),
4774 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc),
4775 StepModifierLoc(StepModifierLoc) {}
4780 explicit OMPLinearClause(
unsigned NumVars)
4781 : OMPVarListClause<OMPLinearClause>(llvm::omp::OMPC_linear,
4782 SourceLocation(), SourceLocation(),
4783 SourceLocation(), NumVars),
4784 OMPClauseWithPostUpdate(this) {}
4799 return {varlist_end(), varlist_size()};
4802 return {varlist_end(), varlist_size()};
4809 return {getPrivates().end(), varlist_size()};
4814 return {
getInits().end(), varlist_size()};
4817 return {getInits().end(), varlist_size()};
4825 return {getUpdates().end(), varlist_size()};
4830 return {
getFinals().end() + 2, varlist_size() + 1};
4833 return {getFinals().end() + 2, varlist_size() + 1};
4865 static OMPLinearClause *
4907 const Expr *getStep()
const {
return *(getFinals().end()); }
4913 const Expr *getCalcStep()
const {
return *(getFinals().end() + 1); }
4933 privates_const_range privates()
const {
return getPrivates(); }
4942 inits_const_range inits()
const {
return getInits(); }
4951 updates_const_range updates()
const {
return getUpdates(); }
4960 finals_const_range finals()
const {
return getFinals(); }
4965 llvm::iterator_range<used_expressions_iterator>;
4967 llvm::iterator_range<used_expressions_const_iterator>;
4973 used_expressions_const_range used_expressions()
const {
4974 return finals_const_range(getUsedExprs().begin(), getUsedExprs().end());
4978 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4979 reinterpret_cast<Stmt **
>(varlist_end()));
4982 const_child_range children()
const {
4983 return const_cast<OMPLinearClause *
>(
this)->children();
4989 return const_cast<OMPLinearClause *
>(
this)->
used_children();
4993 return T->getClauseKind() == llvm::omp::OMPC_linear;
5005class OMPAlignedClause final
5006 :
public OMPVarListClause<OMPAlignedClause>,
5007 private llvm::TrailingObjects<OMPAlignedClause, Expr *> {
5009 friend OMPVarListClause;
5010 friend TrailingObjects;
5013 SourceLocation ColonLoc;
5016 void setAlignment(Expr *A) { *varlist_end() = A; }
5026 SourceLocation ColonLoc, SourceLocation EndLoc,
5029 LParenLoc, EndLoc, NumVars),
5030 ColonLoc(ColonLoc) {}
5035 explicit OMPAlignedClause(
unsigned NumVars)
5036 : OMPVarListClause<OMPAlignedClause>(llvm::omp::OMPC_aligned,
5037 SourceLocation(), SourceLocation(),
5038 SourceLocation(), NumVars) {}
5050 static OMPAlignedClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
5051 SourceLocation LParenLoc,
5052 SourceLocation ColonLoc,
5053 SourceLocation EndLoc, ArrayRef<Expr *> VL,
5060 static OMPAlignedClause *
CreateEmpty(
const ASTContext &C,
unsigned NumVars);
5075 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5076 reinterpret_cast<Stmt **
>(varlist_end()));
5080 return const_cast<OMPAlignedClause *
>(
this)->
children();
5084 return child_range(child_iterator(), child_iterator());
5087 return const_child_range(const_child_iterator(), const_child_iterator());
5091 return T->getClauseKind() == llvm::omp::OMPC_aligned;
5102class OMPCopyinClause final
5103 :
public OMPVarListClause<OMPCopyinClause>,
5104 private llvm::TrailingObjects<OMPCopyinClause, Expr *> {
5119 friend OMPVarListClause;
5120 friend TrailingObjects;
5128 OMPCopyinClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5129 SourceLocation EndLoc,
unsigned N)
5130 : OMPVarListClause<OMPCopyinClause>(
llvm::omp::OMPC_copyin, StartLoc,
5131 LParenLoc, EndLoc, N) {}
5138 SourceLocation(), SourceLocation(),
5139 SourceLocation(), N) {}
5144 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
5147 MutableArrayRef<Expr *> getSourceExprs() {
5148 return {varlist_end(), varlist_size()};
5150 ArrayRef<const Expr *> getSourceExprs()
const {
5151 return {varlist_end(), varlist_size()};
5157 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
5160 MutableArrayRef<Expr *> getDestinationExprs() {
5161 return {getSourceExprs().end(), varlist_size()};
5163 ArrayRef<const Expr *> getDestinationExprs()
const {
5164 return {getSourceExprs().end(), varlist_size()};
5171 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
5174 MutableArrayRef<Expr *> getAssignmentOps() {
5175 return {getDestinationExprs().end(), varlist_size()};
5177 ArrayRef<const Expr *> getAssignmentOps()
const {
5178 return {getDestinationExprs().end(), varlist_size()};
5203 static OMPCopyinClause *
5204 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
5205 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
5206 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
5212 static OMPCopyinClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
5218 llvm::iterator_range<helper_expr_const_iterator>;
5225 return getDestinationExprs();
5235 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5236 reinterpret_cast<Stmt **
>(varlist_end()));
5240 return const_cast<OMPCopyinClause *
>(
this)->
children();
5244 return child_range(child_iterator(), child_iterator());
5247 return const_child_range(const_child_iterator(), const_child_iterator());
5251 return T->getClauseKind() == llvm::omp::OMPC_copyin;
5263class OMPCopyprivateClause final
5264 :
public OMPVarListClause<OMPCopyprivateClause>,
5265 private llvm::TrailingObjects<OMPCopyprivateClause, Expr *> {
5267 friend OMPVarListClause;
5268 friend TrailingObjects;
5276 OMPCopyprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5277 SourceLocation EndLoc,
unsigned N)
5278 : OMPVarListClause<OMPCopyprivateClause>(
llvm::omp::OMPC_copyprivate,
5279 StartLoc, LParenLoc, EndLoc, N) {
5287 llvm::omp::OMPC_copyprivate, SourceLocation(), SourceLocation(),
5288 SourceLocation(), N) {}
5293 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
5296 MutableArrayRef<Expr *> getSourceExprs() {
5297 return {varlist_end(), varlist_size()};
5299 ArrayRef<const Expr *> getSourceExprs()
const {
5300 return {varlist_end(), varlist_size()};
5306 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
5309 MutableArrayRef<Expr *> getDestinationExprs() {
5310 return {getSourceExprs().end(), varlist_size()};
5312 ArrayRef<const Expr *> getDestinationExprs()
const {
5313 return {getSourceExprs().end(), varlist_size()};
5320 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
5323 MutableArrayRef<Expr *> getAssignmentOps() {
5324 return {getDestinationExprs().end(), varlist_size()};
5326 ArrayRef<const Expr *> getAssignmentOps()
const {
5327 return {getDestinationExprs().end(), varlist_size()};
5351 static OMPCopyprivateClause *
5352 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
5353 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
5354 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
5360 static OMPCopyprivateClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
5366 llvm::iterator_range<helper_expr_const_iterator>;
5373 return getDestinationExprs();
5383 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5384 reinterpret_cast<Stmt **
>(varlist_end()));
5388 return const_cast<OMPCopyprivateClause *
>(
this)->
children();
5392 return child_range(child_iterator(), child_iterator());
5395 return const_child_range(const_child_iterator(), const_child_iterator());
5399 return T->getClauseKind() == llvm::omp::OMPC_copyprivate;
5415class OMPFlushClause final
5416 :
public OMPVarListClause<OMPFlushClause>,
5417 private llvm::TrailingObjects<OMPFlushClause, Expr *> {
5418 friend OMPVarListClause;
5419 friend TrailingObjects;
5427 OMPFlushClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5428 SourceLocation EndLoc,
unsigned N)
5429 : OMPVarListClause<OMPFlushClause>(llvm::omp::OMPC_flush, StartLoc,
5430 LParenLoc, EndLoc, N) {}
5435 explicit OMPFlushClause(
unsigned N)
5436 : OMPVarListClause<OMPFlushClause>(llvm::omp::OMPC_flush,
5437 SourceLocation(), SourceLocation(),
5438 SourceLocation(), N) {}
5448 static OMPFlushClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
5449 SourceLocation LParenLoc, SourceLocation EndLoc,
5459 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5460 reinterpret_cast<Stmt **
>(varlist_end()));
5464 return const_cast<OMPFlushClause *
>(
this)->
children();
5468 return child_range(child_iterator(), child_iterator());
5471 return const_child_range(const_child_iterator(), const_child_iterator());
5475 return T->getClauseKind() == llvm::omp::OMPC_flush;
5495 SourceLocation LParenLoc;
5498 Expr *Depobj =
nullptr;
5505 OMPDepobjClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5506 SourceLocation EndLoc)
5508 LParenLoc(LParenLoc) {}
5513 :
OMPClause(
llvm::omp::OMPC_depobj, SourceLocation(), SourceLocation()) {}
5515 void setDepobj(Expr *E) { Depobj = E; }
5518 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
5528 static OMPDepobjClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
5529 SourceLocation LParenLoc,
5530 SourceLocation EndLoc, Expr *Depobj);
5535 static OMPDepobjClause *
CreateEmpty(
const ASTContext &C);
5545 return child_range(
reinterpret_cast<Stmt **
>(&Depobj),
5546 reinterpret_cast<Stmt **
>(&Depobj) + 1);
5550 return const_cast<OMPDepobjClause *
>(
this)->
children();
5554 return child_range(child_iterator(), child_iterator());
5557 return const_child_range(const_child_iterator(), const_child_iterator());
5561 return T->getClauseKind() == llvm::omp::OMPC_depobj;
5573class OMPDependClause final
5574 :
public OMPVarListClause<OMPDependClause>,
5575 private llvm::TrailingObjects<OMPDependClause, Expr *> {
5577 friend OMPVarListClause;
5578 friend TrailingObjects;
5583 OpenMPDependClauseKind
DepKind = OMPC_DEPEND_unknown;
5600 unsigned NumLoops = 0;
5610 OMPDependClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5611 SourceLocation EndLoc,
unsigned N,
unsigned NumLoops)
5612 : OMPVarListClause<OMPDependClause>(
llvm::omp::OMPC_depend, StartLoc,
5613 LParenLoc, EndLoc, N),
5614 NumLoops(NumLoops) {}
5623 SourceLocation(), SourceLocation(),
5624 SourceLocation(), N),
5625 NumLoops(NumLoops) {}
5628 void setDependencyKind(OpenMPDependClauseKind K) {
Data.DepKind = K; }
5631 void setDependencyLoc(SourceLocation Loc) {
Data.DepLoc = Loc; }
5637 void setOmpAllMemoryLoc(SourceLocation Loc) {
Data.OmpAllMemoryLoc = Loc; }
5653 static OMPDependClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
5654 SourceLocation LParenLoc,
5655 SourceLocation EndLoc, DependDataTy Data,
5656 Expr *DepModifier, ArrayRef<Expr *> VL,
5665 static OMPDependClause *
CreateEmpty(
const ASTContext &C,
unsigned N,
5681 Expr *getModifier();
5683 return const_cast<OMPDependClause *
>(
this)->
getModifier();
5691 void setLoopData(
unsigned NumLoop, Expr *Cnt);
5694 Expr *getLoopData(
unsigned NumLoop);
5695 const Expr *getLoopData(
unsigned NumLoop)
const;
5698 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5699 reinterpret_cast<Stmt **
>(varlist_end()));
5703 return const_cast<OMPDependClause *
>(
this)->
children();
5707 return child_range(child_iterator(), child_iterator());
5710 return const_child_range(const_child_iterator(), const_child_iterator());
5714 return T->getClauseKind() == llvm::omp::OMPC_depend;
5730 SourceLocation LParenLoc;
5733 OpenMPDeviceClauseModifier Modifier = OMPC_DEVICE_unknown;
5736 SourceLocation ModifierLoc;
5739 Stmt *Device =
nullptr;
5744 void setDevice(Expr *E) { Device = E; }
5747 void setModifier(OpenMPDeviceClauseModifier M) { Modifier = M; }
5764 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
5765 SourceLocation LParenLoc, SourceLocation ModifierLoc,
5766 SourceLocation EndLoc)
5769 ModifierLoc(ModifierLoc), Device(E) {
5770 setPreInitStmt(HelperE, CaptureRegion);
5775 :
OMPClause(
llvm::omp::OMPC_device, SourceLocation(), SourceLocation()),
5796 child_range
children() {
return child_range(&Device, &Device + 1); }
5799 return const_child_range(&Device, &Device + 1);
5803 return child_range(child_iterator(), child_iterator());
5806 return const_child_range(const_child_iterator(), const_child_iterator());
5810 return T->getClauseKind() == llvm::omp::OMPC_device;
5851 :
OMPClause(
llvm::omp::OMPC_simd, SourceLocation(), SourceLocation()) {}
5854 return child_range(child_iterator(), child_iterator());
5858 return const_child_range(const_child_iterator(), const_child_iterator());
5862 return child_range(child_iterator(), child_iterator());
5865 return const_child_range(const_child_iterator(), const_child_iterator());
5869 return T->getClauseKind() == llvm::omp::OMPC_simd;
5886 llvm::PointerIntPair<Expr *, 1, bool> AssociatedExpressionNonContiguousPr;
5891 ValueDecl *AssociatedDeclaration =
nullptr;
5896 ValueDecl *AssociatedDeclaration,
5897 bool IsNonContiguous)
5898 : AssociatedExpressionNonContiguousPr(AssociatedExpression,
5900 AssociatedDeclaration(
5901 AssociatedDeclaration
5906 return AssociatedExpressionNonContiguousPr.getPointer();
5910 return AssociatedExpressionNonContiguousPr.getInt();
5914 return AssociatedDeclaration;
5918 return AssociatedExpressionNonContiguousPr ==
5919 Other.AssociatedExpressionNonContiguousPr &&
5920 AssociatedDeclaration == Other.AssociatedDeclaration;
5960 static QualType getComponentExprElementType(
const Expr *Exp);
6020 static std::pair<const Expr *, std::optional<size_t>>
6021 findAttachPtrExpr(MappableExprComponentListRef Components,
6022 OpenMPDirectiveKind CurDirKind);
6027 getComponentsTotalNumber(MappableExprComponentListsRef ComponentLists);
6063 unsigned NumUniqueDeclarations;
6066 unsigned NumComponentLists;
6069 unsigned NumComponents;
6074 const bool SupportsMapper;
6077 NestedNameSpecifierLoc MapperQualifierLoc;
6080 DeclarationNameInfo MapperIdInfo;
6102 OpenMPClauseKind K,
const OMPVarListLocTy &Locs,
6104 NestedNameSpecifierLoc *MapperQualifierLocPtr =
nullptr,
6105 DeclarationNameInfo *MapperIdInfoPtr =
nullptr)
6106 : OMPVarListClause<T>(K, Locs.StartLoc, Locs.LParenLoc, Locs.EndLoc,
6108 NumUniqueDeclarations(Sizes.NumUniqueDeclarations),
6109 NumComponentLists(Sizes.NumComponentLists),
6110 NumComponents(Sizes.NumComponents), SupportsMapper(SupportsMapper) {
6111 if (MapperQualifierLocPtr)
6112 MapperQualifierLoc = *MapperQualifierLocPtr;
6113 if (MapperIdInfoPtr)
6114 MapperIdInfo = *MapperIdInfoPtr;
6120 return static_cast<T *
>(
this)
6121 ->
template getTrailingObjectsNonStrict<ValueDecl *>(
6122 NumUniqueDeclarations);
6128 return static_cast<const T *
>(
this)
6129 ->
template getTrailingObjectsNonStrict<ValueDecl *>(
6130 NumUniqueDeclarations);
6136 assert(UDs.size() == NumUniqueDeclarations &&
6137 "Unexpected amount of unique declarations.");
6144 return static_cast<T *
>(
this)
6145 ->
template getTrailingObjectsNonStrict<unsigned>(NumUniqueDeclarations);
6151 return static_cast<const T *
>(
this)
6152 ->
template getTrailingObjectsNonStrict<unsigned>(NumUniqueDeclarations);
6158 assert(DNLs.size() == NumUniqueDeclarations &&
6159 "Unexpected amount of list numbers.");
6166 return MutableArrayRef<unsigned>(
6167 static_cast<T *
>(
this)
6168 ->
template getTrailingObjectsNonStrict<unsigned>() +
6169 NumUniqueDeclarations,
6177 static_cast<const T *
>(
this)
6178 ->
template getTrailingObjectsNonStrict<unsigned>() +
6179 NumUniqueDeclarations,
6186 assert(CLSs.size() == NumComponentLists &&
6187 "Unexpected amount of component lists.");
6193 return static_cast<T *
>(
this)
6194 ->
template getTrailingObjectsNonStrict<MappableComponent>(
6200 return static_cast<const T *
>(
this)
6201 ->
template getTrailingObjectsNonStrict<MappableComponent>(
6210 assert(Components.size() == NumComponents &&
6211 "Unexpected amount of component lists.");
6212 assert(CLSs.size() == NumComponentLists &&
6213 "Unexpected amount of list sizes.");
6224 NumUniqueDeclarations &&
6225 "Unexpected number of mappable expression info entries!");
6227 "Unexpected total number of components!");
6228 assert(Declarations.size() == ComponentLists.size() &&
6229 "Declaration and component lists size is not consistent!");
6230 assert(Declarations.size() == NumComponentLists &&
6231 "Unexpected declaration and component lists size!");
6236 llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
6239 auto CI = ComponentLists.begin();
6240 for (
auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
6242 assert(!CI->empty() &&
"Invalid component list!");
6243 ComponentListMap[*DI].push_back(*CI);
6249 auto UDI = UniqueDeclarations.begin();
6252 auto DNLI = DeclNumLists.begin();
6255 auto CLSI = ComponentListSizes.begin();
6258 auto CI = Components.begin();
6261 unsigned PrevSize = 0u;
6264 for (
auto &M : ComponentListMap) {
6281 PrevSize += C.size();
6288 CI = llvm::copy(C, CI);
6295 MapperQualifierLoc = NNSL;
6300 MapperIdInfo = MapperId;
6306 assert(SupportsMapper &&
6307 "Must be a clause that is possible to have user-defined mappers");
6308 return MutableArrayRef<Expr *>(
6309 static_cast<T *
>(
this)->
template getTrailingObjects<Expr *>() +
6310 OMPVarListClause<T>::varlist_size(),
6311 OMPVarListClause<T>::varlist_size());
6317 assert(SupportsMapper &&
6318 "Must be a clause that is possible to have user-defined mappers");
6320 static_cast<const T *
>(
this)->
template getTrailingObjects<Expr *>() +
6321 OMPVarListClause<T>::varlist_size(),
6322 OMPVarListClause<T>::varlist_size());
6328 assert(DMDs.size() == OMPVarListClause<T>::varlist_size() &&
6329 "Unexpected number of user-defined mappers.");
6330 assert(SupportsMapper &&
6331 "Must be a clause that is possible to have user-defined mappers");
6348 return MapperQualifierLoc;
6357 :
public llvm::iterator_adaptor_base<
6358 const_component_lists_iterator,
6359 MappableExprComponentListRef::const_iterator,
6360 std::forward_iterator_tag, MappableComponent, ptrdiff_t,
6361 MappableComponent, MappableComponent> {
6369 const bool SupportsMapper;
6375 unsigned RemainingLists = 0;
6379 unsigned PrevListSize = 0;
6387 MappableExprComponentListRef::const_iterator End;
6397 Components.begin()),
6398 DeclCur(UniqueDecls.begin()), NumListsCur(DeclsListNum.begin()),
6399 SupportsMapper(SupportsMapper),
6400 ListSizeCur(CumulativeListSizes.begin()),
6401 ListSizeEnd(CumulativeListSizes.end()), End(Components.end()) {
6402 assert(UniqueDecls.size() == DeclsListNum.size() &&
6403 "Inconsistent number of declarations and list sizes!");
6404 if (!DeclsListNum.empty())
6405 RemainingLists = *NumListsCur;
6407 MapperCur = Mappers.begin();
6418 CumulativeListSizes, Components,
6419 SupportsMapper, Mappers) {
6423 for (; DeclCur != UniqueDecls.end(); ++DeclCur, ++NumListsCur) {
6424 if (*DeclCur == Declaration)
6427 assert(*NumListsCur > 0 &&
"No lists associated with declaration??");
6431 std::advance(ListSizeCur, *NumListsCur - 1);
6432 PrevListSize = *ListSizeCur;
6441 if (ListSizeCur == CumulativeListSizes.end()) {
6443 RemainingLists = 0u;
6449 RemainingLists = *NumListsCur;
6452 ListSizeEnd = ListSizeCur;
6453 std::advance(ListSizeEnd, RemainingLists);
6457 std::advance(this->I, PrevListSize);
6465 assert(ListSizeCur != ListSizeEnd &&
"Invalid iterator!");
6466 const ValueDecl *Mapper =
nullptr;
6467 if (SupportsMapper && *MapperCur)
6468 Mapper = cast<ValueDecl>(cast<DeclRefExpr>(*MapperCur)->getDecl());
6469 return std::make_tuple(
6482 assert(ListSizeCur != ListSizeEnd && RemainingLists &&
6483 "Invalid iterator!");
6487 if (std::next(ListSizeCur) == ListSizeEnd) {
6491 std::advance(this->I, *ListSizeCur - PrevListSize);
6492 PrevListSize = *ListSizeCur;
6495 if (!(--RemainingLists)) {
6498 RemainingLists = *NumListsCur;
6499 assert(RemainingLists &&
"No lists in the following declaration??");
6511 llvm::iterator_range<const_component_lists_iterator>;
6525 SupportsMapper, {});
6533 const_component_lists_iterator
6556 llvm::iterator_range<const_all_num_lists_iterator>;
6564 llvm::iterator_range<const_all_lists_sizes_iterator>;
6572 llvm::iterator_range<const_all_components_iterator>;
6582 llvm::iterator_range<mapperlist_const_iterator>;
6608class OMPMapClause final :
public OMPMappableExprListClause<OMPMapClause>,
6609 private llvm::TrailingObjects<
6610 OMPMapClause, Expr *, ValueDecl *, unsigned,
6611 OMPClauseMappableExprCommon::MappableComponent> {
6613 friend OMPMappableExprListClause;
6614 friend OMPVarListClause;
6615 friend TrailingObjects;
6619 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
6622 return 2 * varlist_size() + 1;
6624 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
6625 return getUniqueDeclarationsNum();
6627 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
6628 return getUniqueDeclarationsNum() + getTotalComponentListNum();
6640 SourceLocation MapTypeModifiersLoc[NumberOfOMPMapClauseModifiers];
6646 bool MapTypeIsImplicit =
false;
6649 SourceLocation MapLoc;
6652 SourceLocation ColonLoc;
6674 explicit OMPMapClause(ArrayRef<OpenMPMapModifierKind> MapModifiers,
6675 ArrayRef<SourceLocation> MapModifiersLoc,
6676 NestedNameSpecifierLoc MapperQualifierLoc,
6677 DeclarationNameInfo MapperIdInfo,
6678 OpenMPMapClauseKind MapType,
bool MapTypeIsImplicit,
6679 SourceLocation MapLoc,
const OMPVarListLocTy &Locs,
6680 const OMPMappableExprListSizeTy &Sizes)
6681 : OMPMappableExprListClause(llvm::omp::OMPC_map, Locs, Sizes,
6682 true, &MapperQualifierLoc,
6684 MapType(MapType), MapTypeIsImplicit(MapTypeIsImplicit), MapLoc(MapLoc) {
6685 assert(std::size(MapTypeModifiers) == MapModifiers.size() &&
6686 "Unexpected number of map type modifiers.");
6687 llvm::copy(MapModifiers, std::begin(MapTypeModifiers));
6689 assert(std::size(MapTypeModifiersLoc) == MapModifiersLoc.size() &&
6690 "Unexpected number of map type modifier locations.");
6691 llvm::copy(MapModifiersLoc, std::begin(MapTypeModifiersLoc));
6701 explicit OMPMapClause(
const OMPMappableExprListSizeTy &Sizes)
6702 : OMPMappableExprListClause(llvm::omp::OMPC_map, OMPVarListLocTy(), Sizes,
6709 void setMapTypeModifier(
unsigned I, OpenMPMapModifierKind T) {
6710 assert(I < NumberOfOMPMapClauseModifiers &&
6711 "Unexpected index to store map type modifier, exceeds array size.");
6712 MapTypeModifiers[I] =
T;
6719 void setMapTypeModifierLoc(
unsigned I, SourceLocation TLoc) {
6720 assert(I < NumberOfOMPMapClauseModifiers &&
6721 "Index to store map type modifier location exceeds array size.");
6722 MapTypeModifiersLoc[I] = TLoc;
6728 void setMapType(OpenMPMapClauseKind T) { MapType =
T; }
6733 void setMapLoc(SourceLocation TLoc) { MapLoc = TLoc; }
6736 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
6739 void setIteratorModifier(Expr *IteratorModifier) {
6740 getTrailingObjects<Expr *>()[2 * varlist_size()] = IteratorModifier;
6764 static OMPMapClause *
6765 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
6766 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
6767 MappableExprComponentListsRef ComponentLists,
6768 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorModifier,
6769 ArrayRef<OpenMPMapModifierKind> MapModifiers,
6770 ArrayRef<SourceLocation> MapModifiersLoc,
6771 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId,
6772 OpenMPMapClauseKind Type,
bool TypeIsImplicit, SourceLocation TypeLoc);
6784 static OMPMapClause *
CreateEmpty(
const ASTContext &C,
6785 const OMPMappableExprListSizeTy &Sizes);
6789 return getTrailingObjects<Expr *>()[2 * varlist_size()];
6793 OpenMPMapClauseKind
getMapType() const LLVM_READONLY {
return MapType; }
6806 assert(Cnt < NumberOfOMPMapClauseModifiers &&
6807 "Requested modifier exceeds the total number of modifiers.");
6808 return MapTypeModifiers[Cnt];
6816 assert(Cnt < NumberOfOMPMapClauseModifiers &&
6817 "Requested modifier location exceeds total number of modifiers.");
6818 return MapTypeModifiersLoc[Cnt];
6823 return MapTypeModifiers;
6828 return MapTypeModifiersLoc;
6832 SourceLocation
getMapLoc() const LLVM_READONLY {
return MapLoc; }
6839 reinterpret_cast<Stmt **
>(varlist_begin()),
6840 reinterpret_cast<Stmt **
>(varlist_end()));
6844 return const_cast<OMPMapClause *
>(
this)->
children();
6848 if (MapType == OMPC_MAP_to || MapType == OMPC_MAP_tofrom)
6849 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
6850 reinterpret_cast<Stmt **
>(varlist_end()));
6851 return child_range(child_iterator(), child_iterator());
6859 return T->getClauseKind() == llvm::omp::OMPC_map;
6878class OMPNumTeamsClause final
6879 :
public OMPVarListClause<OMPNumTeamsClause>,
6881 private llvm::TrailingObjects<OMPNumTeamsClause, Expr *> {
6882 friend OMPVarListClause;
6883 friend TrailingObjects;
6886 SourceLocation LParenLoc;
6888 OMPNumTeamsClause(
const ASTContext &C, SourceLocation StartLoc,
6889 SourceLocation LParenLoc, SourceLocation EndLoc,
unsigned N)
6890 : OMPVarListClause(llvm::omp::OMPC_num_teams, StartLoc, LParenLoc, EndLoc,
6895 OMPNumTeamsClause(
unsigned N)
6896 : OMPVarListClause(llvm::omp::OMPC_num_teams, SourceLocation(),
6897 SourceLocation(), SourceLocation(), N),
6909 static OMPNumTeamsClause *
6911 SourceLocation StartLoc, SourceLocation LParenLoc,
6931 return const_cast<OMPNumTeamsClause *
>(
this)->
getNumTeams();
6935 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
6936 reinterpret_cast<Stmt **
>(varlist_end()));
6940 return const_cast<OMPNumTeamsClause *
>(
this)->
children();
6944 return child_range(child_iterator(), child_iterator());
6947 return const_child_range(const_child_iterator(), const_child_iterator());
6951 return T->getClauseKind() == llvm::omp::OMPC_num_teams;
6970class OMPThreadLimitClause final
6971 :
public OMPVarListClause<OMPThreadLimitClause>,
6973 private llvm::TrailingObjects<OMPThreadLimitClause, Expr *> {
6974 friend OMPVarListClause;
6975 friend TrailingObjects;
6978 SourceLocation LParenLoc;
6980 OMPThreadLimitClause(
const ASTContext &C, SourceLocation StartLoc,
6981 SourceLocation LParenLoc, SourceLocation EndLoc,
6983 : OMPVarListClause(llvm::omp::OMPC_thread_limit, StartLoc, LParenLoc,
6988 OMPThreadLimitClause(
unsigned N)
6989 : OMPVarListClause(llvm::omp::OMPC_thread_limit, SourceLocation(),
6990 SourceLocation(), SourceLocation(), N),
7002 static OMPThreadLimitClause *
7004 SourceLocation StartLoc, SourceLocation LParenLoc,
7024 return const_cast<OMPThreadLimitClause *
>(
this)->
getThreadLimit();
7028 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
7029 reinterpret_cast<Stmt **
>(varlist_end()));
7033 return const_cast<OMPThreadLimitClause *
>(
this)->
children();
7037 return child_range(child_iterator(), child_iterator());
7040 return const_child_range(const_child_iterator(), const_child_iterator());
7044 return T->getClauseKind() == llvm::omp::OMPC_thread_limit;
7060 SourceLocation LParenLoc;
7063 Stmt *Priority =
nullptr;
7068 void setPriority(Expr *E) { Priority = E; }
7081 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
7082 SourceLocation LParenLoc, SourceLocation EndLoc)
7085 setPreInitStmt(HelperPriority, CaptureRegion);
7090 :
OMPClause(
llvm::omp::OMPC_priority, SourceLocation(), SourceLocation()),
7105 child_range
children() {
return child_range(&Priority, &Priority + 1); }
7108 return const_child_range(&Priority, &Priority + 1);
7111 child_range used_children();
7117 return T->getClauseKind() == llvm::omp::OMPC_priority;
7133 SourceLocation LParenLoc;
7136 OpenMPGrainsizeClauseModifier Modifier = OMPC_GRAINSIZE_unknown;
7139 SourceLocation ModifierLoc;
7142 Stmt *Grainsize =
nullptr;
7145 void setGrainsize(Expr *Size) { Grainsize = Size; }
7148 void setModifier(OpenMPGrainsizeClauseModifier M) { Modifier = M; }
7166 Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion,
7167 SourceLocation StartLoc, SourceLocation LParenLoc,
7168 SourceLocation ModifierLoc, SourceLocation EndLoc)
7171 ModifierLoc(ModifierLoc), Grainsize(Size) {
7172 setPreInitStmt(HelperSize, CaptureRegion);
7191 OpenMPGrainsizeClauseModifier
getModifier()
const {
return Modifier; }
7196 child_range
children() {
return child_range(&Grainsize, &Grainsize + 1); }
7199 return const_child_range(&Grainsize, &Grainsize + 1);
7202 child_range used_children();
7208 return T->getClauseKind() == llvm::omp::OMPC_grainsize;
7229 :
OMPClause(
llvm::omp::OMPC_nogroup, SourceLocation(), SourceLocation()) {
7233 return child_range(child_iterator(), child_iterator());
7237 return const_child_range(const_child_iterator(), const_child_iterator());
7241 return child_range(child_iterator(), child_iterator());
7244 return const_child_range(const_child_iterator(), const_child_iterator());
7248 return T->getClauseKind() == llvm::omp::OMPC_nogroup;
7264 SourceLocation LParenLoc;
7267 OpenMPNumTasksClauseModifier Modifier = OMPC_NUMTASKS_unknown;
7270 SourceLocation ModifierLoc;
7273 Stmt *NumTasks =
nullptr;
7276 void setNumTasks(Expr *Size) { NumTasks = Size; }
7279 void setModifier(OpenMPNumTasksClauseModifier M) { Modifier = M; }
7297 Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion,
7298 SourceLocation StartLoc, SourceLocation LParenLoc,
7299 SourceLocation ModifierLoc, SourceLocation EndLoc)
7302 ModifierLoc(ModifierLoc), NumTasks(Size) {
7303 setPreInitStmt(HelperSize, CaptureRegion);
7327 child_range
children() {
return child_range(&NumTasks, &NumTasks + 1); }
7330 return const_child_range(&NumTasks, &NumTasks + 1);
7333 child_range used_children();
7339 return T->getClauseKind() == llvm::omp::OMPC_num_tasks;
7354 SourceLocation LParenLoc;
7357 Stmt *Hint =
nullptr;
7360 void setHint(Expr *H) { Hint = H; }
7370 SourceLocation EndLoc)
7371 :
OMPClause(
llvm::omp::OMPC_hint, StartLoc, EndLoc), LParenLoc(LParenLoc),
7376 :
OMPClause(
llvm::omp::OMPC_hint, SourceLocation(), SourceLocation()) {}
7385 Expr *
getHint()
const {
return cast_or_null<Expr>(Hint); }
7387 child_range
children() {
return child_range(&Hint, &Hint + 1); }
7390 return const_child_range(&Hint, &Hint + 1);
7394 return child_range(child_iterator(), child_iterator());
7397 return const_child_range(const_child_iterator(), const_child_iterator());
7401 return T->getClauseKind() == llvm::omp::OMPC_hint;
7417 SourceLocation LParenLoc;
7420 OpenMPDistScheduleClauseKind Kind = OMPC_DIST_SCHEDULE_unknown;
7423 SourceLocation KindLoc;
7426 SourceLocation CommaLoc;
7429 Expr *ChunkSize =
nullptr;
7434 void setDistScheduleKind(OpenMPDistScheduleClauseKind K) { Kind = K; }
7439 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
7444 void setDistScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
7449 void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
7454 void setChunkSize(Expr *E) { ChunkSize = E; }
7469 SourceLocation KLoc, SourceLocation CommaLoc,
7470 SourceLocation EndLoc,
7471 OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize,
7472 Stmt *HelperChunkSize)
7473 :
OMPClause(
llvm::omp::OMPC_dist_schedule, StartLoc, EndLoc),
7475 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
7476 setPreInitStmt(HelperChunkSize);
7481 :
OMPClause(
llvm::omp::OMPC_dist_schedule, SourceLocation(),
7504 return child_range(
reinterpret_cast<Stmt **
>(&ChunkSize),
7505 reinterpret_cast<Stmt **
>(&ChunkSize) + 1);
7513 return child_range(child_iterator(), child_iterator());
7516 return const_child_range(const_child_iterator(), const_child_iterator());
7520 return T->getClauseKind() == llvm::omp::OMPC_dist_schedule;
7535 SourceLocation LParenLoc;
7538 OpenMPDefaultmapClauseModifier Modifier = OMPC_DEFAULTMAP_MODIFIER_unknown;
7541 SourceLocation ModifierLoc;
7544 OpenMPDefaultmapClauseKind Kind = OMPC_DEFAULTMAP_unknown;
7547 SourceLocation KindLoc;
7552 void setDefaultmapKind(OpenMPDefaultmapClauseKind K) { Kind = K; }
7557 void setDefaultmapModifier(OpenMPDefaultmapClauseModifier M) {
7562 void setDefaultmapModifierLoc(SourceLocation Loc) {
7569 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
7574 void setDefaultmapKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
7587 SourceLocation MLoc, SourceLocation KLoc,
7588 SourceLocation EndLoc, OpenMPDefaultmapClauseKind Kind,
7589 OpenMPDefaultmapClauseModifier M)
7591 LParenLoc(LParenLoc), Modifier(M), ModifierLoc(MLoc), Kind(Kind),
7597 SourceLocation()) {}
7619 return child_range(child_iterator(), child_iterator());
7623 return const_child_range(const_child_iterator(), const_child_iterator());
7627 return child_range(child_iterator(), child_iterator());
7630 return const_child_range(const_child_iterator(), const_child_iterator());
7634 return T->getClauseKind() == llvm::omp::OMPC_defaultmap;
7646class OMPToClause final :
public OMPMappableExprListClause<OMPToClause>,
7647 private llvm::TrailingObjects<
7648 OMPToClause, Expr *, ValueDecl *, unsigned,
7649 OMPClauseMappableExprCommon::MappableComponent> {
7651 friend OMPMappableExprListClause;
7652 friend OMPVarListClause;
7653 friend TrailingObjects;
7656 OpenMPMotionModifierKind MotionModifiers[NumberOfOMPMotionModifiers] = {
7657 OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
7658 OMPC_MOTION_MODIFIER_unknown};
7661 SourceLocation MotionModifiersLoc[NumberOfOMPMotionModifiers];
7664 SourceLocation ColonLoc;
7683 NestedNameSpecifierLoc MapperQualifierLoc,
7684 DeclarationNameInfo MapperIdInfo,
7685 const OMPVarListLocTy &Locs,
7688 true, &MapperQualifierLoc,
7690 assert(std::size(MotionModifiers) == TheMotionModifiers.size() &&
7691 "Unexpected number of motion modifiers.");
7692 llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
7694 assert(std::size(MotionModifiersLoc) == TheMotionModifiersLoc.size() &&
7695 "Unexpected number of motion modifier locations.");
7696 llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
7706 explicit OMPToClause(
const OMPMappableExprListSizeTy &Sizes)
7707 : OMPMappableExprListClause(llvm::omp::OMPC_to, OMPVarListLocTy(), Sizes,
7714 void setMotionModifier(
unsigned I, OpenMPMotionModifierKind T) {
7715 assert(I < NumberOfOMPMotionModifiers &&
7716 "Unexpected index to store motion modifier, exceeds array size.");
7717 MotionModifiers[I] =
T;
7724 void setMotionModifierLoc(
unsigned I, SourceLocation TLoc) {
7725 assert(I < NumberOfOMPMotionModifiers &&
7726 "Index to store motion modifier location exceeds array size.");
7727 MotionModifiersLoc[I] = TLoc;
7730 void setIteratorModifier(Expr *IteratorModifier) {
7731 getTrailingObjects<Expr *>()[2 * varlist_size()] = IteratorModifier;
7734 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
7738 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
7741 return 2 * varlist_size() + 1;
7743 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
7744 return getUniqueDeclarationsNum();
7746 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
7747 return getUniqueDeclarationsNum() + getTotalComponentListNum();
7767 static OMPToClause *
7768 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
7769 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
7770 MappableExprComponentListsRef ComponentLists,
7771 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorModifier,
7772 ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
7773 ArrayRef<SourceLocation> MotionModifiersLoc,
7774 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
7784 static OMPToClause *
CreateEmpty(
const ASTContext &C,
7785 const OMPMappableExprListSizeTy &Sizes);
7791 assert(Cnt < NumberOfOMPMotionModifiers &&
7792 "Requested modifier exceeds the total number of modifiers.");
7793 return MotionModifiers[Cnt];
7796 return getTrailingObjects<Expr *>()[2 * varlist_size()];
7803 assert(Cnt < NumberOfOMPMotionModifiers &&
7804 "Requested modifier location exceeds total number of modifiers.");
7805 return MotionModifiersLoc[Cnt];
7810 return MotionModifiers;
7815 return MotionModifiersLoc;
7822 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
7823 reinterpret_cast<Stmt **
>(varlist_end()));
7827 return const_cast<OMPToClause *
>(
this)->
children();
7831 return child_range(child_iterator(), child_iterator());
7834 return const_child_range(const_child_iterator(), const_child_iterator());
7838 return T->getClauseKind() == llvm::omp::OMPC_to;
7850class OMPFromClause final
7851 :
public OMPMappableExprListClause<OMPFromClause>,
7852 private llvm::TrailingObjects<
7853 OMPFromClause, Expr *, ValueDecl *, unsigned,
7854 OMPClauseMappableExprCommon::MappableComponent> {
7856 friend OMPMappableExprListClause;
7857 friend OMPVarListClause;
7858 friend TrailingObjects;
7861 OpenMPMotionModifierKind MotionModifiers[NumberOfOMPMotionModifiers] = {
7862 OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
7863 OMPC_MOTION_MODIFIER_unknown};
7866 SourceLocation MotionModifiersLoc[NumberOfOMPMotionModifiers];
7869 SourceLocation ColonLoc;
7888 NestedNameSpecifierLoc MapperQualifierLoc,
7889 DeclarationNameInfo MapperIdInfo,
7890 const OMPVarListLocTy &Locs,
7893 true, &MapperQualifierLoc,
7895 assert(std::size(MotionModifiers) == TheMotionModifiers.size() &&
7896 "Unexpected number of motion modifiers.");
7897 llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
7899 assert(std::size(MotionModifiersLoc) == TheMotionModifiersLoc.size() &&
7900 "Unexpected number of motion modifier locations.");
7901 llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
7911 explicit OMPFromClause(
const OMPMappableExprListSizeTy &Sizes)
7912 : OMPMappableExprListClause(llvm::omp::OMPC_from, OMPVarListLocTy(),
7919 void setMotionModifier(
unsigned I, OpenMPMotionModifierKind T) {
7920 assert(I < NumberOfOMPMotionModifiers &&
7921 "Unexpected index to store motion modifier, exceeds array size.");
7922 MotionModifiers[I] =
T;
7924 void setIteratorModifier(Expr *IteratorModifier) {
7925 getTrailingObjects<Expr *>()[2 * varlist_size()] = IteratorModifier;
7931 void setMotionModifierLoc(
unsigned I, SourceLocation TLoc) {
7932 assert(I < NumberOfOMPMotionModifiers &&
7933 "Index to store motion modifier location exceeds array size.");
7934 MotionModifiersLoc[I] = TLoc;
7938 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
7942 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
7945 return 2 * varlist_size() + 1;
7947 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
7948 return getUniqueDeclarationsNum();
7950 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
7951 return getUniqueDeclarationsNum() + getTotalComponentListNum();
7971 static OMPFromClause *
7972 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
7973 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
7974 MappableExprComponentListsRef ComponentLists,
7975 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorExpr,
7976 ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
7977 ArrayRef<SourceLocation> MotionModifiersLoc,
7978 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
7988 static OMPFromClause *
CreateEmpty(
const ASTContext &C,
7989 const OMPMappableExprListSizeTy &Sizes);
7995 assert(Cnt < NumberOfOMPMotionModifiers &&
7996 "Requested modifier exceeds the total number of modifiers.");
7997 return MotionModifiers[Cnt];
8000 return getTrailingObjects<Expr *>()[2 * varlist_size()];
8007 assert(Cnt < NumberOfOMPMotionModifiers &&
8008 "Requested modifier location exceeds total number of modifiers.");
8009 return MotionModifiersLoc[Cnt];
8014 return MotionModifiers;
8019 return MotionModifiersLoc;
8026 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8027 reinterpret_cast<Stmt **
>(varlist_end()));
8031 return const_cast<OMPFromClause *
>(
this)->
children();
8035 return child_range(child_iterator(), child_iterator());
8038 return const_child_range(const_child_iterator(), const_child_iterator());
8042 return T->getClauseKind() == llvm::omp::OMPC_from;
8054class OMPUseDevicePtrClause final
8055 :
public OMPMappableExprListClause<OMPUseDevicePtrClause>,
8056 private llvm::TrailingObjects<
8057 OMPUseDevicePtrClause, Expr *, ValueDecl *, unsigned,
8058 OMPClauseMappableExprCommon::MappableComponent> {
8060 friend OMPMappableExprListClause;
8061 friend OMPVarListClause;
8062 friend TrailingObjects;
8065 OpenMPUseDevicePtrFallbackModifier FallbackModifier =
8066 OMPC_USE_DEVICE_PTR_FALLBACK_unknown;
8069 SourceLocation FallbackModifierLoc;
8083 explicit OMPUseDevicePtrClause(
8085 OpenMPUseDevicePtrFallbackModifier FallbackModifier,
8086 SourceLocation FallbackModifierLoc)
8087 : OMPMappableExprListClause(
llvm::omp::OMPC_use_device_ptr, Locs, Sizes),
8088 FallbackModifier(FallbackModifier),
8089 FallbackModifierLoc(FallbackModifierLoc) {}
8100 OMPVarListLocTy(), Sizes) {}
8104 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8105 return 3 * varlist_size();
8107 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8108 return getUniqueDeclarationsNum();
8110 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8111 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8117 void setPrivateCopies(ArrayRef<Expr *> VL);
8121 MutableArrayRef<Expr *> getPrivateCopies() {
8122 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
8124 ArrayRef<const Expr *> getPrivateCopies()
const {
8125 return {varlist_end(), varlist_size()};
8131 void setInits(ArrayRef<Expr *> VL);
8135 MutableArrayRef<Expr *>
getInits() {
8136 return {getPrivateCopies().end(), varlist_size()};
8138 ArrayRef<const Expr *>
getInits()
const {
8139 return {getPrivateCopies().end(), varlist_size()};
8143 void setFallbackModifier(OpenMPUseDevicePtrFallbackModifier M) {
8144 FallbackModifier = M;
8148 void setFallbackModifierLoc(SourceLocation Loc) { FallbackModifierLoc = Loc; }
8164 static OMPUseDevicePtrClause *
8165 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8166 ArrayRef<Expr *> Vars, ArrayRef<Expr *> PrivateVars,
8167 ArrayRef<Expr *> Inits, ArrayRef<ValueDecl *> Declarations,
8168 MappableExprComponentListsRef ComponentLists,
8169 OpenMPUseDevicePtrFallbackModifier FallbackModifier,
8170 SourceLocation FallbackModifierLoc);
8180 static OMPUseDevicePtrClause *
8181 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8185 return FallbackModifier;
8195 llvm::iterator_range<private_copies_const_iterator>;
8200 return getPrivateCopies();
8213 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8214 reinterpret_cast<Stmt **
>(varlist_end()));
8218 return const_cast<OMPUseDevicePtrClause *
>(
this)->
children();
8222 return child_range(child_iterator(), child_iterator());
8225 return const_child_range(const_child_iterator(), const_child_iterator());
8229 return T->getClauseKind() == llvm::omp::OMPC_use_device_ptr;
8241class OMPUseDeviceAddrClause final
8242 :
public OMPMappableExprListClause<OMPUseDeviceAddrClause>,
8243 private llvm::TrailingObjects<
8244 OMPUseDeviceAddrClause, Expr *, ValueDecl *, unsigned,
8245 OMPClauseMappableExprCommon::MappableComponent> {
8247 friend OMPMappableExprListClause;
8248 friend OMPVarListClause;
8249 friend TrailingObjects;
8261 explicit OMPUseDeviceAddrClause(
const OMPVarListLocTy &Locs,
8263 : OMPMappableExprListClause(
llvm::omp::OMPC_use_device_addr, Locs,
8275 OMPVarListLocTy(), Sizes) {}
8279 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8280 return varlist_size();
8282 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8283 return getUniqueDeclarationsNum();
8285 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8286 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8299 static OMPUseDeviceAddrClause *
8300 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8301 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8302 MappableExprComponentListsRef ComponentLists);
8312 static OMPUseDeviceAddrClause *
8313 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8316 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8317 reinterpret_cast<Stmt **
>(varlist_end()));
8321 return const_cast<OMPUseDeviceAddrClause *
>(
this)->
children();
8325 return child_range(child_iterator(), child_iterator());
8328 return const_child_range(const_child_iterator(), const_child_iterator());
8332 return T->getClauseKind() == llvm::omp::OMPC_use_device_addr;
8344class OMPIsDevicePtrClause final
8345 :
public OMPMappableExprListClause<OMPIsDevicePtrClause>,
8346 private llvm::TrailingObjects<
8347 OMPIsDevicePtrClause, Expr *, ValueDecl *, unsigned,
8348 OMPClauseMappableExprCommon::MappableComponent> {
8350 friend OMPMappableExprListClause;
8351 friend OMPVarListClause;
8352 friend TrailingObjects;
8364 explicit OMPIsDevicePtrClause(
const OMPVarListLocTy &Locs,
8366 : OMPMappableExprListClause(
llvm::omp::OMPC_is_device_ptr, Locs, Sizes) {}
8377 OMPVarListLocTy(), Sizes) {}
8381 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8382 return varlist_size();
8384 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8385 return getUniqueDeclarationsNum();
8387 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8388 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8401 static OMPIsDevicePtrClause *
8402 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8403 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8404 MappableExprComponentListsRef ComponentLists);
8414 static OMPIsDevicePtrClause *
8415 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8418 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8419 reinterpret_cast<Stmt **
>(varlist_end()));
8423 return const_cast<OMPIsDevicePtrClause *
>(
this)->
children();
8427 return child_range(child_iterator(), child_iterator());
8430 return const_child_range(const_child_iterator(), const_child_iterator());
8434 return T->getClauseKind() == llvm::omp::OMPC_is_device_ptr;
8446class OMPHasDeviceAddrClause final
8447 :
public OMPMappableExprListClause<OMPHasDeviceAddrClause>,
8448 private llvm::TrailingObjects<
8449 OMPHasDeviceAddrClause, Expr *, ValueDecl *, unsigned,
8450 OMPClauseMappableExprCommon::MappableComponent> {
8452 friend OMPMappableExprListClause;
8453 friend OMPVarListClause;
8454 friend TrailingObjects;
8466 explicit OMPHasDeviceAddrClause(
const OMPVarListLocTy &Locs,
8468 : OMPMappableExprListClause(
llvm::omp::OMPC_has_device_addr, Locs,
8480 OMPVarListLocTy(), Sizes) {}
8484 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8485 return varlist_size();
8487 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8488 return getUniqueDeclarationsNum();
8490 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8491 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8504 static OMPHasDeviceAddrClause *
8505 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8506 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8507 MappableExprComponentListsRef ComponentLists);
8517 static OMPHasDeviceAddrClause *
8518 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8521 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8522 reinterpret_cast<Stmt **
>(varlist_end()));
8526 return const_cast<OMPHasDeviceAddrClause *
>(
this)->
children();
8530 return child_range(child_iterator(), child_iterator());
8533 return const_child_range(const_child_iterator(), const_child_iterator());
8537 return T->getClauseKind() == llvm::omp::OMPC_has_device_addr;
8548class OMPNontemporalClause final
8549 :
public OMPVarListClause<OMPNontemporalClause>,
8550 private llvm::TrailingObjects<OMPNontemporalClause, Expr *> {
8552 friend OMPVarListClause;
8553 friend TrailingObjects;
8561 OMPNontemporalClause(SourceLocation StartLoc, SourceLocation LParenLoc,
8562 SourceLocation EndLoc,
unsigned N)
8563 : OMPVarListClause<OMPNontemporalClause>(
llvm::omp::OMPC_nontemporal,
8564 StartLoc, LParenLoc, EndLoc, N) {
8572 llvm::omp::OMPC_nontemporal, SourceLocation(), SourceLocation(),
8573 SourceLocation(), N) {}
8577 MutableArrayRef<Expr *> getPrivateRefs() {
8578 return {varlist_end(), varlist_size()};
8580 ArrayRef<const Expr *> getPrivateRefs()
const {
8581 return {varlist_end(), varlist_size()};
8592 static OMPNontemporalClause *
8593 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
8594 SourceLocation EndLoc, ArrayRef<Expr *> VL);
8600 static OMPNontemporalClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
8604 void setPrivateRefs(ArrayRef<Expr *> VL);
8607 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8608 reinterpret_cast<Stmt **
>(varlist_end()));
8612 return const_cast<OMPNontemporalClause *
>(
this)->
children();
8616 return child_range(
reinterpret_cast<Stmt **
>(getPrivateRefs().begin()),
8617 reinterpret_cast<Stmt **
>(getPrivateRefs().end()));
8621 return const_cast<OMPNontemporalClause *
>(
this)->
private_refs();
8625 return child_range(child_iterator(), child_iterator());
8628 return const_child_range(const_child_iterator(), const_child_iterator());
8632 return T->getClauseKind() == llvm::omp::OMPC_nontemporal;
8647 SourceLocation LParenLoc;
8650 OpenMPOrderClauseKind Kind = OMPC_ORDER_unknown;
8653 SourceLocation KindKwLoc;
8656 OpenMPOrderClauseModifier Modifier = OMPC_ORDER_MODIFIER_unknown;
8659 SourceLocation ModifierKwLoc;
8664 void setKind(OpenMPOrderClauseKind K) { Kind = K; }
8669 void setKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
8674 void setModifier(OpenMPOrderClauseModifier M) { Modifier = M; }
8679 void setModifierKwLoc(SourceLocation MLoc) { ModifierKwLoc = MLoc; }
8692 SourceLocation StartLoc, SourceLocation LParenLoc,
8693 SourceLocation EndLoc, OpenMPOrderClauseModifier Modifier,
8694 SourceLocation MLoc)
8696 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc), Modifier(Modifier),
8697 ModifierKwLoc(MLoc) {}
8701 :
OMPClause(
llvm::omp::OMPC_order, SourceLocation(), SourceLocation()) {}
8710 OpenMPOrderClauseKind
getKind()
const {
return Kind; }
8722 return child_range(child_iterator(), child_iterator());
8726 return const_child_range(const_child_iterator(), const_child_iterator());
8730 return child_range(child_iterator(), child_iterator());
8733 return const_child_range(const_child_iterator(), const_child_iterator());
8737 return T->getClauseKind() == llvm::omp::OMPC_order;
8746class OMPInitClause final
8747 :
public OMPVarListClause<OMPInitClause>,
8748 private llvm::TrailingObjects<OMPInitClause, Expr *> {
8750 friend OMPVarListClause;
8751 friend TrailingObjects;
8754 SourceLocation VarLoc;
8756 bool IsTarget =
false;
8757 bool IsTargetSync =
false;
8759 void setInteropVar(Expr *E) { varlist_begin()[0] = E; }
8761 void setIsTarget(
bool V) { IsTarget =
V; }
8763 void setIsTargetSync(
bool V) { IsTargetSync =
V; }
8766 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
8777 OMPInitClause(
bool IsTarget,
bool IsTargetSync, SourceLocation StartLoc,
8778 SourceLocation LParenLoc, SourceLocation VarLoc,
8779 SourceLocation EndLoc,
unsigned N)
8780 : OMPVarListClause<OMPInitClause>(llvm::omp::OMPC_init, StartLoc,
8781 LParenLoc, EndLoc, N),
8782 VarLoc(VarLoc), IsTarget(IsTarget), IsTargetSync(IsTargetSync) {}
8785 OMPInitClause(
unsigned N)
8786 : OMPVarListClause<OMPInitClause>(llvm::omp::OMPC_init, SourceLocation(),
8787 SourceLocation(), SourceLocation(), N) {
8800 static OMPInitClause *
Create(
const ASTContext &C, Expr *InteropVar,
8801 OMPInteropInfo &InteropInfo,
8802 SourceLocation StartLoc,
8803 SourceLocation LParenLoc, SourceLocation VarLoc,
8804 SourceLocation EndLoc);
8810 static OMPInitClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
8826 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8827 reinterpret_cast<Stmt **
>(varlist_end()));
8831 return const_cast<OMPInitClause *
>(
this)->
children();
8835 return child_range(child_iterator(), child_iterator());
8838 return const_child_range(const_child_iterator(), const_child_iterator());
8847 return prefs_range(
reinterpret_cast<Expr **
>(std::next(varlist_begin())),
8848 reinterpret_cast<Expr **
>(varlist_end()));
8856 return T->getClauseKind() == llvm::omp::OMPC_init;
8869 SourceLocation LParenLoc;
8872 SourceLocation VarLoc;
8875 Stmt *InteropVar =
nullptr;
8878 void setInteropVar(Expr *E) { InteropVar = E; }
8881 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
8884 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
8895 SourceLocation LParenLoc, SourceLocation VarLoc,
8896 SourceLocation EndLoc)
8897 :
OMPClause(
llvm::omp::OMPC_use, StartLoc, EndLoc), LParenLoc(LParenLoc),
8898 VarLoc(VarLoc), InteropVar(InteropVar) {}
8902 :
OMPClause(
llvm::omp::OMPC_use, SourceLocation(), SourceLocation()) {}
8913 child_range
children() {
return child_range(&InteropVar, &InteropVar + 1); }
8916 return const_child_range(&InteropVar, &InteropVar + 1);
8920 return child_range(child_iterator(), child_iterator());
8923 return const_child_range(const_child_iterator(), const_child_iterator());
8927 return T->getClauseKind() == llvm::omp::OMPC_use;
8944 SourceLocation LParenLoc;
8947 SourceLocation VarLoc;
8950 Stmt *InteropVar =
nullptr;
8953 void setInteropVar(Expr *E) { InteropVar = E; }
8956 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
8959 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
8970 SourceLocation LParenLoc, SourceLocation VarLoc,
8971 SourceLocation EndLoc)
8973 LParenLoc(LParenLoc), VarLoc(VarLoc), InteropVar(InteropVar) {}
8984 :
OMPClause(
llvm::omp::OMPC_destroy, SourceLocation(), SourceLocation()) {
8998 return child_range(&InteropVar, &InteropVar + 1);
8999 return child_range(child_iterator(), child_iterator());
9004 return const_child_range(&InteropVar, &InteropVar + 1);
9005 return const_child_range(const_child_iterator(), const_child_iterator());
9009 return child_range(child_iterator(), child_iterator());
9012 return const_child_range(const_child_iterator(), const_child_iterator());
9016 return T->getClauseKind() == llvm::omp::OMPC_destroy;
9033 void setCondition(Expr *Cond) { setStmt(Cond); }
9046 OpenMPDirectiveKind CaptureRegion,
9047 SourceLocation StartLoc, SourceLocation LParenLoc,
9048 SourceLocation EndLoc)
9051 setPreInitStmt(HelperCond, CaptureRegion);
9060 child_range used_children();
9079 void setCondition(Expr *Cond) { setStmt(Cond); }
9092 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
9093 SourceLocation LParenLoc, SourceLocation EndLoc)
9096 setPreInitStmt(HelperCond, CaptureRegion);
9105 child_range used_children();
9123 void setEventHandler(Expr *E) { setStmt(E); }
9133 SourceLocation EndLoc)
9150class OMPInclusiveClause final
9151 :
public OMPVarListClause<OMPInclusiveClause>,
9152 private llvm::TrailingObjects<OMPInclusiveClause, Expr *> {
9154 friend OMPVarListClause;
9155 friend TrailingObjects;
9163 OMPInclusiveClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9164 SourceLocation EndLoc,
unsigned N)
9165 : OMPVarListClause<OMPInclusiveClause>(
llvm::omp::OMPC_inclusive,
9166 StartLoc, LParenLoc, EndLoc, N) {}
9173 SourceLocation(), SourceLocation(),
9174 SourceLocation(), N) {}
9184 static OMPInclusiveClause *
Create(
const ASTContext &C,
9185 SourceLocation StartLoc,
9186 SourceLocation LParenLoc,
9187 SourceLocation EndLoc, ArrayRef<Expr *> VL);
9193 static OMPInclusiveClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9196 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
9197 reinterpret_cast<Stmt **
>(varlist_end()));
9201 return const_cast<OMPInclusiveClause *
>(
this)->
children();
9205 return child_range(child_iterator(), child_iterator());
9208 return const_child_range(const_child_iterator(), const_child_iterator());
9212 return T->getClauseKind() == llvm::omp::OMPC_inclusive;
9223class OMPExclusiveClause final
9224 :
public OMPVarListClause<OMPExclusiveClause>,
9225 private llvm::TrailingObjects<OMPExclusiveClause, Expr *> {
9227 friend OMPVarListClause;
9228 friend TrailingObjects;
9236 OMPExclusiveClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9237 SourceLocation EndLoc,
unsigned N)
9238 : OMPVarListClause<OMPExclusiveClause>(
llvm::omp::OMPC_exclusive,
9239 StartLoc, LParenLoc, EndLoc, N) {}
9246 SourceLocation(), SourceLocation(),
9247 SourceLocation(), N) {}
9257 static OMPExclusiveClause *
Create(
const ASTContext &C,
9258 SourceLocation StartLoc,
9259 SourceLocation LParenLoc,
9260 SourceLocation EndLoc, ArrayRef<Expr *> VL);
9266 static OMPExclusiveClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9269 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
9270 reinterpret_cast<Stmt **
>(varlist_end()));
9274 return const_cast<OMPExclusiveClause *
>(
this)->
children();
9278 return child_range(child_iterator(), child_iterator());
9281 return const_child_range(const_child_iterator(), const_child_iterator());
9285 return T->getClauseKind() == llvm::omp::OMPC_exclusive;
9297class OMPUsesAllocatorsClause final
9299 private llvm::TrailingObjects<OMPUsesAllocatorsClause, Expr *,
9314 friend TrailingObjects;
9316 enum class ExprOffsets {
9322 enum class ParenLocsOffsets {
9329 SourceLocation LParenLoc;
9331 unsigned NumOfAllocators = 0;
9339 OMPUsesAllocatorsClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9340 SourceLocation EndLoc,
unsigned N)
9341 : OMPClause(llvm::omp::OMPC_uses_allocators, StartLoc, EndLoc),
9342 LParenLoc(LParenLoc), NumOfAllocators(N) {}
9347 explicit OMPUsesAllocatorsClause(
unsigned N)
9348 : OMPClause(llvm::omp::OMPC_uses_allocators, SourceLocation(),
9350 NumOfAllocators(N) {}
9352 unsigned numTrailingObjects(OverloadToken<Expr *>)
const {
9353 return NumOfAllocators *
static_cast<int>(ExprOffsets::Total);
9357 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9360 void setAllocatorsData(ArrayRef<OMPUsesAllocatorsClause::Data> Data);
9370 static OMPUsesAllocatorsClause *
9371 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
9372 SourceLocation EndLoc, ArrayRef<OMPUsesAllocatorsClause::Data> Data);
9378 static OMPUsesAllocatorsClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9391 Stmt **Begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
9392 return child_range(Begin, Begin + NumOfAllocators *
9393 static_cast<int>(ExprOffsets::Total));
9396 Stmt *
const *Begin =
9397 reinterpret_cast<Stmt *
const *
>(getTrailingObjects<Expr *>());
9398 return const_child_range(
9399 Begin, Begin + NumOfAllocators *
static_cast<int>(ExprOffsets::Total));
9403 return child_range(child_iterator(), child_iterator());
9406 return const_child_range(const_child_iterator(), const_child_iterator());
9410 return T->getClauseKind() == llvm::omp::OMPC_uses_allocators;
9423class OMPAffinityClause final
9424 :
public OMPVarListClause<OMPAffinityClause>,
9425 private llvm::TrailingObjects<OMPAffinityClause, Expr *> {
9427 friend OMPVarListClause;
9428 friend TrailingObjects;
9431 SourceLocation ColonLoc;
9440 OMPAffinityClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9441 SourceLocation ColonLoc, SourceLocation EndLoc,
unsigned N)
9442 : OMPVarListClause<OMPAffinityClause>(
llvm::omp::OMPC_affinity, StartLoc,
9443 LParenLoc, EndLoc, N) {}
9450 SourceLocation(), SourceLocation(),
9451 SourceLocation(), N) {}
9454 void setModifier(Expr *E) { getTrailingObjects()[varlist_size()] = E; }
9457 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
9468 static OMPAffinityClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
9469 SourceLocation LParenLoc,
9470 SourceLocation ColonLoc,
9471 SourceLocation EndLoc, Expr *Modifier,
9472 ArrayRef<Expr *> Locators);
9478 static OMPAffinityClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9482 Expr *
getModifier()
const {
return getTrailingObjects()[varlist_size()]; }
9490 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
9491 reinterpret_cast<Stmt **
>(varlist_end() + Offset));
9495 return const_cast<OMPAffinityClause *
>(
this)->
children();
9499 return child_range(child_iterator(), child_iterator());
9502 return const_child_range(const_child_iterator(), const_child_iterator());
9506 return T->getClauseKind() == llvm::omp::OMPC_affinity;
9523 void setThreadID(Expr *TID) { setStmt(TID); }
9536 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
9537 SourceLocation LParenLoc, SourceLocation EndLoc)
9540 setPreInitStmt(HelperE, CaptureRegion);
9562 SourceLocation LParenLoc;
9565 OpenMPBindClauseKind Kind = OMPC_BIND_unknown;
9568 SourceLocation KindLoc;
9571 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9574 void setBindKind(OpenMPBindClauseKind K) { Kind = K; }
9577 void setBindKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
9586 OMPBindClause(OpenMPBindClauseKind K, SourceLocation KLoc,
9587 SourceLocation StartLoc, SourceLocation LParenLoc,
9588 SourceLocation EndLoc)
9589 : OMPNoChildClause(StartLoc, EndLoc), LParenLoc(LParenLoc),
Kind(K),
9593 OMPBindClause() : OMPNoChildClause() {}
9604 static OMPBindClause *
Create(
const ASTContext &C, OpenMPBindClauseKind K,
9605 SourceLocation KLoc, SourceLocation StartLoc,
9606 SourceLocation LParenLoc, SourceLocation EndLoc);
9611 static OMPBindClause *
CreateEmpty(
const ASTContext &C);
9625template<
class ImplClass,
template <
typename>
class Ptr,
typename RetTy>
9628#define PTR(CLASS) Ptr<CLASS>
9629#define DISPATCH(CLASS) \
9630 return static_cast<ImplClass*>(this)->Visit##CLASS(static_cast<PTR(CLASS)>(S))
9632#define GEN_CLANG_CLAUSE_CLASS
9633#define CLAUSE_CLASS(Enum, Str, Class) \
9634 RetTy Visit##Class(PTR(Class) S) { \
9635 return static_cast<ImplClass *>(this)->VisitOMPClause(S); \
9637#include "llvm/Frontend/OpenMP/OMP.inc"
9641 switch (S->getClauseKind()) {
9642#define GEN_CLANG_CLAUSE_CLASS
9643#define CLAUSE_CLASS(Enum, Str, Class) \
9644 case llvm::omp::Clause::Enum: \
9646#define CLAUSE_NO_CLASS(Enum, Str) \
9647 case llvm::omp::Clause::Enum: \
9649#include "llvm/Frontend/OpenMP/OMP.inc"
9658template <
typename T>
using const_ptr = std::add_pointer_t<std::add_const_t<T>>;
9660template <
class ImplClass,
typename RetTy =
void>
9663template<
class ImplClass,
typename RetTy =
void>
9669 const PrintingPolicy &Policy;
9673 template <
typename T>
void VisitOMPClauseList(T *Node,
char StartSym);
9675 template <
typename T>
void VisitOMPMotionClause(T *Node);
9679 unsigned OpenMPVersion)
9680 : OS(OS), Policy(Policy), Version(OpenMPVersion) {}
9682#define GEN_CLANG_CLAUSE_CLASS
9683#define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(Class *S);
9684#include "llvm/Frontend/OpenMP/OMP.inc"
9688 llvm::omp::TraitProperty
Kind = llvm::omp::TraitProperty::invalid;
9697 llvm::omp::TraitSelector
Kind = llvm::omp::TraitSelector::invalid;
9702 llvm::omp::TraitSet
Kind = llvm::omp::TraitSet::invalid;
9718 OMPTraitInfo(StringRef MangledName);
9724 llvm::function_ref<
bool(Expr *&,
bool )> Cond) {
9726 return llvm::any_of(
9728 return Cond(Selector.ScoreOrCondition,
9730 llvm::omp::TraitSelector::user_condition);
9740 void getAsVariantMatchInfo(
ASTContext &ASTCtx,
9741 llvm::omp::VariantMatchInfo &VMI)
const;
9744 std::string getMangledName()
const;
9749 if (Set.Kind != llvm::omp::TraitSet::implementation)
9752 if (Selector.
Kind != llvm::omp::TraitSelector::implementation_extension)
9755 if (Property.Kind == TP)
9764 void print(llvm::raw_ostream &OS,
const PrintingPolicy &Policy)
const;
9773 const FunctionDecl *CurrentFunctionDecl,
9785 llvm::StringMap<bool> FeatureMap;
9791class OMPChildren final
9792 :
private llvm::TrailingObjects<OMPChildren, OMPClause *, Stmt *> {
9793 friend TrailingObjects;
9799 unsigned NumClauses = 0;
9801 unsigned NumChildren = 0;
9803 bool HasAssociatedStmt =
false;
9807 size_t numTrailingObjects(OverloadToken<OMPClause *>)
const {
9813 OMPChildren(
unsigned NumClauses,
unsigned NumChildren,
bool HasAssociatedStmt)
9814 : NumClauses(NumClauses), NumChildren(NumChildren),
9815 HasAssociatedStmt(HasAssociatedStmt) {}
9817 static size_t size(
unsigned NumClauses,
bool HasAssociatedStmt,
9818 unsigned NumChildren);
9820 static OMPChildren *
Create(
void *Mem, ArrayRef<OMPClause *> Clauses);
9821 static OMPChildren *
Create(
void *Mem, ArrayRef<OMPClause *> Clauses, Stmt *S,
9822 unsigned NumChildren = 0);
9823 static OMPChildren *
CreateEmpty(
void *Mem,
unsigned NumClauses,
9824 bool HasAssociatedStmt =
false,
9825 unsigned NumChildren = 0);
9834 getTrailingObjects<Stmt *>()[NumChildren] = S;
9850 assert(HasAssociatedStmt &&
9851 "Expected directive with the associated statement.");
9852 return getTrailingObjects<Stmt *>()[NumChildren];
9857 return getTrailingObjects<OMPClause *>(NumClauses);
9860 return const_cast<OMPChildren *
>(
this)->
getClauses();
9867 const CapturedStmt *
9870 assert(llvm::is_contained(CaptureRegions, RegionKind) &&
9871 "RegionKind not found in OpenMP CaptureRegions.");
9873 for (
auto ThisCaptureRegion : CaptureRegions) {
9874 if (ThisCaptureRegion == RegionKind)
9876 CS = cast<CapturedStmt>(CS->getCapturedStmt());
9878 llvm_unreachable(
"Incorrect RegionKind specified for directive.");
9885 assert(!CaptureRegions.empty() &&
9886 "At least one captured statement must be provided.");
9888 for (
unsigned Level = CaptureRegions.size(); Level > 1; --Level)
9889 CS = cast<CapturedStmt>(CS->getCapturedStmt());
9893 const CapturedStmt *
9899 MutableArrayRef<Stmt *> getChildren();
9901 return const_cast<OMPChildren *
>(
this)->
getChildren();
9905 assert(HasAssociatedStmt &&
9906 "Expected directive with the associated statement.");
9910 S = CS->getCapturedStmt();
9911 CS = dyn_cast<CapturedStmt>(S);
9918 return const_cast<OMPChildren *
>(
this)->
getRawStmt();
9922 if (!HasAssociatedStmt)
9923 return Stmt::child_range(Stmt::child_iterator(), Stmt::child_iterator());
9924 return Stmt::child_range(&getTrailingObjects<Stmt *>()[NumChildren],
9925 &getTrailingObjects<Stmt *>()[NumChildren + 1]);
9941 void setSize(Expr *E) { setStmt(E); }
9953 OpenMPDirectiveKind CaptureRegion,
9954 SourceLocation StartLoc, SourceLocation LParenLoc,
9955 SourceLocation EndLoc)
9958 setPreInitStmt(HelperSize, CaptureRegion);
9968 Expr *
getSize()
const {
return getStmtAs<Expr>(); }
9981 SourceLocation LParenLoc;
9984 enum { SIMPLE, FALLBACK, NUM_MODIFIERS };
9985 unsigned Modifiers[NUM_MODIFIERS];
9988 SourceLocation ModifiersLoc[NUM_MODIFIERS];
9991 Expr *Size =
nullptr;
9996 void setDynGroupprivateModifier(OpenMPDynGroupprivateClauseModifier M) {
9997 Modifiers[SIMPLE] = M;
10003 void setDynGroupprivateFallbackModifier(
10004 OpenMPDynGroupprivateClauseFallbackModifier M) {
10005 Modifiers[FALLBACK] = M;
10009 void setDynGroupprivateModifierLoc(SourceLocation Loc) {
10010 ModifiersLoc[SIMPLE] = Loc;
10014 void setDynGroupprivateFallbackModifierLoc(SourceLocation Loc) {
10015 ModifiersLoc[FALLBACK] = Loc;
10021 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
10026 void setSize(Expr *E) {
Size = E; }
10040 SourceLocation EndLoc, Expr *Size, Stmt *HelperSize,
10041 OpenMPDirectiveKind CaptureRegion,
10042 OpenMPDynGroupprivateClauseModifier M1,
10043 SourceLocation M1Loc,
10044 OpenMPDynGroupprivateClauseFallbackModifier M2,
10045 SourceLocation M2Loc)
10046 :
OMPClause(
llvm::omp::OMPC_dyn_groupprivate, StartLoc, EndLoc),
10048 setPreInitStmt(HelperSize, CaptureRegion);
10049 Modifiers[SIMPLE] = M1;
10050 Modifiers[FALLBACK] = M2;
10051 ModifiersLoc[SIMPLE] = M1Loc;
10052 ModifiersLoc[FALLBACK] = M2Loc;
10057 :
OMPClause(
llvm::omp::OMPC_dyn_groupprivate, SourceLocation(),
10060 Modifiers[SIMPLE] = OMPC_DYN_GROUPPRIVATE_unknown;
10061 Modifiers[FALLBACK] = OMPC_DYN_GROUPPRIVATE_FALLBACK_unknown;
10066 return static_cast<OpenMPDynGroupprivateClauseModifier
>(Modifiers[SIMPLE]);
10070 OpenMPDynGroupprivateClauseFallbackModifier
10072 return static_cast<OpenMPDynGroupprivateClauseFallbackModifier
>(
10073 Modifiers[FALLBACK]);
10081 return ModifiersLoc[SIMPLE];
10086 return ModifiersLoc[FALLBACK];
10096 return child_range(
reinterpret_cast<Stmt **
>(&Size),
10097 reinterpret_cast<Stmt **
>(&Size) + 1);
10105 return child_range(child_iterator(), child_iterator());
10108 return const_child_range(const_child_iterator(), const_child_iterator());
10112 return T->getClauseKind() == llvm::omp::OMPC_dyn_groupprivate;
10124class OMPDoacrossClause final
10125 :
public OMPVarListClause<OMPDoacrossClause>,
10126 private llvm::TrailingObjects<OMPDoacrossClause, Expr *> {
10128 friend OMPVarListClause;
10129 friend TrailingObjects;
10132 OpenMPDoacrossClauseModifier DepType = OMPC_DOACROSS_unknown;
10135 SourceLocation DepLoc;
10138 SourceLocation ColonLoc;
10141 unsigned NumLoops = 0;
10150 OMPDoacrossClause(SourceLocation StartLoc, SourceLocation LParenLoc,
10151 SourceLocation EndLoc,
unsigned N,
unsigned NumLoops)
10152 : OMPVarListClause<OMPDoacrossClause>(
llvm::omp::OMPC_doacross, StartLoc,
10153 LParenLoc, EndLoc, N),
10154 NumLoops(NumLoops) {}
10162 SourceLocation(), SourceLocation(),
10163 SourceLocation(), N),
10164 NumLoops(NumLoops) {}
10167 void setDependenceType(OpenMPDoacrossClauseModifier M) { DepType = M; }
10170 void setDependenceLoc(SourceLocation Loc) { DepLoc = Loc; }
10173 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
10187 static OMPDoacrossClause *
10188 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
10189 SourceLocation EndLoc, OpenMPDoacrossClauseModifier DepType,
10190 SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VL,
10191 unsigned NumLoops);
10198 static OMPDoacrossClause *
CreateEmpty(
const ASTContext &C,
unsigned N,
10199 unsigned NumLoops);
10214 void setLoopData(
unsigned NumLoop, Expr *Cnt);
10217 Expr *getLoopData(
unsigned NumLoop);
10218 const Expr *getLoopData(
unsigned NumLoop)
const;
10221 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
10222 reinterpret_cast<Stmt **
>(varlist_end()));
10226 return const_cast<OMPDoacrossClause *
>(
this)->
children();
10230 return child_range(child_iterator(), child_iterator());
10233 return const_child_range(const_child_iterator(), const_child_iterator());
10237 return T->getClauseKind() == llvm::omp::OMPC_doacross;
10252 SourceLocation LParenLoc;
10265 SourceLocation LParenLoc, SourceLocation EndLoc)
10266 :
OMPNoChildClause(StartLoc, EndLoc), LParenLoc(LParenLoc), Attrs(Attrs) {
10285 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.
friend class OMPClauseReader
const_child_range used_children() const
OMPDefaultClause(llvm::omp::DefaultKind A, SourceLocation ALoc, OpenMPDefaultClauseVariableCategory VC, SourceLocation VCLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'default' clause with argument A ('none' or 'shared').
SourceLocation getLParenLoc() const
Returns the location of '('.
llvm::omp::DefaultKind getDefaultKind() const
Returns kind of the clause.
SourceLocation getDefaultKindKwLoc() const
Returns location of clause kind.
OpenMPDefaultClauseVariableCategory getDefaultVC() const
static bool classof(const OMPClause *T)
child_range used_children()
const_child_range children() const
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OMPDefaultClause()
Build an empty clause.
SourceLocation getDefaultVCLoc() const
Class that represents a list of directive kinds (parallel, target, etc.) as used in absent,...
MutableArrayRef< OpenMPDirectiveKind > getDirectiveKinds()
void setDirectiveKinds(ArrayRef< OpenMPDirectiveKind > DK)
SourceLocation getLParenLoc()
const_child_range children() const
unsigned NumKinds
Number of directive kinds listed in the clause.
void setLParenLoc(SourceLocation S)
const_child_range used_children() const
OMPDirectiveListClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned NumKinds)
Build a clause with NumKinds directive kinds.
child_range used_children()
child_range used_children()
friend class OMPClauseReader
Expr * getCondition() const
Returns condition.
OMPFinalClause(Expr *Cond, Stmt *HelperCond, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'final' clause with condition Cond.
OMPFinalClause()
Build an empty clause.
const_child_range used_children() const
Representation of the 'full' clause of the 'pragma omp unroll' directive.
friend class OMPClauseReader
static OMPFullClause * CreateEmpty(const ASTContext &C)
Build an empty 'full' AST node for deserialization.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
friend class OMPClauseReader
const_child_range used_children() const
SourceLocation getLParenLoc() const
Returns the location of '('.
SourceLocation getColonLoc() const
Return the location of ':'.
static bool classof(const OMPClause *T)
child_range used_children()
Expr * getCondition() const
Returns condition.
OpenMPDirectiveKind getNameModifier() const
Return directive name modifier associated with the clause.
OMPIfClause()
Build an empty clause.
const_child_range children() const
OMPIfClause(OpenMPDirectiveKind NameModifier, Expr *Cond, Stmt *HelperCond, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation NameModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc)
Build 'if' clause with condition Cond.
SourceLocation getNameModifierLoc() const
Return the location of directive name modifier.
friend class OMPClauseReader
Expr * getFirst() const
Get looprange 'first' expression.
static OMPLoopRangeClause * CreateEmpty(const ASTContext &C)
Build an empty 'looprange' clause node.
const_child_range used_children() const
void setFirstLoc(SourceLocation Loc)
child_range used_children()
void setCountLoc(SourceLocation Loc)
SourceLocation getFirstLoc() const
SourceLocation getLParenLoc() const
static bool classof(const OMPClause *T)
SourceLocation getCountLoc() const
const_child_range children() const
Expr * getCount() const
Get looprange 'count' expression.
void setLParenLoc(SourceLocation Loc)
OpenMPNumThreadsClauseModifier getModifier() const
Gets modifier.
friend class OMPClauseReader
SourceLocation getModifierLoc() const
Gets modifier location.
OMPNumThreadsClause()
Build an empty clause.
OMPNumThreadsClause(OpenMPNumThreadsClauseModifier Modifier, Expr *NumThreads, Stmt *HelperNumThreads, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Build 'num_threads' clause with condition NumThreads.
Expr * getNumThreads() const
Returns number of threads.
const_child_range used_children() const
child_range used_children()
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OMPOneStmtClause(Stmt *S, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
static bool classof(const OMPClause *T)
ConstStmtIterator const_child_iterator
const_child_range children() const
StmtIterator child_iterator
llvm::iterator_range< child_iterator > child_range
SourceLocation getLParenLoc() const
Returns the location of '('.
llvm::iterator_range< const_child_iterator > const_child_range
T * getStmtAs() const
Return the associated statement, potentially casted to T.
child_range used_children()
friend class OMPClauseReader
static OMPPartialClause * CreateEmpty(const ASTContext &C)
Build an empty 'partial' AST node for deserialization.
const_child_range used_children() const
SourceLocation getLParenLoc() const
Returns the location of '('.
const_child_range children() const
static bool classof(const OMPClause *T)
Expr * getFactor() const
Returns the argument of the clause or nullptr if not set.
This class represents the 'permutation' clause in the 'pragma omp interchange' directive.
static bool classof(const OMPClause *T)
friend class OMPClauseReader
ArrayRef< Expr * > getArgsRefs() const
unsigned getNumLoops() const
Returns the number of list items.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
SourceLocation getLParenLoc() const
Returns the location of '('.
child_range used_children()
MutableArrayRef< Expr * > getArgsRefs()
Returns the permutation index expressions.
static OMPPermutationClause * CreateEmpty(const ASTContext &C, unsigned NumLoops)
Build an empty 'permutation' AST node for deserialization.
const_child_range used_children() const
const_child_range children() const
friend class OMPClauseReader
OMPSafelenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'safelen' clause.
Expr * getSafelen() const
Return safe iteration space distance.
OMPSafelenClause()
Build an empty clause.
friend class OMPClauseReader
OMPSimdlenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'simdlen' clause.
Expr * getSimdlen() const
Return safe iteration space distance.
OMPSimdlenClause()
Build an empty clause.
This represents the 'sizes' clause in the 'pragma omp tile' directive.
SourceLocation getLParenLoc() const
Returns the location of '('.
friend class OMPClauseReader
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
static bool classof(const OMPClause *T)
const_child_range used_children() const
void setSizesRefs(ArrayRef< Expr * > VL)
Sets the tile size expressions.
unsigned getNumSizes() const
Returns the number of list items.
child_range used_children()
MutableArrayRef< Expr * > getSizesRefs()
Returns the tile size expressions.
ArrayRef< Expr * > getSizesRefs() const
const_child_range children() const
static OMPSizesClause * CreateEmpty(const ASTContext &C, unsigned NumSizes)
Build an empty 'sizes' AST node for deserialization.
friend class OMPClauseReader
static bool classof(const OMPClause *T)
OpenMPThreadsetKind getThreadsetKind() const
Returns kind of the clause.
const_child_range children() const
OMPThreadsetClause(OpenMPThreadsetKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'threadset' clause with argument A ('omp_team' or 'omp_pool').
child_range used_children()
const_child_range used_children() const
SourceLocation getThreadsetKindLoc() const
Returns location of clause kind.
SourceLocation getLParenLoc() const
Returns the location of '('.
OMPThreadsetClause()
Build an empty clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
This represents clauses with the list of variables like 'private', 'firstprivate',...
varlist_const_range varlist() const
friend class OMPClauseReader
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
ArrayRef< const Expr * > getVarRefs() const
Fetches list of all variables in the clause.
OMPVarListClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N)
Build a clause with N variables.
MutableArrayRef< Expr * > getVarRefs()
Fetches list of variables associated with this clause.
varlist_const_iterator varlist_end() const
varlist_iterator varlist_end()
llvm::iterator_range< varlist_const_iterator > varlist_const_range
MutableArrayRef< Expr * >::iterator varlist_iterator
varlist_iterator varlist_begin()
ArrayRef< const Expr * >::iterator varlist_const_iterator
SourceLocation getLParenLoc() const
Returns the location of '('.
bool varlist_empty() const
unsigned varlist_size() const
varlist_const_iterator varlist_begin() const
llvm::iterator_range< varlist_iterator > varlist_range
void setVarRefs(ArrayRef< Expr * > VL)
Sets the list of variables for this clause.
Encodes a location in the source.
Stmt - This represents one statement.
The JSON file list parser is used to communicate input to InstallAPI.
OpenMPOriginalSharingModifier
OpenMP 6.0 original sharing modifiers.
ArrayRef< const Expr * >::iterator used_expressions_const_iterator
bool checkFailClauseParameter(OpenMPClauseKind FailClauseParameter)
Checks if the parameter to the fail clause in "#pragma atomic compare fail" is restricted only to mem...
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
llvm::iterator_range< inits_iterator > inits_range
privates_range privates()
OpenMPDefaultClauseVariableCategory
OpenMP variable-category for 'default' clause.
MutableArrayRef< Expr * >::iterator privates_iterator
llvm::iterator_range< finals_const_iterator > finals_const_range
MutableArrayRef< Expr * > getPrivates()
Finals[]; Step; CalcStep; }.
void setColonLoc(SourceLocation Loc)
Sets the location of ':'.
MutableArrayRef< Expr * >::iterator inits_iterator
OpenMPLinearClauseKind getModifier() const
Return modifier.
llvm::iterator_range< privates_const_iterator > privates_const_range
void setUsedExprs(ArrayRef< Expr * > UE)
Sets the list of used expressions for the linear clause.
OpenMPAtClauseKind
OpenMP attributes for 'at' clause.
OpenMPReductionClauseModifier
OpenMP modifiers for 'reduction' clause.
void setUpdates(ArrayRef< Expr * > UL)
Sets the list of update expressions for linear variables.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
@ OMPC_SCHEDULE_MODIFIER_unknown
llvm::iterator_range< inits_const_iterator > inits_const_range
llvm::iterator_range< updates_iterator > updates_range
llvm::iterator_range< used_expressions_iterator > used_expressions_range
MutableArrayRef< Expr * >::iterator updates_iterator
SourceLocation getStepModifierLoc() const
Returns the location of 'step' modifier.
const FunctionProtoType * T
OpenMPLastprivateModifier
OpenMP 'lastprivate' clause modifier.
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Expr * getStep()
Returns linear step.
ArrayRef< const Expr * >::iterator updates_const_iterator
child_range used_children()
llvm::iterator_range< privates_iterator > privates_range
OpenMPSeverityClauseKind
OpenMP attributes for 'severity' clause.
void setPrivates(ArrayRef< Expr * > PL)
Sets the list of the copies of original linear variables.
MutableArrayRef< Expr * > getUsedExprs()
Gets the list of used expressions for linear variables.
MutableArrayRef< Expr * >::iterator used_expressions_iterator
void setInits(ArrayRef< Expr * > IL)
Sets the list of the initial values for linear variables.
OpenMPAllocateClauseModifier
OpenMP modifiers for 'allocate' clause.
void setModifierLoc(SourceLocation Loc)
Set modifier location.
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
void setStepModifierLoc(SourceLocation Loc)
Sets the location of 'step' modifier.
SourceLocation getColonLoc() const
Returns the location of ':'.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
void setFinals(ArrayRef< Expr * > FL)
Sets the list of final update expressions for linear variables.
void setModifier(OpenMPLinearClauseKind Kind)
Set modifier.
SourceLocation getModifierLoc() const
Return modifier location.
llvm::iterator_range< used_expressions_const_iterator > used_expressions_const_range
MutableArrayRef< Expr * > getInits()
OpenMPNumThreadsClauseModifier
@ OMPC_NUMTHREADS_unknown
ArrayRef< const Expr * >::iterator privates_const_iterator
OpenMPAtomicDefaultMemOrderClauseKind
OpenMP attributes for 'atomic_default_mem_order' clause.
@ OMPC_ATOMIC_DEFAULT_MEM_ORDER_unknown
ArrayRef< const Expr * >::iterator finals_const_iterator
MutableArrayRef< Expr * >::iterator finals_iterator
ArrayRef< const Expr * >::iterator inits_const_iterator
used_expressions_range used_expressions()
Expr * getCalcStep()
Returns expression to calculate linear step.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ConceptReference *C)
Insertion operator for diagnostics.
OpenMPMapModifierKind
OpenMP modifier kind for 'map' clause.
@ OMPC_MAP_MODIFIER_unknown
llvm::omp::Clause OpenMPClauseKind
OpenMP clauses.
llvm::iterator_range< updates_const_iterator > updates_const_range
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
llvm::iterator_range< finals_iterator > finals_range
OpenMPThreadsetKind
OpenMP modifiers for 'threadset' clause.
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
Diagnostic wrappers for TextAPI types for error reporting.
int const char * function
OpenMPDependClauseKind DepKind
Dependency type (one of in, out, inout).
SourceLocation DepLoc
Dependency type location.
SourceLocation ColonLoc
Colon location.
SourceLocation OmpAllMemoryLoc
Location of 'omp_all_memory'.
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)