clang: lib/AST/StmtOpenMP.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

15

16using namespace clang;

17using namespace llvm::omp;

18

19size_t OMPChildren::size(unsigned NumClauses, bool HasAssociatedStmt,

20 unsigned NumChildren) {

21 return llvm::alignTo(

22 totalSizeToAlloc<OMPClause *, Stmt *>(

23 NumClauses, NumChildren + (HasAssociatedStmt ? 1 : 0)),

24 alignof(OMPChildren));

25}

26

28 assert(Clauses.size() == NumClauses &&

29 "Number of clauses is not the same as the preallocated buffer");

30 llvm::copy(Clauses, getTrailingObjects<OMPClause *>());

31}

32

34 return getTrailingObjects<Stmt *>(NumChildren);

35}

36

39 Data->setClauses(Clauses);

41}

42

44 Stmt *S, unsigned NumChildren) {

45 auto *Data = CreateEmpty(Mem, Clauses.size(), S, NumChildren);

46 Data->setClauses(Clauses);

47 if (S)

48 Data->setAssociatedStmt(S);

50}

51

52OMPChildren *OMPChildren::CreateEmpty(void *Mem, unsigned NumClauses,

53 bool HasAssociatedStmt,

54 unsigned NumChildren) {

55 return new (Mem) OMPChildren(NumClauses, NumChildren, HasAssociatedStmt);

56}

57

58bool OMPExecutableDirective::isStandaloneDirective() const {

59

60

61

65 return true;

66 return !hasAssociatedStmt();

67}

68

69Stmt *OMPExecutableDirective::getStructuredBlock() {

70 assert(!isStandaloneDirective() &&

71 "Standalone Executable Directives don't have Structured Blocks.");

72 if (auto *LD = dyn_cast(this))

73 return LD->getBody();

74 return getRawStmt();

75}

76

78OMPLoopBasedDirective::tryToFindNextInnerLoop(Stmt *CurStmt,

79 bool TryImperfectlyNestedLoops) {

80 Stmt *OrigStmt = CurStmt;

82

83 if (TryImperfectlyNestedLoops) {

84 if (auto *CS = dyn_cast(CurStmt)) {

85 CurStmt = nullptr;

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(S))

96 S = CanonLoop->getLoopStmt();

99

100 if (CurStmt) {

101 CurStmt = OrigStmt;

102 break;

103 }

104 CurStmt = S;

105 continue;

106 }

108 if (auto *InnerCS = dyn_cast_or_null(S))

109 NextStatements.push_back(InnerCS);

110 }

111 if (Statements.empty()) {

112

113 if (CurStmt)

114 break;

115 Statements.swap(NextStatements);

116 }

117 }

118 if (!CurStmt)

119 CurStmt = OrigStmt;

120 }

121 }

122 return CurStmt;

123}

124

125bool 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) {

131 for (unsigned Cnt = 0; Cnt < NumLoops; ++Cnt) {

132 while (true) {

133 auto *Dir = dyn_cast(CurStmt);

134 if (!Dir)

135 break;

136

137 OnTransformationCallback(Dir);

138

139 Stmt *TransformedStmt = Dir->getTransformedStmt();

140 if (!TransformedStmt) {

141 unsigned NumGeneratedTopLevelLoops =

142 Dir->getNumGeneratedTopLevelLoops();

143 if (NumGeneratedTopLevelLoops == 0) {

144

145

146 break;

147 }

148 if (NumGeneratedTopLevelLoops > 0) {

149

150

151

152 return true;

153 }

154 }

155

156 CurStmt = TransformedStmt;

157 }

158 if (auto *CanonLoop = dyn_cast(CurStmt))

159 CurStmt = CanonLoop->getLoopStmt();

160 if (Callback(Cnt, CurStmt))

161 return false;

162

163

164

165

166

167 if (auto *For = dyn_cast(CurStmt)) {

168 CurStmt = For->getBody();

169 } else {

171 "Expected canonical for or range-based for loops.");

173 }

174 CurStmt = OMPLoopBasedDirective::tryToFindNextInnerLoop(

175 CurStmt, TryImperfectlyNestedLoops);

176 }

177 return true;

178}

179

180void OMPLoopBasedDirective::doForAllLoopsBodies(

181 Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops,

182 llvm::function_ref<void(unsigned, Stmt *, Stmt *)> Callback) {

183 bool Res = OMPLoopBasedDirective::doForAllLoops(

184 CurStmt, TryImperfectlyNestedLoops, NumLoops,

185 [Callback](unsigned Cnt, Stmt *Loop) {

186 Stmt *Body = nullptr;

187 if (auto *For = dyn_cast(Loop)) {

188 Body = For->getBody();

189 } else {

191 "Expected canonical for or range-based for loops.");

193 }

194 if (auto *CanonLoop = dyn_cast(Body))

195 Body = CanonLoop->getLoopStmt();

196 Callback(Cnt, Loop, Body);

197 return false;

198 });

199 assert(Res && "Expected only loops");

200 (void)Res;

201}

202

203Stmt *OMPLoopDirective::getBody() {

204

205 Stmt *Body = nullptr;

206 OMPLoopBasedDirective::doForAllLoopsBodies(

207 Data->getRawStmt(), true,

208 NumAssociatedLoops,

209 [&Body](unsigned, Stmt *, Stmt *BodyStmt) { Body = BodyStmt; });

210 return Body;

211}

212

214 assert(A.size() == getLoopsNumber() &&

215 "Number of loop counters is not the same as the collapsed number");

216 llvm::copy(A, getCounters().begin());

217}

218

219void OMPLoopDirective::setPrivateCounters(ArrayRef<Expr *> A) {

220 assert(A.size() == getLoopsNumber() && "Number of loop private counters "

221 "is not the same as the collapsed "

222 "number");

223 llvm::copy(A, getPrivateCounters().begin());

224}

225

227 assert(A.size() == getLoopsNumber() &&

228 "Number of counter inits is not the same as the collapsed number");

229 llvm::copy(A, getInits().begin());

230}

231

233 assert(A.size() == getLoopsNumber() &&

234 "Number of counter updates is not the same as the collapsed number");

235 llvm::copy(A, getUpdates().begin());

236}

237

239 assert(A.size() == getLoopsNumber() &&

240 "Number of counter finals is not the same as the collapsed number");

241 llvm::copy(A, getFinals().begin());

242}

243

244void OMPLoopDirective::setDependentCounters(ArrayRef<Expr *> A) {

245 assert(

246 A.size() == getLoopsNumber() &&

247 "Number of dependent counters is not the same as the collapsed number");

248 llvm::copy(A, getDependentCounters().begin());

249}

250

251void OMPLoopDirective::setDependentInits(ArrayRef<Expr *> A) {

252 assert(A.size() == getLoopsNumber() &&

253 "Number of dependent inits is not the same as the collapsed number");

254 llvm::copy(A, getDependentInits().begin());

255}

256

257void OMPLoopDirective::setFinalsConditions(ArrayRef<Expr *> A) {

258 assert(A.size() == getLoopsNumber() &&

259 "Number of finals conditions is not the same as the collapsed number");

260 llvm::copy(A, getFinalsConditions().begin());

261}

262

267 Stmt *AssociatedStmt, Stmt *IfStmt) {

268 auto *Dir = createDirective(

269 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);

270 Dir->setIfStmt(IfStmt);

271 return Dir;

272}

273

275 unsigned NumClauses,

276 EmptyShell) {

277 return createEmptyDirective(C, NumClauses,

278 true,

279 1);

280}

281

282OMPParallelDirective *OMPParallelDirective::Create(

285 bool HasCancel) {

286 auto *Dir = createDirective(

287 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);

288 Dir->setTaskReductionRefExpr(TaskRedRef);

289 Dir->setHasCancel(HasCancel);

290 return Dir;

291}

292

293OMPParallelDirective *OMPParallelDirective::CreateEmpty(const ASTContext &C,

294 unsigned NumClauses,

295 EmptyShell) {

296 return createEmptyDirective(C, NumClauses,

297 true,

298 1);

299}

300

301OMPSimdDirective *

305 const HelperExprs &Exprs) {

306 auto *Dir = createDirective(

307 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_simd),

308 StartLoc, EndLoc, CollapsedNum);

309 Dir->setIterationVariable(Exprs.IterationVarRef);

310 Dir->setLastIteration(Exprs.LastIteration);

311 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

312 Dir->setPreCond(Exprs.PreCond);

313 Dir->setCond(Exprs.Cond);

314 Dir->setInit(Exprs.Init);

315 Dir->setInc(Exprs.Inc);

316 Dir->setCounters(Exprs.Counters);

317 Dir->setPrivateCounters(Exprs.PrivateCounters);

318 Dir->setInits(Exprs.Inits);

319 Dir->setUpdates(Exprs.Updates);

320 Dir->setFinals(Exprs.Finals);

321 Dir->setDependentCounters(Exprs.DependentCounters);

322 Dir->setDependentInits(Exprs.DependentInits);

323 Dir->setFinalsConditions(Exprs.FinalsConditions);

324 Dir->setPreInits(Exprs.PreInits);

325 return Dir;

326}

327

328OMPSimdDirective *OMPSimdDirective::CreateEmpty(const ASTContext &C,

329 unsigned NumClauses,

330 unsigned CollapsedNum,

331 EmptyShell) {

332 return createEmptyDirective(

333 C, NumClauses, true,

334 numLoopChildren(CollapsedNum, OMPD_simd), CollapsedNum);

335}

336

337OMPForDirective *OMPForDirective::Create(

340 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {

341 auto *Dir = createDirective(

342 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for) + 1,

343 StartLoc, EndLoc, CollapsedNum);

344 Dir->setIterationVariable(Exprs.IterationVarRef);

345 Dir->setLastIteration(Exprs.LastIteration);

346 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

347 Dir->setPreCond(Exprs.PreCond);

348 Dir->setCond(Exprs.Cond);

349 Dir->setInit(Exprs.Init);

350 Dir->setInc(Exprs.Inc);

351 Dir->setIsLastIterVariable(Exprs.IL);

352 Dir->setLowerBoundVariable(Exprs.LB);

353 Dir->setUpperBoundVariable(Exprs.UB);

354 Dir->setStrideVariable(Exprs.ST);

355 Dir->setEnsureUpperBound(Exprs.EUB);

356 Dir->setNextLowerBound(Exprs.NLB);

357 Dir->setNextUpperBound(Exprs.NUB);

358 Dir->setNumIterations(Exprs.NumIterations);

359 Dir->setCounters(Exprs.Counters);

360 Dir->setPrivateCounters(Exprs.PrivateCounters);

361 Dir->setInits(Exprs.Inits);

362 Dir->setUpdates(Exprs.Updates);

363 Dir->setFinals(Exprs.Finals);

364 Dir->setDependentCounters(Exprs.DependentCounters);

365 Dir->setDependentInits(Exprs.DependentInits);

366 Dir->setFinalsConditions(Exprs.FinalsConditions);

367 Dir->setPreInits(Exprs.PreInits);

368 Dir->setTaskReductionRefExpr(TaskRedRef);

369 Dir->setHasCancel(HasCancel);

370 return Dir;

371}

372

373Stmt *OMPLoopTransformationDirective::getTransformedStmt() const {

374 if (auto *D = dyn_cast(S))

375 return D->getTransformedStmt();

376 if (auto *D = dyn_cast(S))

377 return D->getTransformedStmt();

378 llvm_unreachable("unexpected object type");

379}

380

381Stmt *OMPLoopTransformationDirective::getPreInits() const {

382 if (auto *D = dyn_cast(S))

383 return D->getPreInits();

384 if (auto *D = dyn_cast(S))

385 return D->getPreInits();

386 llvm_unreachable("unexpected object type");

387}

388

389Stmt *OMPCanonicalLoopNestTransformationDirective::getTransformedStmt() const {

390 switch (getStmtClass()) {

391#define STMT(CLASS, PARENT)

392#define ABSTRACT_STMT(CLASS)

393#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \

394 case Stmt::CLASS##Class: \

395 return static_cast<const CLASS *>(this)->getTransformedStmt();

396#include "clang/AST/StmtNodes.inc"

397 default:

398 llvm_unreachable("Not a loop transformation for canonical loop nests");

399 }

400}

401

402Stmt *OMPCanonicalLoopNestTransformationDirective::getPreInits() const {

403 switch (getStmtClass()) {

404#define STMT(CLASS, PARENT)

405#define ABSTRACT_STMT(CLASS)

406#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \

407 case Stmt::CLASS##Class: \

408 return static_cast<const CLASS *>(this)->getPreInits();

409#include "clang/AST/StmtNodes.inc"

410 default:

411 llvm_unreachable("Not a loop transformation for canonical loop nests");

412 }

413}

414

417 switch (getStmtClass()) {

418#define STMT(CLASS, PARENT)

419#define ABSTRACT_STMT(CLASS)

420#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \

421 case Stmt::CLASS##Class: \

422 return static_cast<const CLASS *>(this)->getTransformedStmt();

423#include "clang/AST/StmtNodes.inc"

424 default:

425 llvm_unreachable("Not a loop transformation for canonical loop sequences");

426 }

427}

428

