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 *>(),
366 :
OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc),
386 static_cast<T *
>(
this)
387 ->
template getTrailingObjects<OpenMPDirectiveKind>(),
394 "Number of directive kinds is not the same as the preallocated buffer");
395 std::copy(DK.begin(), DK.end(),
396 static_cast<T *
>(
this)
397 ->template getTrailingObjects<OpenMPDirectiveKind>());
474 static OMPAlignClause *
Create(
const ASTContext &
C, Expr *A,
475 SourceLocation StartLoc,
476 SourceLocation LParenLoc,
477 SourceLocation EndLoc);
492 private llvm::TrailingObjects<OMPAllocateClause, Expr *> {
495 friend TrailingObjects;
499 Expr *Allocator =
nullptr;
515 LParenLoc, EndLoc, N),
516 Allocator(Allocator), ColonLoc(ColonLoc) {}
527 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
529 void setAllocator(Expr *A) { Allocator = A; }
541 static OMPAllocateClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
542 SourceLocation LParenLoc, Expr *Allocator,
543 SourceLocation ColonLoc,
544 SourceLocation EndLoc, ArrayRef<Expr *> VL);
576 return T->getClauseKind() == llvm::omp::OMPC_allocate;
594 Stmt *Condition =
nullptr;
612 void setNameModifierLoc(SourceLocation
Loc) { NameModifierLoc =
Loc; }
615 void setColonLoc(SourceLocation
Loc) { ColonLoc =
Loc; }
636 ColonLoc(ColonLoc), NameModifier(NameModifier),
637 NameModifierLoc(NameModifierLoc) {
677 return T->getClauseKind() == llvm::omp::OMPC_if;
740 void setNumThreads(
Expr *NThreads) {
setStmt(NThreads); }
848 private llvm::TrailingObjects<OMPSizesClause, Expr *> {
861 NumSizes(NumSizes) {}
893 ->
template getTrailingObjects<Expr *>(),
898 ->
template getTrailingObjects<Expr *>(),
904 assert(VL.size() == NumSizes);
905 std::copy(VL.begin(), VL.end(),
907 ->template getTrailingObjects<Expr *>());
913 reinterpret_cast<Stmt **
>(Sizes.end()));
918 reinterpret_cast<Stmt *
const *
>(Sizes.end()));
929 return T->getClauseKind() == llvm::omp::OMPC_sizes;
980 void setFactor(Expr *
E) { Factor =
E; }
983 void setLParenLoc(SourceLocation
Loc) { LParenLoc =
Loc; }
993 static OMPPartialClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
994 SourceLocation LParenLoc,
995 SourceLocation EndLoc, Expr *Factor);
1000 static OMPPartialClause *
CreateEmpty(
const ASTContext &
C);
1021 return T->getClauseKind() == llvm::omp::OMPC_partial;
1075 llvm::omp::DefaultKind
Kind = llvm::omp::OMP_DEFAULT_unknown;
1083 void setDefaultKind(llvm::omp::DefaultKind K) {
Kind = K; }
1088 void setDefaultKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
1102 LParenLoc(LParenLoc),
Kind(A), KindKwLoc(ALoc) {}
1137 return T->getClauseKind() == llvm::omp::OMPC_default;
1156 llvm::omp::ProcBindKind
Kind = llvm::omp::OMP_PROC_BIND_unknown;
1164 void setProcBindKind(llvm::omp::ProcBindKind K) {
Kind = K; }
1169 void setProcBindKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
1184 LParenLoc(LParenLoc),
Kind(A), KindKwLoc(ALoc) {}
1219 return T->getClauseKind() == llvm::omp::OMPC_proc_bind;
1262 :
OMPClause(
llvm::omp::OMPC_unified_shared_memory, StartLoc, EndLoc) {}
1285 return T->getClauseKind() == llvm::omp::OMPC_unified_shared_memory;
1305 :
OMPClause(
llvm::omp::OMPC_reverse_offload, StartLoc, EndLoc) {}
1328 return T->getClauseKind() == llvm::omp::OMPC_reverse_offload;
1348 :
OMPClause(
llvm::omp::OMPC_dynamic_allocators, StartLoc, EndLoc) {}
1371 return T->getClauseKind() == llvm::omp::OMPC_dynamic_allocators;
1423 :
OMPClause(
llvm::omp::OMPC_atomic_default_mem_order, StartLoc, EndLoc),
1424 LParenLoc(LParenLoc),
Kind(A), KindKwLoc(ALoc) {}
1461 return T->getClauseKind() == llvm::omp::OMPC_atomic_default_mem_order;
1495 void setLParenLoc(SourceLocation
Loc) { LParenLoc =
Loc; }
1508 :
OMPClause(
llvm::omp::OMPC_at, StartLoc, EndLoc), LParenLoc(LParenLoc),
1509 Kind(A), KindKwLoc(ALoc) {}
1540 return T->getClauseKind() == llvm::omp::OMPC_at;
1571 void setSeverityKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
1574 void setLParenLoc(SourceLocation
Loc) { LParenLoc =
Loc; }
1588 LParenLoc(LParenLoc),
Kind(A), KindKwLoc(ALoc) {}
1620 return T->getClauseKind() == llvm::omp::OMPC_severity;
1638 Stmt *MessageString =
nullptr;
1641 void setMessageString(
Expr *MS) { MessageString = MS; }
1656 LParenLoc(LParenLoc), MessageString(MS) {}
1670 return child_range(&MessageString, &MessageString + 1);
1686 return T->getClauseKind() == llvm::omp::OMPC_message;
1707 enum {FIRST, SECOND, NUM_MODIFIERS};
1720 Expr *ChunkSize =
nullptr;
1731 Modifiers[FIRST] = M;
1738 Modifiers[SECOND] = M;
1742 void setFirstScheduleModifierLoc(SourceLocation
Loc) {
1743 ModifiersLoc[FIRST] =
Loc;
1747 void setSecondScheduleModifierLoc(SourceLocation
Loc) {
1748 ModifiersLoc[SECOND] =
Loc;
1756 Modifiers[FIRST] = M;
1759 Modifiers[SECOND] = M;
1766 void setLParenLoc(SourceLocation
Loc) { LParenLoc =
Loc; }
1771 void setScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
1776 void setCommaLoc(SourceLocation
Loc) { CommaLoc =
Loc; }
1781 void setChunkSize(Expr *
E) { ChunkSize =
E; }
1802 Expr *ChunkSize,
Stmt *HelperChunkSize,
1807 KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
1809 Modifiers[FIRST] = M1;
1810 Modifiers[SECOND] = M2;
1811 ModifiersLoc[FIRST] = M1Loc;
1812 ModifiersLoc[SECOND] = M2Loc;
1828 return Modifiers[FIRST];
1833 return Modifiers[SECOND];
1844 return ModifiersLoc[FIRST];
1849 return ModifiersLoc[SECOND];
1863 reinterpret_cast<Stmt **
>(&ChunkSize) + 1);
1879 return T->getClauseKind() == llvm::omp::OMPC_schedule;
1892 private llvm::TrailingObjects<OMPOrderedClause, Expr *> {
1894 friend TrailingObjects;
1900 Stmt *NumForLoops =
nullptr;
1903 unsigned NumberOfLoops = 0;
1915 LParenLoc(LParenLoc), NumForLoops(Num), NumberOfLoops(NumLoops) {}
1920 NumberOfLoops(NumLoops) {}
1923 void setNumForLoops(Expr *Num) { NumForLoops = Num; }
1933 static OMPOrderedClause *
Create(
const ASTContext &
C, Expr *Num,
1934 unsigned NumLoops, SourceLocation StartLoc,
1935 SourceLocation LParenLoc,
1936 SourceLocation EndLoc);
1939 static OMPOrderedClause*
CreateEmpty(
const ASTContext &
C,
unsigned NumLoops);
1975 return T->getClauseKind() == llvm::omp::OMPC_ordered;
2031 return T->getClauseKind() == llvm::omp::OMPC_untied;
2072 return T->getClauseKind() == llvm::omp::OMPC_mergeable;
2085 private llvm::TrailingObjects<OMPAbsentClause, OpenMPDirectiveKind> {
2087 friend TrailingObjects;
2098 llvm::omp::OMPC_absent, StartLoc, LParenLoc, EndLoc,
NumKinds) {}
2115 return C->getClauseKind() == llvm::omp::OMPC_absent;
2128 private llvm::TrailingObjects<OMPContainsClause, OpenMPDirectiveKind> {
2130 friend TrailingObjects;
2141 llvm::omp::OMPC_contains, StartLoc, LParenLoc, EndLoc,
NumKinds) {}
2158 return C->getClauseKind() == llvm::omp::OMPC_contains;
2289 return T->getClauseKind() == llvm::omp::OMPC_read;
2328 return T->getClauseKind() == llvm::omp::OMPC_write;
2349 private llvm::TrailingObjects<OMPUpdateClause, SourceLocation,
2350 OpenMPDependClauseKind> {
2352 friend TrailingObjects;
2355 bool IsExtended =
false;
2359 size_t numTrailingObjects(OverloadToken<SourceLocation>)
const {
2361 return IsExtended ? 2 : 0;
2366 assert(IsExtended &&
"Expected extended clause.");
2367 *getTrailingObjects<SourceLocation>() =
Loc;
2371 void setArgumentLoc(SourceLocation
Loc) {
2372 assert(IsExtended &&
"Expected extended clause.");
2373 *std::next(getTrailingObjects<SourceLocation>(), 1) =
Loc;
2378 assert(IsExtended &&
"Expected extended clause.");
2379 *getTrailingObjects<OpenMPDependClauseKind>() = DK;
2386 OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc,
2389 IsExtended(IsExtended) {}
2392 OMPUpdateClause(
bool IsExtended)
2393 :
OMPClause(
llvm::omp::OMPC_update, SourceLocation(), SourceLocation()),
2394 IsExtended(IsExtended) {}
2402 static OMPUpdateClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
2403 SourceLocation EndLoc);
2413 static OMPUpdateClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
2414 SourceLocation LParenLoc,
2415 SourceLocation ArgumentLoc,
2417 SourceLocation EndLoc);
2424 static OMPUpdateClause *
CreateEmpty(
const ASTContext &
C,
bool IsExtended);
2446 assert(IsExtended &&
"Expected extended clause.");
2447 return *getTrailingObjects<SourceLocation>();
2452 assert(IsExtended &&
"Expected extended clause.");
2453 return *std::next(getTrailingObjects<SourceLocation>(), 1);
2458 assert(IsExtended &&
"Expected extended clause.");
2459 return *getTrailingObjects<OpenMPDependClauseKind>();
2463 return T->getClauseKind() == llvm::omp::OMPC_update;
2504 return T->getClauseKind() == llvm::omp::OMPC_capture;
2545 return T->getClauseKind() == llvm::omp::OMPC_compare;
2586 return T->getClauseKind() == llvm::omp::OMPC_seq_cst;
2627 return T->getClauseKind() == llvm::omp::OMPC_acq_rel;
2668 return T->getClauseKind() == llvm::omp::OMPC_acquire;
2709 return T->getClauseKind() == llvm::omp::OMPC_release;
2750 return T->getClauseKind() == llvm::omp::OMPC_relaxed;
2790 return T->getClauseKind() == llvm::omp::OMPC_weak;
2819 this->FailParameter = FailParameter;
2821 "Invalid fail clause parameter");
2836 FailParameterLoc(FailParameterLoc), LParenLoc(LParenLoc) {
2838 setFailParameter(FailParameter);
2861 return T->getClauseKind() == llvm::omp::OMPC_fail;
2886 private llvm::TrailingObjects<OMPPrivateClause, Expr *> {
2889 friend TrailingObjects;
2900 LParenLoc, EndLoc, N) {}
2913 void setPrivateCopies(ArrayRef<Expr *> VL);
2917 MutableArrayRef<Expr *> getPrivateCopies() {
2920 ArrayRef<const Expr *> getPrivateCopies()
const {
2933 static OMPPrivateClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
2934 SourceLocation LParenLoc,
2935 SourceLocation EndLoc, ArrayRef<Expr *> VL,
2936 ArrayRef<Expr *> PrivateVL);
2942 static OMPPrivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
2948 llvm::iterator_range<private_copies_const_iterator>;
2952 getPrivateCopies().end());
2957 getPrivateCopies().end());
2978 return T->getClauseKind() == llvm::omp::OMPC_private;
2993 private llvm::TrailingObjects<OMPFirstprivateClause, Expr *> {
2996 friend TrailingObjects;
3007 StartLoc, LParenLoc, EndLoc, N),
3022 void setPrivateCopies(ArrayRef<Expr *> VL);
3026 MutableArrayRef<Expr *> getPrivateCopies() {
3029 ArrayRef<const Expr *> getPrivateCopies()
const {
3036 void setInits(ArrayRef<Expr *> VL);
3040 MutableArrayRef<Expr *> getInits() {
3041 return MutableArrayRef<Expr *>(getPrivateCopies().end(),
varlist_size());
3043 ArrayRef<const Expr *> getInits()
const {
3061 static OMPFirstprivateClause *
3062 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
3063 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PrivateVL,
3064 ArrayRef<Expr *> InitVL, Stmt *PreInit);
3070 static OMPFirstprivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
3076 llvm::iterator_range<private_copies_const_iterator>;
3080 getPrivateCopies().end());
3084 getPrivateCopies().end());
3093 return inits_range(getInits().begin(), getInits().end());
3119 return T->getClauseKind() == llvm::omp::OMPC_firstprivate;
3134 private llvm::TrailingObjects<OMPLastprivateClause, Expr *> {
3153 friend TrailingObjects;
3173 StartLoc, LParenLoc, EndLoc, N),
3175 ColonLoc(ColonLoc) {}
3188 MutableArrayRef<Expr *> getPrivateCopies() {
3191 ArrayRef<const Expr *> getPrivateCopies()
const {
3199 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
3202 MutableArrayRef<Expr *> getSourceExprs() {
3203 return MutableArrayRef<Expr *>(getPrivateCopies().end(),
varlist_size());
3205 ArrayRef<const Expr *> getSourceExprs()
const {
3213 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
3216 MutableArrayRef<Expr *> getDestinationExprs() {
3217 return MutableArrayRef<Expr *>(getSourceExprs().end(),
varlist_size());
3219 ArrayRef<const Expr *> getDestinationExprs()
const {
3226 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
3229 MutableArrayRef<Expr *> getAssignmentOps() {
3230 return MutableArrayRef<Expr *>(getDestinationExprs().end(),
varlist_size());
3232 ArrayRef<const Expr *> getAssignmentOps()
const {
3239 void setKindLoc(SourceLocation
Loc) { LPKindLoc =
Loc; }
3241 void setColonLoc(SourceLocation
Loc) { ColonLoc =
Loc; }
3271 static OMPLastprivateClause *
3272 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
3273 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
3274 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps,
3276 SourceLocation ColonLoc, Stmt *PreInit, Expr *PostUpdate);
3282 static OMPLastprivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
3295 llvm::iterator_range<helper_expr_const_iterator>;
3303 getPrivateCopies().end());
3308 getPrivateCopies().end());
3313 getSourceExprs().end());
3322 getDestinationExprs().end());
3327 getDestinationExprs().end());
3332 getAssignmentOps().end());
3337 getAssignmentOps().end());
3358 return T->getClauseKind() == llvm::omp::OMPC_lastprivate;
3371 private llvm::TrailingObjects<OMPSharedClause, Expr *> {
3373 friend TrailingObjects;
3384 LParenLoc, EndLoc, N) {}
3430 return T->getClauseKind() == llvm::omp::OMPC_shared;
3445 private llvm::TrailingObjects<OMPReductionClause, Expr *> {
3448 friend TrailingObjects;
3482 StartLoc, LParenLoc, EndLoc, N),
3484 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc),
3485 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
3500 void setModifierLoc(SourceLocation
Loc) { ModifierLoc =
Loc; }
3503 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
3506 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
3509 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
3514 void setPrivates(ArrayRef<Expr *> Privates);
3517 MutableArrayRef<Expr *> getPrivates() {
3520 ArrayRef<const Expr *> getPrivates()
const {
3527 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
3530 MutableArrayRef<Expr *> getLHSExprs() {
3531 return MutableArrayRef<Expr *>(getPrivates().end(),
varlist_size());
3533 ArrayRef<const Expr *> getLHSExprs()
const {
3542 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
3545 MutableArrayRef<Expr *> getRHSExprs() {
3546 return MutableArrayRef<Expr *>(getLHSExprs().end(),
varlist_size());
3548 ArrayRef<const Expr *> getRHSExprs()
const {
3556 void setReductionOps(ArrayRef<Expr *> ReductionOps);
3559 MutableArrayRef<Expr *> getReductionOps() {
3560 return MutableArrayRef<Expr *>(getRHSExprs().end(),
varlist_size());
3562 ArrayRef<const Expr *> getReductionOps()
const {
3568 void setInscanCopyOps(ArrayRef<Expr *> Ops);
3571 MutableArrayRef<Expr *> getInscanCopyOps() {
3572 return MutableArrayRef<Expr *>(getReductionOps().end(),
varlist_size());
3574 ArrayRef<const Expr *> getInscanCopyOps()
const {
3579 void setInscanCopyArrayTemps(ArrayRef<Expr *> CopyArrayTemps);
3582 MutableArrayRef<Expr *> getInscanCopyArrayTemps() {
3583 return MutableArrayRef<Expr *>(getInscanCopyOps().end(),
varlist_size());
3585 ArrayRef<const Expr *> getInscanCopyArrayTemps()
const {
3590 void setInscanCopyArrayElems(ArrayRef<Expr *> CopyArrayElems);
3593 MutableArrayRef<Expr *> getInscanCopyArrayElems() {
3594 return MutableArrayRef<Expr *>(getInscanCopyArrayTemps().end(),
3597 ArrayRef<const Expr *> getInscanCopyArrayElems()
const {
3641 static OMPReductionClause *
3642 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
3643 SourceLocation ModifierLoc, SourceLocation ColonLoc,
3645 ArrayRef<Expr *> VL, NestedNameSpecifierLoc QualifierLoc,
3646 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
3647 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
3648 ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> CopyOps,
3649 ArrayRef<Expr *> CopyArrayTemps, ArrayRef<Expr *> CopyArrayElems,
3650 Stmt *PreInit, Expr *PostUpdate);
3657 static OMPReductionClause *
3680 llvm::iterator_range<helper_expr_const_iterator>;
3708 getReductionOps().end());
3713 getReductionOps().end());
3718 getInscanCopyOps().end());
3723 getInscanCopyOps().end());
3728 getInscanCopyArrayTemps().end());
3733 getInscanCopyArrayTemps().end());
3738 getInscanCopyArrayElems().end());
3743 getInscanCopyArrayElems().end());
3766 return T->getClauseKind() == llvm::omp::OMPC_reduction;
3781 private llvm::TrailingObjects<OMPTaskReductionClause, Expr *> {
3784 friend TrailingObjects;
3809 llvm::omp::OMPC_task_reduction, StartLoc, LParenLoc, EndLoc, N),
3811 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
3823 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
3826 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
3829 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
3833 void setPrivates(ArrayRef<Expr *> Privates);
3836 MutableArrayRef<Expr *> getPrivates() {
3839 ArrayRef<const Expr *> getPrivates()
const {
3846 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
3849 MutableArrayRef<Expr *> getLHSExprs() {
3850 return MutableArrayRef<Expr *>(getPrivates().end(),
varlist_size());
3852 ArrayRef<const Expr *> getLHSExprs()
const {
3860 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
3863 MutableArrayRef<Expr *> getRHSExprs() {
3864 return MutableArrayRef<Expr *>(getLHSExprs().end(),
varlist_size());
3866 ArrayRef<const Expr *> getRHSExprs()
const {
3874 void setReductionOps(ArrayRef<Expr *> ReductionOps);
3877 MutableArrayRef<Expr *> getReductionOps() {
3878 return MutableArrayRef<Expr *>(getRHSExprs().end(),
varlist_size());
3880 ArrayRef<const Expr *> getReductionOps()
const {
3917 static OMPTaskReductionClause *
3918 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
3919 SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
3920 NestedNameSpecifierLoc QualifierLoc,
3921 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
3922 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
3923 ArrayRef<Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate);
3929 static OMPTaskReductionClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
3944 llvm::iterator_range<helper_expr_const_iterator>;
3972 getReductionOps().end());
3977 getReductionOps().end());
3998 return T->getClauseKind() == llvm::omp::OMPC_task_reduction;
4012 private llvm::TrailingObjects<OMPInReductionClause, Expr *> {
4015 friend TrailingObjects;
4040 StartLoc, LParenLoc, EndLoc, N),
4042 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
4054 void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
4057 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
4060 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
4064 void setPrivates(ArrayRef<Expr *> Privates);
4067 MutableArrayRef<Expr *> getPrivates() {
4070 ArrayRef<const Expr *> getPrivates()
const {
4077 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
4080 MutableArrayRef<Expr *> getLHSExprs() {
4081 return MutableArrayRef<Expr *>(getPrivates().end(),
varlist_size());
4083 ArrayRef<const Expr *> getLHSExprs()
const {
4091 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
4094 MutableArrayRef<Expr *> getRHSExprs() {
4095 return MutableArrayRef<Expr *>(getLHSExprs().end(),
varlist_size());
4097 ArrayRef<const Expr *> getRHSExprs()
const {
4105 void setReductionOps(ArrayRef<Expr *> ReductionOps);
4108 MutableArrayRef<Expr *> getReductionOps() {
4109 return MutableArrayRef<Expr *>(getRHSExprs().end(),
varlist_size());
4111 ArrayRef<const Expr *> getReductionOps()
const {
4116 void setTaskgroupDescriptors(ArrayRef<Expr *> ReductionOps);
4119 MutableArrayRef<Expr *> getTaskgroupDescriptors() {
4120 return MutableArrayRef<Expr *>(getReductionOps().end(),
varlist_size());
4122 ArrayRef<const Expr *> getTaskgroupDescriptors()
const {
4161 static OMPInReductionClause *
4162 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
4163 SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
4164 NestedNameSpecifierLoc QualifierLoc,
4165 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
4166 ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
4167 ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> TaskgroupDescriptors,
4168 Stmt *PreInit, Expr *PostUpdate);
4174 static OMPInReductionClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
4189 llvm::iterator_range<helper_expr_const_iterator>;
4217 getReductionOps().end());
4222 getReductionOps().end());
4227 getTaskgroupDescriptors().end());
4232 getTaskgroupDescriptors().end());
4253 return T->getClauseKind() == llvm::omp::OMPC_in_reduction;
4268 private llvm::TrailingObjects<OMPLinearClause, Expr *> {
4271 friend TrailingObjects;
4286 void setStep(
Expr *Step) { *(getFinals().end()) = Step; }
4289 void setCalcStep(
Expr *CalcStep) { *(getFinals().end() + 1) = CalcStep; }
4299 OMPLinearClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4301 SourceLocation ColonLoc, SourceLocation StepModifierLoc,
4302 SourceLocation EndLoc,
unsigned NumVars)
4303 : OMPVarListClause<OMPLinearClause>(
llvm::omp::OMPC_linear, StartLoc,
4304 LParenLoc, EndLoc, NumVars),
4305 OMPClauseWithPostUpdate(this), Modifier(Modifier),
4306 ModifierLoc(ModifierLoc), ColonLoc(ColonLoc),
4307 StepModifierLoc(StepModifierLoc) {}
4312 explicit OMPLinearClause(
unsigned NumVars)
4313 : OMPVarListClause<OMPLinearClause>(
llvm::omp::OMPC_linear,
4314 SourceLocation(), SourceLocation(),
4315 SourceLocation(), NumVars),
4330 MutableArrayRef<Expr *> getPrivates() {
4333 ArrayRef<const Expr *> getPrivates()
const {
4337 MutableArrayRef<Expr *> getInits() {
4338 return MutableArrayRef<Expr *>(getPrivates().end(),
varlist_size());
4340 ArrayRef<const Expr *> getInits()
const {
4345 MutableArrayRef<Expr *> getUpdates() {
4346 return MutableArrayRef<Expr *>(getInits().end(),
varlist_size());
4348 ArrayRef<const Expr *> getUpdates()
const {
4353 MutableArrayRef<Expr *> getFinals() {
4354 return MutableArrayRef<Expr *>(getUpdates().end(),
varlist_size());
4356 ArrayRef<const Expr *> getFinals()
const {
4361 MutableArrayRef<Expr *> getUsedExprs() {
4362 return MutableArrayRef<Expr *>(getFinals().end() + 2,
varlist_size() + 1);
4364 ArrayRef<const Expr *> getUsedExprs()
const {
4370 void setPrivates(ArrayRef<Expr *> PL);
4374 void setInits(ArrayRef<Expr *> IL);
4397 static OMPLinearClause *
4398 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
4400 SourceLocation ColonLoc, SourceLocation StepModifierLoc,
4401 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PL,
4402 ArrayRef<Expr *> IL, Expr *Step, Expr *CalcStep, Stmt *PreInit,
4409 static OMPLinearClause *
CreateEmpty(
const ASTContext &
C,
unsigned NumVars);
4464 return privates_range(getPrivates().begin(), getPrivates().end());
4477 return inits_range(getInits().begin(), getInits().end());
4490 return updates_range(getUpdates().begin(), getUpdates().end());
4503 return finals_range(getFinals().begin(), getFinals().end());
4513 llvm::iterator_range<used_expressions_iterator>;
4515 llvm::iterator_range<used_expressions_const_iterator>;
4518 return finals_range(getUsedExprs().begin(), getUsedExprs().end());
4543 return T->getClauseKind() == llvm::omp::OMPC_linear;
4557 private llvm::TrailingObjects<OMPAlignedClause, Expr *> {
4560 friend TrailingObjects;
4579 LParenLoc, EndLoc, NumVars),
4580 ColonLoc(ColonLoc) {}
4585 explicit OMPAlignedClause(
unsigned NumVars)
4586 : OMPVarListClause<OMPAlignedClause>(
llvm::omp::OMPC_aligned,
4587 SourceLocation(), SourceLocation(),
4588 SourceLocation(), NumVars) {}
4600 static OMPAlignedClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
4601 SourceLocation LParenLoc,
4602 SourceLocation ColonLoc,
4603 SourceLocation EndLoc, ArrayRef<Expr *> VL,
4610 static OMPAlignedClause *
CreateEmpty(
const ASTContext &
C,
unsigned NumVars);
4642 return T->getClauseKind() == llvm::omp::OMPC_aligned;
4655 private llvm::TrailingObjects<OMPCopyinClause, Expr *> {