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) {}
110template <OpenMPClauseKind ClauseKind>
117 :
OMPClause(ClauseKind, StartLoc, EndLoc) {}
139 return T->getClauseKind() == ClauseKind;
143template <OpenMPClauseKind ClauseKind,
class Base>
158 :
Base(ClauseKind, StartLoc, EndLoc), LParenLoc(LParenLoc), S(S) {}
163 template <
typename T>
T *
getStmtAs()
const {
return cast_or_null<T>(S); }
189 return T->getClauseKind() == ClauseKind;
199 Stmt *PreInit =
nullptr;
206 assert(
get(This) &&
"get is not tuned for pre-init.");
214 CaptureRegion = ThisRegion;
237 Expr *PostUpdate =
nullptr;
241 assert(
get(This) &&
"get is not tuned for post-update.");
294 :
OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
299 static_cast<T *
>(
this)->
template getTrailingObjects<Expr *>(), NumVars);
304 assert(VL.size() == NumVars &&
305 "Number of variables is not the same as the preallocated buffer");
306 std::copy(VL.begin(), VL.end(),
307 static_cast<T *
>(
this)->template getTrailingObjects<Expr *>());
340 static_cast<const T *
>(
this)->
template getTrailingObjects<Expr *>(),
414 static OMPAlignClause *
Create(
const ASTContext &
C, Expr *A,
415 SourceLocation StartLoc,
416 SourceLocation LParenLoc,
417 SourceLocation EndLoc);
432 private llvm::TrailingObjects<OMPAllocateClause, Expr *> {
435 friend TrailingObjects;
439 Expr *Allocator =
nullptr;
455 LParenLoc, EndLoc, N),
456 Allocator(Allocator), ColonLoc(ColonLoc) {}
467 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
469 void setAllocator(Expr *A) { Allocator = A; }
481 static OMPAllocateClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
482 SourceLocation LParenLoc, Expr *Allocator,
483 SourceLocation ColonLoc,
484 SourceLocation EndLoc, ArrayRef<Expr *> VL);
516 return T->getClauseKind() == llvm::omp::OMPC_allocate;
534 Stmt *Condition =
nullptr;
552 void setNameModifierLoc(SourceLocation
Loc) { NameModifierLoc =
Loc; }
555 void setColonLoc(SourceLocation
Loc) { ColonLoc =
Loc; }
576 ColonLoc(ColonLoc), NameModifier(NameModifier),
577 NameModifierLoc(NameModifierLoc) {
617 return T->getClauseKind() == llvm::omp::OMPC_if;
680 void setNumThreads(
Expr *NThreads) {
setStmt(NThreads); }
788 private llvm::TrailingObjects<OMPSizesClause, Expr *> {
801 NumSizes(NumSizes) {}
833 ->
template getTrailingObjects<Expr *>(),
838 ->
template getTrailingObjects<Expr *>(),
844 assert(VL.size() == NumSizes);
845 std::copy(VL.begin(), VL.end(),
847 ->template getTrailingObjects<Expr *>());
853 reinterpret_cast<Stmt **
>(Sizes.end()));
858 reinterpret_cast<Stmt *
const *
>(Sizes.end()));
869 return T->getClauseKind() == llvm::omp::OMPC_sizes;
920 void setFactor(Expr *E) { Factor = E; }
923 void setLParenLoc(SourceLocation
Loc) { LParenLoc =
Loc; }
933 static OMPPartialClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
934 SourceLocation LParenLoc,
935 SourceLocation EndLoc, Expr *Factor);
940 static OMPPartialClause *
CreateEmpty(
const ASTContext &
C);
961 return T->getClauseKind() == llvm::omp::OMPC_partial;
1015 llvm::omp::DefaultKind Kind = llvm::omp::OMP_DEFAULT_unknown;
1023 void setDefaultKind(llvm::omp::DefaultKind K) { Kind = K; }
1028 void setDefaultKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
1042 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {}
1077 return T->getClauseKind() == llvm::omp::OMPC_default;
1096 llvm::omp::ProcBindKind Kind = llvm::omp::OMP_PROC_BIND_unknown;
1104 void setProcBindKind(llvm::omp::ProcBindKind K) { Kind = K; }
1109 void setProcBindKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
1124 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {}
1159 return T->getClauseKind() == llvm::omp::OMPC_proc_bind;
1202 :
OMPClause(
llvm::omp::OMPC_unified_shared_memory, StartLoc, EndLoc) {}
1225 return T->getClauseKind() == llvm::omp::OMPC_unified_shared_memory;
1245 :
OMPClause(
llvm::omp::OMPC_reverse_offload, StartLoc, EndLoc) {}
1268 return T->getClauseKind() == llvm::omp::OMPC_reverse_offload;
1288 :
OMPClause(
llvm::omp::OMPC_dynamic_allocators, StartLoc, EndLoc) {}
1311 return T->getClauseKind() == llvm::omp::OMPC_dynamic_allocators;
1363 :
OMPClause(
llvm::omp::OMPC_atomic_default_mem_order, StartLoc, EndLoc),
1364 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {}
1401 return T->getClauseKind() == llvm::omp::OMPC_atomic_default_mem_order;
1435 void setLParenLoc(SourceLocation
Loc) { LParenLoc =
Loc; }
1448 :
OMPClause(
llvm::omp::OMPC_at, StartLoc, EndLoc), LParenLoc(LParenLoc),
1449 Kind(A), KindKwLoc(ALoc) {}
1480 return T->getClauseKind() == llvm::omp::OMPC_at;
1511 void setSeverityKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
1514 void setLParenLoc(SourceLocation
Loc) { LParenLoc =
Loc; }
1528 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {}
1560 return T->getClauseKind() == llvm::omp::OMPC_severity;
1578 Stmt *MessageString =
nullptr;
1581 void setMessageString(
Expr *MS) { MessageString = MS; }
1596 LParenLoc(LParenLoc), MessageString(MS) {}
1610 return child_range(&MessageString, &MessageString + 1);
1626 return T->getClauseKind() == llvm::omp::OMPC_message;
1647 enum {FIRST, SECOND, NUM_MODIFIERS};
1660 Expr *ChunkSize =
nullptr;
1671 Modifiers[FIRST] = M;
1678 Modifiers[SECOND] = M;
1682 void setFirstScheduleModifierLoc(SourceLocation
Loc) {
1683 ModifiersLoc[FIRST] =
Loc;
1687 void setSecondScheduleModifierLoc(SourceLocation
Loc) {
1688 ModifiersLoc[SECOND] =
Loc;
1696 Modifiers[FIRST] = M;
1699 Modifiers[SECOND] = M;
1706 void setLParenLoc(SourceLocation
Loc) { LParenLoc =
Loc; }
1711 void setScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
1716 void setCommaLoc(SourceLocation
Loc) { CommaLoc =
Loc; }
1721 void setChunkSize(Expr *E) { ChunkSize = E; }
1742 Expr *ChunkSize,
Stmt *HelperChunkSize,
1747 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
1749 Modifiers[FIRST] = M1;
1750 Modifiers[SECOND] = M2;
1751 ModifiersLoc[FIRST] = M1Loc;
1752 ModifiersLoc[SECOND] = M2Loc;
1768 return Modifiers[FIRST];
1773 return Modifiers[SECOND];
1784 return ModifiersLoc[FIRST];
1789 return ModifiersLoc[SECOND];
1803 reinterpret_cast<Stmt **
>(&ChunkSize) + 1);
1819 return T->getClauseKind() == llvm::omp::OMPC_schedule;
1832 private llvm::TrailingObjects<OMPOrderedClause, Expr *> {
1834 friend TrailingObjects;
1840 Stmt *NumForLoops =
nullptr;
1843 unsigned NumberOfLoops = 0;
1855 LParenLoc(LParenLoc), NumForLoops(Num), NumberOfLoops(NumLoops) {}
1860 NumberOfLoops(NumLoops) {}
1863 void setNumForLoops(Expr *Num) { NumForLoops = Num; }
1873 static OMPOrderedClause *
Create(
const ASTContext &
C, Expr *Num,
1874 unsigned NumLoops, SourceLocation StartLoc,
1875 SourceLocation LParenLoc,
1876 SourceLocation EndLoc);
1879 static OMPOrderedClause*
CreateEmpty(
const ASTContext &
C,
unsigned NumLoops);
1915 return T->getClauseKind() == llvm::omp::OMPC_ordered;
1971 return T->getClauseKind() == llvm::omp::OMPC_untied;
2012 return T->getClauseKind() == llvm::omp::OMPC_mergeable;
2051 return T->getClauseKind() == llvm::omp::OMPC_read;
2090 return T->getClauseKind() == llvm::omp::OMPC_write;
2111 private llvm::TrailingObjects<OMPUpdateClause, SourceLocation,
2112 OpenMPDependClauseKind> {
2114 friend TrailingObjects;
2117 bool IsExtended =
false;
2121 size_t numTrailingObjects(OverloadToken<SourceLocation>)
const {
2123 return IsExtended ? 2 : 0;
2128 assert(IsExtended &&
"Expected extended clause.");
2129 *getTrailingObjects<SourceLocation>() =
Loc;
2133 void setArgumentLoc(SourceLocation
Loc) {
2134 assert(IsExtended &&
"Expected extended clause.");
2135 *std::next(getTrailingObjects<SourceLocation>(), 1) =
Loc;
2140 assert(IsExtended &&
"Expected extended clause.");
2141 *getTrailingObjects<OpenMPDependClauseKind>() = DK;
2148 OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc,
2151 IsExtended(IsExtended) {}
2154 OMPUpdateClause(
bool IsExtended)
2155 :
OMPClause(
llvm::omp::OMPC_update, SourceLocation(), SourceLocation()),
2156 IsExtended(IsExtended) {}
2164 static OMPUpdateClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
2165 SourceLocation EndLoc);
2175 static OMPUpdateClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
2176 SourceLocation LParenLoc,
2177 SourceLocation ArgumentLoc,
2179 SourceLocation EndLoc);
2186 static OMPUpdateClause *
CreateEmpty(
const ASTContext &
C,
bool IsExtended);
2208 assert(IsExtended &&
"Expected extended clause.");
2209 return *getTrailingObjects<SourceLocation>();
2214 assert(IsExtended &&
"Expected extended clause.");
2215 return *std::next(getTrailingObjects<SourceLocation>(), 1);
2220 assert(IsExtended &&
"Expected extended clause.");
2221 return *getTrailingObjects<OpenMPDependClauseKind>();
2225 return T->getClauseKind() == llvm::omp::OMPC_update;
2266 return T->getClauseKind() == llvm::omp::OMPC_capture;
2307 return T->getClauseKind() == llvm::omp::OMPC_compare;
2348 return T->getClauseKind() == llvm::omp::OMPC_seq_cst;
2389 return T->getClauseKind() == llvm::omp::OMPC_acq_rel;
2430 return T->getClauseKind() == llvm::omp::OMPC_acquire;
2471 return T->getClauseKind() == llvm::omp::OMPC_release;
2512 return T->getClauseKind() == llvm::omp::OMPC_relaxed;
2552 return T->getClauseKind() == llvm::omp::OMPC_weak;
2581 this->FailParameter = FailParameter;
2583 "Invalid fail clause parameter");
2598 FailParameterLoc(FailParameterLoc), LParenLoc(LParenLoc) {
2600 setFailParameter(FailParameter);
2623 return T->getClauseKind() == llvm::omp::OMPC_fail;
2648 private llvm::TrailingObjects<OMPPrivateClause, Expr *> {
2651 friend TrailingObjects;
2662 LParenLoc, EndLoc, N) {}
2675 void setPrivateCopies(ArrayRef<Expr *> VL);
2679 MutableArrayRef<Expr *> getPrivateCopies() {
2682 ArrayRef<const Expr *> getPrivateCopies()
const {
2695 static OMPPrivateClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
2696 SourceLocation LParenLoc,
2697 SourceLocation EndLoc, ArrayRef<Expr *> VL,
2698 ArrayRef<Expr *> PrivateVL);
2704 static OMPPrivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
2710 llvm::iterator_range<private_copies_const_iterator>;
2714 getPrivateCopies().end());
2719 getPrivateCopies().end());
2740 return T->getClauseKind() == llvm::omp::OMPC_private;
2755 private llvm::TrailingObjects<OMPFirstprivateClause, Expr *> {
2758 friend TrailingObjects;
2769 StartLoc, LParenLoc, EndLoc, N),
2784 void setPrivateCopies(ArrayRef<Expr *> VL);
2788 MutableArrayRef<Expr *> getPrivateCopies() {
2791 ArrayRef<const Expr *> getPrivateCopies()
const {
2798 void setInits(ArrayRef<Expr *> VL);
2802 MutableArrayRef<Expr *> getInits() {
2803 return MutableArrayRef<Expr *>(getPrivateCopies().end(),
varlist_size());
2805 ArrayRef<const Expr *> getInits()
const {
2823 static OMPFirstprivateClause *
2824 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
2825 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PrivateVL,
2826 ArrayRef<Expr *> InitVL, Stmt *PreInit);
2832 static OMPFirstprivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
2838 llvm::iterator_range<private_copies_const_iterator>;
2842 getPrivateCopies().end());
2846 getPrivateCopies().end());
2855 return inits_range(getInits().begin(), getInits().end());
2881 return T->getClauseKind() == llvm::omp::OMPC_firstprivate;
2896 private llvm::TrailingObjects<OMPLastprivateClause, Expr *> {
2915 friend TrailingObjects;
2935 StartLoc, LParenLoc, EndLoc, N),
2937 ColonLoc(ColonLoc) {}
2950 MutableArrayRef<Expr *> getPrivateCopies() {
2953 ArrayRef<const Expr *> getPrivateCopies()
const {
2961 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
2964 MutableArrayRef<Expr *> getSourceExprs() {
2965 return MutableArrayRef<Expr *>(getPrivateCopies().end(),
varlist_size());
2967 ArrayRef<const Expr *> getSourceExprs()
const {
2975 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
2978 MutableArrayRef<Expr *> getDestinationExprs() {
2979 return MutableArrayRef<Expr *>(getSourceExprs().end(),
varlist_size());
2981 ArrayRef<const Expr *> getDestinationExprs()
const {
2988 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
2991 MutableArrayRef<Expr *> getAssignmentOps() {
2992 return MutableArrayRef<Expr *>(getDestinationExprs().end(),
varlist_size());
2994 ArrayRef<const Expr *> getAssignmentOps()
const {
3001 void setKindLoc(SourceLocation
Loc) { LPKindLoc =
Loc; }
3003 void setColonLoc(SourceLocation
Loc) { ColonLoc =
Loc; }
3033 static OMPLastprivateClause *
3034 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
3035 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
3036 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps,
3038 SourceLocation ColonLoc, Stmt *PreInit, Expr *PostUpdate);
3044 static OMPLastprivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
3057 llvm::iterator_range<helper_expr_const_iterator>;
3065 getPrivateCopies().end());
3070 getPrivateCopies().end());
3075 getSourceExprs().end());
3084 getDestinationExprs().end());
3089 getDestinationExprs().end());
3094 getAssignmentOps().end());
3099 getAssignmentOps().end());
3120 return T->getClauseKind() == llvm::omp::OMPC_lastprivate;
3133 private llvm::TrailingObjects<OMPSharedClause, Expr *> {
3135 friend TrailingObjects;
3146 LParenLoc, EndLoc, N) {}
3192 return T->getClauseKind() == llvm::omp::OMPC_shared;
3207 private llvm::TrailingObjects<OMPReductionClause, Expr *> {
3210 friend TrailingObjects;
3244 StartLoc, LParenLoc, EndLoc, N),
3246 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc),
3247 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
3262 void setModifierLoc(SourceLocation
Loc) { ModifierLoc =
Loc; }
3265 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
3268 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
3271 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
3276 void setPrivates(ArrayRef<Expr *> Privates);
3279 MutableArrayRef<Expr *> getPrivates() {
3282 ArrayRef<const Expr *> getPrivates()
const {
3289 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
3292 MutableArrayRef<Expr *> getLHSExprs() {
3293 return MutableArrayRef<Expr *>(getPrivates().end(),
varlist_size());
3295 ArrayRef<const Expr *> getLHSExprs()
const {
3304 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
3307 MutableArrayRef<Expr *> getRHSExprs() {
3308 return MutableArrayRef<Expr *>(getLHSExprs().end(),
varlist_size());
3310 ArrayRef<const Expr *> getRHSExprs()
const {
3318 void setReductionOps(ArrayRef<Expr *> ReductionOps);
3321 MutableArrayRef<Expr *> getReductionOps() {
3322 return MutableArrayRef<Expr *>(getRHSExprs().end(),
varlist_size());
3324 ArrayRef<const Expr *> getReductionOps()
const {
3330 void setInscanCopyOps(ArrayRef<Expr *> Ops);
3333 MutableArrayRef<Expr *> getInscanCopyOps() {
3334 return MutableArrayRef<Expr *>(getReductionOps().end(),
varlist_size());
3336 ArrayRef<const Expr *> getInscanCopyOps()
const {
3341 void setInscanCopyArrayTemps(ArrayRef<Expr *> CopyArrayTemps);
3344 MutableArrayRef<Expr *> getInscanCopyArrayTemps() {
3345 return MutableArrayRef<Expr *>(getInscanCopyOps().end(),
varlist_size());
3347 ArrayRef<const Expr *> getInscanCopyArrayTemps()
const {
3352 void setInscanCopyArrayElems(ArrayRef<Expr *> CopyArrayElems);
3355 MutableArrayRef<Expr *> getInscanCopyArrayElems() {
3356 return MutableArrayRef<Expr *>(getInscanCopyArrayTemps().end(),
3359 ArrayRef<const Expr *> getInscanCopyArrayElems()
const {
3403 static OMPReductionClause *
3404 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
3405 SourceLocation ModifierLoc, SourceLocation ColonLoc,
3407 ArrayRef<Expr *> VL, NestedNameSpecifierLoc QualifierLoc,
3408 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
3409 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
3410 ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> CopyOps,
3411 ArrayRef<Expr *> CopyArrayTemps, ArrayRef<Expr *> CopyArrayElems,
3412 Stmt *PreInit, Expr *PostUpdate);
3419 static OMPReductionClause *
3442 llvm::iterator_range<helper_expr_const_iterator>;
3470 getReductionOps().end());
3475 getReductionOps().end());
3480 getInscanCopyOps().end());
3485 getInscanCopyOps().end());
3490 getInscanCopyArrayTemps().end());
3495 getInscanCopyArrayTemps().end());
3500 getInscanCopyArrayElems().end());
3505 getInscanCopyArrayElems().end());
3528 return T->getClauseKind() == llvm::omp::OMPC_reduction;
3543 private llvm::TrailingObjects<OMPTaskReductionClause, Expr *> {
3546 friend TrailingObjects;
3571 llvm::omp::OMPC_task_reduction, StartLoc, LParenLoc, EndLoc, N),
3573 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
3585 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
3588 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
3591 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
3595 void setPrivates(ArrayRef<Expr *> Privates);
3598 MutableArrayRef<Expr *> getPrivates() {
3601 ArrayRef<const Expr *> getPrivates()
const {
3608 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
3611 MutableArrayRef<Expr *> getLHSExprs() {
3612 return MutableArrayRef<Expr *>(getPrivates().end(),
varlist_size());
3614 ArrayRef<const Expr *> getLHSExprs()
const {
3622 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
3625 MutableArrayRef<Expr *> getRHSExprs() {
3626 return MutableArrayRef<Expr *>(getLHSExprs().end(),
varlist_size());
3628 ArrayRef<const Expr *> getRHSExprs()
const {
3636 void setReductionOps(ArrayRef<Expr *> ReductionOps);
3639 MutableArrayRef<Expr *> getReductionOps() {
3640 return MutableArrayRef<Expr *>(getRHSExprs().end(),
varlist_size());
3642 ArrayRef<const Expr *> getReductionOps()
const {
3679 static OMPTaskReductionClause *
3680 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
3681 SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
3682 NestedNameSpecifierLoc QualifierLoc,
3683 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
3684 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
3685 ArrayRef<Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate);
3691 static OMPTaskReductionClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
3706 llvm::iterator_range<helper_expr_const_iterator>;
3734 getReductionOps().end());
3739 getReductionOps().end());
3760 return T->getClauseKind() == llvm::omp::OMPC_task_reduction;
3774 private llvm::TrailingObjects<OMPInReductionClause, Expr *> {
3777 friend TrailingObjects;
3802 StartLoc, LParenLoc, EndLoc, N),
3804 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
3816 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
3819 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
3822 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
3826 void setPrivates(ArrayRef<Expr *> Privates);
3829 MutableArrayRef<Expr *> getPrivates() {
3832 ArrayRef<const Expr *> getPrivates()
const {
3839 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
3842 MutableArrayRef<Expr *> getLHSExprs() {
3843 return MutableArrayRef<Expr *>(getPrivates().end(),
varlist_size());
3845 ArrayRef<const Expr *> getLHSExprs()
const {
3853 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
3856 MutableArrayRef<Expr *> getRHSExprs() {
3857 return MutableArrayRef<Expr *>(getLHSExprs().end(),
varlist_size());
3859 ArrayRef<const Expr *> getRHSExprs()
const {
3867 void setReductionOps(ArrayRef<Expr *> ReductionOps);
3870 MutableArrayRef<Expr *> getReductionOps() {
3871 return MutableArrayRef<Expr *>(getRHSExprs().end(),
varlist_size());
3873 ArrayRef<const Expr *> getReductionOps()
const {
3878 void setTaskgroupDescriptors(ArrayRef<Expr *> ReductionOps);
3881 MutableArrayRef<Expr *> getTaskgroupDescriptors() {
3882 return MutableArrayRef<Expr *>(getReductionOps().end(),
varlist_size());
3884 ArrayRef<const Expr *> getTaskgroupDescriptors()
const {
3923 static OMPInReductionClause *
3924 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
3925 SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
3926 NestedNameSpecifierLoc QualifierLoc,
3927 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
3928 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
3929 ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> TaskgroupDescriptors,
3930 Stmt *PreInit, Expr *PostUpdate);
3936 static OMPInReductionClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
3951 llvm::iterator_range<helper_expr_const_iterator>;
3979 getReductionOps().end());
3984 getReductionOps().end());
3989 getTaskgroupDescriptors().end());
3994 getTaskgroupDescriptors().end());
4015 return T->getClauseKind() == llvm::omp::OMPC_in_reduction;
4030 private llvm::TrailingObjects<OMPLinearClause, Expr *> {
4033 friend TrailingObjects;
4048 void setStep(
Expr *Step) { *(getFinals().end()) = Step; }
4051 void setCalcStep(
Expr *CalcStep) { *(getFinals().end() + 1) = CalcStep; }
4061 OMPLinearClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4063 SourceLocation ColonLoc, SourceLocation StepModifierLoc,
4064 SourceLocation EndLoc,
unsigned NumVars)
4065 : OMPVarListClause<OMPLinearClause>(
llvm::omp::OMPC_linear, StartLoc,
4066 LParenLoc, EndLoc, NumVars),
4067 OMPClauseWithPostUpdate(this), Modifier(Modifier),
4068 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc),
4069 StepModifierLoc(StepModifierLoc) {}
4074 explicit OMPLinearClause(
unsigned NumVars)
4075 : OMPVarListClause<OMPLinearClause>(
llvm::omp::OMPC_linear,
4076 SourceLocation(), SourceLocation(),
4077 SourceLocation(), NumVars),
4092 MutableArrayRef<Expr *> getPrivates() {
4095 ArrayRef<const Expr *> getPrivates()
const {
4099 MutableArrayRef<Expr *> getInits() {
4100 return MutableArrayRef<Expr *>(getPrivates().end(),
varlist_size());
4102 ArrayRef<const Expr *> getInits()
const {
4107 MutableArrayRef<Expr *> getUpdates() {
4108 return MutableArrayRef<Expr *>(getInits().end(),
varlist_size());
4110 ArrayRef<const Expr *> getUpdates()
const {
4115 MutableArrayRef<Expr *> getFinals() {
4116 return MutableArrayRef<Expr *>(getUpdates().end(),
varlist_size());
4118 ArrayRef<const Expr *> getFinals()
const {
4123 MutableArrayRef<Expr *> getUsedExprs() {
4124 return MutableArrayRef<Expr *>(getFinals().end() + 2,
varlist_size() + 1);
4126 ArrayRef<const Expr *> getUsedExprs()
const {
4132 void setPrivates(ArrayRef<Expr *> PL);
4136 void setInits(ArrayRef<Expr *> IL);
4159 static OMPLinearClause *
4160 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
4162 SourceLocation ColonLoc, SourceLocation StepModifierLoc,
4163 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PL,
4164 ArrayRef<Expr *> IL, Expr *Step, Expr *CalcStep, Stmt *PreInit,
4171 static OMPLinearClause *
CreateEmpty(
const ASTContext &
C,
unsigned NumVars);
4226 return privates_range(getPrivates().begin(), getPrivates().end());
4239 return inits_range(getInits().begin(), getInits().end());
4252 return updates_range(getUpdates().begin(), getUpdates().end());
4265 return finals_range(getFinals().begin(), getFinals().end());
4275 llvm::iterator_range<used_expressions_iterator>;
4277 llvm::iterator_range<used_expressions_const_iterator>;
4280 return finals_range(getUsedExprs().begin(), getUsedExprs().end());
4305 return T->getClauseKind() == llvm::omp::OMPC_linear;
4319 private llvm::TrailingObjects<OMPAlignedClause, Expr *> {
4322 friend TrailingObjects;
4341 LParenLoc, EndLoc, NumVars),
4342 ColonLoc(ColonLoc) {}
4347 explicit OMPAlignedClause(
unsigned NumVars)
4348 : OMPVarListClause<OMPAlignedClause>(
llvm::omp::OMPC_aligned,
4349 SourceLocation(), SourceLocation(),
4350 SourceLocation(), NumVars) {}
4362 static OMPAlignedClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
4363 SourceLocation LParenLoc,
4364 SourceLocation ColonLoc,
4365 SourceLocation EndLoc, ArrayRef<Expr *> VL,
4372 static OMPAlignedClause *
CreateEmpty(
const ASTContext &
C,
unsigned NumVars);
4404 return T->getClauseKind() == llvm::omp::OMPC_aligned;
4417 private llvm::TrailingObjects<OMPCopyinClause, Expr *> {
4433 friend TrailingObjects;
4444 LParenLoc, EndLoc, N) {}
4457 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
4460 MutableArrayRef<Expr *> getSourceExprs() {
4463 ArrayRef<const Expr *> getSourceExprs()
const {
4470 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
4473 MutableArrayRef<Expr *> getDestinationExprs() {
4474 return MutableArrayRef<Expr *>(getSourceExprs().end(),
varlist_size());
4476 ArrayRef<const Expr *> getDestinationExprs()
const {
4484 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
4487 MutableArrayRef<Expr *> getAssignmentOps() {
4488 return MutableArrayRef<Expr *>(getDestinationExprs().end(),
varlist_size());
4490 ArrayRef<const Expr *> getAssignmentOps()
const {
4516 static OMPCopyinClause *
4517 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
4518 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
4519 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
4525 static OMPCopyinClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
4531 llvm::iterator_range<helper_expr_const_iterator>;
4535 getSourceExprs().end());
4544 getDestinationExprs().end());
4549 getDestinationExprs().end());
4554 getAssignmentOps().end());
4559 getAssignmentOps().end());
4580 return T->getClauseKind() == llvm::omp::OMPC_copyin;
4594 private llvm::TrailingObjects<OMPCopyprivateClause, Expr *> {
4597 friend TrailingObjects;
4608 StartLoc, LParenLoc, EndLoc, N) {
4622 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
4625 MutableArrayRef<Expr *> getSourceExprs() {
4628 ArrayRef<const Expr *> getSourceExprs()
const {
4635 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
4638 MutableArrayRef<Expr *> getDestinationExprs() {
4639 return MutableArrayRef<Expr *>(getSourceExprs().end(),
varlist_size());
4641 ArrayRef<const Expr *> getDestinationExprs()
const {
4649 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
4652 MutableArrayRef<Expr *> getAssignmentOps() {
4653 return MutableArrayRef<Expr *>(getDestinationExprs().end(),
varlist_size());
4655 ArrayRef<const Expr *> getAssignmentOps()
const {
4680 static OMPCopyprivateClause *
4681 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
4682 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
4683 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
4689 static OMPCopyprivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
4695 llvm::iterator_range<helper_expr_const_iterator>;
4699 getSourceExprs().end());
4708 getDestinationExprs().end());
4713 getDestinationExprs().end());
4718 getAssignmentOps().end());
4723 getAssignmentOps().end());
4744 return T->getClauseKind() == llvm::omp::OMPC_copyprivate;
4762 private llvm::TrailingObjects<OMPFlushClause, Expr *> {
4764 friend TrailingObjects;
4775 LParenLoc, EndLoc, N) {}
4821 return T->getClauseKind() == llvm::omp::OMPC_flush;
4844 Expr *Depobj =
nullptr;
4854 LParenLoc(LParenLoc) {}
4861 void setDepobj(Expr *E) { Depobj = E; }
4864 void setLParenLoc(SourceLocation
Loc) { LParenLoc =
Loc; }
4874 static OMPDepobjClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
4875 SourceLocation LParenLoc,
4876 SourceLocation EndLoc, Expr *Depobj);
4881 static OMPDepobjClause *
CreateEmpty(
const ASTContext &
C);
4892 reinterpret_cast<Stmt **
>(&Depobj) + 1);
4908 return T->getClauseKind() == llvm::omp::OMPC_depobj;
4922 private llvm::TrailingObjects<OMPDependClause, Expr *> {
4925 friend TrailingObjects;
4947 unsigned NumLoops = 0;
4960 LParenLoc, EndLoc, N),
4961 NumLoops(NumLoops) {}
4972 NumLoops(NumLoops) {}
4978 void setDependencyLoc(SourceLocation
Loc) {
Data.DepLoc =
Loc; }
4981 void setColonLoc(SourceLocation
Loc) {
Data.ColonLoc =
Loc; }
4984 void setOmpAllMemoryLoc(SourceLocation
Loc) {
Data.OmpAllMemoryLoc =
Loc; }
4987 void setModifier(Expr *DepModifier);
5000 static OMPDependClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
5001 SourceLocation LParenLoc,
5002 SourceLocation EndLoc, DependDataTy Data,
5003 Expr *DepModifier, ArrayRef<Expr *> VL,
5012 static OMPDependClause *
CreateEmpty(
const ASTContext &
C,
unsigned N,
5062 return T->getClauseKind() == llvm::omp::OMPC_depend;
5087 Stmt *Device =
nullptr;
5098 void setModifierLoc(SourceLocation
Loc) { ModifierLoc =
Loc; }
5117 ModifierLoc(ModifierLoc),
Device(E) {
5158 return T->getClauseKind() == llvm::omp::OMPC_device;
5217 return T->getClauseKind() == llvm::omp::OMPC_simd;
5234 llvm::PointerIntPair<Expr *, 1, bool> AssociatedExpressionNonContiguousPr;
5239 ValueDecl *AssociatedDeclaration =
nullptr;
5245 bool IsNonContiguous)
5246 : AssociatedExpressionNonContiguousPr(AssociatedExpression,
5248 AssociatedDeclaration(
5249 AssociatedDeclaration
5254 return AssociatedExpressionNonContiguousPr.getPointer();
5258 return AssociatedExpressionNonContiguousPr.getInt();
5262 return AssociatedDeclaration;
5316 unsigned NumUniqueDeclarations;
5319 unsigned NumComponentLists;
5322 unsigned NumComponents;
5327 const bool SupportsMapper;
5361 NumUniqueDeclarations(Sizes.NumUniqueDeclarations),
5362 NumComponentLists(Sizes.NumComponentLists),
5363 NumComponents(Sizes.NumComponents), SupportsMapper(SupportsMapper) {
5364 if (MapperQualifierLocPtr)
5365 MapperQualifierLoc = *MapperQualifierLocPtr;
5366 if (MapperIdInfoPtr)
5367 MapperIdInfo = *MapperIdInfoPtr;
5374 static_cast<T *
>(
this)->
template getTrailingObjects<ValueDecl *>(),
5375 NumUniqueDeclarations);
5382 static_cast<const T *
>(
this)
5383 ->
template getTrailingObjects<ValueDecl *>(),
5384 NumUniqueDeclarations);
5390 assert(UDs.size() == NumUniqueDeclarations &&
5391 "Unexpected amount of unique declarations.");
5399 static_cast<T *
>(
this)->
template getTrailingObjects<unsigned>(),
5400 NumUniqueDeclarations);
5407 static_cast<const T *
>(
this)->
template getTrailingObjects<unsigned>(),
5408 NumUniqueDeclarations);
5414 assert(DNLs.size() == NumUniqueDeclarations &&
5415 "Unexpected amount of list numbers.");
5423 static_cast<T *
>(
this)->
template getTrailingObjects<unsigned>() +
5424 NumUniqueDeclarations,
5432 static_cast<const T *
>(
this)->
template getTrailingObjects<unsigned>() +
5433 NumUniqueDeclarations,
5440 assert(CLSs.size() == NumComponentLists &&
5441 "Unexpected amount of component lists.");
5448 static_cast<T *
>(
this)
5449 ->
template getTrailingObjects<MappableComponent>(),
5456 static_cast<const T *
>(
this)
5457 ->
template getTrailingObjects<MappableComponent>(),
5466 assert(Components.size() == NumComponents &&
5467 "Unexpected amount of component lists.");
5468 assert(CLSs.size() == NumComponentLists &&
5469 "Unexpected amount of list sizes.");
5470 std::copy(Components.begin(), Components.end(),
getComponentsRef().begin());
5480 NumUniqueDeclarations &&
5481 "Unexpected number of mappable expression info entries!");
5483 "Unexpected total number of components!");
5484 assert(Declarations.size() == ComponentLists.size() &&
5485 "Declaration and component lists size is not consistent!");
5486 assert(Declarations.size() == NumComponentLists &&
5487 "Unexpected declaration and component lists size!");
5492 llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
5495 auto CI = ComponentLists.begin();
5496 for (
auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
5498 assert(!CI->empty() &&
"Invalid component list!");
5499 ComponentListMap[*DI].push_back(*CI);
5505 auto UDI = UniqueDeclarations.begin();
5508 auto DNLI = DeclNumLists.begin();
5511 auto CLSI = ComponentListSizes.begin();
5514 auto CI = Components.begin();
5517 unsigned PrevSize = 0u;
5520 for (
auto &M : ComponentListMap) {
5537 PrevSize +=
C.size();
5544 CI = std::copy(
C.begin(),
C.end(), CI);
5551 MapperQualifierLoc = NNSL;
5556 MapperIdInfo = MapperId;
5562 assert(SupportsMapper &&
5563 "Must be a clause that is possible to have user-defined mappers");
5565 static_cast<T *
>(
this)->
template getTrailingObjects<Expr *>() +
5573 assert(SupportsMapper &&
5574 "Must be a clause that is possible to have user-defined mappers");
5576 static_cast<const T *
>(
this)->
template getTrailingObjects<Expr *>() +
5585 "Unexpected number of user-defined mappers.");
5586 assert(SupportsMapper &&
5587 "Must be a clause that is possible to have user-defined mappers");
5604 return MapperQualifierLoc;
5613 :
public llvm::iterator_adaptor_base<
5614 const_component_lists_iterator,
5615 MappableExprComponentListRef::const_iterator,
5616 std::forward_iterator_tag, MappableComponent, ptrdiff_t,
5617 MappableComponent, MappableComponent> {
5625 const bool SupportsMapper;
5631 unsigned RemainingLists = 0;
5635 unsigned PrevListSize = 0;
5643 MappableExprComponentListRef::const_iterator End;
5653 Components.begin()),
5654 DeclCur(UniqueDecls.begin()), NumListsCur(DeclsListNum.begin()),
5655 SupportsMapper(SupportsMapper),
5656 ListSizeCur(CumulativeListSizes.begin()),
5657 ListSizeEnd(CumulativeListSizes.end()), End(Components.end()) {
5658 assert(UniqueDecls.size() == DeclsListNum.size() &&
5659 "Inconsistent number of declarations and list sizes!");
5660 if (!DeclsListNum.empty())
5661 RemainingLists = *NumListsCur;
5663 MapperCur = Mappers.begin();
5674 CumulativeListSizes, Components,
5675 SupportsMapper, Mappers) {
5679 for (; DeclCur != UniqueDecls.end(); ++DeclCur, ++NumListsCur) {
5683 assert(*NumListsCur > 0 &&
"No lists associated with declaration??");
5687 std::advance(ListSizeCur, *NumListsCur - 1);
5688 PrevListSize = *ListSizeCur;
5697 if (ListSizeCur == CumulativeListSizes.end()) {
5699 RemainingLists = 0u;
5705 RemainingLists = *NumListsCur;
5708 ListSizeEnd = ListSizeCur;
5709 std::advance(ListSizeEnd, RemainingLists);
5713 std::advance(this->I, PrevListSize);
5721 assert(ListSizeCur != ListSizeEnd &&
"Invalid iterator!");
5723 if (SupportsMapper && *MapperCur)
5724 Mapper = cast<ValueDecl>(cast<DeclRefExpr>(*MapperCur)->getDecl());
5725 return std::make_tuple(
5738 assert(ListSizeCur != ListSizeEnd && RemainingLists &&
5739 "Invalid iterator!");
5743 if (std::next(ListSizeCur) == ListSizeEnd) {
5747 std::advance(this->I, *ListSizeCur - PrevListSize);
5748 PrevListSize = *ListSizeCur;
5751 if (!(--RemainingLists)) {
5754 RemainingLists = *NumListsCur;
5755 assert(RemainingLists &&
"No lists in the following declaration??");
5767 llvm::iterator_range<const_component_lists_iterator>;
5781 SupportsMapper, std::nullopt);
5789 const_component_lists_iterator
5815 llvm::iterator_range<const_all_num_lists_iterator>;
5824 llvm::iterator_range<const_all_lists_sizes_iterator>;
5833 llvm::iterator_range<const_all_components_iterator>;
5844 llvm::iterator_range<mapperlist_const_iterator>;
5871 private llvm::TrailingObjects<
5872 OMPMapClause, Expr *, ValueDecl *, unsigned,
5873 OMPClauseMappableExprCommon::MappableComponent> {
5877 friend TrailingObjects;
5881 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
5886 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
5889 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
5907 bool MapTypeIsImplicit =
false;
5910 SourceLocation MapLoc;
5913 SourceLocation ColonLoc;
5935 explicit OMPMapClause(ArrayRef<OpenMPMapModifierKind> MapModifiers,
5936 ArrayRef<SourceLocation> MapModifiersLoc,
5937 NestedNameSpecifierLoc MapperQualifierLoc,
5938 DeclarationNameInfo MapperIdInfo,
5940 SourceLocation MapLoc,
const OMPVarListLocTy &Locs,
5941 const OMPMappableExprListSizeTy &Sizes)
5942 : OMPMappableExprListClause(
llvm::omp::OMPC_map, Locs, Sizes,
5943 true, &MapperQualifierLoc,
5945 MapType(MapType), MapTypeIsImplicit(MapTypeIsImplicit), MapLoc(MapLoc) {
5946 assert(std::size(MapTypeModifiers) == MapModifiers.size() &&
5947 "Unexpected number of map type modifiers.");
5948 llvm::copy(MapModifiers, std::begin(MapTypeModifiers));
5950 assert(std::size(MapTypeModifiersLoc) == MapModifiersLoc.size() &&
5951 "Unexpected number of map type modifier locations.");
5952 llvm::copy(MapModifiersLoc, std::begin(MapTypeModifiersLoc));
5962 explicit OMPMapClause(
const OMPMappableExprListSizeTy &Sizes)
5963 : OMPMappableExprListClause(
llvm::omp::OMPC_map, OMPVarListLocTy(), Sizes,
5972 "Unexpected index to store map type modifier, exceeds array size.");
5973 MapTypeModifiers[I] =
T;
5980 void setMapTypeModifierLoc(
unsigned I, SourceLocation TLoc) {
5982 "Index to store map type modifier location exceeds array size.");
5983 MapTypeModifiersLoc[I] = TLoc;
5994 void setMapLoc(SourceLocation TLoc) { MapLoc = TLoc; }
5997 void setColonLoc(SourceLocation
Loc) { ColonLoc =
Loc; }
6000 void setIteratorModifier(Expr *IteratorModifier) {
6001 getTrailingObjects<Expr *>()[2 *
varlist_size()] = IteratorModifier;
6025 static OMPMapClause *
6026 Create(
const ASTContext &
C,
const OMPVarListLocTy &Locs,
6027 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
6029 ArrayRef<Expr *> UDMapperRefs, Expr *IteratorModifier,
6030 ArrayRef<OpenMPMapModifierKind> MapModifiers,
6031 ArrayRef<SourceLocation> MapModifiersLoc,
6032 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId,
6046 const OMPMappableExprListSizeTy &Sizes);
6050 return getTrailingObjects<Expr *>()[2 *
varlist_size()];
6068 "Requested modifier exceeds the total number of modifiers.");
6069 return MapTypeModifiers[Cnt];
6078 "Requested modifier location exceeds total number of modifiers.");
6079 return MapTypeModifiersLoc[Cnt];
6110 if (MapType == OMPC_MAP_to || MapType == OMPC_MAP_tofrom)
6122 return T->getClauseKind() == llvm::omp::OMPC_map;
6141 Stmt *NumTeams =
nullptr;
6146 void setNumTeams(
Expr *E) { NumTeams = E; }
6198 return T->getClauseKind() == llvm::omp::OMPC_num_teams;
6217 Stmt *ThreadLimit =
nullptr;
6222 void setThreadLimit(
Expr *E) { ThreadLimit = E; }
6238 :
OMPClause(
llvm::omp::OMPC_thread_limit, StartLoc, EndLoc),
6275 return T->getClauseKind() == llvm::omp::OMPC_thread_limit;
6349 return T->getClauseKind() == llvm::omp::OMPC_priority;
6374 Stmt *Grainsize =
nullptr;
6377 void setGrainsize(
Expr *Size) { Grainsize = Size; }
6383 void setModifierLoc(SourceLocation
Loc) { ModifierLoc =
Loc; }
6403 ModifierLoc(ModifierLoc), Grainsize(Size) {
6441 return T->getClauseKind() == llvm::omp::OMPC_grainsize;
6481 return T->getClauseKind() == llvm::omp::OMPC_nogroup;
6506 Stmt *NumTasks =
nullptr;
6509 void setNumTasks(
Expr *Size) { NumTasks = Size; }
6515 void setModifierLoc(SourceLocation
Loc) { ModifierLoc =
Loc; }
6535 ModifierLoc(ModifierLoc), NumTasks(Size) {
6573 return T->getClauseKind() == llvm::omp::OMPC_num_tasks;
6591 Stmt *Hint =
nullptr;
6594 void setHint(
Expr *H) { Hint = H; }
6605 :
OMPClause(
llvm::omp::OMPC_hint, StartLoc, EndLoc), LParenLoc(LParenLoc),
6635 return T->getClauseKind() == llvm::omp::OMPC_hint;
6663 Expr *ChunkSize =
nullptr;
6678 void setDistScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
6683 void setCommaLoc(SourceLocation
Loc) { CommaLoc =
Loc; }
6688 void setChunkSize(Expr *E) { ChunkSize = E; }
6706 Stmt *HelperChunkSize)
6707 :
OMPClause(
llvm::omp::OMPC_dist_schedule, StartLoc, EndLoc),
6709 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
6739 reinterpret_cast<Stmt **
>(&ChunkSize) + 1);
6755 return T->getClauseKind() == llvm::omp::OMPC_dist_schedule;
6797 void setDefaultmapModifierLoc(SourceLocation
Loc) {
6804 void setLParenLoc(SourceLocation
Loc) { LParenLoc =
Loc; }
6809 void setDefaultmapKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
6826 LParenLoc(LParenLoc), Modifier(M), ModifierLoc(MLoc), Kind(Kind),
6869 return T->getClauseKind() == llvm::omp::OMPC_defaultmap;
6882 private llvm::TrailingObjects<
6883 OMPToClause, Expr *, ValueDecl *, unsigned,
6884 OMPClauseMappableExprCommon::MappableComponent> {
6888 friend TrailingObjects;
6922 true, &MapperQualifierLoc,
6924 assert(std::size(MotionModifiers) == TheMotionModifiers.size() &&
6925 "Unexpected number of motion modifiers.");
6926 llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
6928 assert(std::size(MotionModifiersLoc) == TheMotionModifiersLoc.size() &&
6929 "Unexpected number of motion modifier locations.");
6930 llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
6940 explicit OMPToClause(
const OMPMappableExprListSizeTy &Sizes)
6941 : OMPMappableExprListClause(
llvm::omp::OMPC_to, OMPVarListLocTy(), Sizes,
6950 "Unexpected index to store motion modifier, exceeds array size.");
6951 MotionModifiers[I] =
T;
6958 void setMotionModifierLoc(
unsigned I, SourceLocation TLoc) {
6960 "Index to store motion modifier location exceeds array size.");
6961 MotionModifiersLoc[I] = TLoc;
6965 void setColonLoc(SourceLocation
Loc) { ColonLoc =
Loc; }
6969 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
6974 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
6977 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
6998 static OMPToClause *
Create(
const ASTContext &
C,
const OMPVarListLocTy &Locs,
6999 ArrayRef<Expr *> Vars,
7000 ArrayRef<ValueDecl *> Declarations,
7002 ArrayRef<Expr *> UDMapperRefs,
7003 ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
7004 ArrayRef<SourceLocation> MotionModifiersLoc,
7005 NestedNameSpecifierLoc UDMQualifierLoc,
7006 DeclarationNameInfo MapperId);
7017 const OMPMappableExprListSizeTy &Sizes);
7024 "Requested modifier exceeds the total number of modifiers.");
7025 return MotionModifiers[Cnt];
7034 "Requested modifier location exceeds total number of modifiers.");
7035 return MotionModifiersLoc[Cnt];
7069 return T->getClauseKind() == llvm::omp::OMPC_to;
7083 private llvm::TrailingObjects<
7084 OMPFromClause, Expr *, ValueDecl *, unsigned,
7085 OMPClauseMappableExprCommon::MappableComponent> {
7089 friend TrailingObjects;
7123 true, &MapperQualifierLoc,
7125 assert(std::size(MotionModifiers) == TheMotionModifiers.size() &&
7126 "Unexpected number of motion modifiers.");
7127 llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
7129 assert(std::size(MotionModifiersLoc) == TheMotionModifiersLoc.size() &&
7130 "Unexpected number of motion modifier locations.");
7131 llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
7141 explicit OMPFromClause(
const OMPMappableExprListSizeTy &Sizes)
7142 : OMPMappableExprListClause(
llvm::omp::OMPC_from, OMPVarListLocTy(),
7151 "Unexpected index to store motion modifier, exceeds array size.");
7152 MotionModifiers[I] =
T;
7159 void setMotionModifierLoc(
unsigned I, SourceLocation TLoc) {
7161 "Index to store motion modifier location exceeds array size.");
7162 MotionModifiersLoc[I] = TLoc;
7166 void setColonLoc(SourceLocation
Loc) { ColonLoc =
Loc; }
7170 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
7175 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
7178 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
7199 static OMPFromClause *
7200 Create(
const ASTContext &
C,
const OMPVarListLocTy &Locs,
7201 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
7203 ArrayRef<Expr *> UDMapperRefs,
7204 ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
7205 ArrayRef<SourceLocation> MotionModifiersLoc,
7206 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
7217 const OMPMappableExprListSizeTy &Sizes);
7224 "Requested modifier exceeds the total number of modifiers.");
7225 return MotionModifiers[Cnt];
7234 "Requested modifier location exceeds total number of modifiers.");
7235 return MotionModifiersLoc[Cnt];
7269 return T->getClauseKind() == llvm::omp::OMPC_from;
7283 private llvm::TrailingObjects<
7284 OMPUseDevicePtrClause, Expr *, ValueDecl *, unsigned,
7285 OMPClauseMappableExprCommon::MappableComponent> {
7289 friend TrailingObjects;
7319 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
7322 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
7325 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
7332 void setPrivateCopies(ArrayRef<Expr *> VL);
7336 MutableArrayRef<Expr *> getPrivateCopies() {
7339 ArrayRef<const Expr *> getPrivateCopies()
const {
7346 void setInits(ArrayRef<Expr *> VL);
7350 MutableArrayRef<Expr *> getInits() {
7351 return MutableArrayRef<Expr *>(getPrivateCopies().end(),
varlist_size());
7353 ArrayRef<const Expr *> getInits()
const {
7369 static OMPUseDevicePtrClause *
7370 Create(
const ASTContext &
C,
const OMPVarListLocTy &Locs,
7371 ArrayRef<Expr *> Vars, ArrayRef<Expr *> PrivateVars,
7372 ArrayRef<Expr *> Inits, ArrayRef<ValueDecl *> Declarations,
7383 static OMPUseDevicePtrClause *
7384 CreateEmpty(
const ASTContext &
C,
const OMPMappableExprListSizeTy &Sizes);
7390 llvm::iterator_range<private_copies_const_iterator>;
7394 getPrivateCopies().end());
7399 getPrivateCopies().end());
7408 return inits_range(getInits().begin(), getInits().end());
7433 return T->getClauseKind() == llvm::omp::OMPC_use_device_ptr;
7447 private llvm::TrailingObjects<
7448 OMPUseDeviceAddrClause, Expr *, ValueDecl *, unsigned,
7449 OMPClauseMappableExprCommon::MappableComponent> {
7453 friend TrailingObjects;
7483 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
7486 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
7489 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
7503 static OMPUseDeviceAddrClause *
7504 Create(
const ASTContext &
C,
const OMPVarListLocTy &Locs,
7505 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
7516 static OMPUseDeviceAddrClause *
7517 CreateEmpty(
const ASTContext &
C,
const OMPMappableExprListSizeTy &Sizes);
7537 return T->getClauseKind() == llvm::omp::OMPC_use_device_addr;
7551 private llvm::TrailingObjects<
7552 OMPIsDevicePtrClause, Expr *, ValueDecl *, unsigned,
7553 OMPClauseMappableExprCommon::MappableComponent> {
7557 friend TrailingObjects;
7586 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
7589 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
7592 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
7606 static OMPIsDevicePtrClause *
7607 Create(
const ASTContext &
C,
const OMPVarListLocTy &Locs,
7608 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
7619 static OMPIsDevicePtrClause *
7620 CreateEmpty(
const ASTContext &
C,
const OMPMappableExprListSizeTy &Sizes);
7640 return T->getClauseKind() == llvm::omp::OMPC_is_device_ptr;
7654 private llvm::TrailingObjects<
7655 OMPHasDeviceAddrClause, Expr *, ValueDecl *, unsigned,
7656 OMPClauseMappableExprCommon::MappableComponent> {
7660 friend TrailingObjects;
7690 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
7693 size_t numTrailingObjects(OverloadToken<ValueDecl *>)
const {
7696 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
7710 static OMPHasDeviceAddrClause *
7711 Create(
const ASTContext &
C,
const OMPVarListLocTy &Locs,
7712 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
7723 static OMPHasDeviceAddrClause *
7724 CreateEmpty(
const ASTContext &
C,
const OMPMappableExprListSizeTy &Sizes);
7744 return T->getClauseKind() == llvm::omp::OMPC_has_device_addr;
7757 private llvm::TrailingObjects<OMPNontemporalClause, Expr *> {
7760 friend TrailingObjects;
7771 StartLoc, LParenLoc, EndLoc, N) {
7784 MutableArrayRef<Expr *> getPrivateRefs() {
7787 ArrayRef<const Expr *> getPrivateRefs()
const {
7799 static OMPNontemporalClause *
7800 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
7801 SourceLocation EndLoc, ArrayRef<Expr *> VL);
7807 static OMPNontemporalClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
7824 return child_range(
reinterpret_cast<Stmt **
>(getPrivateRefs().begin()),
7825 reinterpret_cast<Stmt **
>(getPrivateRefs().end()));
7841 return T->getClauseKind() == llvm::omp::OMPC_nontemporal;
7888 void setModifierKwLoc(SourceLocation MLoc) { ModifierKwLoc = MLoc; }
7905 LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc), Modifier(Modifier),
7906 ModifierKwLoc(MLoc) {}
7946 return T->getClauseKind() == llvm::omp::OMPC_order;
7957 private llvm::TrailingObjects<OMPInitClause, Expr *> {
7960 friend TrailingObjects;
7965 bool IsTarget =
false;
7966 bool IsTargetSync =
false;
7970 void setIsTarget(
bool V) { IsTarget =
V; }
7972 void setIsTargetSync(
bool V) { IsTargetSync =
V; }
7975 void setVarLoc(SourceLocation
Loc) { VarLoc =
Loc; }
7986 OMPInitClause(
bool IsTarget,
bool IsTargetSync, SourceLocation StartLoc,
7987 SourceLocation LParenLoc, SourceLocation VarLoc,
7988 SourceLocation EndLoc,
unsigned N)
7989 : OMPVarListClause<OMPInitClause>(
llvm::omp::OMPC_init, StartLoc,
7990 LParenLoc, EndLoc, N),
7991 VarLoc(VarLoc), IsTarget(IsTarget), IsTargetSync(IsTargetSync) {}
7994 OMPInitClause(
unsigned N)
7995 : OMPVarListClause<OMPInitClause>(
llvm::omp::OMPC_init, SourceLocation(),
7996 SourceLocation(), SourceLocation(), N) {
8009 static OMPInitClause *
Create(
const ASTContext &
C, Expr *InteropVar,
8010 OMPInteropInfo &InteropInfo,
8011 SourceLocation StartLoc,
8012 SourceLocation LParenLoc, SourceLocation VarLoc,
8013 SourceLocation EndLoc);
8019 static OMPInitClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
8067 return T->getClauseKind() == llvm::omp::OMPC_init;
8086 Stmt *InteropVar =
nullptr;
8089 void setInteropVar(
Expr *E) { InteropVar = E; }
8095 void setVarLoc(SourceLocation
Loc) { VarLoc =
Loc; }
8108 :
OMPClause(
llvm::omp::OMPC_use, StartLoc, EndLoc), LParenLoc(LParenLoc),
8109 VarLoc(VarLoc), InteropVar(InteropVar) {}
8138 return T->getClauseKind() == llvm::omp::OMPC_use;
8161 Stmt *InteropVar =
nullptr;
8164 void setInteropVar(
Expr *E) { InteropVar = E; }
8170 void setVarLoc(SourceLocation
Loc) { VarLoc =
Loc; }
8184 LParenLoc(LParenLoc), VarLoc(VarLoc), InteropVar(InteropVar) {}
8227 return T->getClauseKind() == llvm::omp::OMPC_destroy;
8365 private llvm::TrailingObjects<OMPInclusiveClause, Expr *> {
8368 friend TrailingObjects;
8379 StartLoc, LParenLoc, EndLoc, N) {}
8397 static OMPInclusiveClause *
Create(
const ASTContext &
C,
8398 SourceLocation StartLoc,
8399 SourceLocation LParenLoc,
8400 SourceLocation EndLoc, ArrayRef<Expr *> VL);
8406 static OMPInclusiveClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
8426 return T->getClauseKind() == llvm::omp::OMPC_inclusive;
8439 private llvm::TrailingObjects<OMPExclusiveClause, Expr *> {
8442 friend TrailingObjects;
8453 StartLoc, LParenLoc, EndLoc, N) {}
8471 static OMPExclusiveClause *
Create(
const ASTContext &
C,
8472 SourceLocation StartLoc,
8473 SourceLocation LParenLoc,
8474 SourceLocation EndLoc, ArrayRef<Expr *> VL);
8480 static OMPExclusiveClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
8500 return T->getClauseKind() == llvm::omp::OMPC_exclusive;
8514 private llvm::TrailingObjects<OMPUsesAllocatorsClause, Expr *,
8529 friend TrailingObjects;
8531 enum class ExprOffsets {
8537 enum class ParenLocsOffsets {
8544 SourceLocation LParenLoc;
8546 unsigned NumOfAllocators = 0;
8554 OMPUsesAllocatorsClause(SourceLocation StartLoc, SourceLocation LParenLoc,
8555 SourceLocation EndLoc,
unsigned N)
8556 : OMPClause(
llvm::omp::OMPC_uses_allocators, StartLoc, EndLoc),
8557 LParenLoc(LParenLoc), NumOfAllocators(N) {}
8562 explicit OMPUsesAllocatorsClause(
unsigned N)
8563 :
OMPClause(
llvm::omp::OMPC_uses_allocators, SourceLocation(),
8565 NumOfAllocators(N) {}
8567 unsigned numTrailingObjects(OverloadToken<Expr *>)
const {
8568 return NumOfAllocators *
static_cast<int>(ExprOffsets::Total);
8572 void setLParenLoc(SourceLocation
Loc) { LParenLoc =
Loc; }
8575 void setAllocatorsData(ArrayRef<OMPUsesAllocatorsClause::Data>
Data);
8585 static OMPUsesAllocatorsClause *
8586 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
8587 SourceLocation EndLoc, ArrayRef<OMPUsesAllocatorsClause::Data>
Data);
8593 static OMPUsesAllocatorsClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
8606 Stmt **
Begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
8608 static_cast<int>(ExprOffsets::Total));
8612 reinterpret_cast<Stmt *
const *
>(getTrailingObjects<Expr *>());
8614 Begin,
Begin + NumOfAllocators *
static_cast<int>(ExprOffsets::Total));
8625 return T->getClauseKind() == llvm::omp::OMPC_uses_allocators;
8640 private llvm::TrailingObjects<OMPAffinityClause, Expr *> {
8643 friend TrailingObjects;
8658 LParenLoc, EndLoc, N) {}
8669 void setModifier(Expr *E) {
8674 void setColonLoc(SourceLocation
Loc) { ColonLoc =
Loc; }
8685 static OMPAffinityClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
8686 SourceLocation LParenLoc,
8687 SourceLocation ColonLoc,
8688 SourceLocation EndLoc, Expr *Modifier,
8689 ArrayRef<Expr *> Locators);
8695 static OMPAffinityClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
8726 return T->getClauseKind() == llvm::omp::OMPC_affinity;
8797 void setBindKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
8807 SourceLocation StartLoc, SourceLocation LParenLoc,
8808 SourceLocation EndLoc)
8825 SourceLocation KLoc, SourceLocation StartLoc,
8826 SourceLocation LParenLoc, SourceLocation EndLoc);
8831 static OMPBindClause *
CreateEmpty(
const ASTContext &
C);
8845template<
class ImplClass,
template <
typename>
class Ptr,
typename RetTy>
8848#define PTR(CLASS) Ptr<CLASS>
8849#define DISPATCH(CLASS) \
8850 return static_cast<ImplClass*>(this)->Visit##CLASS(static_cast<PTR(CLASS)>(S))
8852#define GEN_CLANG_CLAUSE_CLASS
8853#define CLAUSE_CLASS(Enum, Str, Class) \
8854 RetTy Visit##Class(PTR(Class) S) { DISPATCH(Class); }
8855#include "llvm/Frontend/OpenMP/OMP.inc"
8859 switch (S->getClauseKind()) {
8860#define GEN_CLANG_CLAUSE_CLASS
8861#define CLAUSE_CLASS(Enum, Str, Class) \
8862 case llvm::omp::Clause::Enum: \
8863 return Visit##Class(static_cast<PTR(Class)>(S));
8864#define CLAUSE_NO_CLASS(Enum, Str) \
8865 case llvm::omp::Clause::Enum: \
8867#include "llvm/Frontend/OpenMP/OMP.inc"
8876template <
typename T>
using const_ptr = std::add_pointer_t<std::add_const_t<T>>;
8878template <
class ImplClass,
typename RetTy =
void>
8881template<
class ImplClass,
typename RetTy =
void>
8890 template <
typename T>
void VisitOMPClauseList(
T *
Node,
char StartSym);
8892 template <
typename T>
void VisitOMPMotionClause(
T *
Node);
8896 : OS(OS), Policy(Policy) {}
8898#define GEN_CLANG_CLAUSE_CLASS
8899#define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(Class *S);
8900#include "llvm/Frontend/OpenMP/OMP.inc"
8904 llvm::omp::TraitProperty
Kind = llvm::omp::TraitProperty::invalid;
8912 llvm::omp::TraitSelector
Kind = llvm::omp::TraitSelector::invalid;
8916 llvm::omp::TraitSet
Kind = llvm::omp::TraitSet::invalid;
8938 llvm::function_ref<
bool(
Expr *&,
bool )> Cond) {
8940 return llvm::any_of(
8942 return Cond(Selector.ScoreOrCondition,
8944 llvm::omp::TraitSelector::user_condition);
8955 llvm::omp::VariantMatchInfo &VMI)
const;
8963 if (
Set.Kind != llvm::omp::TraitSet::implementation)
8966 if (
Selector.Kind != llvm::omp::TraitSelector::implementation_extension)
8980llvm::raw_ostream &
operator<<(llvm::raw_ostream &OS,
const OMPTraitInfo &TI);
8981llvm::raw_ostream &
operator<<(llvm::raw_ostream &OS,
const OMPTraitInfo *TI);
8986 std::function<
void(StringRef)> &&DiagUnknownTrait,
8996 std::function<
bool(StringRef)> FeatureValidityCheck;
8997 std::function<void(StringRef)> DiagUnknownTrait;
8998 llvm::StringMap<bool> FeatureMap;
9005 :
private llvm::TrailingObjects<OMPChildren, OMPClause *, Stmt *> {
9006 friend TrailingObjects;
9012 unsigned NumClauses = 0;
9014 unsigned NumChildren = 0;
9016 bool HasAssociatedStmt =
false;
9020 size_t numTrailingObjects(OverloadToken<OMPClause *>)
const {
9026 OMPChildren(
unsigned NumClauses,
unsigned NumChildren,
bool HasAssociatedStmt)
9027 : NumClauses(NumClauses), NumChildren(NumChildren),
9028 HasAssociatedStmt(HasAssociatedStmt) {}
9030 static size_t size(
unsigned NumClauses,
bool HasAssociatedStmt,
9031 unsigned NumChildren);
9033 static OMPChildren *
Create(
void *Mem, ArrayRef<OMPClause *> Clauses);
9034 static OMPChildren *
Create(
void *Mem, ArrayRef<OMPClause *> Clauses, Stmt *S,
9035 unsigned NumChildren = 0);
9036 static OMPChildren *CreateEmpty(
void *Mem,
unsigned NumClauses,
9037 bool HasAssociatedStmt =
false,
9038 unsigned NumChildren = 0);
9047 getTrailingObjects<Stmt *>()[NumChildren] = S;
9063 assert(HasAssociatedStmt &&
9064 "Expected directive with the associated statement.");
9065 return getTrailingObjects<Stmt *>()[NumChildren];
9084 assert(llvm::is_contained(CaptureRegions, RegionKind) &&
9085 "RegionKind not found in OpenMP CaptureRegions.");
9087 for (
auto ThisCaptureRegion : CaptureRegions) {
9088 if (ThisCaptureRegion == RegionKind)
9090 CS = cast<CapturedStmt>(CS->getCapturedStmt());
9092 llvm_unreachable(
"Incorrect RegionKind specified for directive.");
9099 assert(!CaptureRegions.empty() &&
9100 "At least one captured statement must be provided.");
9102 for (
unsigned Level = CaptureRegions.size(); Level > 1; --Level)
9103 CS = cast<CapturedStmt>(CS->getCapturedStmt());
9119 assert(HasAssociatedStmt &&
9120 "Expected directive with the associated statement.");
9124 S = CS->getCapturedStmt();
9125 CS = dyn_cast<CapturedStmt>(S);
9136 if (!HasAssociatedStmt)
9139 &getTrailingObjects<Stmt *>()[NumChildren + 1]);
9195 private llvm::TrailingObjects<OMPDoacrossClause, Expr *> {
9198 friend TrailingObjects;
9210 unsigned NumLoops = 0;
9222 LParenLoc, EndLoc, N),
9223 NumLoops(NumLoops) {}
9233 NumLoops(NumLoops) {}
9239 void setDependenceLoc(SourceLocation
Loc) { DepLoc =
Loc; }
9242 void setColonLoc(SourceLocation
Loc) { ColonLoc =
Loc; }
9256 static OMPDoacrossClause *
9257 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
9259 SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VL,
9267 static OMPDoacrossClause *
CreateEmpty(
const ASTContext &
C,
unsigned N,
9307 return T->getClauseKind() == llvm::omp::OMPC_doacross;
9355 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.
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.
This represents 'acq_rel' clause in the '#pragma omp atomic|flush' directives.
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.
This represents 'acquire' clause in the '#pragma omp atomic|flush' directives.
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()
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.
Expr * getAlignment() const
Returns alignment.
This represents clause 'aligned' in the '#pragma omp ...' directives.
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
const_child_range used_children() const
SourceLocation getColonLoc() const
Returns the location of the ':' delimiter.
Expr * getAllocator() const
Returns the allocator expression or nullptr, if no allocator is specified.
child_range used_children()
static OMPAllocateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
static bool classof(const OMPClause *T)
This represents 'allocator' clause in the '#pragma omp ...' directive.
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.
This represents 'at' clause in the '#pragma omp error' directive.
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
This represents 'atomic_default_mem_order' clause in the '#pragma omp requires' directive.
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.
This represents 'bind' clause in the '#pragma omp ...' directives.
OpenMPBindClauseKind getBindKind() const
Returns kind of the clause.
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.
This represents 'capture' clause in the '#pragma omp atomic' directive.
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.
bool hasAssociatedStmt() const
Stmt::child_range getAssociatedStmtAsRange()
void setClauses(ArrayRef< OMPClause * > Clauses)
Sets the list of variables for this clause.
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.
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.
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
OMPClausePrinter(raw_ostream &OS, const PrintingPolicy &Policy)
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.
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 'shedule', 'firstprivate' etc.
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
This represents 'collapse' clause in the '#pragma omp ...' directive.
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.
This represents 'compare' clause in the '#pragma omp atomic' directive.
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)
This represents clause 'copyin' in the '#pragma omp ...' directives.
helper_expr_range assignment_ops()
MutableArrayRef< Expr * >::iterator helper_expr_iterator
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
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.
helper_expr_range source_exprs()
MutableArrayRef< Expr * >::iterator helper_expr_iterator
llvm::iterator_range< helper_expr_iterator > helper_expr_range
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_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.
helper_expr_range assignment_ops()
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
helper_expr_const_range assignment_ops() const
This is a basic class for representing single OpenMP declarative directive.
This represents 'default' clause in the '#pragma omp ...' directive.
const_child_range used_children() const
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.
OMPDefaultClause(llvm::omp::DefaultKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'default' clause with argument A ('none' or 'shared').
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.
This represents 'defaultmap' clause in the '#pragma omp ...' directive.
const_child_range children() const
SourceLocation getDefaultmapKindLoc()
Get kind location.
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.
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)
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
This represents 'destroy' clause in the '#pragma omp depobj' directive or the '#pragma omp interop' d...
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
This represents 'detach' clause in the '#pragma omp task' directive.
OMPDetachClause(Expr *Evt, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'detach' clause with event-handler Evt.
OMPDetachClause()
Build an empty clause.
Expr * getEventHandler() const
Returns event-handler expression.
This represents 'device' clause in the '#pragma omp ...' directive.
OMPDeviceClause()
Build an empty clause.
const_child_range used_children() const
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 '('.
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
OMPDistScheduleClause()
Build an empty clause.
const_child_range used_children() const
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
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.
This represents 'dynamic_allocators' clause in the '#pragma omp requires' directive.
OMPDynamicAllocatorsClause()
Build an empty clause.
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.
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)
This is a basic class for representing single OpenMP executable directive.
This represents 'fail' clause in the '#pragma omp atomic' directive.
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.
This represents 'filter' clause in the '#pragma omp ...' directive.
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.
This represents 'final' clause in the '#pragma omp ...' directive.
child_range used_children()
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
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< inits_iterator > inits_range
llvm::iterator_range< private_copies_iterator > private_copies_range
llvm::iterator_range< private_copies_const_iterator > private_copies_const_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
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
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
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)
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.
static OMPFullClause * CreateEmpty(const ASTContext &C)
Build an empty 'full' AST node for deserialization.
This represents 'grainsize' clause in the '#pragma omp ...' directive.
const_child_range children() const
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
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()
This represents 'hint' clause in the '#pragma omp ...' directive.
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()
This represents 'if' clause in the '#pragma omp ...' directive.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
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)
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
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
helper_expr_const_range lhs_exprs() const
helper_expr_const_range reduction_ops() const
helper_expr_const_range privates() const
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
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
This represents the 'init' clause in '#pragma omp ...' directives.
bool getIsTarget() const
Returns true is interop-type 'target' is used.
child_range used_children()
const_child_range children() const
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.
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()
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
This represents clause 'linear' in the '#pragma omp ...' directives.
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.
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
llvm::iterator_range< used_expressions_const_iterator > used_expressions_const_range
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.
ArrayRef< const Expr * >::iterator inits_const_iterator
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
llvm::iterator_range< used_expressions_iterator > used_expressions_range
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
This represents clause 'map' in the '#pragma omp ...' directives.
OpenMPMapClauseKind getMapType() const LLVM_READONLY
Fetches mapping kind for the clause.
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? We have to capture 'IsMapTypeImplicit' from the parser for more informa...
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< const_component_lists_iterator > const_component_lists_range
llvm::iterator_range< mapperlist_iterator > mapperlist_range
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()
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.
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.
llvm::iterator_range< const_all_lists_sizes_iterator > const_all_lists_sizes_range
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
llvm::iterator_range< const_all_num_lists_iterator > const_all_num_lists_range
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
llvm::iterator_range< mapperlist_const_iterator > mapperlist_const_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
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()
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.
llvm::iterator_range< const_all_components_iterator > const_all_components_range
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.
This represents 'mergeable' clause in the '#pragma omp ...' directive.
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()
This represents 'message' clause in the '#pragma omp error' directive.
SourceLocation getLParenLoc() const
Returns the locaiton of '('.
Expr * getMessageString() const
Returns message string of the clause.
OMPMessageClause(Expr *MS, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'message' clause with message string argument.
static bool classof(const OMPClause *T)
const_child_range children() const
child_range used_children()
OMPMessageClause()
Build an empty clause.
const_child_range used_children() const
This represents 'nocontext' clause in the '#pragma omp ...' directive.
OMPNocontextClause(Expr *Cond, Stmt *HelperCond, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'nocontext' clause with condition Cond.
const_child_range used_children() const
OMPNocontextClause()
Build an empty clause.
Expr * getCondition() const
Returns condition.
child_range used_children()
This represents 'nogroup' clause in the '#pragma omp ...' directive.
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.
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
This represents 'novariants' clause in the '#pragma omp ...' directive.
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.
This represents 'nowait' clause in the '#pragma omp ...' directive.
OMPNowaitClause(SourceLocation StartLoc=SourceLocation(), SourceLocation EndLoc=SourceLocation())
Build 'nowait' clause.
This represents 'num_tasks' clause in the '#pragma omp ...' directive.
const_child_range children() const
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.
This represents 'num_teams' clause in the '#pragma omp ...' directive.
Expr * getNumTeams()
Return NumTeams number.
OMPNumTeamsClause()
Build an empty clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
OMPNumTeamsClause(Expr *E, Stmt *HelperE, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'num_teams' clause.
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 '('.
Expr * getNumTeams() const
Return NumTeams number.
This represents 'num_threads' clause in the '#pragma omp ...' directive.
OMPNumThreadsClause()
Build an empty clause.
OMPNumThreadsClause(Expr *NumThreads, Stmt *HelperNumThreads, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, 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.
This represents 'order' clause in the '#pragma omp ...' directive.
OMPOrderClause(OpenMPOrderClauseKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, OpenMPOrderClauseModifier Modifier, SourceLocation MLoc)
Build 'order' clause with argument A ('concurrent').
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.
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.
Representation of the 'partial' clause of the '#pragma omp unroll' directive.
child_range used_children()
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 represents 'priority' clause in the '#pragma omp ...' directive.
OMPPriorityClause(Expr *Priority, Stmt *HelperPriority, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'priority' clause.
Expr * getPriority() const
Return Priority number.
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
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_iterator > private_copies_range
ArrayRef< const Expr * >::iterator private_copies_const_iterator
private_copies_const_range private_copies() const
llvm::iterator_range< private_copies_const_iterator > private_copies_const_range
MutableArrayRef< Expr * >::iterator private_copies_iterator
static OMPPrivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
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)
This represents 'read' clause in the '#pragma omp atomic' directive.
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.
child_range used_children()
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
helper_expr_const_range privates() const
llvm::iterator_range< helper_expr_const_iterator > helper_expr_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
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.
helper_expr_range reduction_ops()
This represents 'relaxed' clause in the '#pragma omp atomic' directives.
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.
This represents 'release' clause in the '#pragma omp atomic|flush' directives.
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
This represents 'reverse_offload' clause in the '#pragma omp requires' directive.
const_child_range children() const
const_child_range used_children() const
OMPReverseOffloadClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'reverse_offload' clause.
static bool classof(const OMPClause *T)
OMPReverseOffloadClause()
Build an empty clause.
child_range used_children()
This represents 'simd' clause in the '#pragma omp ...' directive.
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.
This represents 'safelen' clause in the '#pragma omp ...' directive.
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.
This represents 'schedule' clause in the '#pragma omp ...' directive.
static bool classof(const OMPClause *T)
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.
This represents 'seq_cst' clause in the '#pragma omp atomic' directive.
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)
This represents 'severity' clause in the '#pragma omp error' directive.
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.
This represents clause 'shared' in the '#pragma omp ...' directives.
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)
This represents 'simdlen' clause in the '#pragma omp ...' directive.
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 '('.
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
llvm::iterator_range< helper_expr_iterator > helper_expr_range
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
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
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()
This represents 'thread_limit' clause in the '#pragma omp ...' directive.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
const_child_range children() const
OMPThreadLimitClause()
Build an empty clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
Expr * getThreadLimit()
Return ThreadLimit number.
Expr * getThreadLimit() const
Return ThreadLimit number.
child_range used_children()
const_child_range used_children() const
static bool classof(const OMPClause *T)
OMPThreadLimitClause(Expr *E, Stmt *HelperE, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'thread_limit' clause.
This represents 'threads' clause in the '#pragma omp ...' directive.
OMPThreadsClause()
Build an empty clause.
OMPThreadsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'threads' clause.
This represents clause 'to' in the '#pragma omp ...' directives.
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.
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.
Helper data structure representing the traits in a match clause of an declare variant or metadirectiv...
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.
This represents 'unified_address' clause in the '#pragma omp requires' directive.
OMPUnifiedAddressClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'unified_address' clause.
OMPUnifiedAddressClause()
Build an empty clause.
This represents 'unified_shared_memory' clause in the '#pragma omp requires' directive.
OMPUnifiedSharedMemoryClause()
Build an empty clause.
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()
This represents 'untied' clause in the '#pragma omp ...' directive.
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
This represents 'update' clause in the '#pragma omp atomic' directive.
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.
This represents the 'use' clause in '#pragma omp ...' directives.
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.
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
private_copies_const_range private_copies() const
llvm::iterator_range< private_copies_const_iterator > private_copies_const_range
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
This represents clause 'uses_allocators' in the '#pragma omp target'-based directives.
static bool classof(const OMPClause *T)
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',...
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
ArrayRef< const Expr * > getVarRefs() const
Fetches list of all variables in the clause.
varlist_const_range varlists() const
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.
This represents 'weak' clause in the '#pragma omp atomic' directives.
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
This represents 'write' clause in the '#pragma omp atomic' directive.
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.
This represents 'ompx_attribute' clause in a directive that might generate an outlined function.
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 '('.
SourceLocation getLParenLoc() const
Returns the location of '('.
OMPXAttributeClause(ArrayRef< const Attr * > Attrs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'ompx_attribute' clause.
This represents 'ompx_bare' clause in the '#pragma omp target teams ...' directive.
OMPXBareClause()=default
Build an empty clause.
OMPXBareClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'ompx_bare' clause.
This represents 'ompx_dyn_cgroup_mem' clause in the '#pragma omp target ...' directive.
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.
Smart pointer class that efficiently represents Objective-C method names.
Encodes a location in the source.
Stmt - This represents one statement.
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.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
bool checkFailClauseParameter(OpenMPClauseKind FailClauseParameter)
Checks if the parameter to the fail clause in "#pragma atomic compare fail" is restricted only to mem...
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
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.
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
@ OMPC_SCHEDULE_MODIFIER_unknown
llvm::omp::Clause OpenMPClauseKind
OpenMP clauses.
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
@ OMPC_DIST_SCHEDULE_unknown
OpenMPDoacrossClauseModifier
OpenMP dependence types for 'doacross' clause.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
static constexpr unsigned NumberOfOMPMapClauseModifiers
Number of allowed map-type-modifiers.
@ Property
The type of a property.
OpenMPBindClauseKind
OpenMP bindings for the 'bind' clause.
OpenMPLastprivateModifier
OpenMP 'lastprivate' clause modifier.
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
OpenMPGrainsizeClauseModifier
OpenMPNumTasksClauseModifier
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
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
const FunctionProtoType * T
OpenMPAtomicDefaultMemOrderClauseKind
OpenMP attributes for 'atomic_default_mem_order' clause.
@ OMPC_ATOMIC_DEFAULT_MEM_ORDER_unknown
U cast(CodeGen::Address addr)
OpenMPDeviceClauseModifier
OpenMP modifiers for 'device' clause.
OpenMPMapModifierKind
OpenMP modifier kind for 'map' clause.
@ OMPC_MAP_MODIFIER_unknown
OpenMPOrderClauseKind
OpenMP attributes for 'order' clause.
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
Diagnostic wrappers for TextAPI types for error reporting.
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
llvm::SmallVector< OMPTraitProperty, 1 > Properties
llvm::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.
Clang specific specialization of the OMPContext to lookup target features.
bool matchesISATrait(StringRef RawString) const override
See llvm::omp::OMPContext::matchesISATrait.
virtual ~TargetOMPContext()=default