430 switch (getStmtClass()) {

431#define STMT(CLASS, PARENT)

432#define ABSTRACT_STMT(CLASS)

433#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \

434 case Stmt::CLASS##Class: \

435 return static_cast<const CLASS *>(this)->getPreInits();

436#include "clang/AST/StmtNodes.inc"

437 default:

438 llvm_unreachable("Not a loop transformation for canonical loop sequences");

439 }

440}

441

442OMPForDirective *OMPForDirective::CreateEmpty(const ASTContext &C,

443 unsigned NumClauses,

444 unsigned CollapsedNum,

445 EmptyShell) {

446 return createEmptyDirective(

447 C, NumClauses, true,

448 numLoopChildren(CollapsedNum, OMPD_for) + 1, CollapsedNum);

449}

450

451OMPTileDirective *

454 unsigned NumLoops, Stmt *AssociatedStmt,

455 Stmt *TransformedStmt, Stmt *PreInits) {

456 OMPTileDirective *Dir = createDirective(

457 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,

458 NumLoops);

459 Dir->setTransformedStmt(TransformedStmt);

460 Dir->setPreInits(PreInits);

461 return Dir;

462}

463

465 unsigned NumClauses,

466 unsigned NumLoops) {

467 return createEmptyDirective(

468 C, NumClauses, true, TransformedStmtOffset + 1,

470}

471

475 unsigned NumLoops, Stmt *AssociatedStmt,

476 Stmt *TransformedStmt, Stmt *PreInits) {

477 OMPStripeDirective *Dir = createDirective(

478 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,

479 NumLoops);

480 Dir->setTransformedStmt(TransformedStmt);

481 Dir->setPreInits(PreInits);

482 return Dir;

483}

484

486 unsigned NumClauses,

487 unsigned NumLoops) {

488 return createEmptyDirective(

489 C, NumClauses, true, TransformedStmtOffset + 1,

491}

492

496 unsigned NumGeneratedTopLevelLoops, Stmt *TransformedStmt, Stmt *PreInits) {

497 assert(NumGeneratedTopLevelLoops <= 1 &&

498 "Unrolling generates at most one loop");

499

500 auto *Dir = createDirective(

501 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc);

502 Dir->setNumGeneratedTopLevelLoops(NumGeneratedTopLevelLoops);

503 Dir->setTransformedStmt(TransformedStmt);

504 Dir->setPreInits(PreInits);

505 return Dir;

506}

507

509 unsigned NumClauses) {

510 return createEmptyDirective(

511 C, NumClauses, true, TransformedStmtOffset + 1,

513}

514

518 unsigned NumLoops, Stmt *TransformedStmt,

519 Stmt *PreInits) {

520 OMPReverseDirective *Dir = createDirective(

521 C, {}, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,

522 NumLoops);

523 Dir->setTransformedStmt(TransformedStmt);

524 Dir->setPreInits(PreInits);

525 return Dir;

526}

527

529 unsigned NumLoops) {

530 return createEmptyDirective(

531 C, 0, true,

533}

534

538 Stmt *TransformedStmt, Stmt *PreInits) {

539 OMPInterchangeDirective *Dir = createDirective(

540 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,

541 NumLoops);

542 Dir->setTransformedStmt(TransformedStmt);

543 Dir->setPreInits(PreInits);

544 return Dir;

545}

546

549 unsigned NumLoops) {

550 return createEmptyDirective(

551 C, NumClauses, true, TransformedStmtOffset + 1,

553}

554

558 Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits) {

559

560 OMPFuseDirective *Dir = createDirective(

561 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc);

562 Dir->setTransformedStmt(TransformedStmt);

563 Dir->setPreInits(PreInits);

564 Dir->setNumGeneratedTopLevelLoops(NumGeneratedTopLevelLoops);

565 return Dir;

566}

567

569 unsigned NumClauses) {

570 OMPFuseDirective *Dir = createEmptyDirective(

571 C, NumClauses, true, TransformedStmtOffset + 1,

573 return Dir;

574}

575

576OMPForSimdDirective *

580 const HelperExprs &Exprs) {

581 auto *Dir = createDirective(

582 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for_simd),

583 StartLoc, EndLoc, CollapsedNum);

584 Dir->setIterationVariable(Exprs.IterationVarRef);

585 Dir->setLastIteration(Exprs.LastIteration);

586 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

587 Dir->setPreCond(Exprs.PreCond);

588 Dir->setCond(Exprs.Cond);

589 Dir->setInit(Exprs.Init);

590 Dir->setInc(Exprs.Inc);

591 Dir->setIsLastIterVariable(Exprs.IL);

592 Dir->setLowerBoundVariable(Exprs.LB);

593 Dir->setUpperBoundVariable(Exprs.UB);

594 Dir->setStrideVariable(Exprs.ST);

595 Dir->setEnsureUpperBound(Exprs.EUB);

596 Dir->setNextLowerBound(Exprs.NLB);

597 Dir->setNextUpperBound(Exprs.NUB);

598 Dir->setNumIterations(Exprs.NumIterations);

599 Dir->setCounters(Exprs.Counters);

600 Dir->setPrivateCounters(Exprs.PrivateCounters);

601 Dir->setInits(Exprs.Inits);

602 Dir->setUpdates(Exprs.Updates);

603 Dir->setFinals(Exprs.Finals);

604 Dir->setDependentCounters(Exprs.DependentCounters);

605 Dir->setDependentInits(Exprs.DependentInits);

606 Dir->setFinalsConditions(Exprs.FinalsConditions);

607 Dir->setPreInits(Exprs.PreInits);

608 return Dir;

609}

610

611OMPForSimdDirective *OMPForSimdDirective::CreateEmpty(const ASTContext &C,

612 unsigned NumClauses,

613 unsigned CollapsedNum,

614 EmptyShell) {

615 return createEmptyDirective(

616 C, NumClauses, true,

617 numLoopChildren(CollapsedNum, OMPD_for_simd), CollapsedNum);

618}

619

620OMPSectionsDirective *OMPSectionsDirective::Create(

623 bool HasCancel) {

624 auto *Dir = createDirective(C, Clauses, AssociatedStmt,

625 1, StartLoc,

626 EndLoc);

627 Dir->setTaskReductionRefExpr(TaskRedRef);

628 Dir->setHasCancel(HasCancel);

629 return Dir;

630}

631

632OMPSectionsDirective *OMPSectionsDirective::CreateEmpty(const ASTContext &C,

633 unsigned NumClauses,

634 EmptyShell) {

635 return createEmptyDirective(C, NumClauses,

636 true,

637 1);

638}

639

640OMPSectionDirective *OMPSectionDirective::Create(const ASTContext &C,

643 Stmt *AssociatedStmt,

644 bool HasCancel) {

645 auto *Dir =

646 createDirective(C, {}, AssociatedStmt,

647 0, StartLoc, EndLoc);

648 Dir->setHasCancel(HasCancel);

649 return Dir;

650}

651

652OMPSectionDirective *OMPSectionDirective::CreateEmpty(const ASTContext &C,

653 EmptyShell) {

654 return createEmptyDirective(C, 0,

655 true);

656}

657

658OMPScopeDirective *OMPScopeDirective::Create(const ASTContext &C,

662 Stmt *AssociatedStmt) {

663 return createDirective(C, Clauses, AssociatedStmt,

664 0, StartLoc,

665 EndLoc);

666}

667

668OMPScopeDirective *OMPScopeDirective::CreateEmpty(const ASTContext &C,

669 unsigned NumClauses,

670 EmptyShell) {

671 return createEmptyDirective(C, NumClauses,

672 true);

673}

674

675OMPSingleDirective *OMPSingleDirective::Create(const ASTContext &C,

679 Stmt *AssociatedStmt) {

680 return createDirective(C, Clauses, AssociatedStmt,

681 0, StartLoc,

682 EndLoc);

683}

684

685OMPSingleDirective *OMPSingleDirective::CreateEmpty(const ASTContext &C,

686 unsigned NumClauses,

687 EmptyShell) {

688 return createEmptyDirective(C, NumClauses,

689 true);

690}

691

692OMPMasterDirective *OMPMasterDirective::Create(const ASTContext &C,

695 Stmt *AssociatedStmt) {

696 return createDirective(C, {}, AssociatedStmt,

697 0, StartLoc,

698 EndLoc);

699}

700

701OMPMasterDirective *OMPMasterDirective::CreateEmpty(const ASTContext &C,

702 EmptyShell) {

703 return createEmptyDirective(C, 0,

704 true);

705}

706

707OMPCriticalDirective *OMPCriticalDirective::Create(

711 return createDirective(C, Clauses, AssociatedStmt,

712 0, Name,

713 StartLoc, EndLoc);

714}

715

716OMPCriticalDirective *OMPCriticalDirective::CreateEmpty(const ASTContext &C,

717 unsigned NumClauses,

718 EmptyShell) {

719 return createEmptyDirective(C, NumClauses,

720 true);

721}

722

723OMPParallelForDirective *OMPParallelForDirective::Create(

726 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {

727 auto *Dir = createDirective(

728 C, Clauses, AssociatedStmt,

729 numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, StartLoc, EndLoc,

730 CollapsedNum);

731 Dir->setIterationVariable(Exprs.IterationVarRef);

732 Dir->setLastIteration(Exprs.LastIteration);

733 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

734 Dir->setPreCond(Exprs.PreCond);

735 Dir->setCond(Exprs.Cond);

736 Dir->setInit(Exprs.Init);

737 Dir->setInc(Exprs.Inc);

738 Dir->setIsLastIterVariable(Exprs.IL);

739 Dir->setLowerBoundVariable(Exprs.LB);

740 Dir->setUpperBoundVariable(Exprs.UB);

741 Dir->setStrideVariable(Exprs.ST);

742 Dir->setEnsureUpperBound(Exprs.EUB);

743 Dir->setNextLowerBound(Exprs.NLB);

744 Dir->setNextUpperBound(Exprs.NUB);

745 Dir->setNumIterations(Exprs.NumIterations);

746 Dir->setCounters(Exprs.Counters);

747 Dir->setPrivateCounters(Exprs.PrivateCounters);

748 Dir->setInits(Exprs.Inits);

749 Dir->setUpdates(Exprs.Updates);

750 Dir->setFinals(Exprs.Finals);

751 Dir->setDependentCounters(Exprs.DependentCounters);

752 Dir->setDependentInits(Exprs.DependentInits);

753 Dir->setFinalsConditions(Exprs.FinalsConditions);

754 Dir->setPreInits(Exprs.PreInits);

755 Dir->setTaskReductionRefExpr(TaskRedRef);

756 Dir->setHasCancel(HasCancel);

757 return Dir;

758}

759

760OMPParallelForDirective *

761OMPParallelForDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,

762 unsigned CollapsedNum, EmptyShell) {

763 return createEmptyDirective(

764 C, NumClauses, true,

765 numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, CollapsedNum);

766}

767

768OMPParallelForSimdDirective *OMPParallelForSimdDirective::Create(

771 const HelperExprs &Exprs) {

772 auto *Dir = createDirective(

773 C, Clauses, AssociatedStmt,

774 numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), StartLoc, EndLoc,

775 CollapsedNum);

776 Dir->setIterationVariable(Exprs.IterationVarRef);

777 Dir->setLastIteration(Exprs.LastIteration);

778 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

779 Dir->setPreCond(Exprs.PreCond);

780 Dir->setCond(Exprs.Cond);

781 Dir->setInit(Exprs.Init);

782 Dir->setInc(Exprs.Inc);

783 Dir->setIsLastIterVariable(Exprs.IL);

784 Dir->setLowerBoundVariable(Exprs.LB);

785 Dir->setUpperBoundVariable(Exprs.UB);

786 Dir->setStrideVariable(Exprs.ST);

787 Dir->setEnsureUpperBound(Exprs.EUB);

788 Dir->setNextLowerBound(Exprs.NLB);

789 Dir->setNextUpperBound(Exprs.NUB);

790 Dir->setNumIterations(Exprs.NumIterations);

791 Dir->setCounters(Exprs.Counters);

792 Dir->setPrivateCounters(Exprs.PrivateCounters);

793 Dir->setInits(Exprs.Inits);

794 Dir->setUpdates(Exprs.Updates);

795 Dir->setFinals(Exprs.Finals);

796 Dir->setDependentCounters(Exprs.DependentCounters);

797 Dir->setDependentInits(Exprs.DependentInits);

798 Dir->setFinalsConditions(Exprs.FinalsConditions);

799 Dir->setPreInits(Exprs.PreInits);

800 return Dir;

801}

802

803OMPParallelForSimdDirective *

804OMPParallelForSimdDirective::CreateEmpty(const ASTContext &C,

805 unsigned NumClauses,

806 unsigned CollapsedNum, EmptyShell) {

807 return createEmptyDirective(

808 C, NumClauses, true,

809 numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), CollapsedNum);

810}

811

812OMPParallelMasterDirective *OMPParallelMasterDirective::Create(

815 auto *Dir = createDirective(

816 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);

817 Dir->setTaskReductionRefExpr(TaskRedRef);

818 return Dir;

819}

820

821OMPParallelMasterDirective *

822OMPParallelMasterDirective::CreateEmpty(const ASTContext &C,

823 unsigned NumClauses, EmptyShell) {

824 return createEmptyDirective(

825 C, NumClauses, true, 1);

826}

827

