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
1512 friend class OMPClauseReader;
1515 SourceLocation LParenLoc;
1518 Expr *ImpexType =
nullptr;
1521 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1523 void setImpexTypeKind(Expr *E) { ImpexType = E; }
1535 OMPTransparentClause(Expr *ImpexTypeKind, Stmt *HelperValStmt,
1536 OpenMPDirectiveKind CaptureRegion,
1537 SourceLocation StartLoc, SourceLocation LParenLoc,
1538 SourceLocation EndLoc)
1539 : OMPOneStmtClause(ImpexTypeKind, StartLoc, LParenLoc, EndLoc),
1540 OMPClauseWithPreInit(this), LParenLoc(LParenLoc),
1541 ImpexType(ImpexTypeKind) {
1542 setPreInitStmt(HelperValStmt, CaptureRegion);
1546 OMPTransparentClause() : OMPOneStmtClause(), OMPClauseWithPreInit(this) {}
1549 SourceLocation getLParenLoc()
const {
return LParenLoc; }
1552 Expr *getImpexType()
const {
return ImpexType; }
1555 return child_range(
reinterpret_cast<Stmt **
>(&ImpexType),
1556 reinterpret_cast<Stmt **
>(&ImpexType) + 1);
1559 const_child_range
children()
const {
1560 return const_cast<OMPTransparentClause *
>(
this)->
children();
1564 return child_range(child_iterator(), child_iterator());
1567 return const_child_range(const_child_iterator(), const_child_iterator());
1570 static bool classof(
const OMPClause *T) {
1571 return T->getClauseKind() == llvm::omp::OMPC_transparent;
1583class OMPProcBindClause :
public OMPClause {
1584 friend class OMPClauseReader;
1587 SourceLocation LParenLoc;
1590 llvm::omp::ProcBindKind
Kind = llvm::omp::OMP_PROC_BIND_unknown;
1593 SourceLocation KindKwLoc;
1598 void setProcBindKind(llvm::omp::ProcBindKind K) {
Kind = K; }
1603 void setProcBindKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
1614 OMPProcBindClause(llvm::omp::ProcBindKind A, SourceLocation ALoc,
1615 SourceLocation StartLoc, SourceLocation LParenLoc,
1616 SourceLocation EndLoc)
1617 : OMPClause(llvm::omp::OMPC_proc_bind, StartLoc, EndLoc),
1618 LParenLoc(LParenLoc),
Kind(A), KindKwLoc(ALoc) {}
1622 : OMPClause(llvm::omp::OMPC_proc_bind, SourceLocation(),
1623 SourceLocation()) {}
1626 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1629 SourceLocation getLParenLoc()
const {
return LParenLoc; }
1632 llvm::omp::ProcBindKind getProcBindKind()
const {
return Kind; }
1635 SourceLocation getProcBindKindKwLoc()
const {
return KindKwLoc; }
1638 return child_range(child_iterator(), child_iterator());
1641 const_child_range
children()
const {
1642 return const_child_range(const_child_iterator(), const_child_iterator());
1646 return child_range(child_iterator(), child_iterator());
1649 return const_child_range(const_child_iterator(), const_child_iterator());
1652 static bool classof(
const OMPClause *T) {
1653 return T->getClauseKind() == llvm::omp::OMPC_proc_bind;
1665class OMPUnifiedAddressClause final
1668 friend class OMPClauseReader;
1673 OMPUnifiedAddressClause(SourceLocation StartLoc, SourceLocation EndLoc)
1674 : OMPNoChildClause(StartLoc, EndLoc) {}
1677 OMPUnifiedAddressClause() : OMPNoChildClause() {}
1688class OMPUnifiedSharedMemoryClause final :
public OMPClause {
1690 friend class OMPClauseReader;
1695 OMPUnifiedSharedMemoryClause(SourceLocation StartLoc, SourceLocation EndLoc)
1696 : OMPClause(llvm::omp::OMPC_unified_shared_memory, StartLoc, EndLoc) {}
1699 OMPUnifiedSharedMemoryClause()
1700 : OMPClause(llvm::omp::OMPC_unified_shared_memory, SourceLocation(),
1701 SourceLocation()) {}
1704 return child_range(child_iterator(), child_iterator());
1707 const_child_range
children()
const {
1708 return const_child_range(const_child_iterator(), const_child_iterator());
1712 return child_range(child_iterator(), child_iterator());
1715 return const_child_range(const_child_iterator(), const_child_iterator());
1718 static bool classof(
const OMPClause *T) {
1719 return T->getClauseKind() == llvm::omp::OMPC_unified_shared_memory;
1731class OMPReverseOffloadClause final :
public OMPClause {
1733 friend class OMPClauseReader;
1738 OMPReverseOffloadClause(SourceLocation StartLoc, SourceLocation EndLoc)
1739 : OMPClause(llvm::omp::OMPC_reverse_offload, StartLoc, EndLoc) {}
1742 OMPReverseOffloadClause()
1743 : OMPClause(llvm::omp::OMPC_reverse_offload, SourceLocation(),
1744 SourceLocation()) {}
1747 return child_range(child_iterator(), child_iterator());
1750 const_child_range
children()
const {
1751 return const_child_range(const_child_iterator(), const_child_iterator());
1755 return child_range(child_iterator(), child_iterator());
1758 return const_child_range(const_child_iterator(), const_child_iterator());
1761 static bool classof(
const OMPClause *T) {
1762 return T->getClauseKind() == llvm::omp::OMPC_reverse_offload;
1774class OMPDynamicAllocatorsClause final :
public OMPClause {
1776 friend class OMPClauseReader;
1781 OMPDynamicAllocatorsClause(SourceLocation StartLoc, SourceLocation EndLoc)
1782 : OMPClause(llvm::omp::OMPC_dynamic_allocators, StartLoc, EndLoc) {}
1785 OMPDynamicAllocatorsClause()
1786 : OMPClause(llvm::omp::OMPC_dynamic_allocators, SourceLocation(),
1787 SourceLocation()) {}
1790 return child_range(child_iterator(), child_iterator());
1793 const_child_range
children()
const {
1794 return const_child_range(const_child_iterator(), const_child_iterator());
1798 return child_range(child_iterator(), child_iterator());
1801 return const_child_range(const_child_iterator(), const_child_iterator());
1804 static bool classof(
const OMPClause *T) {
1805 return T->getClauseKind() == llvm::omp::OMPC_dynamic_allocators;
1817class OMPAtomicDefaultMemOrderClause final :
public OMPClause {
1818 friend class OMPClauseReader;
1821 SourceLocation LParenLoc;
1828 SourceLocation KindKwLoc;
1833 void setAtomicDefaultMemOrderKind(OpenMPAtomicDefaultMemOrderClauseKind K) {
1840 void setAtomicDefaultMemOrderKindKwLoc(SourceLocation KLoc) {
1853 OMPAtomicDefaultMemOrderClause(OpenMPAtomicDefaultMemOrderClauseKind A,
1854 SourceLocation ALoc, SourceLocation StartLoc,
1855 SourceLocation LParenLoc,
1856 SourceLocation EndLoc)
1857 : OMPClause(llvm::omp::OMPC_atomic_default_mem_order, StartLoc, EndLoc),
1858 LParenLoc(LParenLoc),
Kind(A), KindKwLoc(ALoc) {}
1861 OMPAtomicDefaultMemOrderClause()
1862 : OMPClause(llvm::omp::OMPC_atomic_default_mem_order, SourceLocation(),
1863 SourceLocation()) {}
1866 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1869 SourceLocation getLParenLoc()
const {
return LParenLoc; }
1877 SourceLocation getAtomicDefaultMemOrderKindKwLoc()
const {
return KindKwLoc; }
1880 return child_range(child_iterator(), child_iterator());
1883 const_child_range
children()
const {
1884 return const_child_range(const_child_iterator(), const_child_iterator());
1888 return child_range(child_iterator(), child_iterator());
1891 return const_child_range(const_child_iterator(), const_child_iterator());
1894 static bool classof(
const OMPClause *T) {
1895 return T->getClauseKind() == llvm::omp::OMPC_atomic_default_mem_order;
1907class OMPSelfMapsClause final :
public OMPClause {
1909 friend class OMPClauseReader;
1914 OMPSelfMapsClause(SourceLocation StartLoc, SourceLocation EndLoc)
1915 : OMPClause(llvm::omp::OMPC_self_maps, StartLoc, EndLoc) {}
1919 : OMPClause(llvm::omp::OMPC_self_maps, SourceLocation(),
1920 SourceLocation()) {}
1923 return child_range(child_iterator(), child_iterator());
1926 const_child_range
children()
const {
1927 return const_child_range(const_child_iterator(), const_child_iterator());
1931 return child_range(child_iterator(), child_iterator());
1934 return const_child_range(const_child_iterator(), const_child_iterator());
1937 static bool classof(
const OMPClause *T) {
1938 return T->getClauseKind() == llvm::omp::OMPC_self_maps;
1949class OMPAtClause final :
public OMPClause {
1950 friend class OMPClauseReader;
1953 SourceLocation LParenLoc;
1959 SourceLocation KindKwLoc;
1964 void setAtKind(OpenMPAtClauseKind K) {
Kind = K; }
1969 void setAtKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
1972 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1982 OMPAtClause(OpenMPAtClauseKind A, SourceLocation ALoc,
1983 SourceLocation StartLoc, SourceLocation LParenLoc,
1984 SourceLocation EndLoc)
1985 : OMPClause(llvm::omp::OMPC_at, StartLoc, EndLoc), LParenLoc(LParenLoc),
1986 Kind(A), KindKwLoc(ALoc) {}
1990 : OMPClause(llvm::omp::OMPC_at, SourceLocation(), SourceLocation()) {}
1993 SourceLocation getLParenLoc()
const {
return LParenLoc; }
1999 SourceLocation getAtKindKwLoc()
const {
return KindKwLoc; }
2002 return child_range(child_iterator(), child_iterator());
2005 const_child_range
children()
const {
2006 return const_child_range(const_child_iterator(), const_child_iterator());
2010 return child_range(child_iterator(), child_iterator());
2013 return const_child_range(const_child_iterator(), const_child_iterator());
2016 static bool classof(
const OMPClause *T) {
2017 return T->getClauseKind() == llvm::omp::OMPC_at;
2029class OMPSeverityClause final :
public OMPClause {
2030 friend class OMPClauseReader;
2033 SourceLocation LParenLoc;
2039 SourceLocation KindKwLoc;
2044 void setSeverityKind(OpenMPSeverityClauseKind K) {
Kind = K; }
2049 void setSeverityKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
2052 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
2062 OMPSeverityClause(OpenMPSeverityClauseKind A, SourceLocation ALoc,
2063 SourceLocation StartLoc, SourceLocation LParenLoc,
2064 SourceLocation EndLoc)
2065 : OMPClause(llvm::omp::OMPC_severity, StartLoc, EndLoc),
2066 LParenLoc(LParenLoc),
Kind(A), KindKwLoc(ALoc) {}
2070 : OMPClause(llvm::omp::OMPC_severity, SourceLocation(),
2071 SourceLocation()) {}
2074 SourceLocation getLParenLoc()
const {
return LParenLoc; }
2080 SourceLocation getSeverityKindKwLoc()
const {
return KindKwLoc; }
2083 return child_range(child_iterator(), child_iterator());
2086 const_child_range
children()
const {
2087 return const_child_range(const_child_iterator(), const_child_iterator());
2091 return child_range(child_iterator(), child_iterator());
2094 return const_child_range(const_child_iterator(), const_child_iterator());
2097 static bool classof(
const OMPClause *T) {
2098 return T->getClauseKind() == llvm::omp::OMPC_severity;
2110class OMPMessageClause final
2113 friend class OMPClauseReader;
2116 void setMessageString(Expr *MS) { setStmt(MS); }
2128 OMPMessageClause(Expr *MS, Stmt *HelperMS, OpenMPDirectiveKind CaptureRegion,
2129 SourceLocation StartLoc, SourceLocation LParenLoc,
2130 SourceLocation EndLoc)
2131 : OMPOneStmtClause(MS, StartLoc, LParenLoc, EndLoc),
2132 OMPClauseWithPreInit(this) {
2133 setPreInitStmt(HelperMS, CaptureRegion);
2137 OMPMessageClause() : OMPOneStmtClause(), OMPClauseWithPreInit(this) {}
2140 Expr *getMessageString()
const {
return getStmtAs<Expr>(); }
2143 std::optional<std::string> tryEvaluateString(ASTContext &Ctx)
const {
2144 if (Expr *MessageExpr = getMessageString())
2145 return MessageExpr->tryEvaluateString(Ctx);
2146 return std::nullopt;
2158 friend class OMPClauseReader;
2161 SourceLocation LParenLoc;
2167 enum {FIRST, SECOND, NUM_MODIFIERS};
2171 SourceLocation ModifiersLoc[NUM_MODIFIERS];
2174 SourceLocation KindLoc;
2177 SourceLocation CommaLoc;
2180 Expr *ChunkSize =
nullptr;
2185 void setScheduleKind(OpenMPScheduleClauseKind K) {
Kind = K; }
2190 void setFirstScheduleModifier(OpenMPScheduleClauseModifier M) {
2191 Modifiers[FIRST] = M;
2197 void setSecondScheduleModifier(OpenMPScheduleClauseModifier M) {
2198 Modifiers[SECOND] = M;
2202 void setFirstScheduleModifierLoc(SourceLocation Loc) {
2203 ModifiersLoc[FIRST] = Loc;
2207 void setSecondScheduleModifierLoc(SourceLocation Loc) {
2208 ModifiersLoc[SECOND] = Loc;
2214 void setScheduleModifer(OpenMPScheduleClauseModifier M) {
2215 if (Modifiers[FIRST] == OMPC_SCHEDULE_MODIFIER_unknown)
2216 Modifiers[FIRST] = M;
2218 assert(Modifiers[SECOND] == OMPC_SCHEDULE_MODIFIER_unknown);
2219 Modifiers[SECOND] = M;
2226 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
2231 void setScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
2236 void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
2241 void setChunkSize(Expr *E) { ChunkSize = E; }
2259 OMPScheduleClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2260 SourceLocation KLoc, SourceLocation CommaLoc,
2261 SourceLocation EndLoc, OpenMPScheduleClauseKind Kind,
2262 Expr *ChunkSize, Stmt *HelperChunkSize,
2263 OpenMPScheduleClauseModifier M1, SourceLocation M1Loc,
2264 OpenMPScheduleClauseModifier M2, SourceLocation M2Loc)
2265 : OMPClause(llvm::omp::OMPC_schedule, StartLoc, EndLoc),
2266 OMPClauseWithPreInit(this), LParenLoc(LParenLoc),
Kind(
Kind),
2267 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
2268 setPreInitStmt(HelperChunkSize);
2269 Modifiers[FIRST] = M1;
2270 Modifiers[SECOND] = M2;
2271 ModifiersLoc[FIRST] = M1Loc;
2272 ModifiersLoc[SECOND] = M2Loc;
2276 explicit OMPScheduleClause()
2277 : OMPClause(llvm::omp::OMPC_schedule, SourceLocation(), SourceLocation()),
2278 OMPClauseWithPreInit(this) {
2288 return Modifiers[FIRST];
2293 return Modifiers[SECOND];
2297 SourceLocation getLParenLoc() {
return LParenLoc; }
2300 SourceLocation getScheduleKindLoc() {
return KindLoc; }
2303 SourceLocation getFirstScheduleModifierLoc()
const {
2304 return ModifiersLoc[FIRST];
2308 SourceLocation getSecondScheduleModifierLoc()
const {
2309 return ModifiersLoc[SECOND];
2313 SourceLocation getCommaLoc() {
return CommaLoc; }
2316 Expr *getChunkSize() {
return ChunkSize; }
2319 const Expr *getChunkSize()
const {
return ChunkSize; }
2322 return child_range(
reinterpret_cast<Stmt **
>(&ChunkSize),
2323 reinterpret_cast<Stmt **
>(&ChunkSize) + 1);
2326 const_child_range
children()
const {
2327 return const_cast<OMPScheduleClause *
>(
this)->
children();
2331 return child_range(child_iterator(), child_iterator());
2334 return const_child_range(const_child_iterator(), const_child_iterator());
2337 static bool classof(
const OMPClause *T) {
2338 return T->getClauseKind() == llvm::omp::OMPC_schedule;
2349class OMPOrderedClause final
2351 private llvm::TrailingObjects<OMPOrderedClause, Expr *> {
2352 friend class OMPClauseReader;
2353 friend TrailingObjects;
2356 SourceLocation LParenLoc;
2359 Stmt *NumForLoops =
nullptr;
2362 unsigned NumberOfLoops = 0;
2371 OMPOrderedClause(Expr *Num,
unsigned NumLoops, SourceLocation StartLoc,
2372 SourceLocation LParenLoc, SourceLocation EndLoc)
2373 : OMPClause(llvm::omp::OMPC_ordered, StartLoc, EndLoc),
2374 LParenLoc(LParenLoc), NumForLoops(
Num), NumberOfLoops(NumLoops) {}
2377 explicit OMPOrderedClause(
unsigned NumLoops)
2378 : OMPClause(llvm::omp::OMPC_ordered, SourceLocation(), SourceLocation()),
2379 NumberOfLoops(NumLoops) {}
2382 void setNumForLoops(Expr *Num) { NumForLoops =
Num; }
2392 static OMPOrderedClause *
Create(
const ASTContext &C, Expr *Num,
2393 unsigned NumLoops, SourceLocation StartLoc,
2394 SourceLocation LParenLoc,
2395 SourceLocation EndLoc);
2398 static OMPOrderedClause*
CreateEmpty(
const ASTContext &C,
unsigned NumLoops);
2401 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
2404 SourceLocation getLParenLoc()
const {
return LParenLoc; }
2407 Expr *getNumForLoops()
const {
return cast_or_null<Expr>(NumForLoops); }
2410 void setLoopNumIterations(
unsigned NumLoop, Expr *NumIterations);
2412 ArrayRef<Expr *> getLoopNumIterations()
const;
2415 void setLoopCounter(
unsigned NumLoop, Expr *Counter);
2417 Expr *getLoopCounter(
unsigned NumLoop);
2418 const Expr *getLoopCounter(
unsigned NumLoop)
const;
2420 child_range
children() {
return child_range(&NumForLoops, &NumForLoops + 1); }
2422 const_child_range
children()
const {
2423 return const_child_range(&NumForLoops, &NumForLoops + 1);
2427 return child_range(child_iterator(), child_iterator());
2430 return const_child_range(const_child_iterator(), const_child_iterator());
2433 static bool classof(
const OMPClause *T) {
2434 return T->getClauseKind() == llvm::omp::OMPC_ordered;
2445class OMPNowaitClause final :
public OMPClause {
2446 friend class OMPClauseReader;
2449 SourceLocation LParenLoc;
2464 OMPNowaitClause(Expr *Cond, SourceLocation StartLoc, SourceLocation LParenLoc,
2465 SourceLocation EndLoc)
2466 : OMPClause(llvm::omp::OMPC_nowait, StartLoc, EndLoc),
2471 : OMPClause(llvm::omp::OMPC_nowait, SourceLocation(), SourceLocation()) {}
2474 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
2477 SourceLocation getLParenLoc()
const {
return LParenLoc; }
2480 Expr *getCondition()
const {
return cast_or_null<Expr>(Condition); }
2484 return child_range(&Condition, &Condition + 1);
2485 return child_range(child_iterator(), child_iterator());
2488 const_child_range
children()
const {
2490 return const_child_range(&Condition, &Condition + 1);
2491 return const_child_range(const_child_iterator(), const_child_iterator());
2496 return const_cast<OMPNowaitClause *
>(
this)->
used_children();
2499 static bool classof(
const OMPClause *T) {
2500 return T->getClauseKind() == llvm::omp::OMPC_nowait;
2510class OMPUntiedClause :
public OMPClause {
2516 OMPUntiedClause(SourceLocation StartLoc, SourceLocation EndLoc)
2517 : OMPClause(llvm::omp::OMPC_untied, StartLoc, EndLoc) {}
2521 : OMPClause(llvm::omp::OMPC_untied, SourceLocation(), SourceLocation()) {}
2524 return child_range(child_iterator(), child_iterator());
2527 const_child_range
children()
const {
2528 return const_child_range(const_child_iterator(), const_child_iterator());
2532 return child_range(child_iterator(), child_iterator());
2535 return const_child_range(const_child_iterator(), const_child_iterator());
2538 static bool classof(
const OMPClause *T) {
2539 return T->getClauseKind() == llvm::omp::OMPC_untied;
2550class OMPMergeableClause :
public OMPClause {
2556 OMPMergeableClause(SourceLocation StartLoc, SourceLocation EndLoc)
2557 : OMPClause(llvm::omp::OMPC_mergeable, StartLoc, EndLoc) {}
2560 OMPMergeableClause()
2561 : OMPClause(llvm::omp::OMPC_mergeable, SourceLocation(),
2562 SourceLocation()) {}
2565 return child_range(child_iterator(), child_iterator());
2568 const_child_range
children()
const {
2569 return const_child_range(const_child_iterator(), const_child_iterator());
2573 return child_range(child_iterator(), child_iterator());
2576 return const_child_range(const_child_iterator(), const_child_iterator());
2579 static bool classof(
const OMPClause *T) {
2580 return T->getClauseKind() == llvm::omp::OMPC_mergeable;
2591class OMPAbsentClause final
2593 private llvm::TrailingObjects<OMPAbsentClause, OpenMPDirectiveKind> {
2594 friend OMPDirectiveListClause;
2595 friend TrailingObjects;
2603 OMPAbsentClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2604 SourceLocation EndLoc,
unsigned NumKinds)
2605 : OMPDirectiveListClause<OMPAbsentClause>(
2606 llvm::omp::OMPC_absent, StartLoc, LParenLoc, EndLoc, NumKinds) {}
2609 OMPAbsentClause(
unsigned NumKinds)
2610 : OMPDirectiveListClause<OMPAbsentClause>(
2611 llvm::omp::OMPC_absent, SourceLocation(), SourceLocation(),
2612 SourceLocation(), NumKinds) {}
2615 static OMPAbsentClause *
Create(
const ASTContext &C,
2616 ArrayRef<OpenMPDirectiveKind> DKVec,
2617 SourceLocation Loc, SourceLocation LLoc,
2618 SourceLocation RLoc);
2620 static OMPAbsentClause *
CreateEmpty(
const ASTContext &C,
unsigned NumKinds);
2622 static bool classof(
const OMPClause *C) {
2623 return C->getClauseKind() == llvm::omp::OMPC_absent;
2634class OMPContainsClause final
2636 private llvm::TrailingObjects<OMPContainsClause, OpenMPDirectiveKind> {
2637 friend OMPDirectiveListClause;
2638 friend TrailingObjects;
2646 OMPContainsClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2647 SourceLocation EndLoc,
unsigned NumKinds)
2648 : OMPDirectiveListClause<OMPContainsClause>(
2649 llvm::omp::OMPC_contains, StartLoc, LParenLoc, EndLoc, NumKinds) {}
2652 OMPContainsClause(
unsigned NumKinds)
2653 : OMPDirectiveListClause<OMPContainsClause>(
2654 llvm::omp::OMPC_contains, SourceLocation(), SourceLocation(),
2655 SourceLocation(), NumKinds) {}
2658 static OMPContainsClause *
Create(
const ASTContext &C,
2659 ArrayRef<OpenMPDirectiveKind> DKVec,
2660 SourceLocation Loc, SourceLocation LLoc,
2661 SourceLocation RLoc);
2663 static OMPContainsClause *
CreateEmpty(
const ASTContext &C,
unsigned NumKinds);
2665 static bool classof(
const OMPClause *C) {
2666 return C->getClauseKind() == llvm::omp::OMPC_contains;
2677class OMPHoldsClause final
2679 friend class OMPClauseReader;
2686 OMPHoldsClause(Expr *E, SourceLocation StartLoc, SourceLocation LParenLoc,
2687 SourceLocation EndLoc)
2688 : OMPOneStmtClause(E, StartLoc, LParenLoc, EndLoc) {}
2691 OMPHoldsClause() : OMPOneStmtClause() {}
2693 Expr *
getExpr()
const {
return getStmtAs<Expr>(); }
2694 void setExpr(Expr *E) { setStmt(E); }
2704class OMPNoOpenMPClause final
2711 OMPNoOpenMPClause(SourceLocation StartLoc, SourceLocation EndLoc)
2712 : OMPNoChildClause(StartLoc, EndLoc) {}
2715 OMPNoOpenMPClause() : OMPNoChildClause() {}
2726class OMPNoOpenMPRoutinesClause final
2733 OMPNoOpenMPRoutinesClause(SourceLocation StartLoc, SourceLocation EndLoc)
2734 : OMPNoChildClause(StartLoc, EndLoc) {}
2737 OMPNoOpenMPRoutinesClause() : OMPNoChildClause() {}
2748class OMPNoOpenMPConstructsClause final
2755 OMPNoOpenMPConstructsClause(SourceLocation StartLoc, SourceLocation EndLoc)
2756 : OMPNoChildClause(StartLoc, EndLoc) {}
2759 OMPNoOpenMPConstructsClause() : OMPNoChildClause() {}
2770class OMPNoParallelismClause final
2777 OMPNoParallelismClause(SourceLocation StartLoc, SourceLocation EndLoc)
2778 : OMPNoChildClause(StartLoc, EndLoc) {}
2781 OMPNoParallelismClause() : OMPNoChildClause() {}
2796 OMPReadClause(SourceLocation StartLoc, SourceLocation EndLoc)
2797 : OMPClause(llvm::omp::OMPC_read, StartLoc, EndLoc) {}
2801 : OMPClause(llvm::omp::OMPC_read, SourceLocation(), SourceLocation()) {}
2804 return child_range(child_iterator(), child_iterator());
2807 const_child_range
children()
const {
2808 return const_child_range(const_child_iterator(), const_child_iterator());
2812 return child_range(child_iterator(), child_iterator());
2815 return const_child_range(const_child_iterator(), const_child_iterator());
2818 static bool classof(
const OMPClause *T) {
2819 return T->getClauseKind() == llvm::omp::OMPC_read;
2829class OMPWriteClause :
public OMPClause {
2835 OMPWriteClause(SourceLocation StartLoc, SourceLocation EndLoc)
2836 : OMPClause(llvm::omp::OMPC_write, StartLoc, EndLoc) {}
2840 : OMPClause(llvm::omp::OMPC_write, SourceLocation(), SourceLocation()) {}
2843 return child_range(child_iterator(), child_iterator());
2846 const_child_range
children()
const {
2847 return const_child_range(const_child_iterator(), const_child_iterator());
2851 return child_range(child_iterator(), child_iterator());
2854 return const_child_range(const_child_iterator(), const_child_iterator());
2857 static bool classof(
const OMPClause *T) {
2858 return T->getClauseKind() == llvm::omp::OMPC_write;
2877class OMPUpdateClause final
2879 private llvm::TrailingObjects<OMPUpdateClause, SourceLocation,
2880 OpenMPDependClauseKind> {
2881 friend class OMPClauseReader;
2882 friend TrailingObjects;
2885 bool IsExtended =
false;
2889 size_t numTrailingObjects(OverloadToken<SourceLocation>)
const {
2891 return IsExtended ? 2 : 0;
2895 void setLParenLoc(SourceLocation Loc) {
2896 assert(IsExtended &&
"Expected extended clause.");
2897 *getTrailingObjects<SourceLocation>() = Loc;
2901 void setArgumentLoc(SourceLocation Loc) {
2902 assert(IsExtended &&
"Expected extended clause.");
2903 *std::next(getTrailingObjects<SourceLocation>(), 1) = Loc;
2907 void setDependencyKind(OpenMPDependClauseKind DK) {
2908 assert(IsExtended &&
"Expected extended clause.");
2909 *getTrailingObjects<OpenMPDependClauseKind>() = DK;
2916 OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc,
2918 : OMPClause(llvm::omp::OMPC_update, StartLoc, EndLoc),
2919 IsExtended(IsExtended) {}
2922 OMPUpdateClause(
bool IsExtended)
2923 : OMPClause(llvm::omp::OMPC_update, SourceLocation(), SourceLocation()),
2924 IsExtended(IsExtended) {}
2932 static OMPUpdateClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
2933 SourceLocation EndLoc);
2943 static OMPUpdateClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
2944 SourceLocation LParenLoc,
2945 SourceLocation ArgumentLoc,
2946 OpenMPDependClauseKind DK,
2947 SourceLocation EndLoc);
2954 static OMPUpdateClause *
CreateEmpty(
const ASTContext &C,
bool IsExtended);
2957 bool isExtended()
const {
return IsExtended; }
2960 return child_range(child_iterator(), child_iterator());
2963 const_child_range
children()
const {
2964 return const_child_range(const_child_iterator(), const_child_iterator());
2968 return child_range(child_iterator(), child_iterator());
2971 return const_child_range(const_child_iterator(), const_child_iterator());
2975 SourceLocation getLParenLoc()
const {
2976 assert(IsExtended &&
"Expected extended clause.");
2977 return *getTrailingObjects<SourceLocation>();
2981 SourceLocation getArgumentLoc()
const {
2982 assert(IsExtended &&
"Expected extended clause.");
2983 return *std::next(getTrailingObjects<SourceLocation>(), 1);
2988 assert(IsExtended &&
"Expected extended clause.");
2989 return *getTrailingObjects<OpenMPDependClauseKind>();
2992 static bool classof(
const OMPClause *T) {
2993 return T->getClauseKind() == llvm::omp::OMPC_update;
3004class OMPCaptureClause :
public OMPClause {
3010 OMPCaptureClause(SourceLocation StartLoc, SourceLocation EndLoc)
3011 : OMPClause(llvm::omp::OMPC_capture, StartLoc, EndLoc) {}
3015 : OMPClause(llvm::omp::OMPC_capture, SourceLocation(), SourceLocation()) {
3019 return child_range(child_iterator(), child_iterator());
3022 const_child_range
children()
const {
3023 return const_child_range(const_child_iterator(), const_child_iterator());
3027 return child_range(child_iterator(), child_iterator());
3030 return const_child_range(const_child_iterator(), const_child_iterator());
3033 static bool classof(
const OMPClause *T) {
3034 return T->getClauseKind() == llvm::omp::OMPC_capture;
3045class OMPCompareClause final :
public OMPClause {
3051 OMPCompareClause(SourceLocation StartLoc, SourceLocation EndLoc)
3052 : OMPClause(llvm::omp::OMPC_compare, StartLoc, EndLoc) {}
3056 : OMPClause(llvm::omp::OMPC_compare, SourceLocation(), SourceLocation()) {
3060 return child_range(child_iterator(), child_iterator());
3063 const_child_range
children()
const {
3064 return const_child_range(const_child_iterator(), const_child_iterator());
3068 return child_range(child_iterator(), child_iterator());
3071 return const_child_range(const_child_iterator(), const_child_iterator());
3074 static bool classof(
const OMPClause *T) {
3075 return T->getClauseKind() == llvm::omp::OMPC_compare;
3086class OMPSeqCstClause :
public OMPClause {
3092 OMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc)
3093 : OMPClause(llvm::omp::OMPC_seq_cst, StartLoc, EndLoc) {}
3097 : OMPClause(llvm::omp::OMPC_seq_cst, SourceLocation(), SourceLocation()) {
3101 return child_range(child_iterator(), child_iterator());
3104 const_child_range
children()
const {
3105 return const_child_range(const_child_iterator(), const_child_iterator());
3109 return child_range(child_iterator(), child_iterator());
3112 return const_child_range(const_child_iterator(), const_child_iterator());
3115 static bool classof(
const OMPClause *T) {
3116 return T->getClauseKind() == llvm::omp::OMPC_seq_cst;
3127class OMPAcqRelClause final :
public OMPClause {
3133 OMPAcqRelClause(SourceLocation StartLoc, SourceLocation EndLoc)
3134 : OMPClause(llvm::omp::OMPC_acq_rel, StartLoc, EndLoc) {}
3138 : OMPClause(llvm::omp::OMPC_acq_rel, SourceLocation(), SourceLocation()) {
3142 return child_range(child_iterator(), child_iterator());
3145 const_child_range
children()
const {
3146 return const_child_range(const_child_iterator(), const_child_iterator());
3150 return child_range(child_iterator(), child_iterator());
3153 return const_child_range(const_child_iterator(), const_child_iterator());
3156 static bool classof(
const OMPClause *T) {
3157 return T->getClauseKind() == llvm::omp::OMPC_acq_rel;
3168class OMPAcquireClause final :
public OMPClause {
3174 OMPAcquireClause(SourceLocation StartLoc, SourceLocation EndLoc)
3175 : OMPClause(llvm::omp::OMPC_acquire, StartLoc, EndLoc) {}
3179 : OMPClause(llvm::omp::OMPC_acquire, SourceLocation(), SourceLocation()) {
3183 return child_range(child_iterator(), child_iterator());
3186 const_child_range
children()
const {
3187 return const_child_range(const_child_iterator(), const_child_iterator());
3191 return child_range(child_iterator(), child_iterator());
3194 return const_child_range(const_child_iterator(), const_child_iterator());
3197 static bool classof(
const OMPClause *T) {
3198 return T->getClauseKind() == llvm::omp::OMPC_acquire;
3209class OMPReleaseClause final :
public OMPClause {
3215 OMPReleaseClause(SourceLocation StartLoc, SourceLocation EndLoc)
3216 : OMPClause(llvm::omp::OMPC_release, StartLoc, EndLoc) {}
3220 : OMPClause(llvm::omp::OMPC_release, SourceLocation(), SourceLocation()) {
3224 return child_range(child_iterator(), child_iterator());
3227 const_child_range
children()
const {
3228 return const_child_range(const_child_iterator(), const_child_iterator());
3232 return child_range(child_iterator(), child_iterator());
3235 return const_child_range(const_child_iterator(), const_child_iterator());
3238 static bool classof(
const OMPClause *T) {
3239 return T->getClauseKind() == llvm::omp::OMPC_release;
3250class OMPRelaxedClause final :
public OMPClause {
3256 OMPRelaxedClause(SourceLocation StartLoc, SourceLocation EndLoc)
3257 : OMPClause(llvm::omp::OMPC_relaxed, StartLoc, EndLoc) {}
3261 : OMPClause(llvm::omp::OMPC_relaxed, SourceLocation(), SourceLocation()) {
3265 return child_range(child_iterator(), child_iterator());
3268 const_child_range
children()
const {
3269 return const_child_range(const_child_iterator(), const_child_iterator());
3273 return child_range(child_iterator(), child_iterator());
3276 return const_child_range(const_child_iterator(), const_child_iterator());
3279 static bool classof(
const OMPClause *T) {
3280 return T->getClauseKind() == llvm::omp::OMPC_relaxed;
3291class OMPWeakClause final :
public OMPClause {
3297 OMPWeakClause(SourceLocation StartLoc, SourceLocation EndLoc)
3298 : OMPClause(llvm::omp::OMPC_weak, StartLoc, EndLoc) {}
3302 : OMPClause(llvm::omp::OMPC_weak, SourceLocation(), SourceLocation()) {}
3305 return child_range(child_iterator(), child_iterator());
3308 const_child_range
children()
const {
3309 return const_child_range(const_child_iterator(), const_child_iterator());
3313 return child_range(child_iterator(), child_iterator());
3316 return const_child_range(const_child_iterator(), const_child_iterator());
3319 static bool classof(
const OMPClause *T) {
3320 return T->getClauseKind() == llvm::omp::OMPC_weak;
3331class OMPFailClause final :
public OMPClause {
3336 SourceLocation FailParameterLoc;
3337 SourceLocation LParenLoc;
3339 friend class OMPClauseReader;
3342 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
3345 void setFailParameterLoc(SourceLocation Loc) { FailParameterLoc = Loc; }
3348 void setFailParameter(OpenMPClauseKind FailParameter) {
3349 this->FailParameter = FailParameter;
3351 "Invalid fail clause parameter");
3359 OMPFailClause(SourceLocation StartLoc, SourceLocation EndLoc)
3360 : OMPClause(llvm::omp::OMPC_fail, StartLoc, EndLoc) {}
3362 OMPFailClause(OpenMPClauseKind FailParameter, SourceLocation FailParameterLoc,
3363 SourceLocation StartLoc, SourceLocation LParenLoc,
3364 SourceLocation EndLoc)
3365 : OMPClause(llvm::omp::OMPC_fail, StartLoc, EndLoc),
3366 FailParameterLoc(FailParameterLoc), LParenLoc(LParenLoc) {
3368 setFailParameter(FailParameter);
3373 : OMPClause(llvm::omp::OMPC_fail, SourceLocation(), SourceLocation()) {}
3376 return child_range(child_iterator(), child_iterator());
3379 const_child_range
children()
const {
3380 return const_child_range(const_child_iterator(), const_child_iterator());
3384 return child_range(child_iterator(), child_iterator());
3387 return const_child_range(const_child_iterator(), const_child_iterator());
3390 static bool classof(
const OMPClause *T) {
3391 return T->getClauseKind() == llvm::omp::OMPC_fail;
3395 SourceLocation getLParenLoc()
const {
3401 SourceLocation getFailParameterLoc()
const {
return FailParameterLoc; }
3414class OMPPrivateClause final
3416 private llvm::TrailingObjects<OMPPrivateClause, Expr *> {
3417 friend class OMPClauseReader;
3418 friend OMPVarListClause;
3419 friend TrailingObjects;
3427 OMPPrivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3428 SourceLocation EndLoc,
unsigned N)
3429 : OMPVarListClause<OMPPrivateClause>(llvm::omp::OMPC_private, StartLoc,
3430 LParenLoc, EndLoc, N) {}
3435 explicit OMPPrivateClause(
unsigned N)
3436 : OMPVarListClause<OMPPrivateClause>(llvm::omp::OMPC_private,
3437 SourceLocation(), SourceLocation(),
3438 SourceLocation(), N) {}
3443 void setPrivateCopies(ArrayRef<Expr *> VL);
3447 MutableArrayRef<Expr *> getPrivateCopies() {
3448 return {varlist_end(), varlist_size()};
3450 ArrayRef<const Expr *> getPrivateCopies()
const {
3451 return {varlist_end(), varlist_size()};
3463 static OMPPrivateClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
3464 SourceLocation LParenLoc,
3465 SourceLocation EndLoc, ArrayRef<Expr *> VL,
3466 ArrayRef<Expr *> PrivateVL);
3472 static OMPPrivateClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
3474 using private_copies_iterator = MutableArrayRef<Expr *>::iterator;
3475 using private_copies_const_iterator = ArrayRef<const Expr *>::iterator;
3476 using private_copies_range = llvm::iterator_range<private_copies_iterator>;
3477 using private_copies_const_range =
3478 llvm::iterator_range<private_copies_const_iterator>;
3480 private_copies_range private_copies() {
return getPrivateCopies(); }
3482 private_copies_const_range private_copies()
const {
3483 return getPrivateCopies();
3487 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3488 reinterpret_cast<Stmt **
>(varlist_end()));
3491 const_child_range
children()
const {
3492 return const_cast<OMPPrivateClause *
>(
this)->
children();
3496 return child_range(child_iterator(), child_iterator());
3499 return const_child_range(const_child_iterator(), const_child_iterator());
3502 static bool classof(
const OMPClause *T) {
3503 return T->getClauseKind() == llvm::omp::OMPC_private;
3515class OMPFirstprivateClause final
3518 private llvm::TrailingObjects<OMPFirstprivateClause, Expr *> {
3519 friend class OMPClauseReader;
3520 friend OMPVarListClause;
3521 friend TrailingObjects;
3529 OMPFirstprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3530 SourceLocation EndLoc,
unsigned N)
3531 : OMPVarListClause<OMPFirstprivateClause>(llvm::omp::OMPC_firstprivate,
3532 StartLoc, LParenLoc, EndLoc, N),
3533 OMPClauseWithPreInit(this) {}
3538 explicit OMPFirstprivateClause(
unsigned N)
3539 : OMPVarListClause<OMPFirstprivateClause>(
3540 llvm::omp::OMPC_firstprivate, SourceLocation(), SourceLocation(),
3541 SourceLocation(), N),
3542 OMPClauseWithPreInit(this) {}
3547 void setPrivateCopies(ArrayRef<Expr *> VL);
3551 MutableArrayRef<Expr *> getPrivateCopies() {
3552 return {varlist_end(), varlist_size()};
3554 ArrayRef<const Expr *> getPrivateCopies()
const {
3555 return {varlist_end(), varlist_size()};
3561 void setInits(ArrayRef<Expr *> VL);
3565 MutableArrayRef<Expr *>
getInits() {
3566 return {getPrivateCopies().end(), varlist_size()};
3568 ArrayRef<const Expr *>
getInits()
const {
3569 return {getPrivateCopies().end(), varlist_size()};
3586 static OMPFirstprivateClause *
3587 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
3588 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PrivateVL,
3589 ArrayRef<Expr *> InitVL, Stmt *PreInit);
3595 static OMPFirstprivateClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
3597 using private_copies_iterator = MutableArrayRef<Expr *>::iterator;
3598 using private_copies_const_iterator = ArrayRef<const Expr *>::iterator;
3599 using private_copies_range = llvm::iterator_range<private_copies_iterator>;
3600 using private_copies_const_range =
3601 llvm::iterator_range<private_copies_const_iterator>;
3603 private_copies_range private_copies() {
return getPrivateCopies(); }
3604 private_copies_const_range private_copies()
const {
3605 return getPrivateCopies();
3610 using inits_range = llvm::iterator_range<inits_iterator>;
3617 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3618 reinterpret_cast<Stmt **
>(varlist_end()));
3621 const_child_range
children()
const {
3622 return const_cast<OMPFirstprivateClause *
>(
this)->
children();
3626 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3627 reinterpret_cast<Stmt **
>(varlist_end()));
3630 return const_cast<OMPFirstprivateClause *
>(
this)->
used_children();
3633 static bool classof(
const OMPClause *T) {
3634 return T->getClauseKind() == llvm::omp::OMPC_firstprivate;
3646class OMPLastprivateClause final
3649 private llvm::TrailingObjects<OMPLastprivateClause, Expr *> {
3666 friend class OMPClauseReader;
3667 friend OMPVarListClause;
3668 friend TrailingObjects;
3673 SourceLocation LPKindLoc;
3675 SourceLocation ColonLoc;
3683 OMPLastprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3684 SourceLocation EndLoc, OpenMPLastprivateModifier LPKind,
3685 SourceLocation LPKindLoc, SourceLocation ColonLoc,
3687 : OMPVarListClause<OMPLastprivateClause>(llvm::omp::OMPC_lastprivate,
3688 StartLoc, LParenLoc, EndLoc, N),
3689 OMPClauseWithPostUpdate(this), LPKind(LPKind), LPKindLoc(LPKindLoc),
3690 ColonLoc(ColonLoc) {}
3695 explicit OMPLastprivateClause(
unsigned N)
3696 : OMPVarListClause<OMPLastprivateClause>(
3697 llvm::omp::OMPC_lastprivate, SourceLocation(), SourceLocation(),
3698 SourceLocation(), N),
3699 OMPClauseWithPostUpdate(this) {}
3703 MutableArrayRef<Expr *> getPrivateCopies() {
3704 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
3706 ArrayRef<const Expr *> getPrivateCopies()
const {
3707 return {varlist_end(), varlist_size()};
3714 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
3717 MutableArrayRef<Expr *> getSourceExprs() {
3718 return {getPrivateCopies().end(), varlist_size()};
3720 ArrayRef<const Expr *> getSourceExprs()
const {
3721 return {getPrivateCopies().end(), varlist_size()};
3728 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
3731 MutableArrayRef<Expr *> getDestinationExprs() {
3732 return {getSourceExprs().end(), varlist_size()};
3734 ArrayRef<const Expr *> getDestinationExprs()
const {
3735 return {getSourceExprs().end(), varlist_size()};
3741 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
3744 MutableArrayRef<Expr *> getAssignmentOps() {
3745 return {getDestinationExprs().end(), varlist_size()};
3747 ArrayRef<const Expr *> getAssignmentOps()
const {
3748 return {getDestinationExprs().end(), varlist_size()};
3752 void setKind(OpenMPLastprivateModifier Kind) { LPKind =
Kind; }
3754 void setKindLoc(SourceLocation Loc) { LPKindLoc = Loc; }
3756 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
3786 static OMPLastprivateClause *
3787 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
3788 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
3789 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps,
3790 OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc,
3791 SourceLocation ColonLoc, Stmt *PreInit, Expr *PostUpdate);
3797 static OMPLastprivateClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
3802 SourceLocation getKindLoc()
const {
return LPKindLoc; }
3804 SourceLocation
getColonLoc()
const {
return ColonLoc; }
3806 using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
3807 using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
3808 using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
3809 using helper_expr_const_range =
3810 llvm::iterator_range<helper_expr_const_iterator>;
3814 void setPrivateCopies(ArrayRef<Expr *> PrivateCopies);
3816 helper_expr_const_range private_copies()
const {
return getPrivateCopies(); }
3818 helper_expr_range private_copies() {
return getPrivateCopies(); }
3820 helper_expr_const_range source_exprs()
const {
return getSourceExprs(); }
3822 helper_expr_range source_exprs() {
return getSourceExprs(); }
3824 helper_expr_const_range destination_exprs()
const {
3825 return getDestinationExprs();
3828 helper_expr_range destination_exprs() {
return getDestinationExprs(); }
3830 helper_expr_const_range assignment_ops()
const {
return getAssignmentOps(); }
3832 helper_expr_range assignment_ops() {
return getAssignmentOps(); }
3835 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3836 reinterpret_cast<Stmt **
>(varlist_end()));
3839 const_child_range
children()
const {
3840 return const_cast<OMPLastprivateClause *
>(
this)->
children();
3844 return child_range(child_iterator(), child_iterator());
3847 return const_child_range(const_child_iterator(), const_child_iterator());
3850 static bool classof(
const OMPClause *T) {
3851 return T->getClauseKind() == llvm::omp::OMPC_lastprivate;
3862class OMPSharedClause final
3864 private llvm::TrailingObjects<OMPSharedClause, Expr *> {
3865 friend OMPVarListClause;
3866 friend TrailingObjects;
3874 OMPSharedClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3875 SourceLocation EndLoc,
unsigned N)
3876 : OMPVarListClause<OMPSharedClause>(llvm::omp::OMPC_shared, StartLoc,
3877 LParenLoc, EndLoc, N) {}
3882 explicit OMPSharedClause(
unsigned N)
3883 : OMPVarListClause<OMPSharedClause>(llvm::omp::OMPC_shared,
3884 SourceLocation(), SourceLocation(),
3885 SourceLocation(), N) {}
3895 static OMPSharedClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
3896 SourceLocation LParenLoc,
3897 SourceLocation EndLoc, ArrayRef<Expr *> VL);
3903 static OMPSharedClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
3906 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
3907 reinterpret_cast<Stmt **
>(varlist_end()));
3910 const_child_range
children()
const {
3911 return const_cast<OMPSharedClause *
>(
this)->
children();
3915 return child_range(child_iterator(), child_iterator());
3918 return const_child_range(const_child_iterator(), const_child_iterator());
3921 static bool classof(
const OMPClause *T) {
3922 return T->getClauseKind() == llvm::omp::OMPC_shared;
3934class OMPReductionClause final
3937 private llvm::TrailingObjects<OMPReductionClause, Expr *, bool> {
3938 friend class OMPClauseReader;
3939 friend OMPVarListClause;
3940 friend TrailingObjects;
3947 OMPC_ORIGINAL_SHARING_default;
3950 SourceLocation ModifierLoc;
3953 SourceLocation ColonLoc;
3956 NestedNameSpecifierLoc QualifierLoc;
3959 DeclarationNameInfo NameInfo;
3971 OMPReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3972 SourceLocation ModifierLoc, SourceLocation ColonLoc,
3973 SourceLocation EndLoc,
3974 OpenMPReductionClauseModifier Modifier,
3975 OpenMPOriginalSharingModifier OriginalSharingModifier,
3976 unsigned N, NestedNameSpecifierLoc QualifierLoc,
3977 const DeclarationNameInfo &NameInfo)
3978 : OMPVarListClause<OMPReductionClause>(llvm::omp::OMPC_reduction,
3979 StartLoc, LParenLoc, EndLoc, N),
3980 OMPClauseWithPostUpdate(this), Modifier(Modifier),
3981 OriginalSharingModifier(OriginalSharingModifier),
3982 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc),
3983 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
3988 explicit OMPReductionClause(
unsigned N)
3989 : OMPVarListClause<OMPReductionClause>(llvm::omp::OMPC_reduction,
3990 SourceLocation(), SourceLocation(),
3991 SourceLocation(), N),
3992 OMPClauseWithPostUpdate(this) {}
3995 void setModifier(OpenMPReductionClauseModifier M) { Modifier = M; }
3998 void setOriginalSharingModifier(OpenMPOriginalSharingModifier M) {
3999 OriginalSharingModifier = M;
4006 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
4009 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
4012 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
4021 return {varlist_end(), varlist_size()};
4024 return {varlist_end(), varlist_size()};
4030 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
4033 MutableArrayRef<Expr *> getLHSExprs() {
4036 ArrayRef<const Expr *> getLHSExprs()
const {
4045 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
4048 void setPrivateVariableReductionFlags(ArrayRef<bool> Flags) {
4049 assert(Flags.size() == varlist_size() &&
4050 "Number of private flags does not match vars");
4051 llvm::copy(Flags, getTrailingObjects<bool>());
4055 MutableArrayRef<bool> getPrivateVariableReductionFlags() {
4056 return getTrailingObjects<bool>(varlist_size());
4058 ArrayRef<bool> getPrivateVariableReductionFlags()
const {
4059 return getTrailingObjects<bool>(varlist_size());
4063 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
4064 return varlist_size() * (Modifier == OMPC_REDUCTION_inscan ? 8 : 5);
4068 size_t numTrailingObjects(OverloadToken<bool>)
const {
4069 return varlist_size();
4073 MutableArrayRef<Expr *> getRHSExprs() {
4074 return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
4076 ArrayRef<const Expr *> getRHSExprs()
const {
4077 return {getLHSExprs().end(), varlist_size()};
4084 void setReductionOps(ArrayRef<Expr *> ReductionOps);
4087 MutableArrayRef<Expr *> getReductionOps() {
4088 return {getRHSExprs().end(), varlist_size()};
4090 ArrayRef<const Expr *> getReductionOps()
const {
4091 return {getRHSExprs().end(), varlist_size()};
4096 void setInscanCopyOps(ArrayRef<Expr *> Ops);
4099 MutableArrayRef<Expr *> getInscanCopyOps() {
4100 return {getReductionOps().end(), varlist_size()};
4102 ArrayRef<const Expr *> getInscanCopyOps()
const {
4103 return {getReductionOps().end(), varlist_size()};
4107 void setInscanCopyArrayTemps(ArrayRef<Expr *> CopyArrayTemps);
4110 MutableArrayRef<Expr *> getInscanCopyArrayTemps() {
4111 return {getInscanCopyOps().end(), varlist_size()};
4113 ArrayRef<const Expr *> getInscanCopyArrayTemps()
const {
4114 return {getInscanCopyOps().end(), varlist_size()};
4118 void setInscanCopyArrayElems(ArrayRef<Expr *> CopyArrayElems);
4121 MutableArrayRef<Expr *> getInscanCopyArrayElems() {
4122 return {getInscanCopyArrayTemps().end(), varlist_size()};
4124 ArrayRef<const Expr *> getInscanCopyArrayElems()
const {
4125 return {getInscanCopyArrayTemps().end(), varlist_size()};
4169 static OMPReductionClause *
4170 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
4171 SourceLocation ModifierLoc, SourceLocation ColonLoc,
4172 SourceLocation EndLoc, OpenMPReductionClauseModifier Modifier,
4173 ArrayRef<Expr *> VL, NestedNameSpecifierLoc QualifierLoc,
4174 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
4175 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
4176 ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> CopyOps,
4177 ArrayRef<Expr *> CopyArrayTemps, ArrayRef<Expr *> CopyArrayElems,
4178 Stmt *PreInit, Expr *PostUpdate, ArrayRef<bool> IsPrivateVarReduction,
4179 OpenMPOriginalSharingModifier OriginalSharingModifier);
4186 static OMPReductionClause *
4188 OpenMPReductionClauseModifier Modifier);
4195 return OriginalSharingModifier;
4202 SourceLocation
getColonLoc()
const {
return ColonLoc; }
4205 const DeclarationNameInfo &getNameInfo()
const {
return NameInfo; }
4208 NestedNameSpecifierLoc getQualifierLoc()
const {
return QualifierLoc; }
4210 using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
4211 using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
4212 using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
4213 using helper_expr_const_range =
4214 llvm::iterator_range<helper_expr_const_iterator>;
4215 using helper_flag_iterator = MutableArrayRef<bool>::iterator;
4216 using helper_flag_const_iterator = ArrayRef<bool>::iterator;
4217 using helper_flag_range = llvm::iterator_range<helper_flag_iterator>;
4218 using helper_flag_const_range =
4219 llvm::iterator_range<helper_flag_const_iterator>;
4225 helper_expr_const_range lhs_exprs()
const {
return getLHSExprs(); }
4227 helper_expr_range lhs_exprs() {
return getLHSExprs(); }
4229 helper_expr_const_range rhs_exprs()
const {
return getRHSExprs(); }
4231 helper_expr_range rhs_exprs() {
return getRHSExprs(); }
4233 helper_flag_const_range private_var_reduction_flags()
const {
4234 return getPrivateVariableReductionFlags();
4237 helper_flag_range private_var_reduction_flags() {
4238 return getPrivateVariableReductionFlags();
4241 helper_expr_const_range reduction_ops()
const {
return getReductionOps(); }
4243 helper_expr_range reduction_ops() {
return getReductionOps(); }
4245 helper_expr_const_range copy_ops()
const {
return getInscanCopyOps(); }
4247 helper_expr_range copy_ops() {
return getInscanCopyOps(); }
4249 helper_expr_const_range copy_array_temps()
const {
4250 return getInscanCopyArrayTemps();
4253 helper_expr_range copy_array_temps() {
return getInscanCopyArrayTemps(); }
4255 helper_expr_const_range copy_array_elems()
const {
4256 return getInscanCopyArrayElems();
4259 helper_expr_range copy_array_elems() {
return getInscanCopyArrayElems(); }
4262 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4263 reinterpret_cast<Stmt **
>(varlist_end()));
4266 const_child_range
children()
const {
4267 return const_cast<OMPReductionClause *
>(
this)->
children();
4271 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4272 reinterpret_cast<Stmt **
>(varlist_end()));
4275 return const_cast<OMPReductionClause *
>(
this)->
used_children();
4278 static bool classof(
const OMPClause *T) {
4279 return T->getClauseKind() == llvm::omp::OMPC_reduction;
4291class OMPTaskReductionClause final
4294 private llvm::TrailingObjects<OMPTaskReductionClause, Expr *> {
4295 friend class OMPClauseReader;
4296 friend OMPVarListClause;
4297 friend TrailingObjects;
4300 SourceLocation ColonLoc;
4303 NestedNameSpecifierLoc QualifierLoc;
4306 DeclarationNameInfo NameInfo;
4317 OMPTaskReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4318 SourceLocation ColonLoc, SourceLocation EndLoc,
4319 unsigned N, NestedNameSpecifierLoc QualifierLoc,
4320 const DeclarationNameInfo &NameInfo)
4321 : OMPVarListClause<OMPTaskReductionClause>(
4322 llvm::omp::OMPC_task_reduction, StartLoc, LParenLoc, EndLoc, N),
4323 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
4324 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
4329 explicit OMPTaskReductionClause(
unsigned N)
4330 : OMPVarListClause<OMPTaskReductionClause>(
4331 llvm::omp::OMPC_task_reduction, SourceLocation(), SourceLocation(),
4332 SourceLocation(), N),
4333 OMPClauseWithPostUpdate(this) {}
4336 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
4339 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
4342 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
4350 return {varlist_end(), varlist_size()};
4353 return {varlist_end(), varlist_size()};
4359 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
4362 MutableArrayRef<Expr *> getLHSExprs() {
4365 ArrayRef<const Expr *> getLHSExprs()
const {
4373 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
4376 MutableArrayRef<Expr *> getRHSExprs() {
4377 return {getLHSExprs().end(), varlist_size()};
4379 ArrayRef<const Expr *> getRHSExprs()
const {
4380 return {getLHSExprs().end(), varlist_size()};
4387 void setReductionOps(ArrayRef<Expr *> ReductionOps);
4390 MutableArrayRef<Expr *> getReductionOps() {
4391 return {getRHSExprs().end(), varlist_size()};
4393 ArrayRef<const Expr *> getReductionOps()
const {
4394 return {getRHSExprs().end(), varlist_size()};
4430 static OMPTaskReductionClause *
4431 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
4432 SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
4433 NestedNameSpecifierLoc QualifierLoc,
4434 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
4435 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
4436 ArrayRef<Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate);
4442 static OMPTaskReductionClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
4445 SourceLocation
getColonLoc()
const {
return ColonLoc; }
4448 const DeclarationNameInfo &getNameInfo()
const {
return NameInfo; }
4451 NestedNameSpecifierLoc getQualifierLoc()
const {
return QualifierLoc; }
4453 using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
4454 using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
4455 using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
4456 using helper_expr_const_range =
4457 llvm::iterator_range<helper_expr_const_iterator>;
4463 helper_expr_const_range lhs_exprs()
const {
return getLHSExprs(); }
4465 helper_expr_range lhs_exprs() {
return getLHSExprs(); }
4467 helper_expr_const_range rhs_exprs()
const {
return getRHSExprs(); }
4469 helper_expr_range rhs_exprs() {
return getRHSExprs(); }
4471 helper_expr_const_range reduction_ops()
const {
return getReductionOps(); }
4473 helper_expr_range reduction_ops() {
return getReductionOps(); }
4476 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4477 reinterpret_cast<Stmt **
>(varlist_end()));
4480 const_child_range
children()
const {
4481 return const_cast<OMPTaskReductionClause *
>(
this)->
children();
4485 return child_range(child_iterator(), child_iterator());
4488 return const_child_range(const_child_iterator(), const_child_iterator());
4491 static bool classof(
const OMPClause *T) {
4492 return T->getClauseKind() == llvm::omp::OMPC_task_reduction;
4503class OMPInReductionClause final
4506 private llvm::TrailingObjects<OMPInReductionClause, Expr *> {
4507 friend class OMPClauseReader;
4508 friend OMPVarListClause;
4509 friend TrailingObjects;
4512 SourceLocation ColonLoc;
4515 NestedNameSpecifierLoc QualifierLoc;
4518 DeclarationNameInfo NameInfo;
4529 OMPInReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4530 SourceLocation ColonLoc, SourceLocation EndLoc,
4531 unsigned N, NestedNameSpecifierLoc QualifierLoc,
4532 const DeclarationNameInfo &NameInfo)
4533 : OMPVarListClause<OMPInReductionClause>(llvm::omp::OMPC_in_reduction,
4534 StartLoc, LParenLoc, EndLoc, N),
4535 OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
4536 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
4541 explicit OMPInReductionClause(
unsigned N)
4542 : OMPVarListClause<OMPInReductionClause>(
4543 llvm::omp::OMPC_in_reduction, SourceLocation(), SourceLocation(),
4544 SourceLocation(), N),
4545 OMPClauseWithPostUpdate(this) {}
4548 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
4551 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
4554 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
4562 return {varlist_end(), varlist_size()};
4565 return {varlist_end(), varlist_size()};
4571 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
4574 MutableArrayRef<Expr *> getLHSExprs() {
4577 ArrayRef<const Expr *> getLHSExprs()
const {
4585 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
4588 MutableArrayRef<Expr *> getRHSExprs() {
4589 return {getLHSExprs().end(), varlist_size()};
4591 ArrayRef<const Expr *> getRHSExprs()
const {
4592 return {getLHSExprs().end(), varlist_size()};
4599 void setReductionOps(ArrayRef<Expr *> ReductionOps);
4602 MutableArrayRef<Expr *> getReductionOps() {
4603 return {getRHSExprs().end(), varlist_size()};
4605 ArrayRef<const Expr *> getReductionOps()
const {
4606 return {getRHSExprs().end(), varlist_size()};
4610 void setTaskgroupDescriptors(ArrayRef<Expr *> ReductionOps);
4613 MutableArrayRef<Expr *> getTaskgroupDescriptors() {
4614 return {getReductionOps().end(), varlist_size()};
4616 ArrayRef<const Expr *> getTaskgroupDescriptors()
const {
4617 return {getReductionOps().end(), varlist_size()};
4655 static OMPInReductionClause *
4656 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
4657 SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
4658 NestedNameSpecifierLoc QualifierLoc,
4659 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
4660 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
4661 ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> TaskgroupDescriptors,
4662 Stmt *PreInit, Expr *PostUpdate);
4668 static OMPInReductionClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
4671 SourceLocation
getColonLoc()
const {
return ColonLoc; }
4674 const DeclarationNameInfo &getNameInfo()
const {
return NameInfo; }
4677 NestedNameSpecifierLoc getQualifierLoc()
const {
return QualifierLoc; }
4679 using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
4680 using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
4681 using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
4682 using helper_expr_const_range =
4683 llvm::iterator_range<helper_expr_const_iterator>;
4689 helper_expr_const_range lhs_exprs()
const {
return getLHSExprs(); }
4691 helper_expr_range lhs_exprs() {
return getLHSExprs(); }
4693 helper_expr_const_range rhs_exprs()
const {
return getRHSExprs(); }
4695 helper_expr_range rhs_exprs() {
return getRHSExprs(); }
4697 helper_expr_const_range reduction_ops()
const {
return getReductionOps(); }
4699 helper_expr_range reduction_ops() {
return getReductionOps(); }
4701 helper_expr_const_range taskgroup_descriptors()
const {
4702 return getTaskgroupDescriptors();
4705 helper_expr_range taskgroup_descriptors() {
4706 return getTaskgroupDescriptors();
4710 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4711 reinterpret_cast<Stmt **
>(varlist_end()));
4714 const_child_range
children()
const {
4715 return const_cast<OMPInReductionClause *
>(
this)->
children();
4719 return child_range(child_iterator(), child_iterator());
4722 return const_child_range(const_child_iterator(), const_child_iterator());
4725 static bool classof(
const OMPClause *T) {
4726 return T->getClauseKind() == llvm::omp::OMPC_in_reduction;
4738class OMPLinearClause final
4741 private llvm::TrailingObjects<OMPLinearClause, Expr *> {
4742 friend class OMPClauseReader;
4743 friend OMPVarListClause;
4744 friend TrailingObjects;
4750 SourceLocation ModifierLoc;
4753 SourceLocation ColonLoc;
4756 SourceLocation StepModifierLoc;
4759 void setStep(Expr *Step) { *(
getFinals().end()) = Step; }
4762 void setCalcStep(Expr *CalcStep) { *(
getFinals().end() + 1) = CalcStep; }
4772 OMPLinearClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4773 OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc,
4774 SourceLocation ColonLoc, SourceLocation StepModifierLoc,
4775 SourceLocation EndLoc,
unsigned NumVars)
4776 : OMPVarListClause<OMPLinearClause>(llvm::omp::OMPC_linear, StartLoc,
4777 LParenLoc, EndLoc, NumVars),
4778 OMPClauseWithPostUpdate(this), Modifier(Modifier),
4779 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc),
4780 StepModifierLoc(StepModifierLoc) {}
4785 explicit OMPLinearClause(
unsigned NumVars)
4786 : OMPVarListClause<OMPLinearClause>(llvm::omp::OMPC_linear,
4787 SourceLocation(), SourceLocation(),
4788 SourceLocation(), NumVars),
4789 OMPClauseWithPostUpdate(this) {}
4804 return {varlist_end(), varlist_size()};
4807 return {varlist_end(), varlist_size()};
4814 return {getPrivates().end(), varlist_size()};
4819 return {
getInits().end(), varlist_size()};
4822 return {getInits().end(), varlist_size()};
4830 return {getUpdates().end(), varlist_size()};
4835 return {
getFinals().end() + 2, varlist_size() + 1};
4838 return {getFinals().end() + 2, varlist_size() + 1};
4870 static OMPLinearClause *
4912 const Expr *getStep()
const {
return *(getFinals().end()); }
4918 const Expr *getCalcStep()
const {
return *(getFinals().end() + 1); }
4938 privates_const_range privates()
const {
return getPrivates(); }
4947 inits_const_range inits()
const {
return getInits(); }
4956 updates_const_range updates()
const {
return getUpdates(); }
4965 finals_const_range finals()
const {
return getFinals(); }
4970 llvm::iterator_range<used_expressions_iterator>;
4972 llvm::iterator_range<used_expressions_const_iterator>;
4978 used_expressions_const_range used_expressions()
const {
4979 return finals_const_range(getUsedExprs().begin(), getUsedExprs().end());
4983 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
4984 reinterpret_cast<Stmt **
>(varlist_end()));
4987 const_child_range children()
const {
4988 return const_cast<OMPLinearClause *
>(
this)->children();
4994 return const_cast<OMPLinearClause *
>(
this)->
used_children();
4998 return T->getClauseKind() == llvm::omp::OMPC_linear;
5010class OMPAlignedClause final
5011 :
public OMPVarListClause<OMPAlignedClause>,
5012 private llvm::TrailingObjects<OMPAlignedClause, Expr *> {
5014 friend OMPVarListClause;
5015 friend TrailingObjects;
5018 SourceLocation ColonLoc;
5021 void setAlignment(Expr *A) { *varlist_end() = A; }
5031 SourceLocation ColonLoc, SourceLocation EndLoc,
5034 LParenLoc, EndLoc, NumVars),
5035 ColonLoc(ColonLoc) {}
5040 explicit OMPAlignedClause(
unsigned NumVars)
5041 : OMPVarListClause<OMPAlignedClause>(llvm::omp::OMPC_aligned,
5042 SourceLocation(), SourceLocation(),
5043 SourceLocation(), NumVars) {}
5055 static OMPAlignedClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
5056 SourceLocation LParenLoc,
5057 SourceLocation ColonLoc,
5058 SourceLocation EndLoc, ArrayRef<Expr *> VL,
5065 static OMPAlignedClause *
CreateEmpty(
const ASTContext &C,
unsigned NumVars);
5080 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5081 reinterpret_cast<Stmt **
>(varlist_end()));
5085 return const_cast<OMPAlignedClause *
>(
this)->
children();
5089 return child_range(child_iterator(), child_iterator());
5092 return const_child_range(const_child_iterator(), const_child_iterator());
5096 return T->getClauseKind() == llvm::omp::OMPC_aligned;
5107class OMPCopyinClause final
5108 :
public OMPVarListClause<OMPCopyinClause>,
5109 private llvm::TrailingObjects<OMPCopyinClause, Expr *> {
5124 friend OMPVarListClause;
5125 friend TrailingObjects;
5133 OMPCopyinClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5134 SourceLocation EndLoc,
unsigned N)
5135 : OMPVarListClause<OMPCopyinClause>(
llvm::omp::OMPC_copyin, StartLoc,
5136 LParenLoc, EndLoc, N) {}
5143 SourceLocation(), SourceLocation(),
5144 SourceLocation(), N) {}
5149 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
5152 MutableArrayRef<Expr *> getSourceExprs() {
5153 return {varlist_end(), varlist_size()};
5155 ArrayRef<const Expr *> getSourceExprs()
const {
5156 return {varlist_end(), varlist_size()};
5162 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
5165 MutableArrayRef<Expr *> getDestinationExprs() {
5166 return {getSourceExprs().end(), varlist_size()};
5168 ArrayRef<const Expr *> getDestinationExprs()
const {
5169 return {getSourceExprs().end(), varlist_size()};
5176 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
5179 MutableArrayRef<Expr *> getAssignmentOps() {
5180 return {getDestinationExprs().end(), varlist_size()};
5182 ArrayRef<const Expr *> getAssignmentOps()
const {
5183 return {getDestinationExprs().end(), varlist_size()};
5208 static OMPCopyinClause *
5209 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
5210 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
5211 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
5217 static OMPCopyinClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
5223 llvm::iterator_range<helper_expr_const_iterator>;
5230 return getDestinationExprs();
5240 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5241 reinterpret_cast<Stmt **
>(varlist_end()));
5245 return const_cast<OMPCopyinClause *
>(
this)->
children();
5249 return child_range(child_iterator(), child_iterator());
5252 return const_child_range(const_child_iterator(), const_child_iterator());
5256 return T->getClauseKind() == llvm::omp::OMPC_copyin;
5268class OMPCopyprivateClause final
5269 :
public OMPVarListClause<OMPCopyprivateClause>,
5270 private llvm::TrailingObjects<OMPCopyprivateClause, Expr *> {
5272 friend OMPVarListClause;
5273 friend TrailingObjects;
5281 OMPCopyprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5282 SourceLocation EndLoc,
unsigned N)
5283 : OMPVarListClause<OMPCopyprivateClause>(
llvm::omp::OMPC_copyprivate,
5284 StartLoc, LParenLoc, EndLoc, N) {
5292 llvm::omp::OMPC_copyprivate, SourceLocation(), SourceLocation(),
5293 SourceLocation(), N) {}
5298 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
5301 MutableArrayRef<Expr *> getSourceExprs() {
5302 return {varlist_end(), varlist_size()};
5304 ArrayRef<const Expr *> getSourceExprs()
const {
5305 return {varlist_end(), varlist_size()};
5311 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
5314 MutableArrayRef<Expr *> getDestinationExprs() {
5315 return {getSourceExprs().end(), varlist_size()};
5317 ArrayRef<const Expr *> getDestinationExprs()
const {
5318 return {getSourceExprs().end(), varlist_size()};
5325 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
5328 MutableArrayRef<Expr *> getAssignmentOps() {
5329 return {getDestinationExprs().end(), varlist_size()};
5331 ArrayRef<const Expr *> getAssignmentOps()
const {
5332 return {getDestinationExprs().end(), varlist_size()};
5356 static OMPCopyprivateClause *
5357 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
5358 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
5359 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
5365 static OMPCopyprivateClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
5371 llvm::iterator_range<helper_expr_const_iterator>;
5378 return getDestinationExprs();
5388 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5389 reinterpret_cast<Stmt **
>(varlist_end()));
5393 return const_cast<OMPCopyprivateClause *
>(
this)->
children();
5397 return child_range(child_iterator(), child_iterator());
5400 return const_child_range(const_child_iterator(), const_child_iterator());
5404 return T->getClauseKind() == llvm::omp::OMPC_copyprivate;
5420class OMPFlushClause final
5421 :
public OMPVarListClause<OMPFlushClause>,
5422 private llvm::TrailingObjects<OMPFlushClause, Expr *> {
5423 friend OMPVarListClause;
5424 friend TrailingObjects;
5432 OMPFlushClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5433 SourceLocation EndLoc,
unsigned N)
5434 : OMPVarListClause<OMPFlushClause>(llvm::omp::OMPC_flush, StartLoc,
5435 LParenLoc, EndLoc, N) {}
5440 explicit OMPFlushClause(
unsigned N)
5441 : OMPVarListClause<OMPFlushClause>(llvm::omp::OMPC_flush,
5442 SourceLocation(), SourceLocation(),
5443 SourceLocation(), N) {}
5453 static OMPFlushClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
5454 SourceLocation LParenLoc, SourceLocation EndLoc,
5464 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5465 reinterpret_cast<Stmt **
>(varlist_end()));
5469 return const_cast<OMPFlushClause *
>(
this)->
children();
5473 return child_range(child_iterator(), child_iterator());
5476 return const_child_range(const_child_iterator(), const_child_iterator());
5480 return T->getClauseKind() == llvm::omp::OMPC_flush;
5500 SourceLocation LParenLoc;
5503 Expr *Depobj =
nullptr;
5510 OMPDepobjClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5511 SourceLocation EndLoc)
5513 LParenLoc(LParenLoc) {}
5518 :
OMPClause(
llvm::omp::OMPC_depobj, SourceLocation(), SourceLocation()) {}
5520 void setDepobj(Expr *E) { Depobj = E; }
5523 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
5533 static OMPDepobjClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
5534 SourceLocation LParenLoc,
5535 SourceLocation EndLoc, Expr *Depobj);
5540 static OMPDepobjClause *
CreateEmpty(
const ASTContext &C);
5550 return child_range(
reinterpret_cast<Stmt **
>(&Depobj),
5551 reinterpret_cast<Stmt **
>(&Depobj) + 1);
5555 return const_cast<OMPDepobjClause *
>(
this)->
children();
5559 return child_range(child_iterator(), child_iterator());
5562 return const_child_range(const_child_iterator(), const_child_iterator());
5566 return T->getClauseKind() == llvm::omp::OMPC_depobj;
5578class OMPDependClause final
5579 :
public OMPVarListClause<OMPDependClause>,
5580 private llvm::TrailingObjects<OMPDependClause, Expr *> {
5582 friend OMPVarListClause;
5583 friend TrailingObjects;
5588 OpenMPDependClauseKind
DepKind = OMPC_DEPEND_unknown;
5605 unsigned NumLoops = 0;
5615 OMPDependClause(SourceLocation StartLoc, SourceLocation LParenLoc,
5616 SourceLocation EndLoc,
unsigned N,
unsigned NumLoops)
5617 : OMPVarListClause<OMPDependClause>(
llvm::omp::OMPC_depend, StartLoc,
5618 LParenLoc, EndLoc, N),
5619 NumLoops(NumLoops) {}
5628 SourceLocation(), SourceLocation(),
5629 SourceLocation(), N),
5630 NumLoops(NumLoops) {}
5633 void setDependencyKind(OpenMPDependClauseKind K) {
Data.DepKind = K; }
5636 void setDependencyLoc(SourceLocation Loc) {
Data.DepLoc = Loc; }
5642 void setOmpAllMemoryLoc(SourceLocation Loc) {
Data.OmpAllMemoryLoc = Loc; }
5658 static OMPDependClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
5659 SourceLocation LParenLoc,
5660 SourceLocation EndLoc, DependDataTy Data,
5661 Expr *DepModifier, ArrayRef<Expr *> VL,
5670 static OMPDependClause *
CreateEmpty(
const ASTContext &C,
unsigned N,
5686 Expr *getModifier();
5688 return const_cast<OMPDependClause *
>(
this)->
getModifier();
5696 void setLoopData(
unsigned NumLoop, Expr *Cnt);
5699 Expr *getLoopData(
unsigned NumLoop);
5700 const Expr *getLoopData(
unsigned NumLoop)
const;
5703 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
5704 reinterpret_cast<Stmt **
>(varlist_end()));
5708 return const_cast<OMPDependClause *
>(
this)->
children();
5712 return child_range(child_iterator(), child_iterator());
5715 return const_child_range(const_child_iterator(), const_child_iterator());
5719 return T->getClauseKind() == llvm::omp::OMPC_depend;
5735 SourceLocation LParenLoc;
5738 OpenMPDeviceClauseModifier Modifier = OMPC_DEVICE_unknown;
5741 SourceLocation ModifierLoc;
5744 Stmt *Device =
nullptr;
5749 void setDevice(Expr *E) { Device = E; }
5752 void setModifier(OpenMPDeviceClauseModifier M) { Modifier = M; }
5769 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
5770 SourceLocation LParenLoc, SourceLocation ModifierLoc,
5771 SourceLocation EndLoc)
5774 ModifierLoc(ModifierLoc), Device(E) {
5775 setPreInitStmt(HelperE, CaptureRegion);
5780 :
OMPClause(
llvm::omp::OMPC_device, SourceLocation(), SourceLocation()),
5801 child_range
children() {
return child_range(&Device, &Device + 1); }
5804 return const_child_range(&Device, &Device + 1);
5808 return child_range(child_iterator(), child_iterator());
5811 return const_child_range(const_child_iterator(), const_child_iterator());
5815 return T->getClauseKind() == llvm::omp::OMPC_device;
5856 :
OMPClause(
llvm::omp::OMPC_simd, SourceLocation(), SourceLocation()) {}
5859 return child_range(child_iterator(), child_iterator());
5863 return const_child_range(const_child_iterator(), const_child_iterator());
5867 return child_range(child_iterator(), child_iterator());
5870 return const_child_range(const_child_iterator(), const_child_iterator());
5874 return T->getClauseKind() == llvm::omp::OMPC_simd;
5891 llvm::PointerIntPair<Expr *, 1, bool> AssociatedExpressionNonContiguousPr;
5896 ValueDecl *AssociatedDeclaration =
nullptr;
5901 ValueDecl *AssociatedDeclaration,
5902 bool IsNonContiguous)
5903 : AssociatedExpressionNonContiguousPr(AssociatedExpression,
5905 AssociatedDeclaration(
5906 AssociatedDeclaration
5911 return AssociatedExpressionNonContiguousPr.getPointer();
5915 return AssociatedExpressionNonContiguousPr.getInt();
5919 return AssociatedDeclaration;
5923 return AssociatedExpressionNonContiguousPr ==
5924 Other.AssociatedExpressionNonContiguousPr &&
5925 AssociatedDeclaration == Other.AssociatedDeclaration;
5965 static QualType getComponentExprElementType(
const Expr *Exp);
6025 static std::pair<const Expr *, std::optional<size_t>>
6026 findAttachPtrExpr(MappableExprComponentListRef Components,
6027 OpenMPDirectiveKind CurDirKind);
6032 getComponentsTotalNumber(MappableExprComponentListsRef ComponentLists);
6068 unsigned NumUniqueDeclarations;
6071 unsigned NumComponentLists;
6074 unsigned NumComponents;
6079 const bool SupportsMapper;
6082 NestedNameSpecifierLoc MapperQualifierLoc;
6085 DeclarationNameInfo MapperIdInfo;
6107 OpenMPClauseKind K,
const OMPVarListLocTy &Locs,
6109 NestedNameSpecifierLoc *MapperQualifierLocPtr =
nullptr,
6110 DeclarationNameInfo *MapperIdInfoPtr =
nullptr)
6111 : OMPVarListClause<T>(K, Locs.StartLoc, Locs.LParenLoc, Locs.EndLoc,
6113 NumUniqueDeclarations(Sizes.NumUniqueDeclarations),
6114 NumComponentLists(Sizes.NumComponentLists),
6115 NumComponents(Sizes.NumComponents), SupportsMapper(SupportsMapper) {
6116 if (MapperQualifierLocPtr)
6117 MapperQualifierLoc = *MapperQualifierLocPtr;
6118 if (MapperIdInfoPtr)
6119 MapperIdInfo = *MapperIdInfoPtr;
6125 return static_cast<T *
>(
this)
6126 ->
template getTrailingObjectsNonStrict<ValueDecl *>(
6127 NumUniqueDeclarations);
6133 return static_cast<const T *
>(
this)
6134 ->
template getTrailingObjectsNonStrict<ValueDecl *>(
6135 NumUniqueDeclarations);
6141 assert(UDs.size() == NumUniqueDeclarations &&
6142 "Unexpected amount of unique declarations.");
6149 return static_cast<T *
>(
this)
6150 ->
template getTrailingObjectsNonStrict<unsigned>(NumUniqueDeclarations);
6156 return static_cast<const T *
>(
this)
6157 ->
template getTrailingObjectsNonStrict<unsigned>(NumUniqueDeclarations);
6163 assert(DNLs.size() == NumUniqueDeclarations &&
6164 "Unexpected amount of list numbers.");
6171 return MutableArrayRef<unsigned>(
6172 static_cast<T *
>(
this)
6173 ->
template getTrailingObjectsNonStrict<unsigned>() +
6174 NumUniqueDeclarations,
6182 static_cast<const T *
>(
this)
6183 ->
template getTrailingObjectsNonStrict<unsigned>() +
6184 NumUniqueDeclarations,
6191 assert(CLSs.size() == NumComponentLists &&
6192 "Unexpected amount of component lists.");
6198 return static_cast<T *
>(
this)
6199 ->
template getTrailingObjectsNonStrict<MappableComponent>(
6205 return static_cast<const T *
>(
this)
6206 ->
template getTrailingObjectsNonStrict<MappableComponent>(
6215 assert(Components.size() == NumComponents &&
6216 "Unexpected amount of component lists.");
6217 assert(CLSs.size() == NumComponentLists &&
6218 "Unexpected amount of list sizes.");
6229 NumUniqueDeclarations &&
6230 "Unexpected number of mappable expression info entries!");
6232 "Unexpected total number of components!");
6233 assert(Declarations.size() == ComponentLists.size() &&
6234 "Declaration and component lists size is not consistent!");
6235 assert(Declarations.size() == NumComponentLists &&
6236 "Unexpected declaration and component lists size!");
6241 llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
6244 auto CI = ComponentLists.begin();
6245 for (
auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
6247 assert(!CI->empty() &&
"Invalid component list!");
6248 ComponentListMap[*DI].push_back(*CI);
6254 auto UDI = UniqueDeclarations.begin();
6257 auto DNLI = DeclNumLists.begin();
6260 auto CLSI = ComponentListSizes.begin();
6263 auto CI = Components.begin();
6266 unsigned PrevSize = 0u;
6269 for (
auto &M : ComponentListMap) {
6286 PrevSize += C.size();
6293 CI = llvm::copy(C, CI);
6300 MapperQualifierLoc = NNSL;
6305 MapperIdInfo = MapperId;
6311 assert(SupportsMapper &&
6312 "Must be a clause that is possible to have user-defined mappers");
6313 return MutableArrayRef<Expr *>(
6314 static_cast<T *
>(
this)->
template getTrailingObjects<Expr *>() +
6315 OMPVarListClause<T>::varlist_size(),
6316 OMPVarListClause<T>::varlist_size());
6322 assert(SupportsMapper &&
6323 "Must be a clause that is possible to have user-defined mappers");
6325 static_cast<const T *
>(
this)->
template getTrailingObjects<Expr *>() +
6326 OMPVarListClause<T>::varlist_size(),
6327 OMPVarListClause<T>::varlist_size());
6333 assert(DMDs.size() == OMPVarListClause<T>::varlist_size() &&
6334 "Unexpected number of user-defined mappers.");
6335 assert(SupportsMapper &&
6336 "Must be a clause that is possible to have user-defined mappers");
6353 return MapperQualifierLoc;
6362 :
public llvm::iterator_adaptor_base<
6363 const_component_lists_iterator,
6364 MappableExprComponentListRef::const_iterator,
6365 std::forward_iterator_tag, MappableComponent, ptrdiff_t,
6366 MappableComponent, MappableComponent> {
6374 const bool SupportsMapper;
6380 unsigned RemainingLists = 0;
6384 unsigned PrevListSize = 0;
6392 MappableExprComponentListRef::const_iterator End;
6402 Components.begin()),
6403 DeclCur(UniqueDecls.begin()), NumListsCur(DeclsListNum.begin()),
6404 SupportsMapper(SupportsMapper),
6405 ListSizeCur(CumulativeListSizes.begin()),
6406 ListSizeEnd(CumulativeListSizes.end()), End(Components.end()) {
6407 assert(UniqueDecls.size() == DeclsListNum.size() &&
6408 "Inconsistent number of declarations and list sizes!");
6409 if (!DeclsListNum.empty())
6410 RemainingLists = *NumListsCur;
6412 MapperCur = Mappers.begin();
6423 CumulativeListSizes, Components,
6424 SupportsMapper, Mappers) {
6428 for (; DeclCur != UniqueDecls.end(); ++DeclCur, ++NumListsCur) {
6429 if (*DeclCur == Declaration)
6432 assert(*NumListsCur > 0 &&
"No lists associated with declaration??");
6436 std::advance(ListSizeCur, *NumListsCur - 1);
6437 PrevListSize = *ListSizeCur;
6446 if (ListSizeCur == CumulativeListSizes.end()) {
6448 RemainingLists = 0u;
6454 RemainingLists = *NumListsCur;
6457 ListSizeEnd = ListSizeCur;
6458 std::advance(ListSizeEnd, RemainingLists);
6462 std::advance(this->I, PrevListSize);
6470 assert(ListSizeCur != ListSizeEnd &&
"Invalid iterator!");
6471 const ValueDecl *Mapper =
nullptr;
6472 if (SupportsMapper && *MapperCur)
6473 Mapper = cast<ValueDecl>(cast<DeclRefExpr>(*MapperCur)->getDecl());
6474 return std::make_tuple(
6487 assert(ListSizeCur != ListSizeEnd && RemainingLists &&
6488 "Invalid iterator!");
6492 if (std::next(ListSizeCur) == ListSizeEnd) {
6496 std::advance(this->I, *ListSizeCur - PrevListSize);
6497 PrevListSize = *ListSizeCur;
6500 if (!(--RemainingLists)) {
6503 RemainingLists = *NumListsCur;
6504 assert(RemainingLists &&
"No lists in the following declaration??");
6516 llvm::iterator_range<const_component_lists_iterator>;
6530 SupportsMapper, {});
6538 const_component_lists_iterator
6561 llvm::iterator_range<const_all_num_lists_iterator>;
6569 llvm::iterator_range<const_all_lists_sizes_iterator>;
6577 llvm::iterator_range<const_all_components_iterator>;
6587 llvm::iterator_range<mapperlist_const_iterator>;
6613class OMPMapClause final :
public OMPMappableExprListClause<OMPMapClause>,
6614 private llvm::TrailingObjects<
6615 OMPMapClause, Expr *, ValueDecl *, unsigned,
6616 OMPClauseMappableExprCommon::MappableComponent> {
6618 friend OMPMappableExprListClause;
6619 friend OMPVarListClause;
6620 friend TrailingObjects;
6624 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
6627 return 2 * varlist_size() + 1;
6629 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
6630 return getUniqueDeclarationsNum();
6632 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
6633 return getUniqueDeclarationsNum() + getTotalComponentListNum();
6645 SourceLocation MapTypeModifiersLoc[NumberOfOMPMapClauseModifiers];
6651 bool MapTypeIsImplicit =
false;
6654 SourceLocation MapLoc;
6657 SourceLocation ColonLoc;
6679 explicit OMPMapClause(ArrayRef<OpenMPMapModifierKind> MapModifiers,
6680 ArrayRef<SourceLocation> MapModifiersLoc,
6681 NestedNameSpecifierLoc MapperQualifierLoc,
6682 DeclarationNameInfo MapperIdInfo,
6683 OpenMPMapClauseKind MapType,
bool MapTypeIsImplicit,
6684 SourceLocation MapLoc,
const OMPVarListLocTy &Locs,
6685 const OMPMappableExprListSizeTy &Sizes)
6686 : OMPMappableExprListClause(llvm::omp::OMPC_map, Locs, Sizes,
6687 true, &MapperQualifierLoc,
6689 MapType(MapType), MapTypeIsImplicit(MapTypeIsImplicit), MapLoc(MapLoc) {
6690 assert(std::size(MapTypeModifiers) == MapModifiers.size() &&
6691 "Unexpected number of map type modifiers.");
6692 llvm::copy(MapModifiers, std::begin(MapTypeModifiers));
6694 assert(std::size(MapTypeModifiersLoc) == MapModifiersLoc.size() &&
6695 "Unexpected number of map type modifier locations.");
6696 llvm::copy(MapModifiersLoc, std::begin(MapTypeModifiersLoc));
6706 explicit OMPMapClause(
const OMPMappableExprListSizeTy &Sizes)
6707 : OMPMappableExprListClause(llvm::omp::OMPC_map, OMPVarListLocTy(), Sizes,
6714 void setMapTypeModifier(
unsigned I, OpenMPMapModifierKind T) {
6715 assert(I < NumberOfOMPMapClauseModifiers &&
6716 "Unexpected index to store map type modifier, exceeds array size.");
6717 MapTypeModifiers[I] = T;
6724 void setMapTypeModifierLoc(
unsigned I, SourceLocation TLoc) {
6725 assert(I < NumberOfOMPMapClauseModifiers &&
6726 "Index to store map type modifier location exceeds array size.");
6727 MapTypeModifiersLoc[I] = TLoc;
6733 void setMapType(OpenMPMapClauseKind T) { MapType = T; }
6738 void setMapLoc(SourceLocation TLoc) { MapLoc = TLoc; }
6741 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
6744 void setIteratorModifier(Expr *IteratorModifier) {
6745 getTrailingObjects<Expr *>()[2 * varlist_size()] = IteratorModifier;
6769 static OMPMapClause *
6770 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
6771 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
6772 MappableExprComponentListsRef ComponentLists,
6773 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorModifier,
6774 ArrayRef<OpenMPMapModifierKind> MapModifiers,
6775 ArrayRef<SourceLocation> MapModifiersLoc,
6776 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId,
6777 OpenMPMapClauseKind Type,
bool TypeIsImplicit, SourceLocation TypeLoc);
6789 static OMPMapClause *
CreateEmpty(
const ASTContext &C,
6790 const OMPMappableExprListSizeTy &Sizes);
6794 return getTrailingObjects<Expr *>()[2 * varlist_size()];
6798 OpenMPMapClauseKind
getMapType() const LLVM_READONLY {
return MapType; }
6811 assert(Cnt < NumberOfOMPMapClauseModifiers &&
6812 "Requested modifier exceeds the total number of modifiers.");
6813 return MapTypeModifiers[Cnt];
6821 assert(Cnt < NumberOfOMPMapClauseModifiers &&
6822 "Requested modifier location exceeds total number of modifiers.");
6823 return MapTypeModifiersLoc[Cnt];
6828 return MapTypeModifiers;
6833 return MapTypeModifiersLoc;
6837 SourceLocation
getMapLoc() const LLVM_READONLY {
return MapLoc; }
6844 reinterpret_cast<Stmt **
>(varlist_begin()),
6845 reinterpret_cast<Stmt **
>(varlist_end()));
6849 return const_cast<OMPMapClause *
>(
this)->
children();
6853 if (MapType == OMPC_MAP_to || MapType == OMPC_MAP_tofrom)
6854 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
6855 reinterpret_cast<Stmt **
>(varlist_end()));
6856 return child_range(child_iterator(), child_iterator());
6864 return T->getClauseKind() == llvm::omp::OMPC_map;
6883class OMPNumTeamsClause final
6884 :
public OMPVarListClause<OMPNumTeamsClause>,
6886 private llvm::TrailingObjects<OMPNumTeamsClause, Expr *> {
6887 friend OMPVarListClause;
6888 friend TrailingObjects;
6891 SourceLocation LParenLoc;
6893 OMPNumTeamsClause(
const ASTContext &C, SourceLocation StartLoc,
6894 SourceLocation LParenLoc, SourceLocation EndLoc,
unsigned N)
6895 : OMPVarListClause(llvm::omp::OMPC_num_teams, StartLoc, LParenLoc, EndLoc,
6900 OMPNumTeamsClause(
unsigned N)
6901 : OMPVarListClause(llvm::omp::OMPC_num_teams, SourceLocation(),
6902 SourceLocation(), SourceLocation(), N),
6914 static OMPNumTeamsClause *
6916 SourceLocation StartLoc, SourceLocation LParenLoc,
6936 return const_cast<OMPNumTeamsClause *
>(
this)->
getNumTeams();
6940 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
6941 reinterpret_cast<Stmt **
>(varlist_end()));
6945 return const_cast<OMPNumTeamsClause *
>(
this)->
children();
6949 return child_range(child_iterator(), child_iterator());
6952 return const_child_range(const_child_iterator(), const_child_iterator());
6956 return T->getClauseKind() == llvm::omp::OMPC_num_teams;
6975class OMPThreadLimitClause final
6976 :
public OMPVarListClause<OMPThreadLimitClause>,
6978 private llvm::TrailingObjects<OMPThreadLimitClause, Expr *> {
6979 friend OMPVarListClause;
6980 friend TrailingObjects;
6983 SourceLocation LParenLoc;
6985 OMPThreadLimitClause(
const ASTContext &C, SourceLocation StartLoc,
6986 SourceLocation LParenLoc, SourceLocation EndLoc,
6988 : OMPVarListClause(llvm::omp::OMPC_thread_limit, StartLoc, LParenLoc,
6993 OMPThreadLimitClause(
unsigned N)
6994 : OMPVarListClause(llvm::omp::OMPC_thread_limit, SourceLocation(),
6995 SourceLocation(), SourceLocation(), N),
7007 static OMPThreadLimitClause *
7009 SourceLocation StartLoc, SourceLocation LParenLoc,
7029 return const_cast<OMPThreadLimitClause *
>(
this)->
getThreadLimit();
7033 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
7034 reinterpret_cast<Stmt **
>(varlist_end()));
7038 return const_cast<OMPThreadLimitClause *
>(
this)->
children();
7042 return child_range(child_iterator(), child_iterator());
7045 return const_child_range(const_child_iterator(), const_child_iterator());
7049 return T->getClauseKind() == llvm::omp::OMPC_thread_limit;
7065 SourceLocation LParenLoc;
7068 Stmt *Priority =
nullptr;
7073 void setPriority(Expr *E) { Priority = E; }
7086 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
7087 SourceLocation LParenLoc, SourceLocation EndLoc)
7090 setPreInitStmt(HelperPriority, CaptureRegion);
7095 :
OMPClause(
llvm::omp::OMPC_priority, SourceLocation(), SourceLocation()),
7110 child_range
children() {
return child_range(&Priority, &Priority + 1); }
7113 return const_child_range(&Priority, &Priority + 1);
7116 child_range used_children();
7122 return T->getClauseKind() == llvm::omp::OMPC_priority;
7138 SourceLocation LParenLoc;
7141 OpenMPGrainsizeClauseModifier Modifier = OMPC_GRAINSIZE_unknown;
7144 SourceLocation ModifierLoc;
7147 Stmt *Grainsize =
nullptr;
7150 void setGrainsize(Expr *Size) { Grainsize = Size; }
7153 void setModifier(OpenMPGrainsizeClauseModifier M) { Modifier = M; }
7171 Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion,
7172 SourceLocation StartLoc, SourceLocation LParenLoc,
7173 SourceLocation ModifierLoc, SourceLocation EndLoc)
7176 ModifierLoc(ModifierLoc), Grainsize(Size) {
7177 setPreInitStmt(HelperSize, CaptureRegion);
7196 OpenMPGrainsizeClauseModifier
getModifier()
const {
return Modifier; }
7201 child_range
children() {
return child_range(&Grainsize, &Grainsize + 1); }
7204 return const_child_range(&Grainsize, &Grainsize + 1);
7207 child_range used_children();
7213 return T->getClauseKind() == llvm::omp::OMPC_grainsize;
7234 :
OMPClause(
llvm::omp::OMPC_nogroup, SourceLocation(), SourceLocation()) {
7238 return child_range(child_iterator(), child_iterator());
7242 return const_child_range(const_child_iterator(), const_child_iterator());
7246 return child_range(child_iterator(), child_iterator());
7249 return const_child_range(const_child_iterator(), const_child_iterator());
7253 return T->getClauseKind() == llvm::omp::OMPC_nogroup;
7269 SourceLocation LParenLoc;
7272 OpenMPNumTasksClauseModifier Modifier = OMPC_NUMTASKS_unknown;
7275 SourceLocation ModifierLoc;
7278 Stmt *NumTasks =
nullptr;
7281 void setNumTasks(Expr *Size) { NumTasks = Size; }
7284 void setModifier(OpenMPNumTasksClauseModifier M) { Modifier = M; }
7302 Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion,
7303 SourceLocation StartLoc, SourceLocation LParenLoc,
7304 SourceLocation ModifierLoc, SourceLocation EndLoc)
7307 ModifierLoc(ModifierLoc), NumTasks(Size) {
7308 setPreInitStmt(HelperSize, CaptureRegion);
7332 child_range
children() {
return child_range(&NumTasks, &NumTasks + 1); }
7335 return const_child_range(&NumTasks, &NumTasks + 1);
7338 child_range used_children();
7344 return T->getClauseKind() == llvm::omp::OMPC_num_tasks;
7359 SourceLocation LParenLoc;
7362 Stmt *Hint =
nullptr;
7365 void setHint(Expr *H) { Hint = H; }
7375 SourceLocation EndLoc)
7376 :
OMPClause(
llvm::omp::OMPC_hint, StartLoc, EndLoc), LParenLoc(LParenLoc),
7381 :
OMPClause(
llvm::omp::OMPC_hint, SourceLocation(), SourceLocation()) {}
7390 Expr *
getHint()
const {
return cast_or_null<Expr>(Hint); }
7392 child_range
children() {
return child_range(&Hint, &Hint + 1); }
7395 return const_child_range(&Hint, &Hint + 1);
7399 return child_range(child_iterator(), child_iterator());
7402 return const_child_range(const_child_iterator(), const_child_iterator());
7406 return T->getClauseKind() == llvm::omp::OMPC_hint;
7422 SourceLocation LParenLoc;
7425 OpenMPDistScheduleClauseKind Kind = OMPC_DIST_SCHEDULE_unknown;
7428 SourceLocation KindLoc;
7431 SourceLocation CommaLoc;
7434 Expr *ChunkSize =
nullptr;
7439 void setDistScheduleKind(OpenMPDistScheduleClauseKind K) { Kind = K; }
7444 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
7449 void setDistScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
7454 void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
7459 void setChunkSize(Expr *E) { ChunkSize = E; }
7474 SourceLocation KLoc, SourceLocation CommaLoc,
7475 SourceLocation EndLoc,
7476 OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize,
7477 Stmt *HelperChunkSize)
7478 :
OMPClause(
llvm::omp::OMPC_dist_schedule, StartLoc, EndLoc),
7480 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
7481 setPreInitStmt(HelperChunkSize);
7486 :
OMPClause(
llvm::omp::OMPC_dist_schedule, SourceLocation(),
7509 return child_range(
reinterpret_cast<Stmt **
>(&ChunkSize),
7510 reinterpret_cast<Stmt **
>(&ChunkSize) + 1);
7518 return child_range(child_iterator(), child_iterator());
7521 return const_child_range(const_child_iterator(), const_child_iterator());
7525 return T->getClauseKind() == llvm::omp::OMPC_dist_schedule;
7540 SourceLocation LParenLoc;
7543 OpenMPDefaultmapClauseModifier Modifier = OMPC_DEFAULTMAP_MODIFIER_unknown;
7546 SourceLocation ModifierLoc;
7549 OpenMPDefaultmapClauseKind Kind = OMPC_DEFAULTMAP_unknown;
7552 SourceLocation KindLoc;
7557 void setDefaultmapKind(OpenMPDefaultmapClauseKind K) { Kind = K; }
7562 void setDefaultmapModifier(OpenMPDefaultmapClauseModifier M) {
7567 void setDefaultmapModifierLoc(SourceLocation Loc) {
7574 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
7579 void setDefaultmapKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
7592 SourceLocation MLoc, SourceLocation KLoc,
7593 SourceLocation EndLoc, OpenMPDefaultmapClauseKind Kind,
7594 OpenMPDefaultmapClauseModifier M)
7596 LParenLoc(LParenLoc), Modifier(M), ModifierLoc(MLoc), Kind(Kind),
7602 SourceLocation()) {}
7624 return child_range(child_iterator(), child_iterator());
7628 return const_child_range(const_child_iterator(), const_child_iterator());
7632 return child_range(child_iterator(), child_iterator());
7635 return const_child_range(const_child_iterator(), const_child_iterator());
7639 return T->getClauseKind() == llvm::omp::OMPC_defaultmap;
7651class OMPToClause final :
public OMPMappableExprListClause<OMPToClause>,
7652 private llvm::TrailingObjects<
7653 OMPToClause, Expr *, ValueDecl *, unsigned,
7654 OMPClauseMappableExprCommon::MappableComponent> {
7656 friend OMPMappableExprListClause;
7657 friend OMPVarListClause;
7658 friend TrailingObjects;
7661 OpenMPMotionModifierKind MotionModifiers[NumberOfOMPMotionModifiers] = {
7662 OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
7663 OMPC_MOTION_MODIFIER_unknown};
7666 SourceLocation MotionModifiersLoc[NumberOfOMPMotionModifiers];
7669 SourceLocation ColonLoc;
7688 NestedNameSpecifierLoc MapperQualifierLoc,
7689 DeclarationNameInfo MapperIdInfo,
7690 const OMPVarListLocTy &Locs,
7693 true, &MapperQualifierLoc,
7695 assert(std::size(MotionModifiers) == TheMotionModifiers.size() &&
7696 "Unexpected number of motion modifiers.");
7697 llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
7699 assert(std::size(MotionModifiersLoc) == TheMotionModifiersLoc.size() &&
7700 "Unexpected number of motion modifier locations.");
7701 llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
7711 explicit OMPToClause(
const OMPMappableExprListSizeTy &Sizes)
7712 : OMPMappableExprListClause(llvm::omp::OMPC_to, OMPVarListLocTy(), Sizes,
7719 void setMotionModifier(
unsigned I, OpenMPMotionModifierKind T) {
7720 assert(I < NumberOfOMPMotionModifiers &&
7721 "Unexpected index to store motion modifier, exceeds array size.");
7722 MotionModifiers[I] = T;
7729 void setMotionModifierLoc(
unsigned I, SourceLocation TLoc) {
7730 assert(I < NumberOfOMPMotionModifiers &&
7731 "Index to store motion modifier location exceeds array size.");
7732 MotionModifiersLoc[I] = TLoc;
7735 void setIteratorModifier(Expr *IteratorModifier) {
7736 getTrailingObjects<Expr *>()[2 * varlist_size()] = IteratorModifier;
7739 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
7743 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
7746 return 2 * varlist_size() + 1;
7748 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
7749 return getUniqueDeclarationsNum();
7751 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
7752 return getUniqueDeclarationsNum() + getTotalComponentListNum();
7772 static OMPToClause *
7773 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
7774 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
7775 MappableExprComponentListsRef ComponentLists,
7776 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorModifier,
7777 ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
7778 ArrayRef<SourceLocation> MotionModifiersLoc,
7779 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
7789 static OMPToClause *
CreateEmpty(
const ASTContext &C,
7790 const OMPMappableExprListSizeTy &Sizes);
7796 assert(Cnt < NumberOfOMPMotionModifiers &&
7797 "Requested modifier exceeds the total number of modifiers.");
7798 return MotionModifiers[Cnt];
7801 return getTrailingObjects<Expr *>()[2 * varlist_size()];
7808 assert(Cnt < NumberOfOMPMotionModifiers &&
7809 "Requested modifier location exceeds total number of modifiers.");
7810 return MotionModifiersLoc[Cnt];
7815 return MotionModifiers;
7820 return MotionModifiersLoc;
7827 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
7828 reinterpret_cast<Stmt **
>(varlist_end()));
7832 return const_cast<OMPToClause *
>(
this)->
children();
7836 return child_range(child_iterator(), child_iterator());
7839 return const_child_range(const_child_iterator(), const_child_iterator());
7843 return T->getClauseKind() == llvm::omp::OMPC_to;
7855class OMPFromClause final
7856 :
public OMPMappableExprListClause<OMPFromClause>,
7857 private llvm::TrailingObjects<
7858 OMPFromClause, Expr *, ValueDecl *, unsigned,
7859 OMPClauseMappableExprCommon::MappableComponent> {
7861 friend OMPMappableExprListClause;
7862 friend OMPVarListClause;
7863 friend TrailingObjects;
7866 OpenMPMotionModifierKind MotionModifiers[NumberOfOMPMotionModifiers] = {
7867 OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
7868 OMPC_MOTION_MODIFIER_unknown};
7871 SourceLocation MotionModifiersLoc[NumberOfOMPMotionModifiers];
7874 SourceLocation ColonLoc;
7893 NestedNameSpecifierLoc MapperQualifierLoc,
7894 DeclarationNameInfo MapperIdInfo,
7895 const OMPVarListLocTy &Locs,
7898 true, &MapperQualifierLoc,
7900 assert(std::size(MotionModifiers) == TheMotionModifiers.size() &&
7901 "Unexpected number of motion modifiers.");
7902 llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
7904 assert(std::size(MotionModifiersLoc) == TheMotionModifiersLoc.size() &&
7905 "Unexpected number of motion modifier locations.");
7906 llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
7916 explicit OMPFromClause(
const OMPMappableExprListSizeTy &Sizes)
7917 : OMPMappableExprListClause(llvm::omp::OMPC_from, OMPVarListLocTy(),
7924 void setMotionModifier(
unsigned I, OpenMPMotionModifierKind T) {
7925 assert(I < NumberOfOMPMotionModifiers &&
7926 "Unexpected index to store motion modifier, exceeds array size.");
7927 MotionModifiers[I] = T;
7929 void setIteratorModifier(Expr *IteratorModifier) {
7930 getTrailingObjects<Expr *>()[2 * varlist_size()] = IteratorModifier;
7936 void setMotionModifierLoc(
unsigned I, SourceLocation TLoc) {
7937 assert(I < NumberOfOMPMotionModifiers &&
7938 "Index to store motion modifier location exceeds array size.");
7939 MotionModifiersLoc[I] = TLoc;
7943 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
7947 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
7950 return 2 * varlist_size() + 1;
7952 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
7953 return getUniqueDeclarationsNum();
7955 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
7956 return getUniqueDeclarationsNum() + getTotalComponentListNum();
7976 static OMPFromClause *
7977 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
7978 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
7979 MappableExprComponentListsRef ComponentLists,
7980 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorExpr,
7981 ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
7982 ArrayRef<SourceLocation> MotionModifiersLoc,
7983 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
7993 static OMPFromClause *
CreateEmpty(
const ASTContext &C,
7994 const OMPMappableExprListSizeTy &Sizes);
8000 assert(Cnt < NumberOfOMPMotionModifiers &&
8001 "Requested modifier exceeds the total number of modifiers.");
8002 return MotionModifiers[Cnt];
8005 return getTrailingObjects<Expr *>()[2 * varlist_size()];
8012 assert(Cnt < NumberOfOMPMotionModifiers &&
8013 "Requested modifier location exceeds total number of modifiers.");
8014 return MotionModifiersLoc[Cnt];
8019 return MotionModifiers;
8024 return MotionModifiersLoc;
8031 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8032 reinterpret_cast<Stmt **
>(varlist_end()));
8036 return const_cast<OMPFromClause *
>(
this)->
children();
8040 return child_range(child_iterator(), child_iterator());
8043 return const_child_range(const_child_iterator(), const_child_iterator());
8047 return T->getClauseKind() == llvm::omp::OMPC_from;
8059class OMPUseDevicePtrClause final
8060 :
public OMPMappableExprListClause<OMPUseDevicePtrClause>,
8061 private llvm::TrailingObjects<
8062 OMPUseDevicePtrClause, Expr *, ValueDecl *, unsigned,
8063 OMPClauseMappableExprCommon::MappableComponent> {
8065 friend OMPMappableExprListClause;
8066 friend OMPVarListClause;
8067 friend TrailingObjects;
8070 OpenMPUseDevicePtrFallbackModifier FallbackModifier =
8071 OMPC_USE_DEVICE_PTR_FALLBACK_unknown;
8074 SourceLocation FallbackModifierLoc;
8088 explicit OMPUseDevicePtrClause(
8090 OpenMPUseDevicePtrFallbackModifier FallbackModifier,
8091 SourceLocation FallbackModifierLoc)
8092 : OMPMappableExprListClause(
llvm::omp::OMPC_use_device_ptr, Locs, Sizes),
8093 FallbackModifier(FallbackModifier),
8094 FallbackModifierLoc(FallbackModifierLoc) {}
8105 OMPVarListLocTy(), Sizes) {}
8109 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8110 return 3 * varlist_size();
8112 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8113 return getUniqueDeclarationsNum();
8115 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8116 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8122 void setPrivateCopies(ArrayRef<Expr *> VL);
8126 MutableArrayRef<Expr *> getPrivateCopies() {
8127 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
8129 ArrayRef<const Expr *> getPrivateCopies()
const {
8130 return {varlist_end(), varlist_size()};
8136 void setInits(ArrayRef<Expr *> VL);
8140 MutableArrayRef<Expr *>
getInits() {
8141 return {getPrivateCopies().end(), varlist_size()};
8143 ArrayRef<const Expr *>
getInits()
const {
8144 return {getPrivateCopies().end(), varlist_size()};
8148 void setFallbackModifier(OpenMPUseDevicePtrFallbackModifier M) {
8149 FallbackModifier = M;
8153 void setFallbackModifierLoc(SourceLocation Loc) { FallbackModifierLoc = Loc; }
8169 static OMPUseDevicePtrClause *
8170 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8171 ArrayRef<Expr *> Vars, ArrayRef<Expr *> PrivateVars,
8172 ArrayRef<Expr *> Inits, ArrayRef<ValueDecl *> Declarations,
8173 MappableExprComponentListsRef ComponentLists,
8174 OpenMPUseDevicePtrFallbackModifier FallbackModifier,
8175 SourceLocation FallbackModifierLoc);
8185 static OMPUseDevicePtrClause *
8186 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8190 return FallbackModifier;
8200 llvm::iterator_range<private_copies_const_iterator>;
8205 return getPrivateCopies();
8218 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8219 reinterpret_cast<Stmt **
>(varlist_end()));
8223 return const_cast<OMPUseDevicePtrClause *
>(
this)->
children();
8227 return child_range(child_iterator(), child_iterator());
8230 return const_child_range(const_child_iterator(), const_child_iterator());
8234 return T->getClauseKind() == llvm::omp::OMPC_use_device_ptr;
8246class OMPUseDeviceAddrClause final
8247 :
public OMPMappableExprListClause<OMPUseDeviceAddrClause>,
8248 private llvm::TrailingObjects<
8249 OMPUseDeviceAddrClause, Expr *, ValueDecl *, unsigned,
8250 OMPClauseMappableExprCommon::MappableComponent> {
8252 friend OMPMappableExprListClause;
8253 friend OMPVarListClause;
8254 friend TrailingObjects;
8266 explicit OMPUseDeviceAddrClause(
const OMPVarListLocTy &Locs,
8268 : OMPMappableExprListClause(
llvm::omp::OMPC_use_device_addr, Locs,
8280 OMPVarListLocTy(), Sizes) {}
8284 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8285 return varlist_size();
8287 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8288 return getUniqueDeclarationsNum();
8290 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8291 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8304 static OMPUseDeviceAddrClause *
8305 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8306 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8307 MappableExprComponentListsRef ComponentLists);
8317 static OMPUseDeviceAddrClause *
8318 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8321 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8322 reinterpret_cast<Stmt **
>(varlist_end()));
8326 return const_cast<OMPUseDeviceAddrClause *
>(
this)->
children();
8330 return child_range(child_iterator(), child_iterator());
8333 return const_child_range(const_child_iterator(), const_child_iterator());
8337 return T->getClauseKind() == llvm::omp::OMPC_use_device_addr;
8349class OMPIsDevicePtrClause final
8350 :
public OMPMappableExprListClause<OMPIsDevicePtrClause>,
8351 private llvm::TrailingObjects<
8352 OMPIsDevicePtrClause, Expr *, ValueDecl *, unsigned,
8353 OMPClauseMappableExprCommon::MappableComponent> {
8355 friend OMPMappableExprListClause;
8356 friend OMPVarListClause;
8357 friend TrailingObjects;
8369 explicit OMPIsDevicePtrClause(
const OMPVarListLocTy &Locs,
8371 : OMPMappableExprListClause(
llvm::omp::OMPC_is_device_ptr, Locs, Sizes) {}
8382 OMPVarListLocTy(), Sizes) {}
8386 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8387 return varlist_size();
8389 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8390 return getUniqueDeclarationsNum();
8392 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8393 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8406 static OMPIsDevicePtrClause *
8407 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8408 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8409 MappableExprComponentListsRef ComponentLists);
8419 static OMPIsDevicePtrClause *
8420 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8423 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8424 reinterpret_cast<Stmt **
>(varlist_end()));
8428 return const_cast<OMPIsDevicePtrClause *
>(
this)->
children();
8432 return child_range(child_iterator(), child_iterator());
8435 return const_child_range(const_child_iterator(), const_child_iterator());
8439 return T->getClauseKind() == llvm::omp::OMPC_is_device_ptr;
8451class OMPHasDeviceAddrClause final
8452 :
public OMPMappableExprListClause<OMPHasDeviceAddrClause>,
8453 private llvm::TrailingObjects<
8454 OMPHasDeviceAddrClause, Expr *, ValueDecl *, unsigned,
8455 OMPClauseMappableExprCommon::MappableComponent> {
8457 friend OMPMappableExprListClause;
8458 friend OMPVarListClause;
8459 friend TrailingObjects;
8471 explicit OMPHasDeviceAddrClause(
const OMPVarListLocTy &Locs,
8473 : OMPMappableExprListClause(
llvm::omp::OMPC_has_device_addr, Locs,
8485 OMPVarListLocTy(), Sizes) {}
8489 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8490 return varlist_size();
8492 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8493 return getUniqueDeclarationsNum();
8495 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8496 return getUniqueDeclarationsNum() + getTotalComponentListNum();
8509 static OMPHasDeviceAddrClause *
8510 Create(
const ASTContext &C,
const OMPVarListLocTy &Locs,
8511 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8512 MappableExprComponentListsRef ComponentLists);
8522 static OMPHasDeviceAddrClause *
8523 CreateEmpty(
const ASTContext &C,
const OMPMappableExprListSizeTy &Sizes);
8526 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8527 reinterpret_cast<Stmt **
>(varlist_end()));
8531 return const_cast<OMPHasDeviceAddrClause *
>(
this)->
children();
8535 return child_range(child_iterator(), child_iterator());
8538 return const_child_range(const_child_iterator(), const_child_iterator());
8542 return T->getClauseKind() == llvm::omp::OMPC_has_device_addr;
8553class OMPNontemporalClause final
8554 :
public OMPVarListClause<OMPNontemporalClause>,
8555 private llvm::TrailingObjects<OMPNontemporalClause, Expr *> {
8557 friend OMPVarListClause;
8558 friend TrailingObjects;
8566 OMPNontemporalClause(SourceLocation StartLoc, SourceLocation LParenLoc,
8567 SourceLocation EndLoc,
unsigned N)
8568 : OMPVarListClause<OMPNontemporalClause>(
llvm::omp::OMPC_nontemporal,
8569 StartLoc, LParenLoc, EndLoc, N) {
8577 llvm::omp::OMPC_nontemporal, SourceLocation(), SourceLocation(),
8578 SourceLocation(), N) {}
8582 MutableArrayRef<Expr *> getPrivateRefs() {
8583 return {varlist_end(), varlist_size()};
8585 ArrayRef<const Expr *> getPrivateRefs()
const {
8586 return {varlist_end(), varlist_size()};
8597 static OMPNontemporalClause *
8598 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
8599 SourceLocation EndLoc, ArrayRef<Expr *> VL);
8605 static OMPNontemporalClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
8609 void setPrivateRefs(ArrayRef<Expr *> VL);
8612 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8613 reinterpret_cast<Stmt **
>(varlist_end()));
8617 return const_cast<OMPNontemporalClause *
>(
this)->
children();
8621 return child_range(
reinterpret_cast<Stmt **
>(getPrivateRefs().begin()),
8622 reinterpret_cast<Stmt **
>(getPrivateRefs().end()));
8626 return const_cast<OMPNontemporalClause *
>(
this)->
private_refs();
8630 return child_range(child_iterator(), child_iterator());
8633 return const_child_range(const_child_iterator(), const_child_iterator());
8637 return T->getClauseKind() == llvm::omp::OMPC_nontemporal;
8652 SourceLocation LParenLoc;
8655 OpenMPOrderClauseKind Kind = OMPC_ORDER_unknown;
8658 SourceLocation KindKwLoc;
8661 OpenMPOrderClauseModifier Modifier = OMPC_ORDER_MODIFIER_unknown;
8664 SourceLocation ModifierKwLoc;
8669 void setKind(OpenMPOrderClauseKind K) { Kind = K; }
8674 void setKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
8679 void setModifier(OpenMPOrderClauseModifier M) { Modifier = M; }
8684 void setModifierKwLoc(SourceLocation MLoc) { ModifierKwLoc = MLoc; }
8697 SourceLocation StartLoc, SourceLocation LParenLoc,
8698 SourceLocation EndLoc, OpenMPOrderClauseModifier Modifier,
8699 SourceLocation MLoc)
8701 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc), Modifier(Modifier),
8702 ModifierKwLoc(MLoc) {}
8706 :
OMPClause(
llvm::omp::OMPC_order, SourceLocation(), SourceLocation()) {}
8715 OpenMPOrderClauseKind
getKind()
const {
return Kind; }
8727 return child_range(child_iterator(), child_iterator());
8731 return const_child_range(const_child_iterator(), const_child_iterator());
8735 return child_range(child_iterator(), child_iterator());
8738 return const_child_range(const_child_iterator(), const_child_iterator());
8742 return T->getClauseKind() == llvm::omp::OMPC_order;
8751class OMPInitClause final
8752 :
public OMPVarListClause<OMPInitClause>,
8753 private llvm::TrailingObjects<OMPInitClause, Expr *> {
8755 friend OMPVarListClause;
8756 friend TrailingObjects;
8759 SourceLocation VarLoc;
8761 bool IsTarget =
false;
8762 bool IsTargetSync =
false;
8764 void setInteropVar(Expr *E) { varlist_begin()[0] = E; }
8766 void setIsTarget(
bool V) { IsTarget =
V; }
8768 void setIsTargetSync(
bool V) { IsTargetSync =
V; }
8771 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
8782 OMPInitClause(
bool IsTarget,
bool IsTargetSync, SourceLocation StartLoc,
8783 SourceLocation LParenLoc, SourceLocation VarLoc,
8784 SourceLocation EndLoc,
unsigned N)
8785 : OMPVarListClause<OMPInitClause>(llvm::omp::OMPC_init, StartLoc,
8786 LParenLoc, EndLoc, N),
8787 VarLoc(VarLoc), IsTarget(IsTarget), IsTargetSync(IsTargetSync) {}
8790 OMPInitClause(
unsigned N)
8791 : OMPVarListClause<OMPInitClause>(llvm::omp::OMPC_init, SourceLocation(),
8792 SourceLocation(), SourceLocation(), N) {
8805 static OMPInitClause *
Create(
const ASTContext &C, Expr *InteropVar,
8806 OMPInteropInfo &InteropInfo,
8807 SourceLocation StartLoc,
8808 SourceLocation LParenLoc, SourceLocation VarLoc,
8809 SourceLocation EndLoc);
8815 static OMPInitClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
8831 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
8832 reinterpret_cast<Stmt **
>(varlist_end()));
8836 return const_cast<OMPInitClause *
>(
this)->
children();
8840 return child_range(child_iterator(), child_iterator());
8843 return const_child_range(const_child_iterator(), const_child_iterator());
8852 return prefs_range(
reinterpret_cast<Expr **
>(std::next(varlist_begin())),
8853 reinterpret_cast<Expr **
>(varlist_end()));
8861 return T->getClauseKind() == llvm::omp::OMPC_init;
8874 SourceLocation LParenLoc;
8877 SourceLocation VarLoc;
8880 Stmt *InteropVar =
nullptr;
8883 void setInteropVar(Expr *E) { InteropVar = E; }
8886 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
8889 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
8900 SourceLocation LParenLoc, SourceLocation VarLoc,
8901 SourceLocation EndLoc)
8902 :
OMPClause(
llvm::omp::OMPC_use, StartLoc, EndLoc), LParenLoc(LParenLoc),
8903 VarLoc(VarLoc), InteropVar(InteropVar) {}
8907 :
OMPClause(
llvm::omp::OMPC_use, SourceLocation(), SourceLocation()) {}
8918 child_range
children() {
return child_range(&InteropVar, &InteropVar + 1); }
8921 return const_child_range(&InteropVar, &InteropVar + 1);
8925 return child_range(child_iterator(), child_iterator());
8928 return const_child_range(const_child_iterator(), const_child_iterator());
8932 return T->getClauseKind() == llvm::omp::OMPC_use;
8949 SourceLocation LParenLoc;
8952 SourceLocation VarLoc;
8955 Stmt *InteropVar =
nullptr;
8958 void setInteropVar(Expr *E) { InteropVar = E; }
8961 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
8964 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
8975 SourceLocation LParenLoc, SourceLocation VarLoc,
8976 SourceLocation EndLoc)
8978 LParenLoc(LParenLoc), VarLoc(VarLoc), InteropVar(InteropVar) {}
8989 :
OMPClause(
llvm::omp::OMPC_destroy, SourceLocation(), SourceLocation()) {
9003 return child_range(&InteropVar, &InteropVar + 1);
9004 return child_range(child_iterator(), child_iterator());
9009 return const_child_range(&InteropVar, &InteropVar + 1);
9010 return const_child_range(const_child_iterator(), const_child_iterator());
9014 return child_range(child_iterator(), child_iterator());
9017 return const_child_range(const_child_iterator(), const_child_iterator());
9021 return T->getClauseKind() == llvm::omp::OMPC_destroy;
9038 void setCondition(Expr *Cond) { setStmt(Cond); }
9051 OpenMPDirectiveKind CaptureRegion,
9052 SourceLocation StartLoc, SourceLocation LParenLoc,
9053 SourceLocation EndLoc)
9056 setPreInitStmt(HelperCond, CaptureRegion);
9065 child_range used_children();
9084 void setCondition(Expr *Cond) { setStmt(Cond); }
9097 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
9098 SourceLocation LParenLoc, SourceLocation EndLoc)
9101 setPreInitStmt(HelperCond, CaptureRegion);
9110 child_range used_children();
9128 void setEventHandler(Expr *E) { setStmt(E); }
9138 SourceLocation EndLoc)
9155class OMPInclusiveClause final
9156 :
public OMPVarListClause<OMPInclusiveClause>,
9157 private llvm::TrailingObjects<OMPInclusiveClause, Expr *> {
9159 friend OMPVarListClause;
9160 friend TrailingObjects;
9168 OMPInclusiveClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9169 SourceLocation EndLoc,
unsigned N)
9170 : OMPVarListClause<OMPInclusiveClause>(
llvm::omp::OMPC_inclusive,
9171 StartLoc, LParenLoc, EndLoc, N) {}
9178 SourceLocation(), SourceLocation(),
9179 SourceLocation(), N) {}
9189 static OMPInclusiveClause *
Create(
const ASTContext &C,
9190 SourceLocation StartLoc,
9191 SourceLocation LParenLoc,
9192 SourceLocation EndLoc, ArrayRef<Expr *> VL);
9198 static OMPInclusiveClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9201 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
9202 reinterpret_cast<Stmt **
>(varlist_end()));
9206 return const_cast<OMPInclusiveClause *
>(
this)->
children();
9210 return child_range(child_iterator(), child_iterator());
9213 return const_child_range(const_child_iterator(), const_child_iterator());
9217 return T->getClauseKind() == llvm::omp::OMPC_inclusive;
9228class OMPExclusiveClause final
9229 :
public OMPVarListClause<OMPExclusiveClause>,
9230 private llvm::TrailingObjects<OMPExclusiveClause, Expr *> {
9232 friend OMPVarListClause;
9233 friend TrailingObjects;
9241 OMPExclusiveClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9242 SourceLocation EndLoc,
unsigned N)
9243 : OMPVarListClause<OMPExclusiveClause>(
llvm::omp::OMPC_exclusive,
9244 StartLoc, LParenLoc, EndLoc, N) {}
9251 SourceLocation(), SourceLocation(),
9252 SourceLocation(), N) {}
9262 static OMPExclusiveClause *
Create(
const ASTContext &C,
9263 SourceLocation StartLoc,
9264 SourceLocation LParenLoc,
9265 SourceLocation EndLoc, ArrayRef<Expr *> VL);
9271 static OMPExclusiveClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9274 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
9275 reinterpret_cast<Stmt **
>(varlist_end()));
9279 return const_cast<OMPExclusiveClause *
>(
this)->
children();
9283 return child_range(child_iterator(), child_iterator());
9286 return const_child_range(const_child_iterator(), const_child_iterator());
9290 return T->getClauseKind() == llvm::omp::OMPC_exclusive;
9302class OMPUsesAllocatorsClause final
9304 private llvm::TrailingObjects<OMPUsesAllocatorsClause, Expr *,
9319 friend TrailingObjects;
9321 enum class ExprOffsets {
9327 enum class ParenLocsOffsets {
9334 SourceLocation LParenLoc;
9336 unsigned NumOfAllocators = 0;
9344 OMPUsesAllocatorsClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9345 SourceLocation EndLoc,
unsigned N)
9346 : OMPClause(llvm::omp::OMPC_uses_allocators, StartLoc, EndLoc),
9347 LParenLoc(LParenLoc), NumOfAllocators(N) {}
9352 explicit OMPUsesAllocatorsClause(
unsigned N)
9353 : OMPClause(llvm::omp::OMPC_uses_allocators, SourceLocation(),
9355 NumOfAllocators(N) {}
9357 unsigned numTrailingObjects(OverloadToken<Expr *>)
const {
9358 return NumOfAllocators *
static_cast<int>(ExprOffsets::Total);
9362 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9365 void setAllocatorsData(ArrayRef<OMPUsesAllocatorsClause::Data> Data);
9375 static OMPUsesAllocatorsClause *
9376 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
9377 SourceLocation EndLoc, ArrayRef<OMPUsesAllocatorsClause::Data> Data);
9383 static OMPUsesAllocatorsClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9396 Stmt **Begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
9397 return child_range(Begin, Begin + NumOfAllocators *
9398 static_cast<int>(ExprOffsets::Total));
9401 Stmt *
const *Begin =
9402 reinterpret_cast<Stmt *
const *
>(getTrailingObjects<Expr *>());
9403 return const_child_range(
9404 Begin, Begin + NumOfAllocators *
static_cast<int>(ExprOffsets::Total));
9408 return child_range(child_iterator(), child_iterator());
9411 return const_child_range(const_child_iterator(), const_child_iterator());
9415 return T->getClauseKind() == llvm::omp::OMPC_uses_allocators;
9428class OMPAffinityClause final
9429 :
public OMPVarListClause<OMPAffinityClause>,
9430 private llvm::TrailingObjects<OMPAffinityClause, Expr *> {
9432 friend OMPVarListClause;
9433 friend TrailingObjects;
9436 SourceLocation ColonLoc;
9445 OMPAffinityClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9446 SourceLocation ColonLoc, SourceLocation EndLoc,
unsigned N)
9447 : OMPVarListClause<OMPAffinityClause>(
llvm::omp::OMPC_affinity, StartLoc,
9448 LParenLoc, EndLoc, N) {}
9455 SourceLocation(), SourceLocation(),
9456 SourceLocation(), N) {}
9459 void setModifier(Expr *E) { getTrailingObjects()[varlist_size()] = E; }
9462 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
9473 static OMPAffinityClause *
Create(
const ASTContext &C, SourceLocation StartLoc,
9474 SourceLocation LParenLoc,
9475 SourceLocation ColonLoc,
9476 SourceLocation EndLoc, Expr *Modifier,
9477 ArrayRef<Expr *> Locators);
9483 static OMPAffinityClause *
CreateEmpty(
const ASTContext &C,
unsigned N);
9487 Expr *
getModifier()
const {
return getTrailingObjects()[varlist_size()]; }
9495 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
9496 reinterpret_cast<Stmt **
>(varlist_end() + Offset));
9500 return const_cast<OMPAffinityClause *
>(
this)->
children();
9504 return child_range(child_iterator(), child_iterator());
9507 return const_child_range(const_child_iterator(), const_child_iterator());
9511 return T->getClauseKind() == llvm::omp::OMPC_affinity;
9528 void setThreadID(Expr *TID) { setStmt(TID); }
9541 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
9542 SourceLocation LParenLoc, SourceLocation EndLoc)
9545 setPreInitStmt(HelperE, CaptureRegion);
9567 SourceLocation LParenLoc;
9570 OpenMPBindClauseKind Kind = OMPC_BIND_unknown;
9573 SourceLocation KindLoc;
9576 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9579 void setBindKind(OpenMPBindClauseKind K) { Kind = K; }
9582 void setBindKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
9591 OMPBindClause(OpenMPBindClauseKind K, SourceLocation KLoc,
9592 SourceLocation StartLoc, SourceLocation LParenLoc,
9593 SourceLocation EndLoc)
9594 : OMPNoChildClause(StartLoc, EndLoc), LParenLoc(LParenLoc),
Kind(K),
9598 OMPBindClause() : OMPNoChildClause() {}
9609 static OMPBindClause *
Create(
const ASTContext &C, OpenMPBindClauseKind K,
9610 SourceLocation KLoc, SourceLocation StartLoc,
9611 SourceLocation LParenLoc, SourceLocation EndLoc);
9616 static OMPBindClause *
CreateEmpty(
const ASTContext &C);
9630template<
class ImplClass,
template <
typename>
class Ptr,
typename RetTy>
9633#define PTR(CLASS) Ptr<CLASS>
9634#define DISPATCH(CLASS) \
9635 return static_cast<ImplClass*>(this)->Visit##CLASS(static_cast<PTR(CLASS)>(S))
9637#define GEN_CLANG_CLAUSE_CLASS
9638#define CLAUSE_CLASS(Enum, Str, Class) \
9639 RetTy Visit##Class(PTR(Class) S) { \
9640 return static_cast<ImplClass *>(this)->VisitOMPClause(S); \
9642#include "llvm/Frontend/OpenMP/OMP.inc"
9646 switch (S->getClauseKind()) {
9647#define GEN_CLANG_CLAUSE_CLASS
9648#define CLAUSE_CLASS(Enum, Str, Class) \
9649 case llvm::omp::Clause::Enum: \
9651#define CLAUSE_NO_CLASS(Enum, Str) \
9652 case llvm::omp::Clause::Enum: \
9654#include "llvm/Frontend/OpenMP/OMP.inc"
9663template <
typename T>
using const_ptr = std::add_pointer_t<std::add_const_t<T>>;
9665template <
class ImplClass,
typename RetTy =
void>
9668template<
class ImplClass,
typename RetTy =
void>
9674 const PrintingPolicy &Policy;
9678 template <
typename T>
void VisitOMPClauseList(T *Node,
char StartSym);
9680 template <
typename T>
void VisitOMPMotionClause(T *Node);
9684 unsigned OpenMPVersion)
9685 : OS(OS), Policy(Policy), Version(OpenMPVersion) {}
9687#define GEN_CLANG_CLAUSE_CLASS
9688#define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(Class *S);
9689#include "llvm/Frontend/OpenMP/OMP.inc"
9693 llvm::omp::TraitProperty
Kind = llvm::omp::TraitProperty::invalid;
9702 llvm::omp::TraitSelector
Kind = llvm::omp::TraitSelector::invalid;
9707 llvm::omp::TraitSet
Kind = llvm::omp::TraitSet::invalid;
9723 OMPTraitInfo(StringRef MangledName);
9729 llvm::function_ref<
bool(Expr *&,
bool )> Cond) {
9731 return llvm::any_of(
9733 return Cond(Selector.ScoreOrCondition,
9735 llvm::omp::TraitSelector::user_condition);
9745 void getAsVariantMatchInfo(
ASTContext &ASTCtx,
9746 llvm::omp::VariantMatchInfo &VMI)
const;
9749 std::string getMangledName()
const;
9754 if (Set.Kind != llvm::omp::TraitSet::implementation)
9757 if (Selector.
Kind != llvm::omp::TraitSelector::implementation_extension)
9760 if (Property.Kind == TP)
9769 void print(llvm::raw_ostream &OS,
const PrintingPolicy &Policy)
const;
9778 const FunctionDecl *CurrentFunctionDecl,
9790 llvm::StringMap<bool> FeatureMap;
9796class OMPChildren final
9797 :
private llvm::TrailingObjects<OMPChildren, OMPClause *, Stmt *> {
9798 friend TrailingObjects;
9804 unsigned NumClauses = 0;
9806 unsigned NumChildren = 0;
9808 bool HasAssociatedStmt =
false;
9812 size_t numTrailingObjects(OverloadToken<OMPClause *>)
const {
9818 OMPChildren(
unsigned NumClauses,
unsigned NumChildren,
bool HasAssociatedStmt)
9819 : NumClauses(NumClauses), NumChildren(NumChildren),
9820 HasAssociatedStmt(HasAssociatedStmt) {}
9822 static size_t size(
unsigned NumClauses,
bool HasAssociatedStmt,
9823 unsigned NumChildren);
9825 static OMPChildren *
Create(
void *Mem, ArrayRef<OMPClause *> Clauses);
9826 static OMPChildren *
Create(
void *Mem, ArrayRef<OMPClause *> Clauses, Stmt *S,
9827 unsigned NumChildren = 0);
9828 static OMPChildren *
CreateEmpty(
void *Mem,
unsigned NumClauses,
9829 bool HasAssociatedStmt =
false,
9830 unsigned NumChildren = 0);
9839 getTrailingObjects<Stmt *>()[NumChildren] = S;
9855 assert(HasAssociatedStmt &&
9856 "Expected directive with the associated statement.");
9857 return getTrailingObjects<Stmt *>()[NumChildren];
9862 return getTrailingObjects<OMPClause *>(NumClauses);
9865 return const_cast<OMPChildren *
>(
this)->
getClauses();
9872 const CapturedStmt *
9875 assert(llvm::is_contained(CaptureRegions, RegionKind) &&
9876 "RegionKind not found in OpenMP CaptureRegions.");
9878 for (
auto ThisCaptureRegion : CaptureRegions) {
9879 if (ThisCaptureRegion == RegionKind)
9881 CS = cast<CapturedStmt>(CS->getCapturedStmt());
9883 llvm_unreachable(
"Incorrect RegionKind specified for directive.");
9890 assert(!CaptureRegions.empty() &&
9891 "At least one captured statement must be provided.");
9893 for (
unsigned Level = CaptureRegions.size(); Level > 1; --Level)
9894 CS = cast<CapturedStmt>(CS->getCapturedStmt());
9898 const CapturedStmt *
9904 MutableArrayRef<Stmt *> getChildren();
9906 return const_cast<OMPChildren *
>(
this)->
getChildren();
9910 assert(HasAssociatedStmt &&
9911 "Expected directive with the associated statement.");
9915 S = CS->getCapturedStmt();
9916 CS = dyn_cast<CapturedStmt>(S);
9923 return const_cast<OMPChildren *
>(
this)->
getRawStmt();
9927 if (!HasAssociatedStmt)
9928 return Stmt::child_range(Stmt::child_iterator(), Stmt::child_iterator());
9929 return Stmt::child_range(&getTrailingObjects<Stmt *>()[NumChildren],
9930 &getTrailingObjects<Stmt *>()[NumChildren + 1]);
9946 void setSize(Expr *E) { setStmt(E); }
9958 OpenMPDirectiveKind CaptureRegion,
9959 SourceLocation StartLoc, SourceLocation LParenLoc,
9960 SourceLocation EndLoc)
9963 setPreInitStmt(HelperSize, CaptureRegion);
9973 Expr *
getSize()
const {
return getStmtAs<Expr>(); }
9986 SourceLocation LParenLoc;
9989 enum { SIMPLE, FALLBACK, NUM_MODIFIERS };
9990 unsigned Modifiers[NUM_MODIFIERS];
9993 SourceLocation ModifiersLoc[NUM_MODIFIERS];
9996 Expr *Size =
nullptr;
10001 void setDynGroupprivateModifier(OpenMPDynGroupprivateClauseModifier M) {
10002 Modifiers[SIMPLE] = M;
10008 void setDynGroupprivateFallbackModifier(
10009 OpenMPDynGroupprivateClauseFallbackModifier M) {
10010 Modifiers[FALLBACK] = M;
10014 void setDynGroupprivateModifierLoc(SourceLocation Loc) {
10015 ModifiersLoc[SIMPLE] = Loc;
10019 void setDynGroupprivateFallbackModifierLoc(SourceLocation Loc) {
10020 ModifiersLoc[FALLBACK] = Loc;
10026 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
10031 void setSize(Expr *E) {
Size = E; }
10045 SourceLocation EndLoc, Expr *Size, Stmt *HelperSize,
10046 OpenMPDirectiveKind CaptureRegion,
10047 OpenMPDynGroupprivateClauseModifier M1,
10048 SourceLocation M1Loc,
10049 OpenMPDynGroupprivateClauseFallbackModifier M2,
10050 SourceLocation M2Loc)
10051 :
OMPClause(
llvm::omp::OMPC_dyn_groupprivate, StartLoc, EndLoc),
10053 setPreInitStmt(HelperSize, CaptureRegion);
10054 Modifiers[SIMPLE] = M1;
10055 Modifiers[FALLBACK] = M2;
10056 ModifiersLoc[SIMPLE] = M1Loc;
10057 ModifiersLoc[FALLBACK] = M2Loc;
10062 :
OMPClause(
llvm::omp::OMPC_dyn_groupprivate, SourceLocation(),
10065 Modifiers[SIMPLE] = OMPC_DYN_GROUPPRIVATE_unknown;
10066 Modifiers[FALLBACK] = OMPC_DYN_GROUPPRIVATE_FALLBACK_unknown;
10071 return static_cast<OpenMPDynGroupprivateClauseModifier
>(Modifiers[SIMPLE]);
10075 OpenMPDynGroupprivateClauseFallbackModifier
10077 return static_cast<OpenMPDynGroupprivateClauseFallbackModifier
>(
10078 Modifiers[FALLBACK]);
10086 return ModifiersLoc[SIMPLE];
10091 return ModifiersLoc[FALLBACK];
10101 return child_range(
reinterpret_cast<Stmt **
>(&Size),
10102 reinterpret_cast<Stmt **
>(&Size) + 1);
10110 return child_range(child_iterator(), child_iterator());
10113 return const_child_range(const_child_iterator(), const_child_iterator());
10117 return T->getClauseKind() == llvm::omp::OMPC_dyn_groupprivate;
10129class OMPDoacrossClause final
10130 :
public OMPVarListClause<OMPDoacrossClause>,
10131 private llvm::TrailingObjects<OMPDoacrossClause, Expr *> {
10133 friend OMPVarListClause;
10134 friend TrailingObjects;
10137 OpenMPDoacrossClauseModifier DepType = OMPC_DOACROSS_unknown;
10140 SourceLocation DepLoc;
10143 SourceLocation ColonLoc;
10146 unsigned NumLoops = 0;
10155 OMPDoacrossClause(SourceLocation StartLoc, SourceLocation LParenLoc,
10156 SourceLocation EndLoc,
unsigned N,
unsigned NumLoops)
10157 : OMPVarListClause<OMPDoacrossClause>(
llvm::omp::OMPC_doacross, StartLoc,
10158 LParenLoc, EndLoc, N),
10159 NumLoops(NumLoops) {}
10167 SourceLocation(), SourceLocation(),
10168 SourceLocation(), N),
10169 NumLoops(NumLoops) {}
10172 void setDependenceType(OpenMPDoacrossClauseModifier M) { DepType = M; }
10175 void setDependenceLoc(SourceLocation Loc) { DepLoc = Loc; }
10178 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
10192 static OMPDoacrossClause *
10193 Create(
const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
10194 SourceLocation EndLoc, OpenMPDoacrossClauseModifier DepType,
10195 SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VL,
10196 unsigned NumLoops);
10203 static OMPDoacrossClause *
CreateEmpty(
const ASTContext &C,
unsigned N,
10204 unsigned NumLoops);
10219 void setLoopData(
unsigned NumLoop, Expr *Cnt);
10222 Expr *getLoopData(
unsigned NumLoop);
10223 const Expr *getLoopData(
unsigned NumLoop)
const;
10226 return child_range(
reinterpret_cast<Stmt **
>(varlist_begin()),
10227 reinterpret_cast<Stmt **
>(varlist_end()));
10231 return const_cast<OMPDoacrossClause *
>(
this)->
children();
10235 return child_range(child_iterator(), child_iterator());
10238 return const_child_range(const_child_iterator(), const_child_iterator());
10242 return T->getClauseKind() == llvm::omp::OMPC_doacross;
10257 SourceLocation LParenLoc;
10270 SourceLocation LParenLoc, SourceLocation EndLoc)
10271 :
OMPNoChildClause(StartLoc, EndLoc), LParenLoc(LParenLoc), Attrs(Attrs) {
10290 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.
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)