19 #include "llvm/ADT/SmallPtrSet.h" 20 #include "llvm/Support/Casting.h" 21 #include "llvm/Support/ErrorHandling.h" 25 using namespace clang;
31 #define OPENMP_CLAUSE(Name, Class) \ 33 return static_cast<Class *>(this)->children(); 34 #include "clang/Basic/OpenMPKinds.def" 36 llvm_unreachable(
"unknown OMPClause");
41 #define OPENMP_CLAUSE(Name, Class) \ 43 return static_cast<Class *>(this)->used_children(); 44 #include "clang/Basic/OpenMPKinds.def" 52 llvm_unreachable(
"unknown OMPClause");
64 case OMPC_dist_schedule:
66 case OMPC_firstprivate:
68 case OMPC_lastprivate:
72 case OMPC_task_reduction:
74 case OMPC_in_reduction:
80 case OMPC_num_threads:
84 case OMPC_thread_limit:
107 case OMPC_copyprivate:
125 case OMPC_defaultmap:
130 case OMPC_use_device_ptr:
131 case OMPC_is_device_ptr:
132 case OMPC_unified_address:
133 case OMPC_unified_shared_memory:
134 case OMPC_reverse_offload:
135 case OMPC_dynamic_allocators:
136 case OMPC_atomic_default_mem_order:
139 case OMPC_nontemporal:
153 case OMPC_lastprivate:
157 case OMPC_task_reduction:
159 case OMPC_in_reduction:
164 case OMPC_dist_schedule:
165 case OMPC_firstprivate:
170 case OMPC_num_threads:
180 case OMPC_copyprivate:
198 case OMPC_thread_limit:
204 case OMPC_defaultmap:
209 case OMPC_use_device_ptr:
210 case OMPC_is_device_ptr:
211 case OMPC_unified_address:
212 case OMPC_unified_shared_memory:
213 case OMPC_reverse_offload:
214 case OMPC_dynamic_allocators:
215 case OMPC_atomic_default_mem_order:
218 case OMPC_nontemporal:
230 if (
auto *DS = dyn_cast<DeclStmt>(S)) {
231 assert(DS->isSingleDecl() &&
"Only single expression must be captured.");
232 if (
auto *OED = dyn_cast<OMPCapturedExprDecl>(DS->getSingleDecl()))
233 return OED->getInitAddress();
273 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(2 * NumLoops));
276 for (
unsigned I = 0; I < NumLoops; ++I) {
278 Clause->setLoopCounter(I,
nullptr);
285 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(2 * NumLoops));
287 for (
unsigned I = 0; I < NumLoops; ++I) {
289 Clause->setLoopCounter(I,
nullptr);
295 Expr *NumIterations) {
296 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
297 getTrailingObjects<Expr *>()[NumLoop] = NumIterations;
301 return llvm::makeArrayRef(getTrailingObjects<Expr *>(), NumberOfLoops);
305 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
306 getTrailingObjects<Expr *>()[NumberOfLoops + NumLoop] = Counter;
310 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
311 return getTrailingObjects<Expr *>()[NumberOfLoops + NumLoop];
315 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
316 return getTrailingObjects<Expr *>()[NumberOfLoops + NumLoop];
320 assert(VL.size() == varlist_size() &&
321 "Number of private copies is not the same as the preallocated buffer");
322 std::copy(VL.begin(), VL.end(), varlist_end());
330 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(2 * VL.size()));
334 Clause->setPrivateCopies(PrivateVL);
340 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(2 * N));
345 assert(VL.size() == varlist_size() &&
346 "Number of private copies is not the same as the preallocated buffer");
347 std::copy(VL.begin(), VL.end(), varlist_end());
351 assert(VL.size() == varlist_size() &&
352 "Number of inits is not the same as the preallocated buffer");
353 std::copy(VL.begin(), VL.end(), getPrivateCopies().end());
361 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(3 * VL.size()));
365 Clause->setPrivateCopies(PrivateVL);
366 Clause->setInits(InitVL);
373 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(3 * N));
378 assert(PrivateCopies.size() == varlist_size() &&
379 "Number of private copies is not the same as the preallocated buffer");
380 std::copy(PrivateCopies.begin(), PrivateCopies.end(), varlist_end());
384 assert(SrcExprs.size() == varlist_size() &&
"Number of source expressions is " 385 "not the same as the " 386 "preallocated buffer");
387 std::copy(SrcExprs.begin(), SrcExprs.end(), getPrivateCopies().end());
391 assert(DstExprs.size() == varlist_size() &&
"Number of destination " 392 "expressions is not the same as " 393 "the preallocated buffer");
394 std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
397 void OMPLastprivateClause::setAssignmentOps(
ArrayRef<Expr *> AssignmentOps) {
398 assert(AssignmentOps.size() == varlist_size() &&
399 "Number of assignment expressions is not the same as the preallocated " 401 std::copy(AssignmentOps.begin(), AssignmentOps.end(),
402 getDestinationExprs().end());
411 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
413 StartLoc, LParenLoc, EndLoc, LPKind, LPKindLoc, ColonLoc, VL.size());
415 Clause->setSourceExprs(SrcExprs);
416 Clause->setDestinationExprs(DstExprs);
417 Clause->setAssignmentOps(AssignmentOps);
425 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * N));
434 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(VL.size()));
442 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(N));
447 assert(PL.size() == varlist_size() &&
448 "Number of privates is not the same as the preallocated buffer");
449 std::copy(PL.begin(), PL.end(), varlist_end());
453 assert(IL.size() == varlist_size() &&
454 "Number of inits is not the same as the preallocated buffer");
455 std::copy(IL.begin(), IL.end(),
getPrivates().end());
459 assert(UL.size() == varlist_size() &&
460 "Number of updates is not the same as the preallocated buffer");
461 std::copy(UL.begin(), UL.end(),
getInits().end());
465 assert(FL.size() == varlist_size() &&
466 "Number of final updates is not the same as the preallocated buffer");
467 std::copy(FL.begin(), FL.end(),
getUpdates().end());
472 UE.size() == varlist_size() + 1 &&
473 "Number of used expressions is not the same as the preallocated buffer");
474 std::copy(UE.begin(), UE.end(),
getFinals().end() + 2);
486 C.
Allocate(totalSizeToAlloc<Expr *>(5 * VL.size() + 2 + VL.size() + 1));
488 StartLoc, LParenLoc,
Modifier, ModifierLoc, ColonLoc, EndLoc, VL.size());
490 Clause->setPrivates(PL);
491 Clause->setInits(IL);
494 std::fill(Clause->getInits().end(), Clause->getInits().end() + VL.size(),
496 std::fill(Clause->getUpdates().end(), Clause->getUpdates().end() + VL.size(),
498 std::fill(Clause->getUsedExprs().begin(), Clause->getUsedExprs().end(),
500 Clause->setStep(Step);
501 Clause->setCalcStep(CalcStep);
511 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * NumVars + 2 + NumVars +1));
519 reinterpret_cast<Stmt **>(llvm::find(
getUsedExprs(),
nullptr)));
526 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
529 Clause->setVarRefs(VL);
530 Clause->setAlignment(A);
536 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(NumVars + 1));
541 assert(SrcExprs.size() == varlist_size() &&
"Number of source expressions is " 542 "not the same as the " 543 "preallocated buffer");
544 std::copy(SrcExprs.begin(), SrcExprs.end(), varlist_end());
548 assert(DstExprs.size() == varlist_size() &&
"Number of destination " 549 "expressions is not the same as " 550 "the preallocated buffer");
551 std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
555 assert(AssignmentOps.size() == varlist_size() &&
556 "Number of assignment expressions is not the same as the preallocated " 558 std::copy(AssignmentOps.begin(), AssignmentOps.end(),
559 getDestinationExprs().end());
564 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
565 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps) {
566 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(4 * VL.size()));
569 Clause->setVarRefs(VL);
570 Clause->setSourceExprs(SrcExprs);
571 Clause->setDestinationExprs(DstExprs);
572 Clause->setAssignmentOps(AssignmentOps);
577 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(4 * N));
581 void OMPCopyprivateClause::setSourceExprs(ArrayRef<Expr *> SrcExprs) {
582 assert(SrcExprs.size() == varlist_size() &&
"Number of source expressions is " 583 "not the same as the " 584 "preallocated buffer");
585 std::copy(SrcExprs.begin(), SrcExprs.end(), varlist_end());
588 void OMPCopyprivateClause::setDestinationExprs(ArrayRef<Expr *> DstExprs) {
589 assert(DstExprs.size() == varlist_size() &&
"Number of destination " 590 "expressions is not the same as " 591 "the preallocated buffer");
592 std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
595 void OMPCopyprivateClause::setAssignmentOps(ArrayRef<Expr *> AssignmentOps) {
596 assert(AssignmentOps.size() == varlist_size() &&
597 "Number of assignment expressions is not the same as the preallocated " 599 std::copy(AssignmentOps.begin(), AssignmentOps.end(),
600 getDestinationExprs().end());
605 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
606 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps) {
607 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(4 * VL.size()));
610 Clause->setVarRefs(VL);
611 Clause->setSourceExprs(SrcExprs);
612 Clause->setDestinationExprs(DstExprs);
613 Clause->setAssignmentOps(AssignmentOps);
619 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(4 * N));
623 void OMPReductionClause::setPrivates(ArrayRef<Expr *>
Privates) {
624 assert(Privates.size() == varlist_size() &&
625 "Number of private copies is not the same as the preallocated buffer");
626 std::copy(Privates.begin(), Privates.end(), varlist_end());
629 void OMPReductionClause::setLHSExprs(ArrayRef<Expr *> LHSExprs) {
631 LHSExprs.size() == varlist_size() &&
632 "Number of LHS expressions is not the same as the preallocated buffer");
633 std::copy(LHSExprs.begin(), LHSExprs.end(),
getPrivates().end());
636 void OMPReductionClause::setRHSExprs(ArrayRef<Expr *> RHSExprs) {
638 RHSExprs.size() == varlist_size() &&
639 "Number of RHS expressions is not the same as the preallocated buffer");
640 std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
643 void OMPReductionClause::setReductionOps(ArrayRef<Expr *> ReductionOps) {
644 assert(ReductionOps.size() == varlist_size() &&
"Number of reduction " 645 "expressions is not the same " 646 "as the preallocated buffer");
647 std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
657 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
659 StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
661 Clause->setPrivates(Privates);
662 Clause->setLHSExprs(LHSExprs);
663 Clause->setRHSExprs(RHSExprs);
664 Clause->setReductionOps(ReductionOps);
672 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * N));
677 assert(Privates.size() == varlist_size() &&
678 "Number of private copies is not the same as the preallocated buffer");
679 std::copy(Privates.begin(), Privates.end(), varlist_end());
684 LHSExprs.size() == varlist_size() &&
685 "Number of LHS expressions is not the same as the preallocated buffer");
686 std::copy(LHSExprs.begin(), LHSExprs.end(),
getPrivates().end());
691 RHSExprs.size() == varlist_size() &&
692 "Number of RHS expressions is not the same as the preallocated buffer");
693 std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
696 void OMPTaskReductionClause::setReductionOps(
ArrayRef<Expr *> ReductionOps) {
697 assert(ReductionOps.size() == varlist_size() &&
"Number of task reduction " 698 "expressions is not the same " 699 "as the preallocated buffer");
700 std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
710 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
712 StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
714 Clause->setPrivates(Privates);
715 Clause->setLHSExprs(LHSExprs);
716 Clause->setRHSExprs(RHSExprs);
717 Clause->setReductionOps(ReductionOps);
725 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * N));
730 assert(Privates.size() == varlist_size() &&
731 "Number of private copies is not the same as the preallocated buffer");
732 std::copy(Privates.begin(), Privates.end(), varlist_end());
737 LHSExprs.size() == varlist_size() &&
738 "Number of LHS expressions is not the same as the preallocated buffer");
739 std::copy(LHSExprs.begin(), LHSExprs.end(),
getPrivates().end());
744 RHSExprs.size() == varlist_size() &&
745 "Number of RHS expressions is not the same as the preallocated buffer");
746 std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
750 assert(ReductionOps.size() == varlist_size() &&
"Number of in reduction " 751 "expressions is not the same " 752 "as the preallocated buffer");
753 std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
756 void OMPInReductionClause::setTaskgroupDescriptors(
758 assert(TaskgroupDescriptors.size() == varlist_size() &&
759 "Number of in reduction descriptors is not the same as the " 760 "preallocated buffer");
761 std::copy(TaskgroupDescriptors.begin(), TaskgroupDescriptors.end(),
762 getReductionOps().end());
772 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(6 * VL.size()));
774 StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
776 Clause->setPrivates(Privates);
777 Clause->setLHSExprs(LHSExprs);
778 Clause->setRHSExprs(RHSExprs);
779 Clause->setReductionOps(ReductionOps);
780 Clause->setTaskgroupDescriptors(TaskgroupDescriptors);
788 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(6 * N));
798 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(VL.size()));
800 ColonLoc, EndLoc, VL.size());
807 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(N));
816 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
819 Clause->setVarRefs(VL);
824 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(N));
834 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(VL.size() + NumLoops));
837 Clause->setVarRefs(VL);
838 Clause->setDependencyKind(DepKind);
839 Clause->setDependencyLoc(DepLoc);
840 Clause->setColonLoc(ColonLoc);
841 for (
unsigned I = 0 ; I < NumLoops; ++I)
848 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(N + NumLoops));
853 assert((getDependencyKind() == OMPC_DEPEND_sink ||
854 getDependencyKind() == OMPC_DEPEND_source) &&
855 NumLoop < NumLoops &&
856 "Expected sink or source depend + loop index must be less number of " 858 auto It = std::next(getVarRefs().end(), NumLoop);
863 assert((getDependencyKind() == OMPC_DEPEND_sink ||
864 getDependencyKind() == OMPC_DEPEND_source) &&
865 NumLoop < NumLoops &&
866 "Expected sink or source depend + loop index must be less number of " 868 auto It = std::next(getVarRefs().end(), NumLoop);
873 assert((getDependencyKind() == OMPC_DEPEND_sink ||
874 getDependencyKind() == OMPC_DEPEND_source) &&
875 NumLoop < NumLoops &&
876 "Expected sink or source depend + loop index must be less number of " 878 auto It = std::next(getVarRefs().end(), NumLoop);
884 unsigned TotalNum = 0u;
885 for (
auto &C : ComponentLists)
886 TotalNum += C.size();
891 ArrayRef<const ValueDecl *> Declarations) {
892 unsigned TotalNum = 0u;
893 llvm::SmallPtrSet<const ValueDecl *, 8>
Cache;
894 for (
const ValueDecl *D : Declarations) {
895 const ValueDecl *VD = D ? cast<ValueDecl>(D->getCanonicalDecl()) :
nullptr;
916 Sizes.
NumComponents = getComponentsTotalNumber(ComponentLists);
935 OMPMapClause(MapModifiers, MapModifiersLoc, UDMQualifierLoc, MapperId,
936 Type, TypeIsImplicit, TypeLoc, Locs, Sizes);
938 Clause->setVarRefs(Vars);
941 Clause->setMapType(Type);
942 Clause->setMapLoc(TypeLoc);
967 Sizes.
NumComponents = getComponentsTotalNumber(ComponentLists);
986 auto *Clause =
new (Mem)
OMPToClause(UDMQualifierLoc, MapperId, Locs, Sizes);
988 Clause->setVarRefs(Vars);
990 Clause->setClauseInfo(Declarations, ComponentLists);
1014 Sizes.
NumComponents = getComponentsTotalNumber(ComponentLists);
1034 new (Mem)
OMPFromClause(UDMQualifierLoc, MapperId, Locs, Sizes);
1036 Clause->setVarRefs(Vars);
1038 Clause->setClauseInfo(Declarations, ComponentLists);
1055 assert(VL.size() == varlist_size() &&
1056 "Number of private copies is not the same as the preallocated buffer");
1057 std::copy(VL.begin(), VL.end(), varlist_end());
1061 assert(VL.size() == varlist_size() &&
1062 "Number of inits is not the same as the preallocated buffer");
1063 std::copy(VL.begin(), VL.end(), getPrivateCopies().end());
1068 ArrayRef<Expr *> PrivateVars, ArrayRef<Expr *>
Inits,
1069 ArrayRef<ValueDecl *> Declarations,
1075 Sizes.
NumComponents = getComponentsTotalNumber(ComponentLists);
1096 Clause->setVarRefs(Vars);
1097 Clause->setPrivateCopies(PrivateVars);
1098 Clause->setInits(Inits);
1124 Sizes.
NumComponents = getComponentsTotalNumber(ComponentLists);
1145 Clause->setVarRefs(Vars);
1166 ArrayRef<Expr *> VL) {
1168 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(2 * VL.size()));
1171 Clause->setVarRefs(VL);
1177 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(2 * N));
1182 assert(VL.size() == varlist_size() &&
"Number of private references is not " 1183 "the same as the preallocated buffer");
1184 std::copy(VL.begin(), VL.end(), varlist_end());
1199 void OMPClausePrinter::VisitOMPFinalClause(
OMPFinalClause *Node) {
1206 OS <<
"num_threads(";
1249 OS <<
"unified_address";
1252 void OMPClausePrinter::VisitOMPUnifiedSharedMemoryClause(
1254 OS <<
"unified_shared_memory";
1258 OS <<
"reverse_offload";
1261 void OMPClausePrinter::VisitOMPDynamicAllocatorsClause(
1263 OS <<
"dynamic_allocators";
1266 void OMPClausePrinter::VisitOMPAtomicDefaultMemOrderClause(
1268 OS <<
"atomic_default_mem_order(" 1289 E->printPretty(OS,
nullptr, Policy);
1298 Num->printPretty(OS,
nullptr, Policy, 0);
1319 void OMPClausePrinter::VisitOMPReadClause(
OMPReadClause *) { OS <<
"read"; }
1321 void OMPClausePrinter::VisitOMPWriteClause(
OMPWriteClause *) { OS <<
"write"; }
1339 void OMPClausePrinter::VisitOMPSIMDClause(
OMPSIMDClause *) { OS <<
"simd"; }
1354 OS <<
"thread_limit(";
1377 void OMPClausePrinter::VisitOMPHintClause(
OMPHintClause *Node) {
1383 template<
typename T>
1384 void OMPClausePrinter::VisitOMPClauseList(T *Node,
char StartSym) {
1385 for (
typename T::varlist_iterator I = Node->varlist_begin(),
1386 E = Node->varlist_end();
1388 assert(*I &&
"Expected non-null Stmt");
1389 OS << (I == Node->varlist_begin() ? StartSym :
',');
1390 if (
auto *DRE = dyn_cast<DeclRefExpr>(*I)) {
1391 if (isa<OMPCapturedExprDecl>(DRE->getDecl()))
1392 DRE->printPretty(OS,
nullptr, Policy, 0);
1394 DRE->getDecl()->printQualifiedName(OS);
1396 (*I)->printPretty(OS,
nullptr, Policy, 0);
1406 Allocator->printPretty(OS,
nullptr, Policy, 0);
1408 VisitOMPClauseList(Node,
' ');
1410 VisitOMPClauseList(Node,
'(');
1418 VisitOMPClauseList(Node,
'(');
1425 OS <<
"firstprivate";
1426 VisitOMPClauseList(Node,
'(');
1433 OS <<
"lastprivate";
1448 VisitOMPClauseList(Node,
'(');
1460 if (QualifierLoc ==
nullptr && OOK !=
OO_None) {
1465 if (QualifierLoc !=
nullptr)
1466 QualifierLoc->
print(OS, Policy);
1470 VisitOMPClauseList(Node,
' ');
1475 void OMPClausePrinter::VisitOMPTaskReductionClause(
1478 OS <<
"task_reduction(";
1483 if (QualifierLoc ==
nullptr && OOK !=
OO_None) {
1488 if (QualifierLoc !=
nullptr)
1489 QualifierLoc->
print(OS, Policy);
1493 VisitOMPClauseList(Node,
' ');
1500 OS <<
"in_reduction(";
1505 if (QualifierLoc ==
nullptr && OOK !=
OO_None) {
1510 if (QualifierLoc !=
nullptr)
1511 QualifierLoc->
print(OS, Policy);
1515 VisitOMPClauseList(Node,
' ');
1523 if (Node->getModifierLoc().isValid()) {
1527 VisitOMPClauseList(Node,
'(');
1528 if (Node->getModifierLoc().isValid())
1530 if (Node->getStep() !=
nullptr) {
1532 Node->getStep()->printPretty(OS,
nullptr, Policy, 0);
1539 if (!Node->varlist_empty()) {
1541 VisitOMPClauseList(Node,
'(');
1551 if (!Node->varlist_empty()) {
1553 VisitOMPClauseList(Node,
'(');
1559 if (!Node->varlist_empty()) {
1560 OS <<
"copyprivate";
1561 VisitOMPClauseList(Node,
'(');
1566 void OMPClausePrinter::VisitOMPFlushClause(
OMPFlushClause *Node) {
1567 if (!Node->varlist_empty()) {
1568 VisitOMPClauseList(Node,
'(');
1577 if (!Node->varlist_empty()) {
1579 VisitOMPClauseList(Node,
' ');
1584 void OMPClausePrinter::VisitOMPMapClause(
OMPMapClause *Node) {
1585 if (!Node->varlist_empty()) {
1597 MapperNNS->
print(OS, Policy);
1606 VisitOMPClauseList(Node,
' ');
1611 void OMPClausePrinter::VisitOMPToClause(
OMPToClause *Node) {
1612 if (!Node->varlist_empty()) {
1621 MapperNNS->
print(OS, Policy);
1622 OS << MapperId <<
"):";
1623 VisitOMPClauseList(Node,
' ');
1625 VisitOMPClauseList(Node,
'(');
1631 void OMPClausePrinter::VisitOMPFromClause(
OMPFromClause *Node) {
1632 if (!Node->varlist_empty()) {
1641 MapperNNS->
print(OS, Policy);
1642 OS << MapperId <<
"):";
1643 VisitOMPClauseList(Node,
' ');
1645 VisitOMPClauseList(Node,
'(');
1656 E->printPretty(OS,
nullptr, Policy);
1662 OS <<
"defaultmap(";
1672 if (!Node->varlist_empty()) {
1673 OS <<
"use_device_ptr";
1674 VisitOMPClauseList(Node,
'(');
1680 if (!Node->varlist_empty()) {
1681 OS <<
"is_device_ptr";
1682 VisitOMPClauseList(Node,
'(');
1688 if (!Node->varlist_empty()) {
1689 OS <<
"nontemporal";
1690 VisitOMPClauseList(Node,
'(');
static OMPTaskReductionClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, ArrayRef< Expr *> Privates, ArrayRef< Expr *> LHSExprs, ArrayRef< Expr *> RHSExprs, ArrayRef< Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL.
Defines the clang::ASTContext interface.
static OMPToClause * Create(const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef< Expr *> Vars, ArrayRef< ValueDecl *> Declarations, MappableExprComponentListsRef ComponentLists, ArrayRef< Expr *> UDMapperRefs, NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId)
Creates clause with a list of variables Vars.
This represents 'thread_limit' clause in the '#pragma omp ...' directive.
static OMPCopyinClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
This represents clause 'copyin' in the '#pragma omp ...' directives.
bool varlist_empty() const
llvm::omp::ProcBindKind getProcBindKind() const
Returns kind of the clause.
This represents 'atomic_default_mem_order' clause in the '#pragma omp requires' directive.
static OMPCopyprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, ArrayRef< Expr *> SrcExprs, ArrayRef< Expr *> DstExprs, ArrayRef< Expr *> AssignmentOps)
Creates clause with a list of variables VL.
TypePropertyCache< Private > Cache
static OMPClauseWithPreInit * get(OMPClause *C)
Stmt - This represents one statement.
This represents clause 'in_reduction' in the '#pragma omp task' directives.
Expr * getLoopData(unsigned NumLoop)
Get the loop data.
Class that handles pre-initialization statement for some clauses, like 'shedule', 'firstprivate' etc...
Expr * getAllocator() const
Returns allocator.
child_range used_children()
static OMPFirstprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents 'grainsize' clause in the '#pragma omp ...' directive.
static constexpr unsigned NumberOfModifiers
Number of allowed map-type-modifiers.
This represents 'if' clause in the '#pragma omp ...' directive.
OverloadedOperatorKind getCXXOverloadedOperator() const
If this name is the name of an overloadable operator in C++ (e.g., operator+), retrieve the kind of o...
This represents 'priority' clause in the '#pragma omp ...' directive.
The base class of the type hierarchy.
MutableArrayRef< Expr * > getUsedExprs()
Gets the list of used expressions for linear variables.
const char * getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type)
Expr * getCondition() const
Returns condition.
This represents 'update' clause in the '#pragma omp atomic' directive.
bool isEmpty() const
Evaluates true when this declaration name is empty.
Expr * getCondition() const
Returns condition.
Expr * getAlignment()
Returns alignment.
Expr * getNumForLoops() const
Return the number of associated for-loops.
OpenMPMapModifierKind getMapTypeModifier(unsigned Cnt) const LLVM_READONLY
Fetches the map-type-modifier at 'Cnt' index of array of modifiers.
static OMPReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
static OMPUseDevicePtrClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars variables.
This represents 'read' clause in the '#pragma omp atomic' directive.
static OMPUseDevicePtrClause * Create(const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef< Expr *> Vars, ArrayRef< Expr *> PrivateVars, ArrayRef< Expr *> Inits, ArrayRef< ValueDecl *> Declarations, MappableExprComponentListsRef ComponentLists)
Creates clause with a list of variables Vars.
This represents clause 'private' in the '#pragma omp ...' directives.
This represents 'num_threads' clause in the '#pragma omp ...' directive.
This represents 'defaultmap' clause in the '#pragma omp ...' directive.
void setUpdates(ArrayRef< Expr *> UL)
Sets the list of update expressions for linear variables.
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
This represents 'reverse_offload' clause in the '#pragma omp requires' directive. ...
static OMPTaskReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
Expr * getGrainsize() const
Return safe iteration space distance.
This represents 'nogroup' clause in the '#pragma omp ...' directive.
This represents 'allocator' clause in the '#pragma omp ...' directive.
This represents 'safelen' clause in the '#pragma omp ...' directive.
static OMPOrderedClause * CreateEmpty(const ASTContext &C, unsigned NumLoops)
Build an empty clause.
Base wrapper for a particular "section" of type source info.
static OMPReductionClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, ArrayRef< Expr *> Privates, ArrayRef< Expr *> LHSExprs, ArrayRef< Expr *> RHSExprs, ArrayRef< Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL.
static OMPInReductionClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, ArrayRef< Expr *> Privates, ArrayRef< Expr *> LHSExprs, ArrayRef< Expr *> RHSExprs, ArrayRef< Expr *> ReductionOps, ArrayRef< Expr *> TaskgroupDescriptors, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL.
clang::OMPLinearClause OMPVarListClause, OMPClauseWithPostUpdate, llvm::TrailingObjects getPrivates()
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
static OMPAllocateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents 'simd' clause in the '#pragma omp ...' directive.
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
This represents clause 'lastprivate' in the '#pragma omp ...' directives.
This represents clause 'allocate' in the '#pragma omp ...' directives.
void setLoopNumIterations(unsigned NumLoop, Expr *NumIterations)
Set number of iterations for the specified loop.
Expr * getChunkSize()
Get chunk size.
This represents clause 'map' in the '#pragma omp ...' directives.
void setPrivateRefs(ArrayRef< Expr *> VL)
Sets the list of references to private copies created in private clauses.
This represents clause 'to' in the '#pragma omp ...' directives.
Defines some OpenMP-specific enums and functions.
Expr * getSafelen() const
Return safe iteration space distance.
Expr * getNumTeams()
Return NumTeams number.
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
void setLoopCounter(unsigned NumLoop, Expr *Counter)
Set loop counter for the specified loop.
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
child_range used_children()
static OMPInReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
static unsigned getComponentsTotalNumber(MappableExprComponentListsRef ComponentLists)
Class that handles post-update expression for some clauses, like 'lastprivate', 'reduction' etc...
This represents 'default' clause in the '#pragma omp ...' directive.
This represents 'final' clause in the '#pragma omp ...' directive.
This represents 'mergeable' clause in the '#pragma omp ...' directive.
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
OpenMPDependClauseKind getDependencyKind() const
Get dependency type.
This represents clause 'reduction' in the '#pragma omp ...' directives.
void setPrivates(ArrayRef< Expr *> PL)
Sets the list of the copies of original linear variables.
unsigned NumVars
Number of expressions listed.
This represents clause 'is_device_ptr' in the '#pragma omp ...' directives.
child_range used_children()
Get the iterator range for the expressions used in the clauses.
static OMPMapClause * Create(const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef< Expr *> Vars, ArrayRef< ValueDecl *> Declarations, MappableExprComponentListsRef ComponentLists, ArrayRef< Expr *> UDMapperRefs, ArrayRef< OpenMPMapModifierKind > MapModifiers, ArrayRef< SourceLocation > MapModifiersLoc, NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId, OpenMPMapClauseKind Type, bool TypeIsImplicit, SourceLocation TypeLoc)
Creates clause with a list of variables VL.
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool ResolveTemplateArguments=false) const
Print this nested name specifier to the given output stream.
void setFinals(ArrayRef< Expr *> FL)
Sets the list of final update expressions for linear variables.
static OMPCopyinClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, ArrayRef< Expr *> SrcExprs, ArrayRef< Expr *> DstExprs, ArrayRef< Expr *> AssignmentOps)
Creates clause with a list of variables VL.
static OMPDependClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, OpenMPDependClauseKind DepKind, SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef< Expr *> VL, unsigned NumLoops)
Creates clause with a list of variables VL.
This represents clause 'from' in the '#pragma omp ...' directives.
static OMPIsDevicePtrClause * Create(const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef< Expr *> Vars, ArrayRef< ValueDecl *> Declarations, MappableExprComponentListsRef ComponentLists)
Creates clause with a list of variables Vars.
This represents 'dynamic_allocators' clause in the '#pragma omp requires' directive.
OpenMPDefaultClauseKind getDefaultKind() const
Returns kind of the clause.
OMPLinearClause(SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, unsigned NumVars)
Build 'linear' clause with given number of variables NumVars.
This represents 'threads' clause in the '#pragma omp ...' directive.
NestedNameSpecifierLoc getMapperQualifierLoc() const
Gets the nested name specifier for associated user-defined mapper.
Expr * getSimdlen() const
Return safe iteration space distance.
This represents clause 'aligned' in the '#pragma omp ...' directives.
OpenMPClauseKind getClauseKind() const
Returns kind of OpenMP clause (private, shared, reduction, etc.).
static OMPAlignedClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
static OMPOrderedClause * Create(const ASTContext &C, Expr *Num, unsigned NumLoops, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'ordered' clause.
This represents clause 'task_reduction' in the '#pragma omp taskgroup' directives.
This represents implicit clause 'depend' for the '#pragma omp task' directive.
OpenMPLastprivateModifier
OpenMP 'lastprivate' clause modifier.
OpenMPLastprivateModifier getKind() const
Lastprivate kind.
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
This represents 'capture' clause in the '#pragma omp atomic' directive.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
This represents one expression.
This represents 'simdlen' clause in the '#pragma omp ...' directive.
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
Expr * getNumTasks() const
Return safe iteration space distance.
unsigned NumComponentLists
Number of component lists.
static OMPDependClause * CreateEmpty(const ASTContext &C, unsigned N, unsigned NumLoops)
Creates an empty clause with N variables.
Expr * getAllocator() const
Returns the allocator expression or nullptr, if no allocator is specified.
static Stmt ** getAddrOfExprAsWritten(Stmt *S)
Gets the address of the original, non-captured, expression used in the clause as the preinitializer...
OpenMPDistScheduleClauseKind getDistScheduleKind() const
Get kind of the clause.
This represents 'ordered' clause in the '#pragma omp ...' directive.
static OMPFlushClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
Expr * getDevice()
Return device number.
static OMPPrivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents 'collapse' clause in the '#pragma omp ...' directive.
This represents clause 'firstprivate' in the '#pragma omp ...' directives.
static OMPIsDevicePtrClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars variables.
This file defines OpenMP AST classes for clauses.
void setPreInitStmt(Stmt *S, OpenMPDirectiveKind ThisRegion=llvm::omp::OMPD_unknown)
Set pre-initialization statement for the clause.
ArrayRef< Expr * > getLoopNumIterations() const
Get number of iterations for all the loops.
This represents 'seq_cst' clause in the '#pragma omp atomic' directive.
This represents 'untied' clause in the '#pragma omp ...' directive.
This represents 'unified_address' clause in the '#pragma omp requires' directive. ...
void setPostUpdateExpr(Expr *S)
Set pre-initialization statement for the clause.
This represents 'num_teams' clause in the '#pragma omp ...' directive.
llvm::iterator_range< child_iterator > child_range
Encodes a location in the source.
This represents 'hint' clause in the '#pragma omp ...' directive.
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
MutableArrayRef< Expr * > getInits()
This structure contains all sizes needed for by an OMPMappableExprListClause.
DeclarationName getName() const
getName - Returns the embedded declaration name.
This represents 'schedule' clause in the '#pragma omp ...' directive.
This represents clause 'shared' in the '#pragma omp ...' directives.
Expr * getPriority()
Return Priority number.
OpenMPLinearClauseKind Modifier
Modifier of 'linear' clause.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
OpenMPMapClauseKind getMapType() const LLVM_READONLY
Fetches mapping kind for the clause.
This file defines OpenMP nodes for declarative directives.
static OMPSharedClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL)
Creates clause with a list of variables VL.
Expr * getLoopCounter(unsigned NumLoop)
Get loops counter for the specified loop.
void setPrivateCopies(ArrayRef< Expr *> PrivateCopies)
Set list of helper expressions, required for generation of private copies of original lastprivate var...
This is a basic class for representing single OpenMP clause.
void setVarRefs(ArrayRef< Expr *> VL)
Sets the list of variables for this clause.
Expr * getNumForLoops() const
Return the number of associated for-loops.
child_range used_children()
static OMPAlignedClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, Expr *A)
Creates clause with a list of variables VL and alignment A.
static OMPPrivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, ArrayRef< Expr *> PrivateVL)
Creates clause with a list of variables VL.
void * Allocate(size_t Size, unsigned Align=8) const
ast_type_traits::DynTypedNode Node
Dataflow Directional Tag Classes.
This represents 'device' clause in the '#pragma omp ...' directive.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
OpenMPDefaultmapClauseKind getDefaultmapKind() const
Get kind of the clause.
SourceLocation ModifierLoc
Location of linear modifier if any.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
This represents 'unified_shared_memory' clause in the '#pragma omp requires' directive.
This represents clause 'linear' in the '#pragma omp ...' directives.
static OMPNontemporalClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
OpenMPDefaultmapClauseModifier getDefaultmapModifier() const
Get the modifier of the clause.
static OMPFirstprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, ArrayRef< Expr *> PrivateVL, ArrayRef< Expr *> InitVL, Stmt *PreInit)
Creates clause with a list of variables VL.
ArrayRef< MappableExprComponentList > MappableExprComponentListsRef
static OMPLastprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, ArrayRef< Expr *> SrcExprs, ArrayRef< Expr *> DstExprs, ArrayRef< Expr *> AssignmentOps, OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc, SourceLocation ColonLoc, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL.
unsigned NumUniqueDeclarations
Number of unique base declarations.
static OMPSharedClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
Class that represents a component of a mappable expression.
Not an overloaded operator.
static unsigned getUniqueDeclarationsTotalNumber(ArrayRef< const ValueDecl *> Declarations)
OpenMPDirectiveKind getNameModifier() const
Return directive name modifier associated with the clause.
static OMPCopyprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
child_range used_children()
const char * getOperatorSpelling(OverloadedOperatorKind Operator)
Retrieve the spelling of the given overloaded operator, without the preceding "operator" keyword...
void setUDMapperRefs(ArrayRef< Expr *> DMDs)
Set the user-defined mappers that are in the trailing objects of the class.
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
This represents 'write' clause in the '#pragma omp atomic' directive.
void setLoopData(unsigned NumLoop, Expr *Cnt)
Set the loop data for the depend clauses with 'sink|source' kind of dependency.
void setClauseInfo(ArrayRef< ValueDecl *> Declarations, MappableExprComponentListsRef ComponentLists)
Fill the clause information from the list of declarations and associated component lists...
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
OpenMPScheduleClauseModifier getSecondScheduleModifier() const
Get the second modifier of the clause.
void printPretty(raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, StringRef NewlineSymbol="\, const ASTContext *Context=nullptr) const
static OMPNontemporalClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL)
Creates clause with a list of variables VL.
child_range used_children()
This represents 'nowait' clause in the '#pragma omp ...' directive.
OpenMPScheduleClauseModifier getFirstScheduleModifier() const
Get the first modifier of the clause.
This represents 'num_tasks' clause in the '#pragma omp ...' directive.
OpenMPScheduleClauseKind getScheduleKind() const
Get kind of the clause.
static OMPMapClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars original expressions, NumUniqueDeclarations declar...
Privates[]
Gets the list of initial values for linear variables.
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
Expr * getThreadLimit()
Return ThreadLimit number.
static OMPFromClause * CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
Creates an empty clause with the place for NumVars variables.
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
Expr * getHint() const
Returns number of threads.
static OMPAllocateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, Expr *Allocator, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL)
Creates clause with a list of variables VL.
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
void setInits(ArrayRef< Expr *> IL)
Sets the list of the initial values for linear variables.
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
Expr * getChunkSize()
Get chunk size.
static OMPFlushClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL)
Creates clause with a list of variables VL.
Expr * getNumThreads() const
Returns number of threads.
This structure contains most locations needed for by an OMPVarListClause.
static OMPClauseWithPostUpdate * get(OMPClause *C)
static OMPFromClause * Create(const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef< Expr *> Vars, ArrayRef< ValueDecl *> Declarations, MappableExprComponentListsRef ComponentLists, ArrayRef< Expr *> UDMapperRefs, NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId)
Creates clause with a list of variables Vars.
static OMPLastprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
OpenMPAtomicDefaultMemOrderClauseKind getAtomicDefaultMemOrderKind() const
Returns kind of the clause.
const DeclarationNameInfo & getMapperIdInfo() const
Gets the name info for associated user-defined mapper.
SourceLocation ColonLoc
Location of ':'.
unsigned NumComponents
Total number of expression components.
This represents clause 'nontemporal' in the '#pragma omp ...' directives.
static OMPToClause * 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.
static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, ArrayRef< Expr *> PL, ArrayRef< Expr *> IL, Expr *Step, Expr *CalcStep, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL and a linear step Step.
void setUsedExprs(ArrayRef< Expr *> UE)
Sets the list of used expressions for the linear clause.