828OMPParallelMaskedDirective *OMPParallelMaskedDirective::Create(

831 auto *Dir = createDirective(

832 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);

833 Dir->setTaskReductionRefExpr(TaskRedRef);

834 return Dir;

835}

836

837OMPParallelMaskedDirective *

838OMPParallelMaskedDirective::CreateEmpty(const ASTContext &C,

839 unsigned NumClauses, EmptyShell) {

840 return createEmptyDirective(

841 C, NumClauses, true, 1);

842}

843

844OMPParallelSectionsDirective *OMPParallelSectionsDirective::Create(

847 bool HasCancel) {

848 auto *Dir = createDirective(

849 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);

850 Dir->setTaskReductionRefExpr(TaskRedRef);

851 Dir->setHasCancel(HasCancel);

852 return Dir;

853}

854

855OMPParallelSectionsDirective *

856OMPParallelSectionsDirective::CreateEmpty(const ASTContext &C,

857 unsigned NumClauses, EmptyShell) {

858 return createEmptyDirective(

859 C, NumClauses, true, 1);

860}

861

862OMPTaskDirective *

865 Stmt *AssociatedStmt, bool HasCancel) {

866 auto *Dir = createDirective(

867 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);

868 Dir->setHasCancel(HasCancel);

869 return Dir;

870}

871

872OMPTaskDirective *OMPTaskDirective::CreateEmpty(const ASTContext &C,

873 unsigned NumClauses,

874 EmptyShell) {

875 return createEmptyDirective(C, NumClauses,

876 true);

877}

878

879OMPTaskyieldDirective *OMPTaskyieldDirective::Create(const ASTContext &C,

882 return new (C) OMPTaskyieldDirective(StartLoc, EndLoc);

883}

884

885OMPTaskyieldDirective *OMPTaskyieldDirective::CreateEmpty(const ASTContext &C,

886 EmptyShell) {

887 return new (C) OMPTaskyieldDirective();

888}

889

894 Stmt *AStmt) {

895 return createDirective(C, Clauses, AStmt,

896 0, StartLoc,

897 EndLoc);

898}

899

901 unsigned NumClauses,

902 EmptyShell) {

903 return createEmptyDirective(C, NumClauses,

904 true);

905}

906

911 return createDirective(

912 C, Clauses, nullptr, 0, StartLoc,

913 EndLoc);

914}

915

917 unsigned NumClauses,

918 EmptyShell) {

919 return createEmptyDirective(C, NumClauses);

920}

921

922OMPBarrierDirective *OMPBarrierDirective::Create(const ASTContext &C,

925 return new (C) OMPBarrierDirective(StartLoc, EndLoc);

926}

927

928OMPBarrierDirective *OMPBarrierDirective::CreateEmpty(const ASTContext &C,

929 EmptyShell) {

930 return new (C) OMPBarrierDirective();

931}

932

933OMPTaskwaitDirective *

937 return createDirective(

938 C, Clauses, nullptr, 0, StartLoc,

939 EndLoc);

940}

941

942OMPTaskwaitDirective *OMPTaskwaitDirective::CreateEmpty(const ASTContext &C,

943 unsigned NumClauses,

944 EmptyShell) {

945 return createEmptyDirective(C, NumClauses);

946}

947

948OMPTaskgroupDirective *OMPTaskgroupDirective::Create(

951 auto *Dir = createDirective(

952 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);

953 Dir->setReductionRef(ReductionRef);

954 return Dir;

955}

956

957OMPTaskgroupDirective *OMPTaskgroupDirective::CreateEmpty(const ASTContext &C,

958 unsigned NumClauses,

959 EmptyShell) {

960 return createEmptyDirective(

961 C, NumClauses, true, 1);

962}

963

967 auto *Dir = new (C) OMPCancellationPointDirective(StartLoc, EndLoc);

968 Dir->setCancelRegion(CancelRegion);

969 return Dir;

970}

971

974 return new (C) OMPCancellationPointDirective();

975}

976

981 auto *Dir = createDirective(

982 C, Clauses, nullptr, 0, StartLoc,

983 EndLoc);

984 Dir->setCancelRegion(CancelRegion);

985 return Dir;

986}

987

989 unsigned NumClauses,

990 EmptyShell) {

991 return createEmptyDirective(C, NumClauses);

992}

993

994OMPFlushDirective *OMPFlushDirective::Create(const ASTContext &C,

998 return createDirective(

999 C, Clauses, nullptr, 0, StartLoc,

1000 EndLoc);

1001}

1002

1003OMPFlushDirective *OMPFlushDirective::CreateEmpty(const ASTContext &C,

1004 unsigned NumClauses,

1005 EmptyShell) {

1006 return createEmptyDirective(C, NumClauses);

1007}

1008

1009OMPDepobjDirective *OMPDepobjDirective::Create(const ASTContext &C,

1013 return createDirective(

1014 C, Clauses, nullptr,

1015 0, StartLoc, EndLoc);

1016}

1017

1018OMPDepobjDirective *OMPDepobjDirective::CreateEmpty(const ASTContext &C,

1019 unsigned NumClauses,

1020 EmptyShell) {

1021 return createEmptyDirective(C, NumClauses);

1022}

1023

1028 return createDirective(C, Clauses,

1029 nullptr,

1030 0, StartLoc, EndLoc);

1031}

1032

1034 unsigned NumClauses,

1035 EmptyShell) {

1036 return createEmptyDirective(C, NumClauses);

1037}

1038

1039OMPOrderedDirective *OMPOrderedDirective::Create(const ASTContext &C,

1043 Stmt *AssociatedStmt) {

1044 return createDirective(

1045 C, Clauses, cast_or_null(AssociatedStmt),

1046 0, StartLoc, EndLoc);

1047}

1048

1049OMPOrderedDirective *OMPOrderedDirective::CreateEmpty(const ASTContext &C,

1050 unsigned NumClauses,

1051 bool IsStandalone,

1052 EmptyShell) {

1053 return createEmptyDirective(C, NumClauses,

1054 !IsStandalone);

1055}

1056

1057OMPAtomicDirective *

1060 Stmt *AssociatedStmt, Expressions Exprs) {

1061 auto *Dir = createDirective(

1062 C, Clauses, AssociatedStmt, 7, StartLoc, EndLoc);

1063 Dir->setX(Exprs.X);

1064 Dir->setV(Exprs.V);

1065 Dir->setR(Exprs.R);

1066 Dir->setExpr(Exprs.E);

1067 Dir->setUpdateExpr(Exprs.UE);

1068 Dir->setD(Exprs.D);

1069 Dir->setCond(Exprs.Cond);

1070 Dir->Flags.IsXLHSInRHSPart = Exprs.IsXLHSInRHSPart ? 1 : 0;

1071 Dir->Flags.IsPostfixUpdate = Exprs.IsPostfixUpdate ? 1 : 0;

1072 Dir->Flags.IsFailOnly = Exprs.IsFailOnly ? 1 : 0;

1073 return Dir;

1074}

1075

1076OMPAtomicDirective *OMPAtomicDirective::CreateEmpty(const ASTContext &C,

1077 unsigned NumClauses,

1078 EmptyShell) {

1079 return createEmptyDirective(

1080 C, NumClauses, true, 7);

1081}

1082

1087 Stmt *AssociatedStmt) {

1088 return createDirective(

1089 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);

1090}

1091

1093 unsigned NumClauses,

1094 EmptyShell) {

1095 return createEmptyDirective(C, NumClauses,

1096 true);

1097}

1098

1102 bool HasCancel) {

1103 auto *Dir = createDirective(

1104 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);

1105 Dir->setTaskReductionRefExpr(TaskRedRef);

1106 Dir->setHasCancel(HasCancel);

1107 return Dir;

1108}

1109

1112 unsigned NumClauses, EmptyShell) {

1113 return createEmptyDirective(

1114 C, NumClauses, true, 1);

1115}

1116

1120 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {

1121 auto *Dir = createDirective(

1122 C, Clauses, AssociatedStmt,

1123 numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1, StartLoc,

1124 EndLoc, CollapsedNum);

1125 Dir->setIterationVariable(Exprs.IterationVarRef);

1126 Dir->setLastIteration(Exprs.LastIteration);

1127 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1128 Dir->setPreCond(Exprs.PreCond);

1129 Dir->setCond(Exprs.Cond);

1130 Dir->setInit(Exprs.Init);

1131 Dir->setInc(Exprs.Inc);

1132 Dir->setIsLastIterVariable(Exprs.IL);

1133 Dir->setLowerBoundVariable(Exprs.LB);

1134 Dir->setUpperBoundVariable(Exprs.UB);

1135 Dir->setStrideVariable(Exprs.ST);

1136 Dir->setEnsureUpperBound(Exprs.EUB);

1137 Dir->setNextLowerBound(Exprs.NLB);

1138 Dir->setNextUpperBound(Exprs.NUB);

1139 Dir->setNumIterations(Exprs.NumIterations);

1140 Dir->setCounters(Exprs.Counters);

1141 Dir->setPrivateCounters(Exprs.PrivateCounters);

1142 Dir->setInits(Exprs.Inits);

1143 Dir->setUpdates(Exprs.Updates);

1144 Dir->setFinals(Exprs.Finals);

1145 Dir->setDependentCounters(Exprs.DependentCounters);

1146 Dir->setDependentInits(Exprs.DependentInits);

1147 Dir->setFinalsConditions(Exprs.FinalsConditions);

1148 Dir->setPreInits(Exprs.PreInits);

1149 Dir->setTaskReductionRefExpr(TaskRedRef);

1150 Dir->setHasCancel(HasCancel);

1151 return Dir;

1152}

1153

1156 unsigned NumClauses,

1157 unsigned CollapsedNum, EmptyShell) {

1158 return createEmptyDirective(

1159 C, NumClauses, true,

1160 numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1,

1161 CollapsedNum);

1162}

1163

1167 return createDirective(

1168 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);

1169}

1170

1172 unsigned N,

1173 EmptyShell) {

1174 return createEmptyDirective(

1175 C, N, true);

1176}

1177

1181 return createDirective(

1182 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);

1183}

1184

1187 EmptyShell) {

1188 return createEmptyDirective(

1189 C, N, true);

1190}

1191

1195 return createDirective(

1196 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);

1197}

1198

1201 EmptyShell) {

1202 return createEmptyDirective(

1203 C, N, true);

1204}

1205

1210 Stmt *AssociatedStmt) {

1211 return createDirective(

1212 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);

1213}

1214

1216 unsigned NumClauses,

1217 EmptyShell) {

1218 return createEmptyDirective(C, NumClauses,

1219 true);

1220}

1221

1225 const HelperExprs &Exprs, bool HasCancel) {

1226 auto *Dir = createDirective(

1227 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_taskloop),

1228 StartLoc, EndLoc, CollapsedNum);

1229 Dir->setIterationVariable(Exprs.IterationVarRef);

1230 Dir->setLastIteration(Exprs.LastIteration);

1231 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1232 Dir->setPreCond(Exprs.PreCond);

1233 Dir->setCond(Exprs.Cond);

1234 Dir->setInit(Exprs.Init);

1235 Dir->setInc(Exprs.Inc);

1236 Dir->setIsLastIterVariable(Exprs.IL);

1237 Dir->setLowerBoundVariable(Exprs.LB);

1238 Dir->setUpperBoundVariable(Exprs.UB);

1239 Dir->setStrideVariable(Exprs.ST);

1240 Dir->setEnsureUpperBound(Exprs.EUB);

1241 Dir->setNextLowerBound(Exprs.NLB);

1242 Dir->setNextUpperBound(Exprs.NUB);

1243 Dir->setNumIterations(Exprs.NumIterations);

1244 Dir->setCounters(Exprs.Counters);

1245 Dir->setPrivateCounters(Exprs.PrivateCounters);

1246 Dir->setInits(Exprs.Inits);

1247 Dir->setUpdates(Exprs.Updates);

1248 Dir->setFinals(Exprs.Finals);

1249 Dir->setDependentCounters(Exprs.DependentCounters);

1250 Dir->setDependentInits(Exprs.DependentInits);

1251 Dir->setFinalsConditions(Exprs.FinalsConditions);

1252 Dir->setPreInits(Exprs.PreInits);

1253 Dir->setHasCancel(HasCancel);

1254 return Dir;

1255}

1256

1258 unsigned NumClauses,

1259 unsigned CollapsedNum,

1260 EmptyShell) {

1261 return createEmptyDirective(

1262 C, NumClauses, true,

1263 numLoopChildren(CollapsedNum, OMPD_taskloop), CollapsedNum);

1264}

1265

