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;
1513 llvm::omp::ProcBindKind Kind = llvm::omp::OMP_PROC_BIND_unknown;
1521 void setProcBindKind(llvm::omp::ProcBindKind K) { Kind = K; }
1526 void setProcBindKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
1541 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {}
1576 return T->getClauseKind() == llvm::omp::OMPC_proc_bind;
1619 :
OMPClause(
llvm::omp::OMPC_unified_shared_memory, StartLoc, EndLoc) {}
1642 return T->getClauseKind() == llvm::omp::OMPC_unified_shared_memory;
1662 :
OMPClause(
llvm::omp::OMPC_reverse_offload, StartLoc, EndLoc) {}
1685 return T->getClauseKind() == llvm::omp::OMPC_reverse_offload;
1705 :
OMPClause(
llvm::omp::OMPC_dynamic_allocators, StartLoc, EndLoc) {}
1728 return T->getClauseKind() == llvm::omp::OMPC_dynamic_allocators;
1780 :
OMPClause(
llvm::omp::OMPC_atomic_default_mem_order, StartLoc, EndLoc),
1781 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {}
1818 return T->getClauseKind() == llvm::omp::OMPC_atomic_default_mem_order;
1861 return T->getClauseKind() == llvm::omp::OMPC_self_maps;
1895 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1908 :
OMPClause(
llvm::omp::OMPC_at, StartLoc, EndLoc), LParenLoc(LParenLoc),
1909 Kind(A), KindKwLoc(ALoc) {}
1940 return T->getClauseKind() == llvm::omp::OMPC_at;
1972 void setSeverityKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
1975 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1989 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {}
2021 return T->getClauseKind() == llvm::omp::OMPC_severity;
2068 return MessageExpr->tryEvaluateString(Ctx);
2069 return std::nullopt;
2090 enum {FIRST, SECOND, NUM_MODIFIERS};
2103 Expr *ChunkSize =
nullptr;
2113 void setFirstScheduleModifier(OpenMPScheduleClauseModifier M) {
2114 Modifiers[FIRST] = M;
2121 Modifiers[SECOND] = M;
2125 void setFirstScheduleModifierLoc(SourceLocation Loc) {
2126 ModifiersLoc[FIRST] = Loc;
2130 void setSecondScheduleModifierLoc(SourceLocation Loc) {
2131 ModifiersLoc[SECOND] = Loc;
2139 Modifiers[FIRST] = M;
2142 Modifiers[SECOND] = M;
2149 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
2154 void setScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
2159 void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
2164 void setChunkSize(Expr *E) { ChunkSize = E; }
2185 Expr *ChunkSize,
Stmt *HelperChunkSize,
2190 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
2192 Modifiers[FIRST] = M1;
2193 Modifiers[SECOND] = M2;
2194 ModifiersLoc[FIRST] = M1Loc;
2195 ModifiersLoc[SECOND] = M2Loc;
2211 return Modifiers[FIRST];
2216 return Modifiers[SECOND];
2227 return ModifiersLoc[FIRST];
2232 return ModifiersLoc[SECOND];
2246 reinterpret_cast<Stmt **
>(&ChunkSize) + 1);
2261 return T->getClauseKind() == llvm::omp::OMPC_schedule;
2272class OMPOrderedClause final
2274 private llvm::TrailingObjects<OMPOrderedClause, Expr *> {
2276 friend TrailingObjects;
2282 Stmt *NumForLoops =
nullptr;
2285 unsigned NumberOfLoops = 0;
2297 LParenLoc(LParenLoc), NumForLoops(
Num), NumberOfLoops(NumLoops) {}
2302 NumberOfLoops(NumLoops) {}
2305 void setNumForLoops(Expr *Num) { NumForLoops = Num; }
2315 static OMPOrderedClause *
Create(
const ASTContext &
C, Expr *
Num,
2316 unsigned NumLoops, SourceLocation StartLoc,
2317 SourceLocation LParenLoc,
2318 SourceLocation EndLoc);
2321 static OMPOrderedClause*
CreateEmpty(
const ASTContext &
C,
unsigned NumLoops);
2357 return T->getClauseKind() == llvm::omp::OMPC_ordered;
2375 Stmt *Condition =
nullptr;
2390 LParenLoc(LParenLoc), Condition(
Cond) {}
2423 return T->getClauseKind() == llvm::omp::OMPC_nowait;
2462 return T->getClauseKind() == llvm::omp::OMPC_untied;
2503 return T->getClauseKind() == llvm::omp::OMPC_mergeable;
2514class OMPAbsentClause final
2515 :
public OMPDirectiveListClause<OMPAbsentClause>,
2516 private llvm::TrailingObjects<OMPAbsentClause, OpenMPDirectiveKind> {
2517 friend OMPDirectiveListClause;
2518 friend TrailingObjects;
2528 : OMPDirectiveListClause<OMPAbsentClause>(
2529 llvm::omp::OMPC_absent, StartLoc, LParenLoc, EndLoc,
NumKinds) {}
2533 : OMPDirectiveListClause<OMPAbsentClause>(
2546 return C->getClauseKind() == llvm::omp::OMPC_absent;
2557class OMPContainsClause final
2558 :
public OMPDirectiveListClause<OMPContainsClause>,
2559 private llvm::TrailingObjects<OMPContainsClause, OpenMPDirectiveKind> {
2560 friend OMPDirectiveListClause;
2561 friend TrailingObjects;
2571 : OMPDirectiveListClause<OMPContainsClause>(
2572 llvm::omp::OMPC_contains, StartLoc, LParenLoc, EndLoc,
NumKinds) {}
2575 OMPContainsClause(
unsigned NumKinds)
2576 : OMPDirectiveListClause<OMPContainsClause>(
2589 return C->getClauseKind() == llvm::omp::OMPC_contains;
2742 return T->getClauseKind() == llvm::omp::OMPC_read;
2781 return T->getClauseKind() == llvm::omp::OMPC_write;
2800class OMPUpdateClause final
2802 private llvm::TrailingObjects<OMPUpdateClause, SourceLocation,
2803 OpenMPDependClauseKind> {
2805 friend TrailingObjects;
2808 bool IsExtended =
false;
2812 size_t numTrailingObjects(OverloadToken<SourceLocation>)
const {
2814 return IsExtended ? 2 : 0;
2819 assert(IsExtended &&
"Expected extended clause.");
2820 *getTrailingObjects<SourceLocation>() = Loc;
2824 void setArgumentLoc(SourceLocation Loc) {
2825 assert(IsExtended &&
"Expected extended clause.");
2826 *std::next(getTrailingObjects<SourceLocation>(), 1) = Loc;
2831 assert(IsExtended &&
"Expected extended clause.");
2832 *getTrailingObjects<OpenMPDependClauseKind>() = DK;
2839 OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc,
2841 :
OMPClause(llvm::omp::OMPC_update, StartLoc, EndLoc),
2842 IsExtended(IsExtended) {}
2845 OMPUpdateClause(
bool IsExtended)
2846 :
OMPClause(llvm::omp::OMPC_update, SourceLocation(), SourceLocation()),
2847 IsExtended(IsExtended) {}
2855 static OMPUpdateClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
2856 SourceLocation EndLoc);
2866 static OMPUpdateClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
2867 SourceLocation LParenLoc,
2868 SourceLocation ArgumentLoc,
2870 SourceLocation EndLoc);
2877 static OMPUpdateClause *
CreateEmpty(
const ASTContext &
C,
bool IsExtended);
2899 assert(IsExtended &&
"Expected extended clause.");
2900 return *getTrailingObjects<SourceLocation>();
2905 assert(IsExtended &&
"Expected extended clause.");
2906 return *std::next(getTrailingObjects<SourceLocation>(), 1);
2911 assert(IsExtended &&
"Expected extended clause.");
2912 return *getTrailingObjects<OpenMPDependClauseKind>();
2916 return T->getClauseKind() == llvm::omp::OMPC_update;
2957 return T->getClauseKind() == llvm::omp::OMPC_capture;
2998 return T->getClauseKind() == llvm::omp::OMPC_compare;
3039 return T->getClauseKind() == llvm::omp::OMPC_seq_cst;
3080 return T->getClauseKind() == llvm::omp::OMPC_acq_rel;
3121 return T->getClauseKind() == llvm::omp::OMPC_acquire;
3162 return T->getClauseKind() == llvm::omp::OMPC_release;
3203 return T->getClauseKind() == llvm::omp::OMPC_relaxed;
3243 return T->getClauseKind() == llvm::omp::OMPC_weak;
3268 void setFailParameterLoc(
SourceLocation Loc) { FailParameterLoc = Loc; }
3272 this->FailParameter = FailParameter;
3274 "Invalid fail clause parameter");
3289 FailParameterLoc(FailParameterLoc), LParenLoc(LParenLoc) {
3291 setFailParameter(FailParameter);
3314 return T->getClauseKind() == llvm::omp::OMPC_fail;
3337class OMPPrivateClause final
3338 :
public OMPVarListClause<OMPPrivateClause>,
3339 private llvm::TrailingObjects<OMPPrivateClause, Expr *> {
3341 friend OMPVarListClause;
3342 friend TrailingObjects;
3352 : OMPVarListClause<OMPPrivateClause>(
llvm::omp::OMPC_private, StartLoc,
3353 LParenLoc, EndLoc, N) {}
3370 MutableArrayRef<Expr *> getPrivateCopies() {
3373 ArrayRef<const Expr *> getPrivateCopies()
const {
3386 static OMPPrivateClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
3387 SourceLocation LParenLoc,
3388 SourceLocation EndLoc, ArrayRef<Expr *> VL,
3389 ArrayRef<Expr *> PrivateVL);
3395 static OMPPrivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
3401 llvm::iterator_range<private_copies_const_iterator>;
3406 return getPrivateCopies();
3415 return const_cast<OMPPrivateClause *
>(
this)->
children();
3426 return T->getClauseKind() == llvm::omp::OMPC_private;
3438class OMPFirstprivateClause final
3439 :
public OMPVarListClause<OMPFirstprivateClause>,
3441 private llvm::TrailingObjects<OMPFirstprivateClause, Expr *> {
3443 friend OMPVarListClause;
3444 friend TrailingObjects;
3454 : OMPVarListClause<OMPFirstprivateClause>(
llvm::omp::OMPC_firstprivate,
3455 StartLoc, LParenLoc, EndLoc, N),
3474 MutableArrayRef<Expr *> getPrivateCopies() {
3477 ArrayRef<const Expr *> getPrivateCopies()
const {
3484 void setInits(ArrayRef<Expr *> VL);
3488 MutableArrayRef<Expr *> getInits() {
3491 ArrayRef<const Expr *> getInits()
const {
3509 static OMPFirstprivateClause *
3510 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
3511 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PrivateVL,
3512 ArrayRef<Expr *> InitVL, Stmt *PreInit);
3518 static OMPFirstprivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
3524 llvm::iterator_range<private_copies_const_iterator>;
3528 return getPrivateCopies();
3545 return const_cast<OMPFirstprivateClause *
>(
this)->
children();
3553 return const_cast<OMPFirstprivateClause *
>(
this)->
used_children();
3557 return T->getClauseKind() == llvm::omp::OMPC_firstprivate;
3569class OMPLastprivateClause final
3570 :
public OMPVarListClause<OMPLastprivateClause>,
3572 private llvm::TrailingObjects<OMPLastprivateClause, Expr *> {
3590 friend OMPVarListClause;
3591 friend TrailingObjects;
3610 : OMPVarListClause<OMPLastprivateClause>(
llvm::omp::OMPC_lastprivate,
3611 StartLoc, LParenLoc, EndLoc, N),
3613 ColonLoc(ColonLoc) {}
3626 MutableArrayRef<Expr *> getPrivateCopies() {
3629 ArrayRef<const Expr *> getPrivateCopies()
const {
3637 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
3640 MutableArrayRef<Expr *> getSourceExprs() {
3643 ArrayRef<const Expr *> getSourceExprs()
const {
3651 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
3654 MutableArrayRef<Expr *> getDestinationExprs() {
3657 ArrayRef<const Expr *> getDestinationExprs()
const {
3664 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
3667 MutableArrayRef<Expr *> getAssignmentOps() {
3670 ArrayRef<const Expr *> getAssignmentOps()
const {
3677 void setKindLoc(SourceLocation Loc) { LPKindLoc = Loc; }
3679 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
3709 static OMPLastprivateClause *
3710 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
3711 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
3712 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps,
3714 SourceLocation ColonLoc, Stmt *PreInit, Expr *PostUpdate);
3720 static OMPLastprivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
3733 llvm::iterator_range<helper_expr_const_iterator>;
3748 return getDestinationExprs();
3763 return const_cast<OMPLastprivateClause *
>(
this)->
children();
3774 return T->getClauseKind() == llvm::omp::OMPC_lastprivate;
3785class OMPSharedClause final
3786 :
public OMPVarListClause<OMPSharedClause>,
3787 private llvm::TrailingObjects<OMPSharedClause, Expr *> {
3788 friend OMPVarListClause;
3789 friend TrailingObjects;
3799 : OMPVarListClause<OMPSharedClause>(llvm::omp::OMPC_shared, StartLoc,
3800 LParenLoc, EndLoc, N) {}
3805 explicit OMPSharedClause(
unsigned N)
3806 : OMPVarListClause<OMPSharedClause>(llvm::omp::OMPC_shared,
3834 return const_cast<OMPSharedClause *
>(
this)->
children();
3845 return T->getClauseKind() == llvm::omp::OMPC_shared;
3857class OMPReductionClause final
3858 :
public OMPVarListClause<OMPReductionClause>,
3860 private llvm::TrailingObjects<OMPReductionClause, Expr *, bool> {
3862 friend OMPVarListClause;
3863 friend TrailingObjects;
3870 OMPC_ORIGINAL_SHARING_default;
3901 : OMPVarListClause<OMPReductionClause>(
llvm::omp::OMPC_reduction,
3902 StartLoc, LParenLoc, EndLoc, N),
3904 OriginalSharingModifier(OriginalSharingModifier),
3905 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc),
3906 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
3918 void setModifier(OpenMPReductionClauseModifier M) { Modifier = M; }
3922 OriginalSharingModifier = M;
3926 void setModifierLoc(SourceLocation Loc) { ModifierLoc = Loc; }
3929 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
3932 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
3935 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
3940 void setPrivates(ArrayRef<Expr *> Privates);
3943 MutableArrayRef<Expr *> getPrivates() {
3946 ArrayRef<const Expr *> getPrivates()
const {
3953 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
3956 MutableArrayRef<Expr *> getLHSExprs() {
3959 ArrayRef<const Expr *> getLHSExprs()
const {
3968 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
3971 void setPrivateVariableReductionFlags(ArrayRef<bool> Flags) {
3973 "Number of private flags does not match vars");
3974 llvm::copy(Flags, getTrailingObjects<bool>());
3978 MutableArrayRef<bool> getPrivateVariableReductionFlags() {
3981 ArrayRef<bool> getPrivateVariableReductionFlags()
const {
3986 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
3987 return varlist_size() * (Modifier == OMPC_REDUCTION_inscan ? 8 : 5);
3991 size_t numTrailingObjects(OverloadToken<bool>)
const {
3996 MutableArrayRef<Expr *> getRHSExprs() {
3997 return MutableArrayRef<Expr *>(getLHSExprs().end(),
varlist_size());
3999 ArrayRef<const Expr *> getRHSExprs()
const {
4007 void setReductionOps(ArrayRef<Expr *> ReductionOps);
4010 MutableArrayRef<Expr *> getReductionOps() {
4013 ArrayRef<const Expr *> getReductionOps()
const {
4019 void setInscanCopyOps(ArrayRef<Expr *> Ops);
4022 MutableArrayRef<Expr *> getInscanCopyOps() {
4025 ArrayRef<const Expr *> getInscanCopyOps()
const {
4030 void setInscanCopyArrayTemps(ArrayRef<Expr *> CopyArrayTemps);
4033 MutableArrayRef<Expr *> getInscanCopyArrayTemps() {
4036 ArrayRef<const Expr *> getInscanCopyArrayTemps()
const {
4041 void setInscanCopyArrayElems(ArrayRef<Expr *> CopyArrayElems);
4044 MutableArrayRef<Expr *> getInscanCopyArrayElems() {
4045 return {getInscanCopyArrayTemps().end(),
varlist_size()};
4047 ArrayRef<const Expr *> getInscanCopyArrayElems()
const {
4048 return {getInscanCopyArrayTemps().end(),
varlist_size()};
4092 static OMPReductionClause *
4093 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
4094 SourceLocation ModifierLoc, SourceLocation ColonLoc,
4096 ArrayRef<Expr *> VL, NestedNameSpecifierLoc QualifierLoc,
4097 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
4098 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
4099 ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> CopyOps,
4100 ArrayRef<Expr *> CopyArrayTemps, ArrayRef<Expr *> CopyArrayElems,
4101 Stmt *PreInit, Expr *PostUpdate, ArrayRef<bool> IsPrivateVarReduction,
4109 static OMPReductionClause *
4118 return OriginalSharingModifier;
4137 llvm::iterator_range<helper_expr_const_iterator>;
4142 llvm::iterator_range<helper_flag_const_iterator>;
4157 return getPrivateVariableReductionFlags();
4161 return getPrivateVariableReductionFlags();
4173 return getInscanCopyArrayTemps();
4179 return getInscanCopyArrayElems();
4190 return const_cast<OMPReductionClause *
>(
this)->
children();
4198 return const_cast<OMPReductionClause *
>(
this)->
used_children();
4202 return T->getClauseKind() == llvm::omp::OMPC_reduction;
4214class OMPTaskReductionClause final
4215 :
public OMPVarListClause<OMPTaskReductionClause>,
4217 private llvm::TrailingObjects<OMPTaskReductionClause, Expr *> {
4219 friend OMPVarListClause;
4220 friend TrailingObjects;
4244 : OMPVarListClause<OMPTaskReductionClause>(
4245 llvm::omp::OMPC_task_reduction, StartLoc, LParenLoc, EndLoc, N),
4247 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
4259 void setColonLoc(SourceLocation
CL) { ColonLoc =
CL; }
4262 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
4265 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
4269 void setPrivates(ArrayRef<Expr *> Privates);
4272 MutableArrayRef<Expr *> getPrivates() {
4275 ArrayRef<const Expr *> getPrivates()
const {
4282 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
4285 MutableArrayRef<Expr *> getLHSExprs() {
4288 ArrayRef<const Expr *> getLHSExprs()
const {
4296 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
4299 MutableArrayRef<Expr *> getRHSExprs() {
4302 ArrayRef<const Expr *> getRHSExprs()
const {
4310 void setReductionOps(ArrayRef<Expr *> ReductionOps);
4313 MutableArrayRef<Expr *> getReductionOps() {
4316 ArrayRef<const Expr *> getReductionOps()
const {
4353 static OMPTaskReductionClause *
4354 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
4355 SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
4356 NestedNameSpecifierLoc QualifierLoc,
4357 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
4358 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
4359 ArrayRef<Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate);
4365 static OMPTaskReductionClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
4380 llvm::iterator_range<helper_expr_const_iterator>;
4404 return const_cast<OMPTaskReductionClause *
>(
this)->
children();
4415 return T->getClauseKind() == llvm::omp::OMPC_task_reduction;
4426class OMPInReductionClause final
4427 :
public OMPVarListClause<OMPInReductionClause>,
4429 private llvm::TrailingObjects<OMPInReductionClause, Expr *> {
4431 friend OMPVarListClause;
4432 friend TrailingObjects;
4456 : OMPVarListClause<OMPInReductionClause>(
llvm::omp::OMPC_in_reduction,
4457 StartLoc, LParenLoc, EndLoc, N),
4459 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
4471 void setColonLoc(SourceLocation
CL) { ColonLoc =
CL; }
4474 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
4477 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
4481 void setPrivates(ArrayRef<Expr *> Privates);
4484 MutableArrayRef<Expr *> getPrivates() {
4487 ArrayRef<const Expr *> getPrivates()
const {
4494 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
4497 MutableArrayRef<Expr *> getLHSExprs() {
4500 ArrayRef<const Expr *> getLHSExprs()
const {
4508 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
4511 MutableArrayRef<Expr *> getRHSExprs() {
4514 ArrayRef<const Expr *> getRHSExprs()
const {
4522 void setReductionOps(ArrayRef<Expr *> ReductionOps);
4525 MutableArrayRef<Expr *> getReductionOps() {
4528 ArrayRef<const Expr *> getReductionOps()
const {
4533 void setTaskgroupDescriptors(ArrayRef<Expr *> ReductionOps);
4536 MutableArrayRef<Expr *> getTaskgroupDescriptors() {
4539 ArrayRef<const Expr *> getTaskgroupDescriptors()
const {
4578 static OMPInReductionClause *
4579 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
4580 SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
4581 NestedNameSpecifierLoc QualifierLoc,
4582 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
4583 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
4584 ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> TaskgroupDescriptors,
4585 Stmt *PreInit, Expr *PostUpdate);
4591 static OMPInReductionClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
4606 llvm::iterator_range<helper_expr_const_iterator>;
4625 return getTaskgroupDescriptors();
4629 return getTaskgroupDescriptors();
4638 return const_cast<OMPInReductionClause *
>(
this)->
children();
4649 return T->getClauseKind() == llvm::omp::OMPC_in_reduction;
4661class OMPLinearClause final
4662 :
public OMPVarListClause<OMPLinearClause>,
4664 private llvm::TrailingObjects<OMPLinearClause, Expr *> {
4666 friend OMPVarListClause;
4667 friend TrailingObjects;
4682 void setStep(
Expr *Step) { *(getFinals().end()) = Step; }
4685 void setCalcStep(
Expr *CalcStep) { *(getFinals().end() + 1) = CalcStep; }
4695 OMPLinearClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4696 OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc,
4697 SourceLocation ColonLoc, SourceLocation StepModifierLoc,
4698 SourceLocation EndLoc,
unsigned NumVars)
4699 : OMPVarListClause<OMPLinearClause>(
llvm::omp::OMPC_linear, StartLoc,
4700 LParenLoc, EndLoc, NumVars),
4702 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc),
4703 StepModifierLoc(StepModifierLoc) {}
4708 explicit OMPLinearClause(
unsigned NumVars)
4709 : OMPVarListClause<OMPLinearClause>(llvm::omp::OMPC_linear,
4710 SourceLocation(), SourceLocation(),
4711 SourceLocation(), NumVars),
4726 MutableArrayRef<Expr *> getPrivates() {
4729 ArrayRef<const Expr *> getPrivates()
const {
4733 MutableArrayRef<Expr *> getInits() {
4736 ArrayRef<const Expr *> getInits()
const {
4741 MutableArrayRef<Expr *> getUpdates() {
4744 ArrayRef<const Expr *> getUpdates()
const {
4749 MutableArrayRef<Expr *> getFinals() {
4752 ArrayRef<const Expr *> getFinals()
const {
4757 MutableArrayRef<Expr *> getUsedExprs() {
4760 ArrayRef<const Expr *> getUsedExprs()
const {
4766 void setPrivates(ArrayRef<Expr *> PL);
4770 void setInits(ArrayRef<Expr *> IL);
4793 static OMPLinearClause *
4794 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
4796 SourceLocation ColonLoc, SourceLocation StepModifierLoc,
4797 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PL,
4798 ArrayRef<Expr *> IL, Expr *Step, Expr *CalcStep, Stmt *PreInit,
4805 static OMPLinearClause *
CreateEmpty(
const ASTContext &
C,
unsigned NumVars);
4893 llvm::iterator_range<used_expressions_iterator>;
4895 llvm::iterator_range<used_expressions_const_iterator>;
4898 return finals_range(getUsedExprs().begin(), getUsedExprs().end());
4911 return const_cast<OMPLinearClause *
>(
this)->
children();
4917 return const_cast<OMPLinearClause *
>(
this)->
used_children();
4921 return T->getClauseKind() == llvm::omp::OMPC_linear;
4933class OMPAlignedClause final
4934 :
public OMPVarListClause<OMPAlignedClause>,
4935 private llvm::TrailingObjects<OMPAlignedClause, Expr *> {
4937 friend OMPVarListClause;
4938 friend TrailingObjects;
4957 LParenLoc, EndLoc, NumVars),
4958 ColonLoc(ColonLoc) {}
4963 explicit OMPAlignedClause(
unsigned NumVars)
4964 : OMPVarListClause<OMPAlignedClause>(
llvm::omp::OMPC_aligned,
4965 SourceLocation(), SourceLocation(),
4966 SourceLocation(), NumVars) {}
4978 static OMPAlignedClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
4979 SourceLocation LParenLoc,
4980 SourceLocation ColonLoc,
4981 SourceLocation EndLoc, ArrayRef<Expr *> VL,
4988 static OMPAlignedClause *
CreateEmpty(
const ASTContext &
C,
unsigned NumVars);
5008 return const_cast<OMPAlignedClause *
>(
this)->
children();
5019 return T->getClauseKind() == llvm::omp::OMPC_aligned;
5030class OMPCopyinClause final
5031 :
public OMPVarListClause<OMPCopyinClause>,
5032 private llvm::TrailingObjects<OMPCopyinClause, Expr *> {
5047 friend OMPVarListClause;
5048 friend TrailingObjects;
5058 : OMPVarListClause<OMPCopyinClause>(
llvm::omp::OMPC_copyin, StartLoc,
5059 LParenLoc, EndLoc, N) {}
5075 MutableArrayRef<Expr *> getSourceExprs() {
5078 ArrayRef<const Expr *> getSourceExprs()
const {
5085 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
5088 MutableArrayRef<Expr *> getDestinationExprs() {
5091 ArrayRef<const Expr *> getDestinationExprs()
const {
5099 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
5102 MutableArrayRef<Expr *> getAssignmentOps() {
5105 ArrayRef<const Expr *> getAssignmentOps()
const {
5131 static OMPCopyinClause *
5132 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
5133 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
5134 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
5140 static OMPCopyinClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
5146 llvm::iterator_range<helper_expr_const_iterator>;
5153 return getDestinationExprs();
5168 return const_cast<OMPCopyinClause *
>(
this)->
children();
5179 return T->getClauseKind() == llvm::omp::OMPC_copyin;
5191class OMPCopyprivateClause final
5192 :
public OMPVarListClause<OMPCopyprivateClause>,
5193 private llvm::TrailingObjects<OMPCopyprivateClause, Expr *> {
5195 friend OMPVarListClause;
5196 friend TrailingObjects;
5206 : OMPVarListClause<OMPCopyprivateClause>(
llvm::omp::OMPC_copyprivate,
5207 StartLoc, LParenLoc, EndLoc, N) {
5224 MutableArrayRef<Expr *> getSourceExprs() {
5227 ArrayRef<const Expr *> getSourceExprs()
const {
5234 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
5237 MutableArrayRef<Expr *> getDestinationExprs() {
5240 ArrayRef<const Expr *> getDestinationExprs()
const {
5248 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
5251 MutableArrayRef<Expr *> getAssignmentOps() {
5254 ArrayRef<const Expr *> getAssignmentOps()
const {
5279 static OMPCopyprivateClause *
5280 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
5281 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
5282 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
5288 static OMPCopyprivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
5294 llvm::iterator_range<helper_expr_const_iterator>;
5301 return getDestinationExprs();
5316 return const_cast<OMPCopyprivateClause *
>(
this)->
children();
5327 return T->getClauseKind() == llvm::omp::OMPC_copyprivate;
5343class OMPFlushClause final
5344 :
public OMPVarListClause<OMPFlushClause>,
5345 private llvm::TrailingObjects<OMPFlushClause, Expr *> {
5346 friend OMPVarListClause;
5347 friend TrailingObjects;
5357 : OMPVarListClause<OMPFlushClause>(llvm::omp::OMPC_flush, StartLoc,
5358 LParenLoc, EndLoc, N) {}
5363 explicit OMPFlushClause(
unsigned N)
5364 : OMPVarListClause<OMPFlushClause>(llvm::omp::OMPC_flush,
5392 return const_cast<OMPFlushClause *
>(
this)->
children();
5403 return T->getClauseKind() == llvm::omp::OMPC_flush;
5426 Expr *Depobj =
nullptr;
5436 LParenLoc(LParenLoc) {}
5443 void setDepobj(Expr *E) { Depobj = E; }
5446 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
5456 static OMPDepobjClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
5457 SourceLocation LParenLoc,
5458 SourceLocation EndLoc, Expr *Depobj);
5463 static OMPDepobjClause *
CreateEmpty(
const ASTContext &
C);
5474 reinterpret_cast<Stmt **
>(&Depobj) + 1);
5478 return const_cast<OMPDepobjClause *
>(
this)->
children();
5489 return T->getClauseKind() == llvm::omp::OMPC_depobj;
5501class OMPDependClause final
5502 :
public OMPVarListClause<OMPDependClause>,
5503 private llvm::TrailingObjects<OMPDependClause, Expr *> {
5505 friend OMPVarListClause;
5506 friend TrailingObjects;
5528 unsigned NumLoops = 0;
5540 : OMPVarListClause<OMPDependClause>(
llvm::omp::OMPC_depend, StartLoc,
5541 LParenLoc, EndLoc, N),
5542 NumLoops(NumLoops) {}
5553 NumLoops(NumLoops) {}
5556 void setDependencyKind(OpenMPDependClauseKind K) {
Data.DepKind = K; }
5559 void setDependencyLoc(SourceLocation Loc) { Data.DepLoc = Loc; }
5562 void setColonLoc(SourceLocation Loc) { Data.ColonLoc = Loc; }
5565 void setOmpAllMemoryLoc(SourceLocation Loc) { Data.OmpAllMemoryLoc = Loc; }
5568 void setModifier(Expr *DepModifier);
5581 static OMPDependClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
5582 SourceLocation LParenLoc,
5584 Expr *DepModifier, ArrayRef<Expr *> VL,
5593 static OMPDependClause *
CreateEmpty(
const ASTContext &
C,
unsigned N,
5611 return const_cast<OMPDependClause *
>(
this)->
getModifier();
5631 return const_cast<OMPDependClause *
>(
this)->
children();
5642 return T->getClauseKind() == llvm::omp::OMPC_depend;
5667 Stmt *Device =
nullptr;
5672 void setDevice(
Expr *E) { Device = E; }
5678 void setModifierLoc(SourceLocation Loc) { ModifierLoc = Loc; }
5697 ModifierLoc(ModifierLoc), Device(E) {
5738 return T->getClauseKind() == llvm::omp::OMPC_device;
5797 return T->getClauseKind() == llvm::omp::OMPC_simd;
5814 llvm::PointerIntPair<Expr *, 1, bool> AssociatedExpressionNonContiguousPr;
5819 ValueDecl *AssociatedDeclaration =
nullptr;
5825 bool IsNonContiguous)
5826 : AssociatedExpressionNonContiguousPr(AssociatedExpression,
5828 AssociatedDeclaration(
5829 AssociatedDeclaration
5834 return AssociatedExpressionNonContiguousPr.getPointer();
5838 return AssociatedExpressionNonContiguousPr.getInt();
5842 return AssociatedDeclaration;
5846 return AssociatedExpressionNonContiguousPr ==
5847 Other.AssociatedExpressionNonContiguousPr &&
5848 AssociatedDeclaration ==
Other.AssociatedDeclaration;
5948 static std::pair<const Expr *, std::optional<size_t>>
5991 unsigned NumUniqueDeclarations;
5994 unsigned NumComponentLists;
5997 unsigned NumComponents;
6002 const bool SupportsMapper;
6036 NumUniqueDeclarations(Sizes.NumUniqueDeclarations),
6037 NumComponentLists(Sizes.NumComponentLists),
6038 NumComponents(Sizes.NumComponents), SupportsMapper(SupportsMapper) {
6039 if (MapperQualifierLocPtr)
6040 MapperQualifierLoc = *MapperQualifierLocPtr;
6041 if (MapperIdInfoPtr)
6042 MapperIdInfo = *MapperIdInfoPtr;
6048 return static_cast<T *
>(
this)
6049 ->
template getTrailingObjectsNonStrict<ValueDecl *>(
6050 NumUniqueDeclarations);
6056 return static_cast<const T *
>(
this)
6057 ->
template getTrailingObjectsNonStrict<ValueDecl *>(
6058 NumUniqueDeclarations);
6064 assert(UDs.size() == NumUniqueDeclarations &&
6065 "Unexpected amount of unique declarations.");
6072 return static_cast<T *
>(
this)
6073 ->
template getTrailingObjectsNonStrict<unsigned>(NumUniqueDeclarations);
6079 return static_cast<const T *
>(
this)
6080 ->
template getTrailingObjectsNonStrict<unsigned>(NumUniqueDeclarations);
6086 assert(DNLs.size() == NumUniqueDeclarations &&
6087 "Unexpected amount of list numbers.");
6095 static_cast<T *
>(
this)
6096 ->
template getTrailingObjectsNonStrict<unsigned>() +
6097 NumUniqueDeclarations,
6105 static_cast<const T *
>(
this)
6106 ->
template getTrailingObjectsNonStrict<unsigned>() +
6107 NumUniqueDeclarations,
6114 assert(CLSs.size() == NumComponentLists &&
6115 "Unexpected amount of component lists.");
6121 return static_cast<T *
>(
this)
6122 ->
template getTrailingObjectsNonStrict<MappableComponent>(
6128 return static_cast<const T *
>(
this)
6129 ->
template getTrailingObjectsNonStrict<MappableComponent>(
6138 assert(Components.size() == NumComponents &&
6139 "Unexpected amount of component lists.");
6140 assert(CLSs.size() == NumComponentLists &&
6141 "Unexpected amount of list sizes.");
6152 NumUniqueDeclarations &&
6153 "Unexpected number of mappable expression info entries!");
6155 "Unexpected total number of components!");
6156 assert(Declarations.size() == ComponentLists.size() &&
6157 "Declaration and component lists size is not consistent!");
6158 assert(Declarations.size() == NumComponentLists &&
6159 "Unexpected declaration and component lists size!");
6164 llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
6167 auto CI = ComponentLists.begin();
6168 for (
auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
6170 assert(!CI->empty() &&
"Invalid component list!");
6171 ComponentListMap[*DI].push_back(*CI);
6177 auto UDI = UniqueDeclarations.begin();
6180 auto DNLI = DeclNumLists.begin();
6183 auto CLSI = ComponentListSizes.begin();
6186 auto CI = Components.begin();
6189 unsigned PrevSize = 0u;
6192 for (
auto &M : ComponentListMap) {
6209 PrevSize +=
C.size();
6216 CI = llvm::copy(
C, CI);
6223 MapperQualifierLoc = NNSL;
6228 MapperIdInfo = MapperId;
6234 assert(SupportsMapper &&
6235 "Must be a clause that is possible to have user-defined mappers");
6237 static_cast<T *
>(
this)->
template getTrailingObjects<Expr *>() +
6245 assert(SupportsMapper &&
6246 "Must be a clause that is possible to have user-defined mappers");
6248 static_cast<const T *
>(
this)->
template getTrailingObjects<Expr *>() +
6257 "Unexpected number of user-defined mappers.");
6258 assert(SupportsMapper &&
6259 "Must be a clause that is possible to have user-defined mappers");
6276 return MapperQualifierLoc;
6285 :
public llvm::iterator_adaptor_base<
6286 const_component_lists_iterator,
6287 MappableExprComponentListRef::const_iterator,
6288 std::forward_iterator_tag, MappableComponent, ptrdiff_t,
6289 MappableComponent, MappableComponent> {
6297 const bool SupportsMapper;
6303 unsigned RemainingLists = 0;
6307 unsigned PrevListSize = 0;
6315 MappableExprComponentListRef::const_iterator End;
6325 Components.begin()),
6326 DeclCur(UniqueDecls.begin()), NumListsCur(DeclsListNum.begin()),
6327 SupportsMapper(SupportsMapper),
6328 ListSizeCur(CumulativeListSizes.begin()),
6329 ListSizeEnd(CumulativeListSizes.end()), End(Components.end()) {
6330 assert(UniqueDecls.size() == DeclsListNum.size() &&
6331 "Inconsistent number of declarations and list sizes!");
6332 if (!DeclsListNum.empty())
6333 RemainingLists = *NumListsCur;
6335 MapperCur = Mappers.begin();
6346 CumulativeListSizes, Components,
6347 SupportsMapper, Mappers) {
6351 for (; DeclCur != UniqueDecls.end(); ++DeclCur, ++NumListsCur) {
6355 assert(*NumListsCur > 0 &&
"No lists associated with declaration??");
6359 std::advance(ListSizeCur, *NumListsCur - 1);
6360 PrevListSize = *ListSizeCur;
6369 if (ListSizeCur == CumulativeListSizes.end()) {
6371 RemainingLists = 0u;
6377 RemainingLists = *NumListsCur;
6380 ListSizeEnd = ListSizeCur;
6381 std::advance(ListSizeEnd, RemainingLists);
6385 std::advance(this->I, PrevListSize);
6393 assert(ListSizeCur != ListSizeEnd &&
"Invalid iterator!");
6395 if (SupportsMapper && *MapperCur)
6397 return std::make_tuple(
6410 assert(ListSizeCur != ListSizeEnd && RemainingLists &&
6411 "Invalid iterator!");
6415 if (std::next(ListSizeCur) == ListSizeEnd) {
6419 std::advance(this->I, *ListSizeCur - PrevListSize);
6420 PrevListSize = *ListSizeCur;
6423 if (!(--RemainingLists)) {
6426 RemainingLists = *NumListsCur;
6427 assert(RemainingLists &&
"No lists in the following declaration??");
6439 llvm::iterator_range<const_component_lists_iterator>;
6453 SupportsMapper, {});
6461 const_component_lists_iterator
6484 llvm::iterator_range<const_all_num_lists_iterator>;
6492 llvm::iterator_range<const_all_lists_sizes_iterator>;
6500 llvm::iterator_range<const_all_components_iterator>;
6510 llvm::iterator_range<mapperlist_const_iterator>;
6536class OMPMapClause final :
public OMPMappableExprListClause<OMPMapClause>,
6537 private llvm::TrailingObjects<
6538 OMPMapClause, Expr *, ValueDecl *, unsigned,
6539 OMPClauseMappableExprCommon::MappableComponent> {
6541 friend OMPMappableExprListClause;
6542 friend OMPVarListClause;
6543 friend TrailingObjects;
6547 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
6552 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
6555 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
6574 bool MapTypeIsImplicit =
false;
6577 SourceLocation MapLoc;
6580 SourceLocation ColonLoc;
6602 explicit OMPMapClause(ArrayRef<OpenMPMapModifierKind> MapModifiers,
6603 ArrayRef<SourceLocation> MapModifiersLoc,
6604 NestedNameSpecifierLoc MapperQualifierLoc,
6605 DeclarationNameInfo MapperIdInfo,
6607 SourceLocation MapLoc,
const OMPVarListLocTy &Locs,
6608 const OMPMappableExprListSizeTy &Sizes)
6609 : OMPMappableExprListClause(llvm::omp::OMPC_map, Locs, Sizes,
6610 true, &MapperQualifierLoc,
6612 MapType(MapType), MapTypeIsImplicit(MapTypeIsImplicit), MapLoc(MapLoc) {
6613 assert(std::size(MapTypeModifiers) == MapModifiers.size() &&
6614 "Unexpected number of map type modifiers.");
6615 llvm::copy(MapModifiers, std::begin(MapTypeModifiers));
6617 assert(std::size(MapTypeModifiersLoc) == MapModifiersLoc.size() &&
6618 "Unexpected number of map type modifier locations.");
6619 llvm::copy(MapModifiersLoc, std::begin(MapTypeModifiersLoc));
6629 explicit OMPMapClause(
const OMPMappableExprListSizeTy &Sizes)
6630 : OMPMappableExprListClause(llvm::omp::OMPC_map, OMPVarListLocTy(), Sizes,
6639 "Unexpected index to store map type modifier, exceeds array size.");
6640 MapTypeModifiers[I] =
T;
6647 void setMapTypeModifierLoc(
unsigned I, SourceLocation TLoc) {
6649 "Index to store map type modifier location exceeds array size.");
6650 MapTypeModifiersLoc[I] = TLoc;
6661 void setMapLoc(SourceLocation TLoc) { MapLoc = TLoc; }
6664 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
6667 void setIteratorModifier(Expr *IteratorModifier) {
6668 getTrailingObjects<Expr *>()[2 *
varlist_size()] = IteratorModifier;
6692 static OMPMapClause *
6693 Create(
const ASTContext &
C,
const OMPVarListLocTy &Locs,
6694 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
6696 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorModifier,
6697 ArrayRef<OpenMPMapModifierKind> MapModifiers,
6698 ArrayRef<SourceLocation> MapModifiersLoc,
6699 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId,
6713 const OMPMappableExprListSizeTy &Sizes);
6717 return getTrailingObjects<Expr *>()[2 *
varlist_size()];
6735 "Requested modifier exceeds the total number of modifiers.");
6736 return MapTypeModifiers[Cnt];
6745 "Requested modifier location exceeds total number of modifiers.");
6746 return MapTypeModifiersLoc[Cnt];
6751 return MapTypeModifiers;
6756 return MapTypeModifiersLoc;
6772 return const_cast<OMPMapClause *
>(
this)->
children();
6776 if (MapType == OMPC_MAP_to || MapType == OMPC_MAP_tofrom)
6787 return T->getClauseKind() == llvm::omp::OMPC_map;
6806class OMPNumTeamsClause final
6807 :
public OMPVarListClause<OMPNumTeamsClause>,
6809 private llvm::TrailingObjects<OMPNumTeamsClause, Expr *> {
6810 friend OMPVarListClause;
6811 friend TrailingObjects;
6818 : OMPVarListClause(llvm::omp::OMPC_num_teams, StartLoc, LParenLoc, EndLoc,
6823 OMPNumTeamsClause(
unsigned N)
6837 static OMPNumTeamsClause *
6859 return const_cast<OMPNumTeamsClause *
>(
this)->
getNumTeams();
6868 return const_cast<OMPNumTeamsClause *
>(
this)->
children();
6879 return T->getClauseKind() == llvm::omp::OMPC_num_teams;
6898class OMPThreadLimitClause final
6899 :
public OMPVarListClause<OMPThreadLimitClause>,
6901 private llvm::TrailingObjects<OMPThreadLimitClause, Expr *> {
6902 friend OMPVarListClause;
6903 friend TrailingObjects;
6911 : OMPVarListClause(llvm::omp::OMPC_thread_limit, StartLoc, LParenLoc,
6916 OMPThreadLimitClause(
unsigned N)
6917 : OMPVarListClause(llvm::omp::OMPC_thread_limit,
SourceLocation(),
6930 static OMPThreadLimitClause *
6952 return const_cast<OMPThreadLimitClause *
>(
this)->
getThreadLimit();
6961 return const_cast<OMPThreadLimitClause *
>(
this)->
children();
6972 return T->getClauseKind() == llvm::omp::OMPC_thread_limit;
6991 Stmt *Priority =
nullptr;
6996 void setPriority(
Expr *E) { Priority = E; }
7045 return T->getClauseKind() == llvm::omp::OMPC_priority;
7070 Stmt *Grainsize =
nullptr;
7073 void setGrainsize(
Expr *Size) { Grainsize = Size; }
7079 void setModifierLoc(SourceLocation Loc) { ModifierLoc = Loc; }
7099 ModifierLoc(ModifierLoc), Grainsize(Size) {
7136 return T->getClauseKind() == llvm::omp::OMPC_grainsize;
7176 return T->getClauseKind() == llvm::omp::OMPC_nogroup;
7201 Stmt *NumTasks =
nullptr;
7204 void setNumTasks(
Expr *Size) { NumTasks = Size; }
7210 void setModifierLoc(SourceLocation Loc) { ModifierLoc = Loc; }
7230 ModifierLoc(ModifierLoc), NumTasks(Size) {
7267 return T->getClauseKind() == llvm::omp::OMPC_num_tasks;
7285 Stmt *Hint =
nullptr;
7288 void setHint(
Expr *H) { Hint = H; }
7299 :
OMPClause(
llvm::omp::OMPC_hint, StartLoc, EndLoc), LParenLoc(LParenLoc),
7329 return T->getClauseKind() == llvm::omp::OMPC_hint;
7357 Expr *ChunkSize =
nullptr;
7372 void setDistScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
7377 void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
7382 void setChunkSize(Expr *E) { ChunkSize = E; }
7400 Stmt *HelperChunkSize)
7401 :
OMPClause(
llvm::omp::OMPC_dist_schedule, StartLoc, EndLoc),
7403 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
7433 reinterpret_cast<Stmt **
>(&ChunkSize) + 1);
7448 return T->getClauseKind() == llvm::omp::OMPC_dist_schedule;
7490 void setDefaultmapModifierLoc(SourceLocation Loc) {
7497 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
7502 void setDefaultmapKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
7519 LParenLoc(LParenLoc), Modifier(M), ModifierLoc(MLoc), Kind(Kind),
7562 return T->getClauseKind() == llvm::omp::OMPC_defaultmap;
7574class OMPToClause final :
public OMPMappableExprListClause<OMPToClause>,
7575 private llvm::TrailingObjects<
7576 OMPToClause, Expr *, ValueDecl *, unsigned,
7577 OMPClauseMappableExprCommon::MappableComponent> {
7579 friend OMPMappableExprListClause;
7580 friend OMPVarListClause;
7581 friend TrailingObjects;
7616 true, &MapperQualifierLoc,
7618 assert(std::size(MotionModifiers) == TheMotionModifiers.size() &&
7619 "Unexpected number of motion modifiers.");
7620 llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
7622 assert(std::size(MotionModifiersLoc) == TheMotionModifiersLoc.size() &&
7623 "Unexpected number of motion modifier locations.");
7624 llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
7634 explicit OMPToClause(
const OMPMappableExprListSizeTy &Sizes)
7635 : OMPMappableExprListClause(
llvm::omp::OMPC_to, OMPVarListLocTy(), Sizes,
7644 "Unexpected index to store motion modifier, exceeds array size.");
7645 MotionModifiers[I] =
T;
7652 void setMotionModifierLoc(
unsigned I, SourceLocation TLoc) {
7654 "Index to store motion modifier location exceeds array size.");
7655 MotionModifiersLoc[I] = TLoc;
7658 void setIteratorModifier(Expr *IteratorModifier) {
7659 getTrailingObjects<Expr *>()[2 *
varlist_size()] = IteratorModifier;
7662 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
7666 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
7671 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
7674 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
7695 static OMPToClause *
7696 Create(
const ASTContext &
C,
const OMPVarListLocTy &Locs,
7697 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
7699 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorModifier,
7700 ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
7701 ArrayRef<SourceLocation> MotionModifiersLoc,
7702 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
7713 const OMPMappableExprListSizeTy &Sizes);
7720 "Requested modifier exceeds the total number of modifiers.");
7721 return MotionModifiers[Cnt];
7724 return getTrailingObjects<Expr *>()[2 *
varlist_size()];
7732 "Requested modifier location exceeds total number of modifiers.");
7733 return MotionModifiersLoc[Cnt];
7738 return MotionModifiers;
7743 return MotionModifiersLoc;
7755 return const_cast<OMPToClause *
>(
this)->
children();
7766 return T->getClauseKind() == llvm::omp::OMPC_to;
7778class OMPFromClause final
7779 :
public OMPMappableExprListClause<OMPFromClause>,
7780 private llvm::TrailingObjects<
7781 OMPFromClause, Expr *, ValueDecl *, unsigned,
7782 OMPClauseMappableExprCommon::MappableComponent> {
7784 friend OMPMappableExprListClause;
7785 friend OMPVarListClause;
7786 friend TrailingObjects;
7821 true, &MapperQualifierLoc,
7823 assert(std::size(MotionModifiers) == TheMotionModifiers.size() &&
7824 "Unexpected number of motion modifiers.");
7825 llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
7827 assert(std::size(MotionModifiersLoc) == TheMotionModifiersLoc.size() &&
7828 "Unexpected number of motion modifier locations.");
7829 llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
7839 explicit OMPFromClause(
const OMPMappableExprListSizeTy &Sizes)
7840 : OMPMappableExprListClause(
llvm::omp::OMPC_from, OMPVarListLocTy(),
7849 "Unexpected index to store motion modifier, exceeds array size.");
7850 MotionModifiers[I] =
T;
7852 void setIteratorModifier(Expr *IteratorModifier) {
7853 getTrailingObjects<Expr *>()[2 *
varlist_size()] = IteratorModifier;
7859 void setMotionModifierLoc(
unsigned I, SourceLocation TLoc) {
7861 "Index to store motion modifier location exceeds array size.");
7862 MotionModifiersLoc[I] = TLoc;
7866 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
7870 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
7875 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
7878 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
7899 static OMPFromClause *
7900 Create(
const ASTContext &
C,
const OMPVarListLocTy &Locs,
7901 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
7903 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorExpr,
7904 ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
7905 ArrayRef<SourceLocation> MotionModifiersLoc,
7906 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
7917 const OMPMappableExprListSizeTy &Sizes);
7924 "Requested modifier exceeds the total number of modifiers.");
7925 return MotionModifiers[Cnt];
7928 return getTrailingObjects<Expr *>()[2 *
varlist_size()];
7936 "Requested modifier location exceeds total number of modifiers.");
7937 return MotionModifiersLoc[Cnt];
7942 return MotionModifiers;
7947 return MotionModifiersLoc;
7959 return const_cast<OMPFromClause *
>(
this)->
children();
7970 return T->getClauseKind() == llvm::omp::OMPC_from;
7982class OMPUseDevicePtrClause final
7983 :
public OMPMappableExprListClause<OMPUseDevicePtrClause>,
7984 private llvm::TrailingObjects<
7985 OMPUseDevicePtrClause, Expr *, ValueDecl *, unsigned,
7986 OMPClauseMappableExprCommon::MappableComponent> {
7988 friend OMPMappableExprListClause;
7989 friend OMPVarListClause;
7990 friend TrailingObjects;
8004 : OMPMappableExprListClause(
llvm::omp::OMPC_use_device_ptr, Locs, Sizes) {
8020 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8023 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8026 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8033 void setPrivateCopies(ArrayRef<Expr *> VL);
8037 MutableArrayRef<Expr *> getPrivateCopies() {
8040 ArrayRef<const Expr *> getPrivateCopies()
const {
8047 void setInits(ArrayRef<Expr *> VL);
8051 MutableArrayRef<Expr *> getInits() {
8054 ArrayRef<const Expr *> getInits()
const {
8070 static OMPUseDevicePtrClause *
8071 Create(
const ASTContext &
C,
const OMPVarListLocTy &Locs,
8072 ArrayRef<Expr *> Vars, ArrayRef<Expr *> PrivateVars,
8073 ArrayRef<Expr *> Inits, ArrayRef<ValueDecl *> Declarations,
8084 static OMPUseDevicePtrClause *
8085 CreateEmpty(
const ASTContext &
C,
const OMPMappableExprListSizeTy &Sizes);
8091 llvm::iterator_range<private_copies_const_iterator>;
8096 return getPrivateCopies();
8114 return const_cast<OMPUseDevicePtrClause *
>(
this)->
children();
8125 return T->getClauseKind() == llvm::omp::OMPC_use_device_ptr;
8137class OMPUseDeviceAddrClause final
8138 :
public OMPMappableExprListClause<OMPUseDeviceAddrClause>,
8139 private llvm::TrailingObjects<
8140 OMPUseDeviceAddrClause, Expr *, ValueDecl *, unsigned,
8141 OMPClauseMappableExprCommon::MappableComponent> {
8143 friend OMPMappableExprListClause;
8144 friend OMPVarListClause;
8145 friend TrailingObjects;
8159 : OMPMappableExprListClause(
llvm::omp::OMPC_use_device_addr, Locs,
8175 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8178 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8181 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8195 static OMPUseDeviceAddrClause *
8196 Create(
const ASTContext &
C,
const OMPVarListLocTy &Locs,
8197 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8208 static OMPUseDeviceAddrClause *
8209 CreateEmpty(
const ASTContext &
C,
const OMPMappableExprListSizeTy &Sizes);
8217 return const_cast<OMPUseDeviceAddrClause *
>(
this)->
children();
8228 return T->getClauseKind() == llvm::omp::OMPC_use_device_addr;
8240class OMPIsDevicePtrClause final
8241 :
public OMPMappableExprListClause<OMPIsDevicePtrClause>,
8242 private llvm::TrailingObjects<
8243 OMPIsDevicePtrClause, Expr *, ValueDecl *, unsigned,
8244 OMPClauseMappableExprCommon::MappableComponent> {
8246 friend OMPMappableExprListClause;
8247 friend OMPVarListClause;
8248 friend TrailingObjects;
8262 : OMPMappableExprListClause(
llvm::omp::OMPC_is_device_ptr, Locs, Sizes) {}
8277 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8280 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8283 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8297 static OMPIsDevicePtrClause *
8298 Create(
const ASTContext &
C,
const OMPVarListLocTy &Locs,
8299 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8310 static OMPIsDevicePtrClause *
8311 CreateEmpty(
const ASTContext &
C,
const OMPMappableExprListSizeTy &Sizes);
8319 return const_cast<OMPIsDevicePtrClause *
>(
this)->
children();
8330 return T->getClauseKind() == llvm::omp::OMPC_is_device_ptr;
8342class OMPHasDeviceAddrClause final
8343 :
public OMPMappableExprListClause<OMPHasDeviceAddrClause>,
8344 private llvm::TrailingObjects<
8345 OMPHasDeviceAddrClause, Expr *, ValueDecl *, unsigned,
8346 OMPClauseMappableExprCommon::MappableComponent> {
8348 friend OMPMappableExprListClause;
8349 friend OMPVarListClause;
8350 friend TrailingObjects;
8364 : OMPMappableExprListClause(
llvm::omp::OMPC_has_device_addr, Locs,
8380 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
8383 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
8386 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
8400 static OMPHasDeviceAddrClause *
8401 Create(
const ASTContext &
C,
const OMPVarListLocTy &Locs,
8402 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
8413 static OMPHasDeviceAddrClause *
8414 CreateEmpty(
const ASTContext &
C,
const OMPMappableExprListSizeTy &Sizes);
8422 return const_cast<OMPHasDeviceAddrClause *
>(
this)->
children();
8433 return T->getClauseKind() == llvm::omp::OMPC_has_device_addr;
8444class OMPNontemporalClause final
8445 :
public OMPVarListClause<OMPNontemporalClause>,
8446 private llvm::TrailingObjects<OMPNontemporalClause, Expr *> {
8448 friend OMPVarListClause;
8449 friend TrailingObjects;
8459 : OMPVarListClause<OMPNontemporalClause>(
llvm::omp::OMPC_nontemporal,
8460 StartLoc, LParenLoc, EndLoc, N) {
8473 MutableArrayRef<Expr *> getPrivateRefs() {
8476 ArrayRef<const Expr *> getPrivateRefs()
const {
8488 static OMPNontemporalClause *
8489 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
8490 SourceLocation EndLoc, ArrayRef<Expr *> VL);
8496 static OMPNontemporalClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
8508 return const_cast<OMPNontemporalClause *
>(
this)->
children();
8512 return child_range(
reinterpret_cast<Stmt **
>(getPrivateRefs().begin()),
8513 reinterpret_cast<Stmt **
>(getPrivateRefs().end()));
8517 return const_cast<OMPNontemporalClause *
>(
this)->
private_refs();
8528 return T->getClauseKind() == llvm::omp::OMPC_nontemporal;
8570 void setModifier(OpenMPOrderClauseModifier M) { Modifier = M; }
8575 void setModifierKwLoc(SourceLocation MLoc) { ModifierKwLoc = MLoc; }
8592 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc), Modifier(Modifier),
8593 ModifierKwLoc(MLoc) {}
8633 return T->getClauseKind() == llvm::omp::OMPC_order;
8642class OMPInitClause final
8643 :
public OMPVarListClause<OMPInitClause>,
8644 private llvm::TrailingObjects<OMPInitClause, Expr *> {
8646 friend OMPVarListClause;
8647 friend TrailingObjects;
8652 bool IsTarget =
false;
8653 bool IsTargetSync =
false;
8657 void setIsTarget(
bool V) { IsTarget =
V; }
8659 void setIsTargetSync(
bool V) { IsTargetSync =
V; }
8662 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
8673 OMPInitClause(
bool IsTarget,
bool IsTargetSync, SourceLocation StartLoc,
8674 SourceLocation LParenLoc, SourceLocation VarLoc,
8675 SourceLocation EndLoc,
unsigned N)
8676 : OMPVarListClause<OMPInitClause>(llvm::omp::OMPC_init, StartLoc,
8677 LParenLoc, EndLoc, N),
8678 VarLoc(VarLoc), IsTarget(IsTarget), IsTargetSync(IsTargetSync) {}
8681 OMPInitClause(
unsigned N)
8682 : OMPVarListClause<OMPInitClause>(llvm::omp::OMPC_init, SourceLocation(),
8683 SourceLocation(), SourceLocation(), N) {
8696 static OMPInitClause *
Create(
const ASTContext &
C, Expr *InteropVar,
8697 OMPInteropInfo &InteropInfo,
8698 SourceLocation StartLoc,
8699 SourceLocation LParenLoc, SourceLocation VarLoc,
8700 SourceLocation EndLoc);
8706 static OMPInitClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
8727 return const_cast<OMPInitClause *
>(
this)->
children();
8752 return T->getClauseKind() == llvm::omp::OMPC_init;
8771 Stmt *InteropVar =
nullptr;
8774 void setInteropVar(
Expr *E) { InteropVar = E; }
8780 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
8793 :
OMPClause(
llvm::omp::OMPC_use, StartLoc, EndLoc), LParenLoc(LParenLoc),
8794 VarLoc(VarLoc), InteropVar(InteropVar) {}
8823 return T->getClauseKind() == llvm::omp::OMPC_use;
8846 Stmt *InteropVar =
nullptr;
8849 void setInteropVar(
Expr *E) { InteropVar = E; }
8855 void setVarLoc(SourceLocation Loc) { VarLoc = Loc; }
8869 LParenLoc(LParenLoc), VarLoc(VarLoc), InteropVar(InteropVar) {}
8912 return T->getClauseKind() == llvm::omp::OMPC_destroy;
9046class OMPInclusiveClause final
9047 :
public OMPVarListClause<OMPInclusiveClause>,
9048 private llvm::TrailingObjects<OMPInclusiveClause, Expr *> {
9050 friend OMPVarListClause;
9051 friend TrailingObjects;
9061 : OMPVarListClause<OMPInclusiveClause>(
llvm::omp::OMPC_inclusive,
9062 StartLoc, LParenLoc, EndLoc, N) {}
9081 SourceLocation StartLoc,
9082 SourceLocation LParenLoc,
9097 return const_cast<OMPInclusiveClause *
>(
this)->
children();
9108 return T->getClauseKind() == llvm::omp::OMPC_inclusive;
9119class OMPExclusiveClause final
9120 :
public OMPVarListClause<OMPExclusiveClause>,
9121 private llvm::TrailingObjects<OMPExclusiveClause, Expr *> {
9123 friend OMPVarListClause;
9124 friend TrailingObjects;
9134 : OMPVarListClause<OMPExclusiveClause>(
llvm::omp::OMPC_exclusive,
9135 StartLoc, LParenLoc, EndLoc, N) {}
9154 SourceLocation StartLoc,
9155 SourceLocation LParenLoc,
9170 return const_cast<OMPExclusiveClause *
>(
this)->
children();
9181 return T->getClauseKind() == llvm::omp::OMPC_exclusive;
9193class OMPUsesAllocatorsClause final
9195 private llvm::TrailingObjects<OMPUsesAllocatorsClause, Expr *,
9210 friend TrailingObjects;
9212 enum class ExprOffsets {
9218 enum class ParenLocsOffsets {
9225 SourceLocation LParenLoc;
9227 unsigned NumOfAllocators = 0;
9235 OMPUsesAllocatorsClause(SourceLocation StartLoc, SourceLocation LParenLoc,
9236 SourceLocation EndLoc,
unsigned N)
9237 :
OMPClause(
llvm::omp::OMPC_uses_allocators, StartLoc, EndLoc),
9238 LParenLoc(LParenLoc), NumOfAllocators(N) {}
9243 explicit OMPUsesAllocatorsClause(
unsigned N)
9244 :
OMPClause(llvm::omp::OMPC_uses_allocators, SourceLocation(),
9246 NumOfAllocators(N) {}
9248 unsigned numTrailingObjects(OverloadToken<Expr *>)
const {
9249 return NumOfAllocators *
static_cast<int>(ExprOffsets::Total);
9253 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9256 void setAllocatorsData(ArrayRef<OMPUsesAllocatorsClause::Data>
Data);
9266 static OMPUsesAllocatorsClause *
9267 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
9268 SourceLocation EndLoc, ArrayRef<OMPUsesAllocatorsClause::Data>
Data);
9274 static OMPUsesAllocatorsClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
9287 Stmt **Begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
9288 return child_range(Begin, Begin + NumOfAllocators *
9289 static_cast<int>(ExprOffsets::Total));
9292 Stmt *
const *Begin =
9293 reinterpret_cast<Stmt *
const *
>(getTrailingObjects<Expr *>());
9295 Begin, Begin + NumOfAllocators *
static_cast<int>(ExprOffsets::Total));
9306 return T->getClauseKind() == llvm::omp::OMPC_uses_allocators;
9319class OMPAffinityClause final
9320 :
public OMPVarListClause<OMPAffinityClause>,
9321 private llvm::TrailingObjects<OMPAffinityClause, Expr *> {
9323 friend OMPVarListClause;
9324 friend TrailingObjects;
9338 : OMPVarListClause<OMPAffinityClause>(
llvm::omp::OMPC_affinity, StartLoc,
9339 LParenLoc, EndLoc, N) {}
9350 void setModifier(Expr *E) { getTrailingObjects()[
varlist_size()] = E; }
9353 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
9364 static OMPAffinityClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
9365 SourceLocation LParenLoc,
9366 SourceLocation ColonLoc,
9367 SourceLocation EndLoc, Expr *Modifier,
9368 ArrayRef<Expr *> Locators);
9374 static OMPAffinityClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
9391 return const_cast<OMPAffinityClause *
>(
this)->
children();
9402 return T->getClauseKind() == llvm::omp::OMPC_affinity;
9473 void setBindKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
9483 SourceLocation StartLoc, SourceLocation LParenLoc,
9484 SourceLocation EndLoc)
9501 SourceLocation KLoc, SourceLocation StartLoc,
9502 SourceLocation LParenLoc, SourceLocation EndLoc);
9507 static OMPBindClause *
CreateEmpty(
const ASTContext &
C);
9521template<
class ImplClass,
template <
typename>
class Ptr,
typename RetTy>
9524#define PTR(CLASS) Ptr<CLASS>
9525#define DISPATCH(CLASS) \
9526 return static_cast<ImplClass*>(this)->Visit##CLASS(static_cast<PTR(CLASS)>(S))
9528#define GEN_CLANG_CLAUSE_CLASS
9529#define CLAUSE_CLASS(Enum, Str, Class) \
9530 RetTy Visit##Class(PTR(Class) S) { DISPATCH(Class); }
9531#include "llvm/Frontend/OpenMP/OMP.inc"
9536#define GEN_CLANG_CLAUSE_CLASS
9537#define CLAUSE_CLASS(Enum, Str, Class) \
9538 case llvm::omp::Clause::Enum: \
9539 return Visit##Class(static_cast<PTR(Class)>(S));
9540#define CLAUSE_NO_CLASS(Enum, Str) \
9541 case llvm::omp::Clause::Enum: \
9543#include "llvm/Frontend/OpenMP/OMP.inc"
9552template <
typename T>
using const_ptr = std::add_pointer_t<std::add_const_t<T>>;
9554template <
class ImplClass,
typename RetTy =
void>
9557template<
class ImplClass,
typename RetTy =
void>
9567 template <
typename T>
void VisitOMPClauseList(
T *Node,
char StartSym);
9569 template <
typename T>
void VisitOMPMotionClause(
T *Node);
9573 unsigned OpenMPVersion)
9574 : OS(OS), Policy(Policy), Version(OpenMPVersion) {}
9576#define GEN_CLANG_CLAUSE_CLASS
9577#define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(Class *S);
9578#include "llvm/Frontend/OpenMP/OMP.inc"
9582 llvm::omp::TraitProperty
Kind = llvm::omp::TraitProperty::invalid;
9591 llvm::omp::TraitSelector
Kind = llvm::omp::TraitSelector::invalid;
9596 llvm::omp::TraitSet
Kind = llvm::omp::TraitSet::invalid;
9612 OMPTraitInfo(StringRef MangledName);
9618 llvm::function_ref<
bool(
Expr *&,
bool )>
Cond) {
9620 return llvm::any_of(
9622 return Cond(Selector.ScoreOrCondition,
9624 llvm::omp::TraitSelector::user_condition);
9635 llvm::omp::VariantMatchInfo &VMI)
const;
9643 if (
Set.Kind != llvm::omp::TraitSet::implementation)
9646 if (
Selector.Kind != llvm::omp::TraitSelector::implementation_extension)
9660llvm::raw_ostream &
operator<<(llvm::raw_ostream &OS,
const OMPTraitInfo &TI);
9661llvm::raw_ostream &
operator<<(llvm::raw_ostream &OS,
const OMPTraitInfo *TI);
9679 llvm::StringMap<bool> FeatureMap;
9685class OMPChildren final
9686 :
private llvm::TrailingObjects<OMPChildren, OMPClause *, Stmt *> {
9687 friend TrailingObjects;
9693 unsigned NumClauses = 0;
9695 unsigned NumChildren = 0;
9697 bool HasAssociatedStmt =
false;
9701 size_t numTrailingObjects(OverloadToken<OMPClause *>)
const {
9707 OMPChildren(
unsigned NumClauses,
unsigned NumChildren,
bool HasAssociatedStmt)
9708 : NumClauses(NumClauses), NumChildren(NumChildren),
9709 HasAssociatedStmt(HasAssociatedStmt) {}
9711 static size_t size(
unsigned NumClauses,
bool HasAssociatedStmt,
9712 unsigned NumChildren);
9716 unsigned NumChildren = 0);
9717 static OMPChildren *
CreateEmpty(
void *Mem,
unsigned NumClauses,
9718 bool HasAssociatedStmt =
false,
9719 unsigned NumChildren = 0);
9728 getTrailingObjects<Stmt *>()[NumChildren] = S;
9744 assert(HasAssociatedStmt &&
9745 "Expected directive with the associated statement.");
9746 return getTrailingObjects<Stmt *>()[NumChildren];
9751 return getTrailingObjects<OMPClause *>(NumClauses);
9754 return const_cast<OMPChildren *
>(
this)->
getClauses();
9764 assert(llvm::is_contained(CaptureRegions, RegionKind) &&
9765 "RegionKind not found in OpenMP CaptureRegions.");
9767 for (
auto ThisCaptureRegion : CaptureRegions) {
9768 if (ThisCaptureRegion == RegionKind)
9772 llvm_unreachable(
"Incorrect RegionKind specified for directive.");
9779 assert(!CaptureRegions.empty() &&
9780 "At least one captured statement must be provided.");
9782 for (
unsigned Level = CaptureRegions.size(); Level > 1; --Level)
9795 return const_cast<OMPChildren *
>(
this)->
getChildren();
9799 assert(HasAssociatedStmt &&
9800 "Expected directive with the associated statement.");
9804 S = CS->getCapturedStmt();
9805 CS = dyn_cast<CapturedStmt>(S);
9812 return const_cast<OMPChildren *
>(
this)->
getRawStmt();
9816 if (!HasAssociatedStmt)
9819 &getTrailingObjects<Stmt *>()[NumChildren + 1]);
9878 enum { SIMPLE, FALLBACK, NUM_MODIFIERS };
9879 unsigned Modifiers[NUM_MODIFIERS];
9885 Expr *Size =
nullptr;
9891 Modifiers[SIMPLE] = M;
9897 void setDynGroupprivateFallbackModifier(
9899 Modifiers[FALLBACK] = M;
9903 void setDynGroupprivateModifierLoc(SourceLocation Loc) {
9904 ModifiersLoc[SIMPLE] = Loc;
9908 void setDynGroupprivateFallbackModifierLoc(SourceLocation Loc) {
9909 ModifiersLoc[FALLBACK] = Loc;
9915 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9920 void setSize(Expr *E) { Size = E; }
9940 :
OMPClause(
llvm::omp::OMPC_dyn_groupprivate, StartLoc, EndLoc),
9943 Modifiers[SIMPLE] = M1;
9944 Modifiers[FALLBACK] = M2;
9945 ModifiersLoc[SIMPLE] = M1Loc;
9946 ModifiersLoc[FALLBACK] = M2Loc;
9967 Modifiers[FALLBACK]);
9975 return ModifiersLoc[SIMPLE];
9980 return ModifiersLoc[FALLBACK];
9991 reinterpret_cast<Stmt **
>(&Size) + 1);
10006 return T->getClauseKind() == llvm::omp::OMPC_dyn_groupprivate;
10018class OMPDoacrossClause final
10019 :
public OMPVarListClause<OMPDoacrossClause>,
10020 private llvm::TrailingObjects<OMPDoacrossClause, Expr *> {
10022 friend OMPVarListClause;
10023 friend TrailingObjects;
10035 unsigned NumLoops = 0;
10046 : OMPVarListClause<OMPDoacrossClause>(
llvm::omp::OMPC_doacross, StartLoc,
10047 LParenLoc, EndLoc, N),
10048 NumLoops(NumLoops) {}
10058 NumLoops(NumLoops) {}
10061 void setDependenceType(OpenMPDoacrossClauseModifier M) { DepType = M; }
10064 void setDependenceLoc(SourceLocation Loc) { DepLoc = Loc; }
10067 void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
10081 static OMPDoacrossClause *
10082 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
10084 SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VL,
10085 unsigned NumLoops);
10092 static OMPDoacrossClause *
CreateEmpty(
const ASTContext &
C,
unsigned N,
10093 unsigned NumLoops);
10120 return const_cast<OMPDoacrossClause *
>(
this)->
children();
10131 return T->getClauseKind() == llvm::omp::OMPC_doacross;
10160 :
OMPNoChildClause(StartLoc, EndLoc), LParenLoc(LParenLoc), Attrs(Attrs) {
10179 Attrs.append(NewAttrs.begin(), NewAttrs.end());
Forward declaration of all AST node types.
static const Decl * getCanonicalDecl(const Decl *D)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines some OpenMP-specific enums and functions.
Defines the clang::SourceLocation class and associated facilities.
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 ...
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 captures a statement into a function.
This represents one expression.
Represents a function declaration or definition.
A C++ nested-name-specifier augmented with source location information.
static OMPAbsentClause * CreateEmpty(const ASTContext &C, unsigned NumKinds)
static bool classof(const OMPClause *C)
static bool classof(const OMPClause *T)
OMPAcqRelClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'ack_rel' clause.
const_child_range used_children() const
child_range used_children()
const_child_range children() const
OMPAcqRelClause()
Build an empty clause.
static bool classof(const OMPClause *T)
const_child_range children() const
OMPAcquireClause()
Build an empty clause.
child_range used_children()
const_child_range used_children() const
OMPAcquireClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'acquire' clause.
This represents clause 'affinity' in the 'pragma omp task'-based directives.
child_range used_children()
friend class OMPClauseReader
Expr * getModifier()
Gets affinity modifier.
const_child_range children() const
static OMPAffinityClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N locator items.
SourceLocation getColonLoc() const
Gets the location of ':' symbol.
const_child_range used_children() const
static bool classof(const OMPClause *T)
Expr * getModifier() const
This represents the 'align' clause in the 'pragma omp allocate' directive.
friend class OMPClauseReader
Expr * getAlignment() const
Returns alignment.
This represents clause 'aligned' in the 'pragma omp ...' directives.
friend class OMPClauseReader
Expr * getAlignment()
Returns alignment.
const Expr * getAlignment() const
Returns alignment.
void setColonLoc(SourceLocation Loc)
Sets the location of ':'.
const_child_range used_children() const
static OMPAlignedClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
const_child_range children() const
SourceLocation getColonLoc() const
Returns the location of ':'.
static bool classof(const OMPClause *T)
child_range used_children()
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.
friend class OMPClauseReader
OMPAtClause(OpenMPAtClauseKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'at' clause with argument A ('compilation' or 'execution').
SourceLocation getAtKindKwLoc() const
Returns location of clause kind.
static bool classof(const OMPClause *T)
OpenMPAtClauseKind getAtKind() const
Returns kind of the clause.
const_child_range used_children() const
child_range used_children()
SourceLocation getLParenLoc() const
Returns the locaiton of '('.
OMPAtClause()
Build an empty clause.
const_child_range children() const
friend class OMPClauseReader
const_child_range used_children() const
static bool classof(const OMPClause *T)
SourceLocation getLParenLoc() const
Returns the locaiton of '('.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OpenMPAtomicDefaultMemOrderClauseKind getAtomicDefaultMemOrderKind() const
Returns kind of the clause.
OMPAtomicDefaultMemOrderClause(OpenMPAtomicDefaultMemOrderClauseKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'atomic_default_mem_order' clause with argument A ('seq_cst', 'acq_rel' or 'relaxed').
child_range used_children()
const_child_range children() const
OMPAtomicDefaultMemOrderClause()
Build an empty clause.
SourceLocation getAtomicDefaultMemOrderKindKwLoc() const
Returns location of clause kind.
OpenMPBindClauseKind getBindKind() const
Returns kind of the clause.
friend class OMPClauseReader
SourceLocation getLParenLoc() const
Returns the location of '('.
SourceLocation getBindKindLoc() const
Returns location of clause kind.
static OMPBindClause * CreateEmpty(const ASTContext &C)
Build an empty 'bind' clause.
OMPCaptureClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'capture' clause.
const_child_range used_children() const
child_range used_children()
const_child_range children() const
static bool classof(const OMPClause *T)
OMPCaptureClause()
Build an empty clause.
Contains data for OpenMP directives: clauses, children expressions/statements (helpers for codegen) a...
unsigned getNumClauses() const
const CapturedStmt * getCapturedStmt(OpenMPDirectiveKind RegionKind, ArrayRef< OpenMPDirectiveKind > CaptureRegions) const
Returns the captured statement associated with the component region within the (combined) directive.
friend class OMPClauseReader
bool hasAssociatedStmt() const
Stmt::child_range getAssociatedStmtAsRange()
void setClauses(ArrayRef< OMPClause * > Clauses)
Sets the list of variables for this clause.
friend class OMPDeclarativeDirective
unsigned getNumChildren() const
const Stmt * getAssociatedStmt() const
Returns statement associated with the directive.
Stmt * getAssociatedStmt()
void setChildren(ArrayRef< Stmt * > Children)
ArrayRef< Stmt * > getChildren() const
MutableArrayRef< OMPClause * > getClauses()
Get the clauses storage.
friend class OMPExecutableDirective
MutableArrayRef< Stmt * > getChildren()
const Stmt * getRawStmt() const
void setAssociatedStmt(Stmt *S)
Set associated statement.
CapturedStmt * getInnermostCapturedStmt(ArrayRef< OpenMPDirectiveKind > CaptureRegions)
Get innermost captured statement for the construct.
ArrayRef< OMPClause * > getClauses() const
const CapturedStmt * getInnermostCapturedStmt(ArrayRef< OpenMPDirectiveKind > CaptureRegions) const
Class that represents a component of a mappable expression.
bool operator==(const MappableComponent &Other) const
MappableComponent(Expr *AssociatedExpression, ValueDecl *AssociatedDeclaration, bool IsNonContiguous)
bool isNonContiguous() const
Expr * getAssociatedExpression() const
MappableComponent()=default
ValueDecl * getAssociatedDeclaration() const
Struct that defines common infrastructure to handle mappable expressions used in OpenMP clauses.
ArrayRef< MappableExprComponentList > MappableExprComponentListsRef
static unsigned getUniqueDeclarationsTotalNumber(ArrayRef< const ValueDecl * > Declarations)
static unsigned getComponentsTotalNumber(MappableExprComponentListsRef ComponentLists)
ArrayRef< MappableComponent > MappableExprComponentListRef
SmallVector< MappableComponent, 8 > MappableExprComponentList
friend llvm::hash_code hash_value(const MappableComponent &MC)
SmallVector< MappableExprComponentList, 8 > MappableExprComponentLists
static std::pair< const Expr *, std::optional< size_t > > findAttachPtrExpr(MappableExprComponentListRef Components, OpenMPDirectiveKind CurDirKind)
Find the attach pointer expression from a list of mappable expression components.
static QualType getComponentExprElementType(const Expr *Exp)
Get the type of an element of a ComponentList Expr Exp.
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)
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.
const_child_range used_children() const
OMPCompareClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'compare' clause.
child_range used_children()
const_child_range children() const
OMPCompareClause()
Build an empty clause.
static bool classof(const OMPClause *T)
static OMPContainsClause * CreateEmpty(const ASTContext &C, unsigned NumKinds)
static bool classof(const OMPClause *C)
This represents clause 'copyin' in the 'pragma omp ...' directives.
friend class OMPClauseReader
helper_expr_range assignment_ops()
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
MutableArrayRef< Expr * >::iterator helper_expr_iterator
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
const_child_range children() const
helper_expr_const_range source_exprs() const
llvm::iterator_range< helper_expr_iterator > helper_expr_range
helper_expr_range source_exprs()
static bool classof(const OMPClause *T)
const_child_range used_children() const
child_range used_children()
helper_expr_const_range destination_exprs() const
helper_expr_range destination_exprs()
helper_expr_const_range assignment_ops() const
static OMPCopyinClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
This represents clause 'copyprivate' in the 'pragma omp ...' directives.
friend class OMPClauseReader
helper_expr_range source_exprs()
MutableArrayRef< Expr * >::iterator helper_expr_iterator
llvm::iterator_range< helper_expr_iterator > helper_expr_range
child_range used_children()
helper_expr_const_range destination_exprs() const
helper_expr_range destination_exprs()
const_child_range children() const
static bool classof(const OMPClause *T)
const_child_range used_children() const
helper_expr_const_range source_exprs() const
static OMPCopyprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
helper_expr_range assignment_ops()
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
helper_expr_const_range assignment_ops() const
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
const_child_range children() const
SourceLocation getDefaultmapKindLoc()
Get kind location.
friend class OMPClauseReader
static bool classof(const OMPClause *T)
OMPDefaultmapClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc, SourceLocation KLoc, SourceLocation EndLoc, OpenMPDefaultmapClauseKind Kind, OpenMPDefaultmapClauseModifier M)
Build 'defaultmap' clause with defaultmap kind Kind.
child_range used_children()
OpenMPDefaultmapClauseModifier getDefaultmapModifier() const
Get the modifier of the clause.
OMPDefaultmapClause()
Build an empty clause.
SourceLocation getDefaultmapModifierLoc() const
Get the modifier location.
const_child_range used_children() const
SourceLocation getLParenLoc()
Get location of '('.
OpenMPDefaultmapClauseKind getDefaultmapKind() const
Get kind of the clause.
This represents implicit clause 'depend' for the 'pragma omp task' directive.
SourceLocation getDependencyLoc() const
Get dependency type location.
friend class OMPClauseReader
static bool classof(const OMPClause *T)
unsigned getNumLoops() const
Get number of loops associated with the clause.
Expr * getModifier()
Return optional depend modifier.
Expr * getLoopData(unsigned NumLoop)
Get the loop data.
SourceLocation getOmpAllMemoryLoc() const
Get 'omp_all_memory' location.
const_child_range used_children() const
void setLoopData(unsigned NumLoop, Expr *Cnt)
Set the loop data for the depend clauses with 'sink|source' kind of dependency.
const_child_range children() const
static OMPDependClause * CreateEmpty(const ASTContext &C, unsigned N, unsigned NumLoops)
Creates an empty clause with N variables.
const Expr * getModifier() const
child_range used_children()
SourceLocation getColonLoc() const
Get colon location.
OpenMPDependClauseKind getDependencyKind() const
Get dependency type.
This represents implicit clause 'depobj' for the 'pragma omp depobj' directive.
SourceLocation getLParenLoc() const
Returns the location of '('.
static bool classof(const OMPClause *T)
friend class OMPClauseReader
const_child_range used_children() const
const_child_range children() const
static OMPDepobjClause * CreateEmpty(const ASTContext &C)
Creates an empty clause.
Expr * getDepobj()
Returns depobj expression associated with the clause.
child_range used_children()
const Expr * getDepobj() const
friend class OMPClauseReader
static bool classof(const OMPClause *T)
SourceLocation getLParenLoc() const
Returns the location of '('.
OMPDestroyClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'destroy' clause.
child_range used_children()
const_child_range children() const
OMPDestroyClause(Expr *InteropVar, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Build 'destroy' clause with an interop variable expression InteropVar.
SourceLocation getVarLoc() const
Returns the location of the interop variable.
Expr * getInteropVar() const
Returns the interop variable.
OMPDestroyClause()
Build an empty clause.
const_child_range used_children() const
OMPDetachClause(Expr *Evt, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'detach' clause with event-handler Evt.
friend class OMPClauseReader
OMPDetachClause()
Build an empty clause.
Expr * getEventHandler() const
Returns event-handler expression.
OMPDeviceClause()
Build an empty clause.
const_child_range used_children() const
friend class OMPClauseReader
OpenMPDeviceClauseModifier getModifier() const
Gets modifier.
child_range used_children()
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
const_child_range children() const
Expr * getDevice()
Return device number.
Expr * getDevice() const
Return device number.
OMPDeviceClause(OpenMPDeviceClauseModifier Modifier, Expr *E, Stmt *HelperE, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Build 'device' clause.
SourceLocation getModifierLoc() const
Gets modifier location.
static bool classof(const OMPClause *T)
SourceLocation getLParenLoc() const
Returns the location of '('.
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()
OMPDistScheduleClause()
Build an empty clause.
const_child_range used_children() const
friend class OMPClauseReader
SourceLocation getCommaLoc()
Get location of ','.
const_child_range children() const
SourceLocation getDistScheduleKindLoc()
Get kind location.
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.
const Expr * getChunkSize() const
Get chunk size.
OpenMPDistScheduleClauseKind getDistScheduleKind() const
Get kind of the clause.
Expr * getChunkSize()
Get chunk size.
SourceLocation getLParenLoc()
Get location of '('.
child_range used_children()
static bool classof(const OMPClause *T)
This represents the 'doacross' clause for the 'pragma omp ordered' directive.
const_child_range children() const
friend class OMPClauseReader
const_child_range used_children() const
child_range used_children()
static bool classof(const OMPClause *T)
void setLoopData(unsigned NumLoop, Expr *Cnt)
Set the loop data.
Expr * getLoopData(unsigned NumLoop)
Get the loop data.
SourceLocation getColonLoc() const
Get colon location.
unsigned getNumLoops() const
Get number of loops associated with the clause.
static OMPDoacrossClause * CreateEmpty(const ASTContext &C, unsigned N, unsigned NumLoops)
Creates an empty clause with N expressions.
OpenMPDoacrossClauseModifier getDependenceType() const
Get dependence type.
SourceLocation getDependenceLoc() const
Get dependence type location.
const_child_range used_children() const
friend class OMPClauseReader
static bool classof(const OMPClause *T)
SourceLocation getLParenLoc()
Get location of '('.
OMPDynGroupprivateClause()
Build an empty clause.
const Expr * getSize() const
Get size.
Expr * getSize()
Get size.
SourceLocation getDynGroupprivateModifierLoc() const
Get the first modifier location.
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.
child_range used_children()
OpenMPDynGroupprivateClauseFallbackModifier getDynGroupprivateFallbackModifier() const
Get the second modifier of the clause.
OpenMPDynGroupprivateClauseModifier getDynGroupprivateModifier() const
Get the first modifier of the clause.
const_child_range children() const
SourceLocation getDynGroupprivateFallbackModifierLoc() const
Get the second modifier location.
OMPDynamicAllocatorsClause()
Build an empty clause.
friend class OMPClauseReader
OMPDynamicAllocatorsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'dynamic_allocators' clause.
const_child_range children() const
const_child_range used_children() const
static bool classof(const OMPClause *T)
child_range used_children()
This represents clause 'exclusive' in the 'pragma omp scan' directive.
friend class OMPClauseReader
child_range used_children()
const_child_range used_children() const
static OMPExclusiveClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
const_child_range children() const
static bool classof(const OMPClause *T)
friend class OMPClauseReader
OMPFailClause(OpenMPClauseKind FailParameter, SourceLocation FailParameterLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
child_range used_children()
OMPFailClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'fail' clause.
static bool classof(const OMPClause *T)
const_child_range used_children() const
SourceLocation getLParenLoc() const
Gets the location of '(' (for the parameter) in fail clause.
const_child_range children() const
SourceLocation getFailParameterLoc() const
Gets the location of Fail Parameter (type memory-order-clause) in fail clause.
OMPFailClause()
Build an empty clause.
OpenMPClauseKind getFailParameter() const
Gets the parameter (type memory-order-clause) in Fail 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.
OMPFilterClause()
Build an empty clause.
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
This represents clause 'firstprivate' in the 'pragma omp ...' directives.
MutableArrayRef< Expr * >::iterator private_copies_iterator
friend class OMPClauseReader
const_child_range children() const
static bool classof(const OMPClause *T)
inits_const_range inits() const
llvm::iterator_range< inits_const_iterator > inits_const_range
ArrayRef< const Expr * >::iterator inits_const_iterator
child_range used_children()
private_copies_const_range private_copies() const
llvm::iterator_range< private_copies_const_iterator > private_copies_const_range
llvm::iterator_range< inits_iterator > inits_range
llvm::iterator_range< private_copies_iterator > private_copies_range
const_child_range used_children() const
private_copies_range private_copies()
ArrayRef< const Expr * >::iterator private_copies_const_iterator
static OMPFirstprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
MutableArrayRef< Expr * >::iterator inits_iterator
child_range used_children()
static OMPFlushClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
const_child_range children() const
static bool classof(const OMPClause *T)
const_child_range used_children() const
This represents clause 'from' in the 'pragma omp ...' directives.
const_child_range used_children() const
friend class OMPClauseReader
SourceLocation getColonLoc() const
Get colon location.
OpenMPMotionModifierKind getMotionModifier(unsigned Cnt) const LLVM_READONLY
Fetches the motion-modifier at 'Cnt' index of array of modifiers.
ArrayRef< SourceLocation > getMotionModifiersLoc() const LLVM_READONLY
Fetches ArrayRef of location of motion-modifiers.
static bool classof(const OMPClause *T)
Expr * getIteratorModifier() const
static OMPFromClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars variables.
ArrayRef< OpenMPMotionModifierKind > getMotionModifiers() const LLVM_READONLY
Fetches ArrayRef of motion-modifiers.
child_range used_children()
SourceLocation getMotionModifierLoc(unsigned Cnt) const LLVM_READONLY
Fetches the motion-modifier location at 'Cnt' index of array of modifiers' locations.
const_child_range 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.
const_child_range children() const
friend class OMPClauseReader
Expr * getGrainsize() const
Return safe iteration space distance.
SourceLocation getLParenLoc() const
Returns the location of '('.
child_range used_children()
SourceLocation getModifierLoc() const
Gets modifier location.
OMPGrainsizeClause(OpenMPGrainsizeClauseModifier Modifier, Expr *Size, Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Build 'grainsize' clause.
static bool classof(const OMPClause *T)
const_child_range used_children() const
OMPGrainsizeClause()
Build an empty clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OpenMPGrainsizeClauseModifier getModifier() const
Gets modifier.
This represents clause 'has_device_ptr' in the 'pragma omp ...' directives.
const_child_range used_children() const
friend class OMPClauseReader
const_child_range children() const
static bool classof(const OMPClause *T)
static OMPHasDeviceAddrClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars variables.
child_range used_children()
friend class OMPClauseReader
static bool classof(const OMPClause *T)
Expr * getHint() const
Returns number of threads.
const_child_range children() const
OMPHintClause(Expr *Hint, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'hint' clause with expression Hint.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
SourceLocation getLParenLoc() const
Returns the location of '('.
const_child_range used_children() const
OMPHintClause()
Build an empty clause.
child_range used_children()
friend class OMPClauseReader
OMPHoldsClause(Expr *E, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'holds' clause.
OMPHoldsClause()
Build an empty clause.
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.
This represents clause 'in_reduction' in the 'pragma omp task' directives.
static OMPInReductionClause * 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
helper_expr_const_range rhs_exprs() const
helper_expr_range taskgroup_descriptors()
MutableArrayRef< Expr * >::iterator helper_expr_iterator
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
llvm::iterator_range< helper_expr_iterator > helper_expr_range
helper_expr_const_range lhs_exprs() const
helper_expr_const_range reduction_ops() const
helper_expr_const_range privates() const
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
helper_expr_const_range taskgroup_descriptors() const
child_range used_children()
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
helper_expr_range reduction_ops()
const_child_range used_children() const
helper_expr_range rhs_exprs()
const_child_range children() const
helper_expr_range lhs_exprs()
helper_expr_range privates()
This represents clause 'inclusive' in the 'pragma omp scan' directive.
const_child_range children() const
friend class OMPClauseReader
static bool classof(const OMPClause *T)
child_range used_children()
static OMPInclusiveClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
const_child_range used_children() const
bool getIsTarget() const
Returns true is interop-type 'target' is used.
child_range used_children()
const_child_range children() const
friend class OMPClauseReader
const_prefs_range prefs() const
llvm::iterator_range< prefs_iterator > prefs_range
const Expr * getInteropVar() const
static bool classof(const OMPClause *T)
ArrayRef< const Expr * >::iterator const_prefs_iterator
SourceLocation getVarLoc() const
Returns the location of the interop variable.
bool getIsTargetSync() const
Returns true is interop-type 'targetsync' is used.
static OMPInitClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N expressions.
MutableArrayRef< Expr * >::iterator prefs_iterator
const_child_range used_children() const
Expr * getInteropVar()
Returns the interop variable.
llvm::iterator_range< const_prefs_iterator > const_prefs_range
This represents clause 'is_device_ptr' in the 'pragma omp ...' directives.
friend class OMPClauseReader
const_child_range used_children() const
const_child_range children() const
child_range used_children()
static bool classof(const OMPClause *T)
static OMPIsDevicePtrClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars variables.
This represents clause 'lastprivate' in the 'pragma omp ...' directives.
static OMPLastprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
helper_expr_range assignment_ops()
friend class OMPClauseReader
void setPrivateCopies(ArrayRef< Expr * > PrivateCopies)
Set list of helper expressions, required for generation of private copies of original lastprivate var...
SourceLocation getKindLoc() const
Returns the location of the lastprivate kind.
const_child_range used_children() const
helper_expr_const_range destination_exprs() const
helper_expr_const_range source_exprs() const
helper_expr_range destination_exprs()
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
static bool classof(const OMPClause *T)
helper_expr_range source_exprs()
const_child_range children() const
helper_expr_const_range assignment_ops() const
helper_expr_range private_copies()
MutableArrayRef< Expr * >::iterator helper_expr_iterator
SourceLocation getColonLoc() const
Returns the location of the ':' symbol, if any.
OpenMPLastprivateModifier getKind() const
Lastprivate kind.
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
child_range used_children()
llvm::iterator_range< helper_expr_iterator > helper_expr_range
helper_expr_const_range private_copies() const
static bool classof(const OMPClause *T)
void setStepModifierLoc(SourceLocation Loc)
Sets the location of 'step' modifier.
updates_const_range updates() const
child_range used_children()
SourceLocation getModifierLoc() const
Return modifier location.
friend class OMPClauseReader
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
Expr * getStep()
Returns linear step.
void setUpdates(ArrayRef< Expr * > UL)
Sets the list of update expressions for linear variables.
privates_range privates()
void setFinals(ArrayRef< Expr * > FL)
Sets the list of final update expressions for linear variables.
privates_const_range privates() const
void setUsedExprs(ArrayRef< Expr * > UE)
Sets the list of used expressions for the linear clause.
const Expr * getStep() const
Returns linear step.
ArrayRef< const Expr * >::iterator used_expressions_const_iterator
llvm::iterator_range< finals_iterator > finals_range
llvm::iterator_range< updates_iterator > updates_range
MutableArrayRef< Expr * >::iterator inits_iterator
ArrayRef< const Expr * >::iterator finals_const_iterator
void setModifierLoc(SourceLocation Loc)
Set modifier location.
MutableArrayRef< Expr * >::iterator used_expressions_iterator
llvm::iterator_range< finals_const_iterator > finals_const_range
llvm::iterator_range< privates_iterator > privates_range
inits_const_range inits() const
const_child_range children() const
Expr * getCalcStep()
Returns expression to calculate linear step.
MutableArrayRef< Expr * >::iterator finals_iterator
ArrayRef< const Expr * >::iterator updates_const_iterator
void setColonLoc(SourceLocation Loc)
Sets the location of ':'.
const Expr * getCalcStep() const
Returns expression to calculate linear step.
llvm::iterator_range< used_expressions_iterator > used_expressions_range
ArrayRef< const Expr * >::iterator inits_const_iterator
llvm::iterator_range< used_expressions_const_iterator > used_expressions_const_range
llvm::iterator_range< updates_const_iterator > updates_const_range
SourceLocation getStepModifierLoc() const
Returns the location of 'step' modifier.
used_expressions_const_range used_expressions() const
used_expressions_range used_expressions()
llvm::iterator_range< privates_const_iterator > privates_const_range
finals_const_range finals() const
const_child_range used_children() const
void setModifier(OpenMPLinearClauseKind Kind)
Set modifier.
llvm::iterator_range< inits_const_iterator > inits_const_range
MutableArrayRef< Expr * >::iterator updates_iterator
llvm::iterator_range< inits_iterator > inits_range
ArrayRef< const Expr * >::iterator privates_const_iterator
OpenMPLinearClauseKind getModifier() const
Return modifier.
SourceLocation getColonLoc() const
Returns the location of ':'.
MutableArrayRef< Expr * >::iterator privates_iterator
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)
OpenMPMapClauseKind getMapType() const LLVM_READONLY
Fetches mapping kind for the clause.
friend class OMPClauseReader
ArrayRef< SourceLocation > getMapTypeModifiersLoc() const LLVM_READONLY
Fetches ArrayRef of location of map-type-modifiers.
Expr * getIteratorModifier()
Fetches Expr * of iterator modifier.
child_range used_children()
bool isImplicitMapType() const LLVM_READONLY
Is this an implicit map type?
static bool classof(const OMPClause *T)
SourceLocation getMapTypeModifierLoc(unsigned Cnt) const LLVM_READONLY
Fetches the map-type-modifier location at 'Cnt' index of array of modifiers' locations.
const_child_range children() const
ArrayRef< OpenMPMapModifierKind > getMapTypeModifiers() const LLVM_READONLY
Fetches ArrayRef of map-type-modifiers.
SourceLocation getColonLoc() const
Get colon location.
const_child_range used_children() const
SourceLocation getMapLoc() const LLVM_READONLY
Fetches location of clause mapping kind.
static OMPMapClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars original expressions, NumUniqueDeclarations declar...
OpenMPMapModifierKind getMapTypeModifier(unsigned Cnt) const LLVM_READONLY
Fetches the map-type-modifier at 'Cnt' index of array of modifiers.
Iterator that browse the components by lists.
const_component_lists_iterator & operator++()
std::tuple< const ValueDecl *, MappableExprComponentListRef, const ValueDecl * > operator->() const
std::tuple< const ValueDecl *, MappableExprComponentListRef, const ValueDecl * > operator*() const
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.
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.
This represents clauses with a list of expressions that are mappable.
const_component_lists_range component_lists() const
ArrayRef< MappableComponent > getComponentsRef() const
Get the components that are in the trailing objects of the class.
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,...
llvm::iterator_range< mapperlist_iterator > mapperlist_range
friend class OMPClauseReader
MutableArrayRef< ValueDecl * > getUniqueDeclsRef()
Get the unique declarations that are in the trailing objects of the class.
MutableArrayRef< MappableComponent > getComponentsRef()
Get the components that are in the trailing objects of the class.
void setUDMapperRefs(ArrayRef< Expr * > DMDs)
Set the user-defined mappers that are in the trailing objects of the class.
ArrayRef< unsigned >::iterator const_all_lists_sizes_iterator
mapperlist_iterator mapperlist_end()
llvm::iterator_range< const_all_num_lists_iterator > const_all_num_lists_range
const_all_decls_range all_decls() const
mapperlist_const_range mapperlists() const
void setDeclNumLists(ArrayRef< unsigned > DNLs)
Set the number of lists per declaration that are in the trailing objects of the class.
const_component_lists_iterator decl_component_lists_begin(const ValueDecl *VD) const
Iterators for component lists associated with the provided declaration.
void setMapperQualifierLoc(NestedNameSpecifierLoc NNSL)
Set the nested name specifier of associated user-defined mapper.
llvm::iterator_range< const_component_lists_iterator > const_component_lists_range
unsigned getTotalComponentsNum() const
Return the total number of components in all lists derived from the clause.
MutableArrayRef< unsigned > getComponentListSizesRef()
Get the cumulative component lists sizes 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.
unsigned getUniqueDeclarationsNum() const
Return the number of unique base declarations in this clause.
ArrayRef< unsigned > getComponentListSizesRef() const
Get the cumulative component lists sizes that are in the trailing objects of the class.
ArrayRef< unsigned > getDeclNumListsRef() const
Get the number of lists per declaration that are in the trailing objects of the class.
const_all_lists_sizes_range all_lists_sizes() const
void setUniqueDecls(ArrayRef< ValueDecl * > UDs)
Set the unique declarations that are in the trailing objects of the class.
llvm::iterator_range< const_all_decls_iterator > const_all_decls_range
const DeclarationNameInfo & getMapperIdInfo() const
Gets the name info for associated user-defined mapper.
const_component_lists_iterator decl_component_lists_end() const
mapperlist_iterator mapperlist_begin()
ArrayRef< unsigned >::iterator const_all_num_lists_iterator
void setComponents(ArrayRef< MappableComponent > Components, ArrayRef< unsigned > CLSs)
Set the components that are in the trailing objects of the class.
MutableArrayRef< Expr * >::iterator mapperlist_iterator
MutableArrayRef< Expr * > getUDMapperRefs()
Get the user-defined mapper references that are in the trailing objects of the class.
mapperlist_const_iterator mapperlist_begin() const
ArrayRef< const Expr * >::iterator mapperlist_const_iterator
const_all_num_lists_range all_num_lists() const
llvm::iterator_range< mapperlist_const_iterator > mapperlist_const_range
llvm::iterator_range< const_all_components_iterator > const_all_components_range
void setClauseInfo(ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists)
Fill the clause information from the list of declarations and associated component lists.
unsigned getTotalComponentListNum() const
Return the number of lists derived from the clause expressions.
const_component_lists_range decl_component_lists(const ValueDecl *VD) const
void setComponentListSizes(ArrayRef< unsigned > CLSs)
Set the cumulative component lists sizes that are in the trailing objects of the class.
NestedNameSpecifierLoc getMapperQualifierLoc() const
Gets the nested name specifier for associated user-defined mapper.
ArrayRef< ValueDecl * > getUniqueDeclsRef() const
Get the unique declarations that are in the trailing objects of the class.
mapperlist_range mapperlists()
llvm::iterator_range< const_all_lists_sizes_iterator > const_all_lists_sizes_range
MutableArrayRef< unsigned > getDeclNumListsRef()
Get the number of lists per declaration that are in the trailing objects of the class.
const_component_lists_iterator component_lists_end() const
const_component_lists_iterator component_lists_begin() const
Iterators for all component lists.
ArrayRef< MappableComponent >::iterator const_all_components_iterator
mapperlist_const_iterator mapperlist_end() const
const_all_components_range all_components() const
void setMapperIdInfo(DeclarationNameInfo MapperId)
Set the name of associated user-defined mapper.
ArrayRef< ValueDecl * >::iterator const_all_decls_iterator
Iterators to access all the declarations, number of lists, list sizes, and components.
OMPMergeableClause()
Build an empty clause.
OMPMergeableClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'mergeable' clause.
const_child_range children() const
const_child_range used_children() const
static bool classof(const OMPClause *T)
child_range used_children()
Expr * getMessageString() const
Returns message string of the clause.
friend class OMPClauseReader
OMPMessageClause(Expr *MS, Stmt *HelperMS, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'message' clause with message string argument.
std::optional< std::string > tryEvaluateString(ASTContext &Ctx) const
Try to evaluate the message string at compile time.
OMPMessageClause()
Build an empty clause.
OMPNoOpenMPClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'no_openmp' clause.
OMPNoOpenMPClause()
Build an empty clause.
OMPNoOpenMPConstructsClause()
Build an empty clause.
OMPNoOpenMPConstructsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'no_openmp_constructs' clause.
OMPNoOpenMPRoutinesClause()
Build an empty clause.
OMPNoOpenMPRoutinesClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'no_openmp_routines' clause.
OMPNoParallelismClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'no_parallelism' clause.
OMPNoParallelismClause()
Build an empty clause.
OMPNocontextClause(Expr *Cond, Stmt *HelperCond, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'nocontext' clause with condition Cond.
friend class OMPClauseReader
const_child_range used_children() const
OMPNocontextClause()
Build an empty clause.
Expr * getCondition() const
Returns condition.
child_range used_children()
OMPNogroupClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'nogroup' clause.
static bool classof(const OMPClause *T)
OMPNogroupClause()
Build an empty clause.
const_child_range children() const
child_range used_children()
const_child_range used_children() const
This represents clause 'nontemporal' in the 'pragma omp ...' directives.
friend class OMPClauseReader
static OMPNontemporalClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
const_child_range private_refs() const
static bool classof(const OMPClause *T)
child_range private_refs()
child_range used_children()
void setPrivateRefs(ArrayRef< Expr * > VL)
Sets the list of references to private copies created in private clauses.
const_child_range children() const
const_child_range used_children() const
friend class OMPClauseReader
const_child_range used_children() const
OMPNovariantsClause()
Build an empty clause.
child_range used_children()
OMPNovariantsClause(Expr *Cond, Stmt *HelperCond, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'novariants' clause with condition Cond.
Expr * getCondition() const
Returns condition.
friend class OMPClauseReader
static bool classof(const OMPClause *T)
Expr * getCondition() const
Returns condition.
const_child_range children() const
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
const_child_range used_children() const
OMPNowaitClause()
Build an empty clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
OMPNowaitClause(Expr *Cond, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'nowait' clause with condition Cond.
child_range used_children()
const_child_range children() const
friend class OMPClauseReader
Expr * getNumTasks() const
Return safe iteration space distance.
SourceLocation getModifierLoc() const
Gets modifier location.
SourceLocation getLParenLoc() const
Returns the location of '('.
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)
const_child_range used_children() const
OMPNumTasksClause()
Build an empty clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
child_range used_children()
OpenMPNumTasksClauseModifier getModifier() const
Gets modifier.
SourceLocation getLParenLoc() const
Returns the location of '('.
const_child_range children() const
const_child_range used_children() const
static bool classof(const OMPClause *T)
child_range used_children()
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
ArrayRef< Expr * > getNumTeams() const
Return NumTeams expressions.
static OMPNumTeamsClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
ArrayRef< Expr * > getNumTeams()
Return NumTeams expressions.
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.
OMPOrderClause(OpenMPOrderClauseKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, OpenMPOrderClauseModifier Modifier, SourceLocation MLoc)
Build 'order' clause with argument A ('concurrent').
friend class OMPClauseReader
SourceLocation getLParenLoc() const
Returns the location of '('.
const_child_range children() const
const_child_range used_children() const
SourceLocation getKindKwLoc() const
Returns location of clause kind.
static bool classof(const OMPClause *T)
SourceLocation getModifierKwLoc() const
Returns location of clause modifier.
OpenMPOrderClauseKind getKind() const
Returns kind of the clause.
child_range used_children()
OMPOrderClause()
Build an empty clause.
OpenMPOrderClauseModifier getModifier() const
Returns Modifier of the clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
This represents 'ordered' clause in the 'pragma omp ...' directive.
friend class OMPClauseReader
const_child_range children() const
void setLoopCounter(unsigned NumLoop, Expr *Counter)
Set loop counter for the specified loop.
static bool classof(const OMPClause *T)
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
Expr * getNumForLoops() const
Return the number of associated for-loops.
void setLoopNumIterations(unsigned NumLoop, Expr *NumIterations)
Set number of iterations for the specified loop.
SourceLocation getLParenLoc() const
Returns the location of '('.
const_child_range used_children() const
ArrayRef< Expr * > getLoopNumIterations() const
Get number of iterations for all the loops.
child_range used_children()
static OMPOrderedClause * CreateEmpty(const ASTContext &C, unsigned NumLoops)
Build an empty clause.
Expr * getLoopCounter(unsigned NumLoop)
Get loops counter for the specified loop.
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
OMPPriorityClause(Expr *Priority, Stmt *HelperPriority, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'priority' clause.
Expr * getPriority() const
Return Priority number.
friend class OMPClauseReader
const_child_range used_children() const
static bool classof(const OMPClause *T)
const_child_range children() const
child_range used_children()
OMPPriorityClause()
Build an empty clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
Expr * getPriority()
Return Priority number.
This represents clause 'private' in the 'pragma omp ...' directives.
const_child_range children() const
friend class OMPClauseReader
private_copies_range private_copies()
static bool classof(const OMPClause *T)
const_child_range used_children() const
child_range used_children()
llvm::iterator_range< private_copies_const_iterator > private_copies_const_range
llvm::iterator_range< private_copies_iterator > private_copies_range
ArrayRef< const Expr * >::iterator private_copies_const_iterator
private_copies_const_range private_copies() const
MutableArrayRef< Expr * >::iterator private_copies_iterator
static OMPPrivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
friend class OMPClauseReader
child_range used_children()
const_child_range used_children() const
SourceLocation getProcBindKindKwLoc() const
Returns location of clause kind.
const_child_range children() const
SourceLocation getLParenLoc() const
Returns the location of '('.
OMPProcBindClause()
Build an empty clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OMPProcBindClause(llvm::omp::ProcBindKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'proc_bind' clause with argument A ('master', 'close' or 'spread').
llvm::omp::ProcBindKind getProcBindKind() const
Returns kind of the clause.
static bool classof(const OMPClause *T)
static bool classof(const OMPClause *T)
child_range used_children()
const_child_range children() const
const_child_range used_children() const
OMPReadClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'read' clause.
OMPReadClause()
Build an empty clause.
This represents clause 'reduction' in the 'pragma omp ...' directives.
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
friend class OMPClauseReader
child_range used_children()
OpenMPOriginalSharingModifier getOriginalSharingModifier() const
Returns Original Sharing Modifier.
MutableArrayRef< Expr * >::iterator helper_expr_iterator
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
helper_expr_const_range rhs_exprs() const
llvm::iterator_range< helper_expr_iterator > helper_expr_range
helper_expr_const_range lhs_exprs() const
helper_expr_range copy_array_temps()
static OMPReductionClause * CreateEmpty(const ASTContext &C, unsigned N, OpenMPReductionClauseModifier Modifier)
Creates an empty clause with the place for N variables.
helper_expr_range rhs_exprs()
helper_expr_range copy_array_elems()
helper_expr_range lhs_exprs()
helper_expr_const_range copy_array_temps() const
const_child_range used_children() const
helper_expr_const_range reduction_ops() const
helper_expr_range privates()
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
ArrayRef< bool >::iterator helper_flag_const_iterator
helper_expr_const_range privates() const
MutableArrayRef< bool >::iterator helper_flag_iterator
llvm::iterator_range< helper_flag_const_iterator > helper_flag_const_range
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
static bool classof(const OMPClause *T)
helper_expr_const_range copy_array_elems() const
helper_expr_const_range copy_ops() const
helper_flag_const_range private_var_reduction_flags() const
OpenMPReductionClauseModifier getModifier() const
Returns modifier.
SourceLocation getModifierLoc() const
Returns modifier location.
helper_expr_range copy_ops()
const_child_range children() const
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
llvm::iterator_range< helper_flag_iterator > helper_flag_range
helper_expr_range reduction_ops()
helper_flag_range private_var_reduction_flags()
static bool classof(const OMPClause *T)
const_child_range used_children() const
child_range used_children()
OMPRelaxedClause()
Build an empty clause.
const_child_range children() const
OMPRelaxedClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'relaxed' clause.
const_child_range children() const
child_range used_children()
OMPReleaseClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'release' clause.
OMPReleaseClause()
Build an empty clause.
static bool classof(const OMPClause *T)
const_child_range used_children() const
const_child_range children() const
const_child_range used_children() const
friend class OMPClauseReader
OMPReverseOffloadClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'reverse_offload' clause.
static bool classof(const OMPClause *T)
OMPReverseOffloadClause()
Build an empty clause.
child_range used_children()
OMPSIMDClause()
Build an empty clause.
const_child_range children() const
const_child_range used_children() const
child_range used_children()
static bool classof(const OMPClause *T)
OMPSIMDClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'simd' clause.
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.
static bool classof(const OMPClause *T)
friend class OMPClauseReader
SourceLocation getFirstScheduleModifierLoc() const
Get the first modifier location.
OMPScheduleClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation KLoc, SourceLocation CommaLoc, SourceLocation EndLoc, OpenMPScheduleClauseKind Kind, Expr *ChunkSize, Stmt *HelperChunkSize, OpenMPScheduleClauseModifier M1, SourceLocation M1Loc, OpenMPScheduleClauseModifier M2, SourceLocation M2Loc)
Build 'schedule' clause with schedule kind Kind and chunk size expression ChunkSize.
SourceLocation getScheduleKindLoc()
Get kind location.
OpenMPScheduleClauseKind getScheduleKind() const
Get kind of the clause.
SourceLocation getLParenLoc()
Get location of '('.
const Expr * getChunkSize() const
Get chunk size.
OMPScheduleClause()
Build an empty clause.
OpenMPScheduleClauseModifier getSecondScheduleModifier() const
Get the second modifier of the clause.
SourceLocation getCommaLoc()
Get location of ','.
OpenMPScheduleClauseModifier getFirstScheduleModifier() const
Get the first modifier of the clause.
child_range used_children()
SourceLocation getSecondScheduleModifierLoc() const
Get the second modifier location.
const_child_range children() const
const_child_range used_children() const
Expr * getChunkSize()
Get chunk size.
child_range used_children()
friend class OMPClauseReader
static bool classof(const OMPClause *T)
OMPSelfMapsClause()
Build an empty clause.
OMPSelfMapsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'self_maps' clause.
const_child_range used_children() const
const_child_range children() const
OMPSeqCstClause()
Build an empty clause.
const_child_range used_children() const
OMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'seq_cst' clause.
child_range used_children()
const_child_range children() const
static bool classof(const OMPClause *T)
friend class OMPClauseReader
child_range used_children()
SourceLocation getLParenLoc() const
Returns the locaiton of '('.
const_child_range children() const
static bool classof(const OMPClause *T)
OMPSeverityClause()
Build an empty clause.
OMPSeverityClause(OpenMPSeverityClauseKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'severity' clause with argument A ('fatal' or 'warning').
OpenMPSeverityClauseKind getSeverityKind() const
Returns kind of the clause.
const_child_range used_children() const
SourceLocation getSeverityKindKwLoc() const
Returns location of clause kind.
child_range used_children()
const_child_range used_children() const
static OMPSharedClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
const_child_range children() const
static bool classof(const OMPClause *T)
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.
This represents clause 'task_reduction' in the 'pragma omp taskgroup' directives.
helper_expr_const_range rhs_exprs() const
friend class OMPClauseReader
llvm::iterator_range< helper_expr_iterator > helper_expr_range
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
helper_expr_const_range lhs_exprs() const
const_child_range used_children() const
helper_expr_const_range reduction_ops() const
helper_expr_range privates()
const_child_range children() const
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
MutableArrayRef< Expr * >::iterator helper_expr_iterator
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
helper_expr_range rhs_exprs()
helper_expr_range lhs_exprs()
helper_expr_range reduction_ops()
helper_expr_const_range privates() const
static OMPTaskReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
static bool classof(const OMPClause *T)
child_range used_children()
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
ArrayRef< Expr * > getThreadLimit()
Return ThreadLimit expressions.
const_child_range children() const
ArrayRef< Expr * > getThreadLimit() const
Return ThreadLimit expressions.
SourceLocation getLParenLoc() const
Returns the location of '('.
static OMPThreadLimitClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
child_range used_children()
const_child_range used_children() const
static bool classof(const OMPClause *T)
OMPThreadsClause()
Build an empty clause.
OMPThreadsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'threads' clause.
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 clause 'to' in the 'pragma omp ...' directives.
friend class OMPClauseReader
static OMPToClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars variables.
const_child_range used_children() 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.
ArrayRef< SourceLocation > getMotionModifiersLoc() const LLVM_READONLY
Fetches ArrayRef of location of motion-modifiers.
Expr * getIteratorModifier() const
const_child_range children() const
SourceLocation getColonLoc() const
Get colon location.
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.
bool isExtensionActive(llvm::omp::TraitProperty TP)
Check the extension trait TP is active.
bool anyScoreOrCondition(llvm::function_ref< bool(Expr *&, bool)> Cond)
std::string getMangledName() const
Return a string representation identifying this context selector.
void print(llvm::raw_ostream &OS, const PrintingPolicy &Policy) const
Print a human readable representation into OS.
void getAsVariantMatchInfo(ASTContext &ASTCtx, llvm::omp::VariantMatchInfo &VMI) const
Create a variant match info object from this trait info object.
llvm::SmallVector< OMPTraitSet, 2 > Sets
The outermost level of selector sets.
friend class OMPClauseReader
OMPUnifiedAddressClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'unified_address' clause.
OMPUnifiedAddressClause()
Build an empty clause.
OMPUnifiedSharedMemoryClause()
Build an empty clause.
friend class OMPClauseReader
static bool classof(const OMPClause *T)
const_child_range children() const
OMPUnifiedSharedMemoryClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'unified_shared_memory' clause.
const_child_range used_children() const
child_range used_children()
child_range used_children()
OMPUntiedClause()
Build an empty clause.
OMPUntiedClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'untied' clause.
static bool classof(const OMPClause *T)
const_child_range used_children() const
const_child_range children() const
friend class OMPClauseReader
const_child_range used_children() const
const_child_range children() const
OpenMPDependClauseKind getDependencyKind() const
Gets the dependence kind in clause for 'depobj' directive.
static OMPUpdateClause * CreateEmpty(const ASTContext &C, bool IsExtended)
Creates an empty clause with the place for N variables.
child_range used_children()
static bool classof(const OMPClause *T)
SourceLocation getLParenLoc() const
Gets the location of '(' in clause for 'depobj' directive.
SourceLocation getArgumentLoc() const
Gets the location of argument in clause for 'depobj' directive.
bool isExtended() const
Checks if the clause is the extended clauses for 'depobj' directive.
friend class OMPClauseReader
child_range used_children()
SourceLocation getVarLoc() const
Returns the location of the interop variable.
OMPUseClause()
Build an empty clause.
const_child_range used_children() const
const_child_range children() const
OMPUseClause(Expr *InteropVar, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Build 'use' clause with and interop variable expression InteropVar.
static bool classof(const OMPClause *T)
SourceLocation getLParenLoc() const
Returns the location of '('.
Expr * getInteropVar() const
Returns the interop variable.
This represents clause 'use_device_addr' in the 'pragma omp ...' directives.
friend class OMPClauseReader
const_child_range used_children() const
static bool classof(const OMPClause *T)
child_range used_children()
const_child_range children() const
static OMPUseDeviceAddrClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars variables.
This represents clause 'use_device_ptr' in the 'pragma omp ...' directives.
ArrayRef< const Expr * >::iterator private_copies_const_iterator
friend class OMPClauseReader
llvm::iterator_range< private_copies_const_iterator > private_copies_const_range
private_copies_const_range private_copies() const
const_child_range used_children() const
const_child_range children() const
llvm::iterator_range< inits_iterator > inits_range
MutableArrayRef< Expr * >::iterator inits_iterator
inits_const_range inits() const
static OMPUseDevicePtrClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars variables.
child_range used_children()
ArrayRef< const Expr * >::iterator inits_const_iterator
static bool classof(const OMPClause *T)
MutableArrayRef< Expr * >::iterator private_copies_iterator
private_copies_range private_copies()
llvm::iterator_range< inits_const_iterator > inits_const_range
llvm::iterator_range< private_copies_iterator > private_copies_range
static bool classof(const OMPClause *T)
friend class OMPClauseReader
SourceLocation getLParenLoc() const
Returns the location of '('.
child_range used_children()
const_child_range children() const
OMPUsesAllocatorsClause::Data getAllocatorData(unsigned I) const
Returns data for the specified allocator.
static OMPUsesAllocatorsClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N allocators.
unsigned getNumberOfAllocators() const
Returns number of allocators associated with the clause.
const_child_range used_children() const
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.
const_child_range used_children() const
OMPWeakClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'weak' clause.
static bool classof(const OMPClause *T)
child_range used_children()
OMPWeakClause()
Build an empty clause.
const_child_range children() const
OMPWriteClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'write' clause.
const_child_range used_children() const
child_range used_children()
static bool classof(const OMPClause *T)
const_child_range children() const
OMPWriteClause()
Build an empty clause.
ArrayRef< const Attr * > getAttrs() const
Returned the attributes parsed from this clause.
OMPXAttributeClause()
Build an empty clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
friend class OMPClauseReader
SourceLocation getLParenLoc() const
Returns the location of '('.
OMPXAttributeClause(ArrayRef< const Attr * > Attrs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'ompx_attribute' clause.
OMPXBareClause()=default
Build an empty clause.
OMPXBareClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'ompx_bare' clause.
friend class OMPClauseReader
OMPXDynCGroupMemClause(Expr *Size, Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'ompx_dyn_cgroup_mem' clause.
Expr * getSize()
Return the size expression.
Expr * getSize() const
Return the size expression.
OMPXDynCGroupMemClause()
Build an empty clause.
A (possibly-)qualified type.
Smart pointer class that efficiently represents Objective-C method names.
Encodes a location in the source.
Stmt - This represents one statement.
StmtIterator child_iterator
Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatem...
llvm::iterator_range< child_iterator > child_range
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
The JSON file list parser is used to communicate input to InstallAPI.
OpenMPOriginalSharingModifier
OpenMP 6.0 original sharing modifiers.
bool checkFailClauseParameter(OpenMPClauseKind FailClauseParameter)
Checks if the parameter to the fail clause in "#pragma atomic compare fail" is restricted only to mem...
OpenMPDefaultClauseVariableCategory
OpenMP variable-category for 'default' clause.
OpenMPDefaultmapClauseModifier
OpenMP modifiers for 'defaultmap' clause.
@ OMPC_DEFAULTMAP_MODIFIER_unknown
OpenMPOrderClauseModifier
OpenMP modifiers for 'order' clause.
@ OMPC_ORDER_MODIFIER_unknown
std::add_pointer_t< std::add_const_t< T > > const_ptr
OpenMPAtClauseKind
OpenMP attributes for 'at' clause.
OpenMPReductionClauseModifier
OpenMP modifiers for 'reduction' clause.
@ DeviceNum
'device_num' clause, allowed on 'init', 'shutdown', and 'set' constructs.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
@ OMPC_SCHEDULE_MODIFIER_unknown
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
@ OMPC_DIST_SCHEDULE_unknown
OpenMPDoacrossClauseModifier
OpenMP dependence types for 'doacross' clause.
static constexpr unsigned NumberOfOMPMapClauseModifiers
Number of allowed map-type-modifiers.
OpenMPDynGroupprivateClauseFallbackModifier
@ OMPC_DYN_GROUPPRIVATE_FALLBACK_unknown
@ Property
The type of a property.
OpenMPBindClauseKind
OpenMP bindings for the 'bind' clause.
const FunctionProtoType * T
OpenMPLastprivateModifier
OpenMP 'lastprivate' clause modifier.
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
OpenMPGrainsizeClauseModifier
OpenMPNumTasksClauseModifier
@ Type
The name was classified as a type.
OpenMPSeverityClauseKind
OpenMP attributes for 'severity' clause.
static constexpr unsigned NumberOfOMPMotionModifiers
Number of allowed motion-modifiers.
OpenMPMotionModifierKind
OpenMP modifier kind for 'to' or 'from' clause.
@ OMPC_MOTION_MODIFIER_unknown
OpenMPDefaultmapClauseKind
OpenMP attributes for 'defaultmap' clause.
@ OMPC_DEFAULTMAP_unknown
OpenMPAllocateClauseModifier
OpenMP modifiers for 'allocate' clause.
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
OpenMPDynGroupprivateClauseModifier
@ OMPC_DYN_GROUPPRIVATE_unknown
OpenMPNumThreadsClauseModifier
@ OMPC_NUMTHREADS_unknown
OpenMPAtomicDefaultMemOrderClauseKind
OpenMP attributes for 'atomic_default_mem_order' clause.
@ OMPC_ATOMIC_DEFAULT_MEM_ORDER_unknown
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ConceptReference *C)
Insertion operator for diagnostics.
U cast(CodeGen::Address addr)
OpenMPDeviceClauseModifier
OpenMP modifiers for 'device' clause.
OpenMPMapModifierKind
OpenMP modifier kind for 'map' clause.
@ OMPC_MAP_MODIFIER_unknown
llvm::omp::Clause OpenMPClauseKind
OpenMP clauses.
@ Other
Other implicit parameter.
OpenMPOrderClauseKind
OpenMP attributes for 'order' clause.
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
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
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
SourceLocation OmpAllMemoryLoc
Location of 'omp_all_memory'.
SourceLocation ColonLoc
Colon location.
OpenMPDependClauseKind DepKind
Dependency type (one of in, out, inout).
SourceLocation DepLoc
Dependency type location.
This structure contains all sizes needed for by an OMPMappableExprListClause.
unsigned NumComponentLists
Number of component lists.
OMPMappableExprListSizeTy(unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
unsigned NumVars
Number of expressions listed.
OMPMappableExprListSizeTy()=default
unsigned NumUniqueDeclarations
Number of unique base declarations.
unsigned NumComponents
Total number of expression components.
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
llvm::omp::TraitProperty Kind
StringRef RawString
The raw string as we parsed it.
llvm::omp::TraitSelector Kind
SmallVector< OMPTraitProperty, 1 > Properties
SmallVector< OMPTraitSelector, 2 > Selectors
Data for list of allocators.
SourceLocation LParenLoc
Locations of '(' and ')' symbols.
Expr * AllocatorTraits
Allocator traits.
Expr * Allocator
Allocator.
This structure contains most locations needed for by an OMPVarListClause.
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)
Describes how types, statements, expressions, and declarations should be printed.
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