| 1 | //===--- StmtOpenMP.cpp - Classes for OpenMP directives -------------------===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This file implements the subclasses of Stmt class declared in StmtOpenMP.h |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | #include "clang/AST/ASTContext.h" |
| 14 | #include "clang/AST/StmtOpenMP.h" |
| 15 | |
| 16 | using namespace clang; |
| 17 | using namespace llvm::omp; |
| 18 | |
| 19 | size_t OMPChildren::size(unsigned NumClauses, bool HasAssociatedStmt, |
| 20 | unsigned NumChildren) { |
| 21 | return llvm::alignTo( |
| 22 | Value: totalSizeToAlloc<OMPClause *, Stmt *>( |
| 23 | Counts: NumClauses, Counts: NumChildren + (HasAssociatedStmt ? 1 : 0)), |
| 24 | Align: alignof(OMPChildren)); |
| 25 | } |
| 26 | |
| 27 | void OMPChildren::setClauses(ArrayRef<OMPClause *> Clauses) { |
| 28 | assert(Clauses.size() == NumClauses && |
| 29 | "Number of clauses is not the same as the preallocated buffer" ); |
| 30 | llvm::copy(Range&: Clauses, Out: getTrailingObjects<OMPClause *>()); |
| 31 | } |
| 32 | |
| 33 | MutableArrayRef<Stmt *> OMPChildren::getChildren() { |
| 34 | return getTrailingObjects<Stmt *>(N: NumChildren); |
| 35 | } |
| 36 | |
| 37 | OMPChildren *OMPChildren::Create(void *Mem, ArrayRef<OMPClause *> Clauses) { |
| 38 | auto *Data = CreateEmpty(Mem, NumClauses: Clauses.size()); |
| 39 | Data->setClauses(Clauses); |
| 40 | return Data; |
| 41 | } |
| 42 | |
| 43 | OMPChildren *OMPChildren::Create(void *Mem, ArrayRef<OMPClause *> Clauses, |
| 44 | Stmt *S, unsigned NumChildren) { |
| 45 | auto *Data = CreateEmpty(Mem, NumClauses: Clauses.size(), HasAssociatedStmt: S, NumChildren); |
| 46 | Data->setClauses(Clauses); |
| 47 | if (S) |
| 48 | Data->setAssociatedStmt(S); |
| 49 | return Data; |
| 50 | } |
| 51 | |
| 52 | OMPChildren *OMPChildren::CreateEmpty(void *Mem, unsigned NumClauses, |
| 53 | bool HasAssociatedStmt, |
| 54 | unsigned NumChildren) { |
| 55 | return new (Mem) OMPChildren(NumClauses, NumChildren, HasAssociatedStmt); |
| 56 | } |
| 57 | |
| 58 | bool OMPExecutableDirective::isStandaloneDirective() const { |
| 59 | // Special case: 'omp target enter data', 'omp target exit data', |
| 60 | // 'omp target update' are stand-alone directives, but for implementation |
| 61 | // reasons they have empty synthetic structured block, to simplify codegen. |
| 62 | if (isa<OMPTargetEnterDataDirective>(Val: this) || |
| 63 | isa<OMPTargetExitDataDirective>(Val: this) || |
| 64 | isa<OMPTargetUpdateDirective>(Val: this)) |
| 65 | return true; |
| 66 | return !hasAssociatedStmt(); |
| 67 | } |
| 68 | |
| 69 | Stmt *OMPExecutableDirective::getStructuredBlock() { |
| 70 | assert(!isStandaloneDirective() && |
| 71 | "Standalone Executable Directives don't have Structured Blocks." ); |
| 72 | if (auto *LD = dyn_cast<OMPLoopDirective>(Val: this)) |
| 73 | return LD->getBody(); |
| 74 | return getRawStmt(); |
| 75 | } |
| 76 | |
| 77 | Stmt * |
| 78 | OMPLoopBasedDirective::tryToFindNextInnerLoop(Stmt *CurStmt, |
| 79 | bool TryImperfectlyNestedLoops) { |
| 80 | Stmt *OrigStmt = CurStmt; |
| 81 | CurStmt = CurStmt->IgnoreContainers(); |
| 82 | // Additional work for imperfectly nested loops, introduced in OpenMP 5.0. |
| 83 | if (TryImperfectlyNestedLoops) { |
| 84 | if (auto *CS = dyn_cast<CompoundStmt>(Val: CurStmt)) { |
| 85 | CurStmt = nullptr; |
| 86 | SmallVector<CompoundStmt *, 4> Statements(1, CS); |
| 87 | SmallVector<CompoundStmt *, 4> NextStatements; |
| 88 | while (!Statements.empty()) { |
| 89 | CS = Statements.pop_back_val(); |
| 90 | if (!CS) |
| 91 | continue; |
| 92 | for (Stmt *S : CS->body()) { |
| 93 | if (!S) |
| 94 | continue; |
| 95 | if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Val: S)) |
| 96 | S = CanonLoop->getLoopStmt(); |
| 97 | if (isa<ForStmt>(Val: S) || isa<CXXForRangeStmt>(Val: S) || |
| 98 | (isa<OMPLoopBasedDirective>(Val: S) && !isa<OMPLoopDirective>(Val: S))) { |
| 99 | // Only single loop construct is allowed. |
| 100 | if (CurStmt) { |
| 101 | CurStmt = OrigStmt; |
| 102 | break; |
| 103 | } |
| 104 | CurStmt = S; |
| 105 | continue; |
| 106 | } |
| 107 | S = S->IgnoreContainers(); |
| 108 | if (auto *InnerCS = dyn_cast_or_null<CompoundStmt>(Val: S)) |
| 109 | NextStatements.push_back(Elt: InnerCS); |
| 110 | } |
| 111 | if (Statements.empty()) { |
| 112 | // Found single inner loop or multiple loops - exit. |
| 113 | if (CurStmt) |
| 114 | break; |
| 115 | Statements.swap(RHS&: NextStatements); |
| 116 | } |
| 117 | } |
| 118 | if (!CurStmt) |
| 119 | CurStmt = OrigStmt; |
| 120 | } |
| 121 | } |
| 122 | return CurStmt; |
| 123 | } |
| 124 | |
| 125 | bool OMPLoopBasedDirective::doForAllLoops( |
| 126 | Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops, |
| 127 | llvm::function_ref<bool(unsigned, Stmt *)> Callback, |
| 128 | llvm::function_ref<void(OMPLoopTransformationDirective *)> |
| 129 | OnTransformationCallback) { |
| 130 | CurStmt = CurStmt->IgnoreContainers(); |
| 131 | for (unsigned Cnt = 0; Cnt < NumLoops; ++Cnt) { |
| 132 | while (true) { |
| 133 | auto *Dir = dyn_cast<OMPLoopTransformationDirective>(Val: CurStmt); |
| 134 | if (!Dir) |
| 135 | break; |
| 136 | |
| 137 | OnTransformationCallback(Dir); |
| 138 | |
| 139 | Stmt *TransformedStmt = Dir->getTransformedStmt(); |
| 140 | if (!TransformedStmt) { |
| 141 | unsigned NumGeneratedLoops = Dir->getNumGeneratedLoops(); |
| 142 | if (NumGeneratedLoops == 0) { |
| 143 | // May happen if the loop transformation does not result in a |
| 144 | // generated loop (such as full unrolling). |
| 145 | break; |
| 146 | } |
| 147 | if (NumGeneratedLoops > 0) { |
| 148 | // The loop transformation construct has generated loops, but these |
| 149 | // may not have been generated yet due to being in a dependent |
| 150 | // context. |
| 151 | return true; |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | CurStmt = TransformedStmt; |
| 156 | } |
| 157 | if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Val: CurStmt)) |
| 158 | CurStmt = CanonLoop->getLoopStmt(); |
| 159 | if (Callback(Cnt, CurStmt)) |
| 160 | return false; |
| 161 | // Move on to the next nested for loop, or to the loop body. |
| 162 | // OpenMP [2.8.1, simd construct, Restrictions] |
| 163 | // All loops associated with the construct must be perfectly nested; that |
| 164 | // is, there must be no intervening code nor any OpenMP directive between |
| 165 | // any two loops. |
| 166 | if (auto *For = dyn_cast<ForStmt>(Val: CurStmt)) { |
| 167 | CurStmt = For->getBody(); |
| 168 | } else { |
| 169 | assert(isa<CXXForRangeStmt>(CurStmt) && |
| 170 | "Expected canonical for or range-based for loops." ); |
| 171 | CurStmt = cast<CXXForRangeStmt>(Val: CurStmt)->getBody(); |
| 172 | } |
| 173 | CurStmt = OMPLoopBasedDirective::tryToFindNextInnerLoop( |
| 174 | CurStmt, TryImperfectlyNestedLoops); |
| 175 | } |
| 176 | return true; |
| 177 | } |
| 178 | |
| 179 | void OMPLoopBasedDirective::doForAllLoopsBodies( |
| 180 | Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops, |
| 181 | llvm::function_ref<void(unsigned, Stmt *, Stmt *)> Callback) { |
| 182 | bool Res = OMPLoopBasedDirective::doForAllLoops( |
| 183 | CurStmt, TryImperfectlyNestedLoops, NumLoops, |
| 184 | Callback: [Callback](unsigned Cnt, Stmt *Loop) { |
| 185 | Stmt *Body = nullptr; |
| 186 | if (auto *For = dyn_cast<ForStmt>(Val: Loop)) { |
| 187 | Body = For->getBody(); |
| 188 | } else { |
| 189 | assert(isa<CXXForRangeStmt>(Loop) && |
| 190 | "Expected canonical for or range-based for loops." ); |
| 191 | Body = cast<CXXForRangeStmt>(Val: Loop)->getBody(); |
| 192 | } |
| 193 | if (auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Val: Body)) |
| 194 | Body = CanonLoop->getLoopStmt(); |
| 195 | Callback(Cnt, Loop, Body); |
| 196 | return false; |
| 197 | }); |
| 198 | assert(Res && "Expected only loops" ); |
| 199 | (void)Res; |
| 200 | } |
| 201 | |
| 202 | Stmt *OMPLoopDirective::getBody() { |
| 203 | // This relies on the loop form is already checked by Sema. |
| 204 | Stmt *Body = nullptr; |
| 205 | OMPLoopBasedDirective::doForAllLoopsBodies( |
| 206 | CurStmt: Data->getRawStmt(), /*TryImperfectlyNestedLoops=*/true, |
| 207 | NumLoops: NumAssociatedLoops, |
| 208 | Callback: [&Body](unsigned, Stmt *, Stmt *BodyStmt) { Body = BodyStmt; }); |
| 209 | return Body; |
| 210 | } |
| 211 | |
| 212 | void OMPLoopDirective::setCounters(ArrayRef<Expr *> A) { |
| 213 | assert(A.size() == getLoopsNumber() && |
| 214 | "Number of loop counters is not the same as the collapsed number" ); |
| 215 | llvm::copy(Range&: A, Out: getCounters().begin()); |
| 216 | } |
| 217 | |
| 218 | void OMPLoopDirective::setPrivateCounters(ArrayRef<Expr *> A) { |
| 219 | assert(A.size() == getLoopsNumber() && "Number of loop private counters " |
| 220 | "is not the same as the collapsed " |
| 221 | "number" ); |
| 222 | llvm::copy(Range&: A, Out: getPrivateCounters().begin()); |
| 223 | } |
| 224 | |
| 225 | void OMPLoopDirective::setInits(ArrayRef<Expr *> A) { |
| 226 | assert(A.size() == getLoopsNumber() && |
| 227 | "Number of counter inits is not the same as the collapsed number" ); |
| 228 | llvm::copy(Range&: A, Out: getInits().begin()); |
| 229 | } |
| 230 | |
| 231 | void OMPLoopDirective::setUpdates(ArrayRef<Expr *> A) { |
| 232 | assert(A.size() == getLoopsNumber() && |
| 233 | "Number of counter updates is not the same as the collapsed number" ); |
| 234 | llvm::copy(Range&: A, Out: getUpdates().begin()); |
| 235 | } |
| 236 | |
| 237 | void OMPLoopDirective::setFinals(ArrayRef<Expr *> A) { |
| 238 | assert(A.size() == getLoopsNumber() && |
| 239 | "Number of counter finals is not the same as the collapsed number" ); |
| 240 | llvm::copy(Range&: A, Out: getFinals().begin()); |
| 241 | } |
| 242 | |
| 243 | void OMPLoopDirective::setDependentCounters(ArrayRef<Expr *> A) { |
| 244 | assert( |
| 245 | A.size() == getLoopsNumber() && |
| 246 | "Number of dependent counters is not the same as the collapsed number" ); |
| 247 | llvm::copy(Range&: A, Out: getDependentCounters().begin()); |
| 248 | } |
| 249 | |
| 250 | void OMPLoopDirective::setDependentInits(ArrayRef<Expr *> A) { |
| 251 | assert(A.size() == getLoopsNumber() && |
| 252 | "Number of dependent inits is not the same as the collapsed number" ); |
| 253 | llvm::copy(Range&: A, Out: getDependentInits().begin()); |
| 254 | } |
| 255 | |
| 256 | void OMPLoopDirective::setFinalsConditions(ArrayRef<Expr *> A) { |
| 257 | assert(A.size() == getLoopsNumber() && |
| 258 | "Number of finals conditions is not the same as the collapsed number" ); |
| 259 | llvm::copy(Range&: A, Out: getFinalsConditions().begin()); |
| 260 | } |
| 261 | |
| 262 | OMPMetaDirective *OMPMetaDirective::Create(const ASTContext &C, |
| 263 | SourceLocation StartLoc, |
| 264 | SourceLocation EndLoc, |
| 265 | ArrayRef<OMPClause *> Clauses, |
| 266 | Stmt *AssociatedStmt, Stmt *IfStmt) { |
| 267 | auto *Dir = createDirective<OMPMetaDirective>( |
| 268 | C, Clauses, AssociatedStmt, /*NumChildren=*/1, P&: StartLoc, P&: EndLoc); |
| 269 | Dir->setIfStmt(IfStmt); |
| 270 | return Dir; |
| 271 | } |
| 272 | |
| 273 | OMPMetaDirective *OMPMetaDirective::CreateEmpty(const ASTContext &C, |
| 274 | unsigned NumClauses, |
| 275 | EmptyShell) { |
| 276 | return createEmptyDirective<OMPMetaDirective>(C, NumClauses, |
| 277 | /*HasAssociatedStmt=*/true, |
| 278 | /*NumChildren=*/1); |
| 279 | } |
| 280 | |
| 281 | OMPParallelDirective *OMPParallelDirective::Create( |
| 282 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 283 | ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, |
| 284 | bool HasCancel) { |
| 285 | auto *Dir = createDirective<OMPParallelDirective>( |
| 286 | C, Clauses, AssociatedStmt, /*NumChildren=*/1, P&: StartLoc, P&: EndLoc); |
| 287 | Dir->setTaskReductionRefExpr(TaskRedRef); |
| 288 | Dir->setHasCancel(HasCancel); |
| 289 | return Dir; |
| 290 | } |
| 291 | |
| 292 | OMPParallelDirective *OMPParallelDirective::CreateEmpty(const ASTContext &C, |
| 293 | unsigned NumClauses, |
| 294 | EmptyShell) { |
| 295 | return createEmptyDirective<OMPParallelDirective>(C, NumClauses, |
| 296 | /*HasAssociatedStmt=*/true, |
| 297 | /*NumChildren=*/1); |
| 298 | } |
| 299 | |
| 300 | OMPSimdDirective * |
| 301 | OMPSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc, |
| 302 | SourceLocation EndLoc, unsigned CollapsedNum, |
| 303 | ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 304 | const HelperExprs &Exprs) { |
| 305 | auto *Dir = createDirective<OMPSimdDirective>( |
| 306 | C, Clauses, AssociatedStmt, NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_simd), |
| 307 | P&: StartLoc, P&: EndLoc, P&: CollapsedNum); |
| 308 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 309 | Dir->setLastIteration(Exprs.LastIteration); |
| 310 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 311 | Dir->setPreCond(Exprs.PreCond); |
| 312 | Dir->setCond(Exprs.Cond); |
| 313 | Dir->setInit(Exprs.Init); |
| 314 | Dir->setInc(Exprs.Inc); |
| 315 | Dir->setCounters(Exprs.Counters); |
| 316 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 317 | Dir->setInits(Exprs.Inits); |
| 318 | Dir->setUpdates(Exprs.Updates); |
| 319 | Dir->setFinals(Exprs.Finals); |
| 320 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 321 | Dir->setDependentInits(Exprs.DependentInits); |
| 322 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 323 | Dir->setPreInits(Exprs.PreInits); |
| 324 | return Dir; |
| 325 | } |
| 326 | |
| 327 | OMPSimdDirective *OMPSimdDirective::CreateEmpty(const ASTContext &C, |
| 328 | unsigned NumClauses, |
| 329 | unsigned CollapsedNum, |
| 330 | EmptyShell) { |
| 331 | return createEmptyDirective<OMPSimdDirective>( |
| 332 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 333 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_simd), P&: CollapsedNum); |
| 334 | } |
| 335 | |
| 336 | OMPForDirective *OMPForDirective::Create( |
| 337 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 338 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 339 | const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) { |
| 340 | auto *Dir = createDirective<OMPForDirective>( |
| 341 | C, Clauses, AssociatedStmt, NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_for) + 1, |
| 342 | P&: StartLoc, P&: EndLoc, P&: CollapsedNum); |
| 343 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 344 | Dir->setLastIteration(Exprs.LastIteration); |
| 345 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 346 | Dir->setPreCond(Exprs.PreCond); |
| 347 | Dir->setCond(Exprs.Cond); |
| 348 | Dir->setInit(Exprs.Init); |
| 349 | Dir->setInc(Exprs.Inc); |
| 350 | Dir->setIsLastIterVariable(Exprs.IL); |
| 351 | Dir->setLowerBoundVariable(Exprs.LB); |
| 352 | Dir->setUpperBoundVariable(Exprs.UB); |
| 353 | Dir->setStrideVariable(Exprs.ST); |
| 354 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 355 | Dir->setNextLowerBound(Exprs.NLB); |
| 356 | Dir->setNextUpperBound(Exprs.NUB); |
| 357 | Dir->setNumIterations(Exprs.NumIterations); |
| 358 | Dir->setCounters(Exprs.Counters); |
| 359 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 360 | Dir->setInits(Exprs.Inits); |
| 361 | Dir->setUpdates(Exprs.Updates); |
| 362 | Dir->setFinals(Exprs.Finals); |
| 363 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 364 | Dir->setDependentInits(Exprs.DependentInits); |
| 365 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 366 | Dir->setPreInits(Exprs.PreInits); |
| 367 | Dir->setTaskReductionRefExpr(TaskRedRef); |
| 368 | Dir->setHasCancel(HasCancel); |
| 369 | return Dir; |
| 370 | } |
| 371 | |
| 372 | Stmt *OMPLoopTransformationDirective::getTransformedStmt() const { |
| 373 | switch (getStmtClass()) { |
| 374 | #define STMT(CLASS, PARENT) |
| 375 | #define ABSTRACT_STMT(CLASS) |
| 376 | #define OMPLOOPTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \ |
| 377 | case Stmt::CLASS##Class: \ |
| 378 | return static_cast<const CLASS *>(this)->getTransformedStmt(); |
| 379 | #include "clang/AST/StmtNodes.inc" |
| 380 | default: |
| 381 | llvm_unreachable("Not a loop transformation" ); |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | Stmt *OMPLoopTransformationDirective::getPreInits() const { |
| 386 | switch (getStmtClass()) { |
| 387 | #define STMT(CLASS, PARENT) |
| 388 | #define ABSTRACT_STMT(CLASS) |
| 389 | #define OMPLOOPTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \ |
| 390 | case Stmt::CLASS##Class: \ |
| 391 | return static_cast<const CLASS *>(this)->getPreInits(); |
| 392 | #include "clang/AST/StmtNodes.inc" |
| 393 | default: |
| 394 | llvm_unreachable("Not a loop transformation" ); |
| 395 | } |
| 396 | } |
| 397 | |
| 398 | OMPForDirective *OMPForDirective::CreateEmpty(const ASTContext &C, |
| 399 | unsigned NumClauses, |
| 400 | unsigned CollapsedNum, |
| 401 | EmptyShell) { |
| 402 | return createEmptyDirective<OMPForDirective>( |
| 403 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 404 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_for) + 1, P&: CollapsedNum); |
| 405 | } |
| 406 | |
| 407 | OMPTileDirective * |
| 408 | OMPTileDirective::Create(const ASTContext &C, SourceLocation StartLoc, |
| 409 | SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses, |
| 410 | unsigned NumLoops, Stmt *AssociatedStmt, |
| 411 | Stmt *TransformedStmt, Stmt *PreInits) { |
| 412 | OMPTileDirective *Dir = createDirective<OMPTileDirective>( |
| 413 | C, Clauses, AssociatedStmt, NumChildren: TransformedStmtOffset + 1, P&: StartLoc, P&: EndLoc, |
| 414 | P&: NumLoops); |
| 415 | Dir->setTransformedStmt(TransformedStmt); |
| 416 | Dir->setPreInits(PreInits); |
| 417 | return Dir; |
| 418 | } |
| 419 | |
| 420 | OMPTileDirective *OMPTileDirective::CreateEmpty(const ASTContext &C, |
| 421 | unsigned NumClauses, |
| 422 | unsigned NumLoops) { |
| 423 | return createEmptyDirective<OMPTileDirective>( |
| 424 | C, NumClauses, /*HasAssociatedStmt=*/true, NumChildren: TransformedStmtOffset + 1, |
| 425 | P: SourceLocation(), P: SourceLocation(), P&: NumLoops); |
| 426 | } |
| 427 | |
| 428 | OMPStripeDirective * |
| 429 | OMPStripeDirective::Create(const ASTContext &C, SourceLocation StartLoc, |
| 430 | SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses, |
| 431 | unsigned NumLoops, Stmt *AssociatedStmt, |
| 432 | Stmt *TransformedStmt, Stmt *PreInits) { |
| 433 | OMPStripeDirective *Dir = createDirective<OMPStripeDirective>( |
| 434 | C, Clauses, AssociatedStmt, NumChildren: TransformedStmtOffset + 1, P&: StartLoc, P&: EndLoc, |
| 435 | P&: NumLoops); |
| 436 | Dir->setTransformedStmt(TransformedStmt); |
| 437 | Dir->setPreInits(PreInits); |
| 438 | return Dir; |
| 439 | } |
| 440 | |
| 441 | OMPStripeDirective *OMPStripeDirective::CreateEmpty(const ASTContext &C, |
| 442 | unsigned NumClauses, |
| 443 | unsigned NumLoops) { |
| 444 | return createEmptyDirective<OMPStripeDirective>( |
| 445 | C, NumClauses, /*HasAssociatedStmt=*/true, NumChildren: TransformedStmtOffset + 1, |
| 446 | P: SourceLocation(), P: SourceLocation(), P&: NumLoops); |
| 447 | } |
| 448 | |
| 449 | OMPUnrollDirective * |
| 450 | OMPUnrollDirective::Create(const ASTContext &C, SourceLocation StartLoc, |
| 451 | SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses, |
| 452 | Stmt *AssociatedStmt, unsigned NumGeneratedLoops, |
| 453 | Stmt *TransformedStmt, Stmt *PreInits) { |
| 454 | assert(NumGeneratedLoops <= 1 && "Unrolling generates at most one loop" ); |
| 455 | |
| 456 | auto *Dir = createDirective<OMPUnrollDirective>( |
| 457 | C, Clauses, AssociatedStmt, NumChildren: TransformedStmtOffset + 1, P&: StartLoc, P&: EndLoc); |
| 458 | Dir->setNumGeneratedLoops(NumGeneratedLoops); |
| 459 | Dir->setTransformedStmt(TransformedStmt); |
| 460 | Dir->setPreInits(PreInits); |
| 461 | return Dir; |
| 462 | } |
| 463 | |
| 464 | OMPUnrollDirective *OMPUnrollDirective::CreateEmpty(const ASTContext &C, |
| 465 | unsigned NumClauses) { |
| 466 | return createEmptyDirective<OMPUnrollDirective>( |
| 467 | C, NumClauses, /*HasAssociatedStmt=*/true, NumChildren: TransformedStmtOffset + 1, |
| 468 | P: SourceLocation(), P: SourceLocation()); |
| 469 | } |
| 470 | |
| 471 | OMPReverseDirective * |
| 472 | OMPReverseDirective::Create(const ASTContext &C, SourceLocation StartLoc, |
| 473 | SourceLocation EndLoc, Stmt *AssociatedStmt, |
| 474 | unsigned NumLoops, Stmt *TransformedStmt, |
| 475 | Stmt *PreInits) { |
| 476 | OMPReverseDirective *Dir = createDirective<OMPReverseDirective>( |
| 477 | C, Clauses: {}, AssociatedStmt, NumChildren: TransformedStmtOffset + 1, P&: StartLoc, P&: EndLoc, |
| 478 | P&: NumLoops); |
| 479 | Dir->setTransformedStmt(TransformedStmt); |
| 480 | Dir->setPreInits(PreInits); |
| 481 | return Dir; |
| 482 | } |
| 483 | |
| 484 | OMPReverseDirective *OMPReverseDirective::CreateEmpty(const ASTContext &C, |
| 485 | unsigned NumLoops) { |
| 486 | return createEmptyDirective<OMPReverseDirective>( |
| 487 | C, /*NumClauses=*/0, /*HasAssociatedStmt=*/true, |
| 488 | NumChildren: TransformedStmtOffset + 1, P: SourceLocation(), P: SourceLocation(), P&: NumLoops); |
| 489 | } |
| 490 | |
| 491 | OMPInterchangeDirective *OMPInterchangeDirective::Create( |
| 492 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 493 | ArrayRef<OMPClause *> Clauses, unsigned NumLoops, Stmt *AssociatedStmt, |
| 494 | Stmt *TransformedStmt, Stmt *PreInits) { |
| 495 | OMPInterchangeDirective *Dir = createDirective<OMPInterchangeDirective>( |
| 496 | C, Clauses, AssociatedStmt, NumChildren: TransformedStmtOffset + 1, P&: StartLoc, P&: EndLoc, |
| 497 | P&: NumLoops); |
| 498 | Dir->setTransformedStmt(TransformedStmt); |
| 499 | Dir->setPreInits(PreInits); |
| 500 | return Dir; |
| 501 | } |
| 502 | |
| 503 | OMPInterchangeDirective * |
| 504 | OMPInterchangeDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, |
| 505 | unsigned NumLoops) { |
| 506 | return createEmptyDirective<OMPInterchangeDirective>( |
| 507 | C, NumClauses, /*HasAssociatedStmt=*/true, NumChildren: TransformedStmtOffset + 1, |
| 508 | P: SourceLocation(), P: SourceLocation(), P&: NumLoops); |
| 509 | } |
| 510 | |
| 511 | OMPForSimdDirective * |
| 512 | OMPForSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc, |
| 513 | SourceLocation EndLoc, unsigned CollapsedNum, |
| 514 | ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 515 | const HelperExprs &Exprs) { |
| 516 | auto *Dir = createDirective<OMPForSimdDirective>( |
| 517 | C, Clauses, AssociatedStmt, NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_for_simd), |
| 518 | P&: StartLoc, P&: EndLoc, P&: CollapsedNum); |
| 519 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 520 | Dir->setLastIteration(Exprs.LastIteration); |
| 521 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 522 | Dir->setPreCond(Exprs.PreCond); |
| 523 | Dir->setCond(Exprs.Cond); |
| 524 | Dir->setInit(Exprs.Init); |
| 525 | Dir->setInc(Exprs.Inc); |
| 526 | Dir->setIsLastIterVariable(Exprs.IL); |
| 527 | Dir->setLowerBoundVariable(Exprs.LB); |
| 528 | Dir->setUpperBoundVariable(Exprs.UB); |
| 529 | Dir->setStrideVariable(Exprs.ST); |
| 530 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 531 | Dir->setNextLowerBound(Exprs.NLB); |
| 532 | Dir->setNextUpperBound(Exprs.NUB); |
| 533 | Dir->setNumIterations(Exprs.NumIterations); |
| 534 | Dir->setCounters(Exprs.Counters); |
| 535 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 536 | Dir->setInits(Exprs.Inits); |
| 537 | Dir->setUpdates(Exprs.Updates); |
| 538 | Dir->setFinals(Exprs.Finals); |
| 539 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 540 | Dir->setDependentInits(Exprs.DependentInits); |
| 541 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 542 | Dir->setPreInits(Exprs.PreInits); |
| 543 | return Dir; |
| 544 | } |
| 545 | |
| 546 | OMPForSimdDirective *OMPForSimdDirective::CreateEmpty(const ASTContext &C, |
| 547 | unsigned NumClauses, |
| 548 | unsigned CollapsedNum, |
| 549 | EmptyShell) { |
| 550 | return createEmptyDirective<OMPForSimdDirective>( |
| 551 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 552 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_for_simd), P&: CollapsedNum); |
| 553 | } |
| 554 | |
| 555 | OMPSectionsDirective *OMPSectionsDirective::Create( |
| 556 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 557 | ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, |
| 558 | bool HasCancel) { |
| 559 | auto *Dir = createDirective<OMPSectionsDirective>(C, Clauses, AssociatedStmt, |
| 560 | /*NumChildren=*/1, P&: StartLoc, |
| 561 | P&: EndLoc); |
| 562 | Dir->setTaskReductionRefExpr(TaskRedRef); |
| 563 | Dir->setHasCancel(HasCancel); |
| 564 | return Dir; |
| 565 | } |
| 566 | |
| 567 | OMPSectionsDirective *OMPSectionsDirective::CreateEmpty(const ASTContext &C, |
| 568 | unsigned NumClauses, |
| 569 | EmptyShell) { |
| 570 | return createEmptyDirective<OMPSectionsDirective>(C, NumClauses, |
| 571 | /*HasAssociatedStmt=*/true, |
| 572 | /*NumChildren=*/1); |
| 573 | } |
| 574 | |
| 575 | OMPSectionDirective *OMPSectionDirective::Create(const ASTContext &C, |
| 576 | SourceLocation StartLoc, |
| 577 | SourceLocation EndLoc, |
| 578 | Stmt *AssociatedStmt, |
| 579 | bool HasCancel) { |
| 580 | auto *Dir = |
| 581 | createDirective<OMPSectionDirective>(C, Clauses: {}, AssociatedStmt, |
| 582 | /*NumChildren=*/0, P&: StartLoc, P&: EndLoc); |
| 583 | Dir->setHasCancel(HasCancel); |
| 584 | return Dir; |
| 585 | } |
| 586 | |
| 587 | OMPSectionDirective *OMPSectionDirective::CreateEmpty(const ASTContext &C, |
| 588 | EmptyShell) { |
| 589 | return createEmptyDirective<OMPSectionDirective>(C, /*NumClauses=*/0, |
| 590 | /*HasAssociatedStmt=*/true); |
| 591 | } |
| 592 | |
| 593 | OMPScopeDirective *OMPScopeDirective::Create(const ASTContext &C, |
| 594 | SourceLocation StartLoc, |
| 595 | SourceLocation EndLoc, |
| 596 | ArrayRef<OMPClause *> Clauses, |
| 597 | Stmt *AssociatedStmt) { |
| 598 | return createDirective<OMPScopeDirective>(C, Clauses, AssociatedStmt, |
| 599 | /*NumChildren=*/0, P&: StartLoc, |
| 600 | P&: EndLoc); |
| 601 | } |
| 602 | |
| 603 | OMPScopeDirective *OMPScopeDirective::CreateEmpty(const ASTContext &C, |
| 604 | unsigned NumClauses, |
| 605 | EmptyShell) { |
| 606 | return createEmptyDirective<OMPScopeDirective>(C, NumClauses, |
| 607 | /*HasAssociatedStmt=*/true); |
| 608 | } |
| 609 | |
| 610 | OMPSingleDirective *OMPSingleDirective::Create(const ASTContext &C, |
| 611 | SourceLocation StartLoc, |
| 612 | SourceLocation EndLoc, |
| 613 | ArrayRef<OMPClause *> Clauses, |
| 614 | Stmt *AssociatedStmt) { |
| 615 | return createDirective<OMPSingleDirective>(C, Clauses, AssociatedStmt, |
| 616 | /*NumChildren=*/0, P&: StartLoc, |
| 617 | P&: EndLoc); |
| 618 | } |
| 619 | |
| 620 | OMPSingleDirective *OMPSingleDirective::CreateEmpty(const ASTContext &C, |
| 621 | unsigned NumClauses, |
| 622 | EmptyShell) { |
| 623 | return createEmptyDirective<OMPSingleDirective>(C, NumClauses, |
| 624 | /*HasAssociatedStmt=*/true); |
| 625 | } |
| 626 | |
| 627 | OMPMasterDirective *OMPMasterDirective::Create(const ASTContext &C, |
| 628 | SourceLocation StartLoc, |
| 629 | SourceLocation EndLoc, |
| 630 | Stmt *AssociatedStmt) { |
| 631 | return createDirective<OMPMasterDirective>(C, Clauses: {}, AssociatedStmt, |
| 632 | /*NumChildren=*/0, P&: StartLoc, |
| 633 | P&: EndLoc); |
| 634 | } |
| 635 | |
| 636 | OMPMasterDirective *OMPMasterDirective::CreateEmpty(const ASTContext &C, |
| 637 | EmptyShell) { |
| 638 | return createEmptyDirective<OMPMasterDirective>(C, /*NumClauses=*/0, |
| 639 | /*HasAssociatedStmt=*/true); |
| 640 | } |
| 641 | |
| 642 | OMPCriticalDirective *OMPCriticalDirective::Create( |
| 643 | const ASTContext &C, const DeclarationNameInfo &Name, |
| 644 | SourceLocation StartLoc, SourceLocation EndLoc, |
| 645 | ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { |
| 646 | return createDirective<OMPCriticalDirective>(C, Clauses, AssociatedStmt, |
| 647 | /*NumChildren=*/0, P: Name, |
| 648 | P&: StartLoc, P&: EndLoc); |
| 649 | } |
| 650 | |
| 651 | OMPCriticalDirective *OMPCriticalDirective::CreateEmpty(const ASTContext &C, |
| 652 | unsigned NumClauses, |
| 653 | EmptyShell) { |
| 654 | return createEmptyDirective<OMPCriticalDirective>(C, NumClauses, |
| 655 | /*HasAssociatedStmt=*/true); |
| 656 | } |
| 657 | |
| 658 | OMPParallelForDirective *OMPParallelForDirective::Create( |
| 659 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 660 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 661 | const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) { |
| 662 | auto *Dir = createDirective<OMPParallelForDirective>( |
| 663 | C, Clauses, AssociatedStmt, |
| 664 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_parallel_for) + 1, P&: StartLoc, P&: EndLoc, |
| 665 | P&: CollapsedNum); |
| 666 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 667 | Dir->setLastIteration(Exprs.LastIteration); |
| 668 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 669 | Dir->setPreCond(Exprs.PreCond); |
| 670 | Dir->setCond(Exprs.Cond); |
| 671 | Dir->setInit(Exprs.Init); |
| 672 | Dir->setInc(Exprs.Inc); |
| 673 | Dir->setIsLastIterVariable(Exprs.IL); |
| 674 | Dir->setLowerBoundVariable(Exprs.LB); |
| 675 | Dir->setUpperBoundVariable(Exprs.UB); |
| 676 | Dir->setStrideVariable(Exprs.ST); |
| 677 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 678 | Dir->setNextLowerBound(Exprs.NLB); |
| 679 | Dir->setNextUpperBound(Exprs.NUB); |
| 680 | Dir->setNumIterations(Exprs.NumIterations); |
| 681 | Dir->setCounters(Exprs.Counters); |
| 682 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 683 | Dir->setInits(Exprs.Inits); |
| 684 | Dir->setUpdates(Exprs.Updates); |
| 685 | Dir->setFinals(Exprs.Finals); |
| 686 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 687 | Dir->setDependentInits(Exprs.DependentInits); |
| 688 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 689 | Dir->setPreInits(Exprs.PreInits); |
| 690 | Dir->setTaskReductionRefExpr(TaskRedRef); |
| 691 | Dir->setHasCancel(HasCancel); |
| 692 | return Dir; |
| 693 | } |
| 694 | |
| 695 | OMPParallelForDirective * |
| 696 | OMPParallelForDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, |
| 697 | unsigned CollapsedNum, EmptyShell) { |
| 698 | return createEmptyDirective<OMPParallelForDirective>( |
| 699 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 700 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_parallel_for) + 1, P&: CollapsedNum); |
| 701 | } |
| 702 | |
| 703 | OMPParallelForSimdDirective *OMPParallelForSimdDirective::Create( |
| 704 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 705 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 706 | const HelperExprs &Exprs) { |
| 707 | auto *Dir = createDirective<OMPParallelForSimdDirective>( |
| 708 | C, Clauses, AssociatedStmt, |
| 709 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_parallel_for_simd), P&: StartLoc, P&: EndLoc, |
| 710 | P&: CollapsedNum); |
| 711 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 712 | Dir->setLastIteration(Exprs.LastIteration); |
| 713 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 714 | Dir->setPreCond(Exprs.PreCond); |
| 715 | Dir->setCond(Exprs.Cond); |
| 716 | Dir->setInit(Exprs.Init); |
| 717 | Dir->setInc(Exprs.Inc); |
| 718 | Dir->setIsLastIterVariable(Exprs.IL); |
| 719 | Dir->setLowerBoundVariable(Exprs.LB); |
| 720 | Dir->setUpperBoundVariable(Exprs.UB); |
| 721 | Dir->setStrideVariable(Exprs.ST); |
| 722 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 723 | Dir->setNextLowerBound(Exprs.NLB); |
| 724 | Dir->setNextUpperBound(Exprs.NUB); |
| 725 | Dir->setNumIterations(Exprs.NumIterations); |
| 726 | Dir->setCounters(Exprs.Counters); |
| 727 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 728 | Dir->setInits(Exprs.Inits); |
| 729 | Dir->setUpdates(Exprs.Updates); |
| 730 | Dir->setFinals(Exprs.Finals); |
| 731 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 732 | Dir->setDependentInits(Exprs.DependentInits); |
| 733 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 734 | Dir->setPreInits(Exprs.PreInits); |
| 735 | return Dir; |
| 736 | } |
| 737 | |
| 738 | OMPParallelForSimdDirective * |
| 739 | OMPParallelForSimdDirective::CreateEmpty(const ASTContext &C, |
| 740 | unsigned NumClauses, |
| 741 | unsigned CollapsedNum, EmptyShell) { |
| 742 | return createEmptyDirective<OMPParallelForSimdDirective>( |
| 743 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 744 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_parallel_for_simd), P&: CollapsedNum); |
| 745 | } |
| 746 | |
| 747 | OMPParallelMasterDirective *OMPParallelMasterDirective::Create( |
| 748 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 749 | ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) { |
| 750 | auto *Dir = createDirective<OMPParallelMasterDirective>( |
| 751 | C, Clauses, AssociatedStmt, /*NumChildren=*/1, P&: StartLoc, P&: EndLoc); |
| 752 | Dir->setTaskReductionRefExpr(TaskRedRef); |
| 753 | return Dir; |
| 754 | } |
| 755 | |
| 756 | OMPParallelMasterDirective * |
| 757 | OMPParallelMasterDirective::CreateEmpty(const ASTContext &C, |
| 758 | unsigned NumClauses, EmptyShell) { |
| 759 | return createEmptyDirective<OMPParallelMasterDirective>( |
| 760 | C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1); |
| 761 | } |
| 762 | |
| 763 | OMPParallelMaskedDirective *OMPParallelMaskedDirective::Create( |
| 764 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 765 | ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) { |
| 766 | auto *Dir = createDirective<OMPParallelMaskedDirective>( |
| 767 | C, Clauses, AssociatedStmt, /*NumChildren=*/1, P&: StartLoc, P&: EndLoc); |
| 768 | Dir->setTaskReductionRefExpr(TaskRedRef); |
| 769 | return Dir; |
| 770 | } |
| 771 | |
| 772 | OMPParallelMaskedDirective * |
| 773 | OMPParallelMaskedDirective::CreateEmpty(const ASTContext &C, |
| 774 | unsigned NumClauses, EmptyShell) { |
| 775 | return createEmptyDirective<OMPParallelMaskedDirective>( |
| 776 | C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1); |
| 777 | } |
| 778 | |
| 779 | OMPParallelSectionsDirective *OMPParallelSectionsDirective::Create( |
| 780 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 781 | ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, |
| 782 | bool HasCancel) { |
| 783 | auto *Dir = createDirective<OMPParallelSectionsDirective>( |
| 784 | C, Clauses, AssociatedStmt, /*NumChildren=*/1, P&: StartLoc, P&: EndLoc); |
| 785 | Dir->setTaskReductionRefExpr(TaskRedRef); |
| 786 | Dir->setHasCancel(HasCancel); |
| 787 | return Dir; |
| 788 | } |
| 789 | |
| 790 | OMPParallelSectionsDirective * |
| 791 | OMPParallelSectionsDirective::CreateEmpty(const ASTContext &C, |
| 792 | unsigned NumClauses, EmptyShell) { |
| 793 | return createEmptyDirective<OMPParallelSectionsDirective>( |
| 794 | C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1); |
| 795 | } |
| 796 | |
| 797 | OMPTaskDirective * |
| 798 | OMPTaskDirective::Create(const ASTContext &C, SourceLocation StartLoc, |
| 799 | SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses, |
| 800 | Stmt *AssociatedStmt, bool HasCancel) { |
| 801 | auto *Dir = createDirective<OMPTaskDirective>( |
| 802 | C, Clauses, AssociatedStmt, /*NumChildren=*/0, P&: StartLoc, P&: EndLoc); |
| 803 | Dir->setHasCancel(HasCancel); |
| 804 | return Dir; |
| 805 | } |
| 806 | |
| 807 | OMPTaskDirective *OMPTaskDirective::CreateEmpty(const ASTContext &C, |
| 808 | unsigned NumClauses, |
| 809 | EmptyShell) { |
| 810 | return createEmptyDirective<OMPTaskDirective>(C, NumClauses, |
| 811 | /*HasAssociatedStmt=*/true); |
| 812 | } |
| 813 | |
| 814 | OMPTaskyieldDirective *OMPTaskyieldDirective::Create(const ASTContext &C, |
| 815 | SourceLocation StartLoc, |
| 816 | SourceLocation EndLoc) { |
| 817 | return new (C) OMPTaskyieldDirective(StartLoc, EndLoc); |
| 818 | } |
| 819 | |
| 820 | OMPTaskyieldDirective *OMPTaskyieldDirective::CreateEmpty(const ASTContext &C, |
| 821 | EmptyShell) { |
| 822 | return new (C) OMPTaskyieldDirective(); |
| 823 | } |
| 824 | |
| 825 | OMPAssumeDirective *OMPAssumeDirective::Create(const ASTContext &C, |
| 826 | SourceLocation StartLoc, |
| 827 | SourceLocation EndLoc, |
| 828 | ArrayRef<OMPClause *> Clauses, |
| 829 | Stmt *AStmt) { |
| 830 | return createDirective<OMPAssumeDirective>(C, Clauses, AssociatedStmt: AStmt, |
| 831 | /*NumChildren=*/0, P&: StartLoc, |
| 832 | P&: EndLoc); |
| 833 | } |
| 834 | |
| 835 | OMPAssumeDirective *OMPAssumeDirective::CreateEmpty(const ASTContext &C, |
| 836 | unsigned NumClauses, |
| 837 | EmptyShell) { |
| 838 | return createEmptyDirective<OMPAssumeDirective>(C, NumClauses, |
| 839 | /*HasAssociatedStmt=*/true); |
| 840 | } |
| 841 | |
| 842 | OMPErrorDirective *OMPErrorDirective::Create(const ASTContext &C, |
| 843 | SourceLocation StartLoc, |
| 844 | SourceLocation EndLoc, |
| 845 | ArrayRef<OMPClause *> Clauses) { |
| 846 | return createDirective<OMPErrorDirective>( |
| 847 | C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, P&: StartLoc, |
| 848 | P&: EndLoc); |
| 849 | } |
| 850 | |
| 851 | OMPErrorDirective *OMPErrorDirective::CreateEmpty(const ASTContext &C, |
| 852 | unsigned NumClauses, |
| 853 | EmptyShell) { |
| 854 | return createEmptyDirective<OMPErrorDirective>(C, NumClauses); |
| 855 | } |
| 856 | |
| 857 | OMPBarrierDirective *OMPBarrierDirective::Create(const ASTContext &C, |
| 858 | SourceLocation StartLoc, |
| 859 | SourceLocation EndLoc) { |
| 860 | return new (C) OMPBarrierDirective(StartLoc, EndLoc); |
| 861 | } |
| 862 | |
| 863 | OMPBarrierDirective *OMPBarrierDirective::CreateEmpty(const ASTContext &C, |
| 864 | EmptyShell) { |
| 865 | return new (C) OMPBarrierDirective(); |
| 866 | } |
| 867 | |
| 868 | OMPTaskwaitDirective * |
| 869 | OMPTaskwaitDirective::Create(const ASTContext &C, SourceLocation StartLoc, |
| 870 | SourceLocation EndLoc, |
| 871 | ArrayRef<OMPClause *> Clauses) { |
| 872 | return createDirective<OMPTaskwaitDirective>( |
| 873 | C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, P&: StartLoc, |
| 874 | P&: EndLoc); |
| 875 | } |
| 876 | |
| 877 | OMPTaskwaitDirective *OMPTaskwaitDirective::CreateEmpty(const ASTContext &C, |
| 878 | unsigned NumClauses, |
| 879 | EmptyShell) { |
| 880 | return createEmptyDirective<OMPTaskwaitDirective>(C, NumClauses); |
| 881 | } |
| 882 | |
| 883 | OMPTaskgroupDirective *OMPTaskgroupDirective::Create( |
| 884 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 885 | ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) { |
| 886 | auto *Dir = createDirective<OMPTaskgroupDirective>( |
| 887 | C, Clauses, AssociatedStmt, /*NumChildren=*/1, P&: StartLoc, P&: EndLoc); |
| 888 | Dir->setReductionRef(ReductionRef); |
| 889 | return Dir; |
| 890 | } |
| 891 | |
| 892 | OMPTaskgroupDirective *OMPTaskgroupDirective::CreateEmpty(const ASTContext &C, |
| 893 | unsigned NumClauses, |
| 894 | EmptyShell) { |
| 895 | return createEmptyDirective<OMPTaskgroupDirective>( |
| 896 | C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1); |
| 897 | } |
| 898 | |
| 899 | OMPCancellationPointDirective *OMPCancellationPointDirective::Create( |
| 900 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 901 | OpenMPDirectiveKind CancelRegion) { |
| 902 | auto *Dir = new (C) OMPCancellationPointDirective(StartLoc, EndLoc); |
| 903 | Dir->setCancelRegion(CancelRegion); |
| 904 | return Dir; |
| 905 | } |
| 906 | |
| 907 | OMPCancellationPointDirective * |
| 908 | OMPCancellationPointDirective::CreateEmpty(const ASTContext &C, EmptyShell) { |
| 909 | return new (C) OMPCancellationPointDirective(); |
| 910 | } |
| 911 | |
| 912 | OMPCancelDirective * |
| 913 | OMPCancelDirective::Create(const ASTContext &C, SourceLocation StartLoc, |
| 914 | SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses, |
| 915 | OpenMPDirectiveKind CancelRegion) { |
| 916 | auto *Dir = createDirective<OMPCancelDirective>( |
| 917 | C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, P&: StartLoc, |
| 918 | P&: EndLoc); |
| 919 | Dir->setCancelRegion(CancelRegion); |
| 920 | return Dir; |
| 921 | } |
| 922 | |
| 923 | OMPCancelDirective *OMPCancelDirective::CreateEmpty(const ASTContext &C, |
| 924 | unsigned NumClauses, |
| 925 | EmptyShell) { |
| 926 | return createEmptyDirective<OMPCancelDirective>(C, NumClauses); |
| 927 | } |
| 928 | |
| 929 | OMPFlushDirective *OMPFlushDirective::Create(const ASTContext &C, |
| 930 | SourceLocation StartLoc, |
| 931 | SourceLocation EndLoc, |
| 932 | ArrayRef<OMPClause *> Clauses) { |
| 933 | return createDirective<OMPFlushDirective>( |
| 934 | C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, P&: StartLoc, |
| 935 | P&: EndLoc); |
| 936 | } |
| 937 | |
| 938 | OMPFlushDirective *OMPFlushDirective::CreateEmpty(const ASTContext &C, |
| 939 | unsigned NumClauses, |
| 940 | EmptyShell) { |
| 941 | return createEmptyDirective<OMPFlushDirective>(C, NumClauses); |
| 942 | } |
| 943 | |
| 944 | OMPDepobjDirective *OMPDepobjDirective::Create(const ASTContext &C, |
| 945 | SourceLocation StartLoc, |
| 946 | SourceLocation EndLoc, |
| 947 | ArrayRef<OMPClause *> Clauses) { |
| 948 | return createDirective<OMPDepobjDirective>( |
| 949 | C, Clauses, /*AssociatedStmt=*/nullptr, |
| 950 | /*NumChildren=*/0, P&: StartLoc, P&: EndLoc); |
| 951 | } |
| 952 | |
| 953 | OMPDepobjDirective *OMPDepobjDirective::CreateEmpty(const ASTContext &C, |
| 954 | unsigned NumClauses, |
| 955 | EmptyShell) { |
| 956 | return createEmptyDirective<OMPDepobjDirective>(C, NumClauses); |
| 957 | } |
| 958 | |
| 959 | OMPScanDirective *OMPScanDirective::Create(const ASTContext &C, |
| 960 | SourceLocation StartLoc, |
| 961 | SourceLocation EndLoc, |
| 962 | ArrayRef<OMPClause *> Clauses) { |
| 963 | return createDirective<OMPScanDirective>(C, Clauses, |
| 964 | /*AssociatedStmt=*/nullptr, |
| 965 | /*NumChildren=*/0, P&: StartLoc, P&: EndLoc); |
| 966 | } |
| 967 | |
| 968 | OMPScanDirective *OMPScanDirective::CreateEmpty(const ASTContext &C, |
| 969 | unsigned NumClauses, |
| 970 | EmptyShell) { |
| 971 | return createEmptyDirective<OMPScanDirective>(C, NumClauses); |
| 972 | } |
| 973 | |
| 974 | OMPOrderedDirective *OMPOrderedDirective::Create(const ASTContext &C, |
| 975 | SourceLocation StartLoc, |
| 976 | SourceLocation EndLoc, |
| 977 | ArrayRef<OMPClause *> Clauses, |
| 978 | Stmt *AssociatedStmt) { |
| 979 | return createDirective<OMPOrderedDirective>( |
| 980 | C, Clauses, AssociatedStmt: cast_or_null<CapturedStmt>(Val: AssociatedStmt), |
| 981 | /*NumChildren=*/0, P&: StartLoc, P&: EndLoc); |
| 982 | } |
| 983 | |
| 984 | OMPOrderedDirective *OMPOrderedDirective::CreateEmpty(const ASTContext &C, |
| 985 | unsigned NumClauses, |
| 986 | bool IsStandalone, |
| 987 | EmptyShell) { |
| 988 | return createEmptyDirective<OMPOrderedDirective>(C, NumClauses, |
| 989 | HasAssociatedStmt: !IsStandalone); |
| 990 | } |
| 991 | |
| 992 | OMPAtomicDirective * |
| 993 | OMPAtomicDirective::Create(const ASTContext &C, SourceLocation StartLoc, |
| 994 | SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses, |
| 995 | Stmt *AssociatedStmt, Expressions Exprs) { |
| 996 | auto *Dir = createDirective<OMPAtomicDirective>( |
| 997 | C, Clauses, AssociatedStmt, /*NumChildren=*/7, P&: StartLoc, P&: EndLoc); |
| 998 | Dir->setX(Exprs.X); |
| 999 | Dir->setV(Exprs.V); |
| 1000 | Dir->setR(Exprs.R); |
| 1001 | Dir->setExpr(Exprs.E); |
| 1002 | Dir->setUpdateExpr(Exprs.UE); |
| 1003 | Dir->setD(Exprs.D); |
| 1004 | Dir->setCond(Exprs.Cond); |
| 1005 | Dir->Flags.IsXLHSInRHSPart = Exprs.IsXLHSInRHSPart ? 1 : 0; |
| 1006 | Dir->Flags.IsPostfixUpdate = Exprs.IsPostfixUpdate ? 1 : 0; |
| 1007 | Dir->Flags.IsFailOnly = Exprs.IsFailOnly ? 1 : 0; |
| 1008 | return Dir; |
| 1009 | } |
| 1010 | |
| 1011 | OMPAtomicDirective *OMPAtomicDirective::CreateEmpty(const ASTContext &C, |
| 1012 | unsigned NumClauses, |
| 1013 | EmptyShell) { |
| 1014 | return createEmptyDirective<OMPAtomicDirective>( |
| 1015 | C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/7); |
| 1016 | } |
| 1017 | |
| 1018 | OMPTargetDirective *OMPTargetDirective::Create(const ASTContext &C, |
| 1019 | SourceLocation StartLoc, |
| 1020 | SourceLocation EndLoc, |
| 1021 | ArrayRef<OMPClause *> Clauses, |
| 1022 | Stmt *AssociatedStmt) { |
| 1023 | return createDirective<OMPTargetDirective>( |
| 1024 | C, Clauses, AssociatedStmt, /*NumChildren=*/0, P&: StartLoc, P&: EndLoc); |
| 1025 | } |
| 1026 | |
| 1027 | OMPTargetDirective *OMPTargetDirective::CreateEmpty(const ASTContext &C, |
| 1028 | unsigned NumClauses, |
| 1029 | EmptyShell) { |
| 1030 | return createEmptyDirective<OMPTargetDirective>(C, NumClauses, |
| 1031 | /*HasAssociatedStmt=*/true); |
| 1032 | } |
| 1033 | |
| 1034 | OMPTargetParallelDirective *OMPTargetParallelDirective::Create( |
| 1035 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1036 | ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, |
| 1037 | bool HasCancel) { |
| 1038 | auto *Dir = createDirective<OMPTargetParallelDirective>( |
| 1039 | C, Clauses, AssociatedStmt, /*NumChildren=*/1, P&: StartLoc, P&: EndLoc); |
| 1040 | Dir->setTaskReductionRefExpr(TaskRedRef); |
| 1041 | Dir->setHasCancel(HasCancel); |
| 1042 | return Dir; |
| 1043 | } |
| 1044 | |
| 1045 | OMPTargetParallelDirective * |
| 1046 | OMPTargetParallelDirective::CreateEmpty(const ASTContext &C, |
| 1047 | unsigned NumClauses, EmptyShell) { |
| 1048 | return createEmptyDirective<OMPTargetParallelDirective>( |
| 1049 | C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1); |
| 1050 | } |
| 1051 | |
| 1052 | OMPTargetParallelForDirective *OMPTargetParallelForDirective::Create( |
| 1053 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1054 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1055 | const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) { |
| 1056 | auto *Dir = createDirective<OMPTargetParallelForDirective>( |
| 1057 | C, Clauses, AssociatedStmt, |
| 1058 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_target_parallel_for) + 1, P&: StartLoc, |
| 1059 | P&: EndLoc, P&: CollapsedNum); |
| 1060 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1061 | Dir->setLastIteration(Exprs.LastIteration); |
| 1062 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1063 | Dir->setPreCond(Exprs.PreCond); |
| 1064 | Dir->setCond(Exprs.Cond); |
| 1065 | Dir->setInit(Exprs.Init); |
| 1066 | Dir->setInc(Exprs.Inc); |
| 1067 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1068 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1069 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1070 | Dir->setStrideVariable(Exprs.ST); |
| 1071 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1072 | Dir->setNextLowerBound(Exprs.NLB); |
| 1073 | Dir->setNextUpperBound(Exprs.NUB); |
| 1074 | Dir->setNumIterations(Exprs.NumIterations); |
| 1075 | Dir->setCounters(Exprs.Counters); |
| 1076 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1077 | Dir->setInits(Exprs.Inits); |
| 1078 | Dir->setUpdates(Exprs.Updates); |
| 1079 | Dir->setFinals(Exprs.Finals); |
| 1080 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1081 | Dir->setDependentInits(Exprs.DependentInits); |
| 1082 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1083 | Dir->setPreInits(Exprs.PreInits); |
| 1084 | Dir->setTaskReductionRefExpr(TaskRedRef); |
| 1085 | Dir->setHasCancel(HasCancel); |
| 1086 | return Dir; |
| 1087 | } |
| 1088 | |
| 1089 | OMPTargetParallelForDirective * |
| 1090 | OMPTargetParallelForDirective::CreateEmpty(const ASTContext &C, |
| 1091 | unsigned NumClauses, |
| 1092 | unsigned CollapsedNum, EmptyShell) { |
| 1093 | return createEmptyDirective<OMPTargetParallelForDirective>( |
| 1094 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1095 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_target_parallel_for) + 1, |
| 1096 | P&: CollapsedNum); |
| 1097 | } |
| 1098 | |
| 1099 | OMPTargetDataDirective *OMPTargetDataDirective::Create( |
| 1100 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1101 | ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { |
| 1102 | return createDirective<OMPTargetDataDirective>( |
| 1103 | C, Clauses, AssociatedStmt, /*NumChildren=*/0, P&: StartLoc, P&: EndLoc); |
| 1104 | } |
| 1105 | |
| 1106 | OMPTargetDataDirective *OMPTargetDataDirective::CreateEmpty(const ASTContext &C, |
| 1107 | unsigned N, |
| 1108 | EmptyShell) { |
| 1109 | return createEmptyDirective<OMPTargetDataDirective>( |
| 1110 | C, NumClauses: N, /*HasAssociatedStmt=*/true); |
| 1111 | } |
| 1112 | |
| 1113 | OMPTargetEnterDataDirective *OMPTargetEnterDataDirective::Create( |
| 1114 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1115 | ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { |
| 1116 | return createDirective<OMPTargetEnterDataDirective>( |
| 1117 | C, Clauses, AssociatedStmt, /*NumChildren=*/0, P&: StartLoc, P&: EndLoc); |
| 1118 | } |
| 1119 | |
| 1120 | OMPTargetEnterDataDirective * |
| 1121 | OMPTargetEnterDataDirective::CreateEmpty(const ASTContext &C, unsigned N, |
| 1122 | EmptyShell) { |
| 1123 | return createEmptyDirective<OMPTargetEnterDataDirective>( |
| 1124 | C, NumClauses: N, /*HasAssociatedStmt=*/true); |
| 1125 | } |
| 1126 | |
| 1127 | OMPTargetExitDataDirective *OMPTargetExitDataDirective::Create( |
| 1128 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1129 | ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { |
| 1130 | return createDirective<OMPTargetExitDataDirective>( |
| 1131 | C, Clauses, AssociatedStmt, /*NumChildren=*/0, P&: StartLoc, P&: EndLoc); |
| 1132 | } |
| 1133 | |
| 1134 | OMPTargetExitDataDirective * |
| 1135 | OMPTargetExitDataDirective::CreateEmpty(const ASTContext &C, unsigned N, |
| 1136 | EmptyShell) { |
| 1137 | return createEmptyDirective<OMPTargetExitDataDirective>( |
| 1138 | C, NumClauses: N, /*HasAssociatedStmt=*/true); |
| 1139 | } |
| 1140 | |
| 1141 | OMPTeamsDirective *OMPTeamsDirective::Create(const ASTContext &C, |
| 1142 | SourceLocation StartLoc, |
| 1143 | SourceLocation EndLoc, |
| 1144 | ArrayRef<OMPClause *> Clauses, |
| 1145 | Stmt *AssociatedStmt) { |
| 1146 | return createDirective<OMPTeamsDirective>( |
| 1147 | C, Clauses, AssociatedStmt, /*NumChildren=*/0, P&: StartLoc, P&: EndLoc); |
| 1148 | } |
| 1149 | |
| 1150 | OMPTeamsDirective *OMPTeamsDirective::CreateEmpty(const ASTContext &C, |
| 1151 | unsigned NumClauses, |
| 1152 | EmptyShell) { |
| 1153 | return createEmptyDirective<OMPTeamsDirective>(C, NumClauses, |
| 1154 | /*HasAssociatedStmt=*/true); |
| 1155 | } |
| 1156 | |
| 1157 | OMPTaskLoopDirective *OMPTaskLoopDirective::Create( |
| 1158 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1159 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1160 | const HelperExprs &Exprs, bool HasCancel) { |
| 1161 | auto *Dir = createDirective<OMPTaskLoopDirective>( |
| 1162 | C, Clauses, AssociatedStmt, NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_taskloop), |
| 1163 | P&: StartLoc, P&: EndLoc, P&: CollapsedNum); |
| 1164 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1165 | Dir->setLastIteration(Exprs.LastIteration); |
| 1166 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1167 | Dir->setPreCond(Exprs.PreCond); |
| 1168 | Dir->setCond(Exprs.Cond); |
| 1169 | Dir->setInit(Exprs.Init); |
| 1170 | Dir->setInc(Exprs.Inc); |
| 1171 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1172 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1173 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1174 | Dir->setStrideVariable(Exprs.ST); |
| 1175 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1176 | Dir->setNextLowerBound(Exprs.NLB); |
| 1177 | Dir->setNextUpperBound(Exprs.NUB); |
| 1178 | Dir->setNumIterations(Exprs.NumIterations); |
| 1179 | Dir->setCounters(Exprs.Counters); |
| 1180 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1181 | Dir->setInits(Exprs.Inits); |
| 1182 | Dir->setUpdates(Exprs.Updates); |
| 1183 | Dir->setFinals(Exprs.Finals); |
| 1184 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1185 | Dir->setDependentInits(Exprs.DependentInits); |
| 1186 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1187 | Dir->setPreInits(Exprs.PreInits); |
| 1188 | Dir->setHasCancel(HasCancel); |
| 1189 | return Dir; |
| 1190 | } |
| 1191 | |
| 1192 | OMPTaskLoopDirective *OMPTaskLoopDirective::CreateEmpty(const ASTContext &C, |
| 1193 | unsigned NumClauses, |
| 1194 | unsigned CollapsedNum, |
| 1195 | EmptyShell) { |
| 1196 | return createEmptyDirective<OMPTaskLoopDirective>( |
| 1197 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1198 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_taskloop), P&: CollapsedNum); |
| 1199 | } |
| 1200 | |
| 1201 | OMPTaskLoopSimdDirective *OMPTaskLoopSimdDirective::Create( |
| 1202 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1203 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1204 | const HelperExprs &Exprs) { |
| 1205 | auto *Dir = createDirective<OMPTaskLoopSimdDirective>( |
| 1206 | C, Clauses, AssociatedStmt, |
| 1207 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_taskloop_simd), P&: StartLoc, P&: EndLoc, |
| 1208 | P&: CollapsedNum); |
| 1209 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1210 | Dir->setLastIteration(Exprs.LastIteration); |
| 1211 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1212 | Dir->setPreCond(Exprs.PreCond); |
| 1213 | Dir->setCond(Exprs.Cond); |
| 1214 | Dir->setInit(Exprs.Init); |
| 1215 | Dir->setInc(Exprs.Inc); |
| 1216 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1217 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1218 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1219 | Dir->setStrideVariable(Exprs.ST); |
| 1220 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1221 | Dir->setNextLowerBound(Exprs.NLB); |
| 1222 | Dir->setNextUpperBound(Exprs.NUB); |
| 1223 | Dir->setNumIterations(Exprs.NumIterations); |
| 1224 | Dir->setCounters(Exprs.Counters); |
| 1225 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1226 | Dir->setInits(Exprs.Inits); |
| 1227 | Dir->setUpdates(Exprs.Updates); |
| 1228 | Dir->setFinals(Exprs.Finals); |
| 1229 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1230 | Dir->setDependentInits(Exprs.DependentInits); |
| 1231 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1232 | Dir->setPreInits(Exprs.PreInits); |
| 1233 | return Dir; |
| 1234 | } |
| 1235 | |
| 1236 | OMPTaskLoopSimdDirective * |
| 1237 | OMPTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, |
| 1238 | unsigned CollapsedNum, EmptyShell) { |
| 1239 | return createEmptyDirective<OMPTaskLoopSimdDirective>( |
| 1240 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1241 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_taskloop_simd), P&: CollapsedNum); |
| 1242 | } |
| 1243 | |
| 1244 | OMPMasterTaskLoopDirective *OMPMasterTaskLoopDirective::Create( |
| 1245 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1246 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1247 | const HelperExprs &Exprs, bool HasCancel) { |
| 1248 | auto *Dir = createDirective<OMPMasterTaskLoopDirective>( |
| 1249 | C, Clauses, AssociatedStmt, |
| 1250 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_master_taskloop), P&: StartLoc, P&: EndLoc, |
| 1251 | P&: CollapsedNum); |
| 1252 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1253 | Dir->setLastIteration(Exprs.LastIteration); |
| 1254 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1255 | Dir->setPreCond(Exprs.PreCond); |
| 1256 | Dir->setCond(Exprs.Cond); |
| 1257 | Dir->setInit(Exprs.Init); |
| 1258 | Dir->setInc(Exprs.Inc); |
| 1259 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1260 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1261 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1262 | Dir->setStrideVariable(Exprs.ST); |
| 1263 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1264 | Dir->setNextLowerBound(Exprs.NLB); |
| 1265 | Dir->setNextUpperBound(Exprs.NUB); |
| 1266 | Dir->setNumIterations(Exprs.NumIterations); |
| 1267 | Dir->setCounters(Exprs.Counters); |
| 1268 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1269 | Dir->setInits(Exprs.Inits); |
| 1270 | Dir->setUpdates(Exprs.Updates); |
| 1271 | Dir->setFinals(Exprs.Finals); |
| 1272 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1273 | Dir->setDependentInits(Exprs.DependentInits); |
| 1274 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1275 | Dir->setPreInits(Exprs.PreInits); |
| 1276 | Dir->setHasCancel(HasCancel); |
| 1277 | return Dir; |
| 1278 | } |
| 1279 | |
| 1280 | OMPMasterTaskLoopDirective * |
| 1281 | OMPMasterTaskLoopDirective::CreateEmpty(const ASTContext &C, |
| 1282 | unsigned NumClauses, |
| 1283 | unsigned CollapsedNum, EmptyShell) { |
| 1284 | return createEmptyDirective<OMPMasterTaskLoopDirective>( |
| 1285 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1286 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_master_taskloop), P&: CollapsedNum); |
| 1287 | } |
| 1288 | |
| 1289 | OMPMaskedTaskLoopDirective *OMPMaskedTaskLoopDirective::Create( |
| 1290 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1291 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1292 | const HelperExprs &Exprs, bool HasCancel) { |
| 1293 | auto *Dir = createDirective<OMPMaskedTaskLoopDirective>( |
| 1294 | C, Clauses, AssociatedStmt, |
| 1295 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_masked_taskloop), P&: StartLoc, P&: EndLoc, |
| 1296 | P&: CollapsedNum); |
| 1297 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1298 | Dir->setLastIteration(Exprs.LastIteration); |
| 1299 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1300 | Dir->setPreCond(Exprs.PreCond); |
| 1301 | Dir->setCond(Exprs.Cond); |
| 1302 | Dir->setInit(Exprs.Init); |
| 1303 | Dir->setInc(Exprs.Inc); |
| 1304 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1305 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1306 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1307 | Dir->setStrideVariable(Exprs.ST); |
| 1308 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1309 | Dir->setNextLowerBound(Exprs.NLB); |
| 1310 | Dir->setNextUpperBound(Exprs.NUB); |
| 1311 | Dir->setNumIterations(Exprs.NumIterations); |
| 1312 | Dir->setCounters(Exprs.Counters); |
| 1313 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1314 | Dir->setInits(Exprs.Inits); |
| 1315 | Dir->setUpdates(Exprs.Updates); |
| 1316 | Dir->setFinals(Exprs.Finals); |
| 1317 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1318 | Dir->setDependentInits(Exprs.DependentInits); |
| 1319 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1320 | Dir->setPreInits(Exprs.PreInits); |
| 1321 | Dir->setHasCancel(HasCancel); |
| 1322 | return Dir; |
| 1323 | } |
| 1324 | |
| 1325 | OMPMaskedTaskLoopDirective * |
| 1326 | OMPMaskedTaskLoopDirective::CreateEmpty(const ASTContext &C, |
| 1327 | unsigned NumClauses, |
| 1328 | unsigned CollapsedNum, EmptyShell) { |
| 1329 | return createEmptyDirective<OMPMaskedTaskLoopDirective>( |
| 1330 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1331 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_masked_taskloop), P&: CollapsedNum); |
| 1332 | } |
| 1333 | |
| 1334 | OMPMasterTaskLoopSimdDirective *OMPMasterTaskLoopSimdDirective::Create( |
| 1335 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1336 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1337 | const HelperExprs &Exprs) { |
| 1338 | auto *Dir = createDirective<OMPMasterTaskLoopSimdDirective>( |
| 1339 | C, Clauses, AssociatedStmt, |
| 1340 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_master_taskloop_simd), P&: StartLoc, |
| 1341 | P&: EndLoc, P&: CollapsedNum); |
| 1342 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1343 | Dir->setLastIteration(Exprs.LastIteration); |
| 1344 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1345 | Dir->setPreCond(Exprs.PreCond); |
| 1346 | Dir->setCond(Exprs.Cond); |
| 1347 | Dir->setInit(Exprs.Init); |
| 1348 | Dir->setInc(Exprs.Inc); |
| 1349 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1350 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1351 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1352 | Dir->setStrideVariable(Exprs.ST); |
| 1353 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1354 | Dir->setNextLowerBound(Exprs.NLB); |
| 1355 | Dir->setNextUpperBound(Exprs.NUB); |
| 1356 | Dir->setNumIterations(Exprs.NumIterations); |
| 1357 | Dir->setCounters(Exprs.Counters); |
| 1358 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1359 | Dir->setInits(Exprs.Inits); |
| 1360 | Dir->setUpdates(Exprs.Updates); |
| 1361 | Dir->setFinals(Exprs.Finals); |
| 1362 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1363 | Dir->setDependentInits(Exprs.DependentInits); |
| 1364 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1365 | Dir->setPreInits(Exprs.PreInits); |
| 1366 | return Dir; |
| 1367 | } |
| 1368 | |
| 1369 | OMPMasterTaskLoopSimdDirective * |
| 1370 | OMPMasterTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, |
| 1371 | unsigned NumClauses, |
| 1372 | unsigned CollapsedNum, EmptyShell) { |
| 1373 | return createEmptyDirective<OMPMasterTaskLoopSimdDirective>( |
| 1374 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1375 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_master_taskloop_simd), P&: CollapsedNum); |
| 1376 | } |
| 1377 | |
| 1378 | OMPMaskedTaskLoopSimdDirective *OMPMaskedTaskLoopSimdDirective::Create( |
| 1379 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1380 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1381 | const HelperExprs &Exprs) { |
| 1382 | auto *Dir = createDirective<OMPMaskedTaskLoopSimdDirective>( |
| 1383 | C, Clauses, AssociatedStmt, |
| 1384 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_masked_taskloop_simd), P&: StartLoc, |
| 1385 | P&: EndLoc, P&: CollapsedNum); |
| 1386 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1387 | Dir->setLastIteration(Exprs.LastIteration); |
| 1388 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1389 | Dir->setPreCond(Exprs.PreCond); |
| 1390 | Dir->setCond(Exprs.Cond); |
| 1391 | Dir->setInit(Exprs.Init); |
| 1392 | Dir->setInc(Exprs.Inc); |
| 1393 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1394 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1395 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1396 | Dir->setStrideVariable(Exprs.ST); |
| 1397 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1398 | Dir->setNextLowerBound(Exprs.NLB); |
| 1399 | Dir->setNextUpperBound(Exprs.NUB); |
| 1400 | Dir->setNumIterations(Exprs.NumIterations); |
| 1401 | Dir->setCounters(Exprs.Counters); |
| 1402 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1403 | Dir->setInits(Exprs.Inits); |
| 1404 | Dir->setUpdates(Exprs.Updates); |
| 1405 | Dir->setFinals(Exprs.Finals); |
| 1406 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1407 | Dir->setDependentInits(Exprs.DependentInits); |
| 1408 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1409 | Dir->setPreInits(Exprs.PreInits); |
| 1410 | return Dir; |
| 1411 | } |
| 1412 | |
| 1413 | OMPMaskedTaskLoopSimdDirective * |
| 1414 | OMPMaskedTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, |
| 1415 | unsigned NumClauses, |
| 1416 | unsigned CollapsedNum, EmptyShell) { |
| 1417 | return createEmptyDirective<OMPMaskedTaskLoopSimdDirective>( |
| 1418 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1419 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_masked_taskloop_simd), P&: CollapsedNum); |
| 1420 | } |
| 1421 | |
| 1422 | OMPParallelMasterTaskLoopDirective *OMPParallelMasterTaskLoopDirective::Create( |
| 1423 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1424 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1425 | const HelperExprs &Exprs, bool HasCancel) { |
| 1426 | auto *Dir = createDirective<OMPParallelMasterTaskLoopDirective>( |
| 1427 | C, Clauses, AssociatedStmt, |
| 1428 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_parallel_master_taskloop), P&: StartLoc, |
| 1429 | P&: EndLoc, P&: CollapsedNum); |
| 1430 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1431 | Dir->setLastIteration(Exprs.LastIteration); |
| 1432 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1433 | Dir->setPreCond(Exprs.PreCond); |
| 1434 | Dir->setCond(Exprs.Cond); |
| 1435 | Dir->setInit(Exprs.Init); |
| 1436 | Dir->setInc(Exprs.Inc); |
| 1437 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1438 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1439 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1440 | Dir->setStrideVariable(Exprs.ST); |
| 1441 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1442 | Dir->setNextLowerBound(Exprs.NLB); |
| 1443 | Dir->setNextUpperBound(Exprs.NUB); |
| 1444 | Dir->setNumIterations(Exprs.NumIterations); |
| 1445 | Dir->setCounters(Exprs.Counters); |
| 1446 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1447 | Dir->setInits(Exprs.Inits); |
| 1448 | Dir->setUpdates(Exprs.Updates); |
| 1449 | Dir->setFinals(Exprs.Finals); |
| 1450 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1451 | Dir->setDependentInits(Exprs.DependentInits); |
| 1452 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1453 | Dir->setPreInits(Exprs.PreInits); |
| 1454 | Dir->setHasCancel(HasCancel); |
| 1455 | return Dir; |
| 1456 | } |
| 1457 | |
| 1458 | OMPParallelMasterTaskLoopDirective * |
| 1459 | OMPParallelMasterTaskLoopDirective::CreateEmpty(const ASTContext &C, |
| 1460 | unsigned NumClauses, |
| 1461 | unsigned CollapsedNum, |
| 1462 | EmptyShell) { |
| 1463 | return createEmptyDirective<OMPParallelMasterTaskLoopDirective>( |
| 1464 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1465 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_parallel_master_taskloop), |
| 1466 | P&: CollapsedNum); |
| 1467 | } |
| 1468 | |
| 1469 | OMPParallelMaskedTaskLoopDirective *OMPParallelMaskedTaskLoopDirective::Create( |
| 1470 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1471 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1472 | const HelperExprs &Exprs, bool HasCancel) { |
| 1473 | auto *Dir = createDirective<OMPParallelMaskedTaskLoopDirective>( |
| 1474 | C, Clauses, AssociatedStmt, |
| 1475 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_parallel_masked_taskloop), P&: StartLoc, |
| 1476 | P&: EndLoc, P&: CollapsedNum); |
| 1477 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1478 | Dir->setLastIteration(Exprs.LastIteration); |
| 1479 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1480 | Dir->setPreCond(Exprs.PreCond); |
| 1481 | Dir->setCond(Exprs.Cond); |
| 1482 | Dir->setInit(Exprs.Init); |
| 1483 | Dir->setInc(Exprs.Inc); |
| 1484 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1485 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1486 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1487 | Dir->setStrideVariable(Exprs.ST); |
| 1488 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1489 | Dir->setNextLowerBound(Exprs.NLB); |
| 1490 | Dir->setNextUpperBound(Exprs.NUB); |
| 1491 | Dir->setNumIterations(Exprs.NumIterations); |
| 1492 | Dir->setCounters(Exprs.Counters); |
| 1493 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1494 | Dir->setInits(Exprs.Inits); |
| 1495 | Dir->setUpdates(Exprs.Updates); |
| 1496 | Dir->setFinals(Exprs.Finals); |
| 1497 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1498 | Dir->setDependentInits(Exprs.DependentInits); |
| 1499 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1500 | Dir->setPreInits(Exprs.PreInits); |
| 1501 | Dir->setHasCancel(HasCancel); |
| 1502 | return Dir; |
| 1503 | } |
| 1504 | |
| 1505 | OMPParallelMaskedTaskLoopDirective * |
| 1506 | OMPParallelMaskedTaskLoopDirective::CreateEmpty(const ASTContext &C, |
| 1507 | unsigned NumClauses, |
| 1508 | unsigned CollapsedNum, |
| 1509 | EmptyShell) { |
| 1510 | return createEmptyDirective<OMPParallelMaskedTaskLoopDirective>( |
| 1511 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1512 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_parallel_masked_taskloop), |
| 1513 | P&: CollapsedNum); |
| 1514 | } |
| 1515 | |
| 1516 | OMPParallelMasterTaskLoopSimdDirective * |
| 1517 | OMPParallelMasterTaskLoopSimdDirective::Create( |
| 1518 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1519 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1520 | const HelperExprs &Exprs) { |
| 1521 | auto *Dir = createDirective<OMPParallelMasterTaskLoopSimdDirective>( |
| 1522 | C, Clauses, AssociatedStmt, |
| 1523 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_parallel_master_taskloop_simd), |
| 1524 | P&: StartLoc, P&: EndLoc, P&: CollapsedNum); |
| 1525 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1526 | Dir->setLastIteration(Exprs.LastIteration); |
| 1527 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1528 | Dir->setPreCond(Exprs.PreCond); |
| 1529 | Dir->setCond(Exprs.Cond); |
| 1530 | Dir->setInit(Exprs.Init); |
| 1531 | Dir->setInc(Exprs.Inc); |
| 1532 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1533 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1534 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1535 | Dir->setStrideVariable(Exprs.ST); |
| 1536 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1537 | Dir->setNextLowerBound(Exprs.NLB); |
| 1538 | Dir->setNextUpperBound(Exprs.NUB); |
| 1539 | Dir->setNumIterations(Exprs.NumIterations); |
| 1540 | Dir->setCounters(Exprs.Counters); |
| 1541 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1542 | Dir->setInits(Exprs.Inits); |
| 1543 | Dir->setUpdates(Exprs.Updates); |
| 1544 | Dir->setFinals(Exprs.Finals); |
| 1545 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1546 | Dir->setDependentInits(Exprs.DependentInits); |
| 1547 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1548 | Dir->setPreInits(Exprs.PreInits); |
| 1549 | return Dir; |
| 1550 | } |
| 1551 | |
| 1552 | OMPParallelMasterTaskLoopSimdDirective * |
| 1553 | OMPParallelMasterTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, |
| 1554 | unsigned NumClauses, |
| 1555 | unsigned CollapsedNum, |
| 1556 | EmptyShell) { |
| 1557 | return createEmptyDirective<OMPParallelMasterTaskLoopSimdDirective>( |
| 1558 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1559 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_parallel_master_taskloop_simd), |
| 1560 | P&: CollapsedNum); |
| 1561 | } |
| 1562 | |
| 1563 | OMPParallelMaskedTaskLoopSimdDirective * |
| 1564 | OMPParallelMaskedTaskLoopSimdDirective::Create( |
| 1565 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1566 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1567 | const HelperExprs &Exprs) { |
| 1568 | auto *Dir = createDirective<OMPParallelMaskedTaskLoopSimdDirective>( |
| 1569 | C, Clauses, AssociatedStmt, |
| 1570 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_parallel_masked_taskloop_simd), |
| 1571 | P&: StartLoc, P&: EndLoc, P&: CollapsedNum); |
| 1572 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1573 | Dir->setLastIteration(Exprs.LastIteration); |
| 1574 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1575 | Dir->setPreCond(Exprs.PreCond); |
| 1576 | Dir->setCond(Exprs.Cond); |
| 1577 | Dir->setInit(Exprs.Init); |
| 1578 | Dir->setInc(Exprs.Inc); |
| 1579 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1580 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1581 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1582 | Dir->setStrideVariable(Exprs.ST); |
| 1583 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1584 | Dir->setNextLowerBound(Exprs.NLB); |
| 1585 | Dir->setNextUpperBound(Exprs.NUB); |
| 1586 | Dir->setNumIterations(Exprs.NumIterations); |
| 1587 | Dir->setCounters(Exprs.Counters); |
| 1588 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1589 | Dir->setInits(Exprs.Inits); |
| 1590 | Dir->setUpdates(Exprs.Updates); |
| 1591 | Dir->setFinals(Exprs.Finals); |
| 1592 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1593 | Dir->setDependentInits(Exprs.DependentInits); |
| 1594 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1595 | Dir->setPreInits(Exprs.PreInits); |
| 1596 | return Dir; |
| 1597 | } |
| 1598 | |
| 1599 | OMPParallelMaskedTaskLoopSimdDirective * |
| 1600 | OMPParallelMaskedTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, |
| 1601 | unsigned NumClauses, |
| 1602 | unsigned CollapsedNum, |
| 1603 | EmptyShell) { |
| 1604 | return createEmptyDirective<OMPParallelMaskedTaskLoopSimdDirective>( |
| 1605 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1606 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_parallel_masked_taskloop_simd), |
| 1607 | P&: CollapsedNum); |
| 1608 | } |
| 1609 | |
| 1610 | OMPDistributeDirective * |
| 1611 | OMPDistributeDirective::Create(const ASTContext &C, SourceLocation StartLoc, |
| 1612 | SourceLocation EndLoc, unsigned CollapsedNum, |
| 1613 | ArrayRef<OMPClause *> Clauses, |
| 1614 | Stmt *AssociatedStmt, const HelperExprs &Exprs) { |
| 1615 | auto *Dir = createDirective<OMPDistributeDirective>( |
| 1616 | C, Clauses, AssociatedStmt, |
| 1617 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_distribute), P&: StartLoc, P&: EndLoc, |
| 1618 | P&: CollapsedNum); |
| 1619 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1620 | Dir->setLastIteration(Exprs.LastIteration); |
| 1621 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1622 | Dir->setPreCond(Exprs.PreCond); |
| 1623 | Dir->setCond(Exprs.Cond); |
| 1624 | Dir->setInit(Exprs.Init); |
| 1625 | Dir->setInc(Exprs.Inc); |
| 1626 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1627 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1628 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1629 | Dir->setStrideVariable(Exprs.ST); |
| 1630 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1631 | Dir->setNextLowerBound(Exprs.NLB); |
| 1632 | Dir->setNextUpperBound(Exprs.NUB); |
| 1633 | Dir->setNumIterations(Exprs.NumIterations); |
| 1634 | Dir->setCounters(Exprs.Counters); |
| 1635 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1636 | Dir->setInits(Exprs.Inits); |
| 1637 | Dir->setUpdates(Exprs.Updates); |
| 1638 | Dir->setFinals(Exprs.Finals); |
| 1639 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1640 | Dir->setDependentInits(Exprs.DependentInits); |
| 1641 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1642 | Dir->setPreInits(Exprs.PreInits); |
| 1643 | return Dir; |
| 1644 | } |
| 1645 | |
| 1646 | OMPDistributeDirective * |
| 1647 | OMPDistributeDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, |
| 1648 | unsigned CollapsedNum, EmptyShell) { |
| 1649 | return createEmptyDirective<OMPDistributeDirective>( |
| 1650 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1651 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_distribute), P&: CollapsedNum); |
| 1652 | } |
| 1653 | |
| 1654 | OMPTargetUpdateDirective *OMPTargetUpdateDirective::Create( |
| 1655 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1656 | ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { |
| 1657 | return createDirective<OMPTargetUpdateDirective>(C, Clauses, AssociatedStmt, |
| 1658 | /*NumChildren=*/0, P&: StartLoc, |
| 1659 | P&: EndLoc); |
| 1660 | } |
| 1661 | |
| 1662 | OMPTargetUpdateDirective * |
| 1663 | OMPTargetUpdateDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, |
| 1664 | EmptyShell) { |
| 1665 | return createEmptyDirective<OMPTargetUpdateDirective>( |
| 1666 | C, NumClauses, /*HasAssociatedStmt=*/true); |
| 1667 | } |
| 1668 | |
| 1669 | OMPDistributeParallelForDirective *OMPDistributeParallelForDirective::Create( |
| 1670 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1671 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1672 | const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) { |
| 1673 | auto *Dir = createDirective<OMPDistributeParallelForDirective>( |
| 1674 | C, Clauses, AssociatedStmt, |
| 1675 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_distribute_parallel_for) + 1, P&: StartLoc, |
| 1676 | P&: EndLoc, P&: CollapsedNum); |
| 1677 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1678 | Dir->setLastIteration(Exprs.LastIteration); |
| 1679 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1680 | Dir->setPreCond(Exprs.PreCond); |
| 1681 | Dir->setCond(Exprs.Cond); |
| 1682 | Dir->setInit(Exprs.Init); |
| 1683 | Dir->setInc(Exprs.Inc); |
| 1684 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1685 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1686 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1687 | Dir->setStrideVariable(Exprs.ST); |
| 1688 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1689 | Dir->setNextLowerBound(Exprs.NLB); |
| 1690 | Dir->setNextUpperBound(Exprs.NUB); |
| 1691 | Dir->setNumIterations(Exprs.NumIterations); |
| 1692 | Dir->setPrevLowerBoundVariable(Exprs.PrevLB); |
| 1693 | Dir->setPrevUpperBoundVariable(Exprs.PrevUB); |
| 1694 | Dir->setDistInc(Exprs.DistInc); |
| 1695 | Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); |
| 1696 | Dir->setCounters(Exprs.Counters); |
| 1697 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1698 | Dir->setInits(Exprs.Inits); |
| 1699 | Dir->setUpdates(Exprs.Updates); |
| 1700 | Dir->setFinals(Exprs.Finals); |
| 1701 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1702 | Dir->setDependentInits(Exprs.DependentInits); |
| 1703 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1704 | Dir->setPreInits(Exprs.PreInits); |
| 1705 | Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); |
| 1706 | Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); |
| 1707 | Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); |
| 1708 | Dir->setCombinedInit(Exprs.DistCombinedFields.Init); |
| 1709 | Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); |
| 1710 | Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); |
| 1711 | Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); |
| 1712 | Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); |
| 1713 | Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); |
| 1714 | Dir->setTaskReductionRefExpr(TaskRedRef); |
| 1715 | Dir->HasCancel = HasCancel; |
| 1716 | return Dir; |
| 1717 | } |
| 1718 | |
| 1719 | OMPDistributeParallelForDirective * |
| 1720 | OMPDistributeParallelForDirective::CreateEmpty(const ASTContext &C, |
| 1721 | unsigned NumClauses, |
| 1722 | unsigned CollapsedNum, |
| 1723 | EmptyShell) { |
| 1724 | return createEmptyDirective<OMPDistributeParallelForDirective>( |
| 1725 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1726 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_distribute_parallel_for) + 1, |
| 1727 | P&: CollapsedNum); |
| 1728 | } |
| 1729 | |
| 1730 | OMPDistributeParallelForSimdDirective * |
| 1731 | OMPDistributeParallelForSimdDirective::Create( |
| 1732 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1733 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1734 | const HelperExprs &Exprs) { |
| 1735 | auto *Dir = createDirective<OMPDistributeParallelForSimdDirective>( |
| 1736 | C, Clauses, AssociatedStmt, |
| 1737 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_distribute_parallel_for_simd), |
| 1738 | P&: StartLoc, P&: EndLoc, P&: CollapsedNum); |
| 1739 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1740 | Dir->setLastIteration(Exprs.LastIteration); |
| 1741 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1742 | Dir->setPreCond(Exprs.PreCond); |
| 1743 | Dir->setCond(Exprs.Cond); |
| 1744 | Dir->setInit(Exprs.Init); |
| 1745 | Dir->setInc(Exprs.Inc); |
| 1746 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1747 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1748 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1749 | Dir->setStrideVariable(Exprs.ST); |
| 1750 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1751 | Dir->setNextLowerBound(Exprs.NLB); |
| 1752 | Dir->setNextUpperBound(Exprs.NUB); |
| 1753 | Dir->setNumIterations(Exprs.NumIterations); |
| 1754 | Dir->setPrevLowerBoundVariable(Exprs.PrevLB); |
| 1755 | Dir->setPrevUpperBoundVariable(Exprs.PrevUB); |
| 1756 | Dir->setDistInc(Exprs.DistInc); |
| 1757 | Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); |
| 1758 | Dir->setCounters(Exprs.Counters); |
| 1759 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1760 | Dir->setInits(Exprs.Inits); |
| 1761 | Dir->setUpdates(Exprs.Updates); |
| 1762 | Dir->setFinals(Exprs.Finals); |
| 1763 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1764 | Dir->setDependentInits(Exprs.DependentInits); |
| 1765 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1766 | Dir->setPreInits(Exprs.PreInits); |
| 1767 | Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); |
| 1768 | Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); |
| 1769 | Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); |
| 1770 | Dir->setCombinedInit(Exprs.DistCombinedFields.Init); |
| 1771 | Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); |
| 1772 | Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); |
| 1773 | Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); |
| 1774 | Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); |
| 1775 | Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); |
| 1776 | return Dir; |
| 1777 | } |
| 1778 | |
| 1779 | OMPDistributeParallelForSimdDirective * |
| 1780 | OMPDistributeParallelForSimdDirective::CreateEmpty(const ASTContext &C, |
| 1781 | unsigned NumClauses, |
| 1782 | unsigned CollapsedNum, |
| 1783 | EmptyShell) { |
| 1784 | return createEmptyDirective<OMPDistributeParallelForSimdDirective>( |
| 1785 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1786 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_distribute_parallel_for_simd), |
| 1787 | P&: CollapsedNum); |
| 1788 | } |
| 1789 | |
| 1790 | OMPDistributeSimdDirective *OMPDistributeSimdDirective::Create( |
| 1791 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1792 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1793 | const HelperExprs &Exprs) { |
| 1794 | auto *Dir = createDirective<OMPDistributeSimdDirective>( |
| 1795 | C, Clauses, AssociatedStmt, |
| 1796 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_distribute_simd), P&: StartLoc, P&: EndLoc, |
| 1797 | P&: CollapsedNum); |
| 1798 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1799 | Dir->setLastIteration(Exprs.LastIteration); |
| 1800 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1801 | Dir->setPreCond(Exprs.PreCond); |
| 1802 | Dir->setCond(Exprs.Cond); |
| 1803 | Dir->setInit(Exprs.Init); |
| 1804 | Dir->setInc(Exprs.Inc); |
| 1805 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1806 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1807 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1808 | Dir->setStrideVariable(Exprs.ST); |
| 1809 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1810 | Dir->setNextLowerBound(Exprs.NLB); |
| 1811 | Dir->setNextUpperBound(Exprs.NUB); |
| 1812 | Dir->setNumIterations(Exprs.NumIterations); |
| 1813 | Dir->setCounters(Exprs.Counters); |
| 1814 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1815 | Dir->setInits(Exprs.Inits); |
| 1816 | Dir->setUpdates(Exprs.Updates); |
| 1817 | Dir->setFinals(Exprs.Finals); |
| 1818 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1819 | Dir->setDependentInits(Exprs.DependentInits); |
| 1820 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1821 | Dir->setPreInits(Exprs.PreInits); |
| 1822 | return Dir; |
| 1823 | } |
| 1824 | |
| 1825 | OMPDistributeSimdDirective * |
| 1826 | OMPDistributeSimdDirective::CreateEmpty(const ASTContext &C, |
| 1827 | unsigned NumClauses, |
| 1828 | unsigned CollapsedNum, EmptyShell) { |
| 1829 | return createEmptyDirective<OMPDistributeSimdDirective>( |
| 1830 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1831 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_distribute_simd), P&: CollapsedNum); |
| 1832 | } |
| 1833 | |
| 1834 | OMPTargetParallelForSimdDirective *OMPTargetParallelForSimdDirective::Create( |
| 1835 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1836 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1837 | const HelperExprs &Exprs) { |
| 1838 | auto *Dir = createDirective<OMPTargetParallelForSimdDirective>( |
| 1839 | C, Clauses, AssociatedStmt, |
| 1840 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_target_parallel_for_simd), P&: StartLoc, |
| 1841 | P&: EndLoc, P&: CollapsedNum); |
| 1842 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1843 | Dir->setLastIteration(Exprs.LastIteration); |
| 1844 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1845 | Dir->setPreCond(Exprs.PreCond); |
| 1846 | Dir->setCond(Exprs.Cond); |
| 1847 | Dir->setInit(Exprs.Init); |
| 1848 | Dir->setInc(Exprs.Inc); |
| 1849 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1850 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1851 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1852 | Dir->setStrideVariable(Exprs.ST); |
| 1853 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1854 | Dir->setNextLowerBound(Exprs.NLB); |
| 1855 | Dir->setNextUpperBound(Exprs.NUB); |
| 1856 | Dir->setNumIterations(Exprs.NumIterations); |
| 1857 | Dir->setCounters(Exprs.Counters); |
| 1858 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1859 | Dir->setInits(Exprs.Inits); |
| 1860 | Dir->setUpdates(Exprs.Updates); |
| 1861 | Dir->setFinals(Exprs.Finals); |
| 1862 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1863 | Dir->setDependentInits(Exprs.DependentInits); |
| 1864 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1865 | Dir->setPreInits(Exprs.PreInits); |
| 1866 | return Dir; |
| 1867 | } |
| 1868 | |
| 1869 | OMPTargetParallelForSimdDirective * |
| 1870 | OMPTargetParallelForSimdDirective::CreateEmpty(const ASTContext &C, |
| 1871 | unsigned NumClauses, |
| 1872 | unsigned CollapsedNum, |
| 1873 | EmptyShell) { |
| 1874 | return createEmptyDirective<OMPTargetParallelForSimdDirective>( |
| 1875 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1876 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_target_parallel_for_simd), |
| 1877 | P&: CollapsedNum); |
| 1878 | } |
| 1879 | |
| 1880 | OMPTargetSimdDirective * |
| 1881 | OMPTargetSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc, |
| 1882 | SourceLocation EndLoc, unsigned CollapsedNum, |
| 1883 | ArrayRef<OMPClause *> Clauses, |
| 1884 | Stmt *AssociatedStmt, const HelperExprs &Exprs) { |
| 1885 | auto *Dir = createDirective<OMPTargetSimdDirective>( |
| 1886 | C, Clauses, AssociatedStmt, |
| 1887 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_target_simd), P&: StartLoc, P&: EndLoc, |
| 1888 | P&: CollapsedNum); |
| 1889 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1890 | Dir->setLastIteration(Exprs.LastIteration); |
| 1891 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1892 | Dir->setPreCond(Exprs.PreCond); |
| 1893 | Dir->setCond(Exprs.Cond); |
| 1894 | Dir->setInit(Exprs.Init); |
| 1895 | Dir->setInc(Exprs.Inc); |
| 1896 | Dir->setCounters(Exprs.Counters); |
| 1897 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1898 | Dir->setInits(Exprs.Inits); |
| 1899 | Dir->setUpdates(Exprs.Updates); |
| 1900 | Dir->setFinals(Exprs.Finals); |
| 1901 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1902 | Dir->setDependentInits(Exprs.DependentInits); |
| 1903 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1904 | Dir->setPreInits(Exprs.PreInits); |
| 1905 | return Dir; |
| 1906 | } |
| 1907 | |
| 1908 | OMPTargetSimdDirective * |
| 1909 | OMPTargetSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, |
| 1910 | unsigned CollapsedNum, EmptyShell) { |
| 1911 | return createEmptyDirective<OMPTargetSimdDirective>( |
| 1912 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1913 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_target_simd), P&: CollapsedNum); |
| 1914 | } |
| 1915 | |
| 1916 | OMPTeamsDistributeDirective *OMPTeamsDistributeDirective::Create( |
| 1917 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1918 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1919 | const HelperExprs &Exprs) { |
| 1920 | auto *Dir = createDirective<OMPTeamsDistributeDirective>( |
| 1921 | C, Clauses, AssociatedStmt, |
| 1922 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_teams_distribute), P&: StartLoc, P&: EndLoc, |
| 1923 | P&: CollapsedNum); |
| 1924 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1925 | Dir->setLastIteration(Exprs.LastIteration); |
| 1926 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1927 | Dir->setPreCond(Exprs.PreCond); |
| 1928 | Dir->setCond(Exprs.Cond); |
| 1929 | Dir->setInit(Exprs.Init); |
| 1930 | Dir->setInc(Exprs.Inc); |
| 1931 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1932 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1933 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1934 | Dir->setStrideVariable(Exprs.ST); |
| 1935 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1936 | Dir->setNextLowerBound(Exprs.NLB); |
| 1937 | Dir->setNextUpperBound(Exprs.NUB); |
| 1938 | Dir->setNumIterations(Exprs.NumIterations); |
| 1939 | Dir->setCounters(Exprs.Counters); |
| 1940 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1941 | Dir->setInits(Exprs.Inits); |
| 1942 | Dir->setUpdates(Exprs.Updates); |
| 1943 | Dir->setFinals(Exprs.Finals); |
| 1944 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1945 | Dir->setDependentInits(Exprs.DependentInits); |
| 1946 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1947 | Dir->setPreInits(Exprs.PreInits); |
| 1948 | return Dir; |
| 1949 | } |
| 1950 | |
| 1951 | OMPTeamsDistributeDirective * |
| 1952 | OMPTeamsDistributeDirective::CreateEmpty(const ASTContext &C, |
| 1953 | unsigned NumClauses, |
| 1954 | unsigned CollapsedNum, EmptyShell) { |
| 1955 | return createEmptyDirective<OMPTeamsDistributeDirective>( |
| 1956 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 1957 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_teams_distribute), P&: CollapsedNum); |
| 1958 | } |
| 1959 | |
| 1960 | OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::Create( |
| 1961 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 1962 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 1963 | const HelperExprs &Exprs) { |
| 1964 | auto *Dir = createDirective<OMPTeamsDistributeSimdDirective>( |
| 1965 | C, Clauses, AssociatedStmt, |
| 1966 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_teams_distribute_simd), P&: StartLoc, |
| 1967 | P&: EndLoc, P&: CollapsedNum); |
| 1968 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 1969 | Dir->setLastIteration(Exprs.LastIteration); |
| 1970 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 1971 | Dir->setPreCond(Exprs.PreCond); |
| 1972 | Dir->setCond(Exprs.Cond); |
| 1973 | Dir->setInit(Exprs.Init); |
| 1974 | Dir->setInc(Exprs.Inc); |
| 1975 | Dir->setIsLastIterVariable(Exprs.IL); |
| 1976 | Dir->setLowerBoundVariable(Exprs.LB); |
| 1977 | Dir->setUpperBoundVariable(Exprs.UB); |
| 1978 | Dir->setStrideVariable(Exprs.ST); |
| 1979 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 1980 | Dir->setNextLowerBound(Exprs.NLB); |
| 1981 | Dir->setNextUpperBound(Exprs.NUB); |
| 1982 | Dir->setNumIterations(Exprs.NumIterations); |
| 1983 | Dir->setCounters(Exprs.Counters); |
| 1984 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 1985 | Dir->setInits(Exprs.Inits); |
| 1986 | Dir->setUpdates(Exprs.Updates); |
| 1987 | Dir->setFinals(Exprs.Finals); |
| 1988 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 1989 | Dir->setDependentInits(Exprs.DependentInits); |
| 1990 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 1991 | Dir->setPreInits(Exprs.PreInits); |
| 1992 | return Dir; |
| 1993 | } |
| 1994 | |
| 1995 | OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::CreateEmpty( |
| 1996 | const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, |
| 1997 | EmptyShell) { |
| 1998 | return createEmptyDirective<OMPTeamsDistributeSimdDirective>( |
| 1999 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 2000 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_teams_distribute_simd), P&: CollapsedNum); |
| 2001 | } |
| 2002 | |
| 2003 | OMPTeamsDistributeParallelForSimdDirective * |
| 2004 | OMPTeamsDistributeParallelForSimdDirective::Create( |
| 2005 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 2006 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 2007 | const HelperExprs &Exprs) { |
| 2008 | auto *Dir = createDirective<OMPTeamsDistributeParallelForSimdDirective>( |
| 2009 | C, Clauses, AssociatedStmt, |
| 2010 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_teams_distribute_parallel_for_simd), |
| 2011 | P&: StartLoc, P&: EndLoc, P&: CollapsedNum); |
| 2012 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 2013 | Dir->setLastIteration(Exprs.LastIteration); |
| 2014 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 2015 | Dir->setPreCond(Exprs.PreCond); |
| 2016 | Dir->setCond(Exprs.Cond); |
| 2017 | Dir->setInit(Exprs.Init); |
| 2018 | Dir->setInc(Exprs.Inc); |
| 2019 | Dir->setIsLastIterVariable(Exprs.IL); |
| 2020 | Dir->setLowerBoundVariable(Exprs.LB); |
| 2021 | Dir->setUpperBoundVariable(Exprs.UB); |
| 2022 | Dir->setStrideVariable(Exprs.ST); |
| 2023 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 2024 | Dir->setNextLowerBound(Exprs.NLB); |
| 2025 | Dir->setNextUpperBound(Exprs.NUB); |
| 2026 | Dir->setNumIterations(Exprs.NumIterations); |
| 2027 | Dir->setPrevLowerBoundVariable(Exprs.PrevLB); |
| 2028 | Dir->setPrevUpperBoundVariable(Exprs.PrevUB); |
| 2029 | Dir->setDistInc(Exprs.DistInc); |
| 2030 | Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); |
| 2031 | Dir->setCounters(Exprs.Counters); |
| 2032 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 2033 | Dir->setInits(Exprs.Inits); |
| 2034 | Dir->setUpdates(Exprs.Updates); |
| 2035 | Dir->setFinals(Exprs.Finals); |
| 2036 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 2037 | Dir->setDependentInits(Exprs.DependentInits); |
| 2038 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 2039 | Dir->setPreInits(Exprs.PreInits); |
| 2040 | Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); |
| 2041 | Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); |
| 2042 | Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); |
| 2043 | Dir->setCombinedInit(Exprs.DistCombinedFields.Init); |
| 2044 | Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); |
| 2045 | Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); |
| 2046 | Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); |
| 2047 | Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); |
| 2048 | Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); |
| 2049 | return Dir; |
| 2050 | } |
| 2051 | |
| 2052 | OMPTeamsDistributeParallelForSimdDirective * |
| 2053 | OMPTeamsDistributeParallelForSimdDirective::CreateEmpty(const ASTContext &C, |
| 2054 | unsigned NumClauses, |
| 2055 | unsigned CollapsedNum, |
| 2056 | EmptyShell) { |
| 2057 | return createEmptyDirective<OMPTeamsDistributeParallelForSimdDirective>( |
| 2058 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 2059 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_teams_distribute_parallel_for_simd), |
| 2060 | P&: CollapsedNum); |
| 2061 | } |
| 2062 | |
| 2063 | OMPTeamsDistributeParallelForDirective * |
| 2064 | OMPTeamsDistributeParallelForDirective::Create( |
| 2065 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 2066 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 2067 | const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) { |
| 2068 | auto *Dir = createDirective<OMPTeamsDistributeParallelForDirective>( |
| 2069 | C, Clauses, AssociatedStmt, |
| 2070 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_teams_distribute_parallel_for) + 1, |
| 2071 | P&: StartLoc, P&: EndLoc, P&: CollapsedNum); |
| 2072 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 2073 | Dir->setLastIteration(Exprs.LastIteration); |
| 2074 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 2075 | Dir->setPreCond(Exprs.PreCond); |
| 2076 | Dir->setCond(Exprs.Cond); |
| 2077 | Dir->setInit(Exprs.Init); |
| 2078 | Dir->setInc(Exprs.Inc); |
| 2079 | Dir->setIsLastIterVariable(Exprs.IL); |
| 2080 | Dir->setLowerBoundVariable(Exprs.LB); |
| 2081 | Dir->setUpperBoundVariable(Exprs.UB); |
| 2082 | Dir->setStrideVariable(Exprs.ST); |
| 2083 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 2084 | Dir->setNextLowerBound(Exprs.NLB); |
| 2085 | Dir->setNextUpperBound(Exprs.NUB); |
| 2086 | Dir->setNumIterations(Exprs.NumIterations); |
| 2087 | Dir->setPrevLowerBoundVariable(Exprs.PrevLB); |
| 2088 | Dir->setPrevUpperBoundVariable(Exprs.PrevUB); |
| 2089 | Dir->setDistInc(Exprs.DistInc); |
| 2090 | Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); |
| 2091 | Dir->setCounters(Exprs.Counters); |
| 2092 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 2093 | Dir->setInits(Exprs.Inits); |
| 2094 | Dir->setUpdates(Exprs.Updates); |
| 2095 | Dir->setFinals(Exprs.Finals); |
| 2096 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 2097 | Dir->setDependentInits(Exprs.DependentInits); |
| 2098 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 2099 | Dir->setPreInits(Exprs.PreInits); |
| 2100 | Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); |
| 2101 | Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); |
| 2102 | Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); |
| 2103 | Dir->setCombinedInit(Exprs.DistCombinedFields.Init); |
| 2104 | Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); |
| 2105 | Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); |
| 2106 | Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); |
| 2107 | Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); |
| 2108 | Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); |
| 2109 | Dir->setTaskReductionRefExpr(TaskRedRef); |
| 2110 | Dir->HasCancel = HasCancel; |
| 2111 | return Dir; |
| 2112 | } |
| 2113 | |
| 2114 | OMPTeamsDistributeParallelForDirective * |
| 2115 | OMPTeamsDistributeParallelForDirective::CreateEmpty(const ASTContext &C, |
| 2116 | unsigned NumClauses, |
| 2117 | unsigned CollapsedNum, |
| 2118 | EmptyShell) { |
| 2119 | return createEmptyDirective<OMPTeamsDistributeParallelForDirective>( |
| 2120 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 2121 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_teams_distribute_parallel_for) + 1, |
| 2122 | P&: CollapsedNum); |
| 2123 | } |
| 2124 | |
| 2125 | OMPTargetTeamsDirective *OMPTargetTeamsDirective::Create( |
| 2126 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 2127 | ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { |
| 2128 | return createDirective<OMPTargetTeamsDirective>(C, Clauses, AssociatedStmt, |
| 2129 | /*NumChildren=*/0, P&: StartLoc, |
| 2130 | P&: EndLoc); |
| 2131 | } |
| 2132 | |
| 2133 | OMPTargetTeamsDirective * |
| 2134 | OMPTargetTeamsDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, |
| 2135 | EmptyShell) { |
| 2136 | return createEmptyDirective<OMPTargetTeamsDirective>( |
| 2137 | C, NumClauses, /*HasAssociatedStmt=*/true); |
| 2138 | } |
| 2139 | |
| 2140 | OMPTargetTeamsDistributeDirective *OMPTargetTeamsDistributeDirective::Create( |
| 2141 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 2142 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 2143 | const HelperExprs &Exprs) { |
| 2144 | auto *Dir = createDirective<OMPTargetTeamsDistributeDirective>( |
| 2145 | C, Clauses, AssociatedStmt, |
| 2146 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_target_teams_distribute), P&: StartLoc, |
| 2147 | P&: EndLoc, P&: CollapsedNum); |
| 2148 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 2149 | Dir->setLastIteration(Exprs.LastIteration); |
| 2150 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 2151 | Dir->setPreCond(Exprs.PreCond); |
| 2152 | Dir->setCond(Exprs.Cond); |
| 2153 | Dir->setInit(Exprs.Init); |
| 2154 | Dir->setInc(Exprs.Inc); |
| 2155 | Dir->setIsLastIterVariable(Exprs.IL); |
| 2156 | Dir->setLowerBoundVariable(Exprs.LB); |
| 2157 | Dir->setUpperBoundVariable(Exprs.UB); |
| 2158 | Dir->setStrideVariable(Exprs.ST); |
| 2159 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 2160 | Dir->setNextLowerBound(Exprs.NLB); |
| 2161 | Dir->setNextUpperBound(Exprs.NUB); |
| 2162 | Dir->setNumIterations(Exprs.NumIterations); |
| 2163 | Dir->setCounters(Exprs.Counters); |
| 2164 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 2165 | Dir->setInits(Exprs.Inits); |
| 2166 | Dir->setUpdates(Exprs.Updates); |
| 2167 | Dir->setFinals(Exprs.Finals); |
| 2168 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 2169 | Dir->setDependentInits(Exprs.DependentInits); |
| 2170 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 2171 | Dir->setPreInits(Exprs.PreInits); |
| 2172 | return Dir; |
| 2173 | } |
| 2174 | |
| 2175 | OMPTargetTeamsDistributeDirective * |
| 2176 | OMPTargetTeamsDistributeDirective::CreateEmpty(const ASTContext &C, |
| 2177 | unsigned NumClauses, |
| 2178 | unsigned CollapsedNum, |
| 2179 | EmptyShell) { |
| 2180 | return createEmptyDirective<OMPTargetTeamsDistributeDirective>( |
| 2181 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 2182 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_target_teams_distribute), |
| 2183 | P&: CollapsedNum); |
| 2184 | } |
| 2185 | |
| 2186 | OMPTargetTeamsDistributeParallelForDirective * |
| 2187 | OMPTargetTeamsDistributeParallelForDirective::Create( |
| 2188 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 2189 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 2190 | const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) { |
| 2191 | auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForDirective>( |
| 2192 | C, Clauses, AssociatedStmt, |
| 2193 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_target_teams_distribute_parallel_for) + |
| 2194 | 1, |
| 2195 | P&: StartLoc, P&: EndLoc, P&: CollapsedNum); |
| 2196 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 2197 | Dir->setLastIteration(Exprs.LastIteration); |
| 2198 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 2199 | Dir->setPreCond(Exprs.PreCond); |
| 2200 | Dir->setCond(Exprs.Cond); |
| 2201 | Dir->setInit(Exprs.Init); |
| 2202 | Dir->setInc(Exprs.Inc); |
| 2203 | Dir->setIsLastIterVariable(Exprs.IL); |
| 2204 | Dir->setLowerBoundVariable(Exprs.LB); |
| 2205 | Dir->setUpperBoundVariable(Exprs.UB); |
| 2206 | Dir->setStrideVariable(Exprs.ST); |
| 2207 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 2208 | Dir->setNextLowerBound(Exprs.NLB); |
| 2209 | Dir->setNextUpperBound(Exprs.NUB); |
| 2210 | Dir->setNumIterations(Exprs.NumIterations); |
| 2211 | Dir->setPrevLowerBoundVariable(Exprs.PrevLB); |
| 2212 | Dir->setPrevUpperBoundVariable(Exprs.PrevUB); |
| 2213 | Dir->setDistInc(Exprs.DistInc); |
| 2214 | Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); |
| 2215 | Dir->setCounters(Exprs.Counters); |
| 2216 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 2217 | Dir->setInits(Exprs.Inits); |
| 2218 | Dir->setUpdates(Exprs.Updates); |
| 2219 | Dir->setFinals(Exprs.Finals); |
| 2220 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 2221 | Dir->setDependentInits(Exprs.DependentInits); |
| 2222 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 2223 | Dir->setPreInits(Exprs.PreInits); |
| 2224 | Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); |
| 2225 | Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); |
| 2226 | Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); |
| 2227 | Dir->setCombinedInit(Exprs.DistCombinedFields.Init); |
| 2228 | Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); |
| 2229 | Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); |
| 2230 | Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); |
| 2231 | Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); |
| 2232 | Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); |
| 2233 | Dir->setTaskReductionRefExpr(TaskRedRef); |
| 2234 | Dir->HasCancel = HasCancel; |
| 2235 | return Dir; |
| 2236 | } |
| 2237 | |
| 2238 | OMPTargetTeamsDistributeParallelForDirective * |
| 2239 | OMPTargetTeamsDistributeParallelForDirective::CreateEmpty(const ASTContext &C, |
| 2240 | unsigned NumClauses, |
| 2241 | unsigned CollapsedNum, |
| 2242 | EmptyShell) { |
| 2243 | return createEmptyDirective<OMPTargetTeamsDistributeParallelForDirective>( |
| 2244 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 2245 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_target_teams_distribute_parallel_for) + |
| 2246 | 1, |
| 2247 | P&: CollapsedNum); |
| 2248 | } |
| 2249 | |
| 2250 | OMPTargetTeamsDistributeParallelForSimdDirective * |
| 2251 | OMPTargetTeamsDistributeParallelForSimdDirective::Create( |
| 2252 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 2253 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 2254 | const HelperExprs &Exprs) { |
| 2255 | auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForSimdDirective>( |
| 2256 | C, Clauses, AssociatedStmt, |
| 2257 | NumChildren: numLoopChildren(CollapsedNum, |
| 2258 | Kind: OMPD_target_teams_distribute_parallel_for_simd), |
| 2259 | P&: StartLoc, P&: EndLoc, P&: CollapsedNum); |
| 2260 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 2261 | Dir->setLastIteration(Exprs.LastIteration); |
| 2262 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 2263 | Dir->setPreCond(Exprs.PreCond); |
| 2264 | Dir->setCond(Exprs.Cond); |
| 2265 | Dir->setInit(Exprs.Init); |
| 2266 | Dir->setInc(Exprs.Inc); |
| 2267 | Dir->setIsLastIterVariable(Exprs.IL); |
| 2268 | Dir->setLowerBoundVariable(Exprs.LB); |
| 2269 | Dir->setUpperBoundVariable(Exprs.UB); |
| 2270 | Dir->setStrideVariable(Exprs.ST); |
| 2271 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 2272 | Dir->setNextLowerBound(Exprs.NLB); |
| 2273 | Dir->setNextUpperBound(Exprs.NUB); |
| 2274 | Dir->setNumIterations(Exprs.NumIterations); |
| 2275 | Dir->setPrevLowerBoundVariable(Exprs.PrevLB); |
| 2276 | Dir->setPrevUpperBoundVariable(Exprs.PrevUB); |
| 2277 | Dir->setDistInc(Exprs.DistInc); |
| 2278 | Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); |
| 2279 | Dir->setCounters(Exprs.Counters); |
| 2280 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 2281 | Dir->setInits(Exprs.Inits); |
| 2282 | Dir->setUpdates(Exprs.Updates); |
| 2283 | Dir->setFinals(Exprs.Finals); |
| 2284 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 2285 | Dir->setDependentInits(Exprs.DependentInits); |
| 2286 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 2287 | Dir->setPreInits(Exprs.PreInits); |
| 2288 | Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); |
| 2289 | Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); |
| 2290 | Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); |
| 2291 | Dir->setCombinedInit(Exprs.DistCombinedFields.Init); |
| 2292 | Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); |
| 2293 | Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); |
| 2294 | Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); |
| 2295 | Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); |
| 2296 | Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); |
| 2297 | return Dir; |
| 2298 | } |
| 2299 | |
| 2300 | OMPTargetTeamsDistributeParallelForSimdDirective * |
| 2301 | OMPTargetTeamsDistributeParallelForSimdDirective::CreateEmpty( |
| 2302 | const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, |
| 2303 | EmptyShell) { |
| 2304 | return createEmptyDirective<OMPTargetTeamsDistributeParallelForSimdDirective>( |
| 2305 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 2306 | NumChildren: numLoopChildren(CollapsedNum, |
| 2307 | Kind: OMPD_target_teams_distribute_parallel_for_simd), |
| 2308 | P&: CollapsedNum); |
| 2309 | } |
| 2310 | |
| 2311 | OMPTargetTeamsDistributeSimdDirective * |
| 2312 | OMPTargetTeamsDistributeSimdDirective::Create( |
| 2313 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 2314 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 2315 | const HelperExprs &Exprs) { |
| 2316 | auto *Dir = createDirective<OMPTargetTeamsDistributeSimdDirective>( |
| 2317 | C, Clauses, AssociatedStmt, |
| 2318 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_target_teams_distribute_simd), |
| 2319 | P&: StartLoc, P&: EndLoc, P&: CollapsedNum); |
| 2320 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 2321 | Dir->setLastIteration(Exprs.LastIteration); |
| 2322 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 2323 | Dir->setPreCond(Exprs.PreCond); |
| 2324 | Dir->setCond(Exprs.Cond); |
| 2325 | Dir->setInit(Exprs.Init); |
| 2326 | Dir->setInc(Exprs.Inc); |
| 2327 | Dir->setIsLastIterVariable(Exprs.IL); |
| 2328 | Dir->setLowerBoundVariable(Exprs.LB); |
| 2329 | Dir->setUpperBoundVariable(Exprs.UB); |
| 2330 | Dir->setStrideVariable(Exprs.ST); |
| 2331 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 2332 | Dir->setNextLowerBound(Exprs.NLB); |
| 2333 | Dir->setNextUpperBound(Exprs.NUB); |
| 2334 | Dir->setNumIterations(Exprs.NumIterations); |
| 2335 | Dir->setCounters(Exprs.Counters); |
| 2336 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 2337 | Dir->setInits(Exprs.Inits); |
| 2338 | Dir->setUpdates(Exprs.Updates); |
| 2339 | Dir->setFinals(Exprs.Finals); |
| 2340 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 2341 | Dir->setDependentInits(Exprs.DependentInits); |
| 2342 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 2343 | Dir->setPreInits(Exprs.PreInits); |
| 2344 | return Dir; |
| 2345 | } |
| 2346 | |
| 2347 | OMPTargetTeamsDistributeSimdDirective * |
| 2348 | OMPTargetTeamsDistributeSimdDirective::CreateEmpty(const ASTContext &C, |
| 2349 | unsigned NumClauses, |
| 2350 | unsigned CollapsedNum, |
| 2351 | EmptyShell) { |
| 2352 | return createEmptyDirective<OMPTargetTeamsDistributeSimdDirective>( |
| 2353 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 2354 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_target_teams_distribute_simd), |
| 2355 | P&: CollapsedNum); |
| 2356 | } |
| 2357 | |
| 2358 | OMPInteropDirective * |
| 2359 | OMPInteropDirective::Create(const ASTContext &C, SourceLocation StartLoc, |
| 2360 | SourceLocation EndLoc, |
| 2361 | ArrayRef<OMPClause *> Clauses) { |
| 2362 | return createDirective<OMPInteropDirective>( |
| 2363 | C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, P&: StartLoc, |
| 2364 | P&: EndLoc); |
| 2365 | } |
| 2366 | |
| 2367 | OMPInteropDirective *OMPInteropDirective::CreateEmpty(const ASTContext &C, |
| 2368 | unsigned NumClauses, |
| 2369 | EmptyShell) { |
| 2370 | return createEmptyDirective<OMPInteropDirective>(C, NumClauses); |
| 2371 | } |
| 2372 | |
| 2373 | OMPDispatchDirective *OMPDispatchDirective::Create( |
| 2374 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 2375 | ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 2376 | SourceLocation TargetCallLoc) { |
| 2377 | auto *Dir = createDirective<OMPDispatchDirective>( |
| 2378 | C, Clauses, AssociatedStmt, /*NumChildren=*/0, P&: StartLoc, P&: EndLoc); |
| 2379 | Dir->setTargetCallLoc(TargetCallLoc); |
| 2380 | return Dir; |
| 2381 | } |
| 2382 | |
| 2383 | OMPDispatchDirective *OMPDispatchDirective::CreateEmpty(const ASTContext &C, |
| 2384 | unsigned NumClauses, |
| 2385 | EmptyShell) { |
| 2386 | return createEmptyDirective<OMPDispatchDirective>(C, NumClauses, |
| 2387 | /*HasAssociatedStmt=*/true, |
| 2388 | /*NumChildren=*/0); |
| 2389 | } |
| 2390 | |
| 2391 | OMPMaskedDirective *OMPMaskedDirective::Create(const ASTContext &C, |
| 2392 | SourceLocation StartLoc, |
| 2393 | SourceLocation EndLoc, |
| 2394 | ArrayRef<OMPClause *> Clauses, |
| 2395 | Stmt *AssociatedStmt) { |
| 2396 | return createDirective<OMPMaskedDirective>(C, Clauses, AssociatedStmt, |
| 2397 | /*NumChildren=*/0, P&: StartLoc, |
| 2398 | P&: EndLoc); |
| 2399 | } |
| 2400 | |
| 2401 | OMPMaskedDirective *OMPMaskedDirective::CreateEmpty(const ASTContext &C, |
| 2402 | unsigned NumClauses, |
| 2403 | EmptyShell) { |
| 2404 | return createEmptyDirective<OMPMaskedDirective>(C, NumClauses, |
| 2405 | /*HasAssociatedStmt=*/true); |
| 2406 | } |
| 2407 | |
| 2408 | OMPGenericLoopDirective *OMPGenericLoopDirective::Create( |
| 2409 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 2410 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 2411 | const HelperExprs &Exprs) { |
| 2412 | auto *Dir = createDirective<OMPGenericLoopDirective>( |
| 2413 | C, Clauses, AssociatedStmt, NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_loop), |
| 2414 | P&: StartLoc, P&: EndLoc, P&: CollapsedNum); |
| 2415 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 2416 | Dir->setLastIteration(Exprs.LastIteration); |
| 2417 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 2418 | Dir->setPreCond(Exprs.PreCond); |
| 2419 | Dir->setCond(Exprs.Cond); |
| 2420 | Dir->setInit(Exprs.Init); |
| 2421 | Dir->setInc(Exprs.Inc); |
| 2422 | Dir->setIsLastIterVariable(Exprs.IL); |
| 2423 | Dir->setLowerBoundVariable(Exprs.LB); |
| 2424 | Dir->setUpperBoundVariable(Exprs.UB); |
| 2425 | Dir->setStrideVariable(Exprs.ST); |
| 2426 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 2427 | Dir->setNextLowerBound(Exprs.NLB); |
| 2428 | Dir->setNextUpperBound(Exprs.NUB); |
| 2429 | Dir->setNumIterations(Exprs.NumIterations); |
| 2430 | Dir->setCounters(Exprs.Counters); |
| 2431 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 2432 | Dir->setInits(Exprs.Inits); |
| 2433 | Dir->setUpdates(Exprs.Updates); |
| 2434 | Dir->setFinals(Exprs.Finals); |
| 2435 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 2436 | Dir->setDependentInits(Exprs.DependentInits); |
| 2437 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 2438 | Dir->setPreInits(Exprs.PreInits); |
| 2439 | return Dir; |
| 2440 | } |
| 2441 | |
| 2442 | OMPGenericLoopDirective * |
| 2443 | OMPGenericLoopDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, |
| 2444 | unsigned CollapsedNum, EmptyShell) { |
| 2445 | return createEmptyDirective<OMPGenericLoopDirective>( |
| 2446 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 2447 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_loop), P&: CollapsedNum); |
| 2448 | } |
| 2449 | |
| 2450 | OMPTeamsGenericLoopDirective *OMPTeamsGenericLoopDirective::Create( |
| 2451 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 2452 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 2453 | const HelperExprs &Exprs) { |
| 2454 | auto *Dir = createDirective<OMPTeamsGenericLoopDirective>( |
| 2455 | C, Clauses, AssociatedStmt, |
| 2456 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_teams_loop), P&: StartLoc, P&: EndLoc, |
| 2457 | P&: CollapsedNum); |
| 2458 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 2459 | Dir->setLastIteration(Exprs.LastIteration); |
| 2460 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 2461 | Dir->setPreCond(Exprs.PreCond); |
| 2462 | Dir->setCond(Exprs.Cond); |
| 2463 | Dir->setInit(Exprs.Init); |
| 2464 | Dir->setInc(Exprs.Inc); |
| 2465 | Dir->setIsLastIterVariable(Exprs.IL); |
| 2466 | Dir->setLowerBoundVariable(Exprs.LB); |
| 2467 | Dir->setUpperBoundVariable(Exprs.UB); |
| 2468 | Dir->setStrideVariable(Exprs.ST); |
| 2469 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 2470 | Dir->setNextLowerBound(Exprs.NLB); |
| 2471 | Dir->setNextUpperBound(Exprs.NUB); |
| 2472 | Dir->setNumIterations(Exprs.NumIterations); |
| 2473 | Dir->setPrevLowerBoundVariable(Exprs.PrevLB); |
| 2474 | Dir->setPrevUpperBoundVariable(Exprs.PrevUB); |
| 2475 | Dir->setDistInc(Exprs.DistInc); |
| 2476 | Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); |
| 2477 | Dir->setCounters(Exprs.Counters); |
| 2478 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 2479 | Dir->setInits(Exprs.Inits); |
| 2480 | Dir->setUpdates(Exprs.Updates); |
| 2481 | Dir->setFinals(Exprs.Finals); |
| 2482 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 2483 | Dir->setDependentInits(Exprs.DependentInits); |
| 2484 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 2485 | Dir->setPreInits(Exprs.PreInits); |
| 2486 | Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); |
| 2487 | Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); |
| 2488 | Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); |
| 2489 | Dir->setCombinedInit(Exprs.DistCombinedFields.Init); |
| 2490 | Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); |
| 2491 | Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); |
| 2492 | Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); |
| 2493 | Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); |
| 2494 | Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); |
| 2495 | return Dir; |
| 2496 | } |
| 2497 | |
| 2498 | OMPTeamsGenericLoopDirective * |
| 2499 | OMPTeamsGenericLoopDirective::CreateEmpty(const ASTContext &C, |
| 2500 | unsigned NumClauses, |
| 2501 | unsigned CollapsedNum, EmptyShell) { |
| 2502 | return createEmptyDirective<OMPTeamsGenericLoopDirective>( |
| 2503 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 2504 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_teams_loop), P&: CollapsedNum); |
| 2505 | } |
| 2506 | |
| 2507 | OMPTargetTeamsGenericLoopDirective *OMPTargetTeamsGenericLoopDirective::Create( |
| 2508 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 2509 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 2510 | const HelperExprs &Exprs, bool CanBeParallelFor) { |
| 2511 | auto *Dir = createDirective<OMPTargetTeamsGenericLoopDirective>( |
| 2512 | C, Clauses, AssociatedStmt, |
| 2513 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_target_teams_loop), P&: StartLoc, P&: EndLoc, |
| 2514 | P&: CollapsedNum); |
| 2515 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 2516 | Dir->setLastIteration(Exprs.LastIteration); |
| 2517 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 2518 | Dir->setPreCond(Exprs.PreCond); |
| 2519 | Dir->setCond(Exprs.Cond); |
| 2520 | Dir->setInit(Exprs.Init); |
| 2521 | Dir->setInc(Exprs.Inc); |
| 2522 | Dir->setIsLastIterVariable(Exprs.IL); |
| 2523 | Dir->setLowerBoundVariable(Exprs.LB); |
| 2524 | Dir->setUpperBoundVariable(Exprs.UB); |
| 2525 | Dir->setStrideVariable(Exprs.ST); |
| 2526 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 2527 | Dir->setNextLowerBound(Exprs.NLB); |
| 2528 | Dir->setNextUpperBound(Exprs.NUB); |
| 2529 | Dir->setNumIterations(Exprs.NumIterations); |
| 2530 | Dir->setPrevLowerBoundVariable(Exprs.PrevLB); |
| 2531 | Dir->setPrevUpperBoundVariable(Exprs.PrevUB); |
| 2532 | Dir->setDistInc(Exprs.DistInc); |
| 2533 | Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); |
| 2534 | Dir->setCounters(Exprs.Counters); |
| 2535 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 2536 | Dir->setInits(Exprs.Inits); |
| 2537 | Dir->setUpdates(Exprs.Updates); |
| 2538 | Dir->setFinals(Exprs.Finals); |
| 2539 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 2540 | Dir->setDependentInits(Exprs.DependentInits); |
| 2541 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 2542 | Dir->setPreInits(Exprs.PreInits); |
| 2543 | Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); |
| 2544 | Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); |
| 2545 | Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); |
| 2546 | Dir->setCombinedInit(Exprs.DistCombinedFields.Init); |
| 2547 | Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); |
| 2548 | Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); |
| 2549 | Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); |
| 2550 | Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); |
| 2551 | Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); |
| 2552 | Dir->setCanBeParallelFor(CanBeParallelFor); |
| 2553 | return Dir; |
| 2554 | } |
| 2555 | |
| 2556 | OMPTargetTeamsGenericLoopDirective * |
| 2557 | OMPTargetTeamsGenericLoopDirective::CreateEmpty(const ASTContext &C, |
| 2558 | unsigned NumClauses, |
| 2559 | unsigned CollapsedNum, |
| 2560 | EmptyShell) { |
| 2561 | return createEmptyDirective<OMPTargetTeamsGenericLoopDirective>( |
| 2562 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 2563 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_target_teams_loop), P&: CollapsedNum); |
| 2564 | } |
| 2565 | |
| 2566 | OMPParallelGenericLoopDirective *OMPParallelGenericLoopDirective::Create( |
| 2567 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 2568 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 2569 | const HelperExprs &Exprs) { |
| 2570 | auto *Dir = createDirective<OMPParallelGenericLoopDirective>( |
| 2571 | C, Clauses, AssociatedStmt, |
| 2572 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_parallel_loop), P&: StartLoc, P&: EndLoc, |
| 2573 | P&: CollapsedNum); |
| 2574 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 2575 | Dir->setLastIteration(Exprs.LastIteration); |
| 2576 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 2577 | Dir->setPreCond(Exprs.PreCond); |
| 2578 | Dir->setCond(Exprs.Cond); |
| 2579 | Dir->setInit(Exprs.Init); |
| 2580 | Dir->setInc(Exprs.Inc); |
| 2581 | Dir->setIsLastIterVariable(Exprs.IL); |
| 2582 | Dir->setLowerBoundVariable(Exprs.LB); |
| 2583 | Dir->setUpperBoundVariable(Exprs.UB); |
| 2584 | Dir->setStrideVariable(Exprs.ST); |
| 2585 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 2586 | Dir->setNextLowerBound(Exprs.NLB); |
| 2587 | Dir->setNextUpperBound(Exprs.NUB); |
| 2588 | Dir->setNumIterations(Exprs.NumIterations); |
| 2589 | Dir->setCounters(Exprs.Counters); |
| 2590 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 2591 | Dir->setInits(Exprs.Inits); |
| 2592 | Dir->setUpdates(Exprs.Updates); |
| 2593 | Dir->setFinals(Exprs.Finals); |
| 2594 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 2595 | Dir->setDependentInits(Exprs.DependentInits); |
| 2596 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 2597 | Dir->setPreInits(Exprs.PreInits); |
| 2598 | return Dir; |
| 2599 | } |
| 2600 | |
| 2601 | OMPParallelGenericLoopDirective *OMPParallelGenericLoopDirective::CreateEmpty( |
| 2602 | const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, |
| 2603 | EmptyShell) { |
| 2604 | return createEmptyDirective<OMPParallelGenericLoopDirective>( |
| 2605 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 2606 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_parallel_loop), P&: CollapsedNum); |
| 2607 | } |
| 2608 | |
| 2609 | OMPTargetParallelGenericLoopDirective * |
| 2610 | OMPTargetParallelGenericLoopDirective::Create( |
| 2611 | const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |
| 2612 | unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, |
| 2613 | const HelperExprs &Exprs) { |
| 2614 | auto *Dir = createDirective<OMPTargetParallelGenericLoopDirective>( |
| 2615 | C, Clauses, AssociatedStmt, |
| 2616 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_target_parallel_loop), P&: StartLoc, |
| 2617 | P&: EndLoc, P&: CollapsedNum); |
| 2618 | Dir->setIterationVariable(Exprs.IterationVarRef); |
| 2619 | Dir->setLastIteration(Exprs.LastIteration); |
| 2620 | Dir->setCalcLastIteration(Exprs.CalcLastIteration); |
| 2621 | Dir->setPreCond(Exprs.PreCond); |
| 2622 | Dir->setCond(Exprs.Cond); |
| 2623 | Dir->setInit(Exprs.Init); |
| 2624 | Dir->setInc(Exprs.Inc); |
| 2625 | Dir->setIsLastIterVariable(Exprs.IL); |
| 2626 | Dir->setLowerBoundVariable(Exprs.LB); |
| 2627 | Dir->setUpperBoundVariable(Exprs.UB); |
| 2628 | Dir->setStrideVariable(Exprs.ST); |
| 2629 | Dir->setEnsureUpperBound(Exprs.EUB); |
| 2630 | Dir->setNextLowerBound(Exprs.NLB); |
| 2631 | Dir->setNextUpperBound(Exprs.NUB); |
| 2632 | Dir->setNumIterations(Exprs.NumIterations); |
| 2633 | Dir->setCounters(Exprs.Counters); |
| 2634 | Dir->setPrivateCounters(Exprs.PrivateCounters); |
| 2635 | Dir->setInits(Exprs.Inits); |
| 2636 | Dir->setUpdates(Exprs.Updates); |
| 2637 | Dir->setFinals(Exprs.Finals); |
| 2638 | Dir->setDependentCounters(Exprs.DependentCounters); |
| 2639 | Dir->setDependentInits(Exprs.DependentInits); |
| 2640 | Dir->setFinalsConditions(Exprs.FinalsConditions); |
| 2641 | Dir->setPreInits(Exprs.PreInits); |
| 2642 | return Dir; |
| 2643 | } |
| 2644 | |
| 2645 | OMPTargetParallelGenericLoopDirective * |
| 2646 | OMPTargetParallelGenericLoopDirective::CreateEmpty(const ASTContext &C, |
| 2647 | unsigned NumClauses, |
| 2648 | unsigned CollapsedNum, |
| 2649 | EmptyShell) { |
| 2650 | return createEmptyDirective<OMPTargetParallelGenericLoopDirective>( |
| 2651 | C, NumClauses, /*HasAssociatedStmt=*/true, |
| 2652 | NumChildren: numLoopChildren(CollapsedNum, Kind: OMPD_target_parallel_loop), P&: CollapsedNum); |
| 2653 | } |
| 2654 | |