1269 const HelperExprs &Exprs) {

1270 auto *Dir = createDirective(

1271 C, Clauses, AssociatedStmt,

1272 numLoopChildren(CollapsedNum, OMPD_taskloop_simd), StartLoc, EndLoc,

1273 CollapsedNum);

1274 Dir->setIterationVariable(Exprs.IterationVarRef);

1275 Dir->setLastIteration(Exprs.LastIteration);

1276 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1277 Dir->setPreCond(Exprs.PreCond);

1278 Dir->setCond(Exprs.Cond);

1279 Dir->setInit(Exprs.Init);

1280 Dir->setInc(Exprs.Inc);

1281 Dir->setIsLastIterVariable(Exprs.IL);

1282 Dir->setLowerBoundVariable(Exprs.LB);

1283 Dir->setUpperBoundVariable(Exprs.UB);

1284 Dir->setStrideVariable(Exprs.ST);

1285 Dir->setEnsureUpperBound(Exprs.EUB);

1286 Dir->setNextLowerBound(Exprs.NLB);

1287 Dir->setNextUpperBound(Exprs.NUB);

1288 Dir->setNumIterations(Exprs.NumIterations);

1289 Dir->setCounters(Exprs.Counters);

1290 Dir->setPrivateCounters(Exprs.PrivateCounters);

1291 Dir->setInits(Exprs.Inits);

1292 Dir->setUpdates(Exprs.Updates);

1293 Dir->setFinals(Exprs.Finals);

1294 Dir->setDependentCounters(Exprs.DependentCounters);

1295 Dir->setDependentInits(Exprs.DependentInits);

1296 Dir->setFinalsConditions(Exprs.FinalsConditions);

1297 Dir->setPreInits(Exprs.PreInits);

1298 return Dir;

1299}

1300

1303 unsigned CollapsedNum, EmptyShell) {

1304 return createEmptyDirective(

1305 C, NumClauses, true,

1306 numLoopChildren(CollapsedNum, OMPD_taskloop_simd), CollapsedNum);

1307}

1308

1312 const HelperExprs &Exprs, bool HasCancel) {

1313 auto *Dir = createDirective(

1314 C, Clauses, AssociatedStmt,

1315 numLoopChildren(CollapsedNum, OMPD_master_taskloop), StartLoc, EndLoc,

1316 CollapsedNum);

1317 Dir->setIterationVariable(Exprs.IterationVarRef);

1318 Dir->setLastIteration(Exprs.LastIteration);

1319 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1320 Dir->setPreCond(Exprs.PreCond);

1321 Dir->setCond(Exprs.Cond);

1322 Dir->setInit(Exprs.Init);

1323 Dir->setInc(Exprs.Inc);

1324 Dir->setIsLastIterVariable(Exprs.IL);

1325 Dir->setLowerBoundVariable(Exprs.LB);

1326 Dir->setUpperBoundVariable(Exprs.UB);

1327 Dir->setStrideVariable(Exprs.ST);

1328 Dir->setEnsureUpperBound(Exprs.EUB);

1329 Dir->setNextLowerBound(Exprs.NLB);

1330 Dir->setNextUpperBound(Exprs.NUB);

1331 Dir->setNumIterations(Exprs.NumIterations);

1332 Dir->setCounters(Exprs.Counters);

1333 Dir->setPrivateCounters(Exprs.PrivateCounters);

1334 Dir->setInits(Exprs.Inits);

1335 Dir->setUpdates(Exprs.Updates);

1336 Dir->setFinals(Exprs.Finals);

1337 Dir->setDependentCounters(Exprs.DependentCounters);

1338 Dir->setDependentInits(Exprs.DependentInits);

1339 Dir->setFinalsConditions(Exprs.FinalsConditions);

1340 Dir->setPreInits(Exprs.PreInits);

1341 Dir->setHasCancel(HasCancel);

1342 return Dir;

1343}

1344

1347 unsigned NumClauses,

1348 unsigned CollapsedNum, EmptyShell) {

1349 return createEmptyDirective(

1350 C, NumClauses, true,

1351 numLoopChildren(CollapsedNum, OMPD_master_taskloop), CollapsedNum);

1352}

1353

1357 const HelperExprs &Exprs, bool HasCancel) {

1358 auto *Dir = createDirective(

1359 C, Clauses, AssociatedStmt,

1360 numLoopChildren(CollapsedNum, OMPD_masked_taskloop), StartLoc, EndLoc,

1361 CollapsedNum);

1362 Dir->setIterationVariable(Exprs.IterationVarRef);

1363 Dir->setLastIteration(Exprs.LastIteration);

1364 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1365 Dir->setPreCond(Exprs.PreCond);

1366 Dir->setCond(Exprs.Cond);

1367 Dir->setInit(Exprs.Init);

1368 Dir->setInc(Exprs.Inc);

1369 Dir->setIsLastIterVariable(Exprs.IL);

1370 Dir->setLowerBoundVariable(Exprs.LB);

1371 Dir->setUpperBoundVariable(Exprs.UB);

1372 Dir->setStrideVariable(Exprs.ST);

1373 Dir->setEnsureUpperBound(Exprs.EUB);

1374 Dir->setNextLowerBound(Exprs.NLB);

1375 Dir->setNextUpperBound(Exprs.NUB);

1376 Dir->setNumIterations(Exprs.NumIterations);

1377 Dir->setCounters(Exprs.Counters);

1378 Dir->setPrivateCounters(Exprs.PrivateCounters);

1379 Dir->setInits(Exprs.Inits);

1380 Dir->setUpdates(Exprs.Updates);

1381 Dir->setFinals(Exprs.Finals);

1382 Dir->setDependentCounters(Exprs.DependentCounters);

1383 Dir->setDependentInits(Exprs.DependentInits);

1384 Dir->setFinalsConditions(Exprs.FinalsConditions);

1385 Dir->setPreInits(Exprs.PreInits);

1386 Dir->setHasCancel(HasCancel);

1387 return Dir;

1388}

1389

1392 unsigned NumClauses,

1393 unsigned CollapsedNum, EmptyShell) {

1394 return createEmptyDirective(

1395 C, NumClauses, true,

1396 numLoopChildren(CollapsedNum, OMPD_masked_taskloop), CollapsedNum);

1397}

1398

1402 const HelperExprs &Exprs) {

1403 auto *Dir = createDirective(

1404 C, Clauses, AssociatedStmt,

1405 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), StartLoc,

1406 EndLoc, CollapsedNum);

1407 Dir->setIterationVariable(Exprs.IterationVarRef);

1408 Dir->setLastIteration(Exprs.LastIteration);

1409 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1410 Dir->setPreCond(Exprs.PreCond);

1411 Dir->setCond(Exprs.Cond);

1412 Dir->setInit(Exprs.Init);

1413 Dir->setInc(Exprs.Inc);

1414 Dir->setIsLastIterVariable(Exprs.IL);

1415 Dir->setLowerBoundVariable(Exprs.LB);

1416 Dir->setUpperBoundVariable(Exprs.UB);

1417 Dir->setStrideVariable(Exprs.ST);

1418 Dir->setEnsureUpperBound(Exprs.EUB);

1419 Dir->setNextLowerBound(Exprs.NLB);

1420 Dir->setNextUpperBound(Exprs.NUB);

1421 Dir->setNumIterations(Exprs.NumIterations);

1422 Dir->setCounters(Exprs.Counters);

1423 Dir->setPrivateCounters(Exprs.PrivateCounters);

1424 Dir->setInits(Exprs.Inits);

1425 Dir->setUpdates(Exprs.Updates);

1426 Dir->setFinals(Exprs.Finals);

1427 Dir->setDependentCounters(Exprs.DependentCounters);

1428 Dir->setDependentInits(Exprs.DependentInits);

1429 Dir->setFinalsConditions(Exprs.FinalsConditions);

1430 Dir->setPreInits(Exprs.PreInits);

1431 return Dir;

1432}

1433

1436 unsigned NumClauses,

1437 unsigned CollapsedNum, EmptyShell) {

1438 return createEmptyDirective(

1439 C, NumClauses, true,

1440 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), CollapsedNum);

1441}

1442

1446 const HelperExprs &Exprs) {

1447 auto *Dir = createDirective(

1448 C, Clauses, AssociatedStmt,

1449 numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), StartLoc,

1450 EndLoc, CollapsedNum);

1451 Dir->setIterationVariable(Exprs.IterationVarRef);

1452 Dir->setLastIteration(Exprs.LastIteration);

1453 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1454 Dir->setPreCond(Exprs.PreCond);

1455 Dir->setCond(Exprs.Cond);

1456 Dir->setInit(Exprs.Init);

1457 Dir->setInc(Exprs.Inc);

1458 Dir->setIsLastIterVariable(Exprs.IL);

1459 Dir->setLowerBoundVariable(Exprs.LB);

1460 Dir->setUpperBoundVariable(Exprs.UB);

1461 Dir->setStrideVariable(Exprs.ST);

1462 Dir->setEnsureUpperBound(Exprs.EUB);

1463 Dir->setNextLowerBound(Exprs.NLB);

1464 Dir->setNextUpperBound(Exprs.NUB);

1465 Dir->setNumIterations(Exprs.NumIterations);

1466 Dir->setCounters(Exprs.Counters);

1467 Dir->setPrivateCounters(Exprs.PrivateCounters);

1468 Dir->setInits(Exprs.Inits);

1469 Dir->setUpdates(Exprs.Updates);

1470 Dir->setFinals(Exprs.Finals);

1471 Dir->setDependentCounters(Exprs.DependentCounters);

1472 Dir->setDependentInits(Exprs.DependentInits);

1473 Dir->setFinalsConditions(Exprs.FinalsConditions);

1474 Dir->setPreInits(Exprs.PreInits);

1475 return Dir;

1476}

1477

1480 unsigned NumClauses,

1481 unsigned CollapsedNum, EmptyShell) {

1482 return createEmptyDirective(

1483 C, NumClauses, true,

1484 numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), CollapsedNum);

1485}

1486

1490 const HelperExprs &Exprs, bool HasCancel) {

1491 auto *Dir = createDirective(

1492 C, Clauses, AssociatedStmt,

1493 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop), StartLoc,

1494 EndLoc, CollapsedNum);

1495 Dir->setIterationVariable(Exprs.IterationVarRef);

1496 Dir->setLastIteration(Exprs.LastIteration);

1497 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1498 Dir->setPreCond(Exprs.PreCond);

1499 Dir->setCond(Exprs.Cond);

1500 Dir->setInit(Exprs.Init);

1501 Dir->setInc(Exprs.Inc);

1502 Dir->setIsLastIterVariable(Exprs.IL);

1503 Dir->setLowerBoundVariable(Exprs.LB);

1504 Dir->setUpperBoundVariable(Exprs.UB);

1505 Dir->setStrideVariable(Exprs.ST);

1506 Dir->setEnsureUpperBound(Exprs.EUB);

1507 Dir->setNextLowerBound(Exprs.NLB);

1508 Dir->setNextUpperBound(Exprs.NUB);

1509 Dir->setNumIterations(Exprs.NumIterations);

1510 Dir->setCounters(Exprs.Counters);

1511 Dir->setPrivateCounters(Exprs.PrivateCounters);

1512 Dir->setInits(Exprs.Inits);

1513 Dir->setUpdates(Exprs.Updates);

1514 Dir->setFinals(Exprs.Finals);

1515 Dir->setDependentCounters(Exprs.DependentCounters);

1516 Dir->setDependentInits(Exprs.DependentInits);

1517 Dir->setFinalsConditions(Exprs.FinalsConditions);

1518 Dir->setPreInits(Exprs.PreInits);

1519 Dir->setHasCancel(HasCancel);

1520 return Dir;

1521}

1522

1525 unsigned NumClauses,

1526 unsigned CollapsedNum,

1527 EmptyShell) {

1528 return createEmptyDirective(

1529 C, NumClauses, true,

1530 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop),

1531 CollapsedNum);

1532}

1533

1537 const HelperExprs &Exprs, bool HasCancel) {

1538 auto *Dir = createDirective(

1539 C, Clauses, AssociatedStmt,

1540 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop), StartLoc,

1541 EndLoc, CollapsedNum);

1542 Dir->setIterationVariable(Exprs.IterationVarRef);

1543 Dir->setLastIteration(Exprs.LastIteration);

1544 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1545 Dir->setPreCond(Exprs.PreCond);

1546 Dir->setCond(Exprs.Cond);

1547 Dir->setInit(Exprs.Init);

1548 Dir->setInc(Exprs.Inc);

1549 Dir->setIsLastIterVariable(Exprs.IL);

1550 Dir->setLowerBoundVariable(Exprs.LB);

1551 Dir->setUpperBoundVariable(Exprs.UB);

1552 Dir->setStrideVariable(Exprs.ST);

1553 Dir->setEnsureUpperBound(Exprs.EUB);

1554 Dir->setNextLowerBound(Exprs.NLB);

1555 Dir->setNextUpperBound(Exprs.NUB);

1556 Dir->setNumIterations(Exprs.NumIterations);

1557 Dir->setCounters(Exprs.Counters);

1558 Dir->setPrivateCounters(Exprs.PrivateCounters);

1559 Dir->setInits(Exprs.Inits);

1560 Dir->setUpdates(Exprs.Updates);

1561 Dir->setFinals(Exprs.Finals);

1562 Dir->setDependentCounters(Exprs.DependentCounters);

1563 Dir->setDependentInits(Exprs.DependentInits);

1564 Dir->setFinalsConditions(Exprs.FinalsConditions);

1565 Dir->setPreInits(Exprs.PreInits);

1566 Dir->setHasCancel(HasCancel);

1567 return Dir;

1568}

1569

1572 unsigned NumClauses,

1573 unsigned CollapsedNum,

1574 EmptyShell) {

1575 return createEmptyDirective(

1576 C, NumClauses, true,

1577 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop),

1578 CollapsedNum);

1579}

1580

