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");
48 case OMPC_dist_schedule:
50 case OMPC_firstprivate:
52 case OMPC_lastprivate:
56 case OMPC_task_reduction:
58 case OMPC_in_reduction:
64 case OMPC_num_threads:
68 case OMPC_thread_limit:
82 case OMPC_copyprivate:
103 case OMPC_defaultmap:
108 case OMPC_use_device_ptr:
109 case OMPC_is_device_ptr:
110 case OMPC_unified_address:
111 case OMPC_unified_shared_memory:
112 case OMPC_reverse_offload:
113 case OMPC_dynamic_allocators:
114 case OMPC_atomic_default_mem_order:
128 case OMPC_lastprivate:
132 case OMPC_task_reduction:
134 case OMPC_in_reduction:
139 case OMPC_dist_schedule:
140 case OMPC_firstprivate:
145 case OMPC_num_threads:
153 case OMPC_copyprivate:
171 case OMPC_thread_limit:
177 case OMPC_defaultmap:
182 case OMPC_use_device_ptr:
183 case OMPC_is_device_ptr:
184 case OMPC_unified_address:
185 case OMPC_unified_shared_memory:
186 case OMPC_reverse_offload:
187 case OMPC_dynamic_allocators:
188 case OMPC_atomic_default_mem_order:
200 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(2 * NumLoops));
203 for (
unsigned I = 0; I < NumLoops; ++I) {
205 Clause->setLoopCounter(I,
nullptr);
212 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(2 * NumLoops));
214 for (
unsigned I = 0; I < NumLoops; ++I) {
216 Clause->setLoopCounter(I,
nullptr);
222 Expr *NumIterations) {
223 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
224 getTrailingObjects<Expr *>()[NumLoop] = NumIterations;
228 return llvm::makeArrayRef(getTrailingObjects<Expr *>(), NumberOfLoops);
232 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
233 getTrailingObjects<Expr *>()[NumberOfLoops + NumLoop] = Counter;
237 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
238 return getTrailingObjects<Expr *>()[NumberOfLoops + NumLoop];
242 assert(NumLoop < NumberOfLoops &&
"out of loops number.");
243 return getTrailingObjects<Expr *>()[NumberOfLoops + NumLoop];
247 assert(VL.size() == varlist_size() &&
248 "Number of private copies is not the same as the preallocated buffer");
249 std::copy(VL.begin(), VL.end(), varlist_end());
257 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(2 * VL.size()));
261 Clause->setPrivateCopies(PrivateVL);
267 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(2 * N));
272 assert(VL.size() == varlist_size() &&
273 "Number of private copies is not the same as the preallocated buffer");
274 std::copy(VL.begin(), VL.end(), varlist_end());
278 assert(VL.size() == varlist_size() &&
279 "Number of inits is not the same as the preallocated buffer");
280 std::copy(VL.begin(), VL.end(), getPrivateCopies().end());
288 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(3 * VL.size()));
292 Clause->setPrivateCopies(PrivateVL);
293 Clause->setInits(InitVL);
300 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(3 * N));
305 assert(PrivateCopies.size() == varlist_size() &&
306 "Number of private copies is not the same as the preallocated buffer");
307 std::copy(PrivateCopies.begin(), PrivateCopies.end(), varlist_end());
311 assert(SrcExprs.size() == varlist_size() &&
"Number of source expressions is " 312 "not the same as the " 313 "preallocated buffer");
314 std::copy(SrcExprs.begin(), SrcExprs.end(), getPrivateCopies().end());
318 assert(DstExprs.size() == varlist_size() &&
"Number of destination " 319 "expressions is not the same as " 320 "the preallocated buffer");
321 std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
324 void OMPLastprivateClause::setAssignmentOps(
ArrayRef<Expr *> AssignmentOps) {
325 assert(AssignmentOps.size() == varlist_size() &&
326 "Number of assignment expressions is not the same as the preallocated " 328 std::copy(AssignmentOps.begin(), AssignmentOps.end(),
329 getDestinationExprs().end());
337 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
341 Clause->setSourceExprs(SrcExprs);
342 Clause->setDestinationExprs(DstExprs);
343 Clause->setAssignmentOps(AssignmentOps);
351 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * N));
360 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(VL.size()));
368 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(N));
373 assert(PL.size() == varlist_size() &&
374 "Number of privates is not the same as the preallocated buffer");
375 std::copy(PL.begin(), PL.end(), varlist_end());
379 assert(IL.size() == varlist_size() &&
380 "Number of inits is not the same as the preallocated buffer");
381 std::copy(IL.begin(), IL.end(),
getPrivates().end());
385 assert(UL.size() == varlist_size() &&
386 "Number of updates is not the same as the preallocated buffer");
387 std::copy(UL.begin(), UL.end(),
getInits().end());
391 assert(FL.size() == varlist_size() &&
392 "Number of final updates is not the same as the preallocated buffer");
393 std::copy(FL.begin(), FL.end(),
getUpdates().end());
404 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * VL.size() + 2));
406 StartLoc, LParenLoc,
Modifier, ModifierLoc, ColonLoc, EndLoc, VL.size());
408 Clause->setPrivates(PL);
409 Clause->setInits(IL);
412 std::fill(Clause->getInits().end(), Clause->getInits().end() + VL.size(),
414 std::fill(Clause->getUpdates().end(), Clause->getUpdates().end() + VL.size(),
416 Clause->setStep(Step);
417 Clause->setCalcStep(CalcStep);
427 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * NumVars + 2));
435 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
438 Clause->setVarRefs(VL);
439 Clause->setAlignment(A);
445 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(NumVars + 1));
450 assert(SrcExprs.size() == varlist_size() &&
"Number of source expressions is " 451 "not the same as the " 452 "preallocated buffer");
453 std::copy(SrcExprs.begin(), SrcExprs.end(), varlist_end());
457 assert(DstExprs.size() == varlist_size() &&
"Number of destination " 458 "expressions is not the same as " 459 "the preallocated buffer");
460 std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
464 assert(AssignmentOps.size() == varlist_size() &&
465 "Number of assignment expressions is not the same as the preallocated " 467 std::copy(AssignmentOps.begin(), AssignmentOps.end(),
468 getDestinationExprs().end());
473 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
474 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps) {
475 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(4 * VL.size()));
478 Clause->setVarRefs(VL);
479 Clause->setSourceExprs(SrcExprs);
480 Clause->setDestinationExprs(DstExprs);
481 Clause->setAssignmentOps(AssignmentOps);
486 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(4 * N));
490 void OMPCopyprivateClause::setSourceExprs(ArrayRef<Expr *> SrcExprs) {
491 assert(SrcExprs.size() == varlist_size() &&
"Number of source expressions is " 492 "not the same as the " 493 "preallocated buffer");
494 std::copy(SrcExprs.begin(), SrcExprs.end(), varlist_end());
497 void OMPCopyprivateClause::setDestinationExprs(ArrayRef<Expr *> DstExprs) {
498 assert(DstExprs.size() == varlist_size() &&
"Number of destination " 499 "expressions is not the same as " 500 "the preallocated buffer");
501 std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
504 void OMPCopyprivateClause::setAssignmentOps(ArrayRef<Expr *> AssignmentOps) {
505 assert(AssignmentOps.size() == varlist_size() &&
506 "Number of assignment expressions is not the same as the preallocated " 508 std::copy(AssignmentOps.begin(), AssignmentOps.end(),
509 getDestinationExprs().end());
514 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
515 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps) {
516 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(4 * VL.size()));
519 Clause->setVarRefs(VL);
520 Clause->setSourceExprs(SrcExprs);
521 Clause->setDestinationExprs(DstExprs);
522 Clause->setAssignmentOps(AssignmentOps);
528 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(4 * N));
532 void OMPReductionClause::setPrivates(ArrayRef<Expr *>
Privates) {
533 assert(Privates.size() == varlist_size() &&
534 "Number of private copies is not the same as the preallocated buffer");
535 std::copy(Privates.begin(), Privates.end(), varlist_end());
538 void OMPReductionClause::setLHSExprs(ArrayRef<Expr *> LHSExprs) {
540 LHSExprs.size() == varlist_size() &&
541 "Number of LHS expressions is not the same as the preallocated buffer");
542 std::copy(LHSExprs.begin(), LHSExprs.end(),
getPrivates().end());
545 void OMPReductionClause::setRHSExprs(ArrayRef<Expr *> RHSExprs) {
547 RHSExprs.size() == varlist_size() &&
548 "Number of RHS expressions is not the same as the preallocated buffer");
549 std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
552 void OMPReductionClause::setReductionOps(ArrayRef<Expr *> ReductionOps) {
553 assert(ReductionOps.size() == varlist_size() &&
"Number of reduction " 554 "expressions is not the same " 555 "as the preallocated buffer");
556 std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
566 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
568 StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
570 Clause->setPrivates(Privates);
571 Clause->setLHSExprs(LHSExprs);
572 Clause->setRHSExprs(RHSExprs);
573 Clause->setReductionOps(ReductionOps);
581 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * N));
586 assert(Privates.size() == varlist_size() &&
587 "Number of private copies is not the same as the preallocated buffer");
588 std::copy(Privates.begin(), Privates.end(), varlist_end());
593 LHSExprs.size() == varlist_size() &&
594 "Number of LHS expressions is not the same as the preallocated buffer");
595 std::copy(LHSExprs.begin(), LHSExprs.end(),
getPrivates().end());
600 RHSExprs.size() == varlist_size() &&
601 "Number of RHS expressions is not the same as the preallocated buffer");
602 std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
605 void OMPTaskReductionClause::setReductionOps(
ArrayRef<Expr *> ReductionOps) {
606 assert(ReductionOps.size() == varlist_size() &&
"Number of task reduction " 607 "expressions is not the same " 608 "as the preallocated buffer");
609 std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
619 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
621 StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
623 Clause->setPrivates(Privates);
624 Clause->setLHSExprs(LHSExprs);
625 Clause->setRHSExprs(RHSExprs);
626 Clause->setReductionOps(ReductionOps);
634 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(5 * N));
639 assert(Privates.size() == varlist_size() &&
640 "Number of private copies is not the same as the preallocated buffer");
641 std::copy(Privates.begin(), Privates.end(), varlist_end());
646 LHSExprs.size() == varlist_size() &&
647 "Number of LHS expressions is not the same as the preallocated buffer");
648 std::copy(LHSExprs.begin(), LHSExprs.end(),
getPrivates().end());
653 RHSExprs.size() == varlist_size() &&
654 "Number of RHS expressions is not the same as the preallocated buffer");
655 std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
659 assert(ReductionOps.size() == varlist_size() &&
"Number of in reduction " 660 "expressions is not the same " 661 "as the preallocated buffer");
662 std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
665 void OMPInReductionClause::setTaskgroupDescriptors(
667 assert(TaskgroupDescriptors.size() == varlist_size() &&
668 "Number of in reduction descriptors is not the same as the " 669 "preallocated buffer");
670 std::copy(TaskgroupDescriptors.begin(), TaskgroupDescriptors.end(),
671 getReductionOps().end());
681 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(6 * VL.size()));
683 StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
685 Clause->setPrivates(Privates);
686 Clause->setLHSExprs(LHSExprs);
687 Clause->setRHSExprs(RHSExprs);
688 Clause->setReductionOps(ReductionOps);
689 Clause->setTaskgroupDescriptors(TaskgroupDescriptors);
697 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(6 * N));
706 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
709 Clause->setVarRefs(VL);
714 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(N));
724 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(VL.size() + NumLoops));
727 Clause->setVarRefs(VL);
728 Clause->setDependencyKind(DepKind);
729 Clause->setDependencyLoc(DepLoc);
730 Clause->setColonLoc(ColonLoc);
731 for (
unsigned I = 0 ; I < NumLoops; ++I)
738 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(N + NumLoops));
743 assert((getDependencyKind() == OMPC_DEPEND_sink ||
744 getDependencyKind() == OMPC_DEPEND_source) &&
745 NumLoop < NumLoops &&
746 "Expected sink or source depend + loop index must be less number of " 748 auto It = std::next(getVarRefs().end(), NumLoop);
753 assert((getDependencyKind() == OMPC_DEPEND_sink ||
754 getDependencyKind() == OMPC_DEPEND_source) &&
755 NumLoop < NumLoops &&
756 "Expected sink or source depend + loop index must be less number of " 758 auto It = std::next(getVarRefs().end(), NumLoop);
763 assert((getDependencyKind() == OMPC_DEPEND_sink ||
764 getDependencyKind() == OMPC_DEPEND_source) &&
765 NumLoop < NumLoops &&
766 "Expected sink or source depend + loop index must be less number of " 768 auto It = std::next(getVarRefs().end(), NumLoop);
774 unsigned TotalNum = 0u;
775 for (
auto &C : ComponentLists)
776 TotalNum += C.size();
781 ArrayRef<const ValueDecl *> Declarations) {
782 unsigned TotalNum = 0u;
783 llvm::SmallPtrSet<const ValueDecl *, 8>
Cache;
784 for (
const ValueDecl *D : Declarations) {
785 const ValueDecl *VD = D ? cast<ValueDecl>(D->getCanonicalDecl()) :
nullptr;
803 unsigned NumVars = Vars.size();
804 unsigned NumUniqueDeclarations =
805 getUniqueDeclarationsTotalNumber(Declarations);
806 unsigned NumComponentLists = ComponentLists.size();
807 unsigned NumComponents = getComponentsTotalNumber(ComponentLists);
822 NumVars, NumUniqueDeclarations,
823 NumUniqueDeclarations + NumComponentLists, NumComponents));
825 MapModifiers, MapModifiersLoc, Type, TypeIsImplicit, TypeLoc, StartLoc,
826 LParenLoc, EndLoc, NumVars, NumUniqueDeclarations, NumComponentLists,
829 Clause->setVarRefs(Vars);
831 Clause->setMapType(Type);
832 Clause->setMapLoc(TypeLoc);
837 unsigned NumUniqueDeclarations,
838 unsigned NumComponentLists,
839 unsigned NumComponents) {
843 NumVars, NumUniqueDeclarations,
844 NumUniqueDeclarations + NumComponentLists, NumComponents));
845 return new (Mem)
OMPMapClause(NumVars, NumUniqueDeclarations,
846 NumComponentLists, NumComponents);
854 unsigned NumVars = Vars.size();
855 unsigned NumUniqueDeclarations =
856 getUniqueDeclarationsTotalNumber(Declarations);
857 unsigned NumComponentLists = ComponentLists.size();
858 unsigned NumComponents = getComponentsTotalNumber(ComponentLists);
873 NumVars, NumUniqueDeclarations,
874 NumUniqueDeclarations + NumComponentLists, NumComponents));
877 OMPToClause(StartLoc, LParenLoc, EndLoc, NumVars, NumUniqueDeclarations,
878 NumComponentLists, NumComponents);
880 Clause->setVarRefs(Vars);
886 unsigned NumUniqueDeclarations,
887 unsigned NumComponentLists,
888 unsigned NumComponents) {
892 NumVars, NumUniqueDeclarations,
893 NumUniqueDeclarations + NumComponentLists, NumComponents));
894 return new (Mem)
OMPToClause(NumVars, NumUniqueDeclarations,
895 NumComponentLists, NumComponents);
903 unsigned NumVars = Vars.size();
904 unsigned NumUniqueDeclarations =
905 getUniqueDeclarationsTotalNumber(Declarations);
906 unsigned NumComponentLists = ComponentLists.size();
907 unsigned NumComponents = getComponentsTotalNumber(ComponentLists);
922 NumVars, NumUniqueDeclarations,
923 NumUniqueDeclarations + NumComponentLists, NumComponents));
926 OMPFromClause(StartLoc, LParenLoc, EndLoc, NumVars, NumUniqueDeclarations,
927 NumComponentLists, NumComponents);
929 Clause->setVarRefs(Vars);
935 unsigned NumUniqueDeclarations,
936 unsigned NumComponentLists,
937 unsigned NumComponents) {
941 NumVars, NumUniqueDeclarations,
942 NumUniqueDeclarations + NumComponentLists, NumComponents));
943 return new (Mem)
OMPFromClause(NumVars, NumUniqueDeclarations,
944 NumComponentLists, NumComponents);
948 assert(VL.size() == varlist_size() &&
949 "Number of private copies is not the same as the preallocated buffer");
950 std::copy(VL.begin(), VL.end(), varlist_end());
954 assert(VL.size() == varlist_size() &&
955 "Number of inits is not the same as the preallocated buffer");
956 std::copy(VL.begin(), VL.end(), getPrivateCopies().end());
961 SourceLocation EndLoc, ArrayRef<Expr *> Vars, ArrayRef<Expr *> PrivateVars,
962 ArrayRef<Expr *>
Inits, ArrayRef<ValueDecl *> Declarations,
964 unsigned NumVars = Vars.size();
965 unsigned NumUniqueDeclarations =
966 getUniqueDeclarationsTotalNumber(Declarations);
967 unsigned NumComponentLists = ComponentLists.size();
968 unsigned NumComponents = getComponentsTotalNumber(ComponentLists);
983 3 * NumVars, NumUniqueDeclarations,
984 NumUniqueDeclarations + NumComponentLists, NumComponents));
987 StartLoc, LParenLoc, EndLoc, NumVars, NumUniqueDeclarations,
988 NumComponentLists, NumComponents);
990 Clause->setVarRefs(Vars);
991 Clause->setPrivateCopies(PrivateVars);
992 Clause->setInits(Inits);
998 const ASTContext &C,
unsigned NumVars,
unsigned NumUniqueDeclarations,
999 unsigned NumComponentLists,
unsigned NumComponents) {
1003 3 * NumVars, NumUniqueDeclarations,
1004 NumUniqueDeclarations + NumComponentLists, NumComponents));
1006 NumComponentLists, NumComponents);
1015 unsigned NumVars = Vars.size();
1016 unsigned NumUniqueDeclarations =
1017 getUniqueDeclarationsTotalNumber(Declarations);
1018 unsigned NumComponentLists = ComponentLists.size();
1019 unsigned NumComponents = getComponentsTotalNumber(ComponentLists);
1034 NumVars, NumUniqueDeclarations,
1035 NumUniqueDeclarations + NumComponentLists, NumComponents));
1038 StartLoc, LParenLoc, EndLoc, NumVars, NumUniqueDeclarations,
1039 NumComponentLists, NumComponents);
1041 Clause->setVarRefs(Vars);
1047 const ASTContext &C,
unsigned NumVars,
unsigned NumUniqueDeclarations,
1048 unsigned NumComponentLists,
unsigned NumComponents) {
1052 NumVars, NumUniqueDeclarations,
1053 NumUniqueDeclarations + NumComponentLists, NumComponents));
1055 NumComponentLists, NumComponents);
1070 void OMPClausePrinter::VisitOMPFinalClause(
OMPFinalClause *Node) {
1077 OS <<
"num_threads(";
1113 OS <<
"unified_address";
1116 void OMPClausePrinter::VisitOMPUnifiedSharedMemoryClause(
1118 OS <<
"unified_shared_memory";
1122 OS <<
"reverse_offload";
1125 void OMPClausePrinter::VisitOMPDynamicAllocatorsClause(
1127 OS <<
"dynamic_allocators";
1130 void OMPClausePrinter::VisitOMPAtomicDefaultMemOrderClause(
1132 OS <<
"atomic_default_mem_order(" 1153 E->printPretty(OS,
nullptr, Policy);
1162 Num->printPretty(OS,
nullptr, Policy, 0);
1183 void OMPClausePrinter::VisitOMPReadClause(
OMPReadClause *) { OS <<
"read"; }
1185 void OMPClausePrinter::VisitOMPWriteClause(
OMPWriteClause *) { OS <<
"write"; }
1203 void OMPClausePrinter::VisitOMPSIMDClause(
OMPSIMDClause *) { OS <<
"simd"; }
1218 OS <<
"thread_limit(";
1241 void OMPClausePrinter::VisitOMPHintClause(
OMPHintClause *Node) {
1247 template<
typename T>
1248 void OMPClausePrinter::VisitOMPClauseList(T *Node,
char StartSym) {
1249 for (
typename T::varlist_iterator I = Node->varlist_begin(),
1250 E = Node->varlist_end();
1252 assert(*I &&
"Expected non-null Stmt");
1253 OS << (I == Node->varlist_begin() ? StartSym :
',');
1254 if (
auto *DRE = dyn_cast<DeclRefExpr>(*I)) {
1255 if (isa<OMPCapturedExprDecl>(DRE->getDecl()))
1256 DRE->printPretty(OS,
nullptr, Policy, 0);
1258 DRE->getDecl()->printQualifiedName(OS);
1260 (*I)->printPretty(OS,
nullptr, Policy, 0);
1267 VisitOMPClauseList(Node,
'(');
1274 OS <<
"firstprivate";
1275 VisitOMPClauseList(Node,
'(');
1282 OS <<
"lastprivate";
1283 VisitOMPClauseList(Node,
'(');
1291 VisitOMPClauseList(Node,
'(');
1303 if (QualifierLoc ==
nullptr && OOK !=
OO_None) {
1308 if (QualifierLoc !=
nullptr)
1309 QualifierLoc->
print(OS, Policy);
1313 VisitOMPClauseList(Node,
' ');
1318 void OMPClausePrinter::VisitOMPTaskReductionClause(
1321 OS <<
"task_reduction(";
1326 if (QualifierLoc ==
nullptr && OOK !=
OO_None) {
1331 if (QualifierLoc !=
nullptr)
1332 QualifierLoc->
print(OS, Policy);
1336 VisitOMPClauseList(Node,
' ');
1343 OS <<
"in_reduction(";
1348 if (QualifierLoc ==
nullptr && OOK !=
OO_None) {
1353 if (QualifierLoc !=
nullptr)
1354 QualifierLoc->
print(OS, Policy);
1358 VisitOMPClauseList(Node,
' ');
1366 if (Node->getModifierLoc().isValid()) {
1370 VisitOMPClauseList(Node,
'(');
1371 if (Node->getModifierLoc().isValid())
1373 if (Node->getStep() !=
nullptr) {
1375 Node->getStep()->printPretty(OS,
nullptr, Policy, 0);
1382 if (!Node->varlist_empty()) {
1384 VisitOMPClauseList(Node,
'(');
1394 if (!Node->varlist_empty()) {
1396 VisitOMPClauseList(Node,
'(');
1402 if (!Node->varlist_empty()) {
1403 OS <<
"copyprivate";
1404 VisitOMPClauseList(Node,
'(');
1409 void OMPClausePrinter::VisitOMPFlushClause(
OMPFlushClause *Node) {
1410 if (!Node->varlist_empty()) {
1411 VisitOMPClauseList(Node,
'(');
1420 if (!Node->varlist_empty()) {
1422 VisitOMPClauseList(Node,
' ');
1427 void OMPClausePrinter::VisitOMPMapClause(
OMPMapClause *Node) {
1428 if (!Node->varlist_empty()) {
1441 VisitOMPClauseList(Node,
' ');
1446 void OMPClausePrinter::VisitOMPToClause(
OMPToClause *Node) {
1447 if (!Node->varlist_empty()) {
1449 VisitOMPClauseList(Node,
'(');
1454 void OMPClausePrinter::VisitOMPFromClause(
OMPFromClause *Node) {
1455 if (!Node->varlist_empty()) {
1457 VisitOMPClauseList(Node,
'(');
1467 E->printPretty(OS,
nullptr, Policy);
1473 OS <<
"defaultmap(";
1483 if (!Node->varlist_empty()) {
1484 OS <<
"use_device_ptr";
1485 VisitOMPClauseList(Node,
'(');
1491 if (!Node->varlist_empty()) {
1492 OS <<
"is_device_ptr";
1493 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.
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.
static OMPUseDevicePtrClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
bool varlist_empty() const
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...
static OMPFirstprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
static OMPUseDevicePtrClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr *> Vars, ArrayRef< Expr *> PrivateVars, ArrayRef< Expr *> Inits, ArrayRef< ValueDecl *> Declarations, MappableExprComponentListsRef ComponentLists)
Creates clause with a list of variables Vars.
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...
static OMPMapClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars original expressions, NumUniqueDeclarations declar...
This represents 'priority' clause in the '#pragma omp ...' directive.
The base class of the type hierarchy.
const char * getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type)
Expr * getCondition() const
Returns condition.
This represents 'update' clause in the '#pragma omp atomic' directive.
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.
This represents 'read' clause in the '#pragma omp atomic' directive.
static OMPToClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr *> Vars, ArrayRef< ValueDecl *> Declarations, MappableExprComponentListsRef ComponentLists)
Creates clause with a list of variables Vars.
This represents clause 'private' in the '#pragma omp ...' directives.
static OMPMapClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr *> Vars, ArrayRef< ValueDecl *> Declarations, MappableExprComponentListsRef ComponentLists, ArrayRef< OpenMPMapModifierKind > MapModifiers, ArrayRef< SourceLocation > MapModifiersLoc, OpenMPMapClauseKind Type, bool TypeIsImplicit, SourceLocation TypeLoc)
Creates clause with a list of variables VL.
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 '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 OMPIsDevicePtrClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr *> Vars, ArrayRef< ValueDecl *> Declarations, MappableExprComponentListsRef ComponentLists)
Creates clause with a list of variables Vars.
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.
This represents 'simd' clause in the '#pragma omp ...' directive.
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
This represents clause 'lastprivate' 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.
This represents clause 'to' in the '#pragma omp ...' directives.
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.
static OMPIsDevicePtrClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
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 OMPLastprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, ArrayRef< Expr *> SrcExprs, ArrayRef< Expr *> DstExprs, ArrayRef< Expr *> AssignmentOps, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL.
static unsigned getComponentsTotalNumber(MappableExprComponentListsRef ComponentLists)
static OMPToClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
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.
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.
This represents clause 'is_device_ptr' in the '#pragma omp ...' directives.
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.
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.
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.
OpenMPProcBindClauseKind getProcBindKind() const
Returns kind of the clause.
This represents implicit clause 'depend' for the '#pragma omp task' directive.
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.
static OMPDependClause * CreateEmpty(const ASTContext &C, unsigned N, unsigned NumLoops)
Creates an empty clause with N variables.
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.
This file defines OpenMP AST classes for clauses.
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()
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.
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.
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 OMPSharedClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
static OMPFromClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr *> Vars, ArrayRef< ValueDecl *> Declarations, MappableExprComponentListsRef ComponentLists)
Creates clause with a list of variables Vars.
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.
const char * getOperatorSpelling(OverloadedOperatorKind Operator)
Retrieve the spelling of the given overloaded operator, without the preceding "operator" keyword...
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
This represents 'write' clause in the '#pragma omp atomic' directive.
const char * getOpenMPDirectiveName(OpenMPDirectiveKind Kind)
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
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.
Privates[]
Gets the list of initial values for linear variables.
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
Expr * getThreadLimit()
Return ThreadLimit number.
void setPreInitStmt(Stmt *S, OpenMPDirectiveKind ThisRegion=OMPD_unknown)
Set pre-initialization statement for the clause.
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
static OMPFromClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
Expr * getHint() const
Returns number of threads.
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.
static OMPClauseWithPostUpdate * get(OMPClause *C)
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.
SourceLocation ColonLoc
Location of ':'.
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.