10b57cec5SDimitry Andric //===--- StmtOpenMP.cpp - Classes for OpenMP directives -------------------===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric // 9*0fca6ea1SDimitry Andric // This file implements the subclasses of Stmt class declared in StmtOpenMP.h 100b57cec5SDimitry Andric // 110b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 120b57cec5SDimitry Andric 130b57cec5SDimitry Andric #include "clang/AST/ASTContext.h" 145ffd83dbSDimitry Andric #include "clang/AST/StmtOpenMP.h" 150b57cec5SDimitry Andric 160b57cec5SDimitry Andric using namespace clang; 17480093f4SDimitry Andric using namespace llvm::omp; 180b57cec5SDimitry Andric 19e8d8bef9SDimitry Andric size_t OMPChildren::size(unsigned NumClauses, bool HasAssociatedStmt, 20e8d8bef9SDimitry Andric unsigned NumChildren) { 21e8d8bef9SDimitry Andric return llvm::alignTo( 22e8d8bef9SDimitry Andric totalSizeToAlloc<OMPClause *, Stmt *>( 23e8d8bef9SDimitry Andric NumClauses, NumChildren + (HasAssociatedStmt ? 1 : 0)), 24e8d8bef9SDimitry Andric alignof(OMPChildren)); 25e8d8bef9SDimitry Andric } 26e8d8bef9SDimitry Andric 27e8d8bef9SDimitry Andric void OMPChildren::setClauses(ArrayRef<OMPClause *> Clauses) { 28e8d8bef9SDimitry Andric assert(Clauses.size() == NumClauses && 290b57cec5SDimitry Andric "Number of clauses is not the same as the preallocated buffer"); 30e8d8bef9SDimitry Andric llvm::copy(Clauses, getTrailingObjects<OMPClause *>()); 31e8d8bef9SDimitry Andric } 32e8d8bef9SDimitry Andric 33e8d8bef9SDimitry Andric MutableArrayRef<Stmt *> OMPChildren::getChildren() { 34bdd1243dSDimitry Andric return llvm::MutableArrayRef(getTrailingObjects<Stmt *>(), NumChildren); 35e8d8bef9SDimitry Andric } 36e8d8bef9SDimitry Andric 37e8d8bef9SDimitry Andric OMPChildren *OMPChildren::Create(void *Mem, ArrayRef<OMPClause *> Clauses) { 38e8d8bef9SDimitry Andric auto *Data = CreateEmpty(Mem, Clauses.size()); 39e8d8bef9SDimitry Andric Data->setClauses(Clauses); 40e8d8bef9SDimitry Andric return Data; 41e8d8bef9SDimitry Andric } 42e8d8bef9SDimitry Andric 43e8d8bef9SDimitry Andric OMPChildren *OMPChildren::Create(void *Mem, ArrayRef<OMPClause *> Clauses, 44e8d8bef9SDimitry Andric Stmt *S, unsigned NumChildren) { 45e8d8bef9SDimitry Andric auto *Data = CreateEmpty(Mem, Clauses.size(), S, NumChildren); 46e8d8bef9SDimitry Andric Data->setClauses(Clauses); 47e8d8bef9SDimitry Andric if (S) 48e8d8bef9SDimitry Andric Data->setAssociatedStmt(S); 49e8d8bef9SDimitry Andric return Data; 50e8d8bef9SDimitry Andric } 51e8d8bef9SDimitry Andric 52e8d8bef9SDimitry Andric OMPChildren *OMPChildren::CreateEmpty(void *Mem, unsigned NumClauses, 53e8d8bef9SDimitry Andric bool HasAssociatedStmt, 54e8d8bef9SDimitry Andric unsigned NumChildren) { 55e8d8bef9SDimitry Andric return new (Mem) OMPChildren(NumClauses, NumChildren, HasAssociatedStmt); 560b57cec5SDimitry Andric } 570b57cec5SDimitry Andric 580b57cec5SDimitry Andric bool OMPExecutableDirective::isStandaloneDirective() const { 590b57cec5SDimitry Andric // Special case: 'omp target enter data', 'omp target exit data', 600b57cec5SDimitry Andric // 'omp target update' are stand-alone directives, but for implementation 610b57cec5SDimitry Andric // reasons they have empty synthetic structured block, to simplify codegen. 620b57cec5SDimitry Andric if (isa<OMPTargetEnterDataDirective>(this) || 630b57cec5SDimitry Andric isa<OMPTargetExitDataDirective>(this) || 640b57cec5SDimitry Andric isa<OMPTargetUpdateDirective>(this)) 650b57cec5SDimitry Andric return true; 66e8d8bef9SDimitry Andric return !hasAssociatedStmt(); 670b57cec5SDimitry Andric } 680b57cec5SDimitry Andric 69e8d8bef9SDimitry Andric Stmt *OMPExecutableDirective::getStructuredBlock() { 700b57cec5SDimitry Andric assert(!isStandaloneDirective() && 710b57cec5SDimitry Andric "Standalone Executable Directives don't have Structured Blocks."); 720b57cec5SDimitry Andric if (auto *LD = dyn_cast<OMPLoopDirective>(this)) 730b57cec5SDimitry Andric return LD->getBody(); 74e8d8bef9SDimitry Andric return getRawStmt(); 750b57cec5SDimitry Andric } 760b57cec5SDimitry Andric 77fe6060f1SDimitry Andric Stmt * 78fe6060f1SDimitry Andric OMPLoopBasedDirective::tryToFindNextInnerLoop(Stmt *CurStmt, 79480093f4SDimitry Andric bool TryImperfectlyNestedLoops) { 80480093f4SDimitry Andric Stmt *OrigStmt = CurStmt; 81480093f4SDimitry Andric CurStmt = CurStmt->IgnoreContainers(); 82480093f4SDimitry Andric // Additional work for imperfectly nested loops, introduced in OpenMP 5.0. 83480093f4SDimitry Andric if (TryImperfectlyNestedLoops) { 84480093f4SDimitry Andric if (auto *CS = dyn_cast<CompoundStmt>(CurStmt)) { 85480093f4SDimitry Andric CurStmt = nullptr; 86480093f4SDimitry Andric SmallVector<CompoundStmt *, 4> Statements(1, CS); 87480093f4SDimitry Andric SmallVector<CompoundStmt *, 4> NextStatements; 88480093f4SDimitry Andric while (!Statements.empty()) { 89480093f4SDimitry Andric CS = Statements.pop_back_val(); 90480093f4SDimitry Andric if (!CS) 91480093f4SDimitry Andric continue; 92480093f4SDimitry Andric for (Stmt *S : CS->body()) { 93480093f4SDimitry Andric if (!S) 94480093f4SDimitry Andric continue; 95fe6060f1SDimitry Andric if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(S)) 96fe6060f1SDimitry Andric S = CanonLoop->getLoopStmt(); 97fe6060f1SDimitry Andric if (isa<ForStmt>(S) || isa<CXXForRangeStmt>(S) || 98fe6060f1SDimitry Andric (isa<OMPLoopBasedDirective>(S) && !isa<OMPLoopDirective>(S))) { 99480093f4SDimitry Andric // Only single loop construct is allowed. 100480093f4SDimitry Andric if (CurStmt) { 101480093f4SDimitry Andric CurStmt = OrigStmt; 102480093f4SDimitry Andric break; 103480093f4SDimitry Andric } 104480093f4SDimitry Andric CurStmt = S; 105480093f4SDimitry Andric continue; 106480093f4SDimitry Andric } 107480093f4SDimitry Andric S = S->IgnoreContainers(); 108480093f4SDimitry Andric if (auto *InnerCS = dyn_cast_or_null<CompoundStmt>(S)) 109480093f4SDimitry Andric NextStatements.push_back(InnerCS); 110480093f4SDimitry Andric } 111480093f4SDimitry Andric if (Statements.empty()) { 112480093f4SDimitry Andric // Found single inner loop or multiple loops - exit. 113480093f4SDimitry Andric if (CurStmt) 114480093f4SDimitry Andric break; 115480093f4SDimitry Andric Statements.swap(NextStatements); 116480093f4SDimitry Andric } 117480093f4SDimitry Andric } 118480093f4SDimitry Andric if (!CurStmt) 119480093f4SDimitry Andric CurStmt = OrigStmt; 120480093f4SDimitry Andric } 121480093f4SDimitry Andric } 122480093f4SDimitry Andric return CurStmt; 123480093f4SDimitry Andric } 124480093f4SDimitry Andric 125fe6060f1SDimitry Andric bool OMPLoopBasedDirective::doForAllLoops( 126fe6060f1SDimitry Andric Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops, 127fe6060f1SDimitry Andric llvm::function_ref<bool(unsigned, Stmt *)> Callback, 128349cc55cSDimitry Andric llvm::function_ref<void(OMPLoopTransformationDirective *)> 129fe6060f1SDimitry Andric OnTransformationCallback) { 130fe6060f1SDimitry Andric CurStmt = CurStmt->IgnoreContainers(); 131fe6060f1SDimitry Andric for (unsigned Cnt = 0; Cnt < NumLoops; ++Cnt) { 132fe6060f1SDimitry Andric while (true) { 133349cc55cSDimitry Andric auto *Dir = dyn_cast<OMPLoopTransformationDirective>(CurStmt); 134349cc55cSDimitry Andric if (!Dir) 135fe6060f1SDimitry Andric break; 136349cc55cSDimitry Andric 137349cc55cSDimitry Andric OnTransformationCallback(Dir); 138349cc55cSDimitry Andric 139349cc55cSDimitry Andric Stmt *TransformedStmt = Dir->getTransformedStmt(); 140349cc55cSDimitry Andric if (!TransformedStmt) { 141349cc55cSDimitry Andric unsigned NumGeneratedLoops = Dir->getNumGeneratedLoops(); 142349cc55cSDimitry Andric if (NumGeneratedLoops == 0) { 143349cc55cSDimitry Andric // May happen if the loop transformation does not result in a 144349cc55cSDimitry Andric // generated loop (such as full unrolling). 145349cc55cSDimitry Andric break; 146349cc55cSDimitry Andric } 147349cc55cSDimitry Andric if (NumGeneratedLoops > 0) { 148349cc55cSDimitry Andric // The loop transformation construct has generated loops, but these 149349cc55cSDimitry Andric // may not have been generated yet due to being in a dependent 150349cc55cSDimitry Andric // context. 151349cc55cSDimitry Andric return true; 152349cc55cSDimitry Andric } 153fe6060f1SDimitry Andric } 154fe6060f1SDimitry Andric 155349cc55cSDimitry Andric CurStmt = TransformedStmt; 156fe6060f1SDimitry Andric } 157fe6060f1SDimitry Andric if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(CurStmt)) 158fe6060f1SDimitry Andric CurStmt = CanonLoop->getLoopStmt(); 159fe6060f1SDimitry Andric if (Callback(Cnt, CurStmt)) 160fe6060f1SDimitry Andric return false; 161fe6060f1SDimitry Andric // Move on to the next nested for loop, or to the loop body. 162fe6060f1SDimitry Andric // OpenMP [2.8.1, simd construct, Restrictions] 163fe6060f1SDimitry Andric // All loops associated with the construct must be perfectly nested; that 164fe6060f1SDimitry Andric // is, there must be no intervening code nor any OpenMP directive between 165fe6060f1SDimitry Andric // any two loops. 166fe6060f1SDimitry Andric if (auto *For = dyn_cast<ForStmt>(CurStmt)) { 167fe6060f1SDimitry Andric CurStmt = For->getBody(); 168fe6060f1SDimitry Andric } else { 169fe6060f1SDimitry Andric assert(isa<CXXForRangeStmt>(CurStmt) && 170fe6060f1SDimitry Andric "Expected canonical for or range-based for loops."); 171fe6060f1SDimitry Andric CurStmt = cast<CXXForRangeStmt>(CurStmt)->getBody(); 172fe6060f1SDimitry Andric } 173fe6060f1SDimitry Andric CurStmt = OMPLoopBasedDirective::tryToFindNextInnerLoop( 174fe6060f1SDimitry Andric CurStmt, TryImperfectlyNestedLoops); 175fe6060f1SDimitry Andric } 176fe6060f1SDimitry Andric return true; 177fe6060f1SDimitry Andric } 178fe6060f1SDimitry Andric 179fe6060f1SDimitry Andric void OMPLoopBasedDirective::doForAllLoopsBodies( 180fe6060f1SDimitry Andric Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops, 181fe6060f1SDimitry Andric llvm::function_ref<void(unsigned, Stmt *, Stmt *)> Callback) { 182fe6060f1SDimitry Andric bool Res = OMPLoopBasedDirective::doForAllLoops( 183fe6060f1SDimitry Andric CurStmt, TryImperfectlyNestedLoops, NumLoops, 184fe6060f1SDimitry Andric [Callback](unsigned Cnt, Stmt *Loop) { 185fe6060f1SDimitry Andric Stmt *Body = nullptr; 186fe6060f1SDimitry Andric if (auto *For = dyn_cast<ForStmt>(Loop)) { 187fe6060f1SDimitry Andric Body = For->getBody(); 188fe6060f1SDimitry Andric } else { 189fe6060f1SDimitry Andric assert(isa<CXXForRangeStmt>(Loop) && 190fe6060f1SDimitry Andric "Expected canonical for or range-based for loops."); 191fe6060f1SDimitry Andric Body = cast<CXXForRangeStmt>(Loop)->getBody(); 192fe6060f1SDimitry Andric } 193fe6060f1SDimitry Andric if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Body)) 194fe6060f1SDimitry Andric Body = CanonLoop->getLoopStmt(); 195fe6060f1SDimitry Andric Callback(Cnt, Loop, Body); 196fe6060f1SDimitry Andric return false; 197fe6060f1SDimitry Andric }); 198fe6060f1SDimitry Andric assert(Res && "Expected only loops"); 199fe6060f1SDimitry Andric (void)Res; 200fe6060f1SDimitry Andric } 201fe6060f1SDimitry Andric 202480093f4SDimitry Andric Stmt *OMPLoopDirective::getBody() { 203480093f4SDimitry Andric // This relies on the loop form is already checked by Sema. 204fe6060f1SDimitry Andric Stmt *Body = nullptr; 205fe6060f1SDimitry Andric OMPLoopBasedDirective::doForAllLoopsBodies( 206fe6060f1SDimitry Andric Data->getRawStmt(), /*TryImperfectlyNestedLoops=*/true, 207fe6060f1SDimitry Andric NumAssociatedLoops, 208fe6060f1SDimitry Andric [&Body](unsigned, Stmt *, Stmt *BodyStmt) { Body = BodyStmt; }); 209480093f4SDimitry Andric return Body; 210480093f4SDimitry Andric } 211480093f4SDimitry Andric 2120b57cec5SDimitry Andric void OMPLoopDirective::setCounters(ArrayRef<Expr *> A) { 213fe6060f1SDimitry Andric assert(A.size() == getLoopsNumber() && 2140b57cec5SDimitry Andric "Number of loop counters is not the same as the collapsed number"); 215e8d8bef9SDimitry Andric llvm::copy(A, getCounters().begin()); 2160b57cec5SDimitry Andric } 2170b57cec5SDimitry Andric 2180b57cec5SDimitry Andric void OMPLoopDirective::setPrivateCounters(ArrayRef<Expr *> A) { 219fe6060f1SDimitry Andric assert(A.size() == getLoopsNumber() && "Number of loop private counters " 2200b57cec5SDimitry Andric "is not the same as the collapsed " 2210b57cec5SDimitry Andric "number"); 222e8d8bef9SDimitry Andric llvm::copy(A, getPrivateCounters().begin()); 2230b57cec5SDimitry Andric } 2240b57cec5SDimitry Andric 2250b57cec5SDimitry Andric void OMPLoopDirective::setInits(ArrayRef<Expr *> A) { 226fe6060f1SDimitry Andric assert(A.size() == getLoopsNumber() && 2270b57cec5SDimitry Andric "Number of counter inits is not the same as the collapsed number"); 228e8d8bef9SDimitry Andric llvm::copy(A, getInits().begin()); 2290b57cec5SDimitry Andric } 2300b57cec5SDimitry Andric 2310b57cec5SDimitry Andric void OMPLoopDirective::setUpdates(ArrayRef<Expr *> A) { 232fe6060f1SDimitry Andric assert(A.size() == getLoopsNumber() && 2330b57cec5SDimitry Andric "Number of counter updates is not the same as the collapsed number"); 234e8d8bef9SDimitry Andric llvm::copy(A, getUpdates().begin()); 2350b57cec5SDimitry Andric } 2360b57cec5SDimitry Andric 2370b57cec5SDimitry Andric void OMPLoopDirective::setFinals(ArrayRef<Expr *> A) { 238fe6060f1SDimitry Andric assert(A.size() == getLoopsNumber() && 2390b57cec5SDimitry Andric "Number of counter finals is not the same as the collapsed number"); 240e8d8bef9SDimitry Andric llvm::copy(A, getFinals().begin()); 2410b57cec5SDimitry Andric } 2420b57cec5SDimitry Andric 243a7dea167SDimitry Andric void OMPLoopDirective::setDependentCounters(ArrayRef<Expr *> A) { 244a7dea167SDimitry Andric assert( 245fe6060f1SDimitry Andric A.size() == getLoopsNumber() && 246a7dea167SDimitry Andric "Number of dependent counters is not the same as the collapsed number"); 247a7dea167SDimitry Andric llvm::copy(A, getDependentCounters().begin()); 248a7dea167SDimitry Andric } 249a7dea167SDimitry Andric 250a7dea167SDimitry Andric void OMPLoopDirective::setDependentInits(ArrayRef<Expr *> A) { 251fe6060f1SDimitry Andric assert(A.size() == getLoopsNumber() && 252a7dea167SDimitry Andric "Number of dependent inits is not the same as the collapsed number"); 253a7dea167SDimitry Andric llvm::copy(A, getDependentInits().begin()); 254a7dea167SDimitry Andric } 255a7dea167SDimitry Andric 256a7dea167SDimitry Andric void OMPLoopDirective::setFinalsConditions(ArrayRef<Expr *> A) { 257fe6060f1SDimitry Andric assert(A.size() == getLoopsNumber() && 258a7dea167SDimitry Andric "Number of finals conditions is not the same as the collapsed number"); 259a7dea167SDimitry Andric llvm::copy(A, getFinalsConditions().begin()); 260a7dea167SDimitry Andric } 261a7dea167SDimitry Andric 262349cc55cSDimitry Andric OMPMetaDirective *OMPMetaDirective::Create(const ASTContext &C, 263349cc55cSDimitry Andric SourceLocation StartLoc, 264349cc55cSDimitry Andric SourceLocation EndLoc, 265349cc55cSDimitry Andric ArrayRef<OMPClause *> Clauses, 266349cc55cSDimitry Andric Stmt *AssociatedStmt, Stmt *IfStmt) { 267349cc55cSDimitry Andric auto *Dir = createDirective<OMPMetaDirective>( 268349cc55cSDimitry Andric C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc); 269349cc55cSDimitry Andric Dir->setIfStmt(IfStmt); 270349cc55cSDimitry Andric return Dir; 271349cc55cSDimitry Andric } 272349cc55cSDimitry Andric 273349cc55cSDimitry Andric OMPMetaDirective *OMPMetaDirective::CreateEmpty(const ASTContext &C, 274349cc55cSDimitry Andric unsigned NumClauses, 275349cc55cSDimitry Andric EmptyShell) { 276349cc55cSDimitry Andric return createEmptyDirective<OMPMetaDirective>(C, NumClauses, 277349cc55cSDimitry Andric /*HasAssociatedStmt=*/true, 278349cc55cSDimitry Andric /*NumChildren=*/1); 279349cc55cSDimitry Andric } 280349cc55cSDimitry Andric 2810b57cec5SDimitry Andric OMPParallelDirective *OMPParallelDirective::Create( 2820b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 2835ffd83dbSDimitry Andric ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, 2845ffd83dbSDimitry Andric bool HasCancel) { 285e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPParallelDirective>( 286e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc); 2875ffd83dbSDimitry Andric Dir->setTaskReductionRefExpr(TaskRedRef); 2880b57cec5SDimitry Andric Dir->setHasCancel(HasCancel); 2890b57cec5SDimitry Andric return Dir; 2900b57cec5SDimitry Andric } 2910b57cec5SDimitry Andric 2920b57cec5SDimitry Andric OMPParallelDirective *OMPParallelDirective::CreateEmpty(const ASTContext &C, 2930b57cec5SDimitry Andric unsigned NumClauses, 2940b57cec5SDimitry Andric EmptyShell) { 295e8d8bef9SDimitry Andric return createEmptyDirective<OMPParallelDirective>(C, NumClauses, 296e8d8bef9SDimitry Andric /*HasAssociatedStmt=*/true, 297e8d8bef9SDimitry Andric /*NumChildren=*/1); 2980b57cec5SDimitry Andric } 2990b57cec5SDimitry Andric 3005f757f3fSDimitry Andric OMPSimdDirective *OMPSimdDirective::Create( 3015f757f3fSDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 3025f757f3fSDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 3035f757f3fSDimitry Andric const HelperExprs &Exprs, OpenMPDirectiveKind ParamPrevMappedDirective) { 304e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPSimdDirective>( 305e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_simd), 306e8d8bef9SDimitry Andric StartLoc, EndLoc, CollapsedNum); 3070b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 3080b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 3090b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 3100b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 3110b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 3120b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 3130b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 3140b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 3150b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 3160b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 3170b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 3180b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 319a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 320a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 321a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 3220b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 3235f757f3fSDimitry Andric Dir->setMappedDirective(ParamPrevMappedDirective); 3240b57cec5SDimitry Andric return Dir; 3250b57cec5SDimitry Andric } 3260b57cec5SDimitry Andric 3270b57cec5SDimitry Andric OMPSimdDirective *OMPSimdDirective::CreateEmpty(const ASTContext &C, 3280b57cec5SDimitry Andric unsigned NumClauses, 3290b57cec5SDimitry Andric unsigned CollapsedNum, 3300b57cec5SDimitry Andric EmptyShell) { 331e8d8bef9SDimitry Andric return createEmptyDirective<OMPSimdDirective>( 332e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 333e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_simd), CollapsedNum); 3340b57cec5SDimitry Andric } 3350b57cec5SDimitry Andric 3365ffd83dbSDimitry Andric OMPForDirective *OMPForDirective::Create( 3375ffd83dbSDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 3385ffd83dbSDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 3395f757f3fSDimitry Andric const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel, 3405f757f3fSDimitry Andric OpenMPDirectiveKind ParamPrevMappedDirective) { 341e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPForDirective>( 342e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for) + 1, 343e8d8bef9SDimitry Andric StartLoc, EndLoc, CollapsedNum); 3440b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 3450b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 3460b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 3470b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 3480b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 3490b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 3500b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 3510b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 3520b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 3530b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 3540b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 3550b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 3560b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 3570b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 3580b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 3590b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 3600b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 3610b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 3620b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 3630b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 364a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 365a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 366a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 3670b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 3685ffd83dbSDimitry Andric Dir->setTaskReductionRefExpr(TaskRedRef); 3690b57cec5SDimitry Andric Dir->setHasCancel(HasCancel); 3705f757f3fSDimitry Andric Dir->setMappedDirective(ParamPrevMappedDirective); 3710b57cec5SDimitry Andric return Dir; 3720b57cec5SDimitry Andric } 3730b57cec5SDimitry Andric 374349cc55cSDimitry Andric Stmt *OMPLoopTransformationDirective::getTransformedStmt() const { 375349cc55cSDimitry Andric switch (getStmtClass()) { 376349cc55cSDimitry Andric #define STMT(CLASS, PARENT) 377349cc55cSDimitry Andric #define ABSTRACT_STMT(CLASS) 378349cc55cSDimitry Andric #define OMPLOOPTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \ 379349cc55cSDimitry Andric case Stmt::CLASS##Class: \ 380349cc55cSDimitry Andric return static_cast<const CLASS *>(this)->getTransformedStmt(); 381349cc55cSDimitry Andric #include "clang/AST/StmtNodes.inc" 382349cc55cSDimitry Andric default: 383349cc55cSDimitry Andric llvm_unreachable("Not a loop transformation"); 384349cc55cSDimitry Andric } 385349cc55cSDimitry Andric } 386349cc55cSDimitry Andric 387349cc55cSDimitry Andric Stmt *OMPLoopTransformationDirective::getPreInits() const { 388349cc55cSDimitry Andric switch (getStmtClass()) { 389349cc55cSDimitry Andric #define STMT(CLASS, PARENT) 390349cc55cSDimitry Andric #define ABSTRACT_STMT(CLASS) 391349cc55cSDimitry Andric #define OMPLOOPTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \ 392349cc55cSDimitry Andric case Stmt::CLASS##Class: \ 393349cc55cSDimitry Andric return static_cast<const CLASS *>(this)->getPreInits(); 394349cc55cSDimitry Andric #include "clang/AST/StmtNodes.inc" 395349cc55cSDimitry Andric default: 396349cc55cSDimitry Andric llvm_unreachable("Not a loop transformation"); 397349cc55cSDimitry Andric } 398349cc55cSDimitry Andric } 399349cc55cSDimitry Andric 4000b57cec5SDimitry Andric OMPForDirective *OMPForDirective::CreateEmpty(const ASTContext &C, 4010b57cec5SDimitry Andric unsigned NumClauses, 4020b57cec5SDimitry Andric unsigned CollapsedNum, 4030b57cec5SDimitry Andric EmptyShell) { 404e8d8bef9SDimitry Andric return createEmptyDirective<OMPForDirective>( 405e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 406e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_for) + 1, CollapsedNum); 4070b57cec5SDimitry Andric } 4080b57cec5SDimitry Andric 409fe6060f1SDimitry Andric OMPTileDirective * 410fe6060f1SDimitry Andric OMPTileDirective::Create(const ASTContext &C, SourceLocation StartLoc, 411fe6060f1SDimitry Andric SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses, 412fe6060f1SDimitry Andric unsigned NumLoops, Stmt *AssociatedStmt, 413fe6060f1SDimitry Andric Stmt *TransformedStmt, Stmt *PreInits) { 414fe6060f1SDimitry Andric OMPTileDirective *Dir = createDirective<OMPTileDirective>( 415fe6060f1SDimitry Andric C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc, 416fe6060f1SDimitry Andric NumLoops); 417fe6060f1SDimitry Andric Dir->setTransformedStmt(TransformedStmt); 418fe6060f1SDimitry Andric Dir->setPreInits(PreInits); 419fe6060f1SDimitry Andric return Dir; 420fe6060f1SDimitry Andric } 421fe6060f1SDimitry Andric 422fe6060f1SDimitry Andric OMPTileDirective *OMPTileDirective::CreateEmpty(const ASTContext &C, 423fe6060f1SDimitry Andric unsigned NumClauses, 424fe6060f1SDimitry Andric unsigned NumLoops) { 425fe6060f1SDimitry Andric return createEmptyDirective<OMPTileDirective>( 426fe6060f1SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1, 427fe6060f1SDimitry Andric SourceLocation(), SourceLocation(), NumLoops); 428fe6060f1SDimitry Andric } 429fe6060f1SDimitry Andric 430fe6060f1SDimitry Andric OMPUnrollDirective * 431fe6060f1SDimitry Andric OMPUnrollDirective::Create(const ASTContext &C, SourceLocation StartLoc, 432fe6060f1SDimitry Andric SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses, 433349cc55cSDimitry Andric Stmt *AssociatedStmt, unsigned NumGeneratedLoops, 434349cc55cSDimitry Andric Stmt *TransformedStmt, Stmt *PreInits) { 435349cc55cSDimitry Andric assert(NumGeneratedLoops <= 1 && "Unrolling generates at most one loop"); 436349cc55cSDimitry Andric 437fe6060f1SDimitry Andric auto *Dir = createDirective<OMPUnrollDirective>( 438fe6060f1SDimitry Andric C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc); 439349cc55cSDimitry Andric Dir->setNumGeneratedLoops(NumGeneratedLoops); 440fe6060f1SDimitry Andric Dir->setTransformedStmt(TransformedStmt); 441fe6060f1SDimitry Andric Dir->setPreInits(PreInits); 442fe6060f1SDimitry Andric return Dir; 443fe6060f1SDimitry Andric } 444fe6060f1SDimitry Andric 445fe6060f1SDimitry Andric OMPUnrollDirective *OMPUnrollDirective::CreateEmpty(const ASTContext &C, 446fe6060f1SDimitry Andric unsigned NumClauses) { 447fe6060f1SDimitry Andric return createEmptyDirective<OMPUnrollDirective>( 448fe6060f1SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1, 449fe6060f1SDimitry Andric SourceLocation(), SourceLocation()); 450fe6060f1SDimitry Andric } 451fe6060f1SDimitry Andric 452*0fca6ea1SDimitry Andric OMPReverseDirective * 453*0fca6ea1SDimitry Andric OMPReverseDirective::Create(const ASTContext &C, SourceLocation StartLoc, 454*0fca6ea1SDimitry Andric SourceLocation EndLoc, Stmt *AssociatedStmt, 455*0fca6ea1SDimitry Andric Stmt *TransformedStmt, Stmt *PreInits) { 456*0fca6ea1SDimitry Andric OMPReverseDirective *Dir = createDirective<OMPReverseDirective>( 457*0fca6ea1SDimitry Andric C, std::nullopt, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, 458*0fca6ea1SDimitry Andric EndLoc); 459*0fca6ea1SDimitry Andric Dir->setTransformedStmt(TransformedStmt); 460*0fca6ea1SDimitry Andric Dir->setPreInits(PreInits); 461*0fca6ea1SDimitry Andric return Dir; 462*0fca6ea1SDimitry Andric } 463*0fca6ea1SDimitry Andric 464*0fca6ea1SDimitry Andric OMPReverseDirective *OMPReverseDirective::CreateEmpty(const ASTContext &C) { 465*0fca6ea1SDimitry Andric return createEmptyDirective<OMPReverseDirective>( 466*0fca6ea1SDimitry Andric C, /*NumClauses=*/0, /*HasAssociatedStmt=*/true, 467*0fca6ea1SDimitry Andric TransformedStmtOffset + 1, SourceLocation(), SourceLocation()); 468*0fca6ea1SDimitry Andric } 469*0fca6ea1SDimitry Andric 470*0fca6ea1SDimitry Andric OMPInterchangeDirective *OMPInterchangeDirective::Create( 471*0fca6ea1SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 472*0fca6ea1SDimitry Andric ArrayRef<OMPClause *> Clauses, unsigned NumLoops, Stmt *AssociatedStmt, 473*0fca6ea1SDimitry Andric Stmt *TransformedStmt, Stmt *PreInits) { 474*0fca6ea1SDimitry Andric OMPInterchangeDirective *Dir = createDirective<OMPInterchangeDirective>( 475*0fca6ea1SDimitry Andric C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc, 476*0fca6ea1SDimitry Andric NumLoops); 477*0fca6ea1SDimitry Andric Dir->setTransformedStmt(TransformedStmt); 478*0fca6ea1SDimitry Andric Dir->setPreInits(PreInits); 479*0fca6ea1SDimitry Andric return Dir; 480*0fca6ea1SDimitry Andric } 481*0fca6ea1SDimitry Andric 482*0fca6ea1SDimitry Andric OMPInterchangeDirective * 483*0fca6ea1SDimitry Andric OMPInterchangeDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, 484*0fca6ea1SDimitry Andric unsigned NumLoops) { 485*0fca6ea1SDimitry Andric return createEmptyDirective<OMPInterchangeDirective>( 486*0fca6ea1SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, TransformedStmtOffset + 1, 487*0fca6ea1SDimitry Andric SourceLocation(), SourceLocation(), NumLoops); 488*0fca6ea1SDimitry Andric } 489*0fca6ea1SDimitry Andric 4900b57cec5SDimitry Andric OMPForSimdDirective * 4910b57cec5SDimitry Andric OMPForSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc, 4920b57cec5SDimitry Andric SourceLocation EndLoc, unsigned CollapsedNum, 4930b57cec5SDimitry Andric ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 4940b57cec5SDimitry Andric const HelperExprs &Exprs) { 495e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPForSimdDirective>( 496e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for_simd), 497e8d8bef9SDimitry Andric StartLoc, EndLoc, CollapsedNum); 4980b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 4990b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 5000b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 5010b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 5020b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 5030b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 5040b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 5050b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 5060b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 5070b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 5080b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 5090b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 5100b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 5110b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 5120b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 5130b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 5140b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 5150b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 5160b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 5170b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 518a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 519a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 520a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 5210b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 5220b57cec5SDimitry Andric return Dir; 5230b57cec5SDimitry Andric } 5240b57cec5SDimitry Andric 5250b57cec5SDimitry Andric OMPForSimdDirective *OMPForSimdDirective::CreateEmpty(const ASTContext &C, 5260b57cec5SDimitry Andric unsigned NumClauses, 5270b57cec5SDimitry Andric unsigned CollapsedNum, 5280b57cec5SDimitry Andric EmptyShell) { 529e8d8bef9SDimitry Andric return createEmptyDirective<OMPForSimdDirective>( 530e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 531e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_for_simd), CollapsedNum); 5320b57cec5SDimitry Andric } 5330b57cec5SDimitry Andric 5340b57cec5SDimitry Andric OMPSectionsDirective *OMPSectionsDirective::Create( 5350b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 5365ffd83dbSDimitry Andric ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, 5375ffd83dbSDimitry Andric bool HasCancel) { 538e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPSectionsDirective>(C, Clauses, AssociatedStmt, 539e8d8bef9SDimitry Andric /*NumChildren=*/1, StartLoc, 540e8d8bef9SDimitry Andric EndLoc); 5415ffd83dbSDimitry Andric Dir->setTaskReductionRefExpr(TaskRedRef); 5420b57cec5SDimitry Andric Dir->setHasCancel(HasCancel); 5430b57cec5SDimitry Andric return Dir; 5440b57cec5SDimitry Andric } 5450b57cec5SDimitry Andric 5460b57cec5SDimitry Andric OMPSectionsDirective *OMPSectionsDirective::CreateEmpty(const ASTContext &C, 5470b57cec5SDimitry Andric unsigned NumClauses, 5480b57cec5SDimitry Andric EmptyShell) { 549e8d8bef9SDimitry Andric return createEmptyDirective<OMPSectionsDirective>(C, NumClauses, 550e8d8bef9SDimitry Andric /*HasAssociatedStmt=*/true, 551e8d8bef9SDimitry Andric /*NumChildren=*/1); 5520b57cec5SDimitry Andric } 5530b57cec5SDimitry Andric 5540b57cec5SDimitry Andric OMPSectionDirective *OMPSectionDirective::Create(const ASTContext &C, 5550b57cec5SDimitry Andric SourceLocation StartLoc, 5560b57cec5SDimitry Andric SourceLocation EndLoc, 5570b57cec5SDimitry Andric Stmt *AssociatedStmt, 5580b57cec5SDimitry Andric bool HasCancel) { 559e8d8bef9SDimitry Andric auto *Dir = 560bdd1243dSDimitry Andric createDirective<OMPSectionDirective>(C, std::nullopt, AssociatedStmt, 56104eeddc0SDimitry Andric /*NumChildren=*/0, StartLoc, EndLoc); 5620b57cec5SDimitry Andric Dir->setHasCancel(HasCancel); 5630b57cec5SDimitry Andric return Dir; 5640b57cec5SDimitry Andric } 5650b57cec5SDimitry Andric 5660b57cec5SDimitry Andric OMPSectionDirective *OMPSectionDirective::CreateEmpty(const ASTContext &C, 5670b57cec5SDimitry Andric EmptyShell) { 568e8d8bef9SDimitry Andric return createEmptyDirective<OMPSectionDirective>(C, /*NumClauses=*/0, 569e8d8bef9SDimitry Andric /*HasAssociatedStmt=*/true); 5700b57cec5SDimitry Andric } 5710b57cec5SDimitry Andric 5725f757f3fSDimitry Andric OMPScopeDirective *OMPScopeDirective::Create(const ASTContext &C, 5735f757f3fSDimitry Andric SourceLocation StartLoc, 5745f757f3fSDimitry Andric SourceLocation EndLoc, 5755f757f3fSDimitry Andric ArrayRef<OMPClause *> Clauses, 5765f757f3fSDimitry Andric Stmt *AssociatedStmt) { 5775f757f3fSDimitry Andric return createDirective<OMPScopeDirective>(C, Clauses, AssociatedStmt, 5785f757f3fSDimitry Andric /*NumChildren=*/0, StartLoc, 5795f757f3fSDimitry Andric EndLoc); 5805f757f3fSDimitry Andric } 5815f757f3fSDimitry Andric 5825f757f3fSDimitry Andric OMPScopeDirective *OMPScopeDirective::CreateEmpty(const ASTContext &C, 5835f757f3fSDimitry Andric unsigned NumClauses, 5845f757f3fSDimitry Andric EmptyShell) { 5855f757f3fSDimitry Andric return createEmptyDirective<OMPScopeDirective>(C, NumClauses, 5865f757f3fSDimitry Andric /*HasAssociatedStmt=*/true); 5875f757f3fSDimitry Andric } 5885f757f3fSDimitry Andric 5890b57cec5SDimitry Andric OMPSingleDirective *OMPSingleDirective::Create(const ASTContext &C, 5900b57cec5SDimitry Andric SourceLocation StartLoc, 5910b57cec5SDimitry Andric SourceLocation EndLoc, 5920b57cec5SDimitry Andric ArrayRef<OMPClause *> Clauses, 5930b57cec5SDimitry Andric Stmt *AssociatedStmt) { 594e8d8bef9SDimitry Andric return createDirective<OMPSingleDirective>(C, Clauses, AssociatedStmt, 595e8d8bef9SDimitry Andric /*NumChildren=*/0, StartLoc, 596e8d8bef9SDimitry Andric EndLoc); 5970b57cec5SDimitry Andric } 5980b57cec5SDimitry Andric 5990b57cec5SDimitry Andric OMPSingleDirective *OMPSingleDirective::CreateEmpty(const ASTContext &C, 6000b57cec5SDimitry Andric unsigned NumClauses, 6010b57cec5SDimitry Andric EmptyShell) { 602e8d8bef9SDimitry Andric return createEmptyDirective<OMPSingleDirective>(C, NumClauses, 603e8d8bef9SDimitry Andric /*HasAssociatedStmt=*/true); 6040b57cec5SDimitry Andric } 6050b57cec5SDimitry Andric 6060b57cec5SDimitry Andric OMPMasterDirective *OMPMasterDirective::Create(const ASTContext &C, 6070b57cec5SDimitry Andric SourceLocation StartLoc, 6080b57cec5SDimitry Andric SourceLocation EndLoc, 6090b57cec5SDimitry Andric Stmt *AssociatedStmt) { 610bdd1243dSDimitry Andric return createDirective<OMPMasterDirective>(C, std::nullopt, AssociatedStmt, 611e8d8bef9SDimitry Andric /*NumChildren=*/0, StartLoc, 612e8d8bef9SDimitry Andric EndLoc); 6130b57cec5SDimitry Andric } 6140b57cec5SDimitry Andric 6150b57cec5SDimitry Andric OMPMasterDirective *OMPMasterDirective::CreateEmpty(const ASTContext &C, 6160b57cec5SDimitry Andric EmptyShell) { 617e8d8bef9SDimitry Andric return createEmptyDirective<OMPMasterDirective>(C, /*NumClauses=*/0, 618e8d8bef9SDimitry Andric /*HasAssociatedStmt=*/true); 6190b57cec5SDimitry Andric } 6200b57cec5SDimitry Andric 6210b57cec5SDimitry Andric OMPCriticalDirective *OMPCriticalDirective::Create( 6220b57cec5SDimitry Andric const ASTContext &C, const DeclarationNameInfo &Name, 6230b57cec5SDimitry Andric SourceLocation StartLoc, SourceLocation EndLoc, 6240b57cec5SDimitry Andric ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { 625e8d8bef9SDimitry Andric return createDirective<OMPCriticalDirective>(C, Clauses, AssociatedStmt, 626e8d8bef9SDimitry Andric /*NumChildren=*/0, Name, 627e8d8bef9SDimitry Andric StartLoc, EndLoc); 6280b57cec5SDimitry Andric } 6290b57cec5SDimitry Andric 6300b57cec5SDimitry Andric OMPCriticalDirective *OMPCriticalDirective::CreateEmpty(const ASTContext &C, 6310b57cec5SDimitry Andric unsigned NumClauses, 6320b57cec5SDimitry Andric EmptyShell) { 633e8d8bef9SDimitry Andric return createEmptyDirective<OMPCriticalDirective>(C, NumClauses, 634e8d8bef9SDimitry Andric /*HasAssociatedStmt=*/true); 6350b57cec5SDimitry Andric } 6360b57cec5SDimitry Andric 6370b57cec5SDimitry Andric OMPParallelForDirective *OMPParallelForDirective::Create( 6380b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 6390b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 6405ffd83dbSDimitry Andric const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) { 641e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPParallelForDirective>( 642e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 643e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, StartLoc, EndLoc, 644e8d8bef9SDimitry Andric CollapsedNum); 6450b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 6460b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 6470b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 6480b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 6490b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 6500b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 6510b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 6520b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 6530b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 6540b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 6550b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 6560b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 6570b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 6580b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 6590b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 6600b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 6610b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 6620b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 6630b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 6640b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 665a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 666a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 667a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 6680b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 6695ffd83dbSDimitry Andric Dir->setTaskReductionRefExpr(TaskRedRef); 6700b57cec5SDimitry Andric Dir->setHasCancel(HasCancel); 6710b57cec5SDimitry Andric return Dir; 6720b57cec5SDimitry Andric } 6730b57cec5SDimitry Andric 6740b57cec5SDimitry Andric OMPParallelForDirective * 6750b57cec5SDimitry Andric OMPParallelForDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, 6760b57cec5SDimitry Andric unsigned CollapsedNum, EmptyShell) { 677e8d8bef9SDimitry Andric return createEmptyDirective<OMPParallelForDirective>( 678e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 679e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, CollapsedNum); 6800b57cec5SDimitry Andric } 6810b57cec5SDimitry Andric 6820b57cec5SDimitry Andric OMPParallelForSimdDirective *OMPParallelForSimdDirective::Create( 6830b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 6840b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 6850b57cec5SDimitry Andric const HelperExprs &Exprs) { 686e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPParallelForSimdDirective>( 687e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 688e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), StartLoc, EndLoc, 689e8d8bef9SDimitry Andric CollapsedNum); 6900b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 6910b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 6920b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 6930b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 6940b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 6950b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 6960b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 6970b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 6980b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 6990b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 7000b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 7010b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 7020b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 7030b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 7040b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 7050b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 7060b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 7070b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 7080b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 7090b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 710a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 711a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 712a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 7130b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 7140b57cec5SDimitry Andric return Dir; 7150b57cec5SDimitry Andric } 7160b57cec5SDimitry Andric 7170b57cec5SDimitry Andric OMPParallelForSimdDirective * 7180b57cec5SDimitry Andric OMPParallelForSimdDirective::CreateEmpty(const ASTContext &C, 7190b57cec5SDimitry Andric unsigned NumClauses, 7200b57cec5SDimitry Andric unsigned CollapsedNum, EmptyShell) { 721e8d8bef9SDimitry Andric return createEmptyDirective<OMPParallelForSimdDirective>( 722e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 723e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), CollapsedNum); 7240b57cec5SDimitry Andric } 7250b57cec5SDimitry Andric 726480093f4SDimitry Andric OMPParallelMasterDirective *OMPParallelMasterDirective::Create( 727480093f4SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 7285ffd83dbSDimitry Andric ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) { 729e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPParallelMasterDirective>( 730e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc); 7315ffd83dbSDimitry Andric Dir->setTaskReductionRefExpr(TaskRedRef); 732480093f4SDimitry Andric return Dir; 733480093f4SDimitry Andric } 734480093f4SDimitry Andric 735e8d8bef9SDimitry Andric OMPParallelMasterDirective * 736e8d8bef9SDimitry Andric OMPParallelMasterDirective::CreateEmpty(const ASTContext &C, 737e8d8bef9SDimitry Andric unsigned NumClauses, EmptyShell) { 738e8d8bef9SDimitry Andric return createEmptyDirective<OMPParallelMasterDirective>( 739e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1); 740480093f4SDimitry Andric } 741480093f4SDimitry Andric 74281ad6265SDimitry Andric OMPParallelMaskedDirective *OMPParallelMaskedDirective::Create( 74381ad6265SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 74481ad6265SDimitry Andric ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) { 74581ad6265SDimitry Andric auto *Dir = createDirective<OMPParallelMaskedDirective>( 74681ad6265SDimitry Andric C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc); 74781ad6265SDimitry Andric Dir->setTaskReductionRefExpr(TaskRedRef); 74881ad6265SDimitry Andric return Dir; 74981ad6265SDimitry Andric } 75081ad6265SDimitry Andric 75181ad6265SDimitry Andric OMPParallelMaskedDirective * 75281ad6265SDimitry Andric OMPParallelMaskedDirective::CreateEmpty(const ASTContext &C, 75381ad6265SDimitry Andric unsigned NumClauses, EmptyShell) { 75481ad6265SDimitry Andric return createEmptyDirective<OMPParallelMaskedDirective>( 75581ad6265SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1); 75681ad6265SDimitry Andric } 75781ad6265SDimitry Andric 7580b57cec5SDimitry Andric OMPParallelSectionsDirective *OMPParallelSectionsDirective::Create( 7590b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 7605ffd83dbSDimitry Andric ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, 7615ffd83dbSDimitry Andric bool HasCancel) { 762e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPParallelSectionsDirective>( 763e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc); 7645ffd83dbSDimitry Andric Dir->setTaskReductionRefExpr(TaskRedRef); 7650b57cec5SDimitry Andric Dir->setHasCancel(HasCancel); 7660b57cec5SDimitry Andric return Dir; 7670b57cec5SDimitry Andric } 7680b57cec5SDimitry Andric 7690b57cec5SDimitry Andric OMPParallelSectionsDirective * 7700b57cec5SDimitry Andric OMPParallelSectionsDirective::CreateEmpty(const ASTContext &C, 7710b57cec5SDimitry Andric unsigned NumClauses, EmptyShell) { 772e8d8bef9SDimitry Andric return createEmptyDirective<OMPParallelSectionsDirective>( 773e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1); 7740b57cec5SDimitry Andric } 7750b57cec5SDimitry Andric 7760b57cec5SDimitry Andric OMPTaskDirective * 7770b57cec5SDimitry Andric OMPTaskDirective::Create(const ASTContext &C, SourceLocation StartLoc, 7780b57cec5SDimitry Andric SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses, 7790b57cec5SDimitry Andric Stmt *AssociatedStmt, bool HasCancel) { 780e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPTaskDirective>( 781e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc); 7820b57cec5SDimitry Andric Dir->setHasCancel(HasCancel); 7830b57cec5SDimitry Andric return Dir; 7840b57cec5SDimitry Andric } 7850b57cec5SDimitry Andric 7860b57cec5SDimitry Andric OMPTaskDirective *OMPTaskDirective::CreateEmpty(const ASTContext &C, 7870b57cec5SDimitry Andric unsigned NumClauses, 7880b57cec5SDimitry Andric EmptyShell) { 789e8d8bef9SDimitry Andric return createEmptyDirective<OMPTaskDirective>(C, NumClauses, 790e8d8bef9SDimitry Andric /*HasAssociatedStmt=*/true); 7910b57cec5SDimitry Andric } 7920b57cec5SDimitry Andric 7930b57cec5SDimitry Andric OMPTaskyieldDirective *OMPTaskyieldDirective::Create(const ASTContext &C, 7940b57cec5SDimitry Andric SourceLocation StartLoc, 7950b57cec5SDimitry Andric SourceLocation EndLoc) { 796e8d8bef9SDimitry Andric return new (C) OMPTaskyieldDirective(StartLoc, EndLoc); 7970b57cec5SDimitry Andric } 7980b57cec5SDimitry Andric 7990b57cec5SDimitry Andric OMPTaskyieldDirective *OMPTaskyieldDirective::CreateEmpty(const ASTContext &C, 8000b57cec5SDimitry Andric EmptyShell) { 801e8d8bef9SDimitry Andric return new (C) OMPTaskyieldDirective(); 8020b57cec5SDimitry Andric } 8030b57cec5SDimitry Andric 804bdd1243dSDimitry Andric OMPErrorDirective *OMPErrorDirective::Create(const ASTContext &C, 805bdd1243dSDimitry Andric SourceLocation StartLoc, 806bdd1243dSDimitry Andric SourceLocation EndLoc, 807bdd1243dSDimitry Andric ArrayRef<OMPClause *> Clauses) { 808bdd1243dSDimitry Andric return createDirective<OMPErrorDirective>( 809bdd1243dSDimitry Andric C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc, 810bdd1243dSDimitry Andric EndLoc); 811bdd1243dSDimitry Andric } 812bdd1243dSDimitry Andric 813bdd1243dSDimitry Andric OMPErrorDirective *OMPErrorDirective::CreateEmpty(const ASTContext &C, 814bdd1243dSDimitry Andric unsigned NumClauses, 815bdd1243dSDimitry Andric EmptyShell) { 816bdd1243dSDimitry Andric return createEmptyDirective<OMPErrorDirective>(C, NumClauses); 817bdd1243dSDimitry Andric } 818bdd1243dSDimitry Andric 8190b57cec5SDimitry Andric OMPBarrierDirective *OMPBarrierDirective::Create(const ASTContext &C, 8200b57cec5SDimitry Andric SourceLocation StartLoc, 8210b57cec5SDimitry Andric SourceLocation EndLoc) { 822e8d8bef9SDimitry Andric return new (C) OMPBarrierDirective(StartLoc, EndLoc); 8230b57cec5SDimitry Andric } 8240b57cec5SDimitry Andric 8250b57cec5SDimitry Andric OMPBarrierDirective *OMPBarrierDirective::CreateEmpty(const ASTContext &C, 8260b57cec5SDimitry Andric EmptyShell) { 827e8d8bef9SDimitry Andric return new (C) OMPBarrierDirective(); 8280b57cec5SDimitry Andric } 8290b57cec5SDimitry Andric 830349cc55cSDimitry Andric OMPTaskwaitDirective * 831349cc55cSDimitry Andric OMPTaskwaitDirective::Create(const ASTContext &C, SourceLocation StartLoc, 832349cc55cSDimitry Andric SourceLocation EndLoc, 833349cc55cSDimitry Andric ArrayRef<OMPClause *> Clauses) { 834349cc55cSDimitry Andric return createDirective<OMPTaskwaitDirective>( 835349cc55cSDimitry Andric C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc, 836349cc55cSDimitry Andric EndLoc); 8370b57cec5SDimitry Andric } 8380b57cec5SDimitry Andric 8390b57cec5SDimitry Andric OMPTaskwaitDirective *OMPTaskwaitDirective::CreateEmpty(const ASTContext &C, 840349cc55cSDimitry Andric unsigned NumClauses, 8410b57cec5SDimitry Andric EmptyShell) { 842349cc55cSDimitry Andric return createEmptyDirective<OMPTaskwaitDirective>(C, NumClauses); 8430b57cec5SDimitry Andric } 8440b57cec5SDimitry Andric 8450b57cec5SDimitry Andric OMPTaskgroupDirective *OMPTaskgroupDirective::Create( 8460b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 8470b57cec5SDimitry Andric ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) { 848e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPTaskgroupDirective>( 849e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc); 8500b57cec5SDimitry Andric Dir->setReductionRef(ReductionRef); 8510b57cec5SDimitry Andric return Dir; 8520b57cec5SDimitry Andric } 8530b57cec5SDimitry Andric 8540b57cec5SDimitry Andric OMPTaskgroupDirective *OMPTaskgroupDirective::CreateEmpty(const ASTContext &C, 8550b57cec5SDimitry Andric unsigned NumClauses, 8560b57cec5SDimitry Andric EmptyShell) { 857e8d8bef9SDimitry Andric return createEmptyDirective<OMPTaskgroupDirective>( 858e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1); 8590b57cec5SDimitry Andric } 8600b57cec5SDimitry Andric 8610b57cec5SDimitry Andric OMPCancellationPointDirective *OMPCancellationPointDirective::Create( 8620b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 8630b57cec5SDimitry Andric OpenMPDirectiveKind CancelRegion) { 864e8d8bef9SDimitry Andric auto *Dir = new (C) OMPCancellationPointDirective(StartLoc, EndLoc); 8650b57cec5SDimitry Andric Dir->setCancelRegion(CancelRegion); 8660b57cec5SDimitry Andric return Dir; 8670b57cec5SDimitry Andric } 8680b57cec5SDimitry Andric 8690b57cec5SDimitry Andric OMPCancellationPointDirective * 8700b57cec5SDimitry Andric OMPCancellationPointDirective::CreateEmpty(const ASTContext &C, EmptyShell) { 871e8d8bef9SDimitry Andric return new (C) OMPCancellationPointDirective(); 8720b57cec5SDimitry Andric } 8730b57cec5SDimitry Andric 8740b57cec5SDimitry Andric OMPCancelDirective * 8750b57cec5SDimitry Andric OMPCancelDirective::Create(const ASTContext &C, SourceLocation StartLoc, 8760b57cec5SDimitry Andric SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses, 8770b57cec5SDimitry Andric OpenMPDirectiveKind CancelRegion) { 878e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPCancelDirective>( 879e8d8bef9SDimitry Andric C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc, 880e8d8bef9SDimitry Andric EndLoc); 8810b57cec5SDimitry Andric Dir->setCancelRegion(CancelRegion); 8820b57cec5SDimitry Andric return Dir; 8830b57cec5SDimitry Andric } 8840b57cec5SDimitry Andric 8850b57cec5SDimitry Andric OMPCancelDirective *OMPCancelDirective::CreateEmpty(const ASTContext &C, 8860b57cec5SDimitry Andric unsigned NumClauses, 8870b57cec5SDimitry Andric EmptyShell) { 888e8d8bef9SDimitry Andric return createEmptyDirective<OMPCancelDirective>(C, NumClauses); 8890b57cec5SDimitry Andric } 8900b57cec5SDimitry Andric 8910b57cec5SDimitry Andric OMPFlushDirective *OMPFlushDirective::Create(const ASTContext &C, 8920b57cec5SDimitry Andric SourceLocation StartLoc, 8930b57cec5SDimitry Andric SourceLocation EndLoc, 8940b57cec5SDimitry Andric ArrayRef<OMPClause *> Clauses) { 895e8d8bef9SDimitry Andric return createDirective<OMPFlushDirective>( 896e8d8bef9SDimitry Andric C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc, 897e8d8bef9SDimitry Andric EndLoc); 8980b57cec5SDimitry Andric } 8990b57cec5SDimitry Andric 9000b57cec5SDimitry Andric OMPFlushDirective *OMPFlushDirective::CreateEmpty(const ASTContext &C, 9010b57cec5SDimitry Andric unsigned NumClauses, 9020b57cec5SDimitry Andric EmptyShell) { 903e8d8bef9SDimitry Andric return createEmptyDirective<OMPFlushDirective>(C, NumClauses); 9040b57cec5SDimitry Andric } 9050b57cec5SDimitry Andric 9065ffd83dbSDimitry Andric OMPDepobjDirective *OMPDepobjDirective::Create(const ASTContext &C, 9075ffd83dbSDimitry Andric SourceLocation StartLoc, 9085ffd83dbSDimitry Andric SourceLocation EndLoc, 9095ffd83dbSDimitry Andric ArrayRef<OMPClause *> Clauses) { 910e8d8bef9SDimitry Andric return createDirective<OMPDepobjDirective>( 911e8d8bef9SDimitry Andric C, Clauses, /*AssociatedStmt=*/nullptr, 912e8d8bef9SDimitry Andric /*NumChildren=*/0, StartLoc, EndLoc); 9135ffd83dbSDimitry Andric } 9145ffd83dbSDimitry Andric 9155ffd83dbSDimitry Andric OMPDepobjDirective *OMPDepobjDirective::CreateEmpty(const ASTContext &C, 9165ffd83dbSDimitry Andric unsigned NumClauses, 9175ffd83dbSDimitry Andric EmptyShell) { 918e8d8bef9SDimitry Andric return createEmptyDirective<OMPDepobjDirective>(C, NumClauses); 9195ffd83dbSDimitry Andric } 9205ffd83dbSDimitry Andric 9215ffd83dbSDimitry Andric OMPScanDirective *OMPScanDirective::Create(const ASTContext &C, 9225ffd83dbSDimitry Andric SourceLocation StartLoc, 9235ffd83dbSDimitry Andric SourceLocation EndLoc, 9245ffd83dbSDimitry Andric ArrayRef<OMPClause *> Clauses) { 925e8d8bef9SDimitry Andric return createDirective<OMPScanDirective>(C, Clauses, 926e8d8bef9SDimitry Andric /*AssociatedStmt=*/nullptr, 927e8d8bef9SDimitry Andric /*NumChildren=*/0, StartLoc, EndLoc); 9285ffd83dbSDimitry Andric } 9295ffd83dbSDimitry Andric 9305ffd83dbSDimitry Andric OMPScanDirective *OMPScanDirective::CreateEmpty(const ASTContext &C, 9315ffd83dbSDimitry Andric unsigned NumClauses, 9325ffd83dbSDimitry Andric EmptyShell) { 933e8d8bef9SDimitry Andric return createEmptyDirective<OMPScanDirective>(C, NumClauses); 9345ffd83dbSDimitry Andric } 9355ffd83dbSDimitry Andric 9360b57cec5SDimitry Andric OMPOrderedDirective *OMPOrderedDirective::Create(const ASTContext &C, 9370b57cec5SDimitry Andric SourceLocation StartLoc, 9380b57cec5SDimitry Andric SourceLocation EndLoc, 9390b57cec5SDimitry Andric ArrayRef<OMPClause *> Clauses, 9400b57cec5SDimitry Andric Stmt *AssociatedStmt) { 941e8d8bef9SDimitry Andric return createDirective<OMPOrderedDirective>( 942e8d8bef9SDimitry Andric C, Clauses, cast_or_null<CapturedStmt>(AssociatedStmt), 943e8d8bef9SDimitry Andric /*NumChildren=*/0, StartLoc, EndLoc); 9440b57cec5SDimitry Andric } 9450b57cec5SDimitry Andric 9460b57cec5SDimitry Andric OMPOrderedDirective *OMPOrderedDirective::CreateEmpty(const ASTContext &C, 9470b57cec5SDimitry Andric unsigned NumClauses, 948e8d8bef9SDimitry Andric bool IsStandalone, 9490b57cec5SDimitry Andric EmptyShell) { 950e8d8bef9SDimitry Andric return createEmptyDirective<OMPOrderedDirective>(C, NumClauses, 951e8d8bef9SDimitry Andric !IsStandalone); 9520b57cec5SDimitry Andric } 9530b57cec5SDimitry Andric 95481ad6265SDimitry Andric OMPAtomicDirective * 95581ad6265SDimitry Andric OMPAtomicDirective::Create(const ASTContext &C, SourceLocation StartLoc, 95681ad6265SDimitry Andric SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses, 95781ad6265SDimitry Andric Stmt *AssociatedStmt, Expressions Exprs) { 958e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPAtomicDirective>( 95981ad6265SDimitry Andric C, Clauses, AssociatedStmt, /*NumChildren=*/7, StartLoc, EndLoc); 96081ad6265SDimitry Andric Dir->setX(Exprs.X); 96181ad6265SDimitry Andric Dir->setV(Exprs.V); 96281ad6265SDimitry Andric Dir->setR(Exprs.R); 96381ad6265SDimitry Andric Dir->setExpr(Exprs.E); 96481ad6265SDimitry Andric Dir->setUpdateExpr(Exprs.UE); 96581ad6265SDimitry Andric Dir->setD(Exprs.D); 96681ad6265SDimitry Andric Dir->setCond(Exprs.Cond); 96781ad6265SDimitry Andric Dir->Flags.IsXLHSInRHSPart = Exprs.IsXLHSInRHSPart ? 1 : 0; 96881ad6265SDimitry Andric Dir->Flags.IsPostfixUpdate = Exprs.IsPostfixUpdate ? 1 : 0; 96981ad6265SDimitry Andric Dir->Flags.IsFailOnly = Exprs.IsFailOnly ? 1 : 0; 9700b57cec5SDimitry Andric return Dir; 9710b57cec5SDimitry Andric } 9720b57cec5SDimitry Andric 9730b57cec5SDimitry Andric OMPAtomicDirective *OMPAtomicDirective::CreateEmpty(const ASTContext &C, 9740b57cec5SDimitry Andric unsigned NumClauses, 9750b57cec5SDimitry Andric EmptyShell) { 976e8d8bef9SDimitry Andric return createEmptyDirective<OMPAtomicDirective>( 97781ad6265SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/7); 9780b57cec5SDimitry Andric } 9790b57cec5SDimitry Andric 9800b57cec5SDimitry Andric OMPTargetDirective *OMPTargetDirective::Create(const ASTContext &C, 9810b57cec5SDimitry Andric SourceLocation StartLoc, 9820b57cec5SDimitry Andric SourceLocation EndLoc, 9830b57cec5SDimitry Andric ArrayRef<OMPClause *> Clauses, 9840b57cec5SDimitry Andric Stmt *AssociatedStmt) { 985e8d8bef9SDimitry Andric return createDirective<OMPTargetDirective>( 986e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc); 9870b57cec5SDimitry Andric } 9880b57cec5SDimitry Andric 9890b57cec5SDimitry Andric OMPTargetDirective *OMPTargetDirective::CreateEmpty(const ASTContext &C, 9900b57cec5SDimitry Andric unsigned NumClauses, 9910b57cec5SDimitry Andric EmptyShell) { 992e8d8bef9SDimitry Andric return createEmptyDirective<OMPTargetDirective>(C, NumClauses, 993e8d8bef9SDimitry Andric /*HasAssociatedStmt=*/true); 9940b57cec5SDimitry Andric } 9950b57cec5SDimitry Andric 9960b57cec5SDimitry Andric OMPTargetParallelDirective *OMPTargetParallelDirective::Create( 9970b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 9985ffd83dbSDimitry Andric ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, 9995ffd83dbSDimitry Andric bool HasCancel) { 1000e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPTargetParallelDirective>( 1001e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc); 10025ffd83dbSDimitry Andric Dir->setTaskReductionRefExpr(TaskRedRef); 10035ffd83dbSDimitry Andric Dir->setHasCancel(HasCancel); 10040b57cec5SDimitry Andric return Dir; 10050b57cec5SDimitry Andric } 10060b57cec5SDimitry Andric 10070b57cec5SDimitry Andric OMPTargetParallelDirective * 10080b57cec5SDimitry Andric OMPTargetParallelDirective::CreateEmpty(const ASTContext &C, 10090b57cec5SDimitry Andric unsigned NumClauses, EmptyShell) { 1010e8d8bef9SDimitry Andric return createEmptyDirective<OMPTargetParallelDirective>( 1011e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1); 10120b57cec5SDimitry Andric } 10130b57cec5SDimitry Andric 10140b57cec5SDimitry Andric OMPTargetParallelForDirective *OMPTargetParallelForDirective::Create( 10150b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 10160b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 10175ffd83dbSDimitry Andric const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) { 1018e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPTargetParallelForDirective>( 1019e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 1020e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1, StartLoc, 1021e8d8bef9SDimitry Andric EndLoc, CollapsedNum); 10220b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 10230b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 10240b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 10250b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 10260b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 10270b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 10280b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 10290b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 10300b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 10310b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 10320b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 10330b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 10340b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 10350b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 10360b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 10370b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 10380b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 10390b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 10400b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 10410b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 1042a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 1043a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 1044a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 10450b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 10465ffd83dbSDimitry Andric Dir->setTaskReductionRefExpr(TaskRedRef); 10470b57cec5SDimitry Andric Dir->setHasCancel(HasCancel); 10480b57cec5SDimitry Andric return Dir; 10490b57cec5SDimitry Andric } 10500b57cec5SDimitry Andric 10510b57cec5SDimitry Andric OMPTargetParallelForDirective * 10520b57cec5SDimitry Andric OMPTargetParallelForDirective::CreateEmpty(const ASTContext &C, 10530b57cec5SDimitry Andric unsigned NumClauses, 10540b57cec5SDimitry Andric unsigned CollapsedNum, EmptyShell) { 1055e8d8bef9SDimitry Andric return createEmptyDirective<OMPTargetParallelForDirective>( 1056e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 1057e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1, 1058e8d8bef9SDimitry Andric CollapsedNum); 10590b57cec5SDimitry Andric } 10600b57cec5SDimitry Andric 10610b57cec5SDimitry Andric OMPTargetDataDirective *OMPTargetDataDirective::Create( 10620b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 10630b57cec5SDimitry Andric ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { 1064e8d8bef9SDimitry Andric return createDirective<OMPTargetDataDirective>( 1065e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc); 10660b57cec5SDimitry Andric } 10670b57cec5SDimitry Andric 10680b57cec5SDimitry Andric OMPTargetDataDirective *OMPTargetDataDirective::CreateEmpty(const ASTContext &C, 10690b57cec5SDimitry Andric unsigned N, 10700b57cec5SDimitry Andric EmptyShell) { 1071e8d8bef9SDimitry Andric return createEmptyDirective<OMPTargetDataDirective>( 1072e8d8bef9SDimitry Andric C, N, /*HasAssociatedStmt=*/true); 10730b57cec5SDimitry Andric } 10740b57cec5SDimitry Andric 10750b57cec5SDimitry Andric OMPTargetEnterDataDirective *OMPTargetEnterDataDirective::Create( 10760b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 10770b57cec5SDimitry Andric ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { 1078e8d8bef9SDimitry Andric return createDirective<OMPTargetEnterDataDirective>( 1079e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc); 10800b57cec5SDimitry Andric } 10810b57cec5SDimitry Andric 10820b57cec5SDimitry Andric OMPTargetEnterDataDirective * 10830b57cec5SDimitry Andric OMPTargetEnterDataDirective::CreateEmpty(const ASTContext &C, unsigned N, 10840b57cec5SDimitry Andric EmptyShell) { 1085e8d8bef9SDimitry Andric return createEmptyDirective<OMPTargetEnterDataDirective>( 1086e8d8bef9SDimitry Andric C, N, /*HasAssociatedStmt=*/true); 10870b57cec5SDimitry Andric } 10880b57cec5SDimitry Andric 10890b57cec5SDimitry Andric OMPTargetExitDataDirective *OMPTargetExitDataDirective::Create( 10900b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 10910b57cec5SDimitry Andric ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { 1092e8d8bef9SDimitry Andric return createDirective<OMPTargetExitDataDirective>( 1093e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc); 10940b57cec5SDimitry Andric } 10950b57cec5SDimitry Andric 10960b57cec5SDimitry Andric OMPTargetExitDataDirective * 10970b57cec5SDimitry Andric OMPTargetExitDataDirective::CreateEmpty(const ASTContext &C, unsigned N, 10980b57cec5SDimitry Andric EmptyShell) { 1099e8d8bef9SDimitry Andric return createEmptyDirective<OMPTargetExitDataDirective>( 1100e8d8bef9SDimitry Andric C, N, /*HasAssociatedStmt=*/true); 11010b57cec5SDimitry Andric } 11020b57cec5SDimitry Andric 11030b57cec5SDimitry Andric OMPTeamsDirective *OMPTeamsDirective::Create(const ASTContext &C, 11040b57cec5SDimitry Andric SourceLocation StartLoc, 11050b57cec5SDimitry Andric SourceLocation EndLoc, 11060b57cec5SDimitry Andric ArrayRef<OMPClause *> Clauses, 11070b57cec5SDimitry Andric Stmt *AssociatedStmt) { 1108e8d8bef9SDimitry Andric return createDirective<OMPTeamsDirective>( 1109e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc); 11100b57cec5SDimitry Andric } 11110b57cec5SDimitry Andric 11120b57cec5SDimitry Andric OMPTeamsDirective *OMPTeamsDirective::CreateEmpty(const ASTContext &C, 11130b57cec5SDimitry Andric unsigned NumClauses, 11140b57cec5SDimitry Andric EmptyShell) { 1115e8d8bef9SDimitry Andric return createEmptyDirective<OMPTeamsDirective>(C, NumClauses, 1116e8d8bef9SDimitry Andric /*HasAssociatedStmt=*/true); 11170b57cec5SDimitry Andric } 11180b57cec5SDimitry Andric 11190b57cec5SDimitry Andric OMPTaskLoopDirective *OMPTaskLoopDirective::Create( 11200b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 11210b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 11225ffd83dbSDimitry Andric const HelperExprs &Exprs, bool HasCancel) { 1123e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPTaskLoopDirective>( 1124e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_taskloop), 1125e8d8bef9SDimitry Andric StartLoc, EndLoc, CollapsedNum); 11260b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 11270b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 11280b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 11290b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 11300b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 11310b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 11320b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 11330b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 11340b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 11350b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 11360b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 11370b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 11380b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 11390b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 11400b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 11410b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 11420b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 11430b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 11440b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 11450b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 1146a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 1147a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 1148a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 11490b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 11505ffd83dbSDimitry Andric Dir->setHasCancel(HasCancel); 11510b57cec5SDimitry Andric return Dir; 11520b57cec5SDimitry Andric } 11530b57cec5SDimitry Andric 11540b57cec5SDimitry Andric OMPTaskLoopDirective *OMPTaskLoopDirective::CreateEmpty(const ASTContext &C, 11550b57cec5SDimitry Andric unsigned NumClauses, 11560b57cec5SDimitry Andric unsigned CollapsedNum, 11570b57cec5SDimitry Andric EmptyShell) { 1158e8d8bef9SDimitry Andric return createEmptyDirective<OMPTaskLoopDirective>( 1159e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 1160e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_taskloop), CollapsedNum); 11610b57cec5SDimitry Andric } 11620b57cec5SDimitry Andric 11630b57cec5SDimitry Andric OMPTaskLoopSimdDirective *OMPTaskLoopSimdDirective::Create( 11640b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 11650b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 11660b57cec5SDimitry Andric const HelperExprs &Exprs) { 1167e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPTaskLoopSimdDirective>( 1168e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 1169e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_taskloop_simd), StartLoc, EndLoc, 1170e8d8bef9SDimitry Andric CollapsedNum); 11710b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 11720b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 11730b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 11740b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 11750b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 11760b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 11770b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 11780b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 11790b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 11800b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 11810b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 11820b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 11830b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 11840b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 11850b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 11860b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 11870b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 11880b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 11890b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 11900b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 1191a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 1192a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 1193a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 11940b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 11950b57cec5SDimitry Andric return Dir; 11960b57cec5SDimitry Andric } 11970b57cec5SDimitry Andric 11980b57cec5SDimitry Andric OMPTaskLoopSimdDirective * 11990b57cec5SDimitry Andric OMPTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, 12000b57cec5SDimitry Andric unsigned CollapsedNum, EmptyShell) { 1201e8d8bef9SDimitry Andric return createEmptyDirective<OMPTaskLoopSimdDirective>( 1202e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 1203e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_taskloop_simd), CollapsedNum); 12040b57cec5SDimitry Andric } 12050b57cec5SDimitry Andric 1206a7dea167SDimitry Andric OMPMasterTaskLoopDirective *OMPMasterTaskLoopDirective::Create( 1207a7dea167SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1208a7dea167SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 12095ffd83dbSDimitry Andric const HelperExprs &Exprs, bool HasCancel) { 1210e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPMasterTaskLoopDirective>( 1211e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 1212e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_master_taskloop), StartLoc, EndLoc, 1213e8d8bef9SDimitry Andric CollapsedNum); 1214a7dea167SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 1215a7dea167SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 1216a7dea167SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1217a7dea167SDimitry Andric Dir->setPreCond(Exprs.PreCond); 1218a7dea167SDimitry Andric Dir->setCond(Exprs.Cond); 1219a7dea167SDimitry Andric Dir->setInit(Exprs.Init); 1220a7dea167SDimitry Andric Dir->setInc(Exprs.Inc); 1221a7dea167SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 1222a7dea167SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 1223a7dea167SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 1224a7dea167SDimitry Andric Dir->setStrideVariable(Exprs.ST); 1225a7dea167SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 1226a7dea167SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 1227a7dea167SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 1228a7dea167SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 1229a7dea167SDimitry Andric Dir->setCounters(Exprs.Counters); 1230a7dea167SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 1231a7dea167SDimitry Andric Dir->setInits(Exprs.Inits); 1232a7dea167SDimitry Andric Dir->setUpdates(Exprs.Updates); 1233a7dea167SDimitry Andric Dir->setFinals(Exprs.Finals); 1234a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 1235a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 1236a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 1237a7dea167SDimitry Andric Dir->setPreInits(Exprs.PreInits); 12385ffd83dbSDimitry Andric Dir->setHasCancel(HasCancel); 1239a7dea167SDimitry Andric return Dir; 1240a7dea167SDimitry Andric } 1241a7dea167SDimitry Andric 1242a7dea167SDimitry Andric OMPMasterTaskLoopDirective * 1243a7dea167SDimitry Andric OMPMasterTaskLoopDirective::CreateEmpty(const ASTContext &C, 1244a7dea167SDimitry Andric unsigned NumClauses, 1245a7dea167SDimitry Andric unsigned CollapsedNum, EmptyShell) { 1246e8d8bef9SDimitry Andric return createEmptyDirective<OMPMasterTaskLoopDirective>( 1247e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 1248e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_master_taskloop), CollapsedNum); 1249a7dea167SDimitry Andric } 1250a7dea167SDimitry Andric 125181ad6265SDimitry Andric OMPMaskedTaskLoopDirective *OMPMaskedTaskLoopDirective::Create( 125281ad6265SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 125381ad6265SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 125481ad6265SDimitry Andric const HelperExprs &Exprs, bool HasCancel) { 125581ad6265SDimitry Andric auto *Dir = createDirective<OMPMaskedTaskLoopDirective>( 125681ad6265SDimitry Andric C, Clauses, AssociatedStmt, 125781ad6265SDimitry Andric numLoopChildren(CollapsedNum, OMPD_masked_taskloop), StartLoc, EndLoc, 125881ad6265SDimitry Andric CollapsedNum); 125981ad6265SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 126081ad6265SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 126181ad6265SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 126281ad6265SDimitry Andric Dir->setPreCond(Exprs.PreCond); 126381ad6265SDimitry Andric Dir->setCond(Exprs.Cond); 126481ad6265SDimitry Andric Dir->setInit(Exprs.Init); 126581ad6265SDimitry Andric Dir->setInc(Exprs.Inc); 126681ad6265SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 126781ad6265SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 126881ad6265SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 126981ad6265SDimitry Andric Dir->setStrideVariable(Exprs.ST); 127081ad6265SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 127181ad6265SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 127281ad6265SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 127381ad6265SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 127481ad6265SDimitry Andric Dir->setCounters(Exprs.Counters); 127581ad6265SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 127681ad6265SDimitry Andric Dir->setInits(Exprs.Inits); 127781ad6265SDimitry Andric Dir->setUpdates(Exprs.Updates); 127881ad6265SDimitry Andric Dir->setFinals(Exprs.Finals); 127981ad6265SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 128081ad6265SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 128181ad6265SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 128281ad6265SDimitry Andric Dir->setPreInits(Exprs.PreInits); 128381ad6265SDimitry Andric Dir->setHasCancel(HasCancel); 128481ad6265SDimitry Andric return Dir; 128581ad6265SDimitry Andric } 128681ad6265SDimitry Andric 128781ad6265SDimitry Andric OMPMaskedTaskLoopDirective * 128881ad6265SDimitry Andric OMPMaskedTaskLoopDirective::CreateEmpty(const ASTContext &C, 128981ad6265SDimitry Andric unsigned NumClauses, 129081ad6265SDimitry Andric unsigned CollapsedNum, EmptyShell) { 129181ad6265SDimitry Andric return createEmptyDirective<OMPMaskedTaskLoopDirective>( 129281ad6265SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 129381ad6265SDimitry Andric numLoopChildren(CollapsedNum, OMPD_masked_taskloop), CollapsedNum); 129481ad6265SDimitry Andric } 129581ad6265SDimitry Andric 1296a7dea167SDimitry Andric OMPMasterTaskLoopSimdDirective *OMPMasterTaskLoopSimdDirective::Create( 1297a7dea167SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1298a7dea167SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1299a7dea167SDimitry Andric const HelperExprs &Exprs) { 1300e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPMasterTaskLoopSimdDirective>( 1301e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 1302e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), StartLoc, 1303e8d8bef9SDimitry Andric EndLoc, CollapsedNum); 1304a7dea167SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 1305a7dea167SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 1306a7dea167SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1307a7dea167SDimitry Andric Dir->setPreCond(Exprs.PreCond); 1308a7dea167SDimitry Andric Dir->setCond(Exprs.Cond); 1309a7dea167SDimitry Andric Dir->setInit(Exprs.Init); 1310a7dea167SDimitry Andric Dir->setInc(Exprs.Inc); 1311a7dea167SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 1312a7dea167SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 1313a7dea167SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 1314a7dea167SDimitry Andric Dir->setStrideVariable(Exprs.ST); 1315a7dea167SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 1316a7dea167SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 1317a7dea167SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 1318a7dea167SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 1319a7dea167SDimitry Andric Dir->setCounters(Exprs.Counters); 1320a7dea167SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 1321a7dea167SDimitry Andric Dir->setInits(Exprs.Inits); 1322a7dea167SDimitry Andric Dir->setUpdates(Exprs.Updates); 1323a7dea167SDimitry Andric Dir->setFinals(Exprs.Finals); 1324a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 1325a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 1326a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 1327a7dea167SDimitry Andric Dir->setPreInits(Exprs.PreInits); 1328a7dea167SDimitry Andric return Dir; 1329a7dea167SDimitry Andric } 1330a7dea167SDimitry Andric 1331a7dea167SDimitry Andric OMPMasterTaskLoopSimdDirective * 1332a7dea167SDimitry Andric OMPMasterTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, 1333a7dea167SDimitry Andric unsigned NumClauses, 1334a7dea167SDimitry Andric unsigned CollapsedNum, EmptyShell) { 1335e8d8bef9SDimitry Andric return createEmptyDirective<OMPMasterTaskLoopSimdDirective>( 1336e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 1337e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), CollapsedNum); 1338a7dea167SDimitry Andric } 1339a7dea167SDimitry Andric 134081ad6265SDimitry Andric OMPMaskedTaskLoopSimdDirective *OMPMaskedTaskLoopSimdDirective::Create( 134181ad6265SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 134281ad6265SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 134381ad6265SDimitry Andric const HelperExprs &Exprs) { 134481ad6265SDimitry Andric auto *Dir = createDirective<OMPMaskedTaskLoopSimdDirective>( 134581ad6265SDimitry Andric C, Clauses, AssociatedStmt, 134681ad6265SDimitry Andric numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), StartLoc, 134781ad6265SDimitry Andric EndLoc, CollapsedNum); 134881ad6265SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 134981ad6265SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 135081ad6265SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 135181ad6265SDimitry Andric Dir->setPreCond(Exprs.PreCond); 135281ad6265SDimitry Andric Dir->setCond(Exprs.Cond); 135381ad6265SDimitry Andric Dir->setInit(Exprs.Init); 135481ad6265SDimitry Andric Dir->setInc(Exprs.Inc); 135581ad6265SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 135681ad6265SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 135781ad6265SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 135881ad6265SDimitry Andric Dir->setStrideVariable(Exprs.ST); 135981ad6265SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 136081ad6265SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 136181ad6265SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 136281ad6265SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 136381ad6265SDimitry Andric Dir->setCounters(Exprs.Counters); 136481ad6265SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 136581ad6265SDimitry Andric Dir->setInits(Exprs.Inits); 136681ad6265SDimitry Andric Dir->setUpdates(Exprs.Updates); 136781ad6265SDimitry Andric Dir->setFinals(Exprs.Finals); 136881ad6265SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 136981ad6265SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 137081ad6265SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 137181ad6265SDimitry Andric Dir->setPreInits(Exprs.PreInits); 137281ad6265SDimitry Andric return Dir; 137381ad6265SDimitry Andric } 137481ad6265SDimitry Andric 137581ad6265SDimitry Andric OMPMaskedTaskLoopSimdDirective * 137681ad6265SDimitry Andric OMPMaskedTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, 137781ad6265SDimitry Andric unsigned NumClauses, 137881ad6265SDimitry Andric unsigned CollapsedNum, EmptyShell) { 137981ad6265SDimitry Andric return createEmptyDirective<OMPMaskedTaskLoopSimdDirective>( 138081ad6265SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 138181ad6265SDimitry Andric numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), CollapsedNum); 138281ad6265SDimitry Andric } 138381ad6265SDimitry Andric 1384a7dea167SDimitry Andric OMPParallelMasterTaskLoopDirective *OMPParallelMasterTaskLoopDirective::Create( 1385a7dea167SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1386a7dea167SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 13875ffd83dbSDimitry Andric const HelperExprs &Exprs, bool HasCancel) { 1388e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPParallelMasterTaskLoopDirective>( 1389e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 1390e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop), StartLoc, 1391e8d8bef9SDimitry Andric EndLoc, CollapsedNum); 1392a7dea167SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 1393a7dea167SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 1394a7dea167SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1395a7dea167SDimitry Andric Dir->setPreCond(Exprs.PreCond); 1396a7dea167SDimitry Andric Dir->setCond(Exprs.Cond); 1397a7dea167SDimitry Andric Dir->setInit(Exprs.Init); 1398a7dea167SDimitry Andric Dir->setInc(Exprs.Inc); 1399a7dea167SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 1400a7dea167SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 1401a7dea167SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 1402a7dea167SDimitry Andric Dir->setStrideVariable(Exprs.ST); 1403a7dea167SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 1404a7dea167SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 1405a7dea167SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 1406a7dea167SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 1407a7dea167SDimitry Andric Dir->setCounters(Exprs.Counters); 1408a7dea167SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 1409a7dea167SDimitry Andric Dir->setInits(Exprs.Inits); 1410a7dea167SDimitry Andric Dir->setUpdates(Exprs.Updates); 1411a7dea167SDimitry Andric Dir->setFinals(Exprs.Finals); 1412a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 1413a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 1414a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 1415a7dea167SDimitry Andric Dir->setPreInits(Exprs.PreInits); 14165ffd83dbSDimitry Andric Dir->setHasCancel(HasCancel); 1417a7dea167SDimitry Andric return Dir; 1418a7dea167SDimitry Andric } 1419a7dea167SDimitry Andric 1420a7dea167SDimitry Andric OMPParallelMasterTaskLoopDirective * 1421a7dea167SDimitry Andric OMPParallelMasterTaskLoopDirective::CreateEmpty(const ASTContext &C, 1422a7dea167SDimitry Andric unsigned NumClauses, 1423a7dea167SDimitry Andric unsigned CollapsedNum, 1424a7dea167SDimitry Andric EmptyShell) { 1425e8d8bef9SDimitry Andric return createEmptyDirective<OMPParallelMasterTaskLoopDirective>( 1426e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 1427e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop), 1428e8d8bef9SDimitry Andric CollapsedNum); 1429a7dea167SDimitry Andric } 1430a7dea167SDimitry Andric 143181ad6265SDimitry Andric OMPParallelMaskedTaskLoopDirective *OMPParallelMaskedTaskLoopDirective::Create( 143281ad6265SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 143381ad6265SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 143481ad6265SDimitry Andric const HelperExprs &Exprs, bool HasCancel) { 143581ad6265SDimitry Andric auto *Dir = createDirective<OMPParallelMaskedTaskLoopDirective>( 143681ad6265SDimitry Andric C, Clauses, AssociatedStmt, 143781ad6265SDimitry Andric numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop), StartLoc, 143881ad6265SDimitry Andric EndLoc, CollapsedNum); 143981ad6265SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 144081ad6265SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 144181ad6265SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 144281ad6265SDimitry Andric Dir->setPreCond(Exprs.PreCond); 144381ad6265SDimitry Andric Dir->setCond(Exprs.Cond); 144481ad6265SDimitry Andric Dir->setInit(Exprs.Init); 144581ad6265SDimitry Andric Dir->setInc(Exprs.Inc); 144681ad6265SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 144781ad6265SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 144881ad6265SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 144981ad6265SDimitry Andric Dir->setStrideVariable(Exprs.ST); 145081ad6265SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 145181ad6265SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 145281ad6265SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 145381ad6265SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 145481ad6265SDimitry Andric Dir->setCounters(Exprs.Counters); 145581ad6265SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 145681ad6265SDimitry Andric Dir->setInits(Exprs.Inits); 145781ad6265SDimitry Andric Dir->setUpdates(Exprs.Updates); 145881ad6265SDimitry Andric Dir->setFinals(Exprs.Finals); 145981ad6265SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 146081ad6265SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 146181ad6265SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 146281ad6265SDimitry Andric Dir->setPreInits(Exprs.PreInits); 146381ad6265SDimitry Andric Dir->setHasCancel(HasCancel); 146481ad6265SDimitry Andric return Dir; 146581ad6265SDimitry Andric } 146681ad6265SDimitry Andric 146781ad6265SDimitry Andric OMPParallelMaskedTaskLoopDirective * 146881ad6265SDimitry Andric OMPParallelMaskedTaskLoopDirective::CreateEmpty(const ASTContext &C, 146981ad6265SDimitry Andric unsigned NumClauses, 147081ad6265SDimitry Andric unsigned CollapsedNum, 147181ad6265SDimitry Andric EmptyShell) { 147281ad6265SDimitry Andric return createEmptyDirective<OMPParallelMaskedTaskLoopDirective>( 147381ad6265SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 147481ad6265SDimitry Andric numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop), 147581ad6265SDimitry Andric CollapsedNum); 147681ad6265SDimitry Andric } 147781ad6265SDimitry Andric 1478480093f4SDimitry Andric OMPParallelMasterTaskLoopSimdDirective * 1479480093f4SDimitry Andric OMPParallelMasterTaskLoopSimdDirective::Create( 1480480093f4SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1481480093f4SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1482480093f4SDimitry Andric const HelperExprs &Exprs) { 1483e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPParallelMasterTaskLoopSimdDirective>( 1484e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 1485e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd), 1486e8d8bef9SDimitry Andric StartLoc, EndLoc, CollapsedNum); 1487480093f4SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 1488480093f4SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 1489480093f4SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1490480093f4SDimitry Andric Dir->setPreCond(Exprs.PreCond); 1491480093f4SDimitry Andric Dir->setCond(Exprs.Cond); 1492480093f4SDimitry Andric Dir->setInit(Exprs.Init); 1493480093f4SDimitry Andric Dir->setInc(Exprs.Inc); 1494480093f4SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 1495480093f4SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 1496480093f4SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 1497480093f4SDimitry Andric Dir->setStrideVariable(Exprs.ST); 1498480093f4SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 1499480093f4SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 1500480093f4SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 1501480093f4SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 1502480093f4SDimitry Andric Dir->setCounters(Exprs.Counters); 1503480093f4SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 1504480093f4SDimitry Andric Dir->setInits(Exprs.Inits); 1505480093f4SDimitry Andric Dir->setUpdates(Exprs.Updates); 1506480093f4SDimitry Andric Dir->setFinals(Exprs.Finals); 1507480093f4SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 1508480093f4SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 1509480093f4SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 1510480093f4SDimitry Andric Dir->setPreInits(Exprs.PreInits); 1511480093f4SDimitry Andric return Dir; 1512480093f4SDimitry Andric } 1513480093f4SDimitry Andric 1514480093f4SDimitry Andric OMPParallelMasterTaskLoopSimdDirective * 1515480093f4SDimitry Andric OMPParallelMasterTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, 1516480093f4SDimitry Andric unsigned NumClauses, 1517480093f4SDimitry Andric unsigned CollapsedNum, 1518480093f4SDimitry Andric EmptyShell) { 1519e8d8bef9SDimitry Andric return createEmptyDirective<OMPParallelMasterTaskLoopSimdDirective>( 1520e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 1521e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd), 1522e8d8bef9SDimitry Andric CollapsedNum); 1523480093f4SDimitry Andric } 1524480093f4SDimitry Andric 152581ad6265SDimitry Andric OMPParallelMaskedTaskLoopSimdDirective * 152681ad6265SDimitry Andric OMPParallelMaskedTaskLoopSimdDirective::Create( 152781ad6265SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 152881ad6265SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 152981ad6265SDimitry Andric const HelperExprs &Exprs) { 153081ad6265SDimitry Andric auto *Dir = createDirective<OMPParallelMaskedTaskLoopSimdDirective>( 153181ad6265SDimitry Andric C, Clauses, AssociatedStmt, 153281ad6265SDimitry Andric numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd), 153381ad6265SDimitry Andric StartLoc, EndLoc, CollapsedNum); 153481ad6265SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 153581ad6265SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 153681ad6265SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 153781ad6265SDimitry Andric Dir->setPreCond(Exprs.PreCond); 153881ad6265SDimitry Andric Dir->setCond(Exprs.Cond); 153981ad6265SDimitry Andric Dir->setInit(Exprs.Init); 154081ad6265SDimitry Andric Dir->setInc(Exprs.Inc); 154181ad6265SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 154281ad6265SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 154381ad6265SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 154481ad6265SDimitry Andric Dir->setStrideVariable(Exprs.ST); 154581ad6265SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 154681ad6265SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 154781ad6265SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 154881ad6265SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 154981ad6265SDimitry Andric Dir->setCounters(Exprs.Counters); 155081ad6265SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 155181ad6265SDimitry Andric Dir->setInits(Exprs.Inits); 155281ad6265SDimitry Andric Dir->setUpdates(Exprs.Updates); 155381ad6265SDimitry Andric Dir->setFinals(Exprs.Finals); 155481ad6265SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 155581ad6265SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 155681ad6265SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 155781ad6265SDimitry Andric Dir->setPreInits(Exprs.PreInits); 155881ad6265SDimitry Andric return Dir; 155981ad6265SDimitry Andric } 156081ad6265SDimitry Andric 156181ad6265SDimitry Andric OMPParallelMaskedTaskLoopSimdDirective * 156281ad6265SDimitry Andric OMPParallelMaskedTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, 156381ad6265SDimitry Andric unsigned NumClauses, 156481ad6265SDimitry Andric unsigned CollapsedNum, 156581ad6265SDimitry Andric EmptyShell) { 156681ad6265SDimitry Andric return createEmptyDirective<OMPParallelMaskedTaskLoopSimdDirective>( 156781ad6265SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 156881ad6265SDimitry Andric numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd), 156981ad6265SDimitry Andric CollapsedNum); 157081ad6265SDimitry Andric } 157181ad6265SDimitry Andric 15720b57cec5SDimitry Andric OMPDistributeDirective *OMPDistributeDirective::Create( 15730b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 15740b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 15755f757f3fSDimitry Andric const HelperExprs &Exprs, OpenMPDirectiveKind ParamPrevMappedDirective) { 1576e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPDistributeDirective>( 1577e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 1578e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_distribute), StartLoc, EndLoc, 1579e8d8bef9SDimitry Andric CollapsedNum); 15800b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 15810b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 15820b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 15830b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 15840b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 15850b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 15860b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 15870b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 15880b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 15890b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 15900b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 15910b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 15920b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 15930b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 15940b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 15950b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 15960b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 15970b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 15980b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 15990b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 1600a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 1601a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 1602a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 16030b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 16045f757f3fSDimitry Andric Dir->setMappedDirective(ParamPrevMappedDirective); 16050b57cec5SDimitry Andric return Dir; 16060b57cec5SDimitry Andric } 16070b57cec5SDimitry Andric 16080b57cec5SDimitry Andric OMPDistributeDirective * 16090b57cec5SDimitry Andric OMPDistributeDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, 16100b57cec5SDimitry Andric unsigned CollapsedNum, EmptyShell) { 1611e8d8bef9SDimitry Andric return createEmptyDirective<OMPDistributeDirective>( 1612e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 1613e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_distribute), CollapsedNum); 16140b57cec5SDimitry Andric } 16150b57cec5SDimitry Andric 16160b57cec5SDimitry Andric OMPTargetUpdateDirective *OMPTargetUpdateDirective::Create( 16170b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 16180b57cec5SDimitry Andric ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { 1619e8d8bef9SDimitry Andric return createDirective<OMPTargetUpdateDirective>(C, Clauses, AssociatedStmt, 1620e8d8bef9SDimitry Andric /*NumChildren=*/0, StartLoc, 1621e8d8bef9SDimitry Andric EndLoc); 16220b57cec5SDimitry Andric } 16230b57cec5SDimitry Andric 16240b57cec5SDimitry Andric OMPTargetUpdateDirective * 16250b57cec5SDimitry Andric OMPTargetUpdateDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, 16260b57cec5SDimitry Andric EmptyShell) { 1627e8d8bef9SDimitry Andric return createEmptyDirective<OMPTargetUpdateDirective>( 1628e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true); 16290b57cec5SDimitry Andric } 16300b57cec5SDimitry Andric 16310b57cec5SDimitry Andric OMPDistributeParallelForDirective *OMPDistributeParallelForDirective::Create( 16320b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 16330b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 16345ffd83dbSDimitry Andric const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) { 1635e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPDistributeParallelForDirective>( 1636e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 1637e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1, StartLoc, 1638e8d8bef9SDimitry Andric EndLoc, CollapsedNum); 16390b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 16400b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 16410b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 16420b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 16430b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 16440b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 16450b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 16460b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 16470b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 16480b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 16490b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 16500b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 16510b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 16520b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 16530b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 16540b57cec5SDimitry Andric Dir->setPrevLowerBoundVariable(Exprs.PrevLB); 16550b57cec5SDimitry Andric Dir->setPrevUpperBoundVariable(Exprs.PrevUB); 16560b57cec5SDimitry Andric Dir->setDistInc(Exprs.DistInc); 16570b57cec5SDimitry Andric Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); 16580b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 16590b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 16600b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 16610b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 16620b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 1663a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 1664a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 1665a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 16660b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 16670b57cec5SDimitry Andric Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); 16680b57cec5SDimitry Andric Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); 16690b57cec5SDimitry Andric Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); 16700b57cec5SDimitry Andric Dir->setCombinedInit(Exprs.DistCombinedFields.Init); 16710b57cec5SDimitry Andric Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); 16720b57cec5SDimitry Andric Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); 16730b57cec5SDimitry Andric Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); 16740b57cec5SDimitry Andric Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); 16750b57cec5SDimitry Andric Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); 16765ffd83dbSDimitry Andric Dir->setTaskReductionRefExpr(TaskRedRef); 16770b57cec5SDimitry Andric Dir->HasCancel = HasCancel; 16780b57cec5SDimitry Andric return Dir; 16790b57cec5SDimitry Andric } 16800b57cec5SDimitry Andric 16810b57cec5SDimitry Andric OMPDistributeParallelForDirective * 16820b57cec5SDimitry Andric OMPDistributeParallelForDirective::CreateEmpty(const ASTContext &C, 16830b57cec5SDimitry Andric unsigned NumClauses, 16840b57cec5SDimitry Andric unsigned CollapsedNum, 16850b57cec5SDimitry Andric EmptyShell) { 1686e8d8bef9SDimitry Andric return createEmptyDirective<OMPDistributeParallelForDirective>( 1687e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 1688e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1, 1689e8d8bef9SDimitry Andric CollapsedNum); 16900b57cec5SDimitry Andric } 16910b57cec5SDimitry Andric 16920b57cec5SDimitry Andric OMPDistributeParallelForSimdDirective * 16930b57cec5SDimitry Andric OMPDistributeParallelForSimdDirective::Create( 16940b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 16950b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 16960b57cec5SDimitry Andric const HelperExprs &Exprs) { 1697e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPDistributeParallelForSimdDirective>( 1698e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 1699e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd), 1700e8d8bef9SDimitry Andric StartLoc, EndLoc, CollapsedNum); 17010b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 17020b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 17030b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 17040b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 17050b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 17060b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 17070b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 17080b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 17090b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 17100b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 17110b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 17120b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 17130b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 17140b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 17150b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 17160b57cec5SDimitry Andric Dir->setPrevLowerBoundVariable(Exprs.PrevLB); 17170b57cec5SDimitry Andric Dir->setPrevUpperBoundVariable(Exprs.PrevUB); 17180b57cec5SDimitry Andric Dir->setDistInc(Exprs.DistInc); 17190b57cec5SDimitry Andric Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); 17200b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 17210b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 17220b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 17230b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 17240b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 1725a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 1726a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 1727a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 17280b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 17290b57cec5SDimitry Andric Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); 17300b57cec5SDimitry Andric Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); 17310b57cec5SDimitry Andric Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); 17320b57cec5SDimitry Andric Dir->setCombinedInit(Exprs.DistCombinedFields.Init); 17330b57cec5SDimitry Andric Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); 17340b57cec5SDimitry Andric Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); 17350b57cec5SDimitry Andric Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); 17360b57cec5SDimitry Andric Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); 17370b57cec5SDimitry Andric Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); 17380b57cec5SDimitry Andric return Dir; 17390b57cec5SDimitry Andric } 17400b57cec5SDimitry Andric 17410b57cec5SDimitry Andric OMPDistributeParallelForSimdDirective * 17420b57cec5SDimitry Andric OMPDistributeParallelForSimdDirective::CreateEmpty(const ASTContext &C, 17430b57cec5SDimitry Andric unsigned NumClauses, 17440b57cec5SDimitry Andric unsigned CollapsedNum, 17450b57cec5SDimitry Andric EmptyShell) { 1746e8d8bef9SDimitry Andric return createEmptyDirective<OMPDistributeParallelForSimdDirective>( 1747e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 1748e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd), 1749e8d8bef9SDimitry Andric CollapsedNum); 17500b57cec5SDimitry Andric } 17510b57cec5SDimitry Andric 17520b57cec5SDimitry Andric OMPDistributeSimdDirective *OMPDistributeSimdDirective::Create( 17530b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 17540b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 17550b57cec5SDimitry Andric const HelperExprs &Exprs) { 1756e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPDistributeSimdDirective>( 1757e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 1758e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_distribute_simd), StartLoc, EndLoc, 1759e8d8bef9SDimitry Andric CollapsedNum); 17600b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 17610b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 17620b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 17630b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 17640b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 17650b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 17660b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 17670b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 17680b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 17690b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 17700b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 17710b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 17720b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 17730b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 17740b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 17750b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 17760b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 17770b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 17780b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 17790b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 1780a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 1781a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 1782a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 17830b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 17840b57cec5SDimitry Andric return Dir; 17850b57cec5SDimitry Andric } 17860b57cec5SDimitry Andric 17870b57cec5SDimitry Andric OMPDistributeSimdDirective * 17880b57cec5SDimitry Andric OMPDistributeSimdDirective::CreateEmpty(const ASTContext &C, 17890b57cec5SDimitry Andric unsigned NumClauses, 17900b57cec5SDimitry Andric unsigned CollapsedNum, EmptyShell) { 1791e8d8bef9SDimitry Andric return createEmptyDirective<OMPDistributeSimdDirective>( 1792e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 1793e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_distribute_simd), CollapsedNum); 17940b57cec5SDimitry Andric } 17950b57cec5SDimitry Andric 17960b57cec5SDimitry Andric OMPTargetParallelForSimdDirective *OMPTargetParallelForSimdDirective::Create( 17970b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 17980b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 17990b57cec5SDimitry Andric const HelperExprs &Exprs) { 1800e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPTargetParallelForSimdDirective>( 1801e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 1802e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd), StartLoc, 1803e8d8bef9SDimitry Andric EndLoc, CollapsedNum); 18040b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 18050b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 18060b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 18070b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 18080b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 18090b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 18100b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 18110b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 18120b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 18130b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 18140b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 18150b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 18160b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 18170b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 18180b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 18190b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 18200b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 18210b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 18220b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 18230b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 1824a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 1825a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 1826a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 18270b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 18280b57cec5SDimitry Andric return Dir; 18290b57cec5SDimitry Andric } 18300b57cec5SDimitry Andric 18310b57cec5SDimitry Andric OMPTargetParallelForSimdDirective * 18320b57cec5SDimitry Andric OMPTargetParallelForSimdDirective::CreateEmpty(const ASTContext &C, 18330b57cec5SDimitry Andric unsigned NumClauses, 18340b57cec5SDimitry Andric unsigned CollapsedNum, 18350b57cec5SDimitry Andric EmptyShell) { 1836e8d8bef9SDimitry Andric return createEmptyDirective<OMPTargetParallelForSimdDirective>( 1837e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 1838e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd), 1839e8d8bef9SDimitry Andric CollapsedNum); 18400b57cec5SDimitry Andric } 18410b57cec5SDimitry Andric 18420b57cec5SDimitry Andric OMPTargetSimdDirective * 18430b57cec5SDimitry Andric OMPTargetSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc, 18440b57cec5SDimitry Andric SourceLocation EndLoc, unsigned CollapsedNum, 18450b57cec5SDimitry Andric ArrayRef<OMPClause *> Clauses, 18460b57cec5SDimitry Andric Stmt *AssociatedStmt, const HelperExprs &Exprs) { 1847e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPTargetSimdDirective>( 1848e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 1849e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_target_simd), StartLoc, EndLoc, 1850e8d8bef9SDimitry Andric CollapsedNum); 18510b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 18520b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 18530b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 18540b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 18550b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 18560b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 18570b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 18580b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 18590b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 18600b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 18610b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 18620b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 1863a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 1864a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 1865a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 18660b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 18670b57cec5SDimitry Andric return Dir; 18680b57cec5SDimitry Andric } 18690b57cec5SDimitry Andric 18700b57cec5SDimitry Andric OMPTargetSimdDirective * 18710b57cec5SDimitry Andric OMPTargetSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, 18720b57cec5SDimitry Andric unsigned CollapsedNum, EmptyShell) { 1873e8d8bef9SDimitry Andric return createEmptyDirective<OMPTargetSimdDirective>( 1874e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 1875e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_target_simd), CollapsedNum); 18760b57cec5SDimitry Andric } 18770b57cec5SDimitry Andric 18780b57cec5SDimitry Andric OMPTeamsDistributeDirective *OMPTeamsDistributeDirective::Create( 18790b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 18800b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 18810b57cec5SDimitry Andric const HelperExprs &Exprs) { 1882e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPTeamsDistributeDirective>( 1883e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 1884e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_teams_distribute), StartLoc, EndLoc, 1885e8d8bef9SDimitry Andric CollapsedNum); 18860b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 18870b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 18880b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 18890b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 18900b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 18910b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 18920b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 18930b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 18940b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 18950b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 18960b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 18970b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 18980b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 18990b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 19000b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 19010b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 19020b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 19030b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 19040b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 19050b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 1906a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 1907a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 1908a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 19090b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 19100b57cec5SDimitry Andric return Dir; 19110b57cec5SDimitry Andric } 19120b57cec5SDimitry Andric 19130b57cec5SDimitry Andric OMPTeamsDistributeDirective * 19140b57cec5SDimitry Andric OMPTeamsDistributeDirective::CreateEmpty(const ASTContext &C, 19150b57cec5SDimitry Andric unsigned NumClauses, 19160b57cec5SDimitry Andric unsigned CollapsedNum, EmptyShell) { 1917e8d8bef9SDimitry Andric return createEmptyDirective<OMPTeamsDistributeDirective>( 1918e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 1919e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_teams_distribute), CollapsedNum); 19200b57cec5SDimitry Andric } 19210b57cec5SDimitry Andric 19220b57cec5SDimitry Andric OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::Create( 19230b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 19240b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 19250b57cec5SDimitry Andric const HelperExprs &Exprs) { 1926e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPTeamsDistributeSimdDirective>( 1927e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 1928e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), StartLoc, 1929e8d8bef9SDimitry Andric EndLoc, CollapsedNum); 19300b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 19310b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 19320b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 19330b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 19340b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 19350b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 19360b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 19370b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 19380b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 19390b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 19400b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 19410b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 19420b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 19430b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 19440b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 19450b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 19460b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 19470b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 19480b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 19490b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 1950a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 1951a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 1952a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 19530b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 19540b57cec5SDimitry Andric return Dir; 19550b57cec5SDimitry Andric } 19560b57cec5SDimitry Andric 19570b57cec5SDimitry Andric OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::CreateEmpty( 19580b57cec5SDimitry Andric const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, 19590b57cec5SDimitry Andric EmptyShell) { 1960e8d8bef9SDimitry Andric return createEmptyDirective<OMPTeamsDistributeSimdDirective>( 1961e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 1962e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), CollapsedNum); 19630b57cec5SDimitry Andric } 19640b57cec5SDimitry Andric 19650b57cec5SDimitry Andric OMPTeamsDistributeParallelForSimdDirective * 19660b57cec5SDimitry Andric OMPTeamsDistributeParallelForSimdDirective::Create( 19670b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 19680b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 19690b57cec5SDimitry Andric const HelperExprs &Exprs) { 1970e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPTeamsDistributeParallelForSimdDirective>( 1971e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 1972e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd), 1973e8d8bef9SDimitry Andric StartLoc, EndLoc, CollapsedNum); 19740b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 19750b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 19760b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 19770b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 19780b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 19790b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 19800b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 19810b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 19820b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 19830b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 19840b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 19850b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 19860b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 19870b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 19880b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 19890b57cec5SDimitry Andric Dir->setPrevLowerBoundVariable(Exprs.PrevLB); 19900b57cec5SDimitry Andric Dir->setPrevUpperBoundVariable(Exprs.PrevUB); 19910b57cec5SDimitry Andric Dir->setDistInc(Exprs.DistInc); 19920b57cec5SDimitry Andric Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); 19930b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 19940b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 19950b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 19960b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 19970b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 1998a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 1999a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 2000a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 20010b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 20020b57cec5SDimitry Andric Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); 20030b57cec5SDimitry Andric Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); 20040b57cec5SDimitry Andric Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); 20050b57cec5SDimitry Andric Dir->setCombinedInit(Exprs.DistCombinedFields.Init); 20060b57cec5SDimitry Andric Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); 20070b57cec5SDimitry Andric Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); 20080b57cec5SDimitry Andric Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); 20090b57cec5SDimitry Andric Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); 20100b57cec5SDimitry Andric Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); 20110b57cec5SDimitry Andric return Dir; 20120b57cec5SDimitry Andric } 20130b57cec5SDimitry Andric 20140b57cec5SDimitry Andric OMPTeamsDistributeParallelForSimdDirective * 20150b57cec5SDimitry Andric OMPTeamsDistributeParallelForSimdDirective::CreateEmpty(const ASTContext &C, 20160b57cec5SDimitry Andric unsigned NumClauses, 20170b57cec5SDimitry Andric unsigned CollapsedNum, 20180b57cec5SDimitry Andric EmptyShell) { 2019e8d8bef9SDimitry Andric return createEmptyDirective<OMPTeamsDistributeParallelForSimdDirective>( 2020e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 2021e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd), 2022e8d8bef9SDimitry Andric CollapsedNum); 20230b57cec5SDimitry Andric } 20240b57cec5SDimitry Andric 20250b57cec5SDimitry Andric OMPTeamsDistributeParallelForDirective * 20260b57cec5SDimitry Andric OMPTeamsDistributeParallelForDirective::Create( 20270b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 20280b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 20295ffd83dbSDimitry Andric const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) { 2030e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPTeamsDistributeParallelForDirective>( 2031e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 2032e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1, 2033e8d8bef9SDimitry Andric StartLoc, EndLoc, CollapsedNum); 20340b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 20350b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 20360b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 20370b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 20380b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 20390b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 20400b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 20410b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 20420b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 20430b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 20440b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 20450b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 20460b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 20470b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 20480b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 20490b57cec5SDimitry Andric Dir->setPrevLowerBoundVariable(Exprs.PrevLB); 20500b57cec5SDimitry Andric Dir->setPrevUpperBoundVariable(Exprs.PrevUB); 20510b57cec5SDimitry Andric Dir->setDistInc(Exprs.DistInc); 20520b57cec5SDimitry Andric Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); 20530b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 20540b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 20550b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 20560b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 20570b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 2058a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 2059a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 2060a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 20610b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 20620b57cec5SDimitry Andric Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); 20630b57cec5SDimitry Andric Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); 20640b57cec5SDimitry Andric Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); 20650b57cec5SDimitry Andric Dir->setCombinedInit(Exprs.DistCombinedFields.Init); 20660b57cec5SDimitry Andric Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); 20670b57cec5SDimitry Andric Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); 20680b57cec5SDimitry Andric Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); 20690b57cec5SDimitry Andric Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); 20700b57cec5SDimitry Andric Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); 20715ffd83dbSDimitry Andric Dir->setTaskReductionRefExpr(TaskRedRef); 20720b57cec5SDimitry Andric Dir->HasCancel = HasCancel; 20730b57cec5SDimitry Andric return Dir; 20740b57cec5SDimitry Andric } 20750b57cec5SDimitry Andric 20760b57cec5SDimitry Andric OMPTeamsDistributeParallelForDirective * 20770b57cec5SDimitry Andric OMPTeamsDistributeParallelForDirective::CreateEmpty(const ASTContext &C, 20780b57cec5SDimitry Andric unsigned NumClauses, 20790b57cec5SDimitry Andric unsigned CollapsedNum, 20800b57cec5SDimitry Andric EmptyShell) { 2081e8d8bef9SDimitry Andric return createEmptyDirective<OMPTeamsDistributeParallelForDirective>( 2082e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 2083e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1, 2084e8d8bef9SDimitry Andric CollapsedNum); 20850b57cec5SDimitry Andric } 20860b57cec5SDimitry Andric 20870b57cec5SDimitry Andric OMPTargetTeamsDirective *OMPTargetTeamsDirective::Create( 20880b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 20890b57cec5SDimitry Andric ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { 2090e8d8bef9SDimitry Andric return createDirective<OMPTargetTeamsDirective>(C, Clauses, AssociatedStmt, 2091e8d8bef9SDimitry Andric /*NumChildren=*/0, StartLoc, 2092e8d8bef9SDimitry Andric EndLoc); 20930b57cec5SDimitry Andric } 20940b57cec5SDimitry Andric 20950b57cec5SDimitry Andric OMPTargetTeamsDirective * 20960b57cec5SDimitry Andric OMPTargetTeamsDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, 20970b57cec5SDimitry Andric EmptyShell) { 2098e8d8bef9SDimitry Andric return createEmptyDirective<OMPTargetTeamsDirective>( 2099e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true); 21000b57cec5SDimitry Andric } 21010b57cec5SDimitry Andric 21020b57cec5SDimitry Andric OMPTargetTeamsDistributeDirective *OMPTargetTeamsDistributeDirective::Create( 21030b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 21040b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 21050b57cec5SDimitry Andric const HelperExprs &Exprs) { 2106e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPTargetTeamsDistributeDirective>( 2107e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 2108e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_target_teams_distribute), StartLoc, 2109e8d8bef9SDimitry Andric EndLoc, CollapsedNum); 21100b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 21110b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 21120b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 21130b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 21140b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 21150b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 21160b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 21170b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 21180b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 21190b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 21200b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 21210b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 21220b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 21230b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 21240b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 21250b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 21260b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 21270b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 21280b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 21290b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 2130a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 2131a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 2132a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 21330b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 21340b57cec5SDimitry Andric return Dir; 21350b57cec5SDimitry Andric } 21360b57cec5SDimitry Andric 21370b57cec5SDimitry Andric OMPTargetTeamsDistributeDirective * 21380b57cec5SDimitry Andric OMPTargetTeamsDistributeDirective::CreateEmpty(const ASTContext &C, 21390b57cec5SDimitry Andric unsigned NumClauses, 21400b57cec5SDimitry Andric unsigned CollapsedNum, 21410b57cec5SDimitry Andric EmptyShell) { 2142e8d8bef9SDimitry Andric return createEmptyDirective<OMPTargetTeamsDistributeDirective>( 2143e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 2144e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_target_teams_distribute), 2145e8d8bef9SDimitry Andric CollapsedNum); 21460b57cec5SDimitry Andric } 21470b57cec5SDimitry Andric 21480b57cec5SDimitry Andric OMPTargetTeamsDistributeParallelForDirective * 21490b57cec5SDimitry Andric OMPTargetTeamsDistributeParallelForDirective::Create( 21500b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 21510b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 21525ffd83dbSDimitry Andric const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) { 2153e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForDirective>( 2154e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 2155e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) + 2156e8d8bef9SDimitry Andric 1, 2157e8d8bef9SDimitry Andric StartLoc, EndLoc, CollapsedNum); 21580b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 21590b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 21600b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 21610b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 21620b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 21630b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 21640b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 21650b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 21660b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 21670b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 21680b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 21690b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 21700b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 21710b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 21720b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 21730b57cec5SDimitry Andric Dir->setPrevLowerBoundVariable(Exprs.PrevLB); 21740b57cec5SDimitry Andric Dir->setPrevUpperBoundVariable(Exprs.PrevUB); 21750b57cec5SDimitry Andric Dir->setDistInc(Exprs.DistInc); 21760b57cec5SDimitry Andric Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); 21770b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 21780b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 21790b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 21800b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 21810b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 2182a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 2183a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 2184a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 21850b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 21860b57cec5SDimitry Andric Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); 21870b57cec5SDimitry Andric Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); 21880b57cec5SDimitry Andric Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); 21890b57cec5SDimitry Andric Dir->setCombinedInit(Exprs.DistCombinedFields.Init); 21900b57cec5SDimitry Andric Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); 21910b57cec5SDimitry Andric Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); 21920b57cec5SDimitry Andric Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); 21930b57cec5SDimitry Andric Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); 21940b57cec5SDimitry Andric Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); 21955ffd83dbSDimitry Andric Dir->setTaskReductionRefExpr(TaskRedRef); 21960b57cec5SDimitry Andric Dir->HasCancel = HasCancel; 21970b57cec5SDimitry Andric return Dir; 21980b57cec5SDimitry Andric } 21990b57cec5SDimitry Andric 22000b57cec5SDimitry Andric OMPTargetTeamsDistributeParallelForDirective * 22010b57cec5SDimitry Andric OMPTargetTeamsDistributeParallelForDirective::CreateEmpty(const ASTContext &C, 22020b57cec5SDimitry Andric unsigned NumClauses, 22030b57cec5SDimitry Andric unsigned CollapsedNum, 22040b57cec5SDimitry Andric EmptyShell) { 2205e8d8bef9SDimitry Andric return createEmptyDirective<OMPTargetTeamsDistributeParallelForDirective>( 2206e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 2207e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) + 2208e8d8bef9SDimitry Andric 1, 2209e8d8bef9SDimitry Andric CollapsedNum); 22100b57cec5SDimitry Andric } 22110b57cec5SDimitry Andric 22120b57cec5SDimitry Andric OMPTargetTeamsDistributeParallelForSimdDirective * 22130b57cec5SDimitry Andric OMPTargetTeamsDistributeParallelForSimdDirective::Create( 22140b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 22150b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 22160b57cec5SDimitry Andric const HelperExprs &Exprs) { 2217e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForSimdDirective>( 2218e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 22190b57cec5SDimitry Andric numLoopChildren(CollapsedNum, 2220e8d8bef9SDimitry Andric OMPD_target_teams_distribute_parallel_for_simd), 2221e8d8bef9SDimitry Andric StartLoc, EndLoc, CollapsedNum); 22220b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 22230b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 22240b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 22250b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 22260b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 22270b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 22280b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 22290b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 22300b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 22310b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 22320b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 22330b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 22340b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 22350b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 22360b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 22370b57cec5SDimitry Andric Dir->setPrevLowerBoundVariable(Exprs.PrevLB); 22380b57cec5SDimitry Andric Dir->setPrevUpperBoundVariable(Exprs.PrevUB); 22390b57cec5SDimitry Andric Dir->setDistInc(Exprs.DistInc); 22400b57cec5SDimitry Andric Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); 22410b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 22420b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 22430b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 22440b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 22450b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 2246a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 2247a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 2248a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 22490b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 22500b57cec5SDimitry Andric Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); 22510b57cec5SDimitry Andric Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); 22520b57cec5SDimitry Andric Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); 22530b57cec5SDimitry Andric Dir->setCombinedInit(Exprs.DistCombinedFields.Init); 22540b57cec5SDimitry Andric Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); 22550b57cec5SDimitry Andric Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); 22560b57cec5SDimitry Andric Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); 22570b57cec5SDimitry Andric Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); 22580b57cec5SDimitry Andric Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); 22590b57cec5SDimitry Andric return Dir; 22600b57cec5SDimitry Andric } 22610b57cec5SDimitry Andric 22620b57cec5SDimitry Andric OMPTargetTeamsDistributeParallelForSimdDirective * 22630b57cec5SDimitry Andric OMPTargetTeamsDistributeParallelForSimdDirective::CreateEmpty( 22640b57cec5SDimitry Andric const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, 22650b57cec5SDimitry Andric EmptyShell) { 2266e8d8bef9SDimitry Andric return createEmptyDirective<OMPTargetTeamsDistributeParallelForSimdDirective>( 2267e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 22680b57cec5SDimitry Andric numLoopChildren(CollapsedNum, 2269e8d8bef9SDimitry Andric OMPD_target_teams_distribute_parallel_for_simd), 2270e8d8bef9SDimitry Andric CollapsedNum); 22710b57cec5SDimitry Andric } 22720b57cec5SDimitry Andric 22730b57cec5SDimitry Andric OMPTargetTeamsDistributeSimdDirective * 22740b57cec5SDimitry Andric OMPTargetTeamsDistributeSimdDirective::Create( 22750b57cec5SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 22760b57cec5SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 22770b57cec5SDimitry Andric const HelperExprs &Exprs) { 2278e8d8bef9SDimitry Andric auto *Dir = createDirective<OMPTargetTeamsDistributeSimdDirective>( 2279e8d8bef9SDimitry Andric C, Clauses, AssociatedStmt, 2280e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd), 2281e8d8bef9SDimitry Andric StartLoc, EndLoc, CollapsedNum); 22820b57cec5SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 22830b57cec5SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 22840b57cec5SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 22850b57cec5SDimitry Andric Dir->setPreCond(Exprs.PreCond); 22860b57cec5SDimitry Andric Dir->setCond(Exprs.Cond); 22870b57cec5SDimitry Andric Dir->setInit(Exprs.Init); 22880b57cec5SDimitry Andric Dir->setInc(Exprs.Inc); 22890b57cec5SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 22900b57cec5SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 22910b57cec5SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 22920b57cec5SDimitry Andric Dir->setStrideVariable(Exprs.ST); 22930b57cec5SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 22940b57cec5SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 22950b57cec5SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 22960b57cec5SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 22970b57cec5SDimitry Andric Dir->setCounters(Exprs.Counters); 22980b57cec5SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 22990b57cec5SDimitry Andric Dir->setInits(Exprs.Inits); 23000b57cec5SDimitry Andric Dir->setUpdates(Exprs.Updates); 23010b57cec5SDimitry Andric Dir->setFinals(Exprs.Finals); 2302a7dea167SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 2303a7dea167SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 2304a7dea167SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 23050b57cec5SDimitry Andric Dir->setPreInits(Exprs.PreInits); 23060b57cec5SDimitry Andric return Dir; 23070b57cec5SDimitry Andric } 23080b57cec5SDimitry Andric 23090b57cec5SDimitry Andric OMPTargetTeamsDistributeSimdDirective * 23100b57cec5SDimitry Andric OMPTargetTeamsDistributeSimdDirective::CreateEmpty(const ASTContext &C, 23110b57cec5SDimitry Andric unsigned NumClauses, 23120b57cec5SDimitry Andric unsigned CollapsedNum, 23130b57cec5SDimitry Andric EmptyShell) { 2314e8d8bef9SDimitry Andric return createEmptyDirective<OMPTargetTeamsDistributeSimdDirective>( 2315e8d8bef9SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 2316e8d8bef9SDimitry Andric numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd), 2317e8d8bef9SDimitry Andric CollapsedNum); 23180b57cec5SDimitry Andric } 2319fe6060f1SDimitry Andric 2320fe6060f1SDimitry Andric OMPInteropDirective * 2321fe6060f1SDimitry Andric OMPInteropDirective::Create(const ASTContext &C, SourceLocation StartLoc, 2322fe6060f1SDimitry Andric SourceLocation EndLoc, 2323fe6060f1SDimitry Andric ArrayRef<OMPClause *> Clauses) { 2324fe6060f1SDimitry Andric return createDirective<OMPInteropDirective>( 2325fe6060f1SDimitry Andric C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc, 2326fe6060f1SDimitry Andric EndLoc); 2327fe6060f1SDimitry Andric } 2328fe6060f1SDimitry Andric 2329fe6060f1SDimitry Andric OMPInteropDirective *OMPInteropDirective::CreateEmpty(const ASTContext &C, 2330fe6060f1SDimitry Andric unsigned NumClauses, 2331fe6060f1SDimitry Andric EmptyShell) { 2332fe6060f1SDimitry Andric return createEmptyDirective<OMPInteropDirective>(C, NumClauses); 2333fe6060f1SDimitry Andric } 2334fe6060f1SDimitry Andric 2335fe6060f1SDimitry Andric OMPDispatchDirective *OMPDispatchDirective::Create( 2336fe6060f1SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 2337fe6060f1SDimitry Andric ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 2338fe6060f1SDimitry Andric SourceLocation TargetCallLoc) { 2339fe6060f1SDimitry Andric auto *Dir = createDirective<OMPDispatchDirective>( 2340fe6060f1SDimitry Andric C, Clauses, AssociatedStmt, /*NumChildren=*/0, StartLoc, EndLoc); 2341fe6060f1SDimitry Andric Dir->setTargetCallLoc(TargetCallLoc); 2342fe6060f1SDimitry Andric return Dir; 2343fe6060f1SDimitry Andric } 2344fe6060f1SDimitry Andric 2345fe6060f1SDimitry Andric OMPDispatchDirective *OMPDispatchDirective::CreateEmpty(const ASTContext &C, 2346fe6060f1SDimitry Andric unsigned NumClauses, 2347fe6060f1SDimitry Andric EmptyShell) { 2348fe6060f1SDimitry Andric return createEmptyDirective<OMPDispatchDirective>(C, NumClauses, 2349fe6060f1SDimitry Andric /*HasAssociatedStmt=*/true, 2350fe6060f1SDimitry Andric /*NumChildren=*/0); 2351fe6060f1SDimitry Andric } 2352fe6060f1SDimitry Andric 2353fe6060f1SDimitry Andric OMPMaskedDirective *OMPMaskedDirective::Create(const ASTContext &C, 2354fe6060f1SDimitry Andric SourceLocation StartLoc, 2355fe6060f1SDimitry Andric SourceLocation EndLoc, 2356fe6060f1SDimitry Andric ArrayRef<OMPClause *> Clauses, 2357fe6060f1SDimitry Andric Stmt *AssociatedStmt) { 2358fe6060f1SDimitry Andric return createDirective<OMPMaskedDirective>(C, Clauses, AssociatedStmt, 2359fe6060f1SDimitry Andric /*NumChildren=*/0, StartLoc, 2360fe6060f1SDimitry Andric EndLoc); 2361fe6060f1SDimitry Andric } 2362fe6060f1SDimitry Andric 2363fe6060f1SDimitry Andric OMPMaskedDirective *OMPMaskedDirective::CreateEmpty(const ASTContext &C, 2364fe6060f1SDimitry Andric unsigned NumClauses, 2365fe6060f1SDimitry Andric EmptyShell) { 2366fe6060f1SDimitry Andric return createEmptyDirective<OMPMaskedDirective>(C, NumClauses, 2367fe6060f1SDimitry Andric /*HasAssociatedStmt=*/true); 2368fe6060f1SDimitry Andric } 2369349cc55cSDimitry Andric 2370349cc55cSDimitry Andric OMPGenericLoopDirective *OMPGenericLoopDirective::Create( 2371349cc55cSDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 2372349cc55cSDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 2373349cc55cSDimitry Andric const HelperExprs &Exprs) { 2374349cc55cSDimitry Andric auto *Dir = createDirective<OMPGenericLoopDirective>( 2375349cc55cSDimitry Andric C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_loop), 2376349cc55cSDimitry Andric StartLoc, EndLoc, CollapsedNum); 2377349cc55cSDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 2378349cc55cSDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 2379349cc55cSDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 2380349cc55cSDimitry Andric Dir->setPreCond(Exprs.PreCond); 2381349cc55cSDimitry Andric Dir->setCond(Exprs.Cond); 2382349cc55cSDimitry Andric Dir->setInit(Exprs.Init); 2383349cc55cSDimitry Andric Dir->setInc(Exprs.Inc); 2384349cc55cSDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 2385349cc55cSDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 2386349cc55cSDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 2387349cc55cSDimitry Andric Dir->setStrideVariable(Exprs.ST); 2388349cc55cSDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 2389349cc55cSDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 2390349cc55cSDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 2391349cc55cSDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 2392349cc55cSDimitry Andric Dir->setCounters(Exprs.Counters); 2393349cc55cSDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 2394349cc55cSDimitry Andric Dir->setInits(Exprs.Inits); 2395349cc55cSDimitry Andric Dir->setUpdates(Exprs.Updates); 2396349cc55cSDimitry Andric Dir->setFinals(Exprs.Finals); 2397349cc55cSDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 2398349cc55cSDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 2399349cc55cSDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 2400349cc55cSDimitry Andric Dir->setPreInits(Exprs.PreInits); 2401349cc55cSDimitry Andric return Dir; 2402349cc55cSDimitry Andric } 2403349cc55cSDimitry Andric 2404349cc55cSDimitry Andric OMPGenericLoopDirective * 2405349cc55cSDimitry Andric OMPGenericLoopDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, 2406349cc55cSDimitry Andric unsigned CollapsedNum, EmptyShell) { 2407349cc55cSDimitry Andric return createEmptyDirective<OMPGenericLoopDirective>( 2408349cc55cSDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 2409349cc55cSDimitry Andric numLoopChildren(CollapsedNum, OMPD_loop), CollapsedNum); 2410349cc55cSDimitry Andric } 241181ad6265SDimitry Andric 241281ad6265SDimitry Andric OMPTeamsGenericLoopDirective *OMPTeamsGenericLoopDirective::Create( 241381ad6265SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 241481ad6265SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 241581ad6265SDimitry Andric const HelperExprs &Exprs) { 241681ad6265SDimitry Andric auto *Dir = createDirective<OMPTeamsGenericLoopDirective>( 241781ad6265SDimitry Andric C, Clauses, AssociatedStmt, 241881ad6265SDimitry Andric numLoopChildren(CollapsedNum, OMPD_teams_loop), StartLoc, EndLoc, 241981ad6265SDimitry Andric CollapsedNum); 242081ad6265SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 242181ad6265SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 242281ad6265SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 242381ad6265SDimitry Andric Dir->setPreCond(Exprs.PreCond); 242481ad6265SDimitry Andric Dir->setCond(Exprs.Cond); 242581ad6265SDimitry Andric Dir->setInit(Exprs.Init); 242681ad6265SDimitry Andric Dir->setInc(Exprs.Inc); 242781ad6265SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 242881ad6265SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 242981ad6265SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 243081ad6265SDimitry Andric Dir->setStrideVariable(Exprs.ST); 243181ad6265SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 243281ad6265SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 243381ad6265SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 243481ad6265SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 243506c3fb27SDimitry Andric Dir->setPrevLowerBoundVariable(Exprs.PrevLB); 243606c3fb27SDimitry Andric Dir->setPrevUpperBoundVariable(Exprs.PrevUB); 243706c3fb27SDimitry Andric Dir->setDistInc(Exprs.DistInc); 243806c3fb27SDimitry Andric Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); 243981ad6265SDimitry Andric Dir->setCounters(Exprs.Counters); 244081ad6265SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 244181ad6265SDimitry Andric Dir->setInits(Exprs.Inits); 244281ad6265SDimitry Andric Dir->setUpdates(Exprs.Updates); 244381ad6265SDimitry Andric Dir->setFinals(Exprs.Finals); 244481ad6265SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 244581ad6265SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 244681ad6265SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 244781ad6265SDimitry Andric Dir->setPreInits(Exprs.PreInits); 244806c3fb27SDimitry Andric Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); 244906c3fb27SDimitry Andric Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); 245006c3fb27SDimitry Andric Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); 245106c3fb27SDimitry Andric Dir->setCombinedInit(Exprs.DistCombinedFields.Init); 245206c3fb27SDimitry Andric Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); 245306c3fb27SDimitry Andric Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); 245406c3fb27SDimitry Andric Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); 245506c3fb27SDimitry Andric Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); 245606c3fb27SDimitry Andric Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); 245781ad6265SDimitry Andric return Dir; 245881ad6265SDimitry Andric } 245981ad6265SDimitry Andric 246081ad6265SDimitry Andric OMPTeamsGenericLoopDirective * 246181ad6265SDimitry Andric OMPTeamsGenericLoopDirective::CreateEmpty(const ASTContext &C, 246281ad6265SDimitry Andric unsigned NumClauses, 246381ad6265SDimitry Andric unsigned CollapsedNum, EmptyShell) { 246481ad6265SDimitry Andric return createEmptyDirective<OMPTeamsGenericLoopDirective>( 246581ad6265SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 246681ad6265SDimitry Andric numLoopChildren(CollapsedNum, OMPD_teams_loop), CollapsedNum); 246781ad6265SDimitry Andric } 246881ad6265SDimitry Andric 246981ad6265SDimitry Andric OMPTargetTeamsGenericLoopDirective *OMPTargetTeamsGenericLoopDirective::Create( 247081ad6265SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 247181ad6265SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 2472*0fca6ea1SDimitry Andric const HelperExprs &Exprs, bool CanBeParallelFor) { 247381ad6265SDimitry Andric auto *Dir = createDirective<OMPTargetTeamsGenericLoopDirective>( 247481ad6265SDimitry Andric C, Clauses, AssociatedStmt, 247581ad6265SDimitry Andric numLoopChildren(CollapsedNum, OMPD_target_teams_loop), StartLoc, EndLoc, 247681ad6265SDimitry Andric CollapsedNum); 247781ad6265SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 247881ad6265SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 247981ad6265SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 248081ad6265SDimitry Andric Dir->setPreCond(Exprs.PreCond); 248181ad6265SDimitry Andric Dir->setCond(Exprs.Cond); 248281ad6265SDimitry Andric Dir->setInit(Exprs.Init); 248381ad6265SDimitry Andric Dir->setInc(Exprs.Inc); 248481ad6265SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 248581ad6265SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 248681ad6265SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 248781ad6265SDimitry Andric Dir->setStrideVariable(Exprs.ST); 248881ad6265SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 248981ad6265SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 249081ad6265SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 249181ad6265SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 249206c3fb27SDimitry Andric Dir->setPrevLowerBoundVariable(Exprs.PrevLB); 249306c3fb27SDimitry Andric Dir->setPrevUpperBoundVariable(Exprs.PrevUB); 249406c3fb27SDimitry Andric Dir->setDistInc(Exprs.DistInc); 249506c3fb27SDimitry Andric Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); 249681ad6265SDimitry Andric Dir->setCounters(Exprs.Counters); 249781ad6265SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 249881ad6265SDimitry Andric Dir->setInits(Exprs.Inits); 249981ad6265SDimitry Andric Dir->setUpdates(Exprs.Updates); 250081ad6265SDimitry Andric Dir->setFinals(Exprs.Finals); 250181ad6265SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 250281ad6265SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 250381ad6265SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 250481ad6265SDimitry Andric Dir->setPreInits(Exprs.PreInits); 250506c3fb27SDimitry Andric Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); 250606c3fb27SDimitry Andric Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); 250706c3fb27SDimitry Andric Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); 250806c3fb27SDimitry Andric Dir->setCombinedInit(Exprs.DistCombinedFields.Init); 250906c3fb27SDimitry Andric Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); 251006c3fb27SDimitry Andric Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); 251106c3fb27SDimitry Andric Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); 251206c3fb27SDimitry Andric Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); 251306c3fb27SDimitry Andric Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); 2514*0fca6ea1SDimitry Andric Dir->setCanBeParallelFor(CanBeParallelFor); 251581ad6265SDimitry Andric return Dir; 251681ad6265SDimitry Andric } 251781ad6265SDimitry Andric 251881ad6265SDimitry Andric OMPTargetTeamsGenericLoopDirective * 251981ad6265SDimitry Andric OMPTargetTeamsGenericLoopDirective::CreateEmpty(const ASTContext &C, 252081ad6265SDimitry Andric unsigned NumClauses, 252181ad6265SDimitry Andric unsigned CollapsedNum, 252281ad6265SDimitry Andric EmptyShell) { 252381ad6265SDimitry Andric return createEmptyDirective<OMPTargetTeamsGenericLoopDirective>( 252481ad6265SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 252581ad6265SDimitry Andric numLoopChildren(CollapsedNum, OMPD_target_teams_loop), CollapsedNum); 252681ad6265SDimitry Andric } 252781ad6265SDimitry Andric 252881ad6265SDimitry Andric OMPParallelGenericLoopDirective *OMPParallelGenericLoopDirective::Create( 252981ad6265SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 253081ad6265SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 253181ad6265SDimitry Andric const HelperExprs &Exprs) { 253281ad6265SDimitry Andric auto *Dir = createDirective<OMPParallelGenericLoopDirective>( 253381ad6265SDimitry Andric C, Clauses, AssociatedStmt, 253481ad6265SDimitry Andric numLoopChildren(CollapsedNum, OMPD_parallel_loop), StartLoc, EndLoc, 253581ad6265SDimitry Andric CollapsedNum); 253681ad6265SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 253781ad6265SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 253881ad6265SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 253981ad6265SDimitry Andric Dir->setPreCond(Exprs.PreCond); 254081ad6265SDimitry Andric Dir->setCond(Exprs.Cond); 254181ad6265SDimitry Andric Dir->setInit(Exprs.Init); 254281ad6265SDimitry Andric Dir->setInc(Exprs.Inc); 254381ad6265SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 254481ad6265SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 254581ad6265SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 254681ad6265SDimitry Andric Dir->setStrideVariable(Exprs.ST); 254781ad6265SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 254881ad6265SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 254981ad6265SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 255081ad6265SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 255181ad6265SDimitry Andric Dir->setCounters(Exprs.Counters); 255281ad6265SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 255381ad6265SDimitry Andric Dir->setInits(Exprs.Inits); 255481ad6265SDimitry Andric Dir->setUpdates(Exprs.Updates); 255581ad6265SDimitry Andric Dir->setFinals(Exprs.Finals); 255681ad6265SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 255781ad6265SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 255881ad6265SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 255981ad6265SDimitry Andric Dir->setPreInits(Exprs.PreInits); 256081ad6265SDimitry Andric return Dir; 256181ad6265SDimitry Andric } 256281ad6265SDimitry Andric 256381ad6265SDimitry Andric OMPParallelGenericLoopDirective *OMPParallelGenericLoopDirective::CreateEmpty( 256481ad6265SDimitry Andric const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, 256581ad6265SDimitry Andric EmptyShell) { 256681ad6265SDimitry Andric return createEmptyDirective<OMPParallelGenericLoopDirective>( 256781ad6265SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 256881ad6265SDimitry Andric numLoopChildren(CollapsedNum, OMPD_parallel_loop), CollapsedNum); 256981ad6265SDimitry Andric } 257081ad6265SDimitry Andric 257181ad6265SDimitry Andric OMPTargetParallelGenericLoopDirective * 257281ad6265SDimitry Andric OMPTargetParallelGenericLoopDirective::Create( 257381ad6265SDimitry Andric const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 257481ad6265SDimitry Andric unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 257581ad6265SDimitry Andric const HelperExprs &Exprs) { 257681ad6265SDimitry Andric auto *Dir = createDirective<OMPTargetParallelGenericLoopDirective>( 257781ad6265SDimitry Andric C, Clauses, AssociatedStmt, 257881ad6265SDimitry Andric numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), StartLoc, 257981ad6265SDimitry Andric EndLoc, CollapsedNum); 258081ad6265SDimitry Andric Dir->setIterationVariable(Exprs.IterationVarRef); 258181ad6265SDimitry Andric Dir->setLastIteration(Exprs.LastIteration); 258281ad6265SDimitry Andric Dir->setCalcLastIteration(Exprs.CalcLastIteration); 258381ad6265SDimitry Andric Dir->setPreCond(Exprs.PreCond); 258481ad6265SDimitry Andric Dir->setCond(Exprs.Cond); 258581ad6265SDimitry Andric Dir->setInit(Exprs.Init); 258681ad6265SDimitry Andric Dir->setInc(Exprs.Inc); 258781ad6265SDimitry Andric Dir->setIsLastIterVariable(Exprs.IL); 258881ad6265SDimitry Andric Dir->setLowerBoundVariable(Exprs.LB); 258981ad6265SDimitry Andric Dir->setUpperBoundVariable(Exprs.UB); 259081ad6265SDimitry Andric Dir->setStrideVariable(Exprs.ST); 259181ad6265SDimitry Andric Dir->setEnsureUpperBound(Exprs.EUB); 259281ad6265SDimitry Andric Dir->setNextLowerBound(Exprs.NLB); 259381ad6265SDimitry Andric Dir->setNextUpperBound(Exprs.NUB); 259481ad6265SDimitry Andric Dir->setNumIterations(Exprs.NumIterations); 259581ad6265SDimitry Andric Dir->setCounters(Exprs.Counters); 259681ad6265SDimitry Andric Dir->setPrivateCounters(Exprs.PrivateCounters); 259781ad6265SDimitry Andric Dir->setInits(Exprs.Inits); 259881ad6265SDimitry Andric Dir->setUpdates(Exprs.Updates); 259981ad6265SDimitry Andric Dir->setFinals(Exprs.Finals); 260081ad6265SDimitry Andric Dir->setDependentCounters(Exprs.DependentCounters); 260181ad6265SDimitry Andric Dir->setDependentInits(Exprs.DependentInits); 260281ad6265SDimitry Andric Dir->setFinalsConditions(Exprs.FinalsConditions); 260381ad6265SDimitry Andric Dir->setPreInits(Exprs.PreInits); 260481ad6265SDimitry Andric return Dir; 260581ad6265SDimitry Andric } 260681ad6265SDimitry Andric 260781ad6265SDimitry Andric OMPTargetParallelGenericLoopDirective * 260881ad6265SDimitry Andric OMPTargetParallelGenericLoopDirective::CreateEmpty(const ASTContext &C, 260981ad6265SDimitry Andric unsigned NumClauses, 261081ad6265SDimitry Andric unsigned CollapsedNum, 261181ad6265SDimitry Andric EmptyShell) { 261281ad6265SDimitry Andric return createEmptyDirective<OMPTargetParallelGenericLoopDirective>( 261381ad6265SDimitry Andric C, NumClauses, /*HasAssociatedStmt=*/true, 261481ad6265SDimitry Andric numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), CollapsedNum); 261581ad6265SDimitry Andric } 2616