1585 const HelperExprs &Exprs) {

1586 auto *Dir = createDirective(

1587 C, Clauses, AssociatedStmt,

1588 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),

1589 StartLoc, EndLoc, CollapsedNum);

1590 Dir->setIterationVariable(Exprs.IterationVarRef);

1591 Dir->setLastIteration(Exprs.LastIteration);

1592 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1593 Dir->setPreCond(Exprs.PreCond);

1594 Dir->setCond(Exprs.Cond);

1595 Dir->setInit(Exprs.Init);

1596 Dir->setInc(Exprs.Inc);

1597 Dir->setIsLastIterVariable(Exprs.IL);

1598 Dir->setLowerBoundVariable(Exprs.LB);

1599 Dir->setUpperBoundVariable(Exprs.UB);

1600 Dir->setStrideVariable(Exprs.ST);

1601 Dir->setEnsureUpperBound(Exprs.EUB);

1602 Dir->setNextLowerBound(Exprs.NLB);

1603 Dir->setNextUpperBound(Exprs.NUB);

1604 Dir->setNumIterations(Exprs.NumIterations);

1605 Dir->setCounters(Exprs.Counters);

1606 Dir->setPrivateCounters(Exprs.PrivateCounters);

1607 Dir->setInits(Exprs.Inits);

1608 Dir->setUpdates(Exprs.Updates);

1609 Dir->setFinals(Exprs.Finals);

1610 Dir->setDependentCounters(Exprs.DependentCounters);

1611 Dir->setDependentInits(Exprs.DependentInits);

1612 Dir->setFinalsConditions(Exprs.FinalsConditions);

1613 Dir->setPreInits(Exprs.PreInits);

1614 return Dir;

1615}

1616

1619 unsigned NumClauses,

1620 unsigned CollapsedNum,

1621 EmptyShell) {

1622 return createEmptyDirective(

1623 C, NumClauses, true,

1624 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd),

1625 CollapsedNum);

1626}

1627

1632 const HelperExprs &Exprs) {

1633 auto *Dir = createDirective(

1634 C, Clauses, AssociatedStmt,

1635 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd),

1636 StartLoc, EndLoc, CollapsedNum);

1637 Dir->setIterationVariable(Exprs.IterationVarRef);

1638 Dir->setLastIteration(Exprs.LastIteration);

1639 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1640 Dir->setPreCond(Exprs.PreCond);

1641 Dir->setCond(Exprs.Cond);

1642 Dir->setInit(Exprs.Init);

1643 Dir->setInc(Exprs.Inc);

1644 Dir->setIsLastIterVariable(Exprs.IL);

1645 Dir->setLowerBoundVariable(Exprs.LB);

1646 Dir->setUpperBoundVariable(Exprs.UB);

1647 Dir->setStrideVariable(Exprs.ST);

1648 Dir->setEnsureUpperBound(Exprs.EUB);

1649 Dir->setNextLowerBound(Exprs.NLB);

1650 Dir->setNextUpperBound(Exprs.NUB);

1651 Dir->setNumIterations(Exprs.NumIterations);

1652 Dir->setCounters(Exprs.Counters);

1653 Dir->setPrivateCounters(Exprs.PrivateCounters);

1654 Dir->setInits(Exprs.Inits);

1655 Dir->setUpdates(Exprs.Updates);

1656 Dir->setFinals(Exprs.Finals);

1657 Dir->setDependentCounters(Exprs.DependentCounters);

1658 Dir->setDependentInits(Exprs.DependentInits);

1659 Dir->setFinalsConditions(Exprs.FinalsConditions);

1660 Dir->setPreInits(Exprs.PreInits);

1661 return Dir;

1662}

1663

1666 unsigned NumClauses,

1667 unsigned CollapsedNum,

1668 EmptyShell) {

1669 return createEmptyDirective(

1670 C, NumClauses, true,

1671 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop_simd),

1672 CollapsedNum);

1673}

1674

1679 Stmt *AssociatedStmt, const HelperExprs &Exprs) {

1680 auto *Dir = createDirective(

1681 C, Clauses, AssociatedStmt,

1682 numLoopChildren(CollapsedNum, OMPD_distribute), StartLoc, EndLoc,

1683 CollapsedNum);

1684 Dir->setIterationVariable(Exprs.IterationVarRef);

1685 Dir->setLastIteration(Exprs.LastIteration);

1686 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1687 Dir->setPreCond(Exprs.PreCond);

1688 Dir->setCond(Exprs.Cond);

1689 Dir->setInit(Exprs.Init);

1690 Dir->setInc(Exprs.Inc);

1691 Dir->setIsLastIterVariable(Exprs.IL);

1692 Dir->setLowerBoundVariable(Exprs.LB);

1693 Dir->setUpperBoundVariable(Exprs.UB);

1694 Dir->setStrideVariable(Exprs.ST);

1695 Dir->setEnsureUpperBound(Exprs.EUB);

1696 Dir->setNextLowerBound(Exprs.NLB);

1697 Dir->setNextUpperBound(Exprs.NUB);

1698 Dir->setNumIterations(Exprs.NumIterations);

1699 Dir->setCounters(Exprs.Counters);

1700 Dir->setPrivateCounters(Exprs.PrivateCounters);

1701 Dir->setInits(Exprs.Inits);

1702 Dir->setUpdates(Exprs.Updates);

1703 Dir->setFinals(Exprs.Finals);

1704 Dir->setDependentCounters(Exprs.DependentCounters);

1705 Dir->setDependentInits(Exprs.DependentInits);

1706 Dir->setFinalsConditions(Exprs.FinalsConditions);

1707 Dir->setPreInits(Exprs.PreInits);

1708 return Dir;

1709}

1710

1713 unsigned CollapsedNum, EmptyShell) {

1714 return createEmptyDirective(

1715 C, NumClauses, true,

1716 numLoopChildren(CollapsedNum, OMPD_distribute), CollapsedNum);

1717}

1718

1722 return createDirective(C, Clauses, AssociatedStmt,

1723 0, StartLoc,

1724 EndLoc);

1725}

1726

1729 EmptyShell) {

1730 return createEmptyDirective(

1731 C, NumClauses, true);

1732}

1733

1737 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {

1738 auto *Dir = createDirective(

1739 C, Clauses, AssociatedStmt,

1740 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1, StartLoc,

1741 EndLoc, CollapsedNum);

1742 Dir->setIterationVariable(Exprs.IterationVarRef);

1743 Dir->setLastIteration(Exprs.LastIteration);

1744 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1745 Dir->setPreCond(Exprs.PreCond);

1746 Dir->setCond(Exprs.Cond);

1747 Dir->setInit(Exprs.Init);

1748 Dir->setInc(Exprs.Inc);

1749 Dir->setIsLastIterVariable(Exprs.IL);

1750 Dir->setLowerBoundVariable(Exprs.LB);

1751 Dir->setUpperBoundVariable(Exprs.UB);

1752 Dir->setStrideVariable(Exprs.ST);

1753 Dir->setEnsureUpperBound(Exprs.EUB);

1754 Dir->setNextLowerBound(Exprs.NLB);

1755 Dir->setNextUpperBound(Exprs.NUB);

1756 Dir->setNumIterations(Exprs.NumIterations);

1757 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);

1758 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);

1759 Dir->setDistInc(Exprs.DistInc);

1760 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);

1761 Dir->setCounters(Exprs.Counters);

1762 Dir->setPrivateCounters(Exprs.PrivateCounters);

1763 Dir->setInits(Exprs.Inits);

1764 Dir->setUpdates(Exprs.Updates);

1765 Dir->setFinals(Exprs.Finals);

1766 Dir->setDependentCounters(Exprs.DependentCounters);

1767 Dir->setDependentInits(Exprs.DependentInits);

1768 Dir->setFinalsConditions(Exprs.FinalsConditions);

1769 Dir->setPreInits(Exprs.PreInits);

1770 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);

1771 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);

1772 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);

1773 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);

1774 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);

1775 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);

1776 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);

1777 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);

1778 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);

1779 Dir->setTaskReductionRefExpr(TaskRedRef);

1780 Dir->HasCancel = HasCancel;

1781 return Dir;

1782}

1783

1786 unsigned NumClauses,

1787 unsigned CollapsedNum,

1788 EmptyShell) {

1789 return createEmptyDirective(

1790 C, NumClauses, true,

1791 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1,

1792 CollapsedNum);

1793}

1794

1799 const HelperExprs &Exprs) {

1800 auto *Dir = createDirective(

1801 C, Clauses, AssociatedStmt,

1802 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),

1803 StartLoc, EndLoc, CollapsedNum);

1804 Dir->setIterationVariable(Exprs.IterationVarRef);

1805 Dir->setLastIteration(Exprs.LastIteration);

1806 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1807 Dir->setPreCond(Exprs.PreCond);

1808 Dir->setCond(Exprs.Cond);

1809 Dir->setInit(Exprs.Init);

1810 Dir->setInc(Exprs.Inc);

1811 Dir->setIsLastIterVariable(Exprs.IL);

1812 Dir->setLowerBoundVariable(Exprs.LB);

1813 Dir->setUpperBoundVariable(Exprs.UB);

1814 Dir->setStrideVariable(Exprs.ST);

1815 Dir->setEnsureUpperBound(Exprs.EUB);

1816 Dir->setNextLowerBound(Exprs.NLB);

1817 Dir->setNextUpperBound(Exprs.NUB);

1818 Dir->setNumIterations(Exprs.NumIterations);

1819 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);

1820 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);

1821 Dir->setDistInc(Exprs.DistInc);

1822 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);

1823 Dir->setCounters(Exprs.Counters);

1824 Dir->setPrivateCounters(Exprs.PrivateCounters);

1825 Dir->setInits(Exprs.Inits);

1826 Dir->setUpdates(Exprs.Updates);

1827 Dir->setFinals(Exprs.Finals);

1828 Dir->setDependentCounters(Exprs.DependentCounters);

1829 Dir->setDependentInits(Exprs.DependentInits);

1830 Dir->setFinalsConditions(Exprs.FinalsConditions);

1831 Dir->setPreInits(Exprs.PreInits);

1832 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);

1833 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);

1834 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);

1835 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);

1836 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);

1837 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);

1838 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);

1839 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);

1840 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);

1841 return Dir;

1842}

1843

1846 unsigned NumClauses,

1847 unsigned CollapsedNum,

1848 EmptyShell) {

1849 return createEmptyDirective(

1850 C, NumClauses, true,

1851 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd),

1852 CollapsedNum);

1853}

1854

1858 const HelperExprs &Exprs) {

1859 auto *Dir = createDirective(

1860 C, Clauses, AssociatedStmt,

1861 numLoopChildren(CollapsedNum, OMPD_distribute_simd), StartLoc, EndLoc,

1862 CollapsedNum);

1863 Dir->setIterationVariable(Exprs.IterationVarRef);

1864 Dir->setLastIteration(Exprs.LastIteration);

1865 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1866 Dir->setPreCond(Exprs.PreCond);

1867 Dir->setCond(Exprs.Cond);

1868 Dir->setInit(Exprs.Init);

1869 Dir->setInc(Exprs.Inc);

1870 Dir->setIsLastIterVariable(Exprs.IL);

1871 Dir->setLowerBoundVariable(Exprs.LB);

1872 Dir->setUpperBoundVariable(Exprs.UB);

1873 Dir->setStrideVariable(Exprs.ST);

1874 Dir->setEnsureUpperBound(Exprs.EUB);

1875 Dir->setNextLowerBound(Exprs.NLB);

1876 Dir->setNextUpperBound(Exprs.NUB);

1877 Dir->setNumIterations(Exprs.NumIterations);

1878 Dir->setCounters(Exprs.Counters);

1879 Dir->setPrivateCounters(Exprs.PrivateCounters);

1880 Dir->setInits(Exprs.Inits);

1881 Dir->setUpdates(Exprs.Updates);

1882 Dir->setFinals(Exprs.Finals);

1883 Dir->setDependentCounters(Exprs.DependentCounters);

1884 Dir->setDependentInits(Exprs.DependentInits);

1885 Dir->setFinalsConditions(Exprs.FinalsConditions);

1886 Dir->setPreInits(Exprs.PreInits);

1887 return Dir;

1888}

1889

1892 unsigned NumClauses,

1893 unsigned CollapsedNum, EmptyShell) {

1894 return createEmptyDirective(

1895 C, NumClauses, true,

1896 numLoopChildren(CollapsedNum, OMPD_distribute_simd), CollapsedNum);

1897}

1898

1902 const HelperExprs &Exprs) {

1903 auto *Dir = createDirective(

1904 C, Clauses, AssociatedStmt,

1905 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd), StartLoc,

1906 EndLoc, CollapsedNum);

1907 Dir->setIterationVariable(Exprs.IterationVarRef);

1908 Dir->setLastIteration(Exprs.LastIteration);

1909 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1910 Dir->setPreCond(Exprs.PreCond);

1911 Dir->setCond(Exprs.Cond);

1912 Dir->setInit(Exprs.Init);

1913 Dir->setInc(Exprs.Inc);

1914 Dir->setIsLastIterVariable(Exprs.IL);

1915 Dir->setLowerBoundVariable(Exprs.LB);

1916 Dir->setUpperBoundVariable(Exprs.UB);

1917 Dir->setStrideVariable(Exprs.ST);

1918 Dir->setEnsureUpperBound(Exprs.EUB);

1919 Dir->setNextLowerBound(Exprs.NLB);

1920 Dir->setNextUpperBound(Exprs.NUB);

1921 Dir->setNumIterations(Exprs.NumIterations);

1922 Dir->setCounters(Exprs.Counters);

1923 Dir->setPrivateCounters(Exprs.PrivateCounters);

1924 Dir->setInits(Exprs.Inits);

1925 Dir->setUpdates(Exprs.Updates);

1926 Dir->setFinals(Exprs.Finals);

1927 Dir->setDependentCounters(Exprs.DependentCounters);

1928 Dir->setDependentInits(Exprs.DependentInits);

1929 Dir->setFinalsConditions(Exprs.FinalsConditions);

1930 Dir->setPreInits(Exprs.PreInits);

1931 return Dir;

1932}

1933

1936 unsigned NumClauses,

1937 unsigned CollapsedNum,

1938 EmptyShell) {

1939 return createEmptyDirective(

1940 C, NumClauses, true,

1941 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd),

1942 CollapsedNum);

1943}

1944

1949 Stmt *AssociatedStmt, const HelperExprs &Exprs) {

1950 auto *Dir = createDirective(

1951 C, Clauses, AssociatedStmt,

1952 numLoopChildren(CollapsedNum, OMPD_target_simd), StartLoc, EndLoc,

1953 CollapsedNum);

1954 Dir->setIterationVariable(Exprs.IterationVarRef);

1955 Dir->setLastIteration(Exprs.LastIteration);

1956 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1957 Dir->setPreCond(Exprs.PreCond);

1958 Dir->setCond(Exprs.Cond);

1959 Dir->setInit(Exprs.Init);

1960 Dir->setInc(Exprs.Inc);

1961 Dir->setCounters(Exprs.Counters);

1962 Dir->setPrivateCounters(Exprs.PrivateCounters);

1963 Dir->setInits(Exprs.Inits);

1964 Dir->setUpdates(Exprs.Updates);

1965 Dir->setFinals(Exprs.Finals);

1966 Dir->setDependentCounters(Exprs.DependentCounters);

1967 Dir->setDependentInits(Exprs.DependentInits);

1968 Dir->setFinalsConditions(Exprs.FinalsConditions);

1969 Dir->setPreInits(Exprs.PreInits);

1970 return Dir;

1971}

1972

1975 unsigned CollapsedNum, EmptyShell) {

1976 return createEmptyDirective(

1977 C, NumClauses, true,

1978 numLoopChildren(CollapsedNum, OMPD_target_simd), CollapsedNum);

1979}

1980

1984 const HelperExprs &Exprs) {

1985 auto *Dir = createDirective(

1986 C, Clauses, AssociatedStmt,

1987 numLoopChildren(CollapsedNum, OMPD_teams_distribute), StartLoc, EndLoc,

1988 CollapsedNum);

1989 Dir->setIterationVariable(Exprs.IterationVarRef);

1990 Dir->setLastIteration(Exprs.LastIteration);

1991 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

1992 Dir->setPreCond(Exprs.PreCond);

1993 Dir->setCond(Exprs.Cond);

1994 Dir->setInit(Exprs.Init);

1995 Dir->setInc(Exprs.Inc);

1996 Dir->setIsLastIterVariable(Exprs.IL);

1997 Dir->setLowerBoundVariable(Exprs.LB);

1998 Dir->setUpperBoundVariable(Exprs.UB);

1999 Dir->setStrideVariable(Exprs.ST);

2000 Dir->setEnsureUpperBound(Exprs.EUB);

2001 Dir->setNextLowerBound(Exprs.NLB);

2002 Dir->setNextUpperBound(Exprs.NUB);

2003 Dir->setNumIterations(Exprs.NumIterations);

2004 Dir->setCounters(Exprs.Counters);

2005 Dir->setPrivateCounters(Exprs.PrivateCounters);

2006 Dir->setInits(Exprs.Inits);

2007 Dir->setUpdates(Exprs.Updates);

2008 Dir->setFinals(Exprs.Finals);

2009 Dir->setDependentCounters(Exprs.DependentCounters);

2010 Dir->setDependentInits(Exprs.DependentInits);

2011 Dir->setFinalsConditions(Exprs.FinalsConditions);

2012 Dir->setPreInits(Exprs.PreInits);

2013 return Dir;

2014}

2015

2018 unsigned NumClauses,

2019 unsigned CollapsedNum, EmptyShell) {

2020 return createEmptyDirective(

2021 C, NumClauses, true,

2022 numLoopChildren(CollapsedNum, OMPD_teams_distribute), CollapsedNum);

2023}

2024

2028 const HelperExprs &Exprs) {

2029 auto *Dir = createDirective(

2030 C, Clauses, AssociatedStmt,

2031 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), StartLoc,

2032 EndLoc, CollapsedNum);

2033 Dir->setIterationVariable(Exprs.IterationVarRef);

2034 Dir->setLastIteration(Exprs.LastIteration);

2035 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

2036 Dir->setPreCond(Exprs.PreCond);

2037 Dir->setCond(Exprs.Cond);

2038 Dir->setInit(Exprs.Init);

2039 Dir->setInc(Exprs.Inc);

2040 Dir->setIsLastIterVariable(Exprs.IL);

2041 Dir->setLowerBoundVariable(Exprs.LB);

2042 Dir->setUpperBoundVariable(Exprs.UB);

2043 Dir->setStrideVariable(Exprs.ST);

2044 Dir->setEnsureUpperBound(Exprs.EUB);

2045 Dir->setNextLowerBound(Exprs.NLB);

2046 Dir->setNextUpperBound(Exprs.NUB);

2047 Dir->setNumIterations(Exprs.NumIterations);

2048 Dir->setCounters(Exprs.Counters);

2049 Dir->setPrivateCounters(Exprs.PrivateCounters);

2050 Dir->setInits(Exprs.Inits);

2051 Dir->setUpdates(Exprs.Updates);

2052 Dir->setFinals(Exprs.Finals);

2053 Dir->setDependentCounters(Exprs.DependentCounters);

2054 Dir->setDependentInits(Exprs.DependentInits);

2055 Dir->setFinalsConditions(Exprs.FinalsConditions);

2056 Dir->setPreInits(Exprs.PreInits);

2057 return Dir;

2058}

2059

2061 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,

2062 EmptyShell) {

2063 return createEmptyDirective(

2064 C, NumClauses, true,

2065 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), CollapsedNum);

2066}

2067

2072 const HelperExprs &Exprs) {

2073 auto *Dir = createDirective(

2074 C, Clauses, AssociatedStmt,

2075 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),

2076 StartLoc, EndLoc, CollapsedNum);

2077 Dir->setIterationVariable(Exprs.IterationVarRef);

2078 Dir->setLastIteration(Exprs.LastIteration);

2079 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

2080 Dir->setPreCond(Exprs.PreCond);

2081 Dir->setCond(Exprs.Cond);

2082 Dir->setInit(Exprs.Init);

2083 Dir->setInc(Exprs.Inc);

2084 Dir->setIsLastIterVariable(Exprs.IL);

2085 Dir->setLowerBoundVariable(Exprs.LB);

2086 Dir->setUpperBoundVariable(Exprs.UB);

2087 Dir->setStrideVariable(Exprs.ST);

2088 Dir->setEnsureUpperBound(Exprs.EUB);

2089 Dir->setNextLowerBound(Exprs.NLB);

2090 Dir->setNextUpperBound(Exprs.NUB);

2091 Dir->setNumIterations(Exprs.NumIterations);

2092 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);

2093 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);

2094 Dir->setDistInc(Exprs.DistInc);

2095 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);

2096 Dir->setCounters(Exprs.Counters);

2097 Dir->setPrivateCounters(Exprs.PrivateCounters);

2098 Dir->setInits(Exprs.Inits);

2099 Dir->setUpdates(Exprs.Updates);

2100 Dir->setFinals(Exprs.Finals);

2101 Dir->setDependentCounters(Exprs.DependentCounters);

2102 Dir->setDependentInits(Exprs.DependentInits);

2103 Dir->setFinalsConditions(Exprs.FinalsConditions);

2104 Dir->setPreInits(Exprs.PreInits);

2105 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);

2106 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);

2107 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);

2108 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);

2109 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);

2110 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);

2111 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);

2112 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);

2113 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);

2114 return Dir;

2115}

2116

2119 unsigned NumClauses,

2120 unsigned CollapsedNum,

2121 EmptyShell) {

2122 return createEmptyDirective(

2123 C, NumClauses, true,

2124 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),

2125 CollapsedNum);

2126}

2127

2132 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {

2133 auto *Dir = createDirective(

2134 C, Clauses, AssociatedStmt,

2135 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,

2136 StartLoc, EndLoc, CollapsedNum);

2137 Dir->setIterationVariable(Exprs.IterationVarRef);

2138 Dir->setLastIteration(Exprs.LastIteration);

2139 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

2140 Dir->setPreCond(Exprs.PreCond);

2141 Dir->setCond(Exprs.Cond);

2142 Dir->setInit(Exprs.Init);

2143 Dir->setInc(Exprs.Inc);

2144 Dir->setIsLastIterVariable(Exprs.IL);

2145 Dir->setLowerBoundVariable(Exprs.LB);

2146 Dir->setUpperBoundVariable(Exprs.UB);

2147 Dir->setStrideVariable(Exprs.ST);

2148 Dir->setEnsureUpperBound(Exprs.EUB);

2149 Dir->setNextLowerBound(Exprs.NLB);

2150 Dir->setNextUpperBound(Exprs.NUB);

2151 Dir->setNumIterations(Exprs.NumIterations);

2152 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);

2153 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);

2154 Dir->setDistInc(Exprs.DistInc);

2155 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);

2156 Dir->setCounters(Exprs.Counters);

2157 Dir->setPrivateCounters(Exprs.PrivateCounters);

2158 Dir->setInits(Exprs.Inits);

2159 Dir->setUpdates(Exprs.Updates);

2160 Dir->setFinals(Exprs.Finals);

2161 Dir->setDependentCounters(Exprs.DependentCounters);

2162 Dir->setDependentInits(Exprs.DependentInits);

2163 Dir->setFinalsConditions(Exprs.FinalsConditions);

2164 Dir->setPreInits(Exprs.PreInits);

2165 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);

2166 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);

2167 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);

2168 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);

2169 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);

2170 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);

2171 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);

2172 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);

2173 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);

2174 Dir->setTaskReductionRefExpr(TaskRedRef);

2175 Dir->HasCancel = HasCancel;

2176 return Dir;

2177}

2178

2181 unsigned NumClauses,

2182 unsigned CollapsedNum,

2183 EmptyShell) {

2184 return createEmptyDirective(

2185 C, NumClauses, true,

2186 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,

2187 CollapsedNum);

2188}

2189

2193 return createDirective(C, Clauses, AssociatedStmt,

2194 0, StartLoc,

2195 EndLoc);

2196}

2197

2200 EmptyShell) {

2201 return createEmptyDirective(

2202 C, NumClauses, true);

2203}

2204

2208 const HelperExprs &Exprs) {

2209 auto *Dir = createDirective(

2210 C, Clauses, AssociatedStmt,

2211 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute), StartLoc,

2212 EndLoc, CollapsedNum);

2213 Dir->setIterationVariable(Exprs.IterationVarRef);

2214 Dir->setLastIteration(Exprs.LastIteration);

2215 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

2216 Dir->setPreCond(Exprs.PreCond);

2217 Dir->setCond(Exprs.Cond);

2218 Dir->setInit(Exprs.Init);

2219 Dir->setInc(Exprs.Inc);

2220 Dir->setIsLastIterVariable(Exprs.IL);

2221 Dir->setLowerBoundVariable(Exprs.LB);

2222 Dir->setUpperBoundVariable(Exprs.UB);

2223 Dir->setStrideVariable(Exprs.ST);

2224 Dir->setEnsureUpperBound(Exprs.EUB);

2225 Dir->setNextLowerBound(Exprs.NLB);

2226 Dir->setNextUpperBound(Exprs.NUB);

2227 Dir->setNumIterations(Exprs.NumIterations);

2228 Dir->setCounters(Exprs.Counters);

2229 Dir->setPrivateCounters(Exprs.PrivateCounters);

2230 Dir->setInits(Exprs.Inits);

2231 Dir->setUpdates(Exprs.Updates);

2232 Dir->setFinals(Exprs.Finals);

2233 Dir->setDependentCounters(Exprs.DependentCounters);

2234 Dir->setDependentInits(Exprs.DependentInits);

2235 Dir->setFinalsConditions(Exprs.FinalsConditions);

2236 Dir->setPreInits(Exprs.PreInits);

2237 return Dir;

2238}

2239

2242 unsigned NumClauses,

2243 unsigned CollapsedNum,

2244 EmptyShell) {

2245 return createEmptyDirective(

2246 C, NumClauses, true,

2247 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute),

2248 CollapsedNum);

2249}

2250

2255 const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {

2256 auto *Dir = createDirective(

2257 C, Clauses, AssociatedStmt,

2258 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +

2259 1,

2260 StartLoc, EndLoc, CollapsedNum);

2261 Dir->setIterationVariable(Exprs.IterationVarRef);

2262 Dir->setLastIteration(Exprs.LastIteration);

2263 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

2264 Dir->setPreCond(Exprs.PreCond);

2265 Dir->setCond(Exprs.Cond);

2266 Dir->setInit(Exprs.Init);

2267 Dir->setInc(Exprs.Inc);

2268 Dir->setIsLastIterVariable(Exprs.IL);

2269 Dir->setLowerBoundVariable(Exprs.LB);

2270 Dir->setUpperBoundVariable(Exprs.UB);

2271 Dir->setStrideVariable(Exprs.ST);

2272 Dir->setEnsureUpperBound(Exprs.EUB);

2273 Dir->setNextLowerBound(Exprs.NLB);

2274 Dir->setNextUpperBound(Exprs.NUB);

2275 Dir->setNumIterations(Exprs.NumIterations);

2276 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);

2277 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);

2278 Dir->setDistInc(Exprs.DistInc);

2279 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);

2280 Dir->setCounters(Exprs.Counters);

2281 Dir->setPrivateCounters(Exprs.PrivateCounters);

2282 Dir->setInits(Exprs.Inits);

2283 Dir->setUpdates(Exprs.Updates);

2284 Dir->setFinals(Exprs.Finals);

2285 Dir->setDependentCounters(Exprs.DependentCounters);

2286 Dir->setDependentInits(Exprs.DependentInits);

2287 Dir->setFinalsConditions(Exprs.FinalsConditions);

2288 Dir->setPreInits(Exprs.PreInits);

2289 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);

2290 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);

2291 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);

2292 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);

2293 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);

2294 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);

2295 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);

2296 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);

2297 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);

2298 Dir->setTaskReductionRefExpr(TaskRedRef);

2299 Dir->HasCancel = HasCancel;

2300 return Dir;

2301}

2302

2305 unsigned NumClauses,

2306 unsigned CollapsedNum,

2307 EmptyShell) {

2308 return createEmptyDirective(

2309 C, NumClauses, true,

2310 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +

2311 1,

2312 CollapsedNum);

2313}

2314

2319 const HelperExprs &Exprs) {

2320 auto *Dir = createDirective(

2321 C, Clauses, AssociatedStmt,

2322 numLoopChildren(CollapsedNum,

2323 OMPD_target_teams_distribute_parallel_for_simd),

2324 StartLoc, EndLoc, CollapsedNum);

2325 Dir->setIterationVariable(Exprs.IterationVarRef);

2326 Dir->setLastIteration(Exprs.LastIteration);

2327 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

2328 Dir->setPreCond(Exprs.PreCond);

2329 Dir->setCond(Exprs.Cond);

2330 Dir->setInit(Exprs.Init);

2331 Dir->setInc(Exprs.Inc);

2332 Dir->setIsLastIterVariable(Exprs.IL);

2333 Dir->setLowerBoundVariable(Exprs.LB);

2334 Dir->setUpperBoundVariable(Exprs.UB);

2335 Dir->setStrideVariable(Exprs.ST);

2336 Dir->setEnsureUpperBound(Exprs.EUB);

2337 Dir->setNextLowerBound(Exprs.NLB);

2338 Dir->setNextUpperBound(Exprs.NUB);

2339 Dir->setNumIterations(Exprs.NumIterations);

2340 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);

2341 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);

2342 Dir->setDistInc(Exprs.DistInc);

2343 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);

2344 Dir->setCounters(Exprs.Counters);

2345 Dir->setPrivateCounters(Exprs.PrivateCounters);

2346 Dir->setInits(Exprs.Inits);

2347 Dir->setUpdates(Exprs.Updates);

2348 Dir->setFinals(Exprs.Finals);

2349 Dir->setDependentCounters(Exprs.DependentCounters);

2350 Dir->setDependentInits(Exprs.DependentInits);

2351 Dir->setFinalsConditions(Exprs.FinalsConditions);

2352 Dir->setPreInits(Exprs.PreInits);

2353 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);

2354 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);

2355 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);

2356 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);

2357 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);

2358 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);

2359 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);

2360 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);

2361 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);

2362 return Dir;

2363}

2364

2367 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,

2368 EmptyShell) {

2369 return createEmptyDirective(

2370 C, NumClauses, true,

2371 numLoopChildren(CollapsedNum,

2372 OMPD_target_teams_distribute_parallel_for_simd),

2373 CollapsedNum);

2374}

2375

2380 const HelperExprs &Exprs) {

2381 auto *Dir = createDirective(

2382 C, Clauses, AssociatedStmt,

2383 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),

2384 StartLoc, EndLoc, CollapsedNum);

2385 Dir->setIterationVariable(Exprs.IterationVarRef);

2386 Dir->setLastIteration(Exprs.LastIteration);

2387 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

2388 Dir->setPreCond(Exprs.PreCond);

2389 Dir->setCond(Exprs.Cond);

2390 Dir->setInit(Exprs.Init);

2391 Dir->setInc(Exprs.Inc);

2392 Dir->setIsLastIterVariable(Exprs.IL);

2393 Dir->setLowerBoundVariable(Exprs.LB);

2394 Dir->setUpperBoundVariable(Exprs.UB);

2395 Dir->setStrideVariable(Exprs.ST);

2396 Dir->setEnsureUpperBound(Exprs.EUB);

2397 Dir->setNextLowerBound(Exprs.NLB);

2398 Dir->setNextUpperBound(Exprs.NUB);

2399 Dir->setNumIterations(Exprs.NumIterations);

2400 Dir->setCounters(Exprs.Counters);

2401 Dir->setPrivateCounters(Exprs.PrivateCounters);

2402 Dir->setInits(Exprs.Inits);

2403 Dir->setUpdates(Exprs.Updates);

2404 Dir->setFinals(Exprs.Finals);

2405 Dir->setDependentCounters(Exprs.DependentCounters);

2406 Dir->setDependentInits(Exprs.DependentInits);

2407 Dir->setFinalsConditions(Exprs.FinalsConditions);

2408 Dir->setPreInits(Exprs.PreInits);

2409 return Dir;

2410}

2411

2414 unsigned NumClauses,

2415 unsigned CollapsedNum,

2416 EmptyShell) {

2417 return createEmptyDirective(

2418 C, NumClauses, true,

2419 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd),

2420 CollapsedNum);

2421}

2422

2427 return createDirective(

2428 C, Clauses, nullptr, 0, StartLoc,

2429 EndLoc);

2430}

2431

2433 unsigned NumClauses,

2434 EmptyShell) {

2435 return createEmptyDirective(C, NumClauses);

2436}

2437

2442 auto *Dir = createDirective(

2443 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);

2444 Dir->setTargetCallLoc(TargetCallLoc);

2445 return Dir;

2446}

2447

2449 unsigned NumClauses,

2450 EmptyShell) {

2451 return createEmptyDirective(C, NumClauses,

2452 true,

2453 0);

2454}

2455

2460 Stmt *AssociatedStmt) {

2461 return createDirective(C, Clauses, AssociatedStmt,

2462 0, StartLoc,

2463 EndLoc);

2464}

2465

2467 unsigned NumClauses,

2468 EmptyShell) {

2469 return createEmptyDirective(C, NumClauses,

2470 true);

2471}

2472

2476 const HelperExprs &Exprs) {

2477 auto *Dir = createDirective(

2478 C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_loop),

2479 StartLoc, EndLoc, CollapsedNum);

2480 Dir->setIterationVariable(Exprs.IterationVarRef);

2481 Dir->setLastIteration(Exprs.LastIteration);

2482 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

2483 Dir->setPreCond(Exprs.PreCond);

2484 Dir->setCond(Exprs.Cond);

2485 Dir->setInit(Exprs.Init);

2486 Dir->setInc(Exprs.Inc);

2487 Dir->setIsLastIterVariable(Exprs.IL);

2488 Dir->setLowerBoundVariable(Exprs.LB);

2489 Dir->setUpperBoundVariable(Exprs.UB);

2490 Dir->setStrideVariable(Exprs.ST);

2491 Dir->setEnsureUpperBound(Exprs.EUB);

2492 Dir->setNextLowerBound(Exprs.NLB);

2493 Dir->setNextUpperBound(Exprs.NUB);

2494 Dir->setNumIterations(Exprs.NumIterations);

2495 Dir->setCounters(Exprs.Counters);

2496 Dir->setPrivateCounters(Exprs.PrivateCounters);

2497 Dir->setInits(Exprs.Inits);

2498 Dir->setUpdates(Exprs.Updates);

2499 Dir->setFinals(Exprs.Finals);

2500 Dir->setDependentCounters(Exprs.DependentCounters);

2501 Dir->setDependentInits(Exprs.DependentInits);

2502 Dir->setFinalsConditions(Exprs.FinalsConditions);

2503 Dir->setPreInits(Exprs.PreInits);

2504 return Dir;

2505}

2506

2509 unsigned CollapsedNum, EmptyShell) {

2510 return createEmptyDirective(

2511 C, NumClauses, true,

2512 numLoopChildren(CollapsedNum, OMPD_loop), CollapsedNum);

2513}

2514

2518 const HelperExprs &Exprs) {

2519 auto *Dir = createDirective(

2520 C, Clauses, AssociatedStmt,

2521 numLoopChildren(CollapsedNum, OMPD_teams_loop), StartLoc, EndLoc,

2522 CollapsedNum);

2523 Dir->setIterationVariable(Exprs.IterationVarRef);

2524 Dir->setLastIteration(Exprs.LastIteration);

2525 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

2526 Dir->setPreCond(Exprs.PreCond);

2527 Dir->setCond(Exprs.Cond);

2528 Dir->setInit(Exprs.Init);

2529 Dir->setInc(Exprs.Inc);

2530 Dir->setIsLastIterVariable(Exprs.IL);

2531 Dir->setLowerBoundVariable(Exprs.LB);

2532 Dir->setUpperBoundVariable(Exprs.UB);

2533 Dir->setStrideVariable(Exprs.ST);

2534 Dir->setEnsureUpperBound(Exprs.EUB);

2535 Dir->setNextLowerBound(Exprs.NLB);

2536 Dir->setNextUpperBound(Exprs.NUB);

2537 Dir->setNumIterations(Exprs.NumIterations);

2538 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);

2539 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);

2540 Dir->setDistInc(Exprs.DistInc);

2541 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);

2542 Dir->setCounters(Exprs.Counters);

2543 Dir->setPrivateCounters(Exprs.PrivateCounters);

2544 Dir->setInits(Exprs.Inits);

2545 Dir->setUpdates(Exprs.Updates);

2546 Dir->setFinals(Exprs.Finals);

2547 Dir->setDependentCounters(Exprs.DependentCounters);

2548 Dir->setDependentInits(Exprs.DependentInits);

2549 Dir->setFinalsConditions(Exprs.FinalsConditions);

2550 Dir->setPreInits(Exprs.PreInits);

2551 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);

2552 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);

2553 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);

2554 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);

2555 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);

2556 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);

2557 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);

2558 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);

2559 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);

2560 return Dir;

2561}

2562

2565 unsigned NumClauses,

2566 unsigned CollapsedNum, EmptyShell) {

2567 return createEmptyDirective(

2568 C, NumClauses, true,

2569 numLoopChildren(CollapsedNum, OMPD_teams_loop), CollapsedNum);

2570}

2571

2575 const HelperExprs &Exprs, bool CanBeParallelFor) {

2576 auto *Dir = createDirective(

2577 C, Clauses, AssociatedStmt,

2578 numLoopChildren(CollapsedNum, OMPD_target_teams_loop), StartLoc, EndLoc,

2579 CollapsedNum);

2580 Dir->setIterationVariable(Exprs.IterationVarRef);

2581 Dir->setLastIteration(Exprs.LastIteration);

2582 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

2583 Dir->setPreCond(Exprs.PreCond);

2584 Dir->setCond(Exprs.Cond);

2585 Dir->setInit(Exprs.Init);

2586 Dir->setInc(Exprs.Inc);

2587 Dir->setIsLastIterVariable(Exprs.IL);

2588 Dir->setLowerBoundVariable(Exprs.LB);

2589 Dir->setUpperBoundVariable(Exprs.UB);

2590 Dir->setStrideVariable(Exprs.ST);

2591 Dir->setEnsureUpperBound(Exprs.EUB);

2592 Dir->setNextLowerBound(Exprs.NLB);

2593 Dir->setNextUpperBound(Exprs.NUB);

2594 Dir->setNumIterations(Exprs.NumIterations);

2595 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);

2596 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);

2597 Dir->setDistInc(Exprs.DistInc);

2598 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);

2599 Dir->setCounters(Exprs.Counters);

2600 Dir->setPrivateCounters(Exprs.PrivateCounters);

2601 Dir->setInits(Exprs.Inits);

2602 Dir->setUpdates(Exprs.Updates);

2603 Dir->setFinals(Exprs.Finals);

2604 Dir->setDependentCounters(Exprs.DependentCounters);

2605 Dir->setDependentInits(Exprs.DependentInits);

2606 Dir->setFinalsConditions(Exprs.FinalsConditions);

2607 Dir->setPreInits(Exprs.PreInits);

2608 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);

2609 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);

2610 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);

2611 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);

2612 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);

2613 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);

2614 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);

2615 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);

2616 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);

2617 Dir->setCanBeParallelFor(CanBeParallelFor);

2618 return Dir;

2619}

2620

2623 unsigned NumClauses,

2624 unsigned CollapsedNum,

2625 EmptyShell) {

2626 return createEmptyDirective(

2627 C, NumClauses, true,

2628 numLoopChildren(CollapsedNum, OMPD_target_teams_loop), CollapsedNum);

2629}

2630

2634 const HelperExprs &Exprs) {

2635 auto *Dir = createDirective(

2636 C, Clauses, AssociatedStmt,

2637 numLoopChildren(CollapsedNum, OMPD_parallel_loop), StartLoc, EndLoc,

2638 CollapsedNum);

2639 Dir->setIterationVariable(Exprs.IterationVarRef);

2640 Dir->setLastIteration(Exprs.LastIteration);

2641 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

2642 Dir->setPreCond(Exprs.PreCond);

2643 Dir->setCond(Exprs.Cond);

2644 Dir->setInit(Exprs.Init);

2645 Dir->setInc(Exprs.Inc);

2646 Dir->setIsLastIterVariable(Exprs.IL);

2647 Dir->setLowerBoundVariable(Exprs.LB);

2648 Dir->setUpperBoundVariable(Exprs.UB);

2649 Dir->setStrideVariable(Exprs.ST);

2650 Dir->setEnsureUpperBound(Exprs.EUB);

2651 Dir->setNextLowerBound(Exprs.NLB);

2652 Dir->setNextUpperBound(Exprs.NUB);

2653 Dir->setNumIterations(Exprs.NumIterations);

2654 Dir->setCounters(Exprs.Counters);

2655 Dir->setPrivateCounters(Exprs.PrivateCounters);

2656 Dir->setInits(Exprs.Inits);

2657 Dir->setUpdates(Exprs.Updates);

2658 Dir->setFinals(Exprs.Finals);

2659 Dir->setDependentCounters(Exprs.DependentCounters);

2660 Dir->setDependentInits(Exprs.DependentInits);

2661 Dir->setFinalsConditions(Exprs.FinalsConditions);

2662 Dir->setPreInits(Exprs.PreInits);

2663 return Dir;

2664}

2665

2667 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,

2668 EmptyShell) {

2669 return createEmptyDirective(

2670 C, NumClauses, true,

2671 numLoopChildren(CollapsedNum, OMPD_parallel_loop), CollapsedNum);

2672}

2673

2678 const HelperExprs &Exprs) {

2679 auto *Dir = createDirective(

2680 C, Clauses, AssociatedStmt,

2681 numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), StartLoc,

2682 EndLoc, CollapsedNum);

2683 Dir->setIterationVariable(Exprs.IterationVarRef);

2684 Dir->setLastIteration(Exprs.LastIteration);

2685 Dir->setCalcLastIteration(Exprs.CalcLastIteration);

2686 Dir->setPreCond(Exprs.PreCond);

2687 Dir->setCond(Exprs.Cond);

2688 Dir->setInit(Exprs.Init);

2689 Dir->setInc(Exprs.Inc);

2690 Dir->setIsLastIterVariable(Exprs.IL);

2691 Dir->setLowerBoundVariable(Exprs.LB);

2692 Dir->setUpperBoundVariable(Exprs.UB);

2693 Dir->setStrideVariable(Exprs.ST);

2694 Dir->setEnsureUpperBound(Exprs.EUB);

2695 Dir->setNextLowerBound(Exprs.NLB);

2696 Dir->setNextUpperBound(Exprs.NUB);

2697 Dir->setNumIterations(Exprs.NumIterations);

2698 Dir->setCounters(Exprs.Counters);

2699 Dir->setPrivateCounters(Exprs.PrivateCounters);

2700 Dir->setInits(Exprs.Inits);

2701 Dir->setUpdates(Exprs.Updates);

2702 Dir->setFinals(Exprs.Finals);

2703 Dir->setDependentCounters(Exprs.DependentCounters);

2704 Dir->setDependentInits(Exprs.DependentInits);

2705 Dir->setFinalsConditions(Exprs.FinalsConditions);

2706 Dir->setPreInits(Exprs.PreInits);

2707 return Dir;

2708}

2709

2712 unsigned NumClauses,

2713 unsigned CollapsedNum,

2714 EmptyShell) {

2715 return createEmptyDirective(

2716 C, NumClauses, true,

2717 numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), CollapsedNum);

2718}

Defines the clang::ASTContext interface.

This file defines OpenMP AST classes for executable directives and clauses.

static OMPAssumeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)

Definition StmtOpenMP.cpp:900

static OMPAssumeDirective * Create(const ASTContext &Ctx, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AStmt)

Definition StmtOpenMP.cpp:890

This represents 'pragma omp cancel' directive.

static OMPCancelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, OpenMPDirectiveKind CancelRegion)

Creates directive.

Definition StmtOpenMP.cpp:978

static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)

Creates an empty directive.

Definition StmtOpenMP.cpp:988

This represents 'pragma omp cancellation point' directive.

static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)

Creates an empty directive.

Definition StmtOpenMP.cpp:973

static OMPCancellationPointDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)

Creates directive.

Definition StmtOpenMP.cpp:964

Stmt * getPreInits() const

Return preinits statement.

Definition StmtOpenMP.cpp:429

Stmt * getTransformedStmt() const

Get the de-sugared statements after the loop transformation.

Definition StmtOpenMP.cpp:416

static OMPDispatchDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, SourceLocation TargetCallLoc)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:2438

static OMPDispatchDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:2448

This represents 'pragma omp distribute' directive.

static OMPDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1676

static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1712

This represents 'pragma omp distribute parallel for' composite directive.

static OMPDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1785

static OMPDistributeParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1734

This represents 'pragma omp distribute parallel for simd' composite directive.

static OMPDistributeParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1796

static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1845

This represents 'pragma omp distribute simd' composite directive.

static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1891

static OMPDistributeSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1855

static OMPErrorDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)

Definition StmtOpenMP.cpp:907

static OMPErrorDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)

Creates an empty directive.

Definition StmtOpenMP.cpp:916

static OMPFuseDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumGeneratedTopLevelLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits)

Create a new AST node representation for pragma omp fuse'.

Definition StmtOpenMP.cpp:555

static OMPFuseDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)

Build an empty 'pragma omp fuse' AST node for deserialization.

Definition StmtOpenMP.cpp:568

This represents 'pragma omp loop' directive.

static OMPGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with a place for NumClauses clauses.

Definition StmtOpenMP.cpp:2508

static OMPGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:2473

Represents the 'pragma omp interchange' loop transformation directive.

static OMPInterchangeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)

Build an empty 'pragma omp interchange' AST node for deserialization.

Definition StmtOpenMP.cpp:548

static OMPInterchangeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits)

Create a new AST node representation for 'pragma omp interchange'.

Definition StmtOpenMP.cpp:535

This represents 'pragma omp interop' directive.

static OMPInteropDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)

Creates an empty directive.

Definition StmtOpenMP.cpp:2432

static OMPInteropDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)

Creates directive.

Definition StmtOpenMP.cpp:2424

static OMPMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)

Creates an empty directive.

Definition StmtOpenMP.cpp:2466

static OMPMaskedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)

Creates directive.

Definition StmtOpenMP.cpp:2456

This represents 'pragma omp masked taskloop' directive.

static OMPMaskedTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1354

static OMPMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1391

This represents 'pragma omp masked taskloop simd' directive.

static OMPMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1479

static OMPMaskedTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1443

This represents 'pragma omp master taskloop' directive.

static OMPMasterTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1309

static OMPMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1346

This represents 'pragma omp master taskloop simd' directive.

static OMPMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1435

static OMPMasterTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1399

static OMPParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:2666

static OMPParallelGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:2631

This represents 'pragma omp parallel masked taskloop' directive.

static OMPParallelMaskedTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1534

static OMPParallelMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1571

This represents 'pragma omp parallel masked taskloop simd' directive.

static OMPParallelMaskedTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1629

static OMPParallelMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1665

This represents 'pragma omp parallel master taskloop' directive.

static OMPParallelMasterTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1487

static OMPParallelMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1524

This represents 'pragma omp parallel master taskloop simd' directive.

static OMPParallelMasterTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1582

static OMPParallelMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1618

Represents the 'pragma omp reverse' loop transformation directive.

static OMPReverseDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, unsigned NumLoops, Stmt *TransformedStmt, Stmt *PreInits)

Create a new AST node representation for 'pragma omp reverse'.

Definition StmtOpenMP.cpp:516

static OMPReverseDirective * CreateEmpty(const ASTContext &C, unsigned NumLoops)

Build an empty 'pragma omp reverse' AST node for deserialization.

Definition StmtOpenMP.cpp:528

static OMPScanDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1033

static OMPScanDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1024

This represents the 'pragma omp stripe' loop transformation directive.

static OMPStripeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits)

Create a new AST node representation for 'pragma omp stripe'.

Definition StmtOpenMP.cpp:473

static OMPStripeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)

Build an empty 'pragma omp stripe' AST node for deserialization.

Definition StmtOpenMP.cpp:485

static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)

Creates an empty directive with the place for N clauses.

Definition StmtOpenMP.cpp:1171

static OMPTargetDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1164

static OMPTargetDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1083

static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1092

This represents 'pragma omp target enter data' directive.

static OMPTargetEnterDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1178

static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)

Creates an empty directive with the place for N clauses.

Definition StmtOpenMP.cpp:1186

This represents 'pragma omp target exit data' directive.

static OMPTargetExitDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1192

static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)

Creates an empty directive with the place for N clauses.

Definition StmtOpenMP.cpp:1200

This represents 'pragma omp target parallel' directive.

static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1111

static OMPTargetParallelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, bool HasCancel)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1099

This represents 'pragma omp target parallel for' directive.

static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1155

static OMPTargetParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1117

This represents 'pragma omp target parallel for simd' directive.

static OMPTargetParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1899

static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1935

This represents 'pragma omp target parallel loop' directive.

static OMPTargetParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:2711

static OMPTargetParallelGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:2675

This represents 'pragma omp target simd' directive.

static OMPTargetSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1946

static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1974

This represents 'pragma omp target teams' directive.

static OMPTargetTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:2190

static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:2199

This represents 'pragma omp target teams distribute' combined directive.

static OMPTargetTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:2241

static OMPTargetTeamsDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:2205

This represents 'pragma omp target teams distribute parallel for' combined directive.

static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:2304

static OMPTargetTeamsDistributeParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:2252

This represents 'pragma omp target teams distribute parallel for simd' combined directive.

static OMPTargetTeamsDistributeParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:2316

static OMPTargetTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:2366

This represents 'pragma omp target teams distribute simd' combined directive.

static OMPTargetTeamsDistributeSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:2377

static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:2413

This represents 'pragma omp target teams loop' directive.

static OMPTargetTeamsGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool CanBeParallelFor)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:2572

static OMPTargetTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:2622

This represents 'pragma omp target update' directive.

static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1728

static OMPTargetUpdateDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1719

static OMPTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1222

static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1257

This represents 'pragma omp taskloop simd' directive.

static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1302

static OMPTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1266

static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:1215

static OMPTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1206

This represents 'pragma omp teams distribute' directive.

static OMPTeamsDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:1981

static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:2017

This represents 'pragma omp teams distribute parallel for' composite directive.

static OMPTeamsDistributeParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:2129

static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:2180

This represents 'pragma omp teams distribute parallel for simd' composite directive.

static OMPTeamsDistributeParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:2069

static OMPTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:2118

static OMPTeamsDistributeSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:2025

static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:2060

This represents 'pragma omp teams loop' directive.

static OMPTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)

Creates an empty directive with the place for NumClauses clauses.

Definition StmtOpenMP.cpp:2564

static OMPTeamsGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)

Creates directive with a list of Clauses.

Definition StmtOpenMP.cpp:2515

static OMPTileDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)

Build an empty 'pragma omp tile' AST node for deserialization.

Definition StmtOpenMP.cpp:464

static OMPTileDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits)

Create a new AST node representation for 'pragma omp tile'.

Definition StmtOpenMP.cpp:452

static OMPUnrollDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, unsigned NumGeneratedTopLevelLoops, Stmt *TransformedStmt, Stmt *PreInits)

Create a new AST node representation for 'pragma omp unroll'.

Definition StmtOpenMP.cpp:493

static OMPUnrollDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)

Build an empty 'pragma omp unroll' AST node for deserialization.

Definition StmtOpenMP.cpp:508

Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...

This represents one expression.

Contains data for OpenMP directives: clauses, children expressions/statements (helpers for codegen) a...

void setClauses(ArrayRef< OMPClause * > Clauses)

Sets the list of variables for this clause.

Definition StmtOpenMP.cpp:27

MutableArrayRef< Stmt * > getChildren()

Definition StmtOpenMP.cpp:33

Encodes a location in the source.

Stmt - This represents one statement.

Stmt * IgnoreContainers(bool IgnoreCaptured=false)

Skip no-op (attributed, compound) container stmts and skip captured stmt at the top,...

The JSON file list parser is used to communicate input to InstallAPI.

bool isa(CodeGen::Address addr)

static OpenACCComputeConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)

llvm::omp::Directive OpenMPDirectiveKind

OpenMP directives.

U cast(CodeGen::Address addr)

DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...