clang 10.0.0git

StmtOpenMP.cpp
Go to the documentation of this file.
1 //===--- StmtOpenMP.cpp - Classes for OpenMP directives -------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the subclesses of Stmt class declared in StmtOpenMP.h
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "clang/AST/StmtOpenMP.h"
14
15 #include "clang/AST/ASTContext.h"
16
17 using namespace clang;
18 using namespace llvm::omp;
19
20 void OMPExecutableDirective::setClauses(ArrayRef<OMPClause *> Clauses) {
21 assert(Clauses.size() == getNumClauses() &&
22 "Number of clauses is not the same as the preallocated buffer");
23 std::copy(Clauses.begin(), Clauses.end(), getClauses().begin());
24 }
25
26 bool OMPExecutableDirective::isStandaloneDirective() const {
27 // Special case: 'omp target enter data', 'omp target exit data',
28 // 'omp target update' are stand-alone directives, but for implementation
29 // reasons they have empty synthetic structured block, to simplify codegen.
30 if (isa<OMPTargetEnterDataDirective>(this) ||
31 isa<OMPTargetExitDataDirective>(this) ||
32 isa<OMPTargetUpdateDirective>(this))
33 return true;
34 return !hasAssociatedStmt() || !getAssociatedStmt();
35 }
36
37 const Stmt *OMPExecutableDirective::getStructuredBlock() const {
38 assert(!isStandaloneDirective() &&
39 "Standalone Executable Directives don't have Structured Blocks.");
40 if (auto *LD = dyn_cast<OMPLoopDirective>(this))
41 return LD->getBody();
42 return getInnermostCapturedStmt()->getCapturedStmt();
43 }
44
45 Stmt *OMPLoopDirective::tryToFindNextInnerLoop(Stmt *CurStmt,
46 bool TryImperfectlyNestedLoops) {
47 Stmt *OrigStmt = CurStmt;
48 CurStmt = CurStmt->IgnoreContainers();
49 // Additional work for imperfectly nested loops, introduced in OpenMP 5.0.
50 if (TryImperfectlyNestedLoops) {
51 if (auto *CS = dyn_cast<CompoundStmt>(CurStmt)) {
52 CurStmt = nullptr;
53 SmallVector<CompoundStmt *, 4> Statements(1, CS);
54 SmallVector<CompoundStmt *, 4> NextStatements;
55 while (!Statements.empty()) {
56 CS = Statements.pop_back_val();
57 if (!CS)
58 continue;
59 for (Stmt *S : CS->body()) {
60 if (!S)
61 continue;
62 if (isa<ForStmt>(S) || isa<CXXForRangeStmt>(S)) {
63 // Only single loop construct is allowed.
64 if (CurStmt) {
65 CurStmt = OrigStmt;
66 break;
67 }
68 CurStmt = S;
69 continue;
70 }
71 S = S->IgnoreContainers();
72 if (auto *InnerCS = dyn_cast_or_null<CompoundStmt>(S))
73 NextStatements.push_back(InnerCS);
74 }
75 if (Statements.empty()) {
76 // Found single inner loop or multiple loops - exit.
77 if (CurStmt)
78 break;
79 Statements.swap(NextStatements);
80 }
81 }
82 if (!CurStmt)
83 CurStmt = OrigStmt;
84 }
85 }
86 return CurStmt;
87 }
88
89 Stmt *OMPLoopDirective::getBody() {
90 // This relies on the loop form is already checked by Sema.
91 Stmt *Body =
92 getInnermostCapturedStmt()->getCapturedStmt()->IgnoreContainers();
93 if (auto *For = dyn_cast<ForStmt>(Body)) {
94 Body = For->getBody();
95 } else {
96 assert(isa<CXXForRangeStmt>(Body) &&
97 "Expected canonical for loop or range-based for loop.");
98 Body = cast<CXXForRangeStmt>(Body)->getBody();
99 }
100 for (unsigned Cnt = 1; Cnt < CollapsedNum; ++Cnt) {
101 Body = tryToFindNextInnerLoop(Body, /*TryImperfectlyNestedLoops=*/true);
102 if (auto *For = dyn_cast<ForStmt>(Body)) {
103 Body = For->getBody();
104 } else {
105 assert(isa<CXXForRangeStmt>(Body) &&
106 "Expected canonical for loop or range-based for loop.");
107 Body = cast<CXXForRangeStmt>(Body)->getBody();
108 }
109 }
110 return Body;
111 }
112
113 void OMPLoopDirective::setCounters(ArrayRef<Expr *> A) {
114 assert(A.size() == getCollapsedNumber() &&
115 "Number of loop counters is not the same as the collapsed number");
116 std::copy(A.begin(), A.end(), getCounters().begin());
117 }
118
119 void OMPLoopDirective::setPrivateCounters(ArrayRef<Expr *> A) {
120 assert(A.size() == getCollapsedNumber() && "Number of loop private counters "
121 "is not the same as the collapsed "
122 "number");
123 std::copy(A.begin(), A.end(), getPrivateCounters().begin());
124 }
125
126 void OMPLoopDirective::setInits(ArrayRef<Expr *> A) {
127 assert(A.size() == getCollapsedNumber() &&
128 "Number of counter inits is not the same as the collapsed number");
129 std::copy(A.begin(), A.end(), getInits().begin());
130 }
131
132 void OMPLoopDirective::setUpdates(ArrayRef<Expr *> A) {
133 assert(A.size() == getCollapsedNumber() &&
134 "Number of counter updates is not the same as the collapsed number");
135 std::copy(A.begin(), A.end(), getUpdates().begin());
136 }
137
138 void OMPLoopDirective::setFinals(ArrayRef<Expr *> A) {
139 assert(A.size() == getCollapsedNumber() &&
140 "Number of counter finals is not the same as the collapsed number");
141 std::copy(A.begin(), A.end(), getFinals().begin());
142 }
143
144 void OMPLoopDirective::setDependentCounters(ArrayRef<Expr *> A) {
145 assert(
146 A.size() == getCollapsedNumber() &&
147 "Number of dependent counters is not the same as the collapsed number");
148 llvm::copy(A, getDependentCounters().begin());
149 }
150
151 void OMPLoopDirective::setDependentInits(ArrayRef<Expr *> A) {
152 assert(A.size() == getCollapsedNumber() &&
153 "Number of dependent inits is not the same as the collapsed number");
154 llvm::copy(A, getDependentInits().begin());
155 }
156
157 void OMPLoopDirective::setFinalsConditions(ArrayRef<Expr *> A) {
158 assert(A.size() == getCollapsedNumber() &&
159 "Number of finals conditions is not the same as the collapsed number");
160 llvm::copy(A, getFinalsConditions().begin());
161 }
162
163 OMPParallelDirective *OMPParallelDirective::Create(
164 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
165 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
166 unsigned Size =
167 llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *));
168 void *Mem =
169 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
170 OMPParallelDirective *Dir =
171 new (Mem) OMPParallelDirective(StartLoc, EndLoc, Clauses.size());
172 Dir->setClauses(Clauses);
173 Dir->setAssociatedStmt(AssociatedStmt);
174 Dir->setHasCancel(HasCancel);
175 return Dir;
176 }
177
178 OMPParallelDirective *OMPParallelDirective::CreateEmpty(const ASTContext &C,
179 unsigned NumClauses,
180 EmptyShell) {
181 unsigned Size =
182 llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *));
183 void *Mem =
184 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
185 return new (Mem) OMPParallelDirective(NumClauses);
186 }
187
188 OMPSimdDirective *
189 OMPSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc,
190 SourceLocation EndLoc, unsigned CollapsedNum,
191 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
192 const HelperExprs &Exprs) {
193 unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *));
194 void *Mem =
195 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
196 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
197 OMPSimdDirective *Dir = new (Mem)
198 OMPSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
199 Dir->setClauses(Clauses);
200 Dir->setAssociatedStmt(AssociatedStmt);
201 Dir->setIterationVariable(Exprs.IterationVarRef);
202 Dir->setLastIteration(Exprs.LastIteration);
203 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
204 Dir->setPreCond(Exprs.PreCond);
205 Dir->setCond(Exprs.Cond);
206 Dir->setInit(Exprs.Init);
207 Dir->setInc(Exprs.Inc);
208 Dir->setCounters(Exprs.Counters);
209 Dir->setPrivateCounters(Exprs.PrivateCounters);
210 Dir->setInits(Exprs.Inits);
211 Dir->setUpdates(Exprs.Updates);
212 Dir->setFinals(Exprs.Finals);
213 Dir->setDependentCounters(Exprs.DependentCounters);
214 Dir->setDependentInits(Exprs.DependentInits);
215 Dir->setFinalsConditions(Exprs.FinalsConditions);
216 Dir->setPreInits(Exprs.PreInits);
217 return Dir;
218 }
219
220 OMPSimdDirective *OMPSimdDirective::CreateEmpty(const ASTContext &C,
221 unsigned NumClauses,
222 unsigned CollapsedNum,
223 EmptyShell) {
224 unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *));
225 void *Mem =
226 C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
227 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
228 return new (Mem) OMPSimdDirective(CollapsedNum, NumClauses);
229 }
230
231 OMPForDirective *
232 OMPForDirective::Create(const ASTContext &C, SourceLocation StartLoc,
233 SourceLocation EndLoc, unsigned CollapsedNum,
234 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
235 const HelperExprs &Exprs, bool HasCancel) {
236 unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *));
237 void *Mem =
238 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
239 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
240 OMPForDirective *Dir =
241 new (Mem) OMPForDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
242 Dir->setClauses(Clauses);
243 Dir->setAssociatedStmt(AssociatedStmt);
244 Dir->setIterationVariable(Exprs.IterationVarRef);
245 Dir->setLastIteration(Exprs.LastIteration);
246 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
247 Dir->setPreCond(Exprs.PreCond);
248 Dir->setCond(Exprs.Cond);
249 Dir->setInit(Exprs.Init);
250 Dir->setInc(Exprs.Inc);
251 Dir->setIsLastIterVariable(Exprs.IL);
252 Dir->setLowerBoundVariable(Exprs.LB);
253 Dir->setUpperBoundVariable(Exprs.UB);
254 Dir->setStrideVariable(Exprs.ST);
255 Dir->setEnsureUpperBound(Exprs.EUB);
256 Dir->setNextLowerBound(Exprs.NLB);
257 Dir->setNextUpperBound(Exprs.NUB);
258 Dir->setNumIterations(Exprs.NumIterations);
259 Dir->setCounters(Exprs.Counters);
260 Dir->setPrivateCounters(Exprs.PrivateCounters);
261 Dir->setInits(Exprs.Inits);
262 Dir->setUpdates(Exprs.Updates);
263 Dir->setFinals(Exprs.Finals);
264 Dir->setDependentCounters(Exprs.DependentCounters);
265 Dir->setDependentInits(Exprs.DependentInits);
266 Dir->setFinalsConditions(Exprs.FinalsConditions);
267 Dir->setPreInits(Exprs.PreInits);
268 Dir->setHasCancel(HasCancel);
269 return Dir;
270 }
271
272 OMPForDirective *OMPForDirective::CreateEmpty(const ASTContext &C,
273 unsigned NumClauses,
274 unsigned CollapsedNum,
275 EmptyShell) {
276 unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *));
277 void *Mem =
278 C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
279 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
280 return new (Mem) OMPForDirective(CollapsedNum, NumClauses);
281 }
282
283 OMPForSimdDirective *
284 OMPForSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc,
285 SourceLocation EndLoc, unsigned CollapsedNum,
286 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
287 const HelperExprs &Exprs) {
288 unsigned Size =
289 llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *));
290 void *Mem =
291 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
292 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
293 OMPForSimdDirective *Dir = new (Mem)
294 OMPForSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
295 Dir->setClauses(Clauses);
296 Dir->setAssociatedStmt(AssociatedStmt);
297 Dir->setIterationVariable(Exprs.IterationVarRef);
298 Dir->setLastIteration(Exprs.LastIteration);
299 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
300 Dir->setPreCond(Exprs.PreCond);
301 Dir->setCond(Exprs.Cond);
302 Dir->setInit(Exprs.Init);
303 Dir->setInc(Exprs.Inc);
304 Dir->setIsLastIterVariable(Exprs.IL);
305 Dir->setLowerBoundVariable(Exprs.LB);
306 Dir->setUpperBoundVariable(Exprs.UB);
307 Dir->setStrideVariable(Exprs.ST);
308 Dir->setEnsureUpperBound(Exprs.EUB);
309 Dir->setNextLowerBound(Exprs.NLB);
310 Dir->setNextUpperBound(Exprs.NUB);
311 Dir->setNumIterations(Exprs.NumIterations);
312 Dir->setCounters(Exprs.Counters);
313 Dir->setPrivateCounters(Exprs.PrivateCounters);
314 Dir->setInits(Exprs.Inits);
315 Dir->setUpdates(Exprs.Updates);
316 Dir->setFinals(Exprs.Finals);
317 Dir->setDependentCounters(Exprs.DependentCounters);
318 Dir->setDependentInits(Exprs.DependentInits);
319 Dir->setFinalsConditions(Exprs.FinalsConditions);
320 Dir->setPreInits(Exprs.PreInits);
321 return Dir;
322 }
323
324 OMPForSimdDirective *OMPForSimdDirective::CreateEmpty(const ASTContext &C,
325 unsigned NumClauses,
326 unsigned CollapsedNum,
327 EmptyShell) {
328 unsigned Size =
329 llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *));
330 void *Mem =
331 C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
332 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
333 return new (Mem) OMPForSimdDirective(CollapsedNum, NumClauses);
334 }
335
336 OMPSectionsDirective *OMPSectionsDirective::Create(
337 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
338 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
339 unsigned Size =
340 llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *));
341 void *Mem =
342 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
343 OMPSectionsDirective *Dir =
344 new (Mem) OMPSectionsDirective(StartLoc, EndLoc, Clauses.size());
345 Dir->setClauses(Clauses);
346 Dir->setAssociatedStmt(AssociatedStmt);
347 Dir->setHasCancel(HasCancel);
348 return Dir;
349 }
350
351 OMPSectionsDirective *OMPSectionsDirective::CreateEmpty(const ASTContext &C,
352 unsigned NumClauses,
353 EmptyShell) {
354 unsigned Size =
355 llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *));
356 void *Mem =
357 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
358 return new (Mem) OMPSectionsDirective(NumClauses);
359 }
360
361 OMPSectionDirective *OMPSectionDirective::Create(const ASTContext &C,
362 SourceLocation StartLoc,
363 SourceLocation EndLoc,
364 Stmt *AssociatedStmt,
365 bool HasCancel) {
366 unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *));
367 void *Mem = C.Allocate(Size + sizeof(Stmt *));
368 OMPSectionDirective *Dir = new (Mem) OMPSectionDirective(StartLoc, EndLoc);
369 Dir->setAssociatedStmt(AssociatedStmt);
370 Dir->setHasCancel(HasCancel);
371 return Dir;
372 }
373
374 OMPSectionDirective *OMPSectionDirective::CreateEmpty(const ASTContext &C,
375 EmptyShell) {
376 unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *));
377 void *Mem = C.Allocate(Size + sizeof(Stmt *));
378 return new (Mem) OMPSectionDirective();
379 }
380
381 OMPSingleDirective *OMPSingleDirective::Create(const ASTContext &C,
382 SourceLocation StartLoc,
383 SourceLocation EndLoc,
384 ArrayRef<OMPClause *> Clauses,
385 Stmt *AssociatedStmt) {
386 unsigned Size =
387 llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *));
388 void *Mem =
389 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
390 OMPSingleDirective *Dir =
391 new (Mem) OMPSingleDirective(StartLoc, EndLoc, Clauses.size());
392 Dir->setClauses(Clauses);
393 Dir->setAssociatedStmt(AssociatedStmt);
394 return Dir;
395 }
396
397 OMPSingleDirective *OMPSingleDirective::CreateEmpty(const ASTContext &C,
398 unsigned NumClauses,
399 EmptyShell) {
400 unsigned Size =
401 llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *));
402 void *Mem =
403 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
404 return new (Mem) OMPSingleDirective(NumClauses);
405 }
406
407 OMPMasterDirective *OMPMasterDirective::Create(const ASTContext &C,
408 SourceLocation StartLoc,
409 SourceLocation EndLoc,
410 Stmt *AssociatedStmt) {
411 unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *));
412 void *Mem = C.Allocate(Size + sizeof(Stmt *));
413 OMPMasterDirective *Dir = new (Mem) OMPMasterDirective(StartLoc, EndLoc);
414 Dir->setAssociatedStmt(AssociatedStmt);
415 return Dir;
416 }
417
418 OMPMasterDirective *OMPMasterDirective::CreateEmpty(const ASTContext &C,
419 EmptyShell) {
420 unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *));
421 void *Mem = C.Allocate(Size + sizeof(Stmt *));
422 return new (Mem) OMPMasterDirective();
423 }
424
425 OMPCriticalDirective *OMPCriticalDirective::Create(
426 const ASTContext &C, const DeclarationNameInfo &Name,
427 SourceLocation StartLoc, SourceLocation EndLoc,
428 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
429 unsigned Size =
430 llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *));
431 void *Mem =
432 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
433 OMPCriticalDirective *Dir =
434 new (Mem) OMPCriticalDirective(Name, StartLoc, EndLoc, Clauses.size());
435 Dir->setClauses(Clauses);
436 Dir->setAssociatedStmt(AssociatedStmt);
437 return Dir;
438 }
439
440 OMPCriticalDirective *OMPCriticalDirective::CreateEmpty(const ASTContext &C,
441 unsigned NumClauses,
442 EmptyShell) {
443 unsigned Size =
444 llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *));
445 void *Mem =
446 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
447 return new (Mem) OMPCriticalDirective(NumClauses);
448 }
449
450 OMPParallelForDirective *OMPParallelForDirective::Create(
451 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
452 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
453 const HelperExprs &Exprs, bool HasCancel) {
454 unsigned Size =
455 llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *));
456 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
457 sizeof(Stmt *) *
458 numLoopChildren(CollapsedNum, OMPD_parallel_for));
459 OMPParallelForDirective *Dir = new (Mem)
460 OMPParallelForDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
461 Dir->setClauses(Clauses);
462 Dir->setAssociatedStmt(AssociatedStmt);
463 Dir->setIterationVariable(Exprs.IterationVarRef);
464 Dir->setLastIteration(Exprs.LastIteration);
465 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
466 Dir->setPreCond(Exprs.PreCond);
467 Dir->setCond(Exprs.Cond);
468 Dir->setInit(Exprs.Init);
469 Dir->setInc(Exprs.Inc);
470 Dir->setIsLastIterVariable(Exprs.IL);
471 Dir->setLowerBoundVariable(Exprs.LB);
472 Dir->setUpperBoundVariable(Exprs.UB);
473 Dir->setStrideVariable(Exprs.ST);
474 Dir->setEnsureUpperBound(Exprs.EUB);
475 Dir->setNextLowerBound(Exprs.NLB);
476 Dir->setNextUpperBound(Exprs.NUB);
477 Dir->setNumIterations(Exprs.NumIterations);
478 Dir->setCounters(Exprs.Counters);
479 Dir->setPrivateCounters(Exprs.PrivateCounters);
480 Dir->setInits(Exprs.Inits);
481 Dir->setUpdates(Exprs.Updates);
482 Dir->setFinals(Exprs.Finals);
483 Dir->setDependentCounters(Exprs.DependentCounters);
484 Dir->setDependentInits(Exprs.DependentInits);
485 Dir->setFinalsConditions(Exprs.FinalsConditions);
486 Dir->setPreInits(Exprs.PreInits);
487 Dir->setHasCancel(HasCancel);
488 return Dir;
489 }
490
491 OMPParallelForDirective *
492 OMPParallelForDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
493 unsigned CollapsedNum, EmptyShell) {
494 unsigned Size =
495 llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *));
496 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
497 sizeof(Stmt *) *
498 numLoopChildren(CollapsedNum, OMPD_parallel_for));
499 return new (Mem) OMPParallelForDirective(CollapsedNum, NumClauses);
500 }
501
502 OMPParallelForSimdDirective *OMPParallelForSimdDirective::Create(
503 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
504 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
505 const HelperExprs &Exprs) {
506 unsigned Size =
507 llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *));
508 void *Mem = C.Allocate(
509 Size + sizeof(OMPClause *) * Clauses.size() +
510 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
511 OMPParallelForSimdDirective *Dir = new (Mem) OMPParallelForSimdDirective(
512 StartLoc, EndLoc, CollapsedNum, Clauses.size());
513 Dir->setClauses(Clauses);
514 Dir->setAssociatedStmt(AssociatedStmt);
515 Dir->setIterationVariable(Exprs.IterationVarRef);
516 Dir->setLastIteration(Exprs.LastIteration);
517 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
518 Dir->setPreCond(Exprs.PreCond);
519 Dir->setCond(Exprs.Cond);
520 Dir->setInit(Exprs.Init);
521 Dir->setInc(Exprs.Inc);
522 Dir->setIsLastIterVariable(Exprs.IL);
523 Dir->setLowerBoundVariable(Exprs.LB);
524 Dir->setUpperBoundVariable(Exprs.UB);
525 Dir->setStrideVariable(Exprs.ST);
526 Dir->setEnsureUpperBound(Exprs.EUB);
527 Dir->setNextLowerBound(Exprs.NLB);
528 Dir->setNextUpperBound(Exprs.NUB);
529 Dir->setNumIterations(Exprs.NumIterations);
530 Dir->setCounters(Exprs.Counters);
531 Dir->setPrivateCounters(Exprs.PrivateCounters);
532 Dir->setInits(Exprs.Inits);
533 Dir->setUpdates(Exprs.Updates);
534 Dir->setFinals(Exprs.Finals);
535 Dir->setDependentCounters(Exprs.DependentCounters);
536 Dir->setDependentInits(Exprs.DependentInits);
537 Dir->setFinalsConditions(Exprs.FinalsConditions);
538 Dir->setPreInits(Exprs.PreInits);
539 return Dir;
540 }
541
542 OMPParallelForSimdDirective *
543 OMPParallelForSimdDirective::CreateEmpty(const ASTContext &C,
544 unsigned NumClauses,
545 unsigned CollapsedNum, EmptyShell) {
546 unsigned Size =
547 llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *));
548 void *Mem = C.Allocate(
549 Size + sizeof(OMPClause *) * NumClauses +
550 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
551 return new (Mem) OMPParallelForSimdDirective(CollapsedNum, NumClauses);
552 }
553
554 OMPParallelMasterDirective *OMPParallelMasterDirective::Create(
555 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
556 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
557 unsigned Size =
558 llvm::alignTo(sizeof(OMPParallelMasterDirective), alignof(OMPClause *));
559 void *Mem =
560 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
561 auto *Dir =
562 new (Mem) OMPParallelMasterDirective(StartLoc, EndLoc, Clauses.size());
563 Dir->setClauses(Clauses);
564 Dir->setAssociatedStmt(AssociatedStmt);
565 return Dir;
566 }
567
568 OMPParallelMasterDirective *OMPParallelMasterDirective::CreateEmpty(const ASTContext &C,
569 unsigned NumClauses,
570 EmptyShell) {
571 unsigned Size =
572 llvm::alignTo(sizeof(OMPParallelMasterDirective), alignof(OMPClause *));
573 void *Mem =
574 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
575 return new (Mem) OMPParallelMasterDirective(NumClauses);
576 }
577
578 OMPParallelSectionsDirective *OMPParallelSectionsDirective::Create(
579 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
580 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
581 unsigned Size =
582 llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *));
583 void *Mem =
584 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
585 OMPParallelSectionsDirective *Dir =
586 new (Mem) OMPParallelSectionsDirective(StartLoc, EndLoc, Clauses.size());
587 Dir->setClauses(Clauses);
588 Dir->setAssociatedStmt(AssociatedStmt);
589 Dir->setHasCancel(HasCancel);
590 return Dir;
591 }
592
593 OMPParallelSectionsDirective *
594 OMPParallelSectionsDirective::CreateEmpty(const ASTContext &C,
595 unsigned NumClauses, EmptyShell) {
596 unsigned Size =
597 llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *));
598 void *Mem =
599 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
600 return new (Mem) OMPParallelSectionsDirective(NumClauses);
601 }
602
603 OMPTaskDirective *
604 OMPTaskDirective::Create(const ASTContext &C, SourceLocation StartLoc,
605 SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
606 Stmt *AssociatedStmt, bool HasCancel) {
607 unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *));
608 void *Mem =
609 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
610 OMPTaskDirective *Dir =
611 new (Mem) OMPTaskDirective(StartLoc, EndLoc, Clauses.size());
612 Dir->setClauses(Clauses);
613 Dir->setAssociatedStmt(AssociatedStmt);
614 Dir->setHasCancel(HasCancel);
615 return Dir;
616 }
617
618 OMPTaskDirective *OMPTaskDirective::CreateEmpty(const ASTContext &C,
619 unsigned NumClauses,
620 EmptyShell) {
621 unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *));
622 void *Mem =
623 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
624 return new (Mem) OMPTaskDirective(NumClauses);
625 }
626
627 OMPTaskyieldDirective *OMPTaskyieldDirective::Create(const ASTContext &C,
628 SourceLocation StartLoc,
629 SourceLocation EndLoc) {
630 void *Mem = C.Allocate(sizeof(OMPTaskyieldDirective));
631 OMPTaskyieldDirective *Dir =
632 new (Mem) OMPTaskyieldDirective(StartLoc, EndLoc);
633 return Dir;
634 }
635
636 OMPTaskyieldDirective *OMPTaskyieldDirective::CreateEmpty(const ASTContext &C,
637 EmptyShell) {
638 void *Mem = C.Allocate(sizeof(OMPTaskyieldDirective));
639 return new (Mem) OMPTaskyieldDirective();
640 }
641
642 OMPBarrierDirective *OMPBarrierDirective::Create(const ASTContext &C,
643 SourceLocation StartLoc,
644 SourceLocation EndLoc) {
645 void *Mem = C.Allocate(sizeof(OMPBarrierDirective));
646 OMPBarrierDirective *Dir = new (Mem) OMPBarrierDirective(StartLoc, EndLoc);
647 return Dir;
648 }
649
650 OMPBarrierDirective *OMPBarrierDirective::CreateEmpty(const ASTContext &C,
651 EmptyShell) {
652 void *Mem = C.Allocate(sizeof(OMPBarrierDirective));
653 return new (Mem) OMPBarrierDirective();
654 }
655
656 OMPTaskwaitDirective *OMPTaskwaitDirective::Create(const ASTContext &C,
657 SourceLocation StartLoc,
658 SourceLocation EndLoc) {
659 void *Mem = C.Allocate(sizeof(OMPTaskwaitDirective));
660 OMPTaskwaitDirective *Dir = new (Mem) OMPTaskwaitDirective(StartLoc, EndLoc);
661 return Dir;
662 }
663
664 OMPTaskwaitDirective *OMPTaskwaitDirective::CreateEmpty(const ASTContext &C,
665 EmptyShell) {
666 void *Mem = C.Allocate(sizeof(OMPTaskwaitDirective));
667 return new (Mem) OMPTaskwaitDirective();
668 }
669
670 OMPTaskgroupDirective *OMPTaskgroupDirective::Create(
671 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
672 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) {
673 unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective) +
674 sizeof(OMPClause *) * Clauses.size(),
675 alignof(Stmt *));
676 void *Mem = C.Allocate(Size + sizeof(Stmt *) + sizeof(Expr *));
677 OMPTaskgroupDirective *Dir =
678 new (Mem) OMPTaskgroupDirective(StartLoc, EndLoc, Clauses.size());
679 Dir->setAssociatedStmt(AssociatedStmt);
680 Dir->setReductionRef(ReductionRef);
681 Dir->setClauses(Clauses);
682 return Dir;
683 }
684
685 OMPTaskgroupDirective *OMPTaskgroupDirective::CreateEmpty(const ASTContext &C,
686 unsigned NumClauses,
687 EmptyShell) {
688 unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective) +
689 sizeof(OMPClause *) * NumClauses,
690 alignof(Stmt *));
691 void *Mem = C.Allocate(Size + sizeof(Stmt *) + sizeof(Expr *));
692 return new (Mem) OMPTaskgroupDirective(NumClauses);
693 }
694
695 OMPCancellationPointDirective *OMPCancellationPointDirective::Create(
696 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
697 OpenMPDirectiveKind CancelRegion) {
698 unsigned Size =
699 llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *));
700 void *Mem = C.Allocate(Size);
701 OMPCancellationPointDirective *Dir =
702 new (Mem) OMPCancellationPointDirective(StartLoc, EndLoc);
703 Dir->setCancelRegion(CancelRegion);
704 return Dir;
705 }
706
707 OMPCancellationPointDirective *
708 OMPCancellationPointDirective::CreateEmpty(const ASTContext &C, EmptyShell) {
709 unsigned Size =
710 llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *));
711 void *Mem = C.Allocate(Size);
712 return new (Mem) OMPCancellationPointDirective();
713 }
714
715 OMPCancelDirective *
716 OMPCancelDirective::Create(const ASTContext &C, SourceLocation StartLoc,
717 SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
718 OpenMPDirectiveKind CancelRegion) {
719 unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
720 sizeof(OMPClause *) * Clauses.size(),
721 alignof(Stmt *));
722 void *Mem = C.Allocate(Size);
723 OMPCancelDirective *Dir =
724 new (Mem) OMPCancelDirective(StartLoc, EndLoc, Clauses.size());
725 Dir->setClauses(Clauses);
726 Dir->setCancelRegion(CancelRegion);
727 return Dir;
728 }
729
730 OMPCancelDirective *OMPCancelDirective::CreateEmpty(const ASTContext &C,
731 unsigned NumClauses,
732 EmptyShell) {
733 unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
734 sizeof(OMPClause *) * NumClauses,
735 alignof(Stmt *));
736 void *Mem = C.Allocate(Size);
737 return new (Mem) OMPCancelDirective(NumClauses);
738 }
739
740 OMPFlushDirective *OMPFlushDirective::Create(const ASTContext &C,
741 SourceLocation StartLoc,
742 SourceLocation EndLoc,
743 ArrayRef<OMPClause *> Clauses) {
744 unsigned Size =
745 llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *));
746 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size());
747 OMPFlushDirective *Dir =
748 new (Mem) OMPFlushDirective(StartLoc, EndLoc, Clauses.size());
749 Dir->setClauses(Clauses);
750 return Dir;
751 }
752
753 OMPFlushDirective *OMPFlushDirective::CreateEmpty(const ASTContext &C,
754 unsigned NumClauses,
755 EmptyShell) {
756 unsigned Size =
757 llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *));
758 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses);
759 return new (Mem) OMPFlushDirective(NumClauses);
760 }
761
762 OMPOrderedDirective *OMPOrderedDirective::Create(const ASTContext &C,
763 SourceLocation StartLoc,
764 SourceLocation EndLoc,
765 ArrayRef<OMPClause *> Clauses,
766 Stmt *AssociatedStmt) {
767 unsigned Size =
768 llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *));
769 void *Mem =
770 C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * Clauses.size());
771 OMPOrderedDirective *Dir =
772 new (Mem) OMPOrderedDirective(StartLoc, EndLoc, Clauses.size());
773 Dir->setClauses(Clauses);
774 Dir->setAssociatedStmt(AssociatedStmt);
775 return Dir;
776 }
777
778 OMPOrderedDirective *OMPOrderedDirective::CreateEmpty(const ASTContext &C,
779 unsigned NumClauses,
780 EmptyShell) {
781 unsigned Size =
782 llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *));
783 void *Mem =
784 C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * NumClauses);
785 return new (Mem) OMPOrderedDirective(NumClauses);
786 }
787
788 OMPAtomicDirective *OMPAtomicDirective::Create(
789 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
790 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V,
791 Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate) {
792 unsigned Size =
793 llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *));
794 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
795 5 * sizeof(Stmt *));
796 OMPAtomicDirective *Dir =
797 new (Mem) OMPAtomicDirective(StartLoc, EndLoc, Clauses.size());
798 Dir->setClauses(Clauses);
799 Dir->setAssociatedStmt(AssociatedStmt);
800 Dir->setX(X);
801 Dir->setV(V);
802 Dir->setExpr(E);
803 Dir->setUpdateExpr(UE);
804 Dir->IsXLHSInRHSPart = IsXLHSInRHSPart;
805 Dir->IsPostfixUpdate = IsPostfixUpdate;
806 return Dir;
807 }
808
809 OMPAtomicDirective *OMPAtomicDirective::CreateEmpty(const ASTContext &C,
810 unsigned NumClauses,
811 EmptyShell) {
812 unsigned Size =
813 llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *));
814 void *Mem =
815 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 5 * sizeof(Stmt *));
816 return new (Mem) OMPAtomicDirective(NumClauses);
817 }
818
819 OMPTargetDirective *OMPTargetDirective::Create(const ASTContext &C,
820 SourceLocation StartLoc,
821 SourceLocation EndLoc,
822 ArrayRef<OMPClause *> Clauses,
823 Stmt *AssociatedStmt) {
824 unsigned Size =
825 llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *));
826 void *Mem =
827 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
828 OMPTargetDirective *Dir =
829 new (Mem) OMPTargetDirective(StartLoc, EndLoc, Clauses.size());
830 Dir->setClauses(Clauses);
831 Dir->setAssociatedStmt(AssociatedStmt);
832 return Dir;
833 }
834
835 OMPTargetDirective *OMPTargetDirective::CreateEmpty(const ASTContext &C,
836 unsigned NumClauses,
837 EmptyShell) {
838 unsigned Size =
839 llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *));
840 void *Mem =
841 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
842 return new (Mem) OMPTargetDirective(NumClauses);
843 }
844
845 OMPTargetParallelDirective *OMPTargetParallelDirective::Create(
846 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
847 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
848 unsigned Size =
849 llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *));
850 void *Mem =
851 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
852 OMPTargetParallelDirective *Dir =
853 new (Mem) OMPTargetParallelDirective(StartLoc, EndLoc, Clauses.size());
854 Dir->setClauses(Clauses);
855 Dir->setAssociatedStmt(AssociatedStmt);
856 return Dir;
857 }
858
859 OMPTargetParallelDirective *
860 OMPTargetParallelDirective::CreateEmpty(const ASTContext &C,
861 unsigned NumClauses, EmptyShell) {
862 unsigned Size =
863 llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *));
864 void *Mem =
865 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
866 return new (Mem) OMPTargetParallelDirective(NumClauses);
867 }
868
869 OMPTargetParallelForDirective *OMPTargetParallelForDirective::Create(
870 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
871 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
872 const HelperExprs &Exprs, bool HasCancel) {
873 unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
874 alignof(OMPClause *));
875 void *Mem = C.Allocate(
876 Size + sizeof(OMPClause *) * Clauses.size() +
877 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
878 OMPTargetParallelForDirective *Dir = new (Mem) OMPTargetParallelForDirective(
879 StartLoc, EndLoc, CollapsedNum, Clauses.size());
880 Dir->setClauses(Clauses);
881 Dir->setAssociatedStmt(AssociatedStmt);
882 Dir->setIterationVariable(Exprs.IterationVarRef);
883 Dir->setLastIteration(Exprs.LastIteration);
884 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
885 Dir->setPreCond(Exprs.PreCond);
886 Dir->setCond(Exprs.Cond);
887 Dir->setInit(Exprs.Init);
888 Dir->setInc(Exprs.Inc);
889 Dir->setIsLastIterVariable(Exprs.IL);
890 Dir->setLowerBoundVariable(Exprs.LB);
891 Dir->setUpperBoundVariable(Exprs.UB);
892 Dir->setStrideVariable(Exprs.ST);
893 Dir->setEnsureUpperBound(Exprs.EUB);
894 Dir->setNextLowerBound(Exprs.NLB);
895 Dir->setNextUpperBound(Exprs.NUB);
896 Dir->setNumIterations(Exprs.NumIterations);
897 Dir->setCounters(Exprs.Counters);
898 Dir->setPrivateCounters(Exprs.PrivateCounters);
899 Dir->setInits(Exprs.Inits);
900 Dir->setUpdates(Exprs.Updates);
901 Dir->setFinals(Exprs.Finals);
902 Dir->setDependentCounters(Exprs.DependentCounters);
903 Dir->setDependentInits(Exprs.DependentInits);
904 Dir->setFinalsConditions(Exprs.FinalsConditions);
905 Dir->setPreInits(Exprs.PreInits);
906 Dir->setHasCancel(HasCancel);
907 return Dir;
908 }
909
910 OMPTargetParallelForDirective *
911 OMPTargetParallelForDirective::CreateEmpty(const ASTContext &C,
912 unsigned NumClauses,
913 unsigned CollapsedNum, EmptyShell) {
914 unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
915 alignof(OMPClause *));
916 void *Mem = C.Allocate(
917 Size + sizeof(OMPClause *) * NumClauses +
918 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
919 return new (Mem) OMPTargetParallelForDirective(CollapsedNum, NumClauses);
920 }
921
922 OMPTargetDataDirective *OMPTargetDataDirective::Create(
923 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
924 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
925 void *Mem = C.Allocate(
926 llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) +
927 sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
928 OMPTargetDataDirective *Dir =
929 new (Mem) OMPTargetDataDirective(StartLoc, EndLoc, Clauses.size());
930 Dir->setClauses(Clauses);
931 Dir->setAssociatedStmt(AssociatedStmt);
932 return Dir;
933 }
934
935 OMPTargetDataDirective *OMPTargetDataDirective::CreateEmpty(const ASTContext &C,
936 unsigned N,
937 EmptyShell) {
938 void *Mem = C.Allocate(
939 llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) +
940 sizeof(OMPClause *) * N + sizeof(Stmt *));
941 return new (Mem) OMPTargetDataDirective(N);
942 }
943
944 OMPTargetEnterDataDirective *OMPTargetEnterDataDirective::Create(
945 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
946 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
947 void *Mem = C.Allocate(
948 llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) +
949 sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
950 OMPTargetEnterDataDirective *Dir =
951 new (Mem) OMPTargetEnterDataDirective(StartLoc, EndLoc, Clauses.size());
952 Dir->setClauses(Clauses);
953 Dir->setAssociatedStmt(AssociatedStmt);
954 return Dir;
955 }
956
957 OMPTargetEnterDataDirective *
958 OMPTargetEnterDataDirective::CreateEmpty(const ASTContext &C, unsigned N,
959 EmptyShell) {
960 void *Mem = C.Allocate(
961 llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) +
962 sizeof(OMPClause *) * N + sizeof(Stmt *));
963 return new (Mem) OMPTargetEnterDataDirective(N);
964 }
965
966 OMPTargetExitDataDirective *OMPTargetExitDataDirective::Create(
967 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
968 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
969 void *Mem = C.Allocate(
970 llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) +
971 sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
972 OMPTargetExitDataDirective *Dir =
973 new (Mem) OMPTargetExitDataDirective(StartLoc, EndLoc, Clauses.size());
974 Dir->setClauses(Clauses);
975 Dir->setAssociatedStmt(AssociatedStmt);
976 return Dir;
977 }
978
979 OMPTargetExitDataDirective *
980 OMPTargetExitDataDirective::CreateEmpty(const ASTContext &C, unsigned N,
981 EmptyShell) {
982 void *Mem = C.Allocate(
983 llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) +
984 sizeof(OMPClause *) * N + sizeof(Stmt *));
985 return new (Mem) OMPTargetExitDataDirective(N);
986 }
987
988 OMPTeamsDirective *OMPTeamsDirective::Create(const ASTContext &C,
989 SourceLocation StartLoc,
990 SourceLocation EndLoc,
991 ArrayRef<OMPClause *> Clauses,
992 Stmt *AssociatedStmt) {
993 unsigned Size =
994 llvm::alignTo(sizeof(OMPTeamsDirective), alignof(OMPClause *));
995 void *Mem =
996 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
997 OMPTeamsDirective *Dir =
998 new (Mem) OMPTeamsDirective(StartLoc, EndLoc, Clauses.size());
999 Dir->setClauses(Clauses);
1000 Dir->setAssociatedStmt(AssociatedStmt);
1001 return Dir;
1002 }
1003
1004 OMPTeamsDirective *OMPTeamsDirective::CreateEmpty(const ASTContext &C,
1005 unsigned NumClauses,
1006 EmptyShell) {
1007 unsigned Size =
1008 llvm::alignTo(sizeof(OMPTeamsDirective), alignof(OMPClause *));
1009 void *Mem =
1010 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
1011 return new (Mem) OMPTeamsDirective(NumClauses);
1012 }
1013
1014 OMPTaskLoopDirective *OMPTaskLoopDirective::Create(
1015 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1016 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1017 const HelperExprs &Exprs) {
1018 unsigned Size =
1019 llvm::alignTo(sizeof(OMPTaskLoopDirective), alignof(OMPClause *));
1020 void *Mem =
1021 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1022 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
1023 OMPTaskLoopDirective *Dir = new (Mem)
1024 OMPTaskLoopDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
1025 Dir->setClauses(Clauses);
1026 Dir->setAssociatedStmt(AssociatedStmt);
1027 Dir->setIterationVariable(Exprs.IterationVarRef);
1028 Dir->setLastIteration(Exprs.LastIteration);
1029 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1030 Dir->setPreCond(Exprs.PreCond);
1031 Dir->setCond(Exprs.Cond);
1032 Dir->setInit(Exprs.Init);
1033 Dir->setInc(Exprs.Inc);
1034 Dir->setIsLastIterVariable(Exprs.IL);
1035 Dir->setLowerBoundVariable(Exprs.LB);
1036 Dir->setUpperBoundVariable(Exprs.UB);
1037 Dir->setStrideVariable(Exprs.ST);
1038 Dir->setEnsureUpperBound(Exprs.EUB);
1039 Dir->setNextLowerBound(Exprs.NLB);
1040 Dir->setNextUpperBound(Exprs.NUB);
1041 Dir->setNumIterations(Exprs.NumIterations);
1042 Dir->setCounters(Exprs.Counters);
1043 Dir->setPrivateCounters(Exprs.PrivateCounters);
1044 Dir->setInits(Exprs.Inits);
1045 Dir->setUpdates(Exprs.Updates);
1046 Dir->setFinals(Exprs.Finals);
1047 Dir->setDependentCounters(Exprs.DependentCounters);
1048 Dir->setDependentInits(Exprs.DependentInits);
1049 Dir->setFinalsConditions(Exprs.FinalsConditions);
1050 Dir->setPreInits(Exprs.PreInits);
1051 return Dir;
1052 }
1053
1054 OMPTaskLoopDirective *OMPTaskLoopDirective::CreateEmpty(const ASTContext &C,
1055 unsigned NumClauses,
1056 unsigned CollapsedNum,
1057 EmptyShell) {
1058 unsigned Size =
1059 llvm::alignTo(sizeof(OMPTaskLoopDirective), alignof(OMPClause *));
1060 void *Mem =
1061 C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1062 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
1063 return new (Mem) OMPTaskLoopDirective(CollapsedNum, NumClauses);
1064 }
1065
1066 OMPTaskLoopSimdDirective *OMPTaskLoopSimdDirective::Create(
1067 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1068 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1069 const HelperExprs &Exprs) {
1070 unsigned Size =
1071 llvm::alignTo(sizeof(OMPTaskLoopSimdDirective), alignof(OMPClause *));
1072 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1073 sizeof(Stmt *) *
1074 numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
1075 OMPTaskLoopSimdDirective *Dir = new (Mem)
1076 OMPTaskLoopSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
1077 Dir->setClauses(Clauses);
1078 Dir->setAssociatedStmt(AssociatedStmt);
1079 Dir->setIterationVariable(Exprs.IterationVarRef);
1080 Dir->setLastIteration(Exprs.LastIteration);
1081 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1082 Dir->setPreCond(Exprs.PreCond);
1083 Dir->setCond(Exprs.Cond);
1084 Dir->setInit(Exprs.Init);
1085 Dir->setInc(Exprs.Inc);
1086 Dir->setIsLastIterVariable(Exprs.IL);
1087 Dir->setLowerBoundVariable(Exprs.LB);
1088 Dir->setUpperBoundVariable(Exprs.UB);
1089 Dir->setStrideVariable(Exprs.ST);
1090 Dir->setEnsureUpperBound(Exprs.EUB);
1091 Dir->setNextLowerBound(Exprs.NLB);
1092 Dir->setNextUpperBound(Exprs.NUB);
1093 Dir->setNumIterations(Exprs.NumIterations);
1094 Dir->setCounters(Exprs.Counters);
1095 Dir->setPrivateCounters(Exprs.PrivateCounters);
1096 Dir->setInits(Exprs.Inits);
1097 Dir->setUpdates(Exprs.Updates);
1098 Dir->setFinals(Exprs.Finals);
1099 Dir->setDependentCounters(Exprs.DependentCounters);
1100 Dir->setDependentInits(Exprs.DependentInits);
1101 Dir->setFinalsConditions(Exprs.FinalsConditions);
1102 Dir->setPreInits(Exprs.PreInits);
1103 return Dir;
1104 }
1105
1106 OMPTaskLoopSimdDirective *
1107 OMPTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
1108 unsigned CollapsedNum, EmptyShell) {
1109 unsigned Size =
1110 llvm::alignTo(sizeof(OMPTaskLoopSimdDirective), alignof(OMPClause *));
1111 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1112 sizeof(Stmt *) *
1113 numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
1114 return new (Mem) OMPTaskLoopSimdDirective(CollapsedNum, NumClauses);
1115 }
1116
1117 OMPMasterTaskLoopDirective *OMPMasterTaskLoopDirective::Create(
1118 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1119 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1120 const HelperExprs &Exprs) {
1121 unsigned Size =
1122 llvm::alignTo(sizeof(OMPMasterTaskLoopDirective), alignof(OMPClause *));
1123 void *Mem = C.Allocate(
1124 Size + sizeof(OMPClause *) * Clauses.size() +
1125 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_master_taskloop));
1126 OMPMasterTaskLoopDirective *Dir = new (Mem) OMPMasterTaskLoopDirective(
1127 StartLoc, EndLoc, CollapsedNum, Clauses.size());
1128 Dir->setClauses(Clauses);
1129 Dir->setAssociatedStmt(AssociatedStmt);
1130 Dir->setIterationVariable(Exprs.IterationVarRef);
1131 Dir->setLastIteration(Exprs.LastIteration);
1132 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1133 Dir->setPreCond(Exprs.PreCond);
1134 Dir->setCond(Exprs.Cond);
1135 Dir->setInit(Exprs.Init);
1136 Dir->setInc(Exprs.Inc);
1137 Dir->setIsLastIterVariable(Exprs.IL);
1138 Dir->setLowerBoundVariable(Exprs.LB);
1139 Dir->setUpperBoundVariable(Exprs.UB);
1140 Dir->setStrideVariable(Exprs.ST);
1141 Dir->setEnsureUpperBound(Exprs.EUB);
1142 Dir->setNextLowerBound(Exprs.NLB);
1143 Dir->setNextUpperBound(Exprs.NUB);
1144 Dir->setNumIterations(Exprs.NumIterations);
1145 Dir->setCounters(Exprs.Counters);
1146 Dir->setPrivateCounters(Exprs.PrivateCounters);
1147 Dir->setInits(Exprs.Inits);
1148 Dir->setUpdates(Exprs.Updates);
1149 Dir->setFinals(Exprs.Finals);
1150 Dir->setDependentCounters(Exprs.DependentCounters);
1151 Dir->setDependentInits(Exprs.DependentInits);
1152 Dir->setFinalsConditions(Exprs.FinalsConditions);
1153 Dir->setPreInits(Exprs.PreInits);
1154 return Dir;
1155 }
1156
1157 OMPMasterTaskLoopDirective *
1158 OMPMasterTaskLoopDirective::CreateEmpty(const ASTContext &C,
1159 unsigned NumClauses,
1160 unsigned CollapsedNum, EmptyShell) {
1161 unsigned Size =
1162 llvm::alignTo(sizeof(OMPMasterTaskLoopDirective), alignof(OMPClause *));
1163 void *Mem = C.Allocate(
1164 Size + sizeof(OMPClause *) * NumClauses +
1165 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_master_taskloop));
1166 return new (Mem) OMPMasterTaskLoopDirective(CollapsedNum, NumClauses);
1167 }
1168
1169 OMPMasterTaskLoopSimdDirective *OMPMasterTaskLoopSimdDirective::Create(
1170 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1171 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1172 const HelperExprs &Exprs) {
1173 unsigned Size = llvm::alignTo(sizeof(OMPMasterTaskLoopSimdDirective),
1174 alignof(OMPClause *));
1175 void *Mem =
1176 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1177 sizeof(Stmt *) *
1178 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd));
1179 auto *Dir = new (Mem) OMPMasterTaskLoopSimdDirective(
1180 StartLoc, EndLoc, CollapsedNum, Clauses.size());
1181 Dir->setClauses(Clauses);
1182 Dir->setAssociatedStmt(AssociatedStmt);
1183 Dir->setIterationVariable(Exprs.IterationVarRef);
1184 Dir->setLastIteration(Exprs.LastIteration);
1185 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1186 Dir->setPreCond(Exprs.PreCond);
1187 Dir->setCond(Exprs.Cond);
1188 Dir->setInit(Exprs.Init);
1189 Dir->setInc(Exprs.Inc);
1190 Dir->setIsLastIterVariable(Exprs.IL);
1191 Dir->setLowerBoundVariable(Exprs.LB);
1192 Dir->setUpperBoundVariable(Exprs.UB);
1193 Dir->setStrideVariable(Exprs.ST);
1194 Dir->setEnsureUpperBound(Exprs.EUB);
1195 Dir->setNextLowerBound(Exprs.NLB);
1196 Dir->setNextUpperBound(Exprs.NUB);
1197 Dir->setNumIterations(Exprs.NumIterations);
1198 Dir->setCounters(Exprs.Counters);
1199 Dir->setPrivateCounters(Exprs.PrivateCounters);
1200 Dir->setInits(Exprs.Inits);
1201 Dir->setUpdates(Exprs.Updates);
1202 Dir->setFinals(Exprs.Finals);
1203 Dir->setDependentCounters(Exprs.DependentCounters);
1204 Dir->setDependentInits(Exprs.DependentInits);
1205 Dir->setFinalsConditions(Exprs.FinalsConditions);
1206 Dir->setPreInits(Exprs.PreInits);
1207 return Dir;
1208 }
1209
1210 OMPMasterTaskLoopSimdDirective *
1211 OMPMasterTaskLoopSimdDirective::CreateEmpty(const ASTContext &C,
1212 unsigned NumClauses,
1213 unsigned CollapsedNum, EmptyShell) {
1214 unsigned Size = llvm::alignTo(sizeof(OMPMasterTaskLoopSimdDirective),
1215 alignof(OMPClause *));
1216 void *Mem =
1217 C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1218 sizeof(Stmt *) *
1219 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd));
1220 return new (Mem) OMPMasterTaskLoopSimdDirective(CollapsedNum, NumClauses);
1221 }
1222
1223 OMPParallelMasterTaskLoopDirective *OMPParallelMasterTaskLoopDirective::Create(
1224 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1225 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1226 const HelperExprs &Exprs) {
1227 unsigned Size = llvm::alignTo(sizeof(OMPParallelMasterTaskLoopDirective),
1228 alignof(OMPClause *));
1229 void *Mem = C.Allocate(
1230 Size + sizeof(OMPClause *) * Clauses.size() +
1231 sizeof(Stmt *) *
1232 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop));
1233 auto *Dir = new (Mem) OMPParallelMasterTaskLoopDirective(
1234 StartLoc, EndLoc, CollapsedNum, Clauses.size());
1235 Dir->setClauses(Clauses);
1236 Dir->setAssociatedStmt(AssociatedStmt);
1237 Dir->setIterationVariable(Exprs.IterationVarRef);
1238 Dir->setLastIteration(Exprs.LastIteration);
1239 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1240 Dir->setPreCond(Exprs.PreCond);
1241 Dir->setCond(Exprs.Cond);
1242 Dir->setInit(Exprs.Init);
1243 Dir->setInc(Exprs.Inc);
1244 Dir->setIsLastIterVariable(Exprs.IL);
1245 Dir->setLowerBoundVariable(Exprs.LB);
1246 Dir->setUpperBoundVariable(Exprs.UB);
1247 Dir->setStrideVariable(Exprs.ST);
1248 Dir->setEnsureUpperBound(Exprs.EUB);
1249 Dir->setNextLowerBound(Exprs.NLB);
1250 Dir->setNextUpperBound(Exprs.NUB);
1251 Dir->setNumIterations(Exprs.NumIterations);
1252 Dir->setCounters(Exprs.Counters);
1253 Dir->setPrivateCounters(Exprs.PrivateCounters);
1254 Dir->setInits(Exprs.Inits);
1255 Dir->setUpdates(Exprs.Updates);
1256 Dir->setFinals(Exprs.Finals);
1257 Dir->setDependentCounters(Exprs.DependentCounters);
1258 Dir->setDependentInits(Exprs.DependentInits);
1259 Dir->setFinalsConditions(Exprs.FinalsConditions);
1260 Dir->setPreInits(Exprs.PreInits);
1261 return Dir;
1262 }
1263
1264 OMPParallelMasterTaskLoopDirective *
1265 OMPParallelMasterTaskLoopDirective::CreateEmpty(const ASTContext &C,
1266 unsigned NumClauses,
1267 unsigned CollapsedNum,
1268 EmptyShell) {
1269 unsigned Size = llvm::alignTo(sizeof(OMPParallelMasterTaskLoopDirective),
1270 alignof(OMPClause *));
1271 void *Mem = C.Allocate(
1272 Size + sizeof(OMPClause *) * NumClauses +
1273 sizeof(Stmt *) *
1274 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop));
1275 return new (Mem) OMPParallelMasterTaskLoopDirective(CollapsedNum, NumClauses);
1276 }
1277
1278 OMPParallelMasterTaskLoopSimdDirective *
1279 OMPParallelMasterTaskLoopSimdDirective::Create(
1280 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1281 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1282 const HelperExprs &Exprs) {
1283 unsigned Size = llvm::alignTo(sizeof(OMPParallelMasterTaskLoopSimdDirective),
1284 alignof(OMPClause *));
1285 void *Mem = C.Allocate(
1286 Size + sizeof(OMPClause *) * Clauses.size() +
1287 sizeof(Stmt *) *
1288 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd));
1289 auto *Dir = new (Mem) OMPParallelMasterTaskLoopSimdDirective(
1290 StartLoc, EndLoc, CollapsedNum, Clauses.size());
1291 Dir->setClauses(Clauses);
1292 Dir->setAssociatedStmt(AssociatedStmt);
1293 Dir->setIterationVariable(Exprs.IterationVarRef);
1294 Dir->setLastIteration(Exprs.LastIteration);
1295 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1296 Dir->setPreCond(Exprs.PreCond);
1297 Dir->setCond(Exprs.Cond);
1298 Dir->setInit(Exprs.Init);
1299 Dir->setInc(Exprs.Inc);
1300 Dir->setIsLastIterVariable(Exprs.IL);
1301 Dir->setLowerBoundVariable(Exprs.LB);
1302 Dir->setUpperBoundVariable(Exprs.UB);
1303 Dir->setStrideVariable(Exprs.ST);
1304 Dir->setEnsureUpperBound(Exprs.EUB);
1305 Dir->setNextLowerBound(Exprs.NLB);
1306 Dir->setNextUpperBound(Exprs.NUB);
1307 Dir->setNumIterations(Exprs.NumIterations);
1308 Dir->setCounters(Exprs.Counters);
1309 Dir->setPrivateCounters(Exprs.PrivateCounters);
1310 Dir->setInits(Exprs.Inits);
1311 Dir->setUpdates(Exprs.Updates);
1312 Dir->setFinals(Exprs.Finals);
1313 Dir->setDependentCounters(Exprs.DependentCounters);
1314 Dir->setDependentInits(Exprs.DependentInits);
1315 Dir->setFinalsConditions(Exprs.FinalsConditions);
1316 Dir->setPreInits(Exprs.PreInits);
1317 return Dir;
1318 }
1319
1320 OMPParallelMasterTaskLoopSimdDirective *
1321 OMPParallelMasterTaskLoopSimdDirective::CreateEmpty(const ASTContext &C,
1322 unsigned NumClauses,
1323 unsigned CollapsedNum,
1324 EmptyShell) {
1325 unsigned Size = llvm::alignTo(sizeof(OMPParallelMasterTaskLoopSimdDirective),
1326 alignof(OMPClause *));
1327 void *Mem = C.Allocate(
1328 Size + sizeof(OMPClause *) * NumClauses +
1329 sizeof(Stmt *) *
1330 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd));
1331 return new (Mem)
1332 OMPParallelMasterTaskLoopSimdDirective(CollapsedNum, NumClauses);
1333 }
1334
1335 OMPDistributeDirective *OMPDistributeDirective::Create(
1336 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1337 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1338 const HelperExprs &Exprs) {
1339 unsigned Size =
1340 llvm::alignTo(sizeof(OMPDistributeDirective), alignof(OMPClause *));
1341 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1342 sizeof(Stmt *) *
1343 numLoopChildren(CollapsedNum, OMPD_distribute));
1344 OMPDistributeDirective *Dir = new (Mem)
1345 OMPDistributeDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
1346 Dir->setClauses(Clauses);
1347 Dir->setAssociatedStmt(AssociatedStmt);
1348 Dir->setIterationVariable(Exprs.IterationVarRef);
1349 Dir->setLastIteration(Exprs.LastIteration);
1350 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1351 Dir->setPreCond(Exprs.PreCond);
1352 Dir->setCond(Exprs.Cond);
1353 Dir->setInit(Exprs.Init);
1354 Dir->setInc(Exprs.Inc);
1355 Dir->setIsLastIterVariable(Exprs.IL);
1356 Dir->setLowerBoundVariable(Exprs.LB);
1357 Dir->setUpperBoundVariable(Exprs.UB);
1358 Dir->setStrideVariable(Exprs.ST);
1359 Dir->setEnsureUpperBound(Exprs.EUB);
1360 Dir->setNextLowerBound(Exprs.NLB);
1361 Dir->setNextUpperBound(Exprs.NUB);
1362 Dir->setNumIterations(Exprs.NumIterations);
1363 Dir->setCounters(Exprs.Counters);
1364 Dir->setPrivateCounters(Exprs.PrivateCounters);
1365 Dir->setInits(Exprs.Inits);
1366 Dir->setUpdates(Exprs.Updates);
1367 Dir->setFinals(Exprs.Finals);
1368 Dir->setDependentCounters(Exprs.DependentCounters);
1369 Dir->setDependentInits(Exprs.DependentInits);
1370 Dir->setFinalsConditions(Exprs.FinalsConditions);
1371 Dir->setPreInits(Exprs.PreInits);
1372 return Dir;
1373 }
1374
1375 OMPDistributeDirective *
1376 OMPDistributeDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
1377 unsigned CollapsedNum, EmptyShell) {
1378 unsigned Size =
1379 llvm::alignTo(sizeof(OMPDistributeDirective), alignof(OMPClause *));
1380 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1381 sizeof(Stmt *) *
1382 numLoopChildren(CollapsedNum, OMPD_distribute));
1383 return new (Mem) OMPDistributeDirective(CollapsedNum, NumClauses);
1384 }
1385
1386 OMPTargetUpdateDirective *OMPTargetUpdateDirective::Create(
1387 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1388 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1389 unsigned Size =
1390 llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *));
1391 void *Mem =
1392 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
1393 OMPTargetUpdateDirective *Dir =
1394 new (Mem) OMPTargetUpdateDirective(StartLoc, EndLoc, Clauses.size());
1395 Dir->setClauses(Clauses);
1396 Dir->setAssociatedStmt(AssociatedStmt);
1397 return Dir;
1398 }
1399
1400 OMPTargetUpdateDirective *
1401 OMPTargetUpdateDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
1402 EmptyShell) {
1403 unsigned Size =
1404 llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *));
1405 void *Mem =
1406 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
1407 return new (Mem) OMPTargetUpdateDirective(NumClauses);
1408 }
1409
1410 OMPDistributeParallelForDirective *OMPDistributeParallelForDirective::Create(
1411 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1412 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1413 const HelperExprs &Exprs, bool HasCancel) {
1414 unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
1415 alignof(OMPClause *));
1416 void *Mem = C.Allocate(
1417 Size + sizeof(OMPClause *) * Clauses.size() +
1418 sizeof(Stmt *) *
1419 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for));
1420 OMPDistributeParallelForDirective *Dir =
1421 new (Mem) OMPDistributeParallelForDirective(StartLoc, EndLoc,
1422 CollapsedNum, Clauses.size());
1423 Dir->setClauses(Clauses);
1424 Dir->setAssociatedStmt(AssociatedStmt);
1425 Dir->setIterationVariable(Exprs.IterationVarRef);
1426 Dir->setLastIteration(Exprs.LastIteration);
1427 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1428 Dir->setPreCond(Exprs.PreCond);
1429 Dir->setCond(Exprs.Cond);
1430 Dir->setInit(Exprs.Init);
1431 Dir->setInc(Exprs.Inc);
1432 Dir->setIsLastIterVariable(Exprs.IL);
1433 Dir->setLowerBoundVariable(Exprs.LB);
1434 Dir->setUpperBoundVariable(Exprs.UB);
1435 Dir->setStrideVariable(Exprs.ST);
1436 Dir->setEnsureUpperBound(Exprs.EUB);
1437 Dir->setNextLowerBound(Exprs.NLB);
1438 Dir->setNextUpperBound(Exprs.NUB);
1439 Dir->setNumIterations(Exprs.NumIterations);
1440 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1441 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1442 Dir->setDistInc(Exprs.DistInc);
1443 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1444 Dir->setCounters(Exprs.Counters);
1445 Dir->setPrivateCounters(Exprs.PrivateCounters);
1446 Dir->setInits(Exprs.Inits);
1447 Dir->setUpdates(Exprs.Updates);
1448 Dir->setFinals(Exprs.Finals);
1449 Dir->setDependentCounters(Exprs.DependentCounters);
1450 Dir->setDependentInits(Exprs.DependentInits);
1451 Dir->setFinalsConditions(Exprs.FinalsConditions);
1452 Dir->setPreInits(Exprs.PreInits);
1453 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1454 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1455 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1456 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1457 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1458 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1459 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1460 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1461 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1462 Dir->HasCancel = HasCancel;
1463 return Dir;
1464 }
1465
1466 OMPDistributeParallelForDirective *
1467 OMPDistributeParallelForDirective::CreateEmpty(const ASTContext &C,
1468 unsigned NumClauses,
1469 unsigned CollapsedNum,
1470 EmptyShell) {
1471 unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
1472 alignof(OMPClause *));
1473 void *Mem = C.Allocate(
1474 Size + sizeof(OMPClause *) * NumClauses +
1475 sizeof(Stmt *) *
1476 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for));
1477 return new (Mem) OMPDistributeParallelForDirective(CollapsedNum, NumClauses);
1478 }
1479
1480 OMPDistributeParallelForSimdDirective *
1481 OMPDistributeParallelForSimdDirective::Create(
1482 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1483 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1484 const HelperExprs &Exprs) {
1485 unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
1486 alignof(OMPClause *));
1487 void *Mem = C.Allocate(
1488 Size + sizeof(OMPClause *) * Clauses.size() +
1489 sizeof(Stmt *) *
1490 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd));
1491 OMPDistributeParallelForSimdDirective *Dir = new (Mem)
1492 OMPDistributeParallelForSimdDirective(StartLoc, EndLoc, CollapsedNum,
1493 Clauses.size());
1494 Dir->setClauses(Clauses);
1495 Dir->setAssociatedStmt(AssociatedStmt);
1496 Dir->setIterationVariable(Exprs.IterationVarRef);
1497 Dir->setLastIteration(Exprs.LastIteration);
1498 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1499 Dir->setPreCond(Exprs.PreCond);
1500 Dir->setCond(Exprs.Cond);
1501 Dir->setInit(Exprs.Init);
1502 Dir->setInc(Exprs.Inc);
1503 Dir->setIsLastIterVariable(Exprs.IL);
1504 Dir->setLowerBoundVariable(Exprs.LB);
1505 Dir->setUpperBoundVariable(Exprs.UB);
1506 Dir->setStrideVariable(Exprs.ST);
1507 Dir->setEnsureUpperBound(Exprs.EUB);
1508 Dir->setNextLowerBound(Exprs.NLB);
1509 Dir->setNextUpperBound(Exprs.NUB);
1510 Dir->setNumIterations(Exprs.NumIterations);
1511 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1512 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1513 Dir->setDistInc(Exprs.DistInc);
1514 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1515 Dir->setCounters(Exprs.Counters);
1516 Dir->setPrivateCounters(Exprs.PrivateCounters);
1517 Dir->setInits(Exprs.Inits);
1518 Dir->setUpdates(Exprs.Updates);
1519 Dir->setFinals(Exprs.Finals);
1520 Dir->setDependentCounters(Exprs.DependentCounters);
1521 Dir->setDependentInits(Exprs.DependentInits);
1522 Dir->setFinalsConditions(Exprs.FinalsConditions);
1523 Dir->setPreInits(Exprs.PreInits);
1524 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1525 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1526 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1527 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1528 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1529 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1530 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1531 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1532 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1533 return Dir;
1534 }
1535
1536 OMPDistributeParallelForSimdDirective *
1537 OMPDistributeParallelForSimdDirective::CreateEmpty(const ASTContext &C,
1538 unsigned NumClauses,
1539 unsigned CollapsedNum,
1540 EmptyShell) {
1541 unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
1542 alignof(OMPClause *));
1543 void *Mem = C.Allocate(
1544 Size + sizeof(OMPClause *) * NumClauses +
1545 sizeof(Stmt *) *
1546 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd));
1547 return new (Mem)
1548 OMPDistributeParallelForSimdDirective(CollapsedNum, NumClauses);
1549 }
1550
1551 OMPDistributeSimdDirective *OMPDistributeSimdDirective::Create(
1552 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1553 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1554 const HelperExprs &Exprs) {
1555 unsigned Size =
1556 llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *));
1557 void *Mem = C.Allocate(
1558 Size + sizeof(OMPClause *) * Clauses.size() +
1559 sizeof(Stmt *) *
1560 numLoopChildren(CollapsedNum, OMPD_distribute_simd));
1561 OMPDistributeSimdDirective *Dir = new (Mem) OMPDistributeSimdDirective(
1562 StartLoc, EndLoc, CollapsedNum, Clauses.size());
1563 Dir->setClauses(Clauses);
1564 Dir->setAssociatedStmt(AssociatedStmt);
1565 Dir->setIterationVariable(Exprs.IterationVarRef);
1566 Dir->setLastIteration(Exprs.LastIteration);
1567 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1568 Dir->setPreCond(Exprs.PreCond);
1569 Dir->setCond(Exprs.Cond);
1570 Dir->setInit(Exprs.Init);
1571 Dir->setInc(Exprs.Inc);
1572 Dir->setIsLastIterVariable(Exprs.IL);
1573 Dir->setLowerBoundVariable(Exprs.LB);
1574 Dir->setUpperBoundVariable(Exprs.UB);
1575 Dir->setStrideVariable(Exprs.ST);
1576 Dir->setEnsureUpperBound(Exprs.EUB);
1577 Dir->setNextLowerBound(Exprs.NLB);
1578 Dir->setNextUpperBound(Exprs.NUB);
1579 Dir->setNumIterations(Exprs.NumIterations);
1580 Dir->setCounters(Exprs.Counters);
1581 Dir->setPrivateCounters(Exprs.PrivateCounters);
1582 Dir->setInits(Exprs.Inits);
1583 Dir->setUpdates(Exprs.Updates);
1584 Dir->setFinals(Exprs.Finals);
1585 Dir->setDependentCounters(Exprs.DependentCounters);
1586 Dir->setDependentInits(Exprs.DependentInits);
1587 Dir->setFinalsConditions(Exprs.FinalsConditions);
1588 Dir->setPreInits(Exprs.PreInits);
1589 return Dir;
1590 }
1591
1592 OMPDistributeSimdDirective *
1593 OMPDistributeSimdDirective::CreateEmpty(const ASTContext &C,
1594 unsigned NumClauses,
1595 unsigned CollapsedNum, EmptyShell) {
1596 unsigned Size =
1597 llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *));
1598 void *Mem = C.Allocate(
1599 Size + sizeof(OMPClause *) * NumClauses +
1600 sizeof(Stmt *) *
1601 numLoopChildren(CollapsedNum, OMPD_distribute_simd));
1602 return new (Mem) OMPDistributeSimdDirective(CollapsedNum, NumClauses);
1603 }
1604
1605 OMPTargetParallelForSimdDirective *OMPTargetParallelForSimdDirective::Create(
1606 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1607 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1608 const HelperExprs &Exprs) {
1609 unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
1610 alignof(OMPClause *));
1611 void *Mem = C.Allocate(
1612 Size + sizeof(OMPClause *) * Clauses.size() +
1613 sizeof(Stmt *) *
1614 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd));
1615 OMPTargetParallelForSimdDirective *Dir =
1616 new (Mem) OMPTargetParallelForSimdDirective(StartLoc, EndLoc,
1617 CollapsedNum, Clauses.size());
1618 Dir->setClauses(Clauses);
1619 Dir->setAssociatedStmt(AssociatedStmt);
1620 Dir->setIterationVariable(Exprs.IterationVarRef);
1621 Dir->setLastIteration(Exprs.LastIteration);
1622 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1623 Dir->setPreCond(Exprs.PreCond);
1624 Dir->setCond(Exprs.Cond);
1625 Dir->setInit(Exprs.Init);
1626 Dir->setInc(Exprs.Inc);
1627 Dir->setIsLastIterVariable(Exprs.IL);
1628 Dir->setLowerBoundVariable(Exprs.LB);
1629 Dir->setUpperBoundVariable(Exprs.UB);
1630 Dir->setStrideVariable(Exprs.ST);
1631 Dir->setEnsureUpperBound(Exprs.EUB);
1632 Dir->setNextLowerBound(Exprs.NLB);
1633 Dir->setNextUpperBound(Exprs.NUB);
1634 Dir->setNumIterations(Exprs.NumIterations);
1635 Dir->setCounters(Exprs.Counters);
1636 Dir->setPrivateCounters(Exprs.PrivateCounters);
1637 Dir->setInits(Exprs.Inits);
1638 Dir->setUpdates(Exprs.Updates);
1639 Dir->setFinals(Exprs.Finals);
1640 Dir->setDependentCounters(Exprs.DependentCounters);
1641 Dir->setDependentInits(Exprs.DependentInits);
1642 Dir->setFinalsConditions(Exprs.FinalsConditions);
1643 Dir->setPreInits(Exprs.PreInits);
1644 return Dir;
1645 }
1646
1647 OMPTargetParallelForSimdDirective *
1648 OMPTargetParallelForSimdDirective::CreateEmpty(const ASTContext &C,
1649 unsigned NumClauses,
1650 unsigned CollapsedNum,
1651 EmptyShell) {
1652 unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
1653 alignof(OMPClause *));
1654 void *Mem = C.Allocate(
1655 Size + sizeof(OMPClause *) * NumClauses +
1656 sizeof(Stmt *) *
1657 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd));
1658 return new (Mem) OMPTargetParallelForSimdDirective(CollapsedNum, NumClauses);
1659 }
1660
1661 OMPTargetSimdDirective *
1662 OMPTargetSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc,
1663 SourceLocation EndLoc, unsigned CollapsedNum,
1664 ArrayRef<OMPClause *> Clauses,
1665 Stmt *AssociatedStmt, const HelperExprs &Exprs) {
1666 unsigned Size =
1667 llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *));
1668 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1669 sizeof(Stmt *) *
1670 numLoopChildren(CollapsedNum, OMPD_target_simd));
1671 OMPTargetSimdDirective *Dir = new (Mem)
1672 OMPTargetSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
1673 Dir->setClauses(Clauses);
1674 Dir->setAssociatedStmt(AssociatedStmt);
1675 Dir->setIterationVariable(Exprs.IterationVarRef);
1676 Dir->setLastIteration(Exprs.LastIteration);
1677 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1678 Dir->setPreCond(Exprs.PreCond);
1679 Dir->setCond(Exprs.Cond);
1680 Dir->setInit(Exprs.Init);
1681 Dir->setInc(Exprs.Inc);
1682 Dir->setCounters(Exprs.Counters);
1683 Dir->setPrivateCounters(Exprs.PrivateCounters);
1684 Dir->setInits(Exprs.Inits);
1685 Dir->setUpdates(Exprs.Updates);
1686 Dir->setFinals(Exprs.Finals);
1687 Dir->setDependentCounters(Exprs.DependentCounters);
1688 Dir->setDependentInits(Exprs.DependentInits);
1689 Dir->setFinalsConditions(Exprs.FinalsConditions);
1690 Dir->setPreInits(Exprs.PreInits);
1691 return Dir;
1692 }
1693
1694 OMPTargetSimdDirective *
1695 OMPTargetSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
1696 unsigned CollapsedNum, EmptyShell) {
1697 unsigned Size =
1698 llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *));
1699 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1700 sizeof(Stmt *) *
1701 numLoopChildren(CollapsedNum, OMPD_target_simd));
1702 return new (Mem) OMPTargetSimdDirective(CollapsedNum, NumClauses);
1703 }
1704
1705 OMPTeamsDistributeDirective *OMPTeamsDistributeDirective::Create(
1706 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1707 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1708 const HelperExprs &Exprs) {
1709 unsigned Size =
1710 llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *));
1711 void *Mem = C.Allocate(
1712 Size + sizeof(OMPClause *) * Clauses.size() +
1713 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
1714 OMPTeamsDistributeDirective *Dir = new (Mem) OMPTeamsDistributeDirective(
1715 StartLoc, EndLoc, CollapsedNum, Clauses.size());
1716 Dir->setClauses(Clauses);
1717 Dir->setAssociatedStmt(AssociatedStmt);
1718 Dir->setIterationVariable(Exprs.IterationVarRef);
1719 Dir->setLastIteration(Exprs.LastIteration);
1720 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1721 Dir->setPreCond(Exprs.PreCond);
1722 Dir->setCond(Exprs.Cond);
1723 Dir->setInit(Exprs.Init);
1724 Dir->setInc(Exprs.Inc);
1725 Dir->setIsLastIterVariable(Exprs.IL);
1726 Dir->setLowerBoundVariable(Exprs.LB);
1727 Dir->setUpperBoundVariable(Exprs.UB);
1728 Dir->setStrideVariable(Exprs.ST);
1729 Dir->setEnsureUpperBound(Exprs.EUB);
1730 Dir->setNextLowerBound(Exprs.NLB);
1731 Dir->setNextUpperBound(Exprs.NUB);
1732 Dir->setNumIterations(Exprs.NumIterations);
1733 Dir->setCounters(Exprs.Counters);
1734 Dir->setPrivateCounters(Exprs.PrivateCounters);
1735 Dir->setInits(Exprs.Inits);
1736 Dir->setUpdates(Exprs.Updates);
1737 Dir->setFinals(Exprs.Finals);
1738 Dir->setDependentCounters(Exprs.DependentCounters);
1739 Dir->setDependentInits(Exprs.DependentInits);
1740 Dir->setFinalsConditions(Exprs.FinalsConditions);
1741 Dir->setPreInits(Exprs.PreInits);
1742 return Dir;
1743 }
1744
1745 OMPTeamsDistributeDirective *
1746 OMPTeamsDistributeDirective::CreateEmpty(const ASTContext &C,
1747 unsigned NumClauses,
1748 unsigned CollapsedNum, EmptyShell) {
1749 unsigned Size =
1750 llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *));
1751 void *Mem = C.Allocate(
1752 Size + sizeof(OMPClause *) * NumClauses +
1753 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
1754 return new (Mem) OMPTeamsDistributeDirective(CollapsedNum, NumClauses);
1755 }
1756
1757 OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::Create(
1758 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1759 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1760 const HelperExprs &Exprs) {
1761 unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeSimdDirective),
1762 alignof(OMPClause *));
1763 void *Mem =
1764 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1765 sizeof(Stmt *) *
1766 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd));
1767 OMPTeamsDistributeSimdDirective *Dir =
1768 new (Mem) OMPTeamsDistributeSimdDirective(StartLoc, EndLoc, CollapsedNum,
1769 Clauses.size());
1770 Dir->setClauses(Clauses);
1771 Dir->setAssociatedStmt(AssociatedStmt);
1772 Dir->setIterationVariable(Exprs.IterationVarRef);
1773 Dir->setLastIteration(Exprs.LastIteration);
1774 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1775 Dir->setPreCond(Exprs.PreCond);
1776 Dir->setCond(Exprs.Cond);
1777 Dir->setInit(Exprs.Init);
1778 Dir->setInc(Exprs.Inc);
1779 Dir->setIsLastIterVariable(Exprs.IL);
1780 Dir->setLowerBoundVariable(Exprs.LB);
1781 Dir->setUpperBoundVariable(Exprs.UB);
1782 Dir->setStrideVariable(Exprs.ST);
1783 Dir->setEnsureUpperBound(Exprs.EUB);
1784 Dir->setNextLowerBound(Exprs.NLB);
1785 Dir->setNextUpperBound(Exprs.NUB);
1786 Dir->setNumIterations(Exprs.NumIterations);
1787 Dir->setCounters(Exprs.Counters);
1788 Dir->setPrivateCounters(Exprs.PrivateCounters);
1789 Dir->setInits(Exprs.Inits);
1790 Dir->setUpdates(Exprs.Updates);
1791 Dir->setFinals(Exprs.Finals);
1792 Dir->setDependentCounters(Exprs.DependentCounters);
1793 Dir->setDependentInits(Exprs.DependentInits);
1794 Dir->setFinalsConditions(Exprs.FinalsConditions);
1795 Dir->setPreInits(Exprs.PreInits);
1796 return Dir;
1797 }
1798
1799 OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::CreateEmpty(
1800 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1801 EmptyShell) {
1802 unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeSimdDirective),
1803 alignof(OMPClause *));
1804 void *Mem =
1805 C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1806 sizeof(Stmt *) *
1807 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd));
1808 return new (Mem) OMPTeamsDistributeSimdDirective(CollapsedNum, NumClauses);
1809 }
1810
1811 OMPTeamsDistributeParallelForSimdDirective *
1812 OMPTeamsDistributeParallelForSimdDirective::Create(
1813 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1814 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1815 const HelperExprs &Exprs) {
1816 auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForSimdDirective),
1817 alignof(OMPClause *));
1818 void *Mem =
1819 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1820 sizeof(Stmt *) *
1821 numLoopChildren(CollapsedNum,
1822 OMPD_teams_distribute_parallel_for_simd));
1823 OMPTeamsDistributeParallelForSimdDirective *Dir = new (Mem)
1824 OMPTeamsDistributeParallelForSimdDirective(StartLoc, EndLoc, CollapsedNum,
1825 Clauses.size());
1826 Dir->setClauses(Clauses);
1827 Dir->setAssociatedStmt(AssociatedStmt);
1828 Dir->setIterationVariable(Exprs.IterationVarRef);
1829 Dir->setLastIteration(Exprs.LastIteration);
1830 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1831 Dir->setPreCond(Exprs.PreCond);
1832 Dir->setCond(Exprs.Cond);
1833 Dir->setInit(Exprs.Init);
1834 Dir->setInc(Exprs.Inc);
1835 Dir->setIsLastIterVariable(Exprs.IL);
1836 Dir->setLowerBoundVariable(Exprs.LB);
1837 Dir->setUpperBoundVariable(Exprs.UB);
1838 Dir->setStrideVariable(Exprs.ST);
1839 Dir->setEnsureUpperBound(Exprs.EUB);
1840 Dir->setNextLowerBound(Exprs.NLB);
1841 Dir->setNextUpperBound(Exprs.NUB);
1842 Dir->setNumIterations(Exprs.NumIterations);
1843 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1844 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1845 Dir->setDistInc(Exprs.DistInc);
1846 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1847 Dir->setCounters(Exprs.Counters);
1848 Dir->setPrivateCounters(Exprs.PrivateCounters);
1849 Dir->setInits(Exprs.Inits);
1850 Dir->setUpdates(Exprs.Updates);
1851 Dir->setFinals(Exprs.Finals);
1852 Dir->setDependentCounters(Exprs.DependentCounters);
1853 Dir->setDependentInits(Exprs.DependentInits);
1854 Dir->setFinalsConditions(Exprs.FinalsConditions);
1855 Dir->setPreInits(Exprs.PreInits);
1856 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1857 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1858 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1859 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1860 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1861 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1862 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1863 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1864 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1865 return Dir;
1866 }
1867
1868 OMPTeamsDistributeParallelForSimdDirective *
1869 OMPTeamsDistributeParallelForSimdDirective::CreateEmpty(const ASTContext &C,
1870 unsigned NumClauses,
1871 unsigned CollapsedNum,
1872 EmptyShell) {
1873 auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForSimdDirective),
1874 alignof(OMPClause *));
1875 void *Mem =
1876 C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1877 sizeof(Stmt *) *
1878 numLoopChildren(CollapsedNum,
1879 OMPD_teams_distribute_parallel_for_simd));
1880 return new (Mem)
1881 OMPTeamsDistributeParallelForSimdDirective(CollapsedNum, NumClauses);
1882 }
1883
1884 OMPTeamsDistributeParallelForDirective *
1885 OMPTeamsDistributeParallelForDirective::Create(
1886 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1887 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1888 const HelperExprs &Exprs, bool HasCancel) {
1889 auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForDirective),
1890 alignof(OMPClause *));
1891 void *Mem = C.Allocate(
1892 Size + sizeof(OMPClause *) * Clauses.size() +
1893 sizeof(Stmt *) *
1894 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for));
1895 OMPTeamsDistributeParallelForDirective *Dir = new (Mem)
1896 OMPTeamsDistributeParallelForDirective(StartLoc, EndLoc, CollapsedNum,
1897 Clauses.size());
1898 Dir->setClauses(Clauses);
1899 Dir->setAssociatedStmt(AssociatedStmt);
1900 Dir->setIterationVariable(Exprs.IterationVarRef);
1901 Dir->setLastIteration(Exprs.LastIteration);
1902 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1903 Dir->setPreCond(Exprs.PreCond);
1904 Dir->setCond(Exprs.Cond);
1905 Dir->setInit(Exprs.Init);
1906 Dir->setInc(Exprs.Inc);
1907 Dir->setIsLastIterVariable(Exprs.IL);
1908 Dir->setLowerBoundVariable(Exprs.LB);
1909 Dir->setUpperBoundVariable(Exprs.UB);
1910 Dir->setStrideVariable(Exprs.ST);
1911 Dir->setEnsureUpperBound(Exprs.EUB);
1912 Dir->setNextLowerBound(Exprs.NLB);
1913 Dir->setNextUpperBound(Exprs.NUB);
1914 Dir->setNumIterations(Exprs.NumIterations);
1915 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1916 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1917 Dir->setDistInc(Exprs.DistInc);
1918 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1919 Dir->setCounters(Exprs.Counters);
1920 Dir->setPrivateCounters(Exprs.PrivateCounters);
1921 Dir->setInits(Exprs.Inits);
1922 Dir->setUpdates(Exprs.Updates);
1923 Dir->setFinals(Exprs.Finals);
1924 Dir->setDependentCounters(Exprs.DependentCounters);
1925 Dir->setDependentInits(Exprs.DependentInits);
1926 Dir->setFinalsConditions(Exprs.FinalsConditions);
1927 Dir->setPreInits(Exprs.PreInits);
1928 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1929 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1930 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1931 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1932 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1933 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1934 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1935 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1936 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1937 Dir->HasCancel = HasCancel;
1938 return Dir;
1939 }
1940
1941 OMPTeamsDistributeParallelForDirective *
1942 OMPTeamsDistributeParallelForDirective::CreateEmpty(const ASTContext &C,
1943 unsigned NumClauses,
1944 unsigned CollapsedNum,
1945 EmptyShell) {
1946 auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForDirective),
1947 alignof(OMPClause *));
1948 void *Mem = C.Allocate(
1949 Size + sizeof(OMPClause *) * NumClauses +
1950 sizeof(Stmt *) *
1951 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for));
1952 return new (Mem)
1953 OMPTeamsDistributeParallelForDirective(CollapsedNum, NumClauses);
1954 }
1955
1956 OMPTargetTeamsDirective *OMPTargetTeamsDirective::Create(
1957 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1958 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1959 auto Size =
1960 llvm::alignTo(sizeof(OMPTargetTeamsDirective), alignof(OMPClause *));
1961 void *Mem =
1962 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
1963 OMPTargetTeamsDirective *Dir =
1964 new (Mem) OMPTargetTeamsDirective(StartLoc, EndLoc, Clauses.size());
1965 Dir->setClauses(Clauses);
1966 Dir->setAssociatedStmt(AssociatedStmt);
1967 return Dir;
1968 }
1969
1970 OMPTargetTeamsDirective *
1971 OMPTargetTeamsDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
1972 EmptyShell) {
1973 auto Size =
1974 llvm::alignTo(sizeof(OMPTargetTeamsDirective), alignof(OMPClause *));
1975 void *Mem =
1976 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
1977 return new (Mem) OMPTargetTeamsDirective(NumClauses);
1978 }
1979
1980 OMPTargetTeamsDistributeDirective *OMPTargetTeamsDistributeDirective::Create(
1981 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1982 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1983 const HelperExprs &Exprs) {
1984 auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeDirective),
1985 alignof(OMPClause *));
1986 void *Mem = C.Allocate(
1987 Size + sizeof(OMPClause *) * Clauses.size() +
1988 sizeof(Stmt *) *
1989 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute));
1990 OMPTargetTeamsDistributeDirective *Dir =
1991 new (Mem) OMPTargetTeamsDistributeDirective(StartLoc, EndLoc, CollapsedNum,
1992 Clauses.size());
1993 Dir->setClauses(Clauses);
1994 Dir->setAssociatedStmt(AssociatedStmt);
1995 Dir->setIterationVariable(Exprs.IterationVarRef);
1996 Dir->setLastIteration(Exprs.LastIteration);
1997 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1998 Dir->setPreCond(Exprs.PreCond);
1999 Dir->setCond(Exprs.Cond);
2000 Dir->setInit(Exprs.Init);
2001 Dir->setInc(Exprs.Inc);
2002 Dir->setIsLastIterVariable(Exprs.IL);
2003 Dir->setLowerBoundVariable(Exprs.LB);
2004 Dir->setUpperBoundVariable(Exprs.UB);
2005 Dir->setStrideVariable(Exprs.ST);
2006 Dir->setEnsureUpperBound(Exprs.EUB);
2007 Dir->setNextLowerBound(Exprs.NLB);
2008 Dir->setNextUpperBound(Exprs.NUB);
2009 Dir->setNumIterations(Exprs.NumIterations);
2010 Dir->setCounters(Exprs.Counters);
2011 Dir->setPrivateCounters(Exprs.PrivateCounters);
2012 Dir->setInits(Exprs.Inits);
2013 Dir->setUpdates(Exprs.Updates);
2014 Dir->setFinals(Exprs.Finals);
2015 Dir->setDependentCounters(Exprs.DependentCounters);
2016 Dir->setDependentInits(Exprs.DependentInits);
2017 Dir->setFinalsConditions(Exprs.FinalsConditions);
2018 Dir->setPreInits(Exprs.PreInits);
2019 return Dir;
2020 }
2021
2022 OMPTargetTeamsDistributeDirective *
2023 OMPTargetTeamsDistributeDirective::CreateEmpty(const ASTContext &C,
2024 unsigned NumClauses,
2025 unsigned CollapsedNum,
2026 EmptyShell) {
2027 auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeDirective),
2028 alignof(OMPClause *));
2029 void *Mem = C.Allocate(
2030 Size + sizeof(OMPClause *) * NumClauses +
2031 sizeof(Stmt *) *
2032 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute));
2033 return new (Mem) OMPTargetTeamsDistributeDirective(CollapsedNum, NumClauses);
2034 }
2035
2036 OMPTargetTeamsDistributeParallelForDirective *
2037 OMPTargetTeamsDistributeParallelForDirective::Create(
2038 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2039 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2040 const HelperExprs &Exprs, bool HasCancel) {
2041 auto Size =
2042 llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForDirective),
2043 alignof(OMPClause *));
2044 void *Mem = C.Allocate(
2045 Size + sizeof(OMPClause *) * Clauses.size() +
2046 sizeof(Stmt *) *
2047 numLoopChildren(CollapsedNum,
2048 OMPD_target_teams_distribute_parallel_for));
2049 OMPTargetTeamsDistributeParallelForDirective *Dir =
2050 new (Mem) OMPTargetTeamsDistributeParallelForDirective(
2051 StartLoc, EndLoc, CollapsedNum, Clauses.size());
2052 Dir->setClauses(Clauses);
2053 Dir->setAssociatedStmt(AssociatedStmt);
2054 Dir->setIterationVariable(Exprs.IterationVarRef);
2055 Dir->setLastIteration(Exprs.LastIteration);
2056 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2057 Dir->setPreCond(Exprs.PreCond);
2058 Dir->setCond(Exprs.Cond);
2059 Dir->setInit(Exprs.Init);
2060 Dir->setInc(Exprs.Inc);
2061 Dir->setIsLastIterVariable(Exprs.IL);
2062 Dir->setLowerBoundVariable(Exprs.LB);
2063 Dir->setUpperBoundVariable(Exprs.UB);
2064 Dir->setStrideVariable(Exprs.ST);
2065 Dir->setEnsureUpperBound(Exprs.EUB);
2066 Dir->setNextLowerBound(Exprs.NLB);
2067 Dir->setNextUpperBound(Exprs.NUB);
2068 Dir->setNumIterations(Exprs.NumIterations);
2069 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2070 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2071 Dir->setDistInc(Exprs.DistInc);
2072 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2073 Dir->setCounters(Exprs.Counters);
2074 Dir->setPrivateCounters(Exprs.PrivateCounters);
2075 Dir->setInits(Exprs.Inits);
2076 Dir->setUpdates(Exprs.Updates);
2077 Dir->setFinals(Exprs.Finals);
2078 Dir->setDependentCounters(Exprs.DependentCounters);
2079 Dir->setDependentInits(Exprs.DependentInits);
2080 Dir->setFinalsConditions(Exprs.FinalsConditions);
2081 Dir->setPreInits(Exprs.PreInits);
2082 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2083 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2084 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2085 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2086 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2087 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2088 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2089 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2090 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2091 Dir->HasCancel = HasCancel;
2092 return Dir;
2093 }
2094
2095 OMPTargetTeamsDistributeParallelForDirective *
2096 OMPTargetTeamsDistributeParallelForDirective::CreateEmpty(const ASTContext &C,
2097 unsigned NumClauses,
2098 unsigned CollapsedNum,
2099 EmptyShell) {
2100 auto Size =
2101 llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForDirective),
2102 alignof(OMPClause *));
2103 void *Mem = C.Allocate(
2104 Size + sizeof(OMPClause *) * NumClauses +
2105 sizeof(Stmt *) *
2106 numLoopChildren(CollapsedNum,
2107 OMPD_target_teams_distribute_parallel_for));
2108 return new (Mem)
2109 OMPTargetTeamsDistributeParallelForDirective(CollapsedNum, NumClauses);
2110 }
2111
2112 OMPTargetTeamsDistributeParallelForSimdDirective *
2113 OMPTargetTeamsDistributeParallelForSimdDirective::Create(
2114 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2115 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2116 const HelperExprs &Exprs) {
2117 auto Size =
2118 llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForSimdDirective),
2119 alignof(OMPClause *));
2120 void *Mem = C.Allocate(
2121 Size + sizeof(OMPClause *) * Clauses.size() +
2122 sizeof(Stmt *) *
2123 numLoopChildren(CollapsedNum,
2124 OMPD_target_teams_distribute_parallel_for_simd));
2125 OMPTargetTeamsDistributeParallelForSimdDirective *Dir =
2126 new (Mem) OMPTargetTeamsDistributeParallelForSimdDirective(
2127 StartLoc, EndLoc, CollapsedNum, Clauses.size());
2128 Dir->setClauses(Clauses);
2129 Dir->setAssociatedStmt(AssociatedStmt);
2130 Dir->setIterationVariable(Exprs.IterationVarRef);
2131 Dir->setLastIteration(Exprs.LastIteration);
2132 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2133 Dir->setPreCond(Exprs.PreCond);
2134 Dir->setCond(Exprs.Cond);
2135 Dir->setInit(Exprs.Init);
2136 Dir->setInc(Exprs.Inc);
2137 Dir->setIsLastIterVariable(Exprs.IL);
2138 Dir->setLowerBoundVariable(Exprs.LB);
2139 Dir->setUpperBoundVariable(Exprs.UB);
2140 Dir->setStrideVariable(Exprs.ST);
2141 Dir->setEnsureUpperBound(Exprs.EUB);
2142 Dir->setNextLowerBound(Exprs.NLB);
2143 Dir->setNextUpperBound(Exprs.NUB);
2144 Dir->setNumIterations(Exprs.NumIterations);
2145 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2146 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2147 Dir->setDistInc(Exprs.DistInc);
2148 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2149 Dir->setCounters(Exprs.Counters);
2150 Dir->setPrivateCounters(Exprs.PrivateCounters);
2151 Dir->setInits(Exprs.Inits);
2152 Dir->setUpdates(Exprs.Updates);
2153 Dir->setFinals(Exprs.Finals);
2154 Dir->setDependentCounters(Exprs.DependentCounters);
2155 Dir->setDependentInits(Exprs.DependentInits);
2156 Dir->setFinalsConditions(Exprs.FinalsConditions);
2157 Dir->setPreInits(Exprs.PreInits);
2158 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2159 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2160 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2161 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2162 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2163 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2164 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2165 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2166 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2167 return Dir;
2168 }
2169
2170 OMPTargetTeamsDistributeParallelForSimdDirective *
2171 OMPTargetTeamsDistributeParallelForSimdDirective::CreateEmpty(
2172 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
2173 EmptyShell) {
2174 auto Size =
2175 llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForSimdDirective),
2176 alignof(OMPClause *));
2177 void *Mem = C.Allocate(
2178 Size + sizeof(OMPClause *) * NumClauses +
2179 sizeof(Stmt *) *
2180 numLoopChildren(CollapsedNum,
2181 OMPD_target_teams_distribute_parallel_for_simd));
2182 return new (Mem) OMPTargetTeamsDistributeParallelForSimdDirective(
2183 CollapsedNum, NumClauses);
2184 }
2185
2186 OMPTargetTeamsDistributeSimdDirective *
2187 OMPTargetTeamsDistributeSimdDirective::Create(
2188 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2189 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2190 const HelperExprs &Exprs) {
2191 auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeSimdDirective),
2192 alignof(OMPClause *));
2193 void *Mem = C.Allocate(
2194 Size + sizeof(OMPClause *) * Clauses.size() +
2195 sizeof(Stmt *) *
2196 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd));
2197 OMPTargetTeamsDistributeSimdDirective *Dir = new (Mem)
2198 OMPTargetTeamsDistributeSimdDirective(StartLoc, EndLoc, CollapsedNum,
2199 Clauses.size());
2200 Dir->setClauses(Clauses);
2201 Dir->setAssociatedStmt(AssociatedStmt);
2202 Dir->setIterationVariable(Exprs.IterationVarRef);
2203 Dir->setLastIteration(Exprs.LastIteration);
2204 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2205 Dir->setPreCond(Exprs.PreCond);
2206 Dir->setCond(Exprs.Cond);
2207 Dir->setInit(Exprs.Init);
2208 Dir->setInc(Exprs.Inc);
2209 Dir->setIsLastIterVariable(Exprs.IL);
2210 Dir->setLowerBoundVariable(Exprs.LB);
2211 Dir->setUpperBoundVariable(Exprs.UB);
2212 Dir->setStrideVariable(Exprs.ST);
2213 Dir->setEnsureUpperBound(Exprs.EUB);
2214 Dir->setNextLowerBound(Exprs.NLB);
2215 Dir->setNextUpperBound(Exprs.NUB);
2216 Dir->setNumIterations(Exprs.NumIterations);
2217 Dir->setCounters(Exprs.Counters);
2218 Dir->setPrivateCounters(Exprs.PrivateCounters);
2219 Dir->setInits(Exprs.Inits);
2220 Dir->setUpdates(Exprs.Updates);
2221 Dir->setFinals(Exprs.Finals);
2222 Dir->setDependentCounters(Exprs.DependentCounters);
2223 Dir->setDependentInits(Exprs.DependentInits);
2224 Dir->setFinalsConditions(Exprs.FinalsConditions);
2225 Dir->setPreInits(Exprs.PreInits);
2226 return Dir;
2227 }
2228
2229 OMPTargetTeamsDistributeSimdDirective *
2230 OMPTargetTeamsDistributeSimdDirective::CreateEmpty(const ASTContext &C,
2231 unsigned NumClauses,
2232 unsigned CollapsedNum,
2233 EmptyShell) {
2234 auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeSimdDirective),
2235 alignof(OMPClause *));
2236 void *Mem = C.Allocate(
2237 Size + sizeof(OMPClause *) * NumClauses +
2238 sizeof(Stmt *) *
2239 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd));
2240 return new (Mem)
2241 OMPTargetTeamsDistributeSimdDirective(CollapsedNum, NumClauses);
2242 }
clang::OMPLoopDirective::setPreInits
void setPreInits(Stmt *PreInits)
Definition: StmtOpenMP.h:605
clang::OMPLoopDirective::setCombinedParForInDistCond
void setCombinedParForInDistCond(Expr *CombParForInDistCond)
Definition: StmtOpenMP.h:724
clang::OMPLoopDirective::HelperExprs::NLB
Expr * NLB
Update of LowerBound for statically scheduled &#39;omp for&#39; loops.
Definition: StmtOpenMP.h:804
ASTContext.h
Defines the clang::ASTContext interface.
clang::OMPDistributeSimdDirective
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3757
clang::OMPLoopDirective::HelperExprs::Finals
SmallVector< Expr *, 4 > Finals
Final loop counter values for GodeGen.
Definition: StmtOpenMP.h:832
clang::OMPMasterDirective
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1591
clang::OMPLoopDirective::DistCombinedHelperExprs::NUB
Expr * NUB
Update of UpperBound for statically scheduled omp loops for outer loop in combined constructs (e...
Definition: StmtOpenMP.h:764
clang::OMPLoopDirective::HelperExprs::Updates
SmallVector< Expr *, 4 > Updates
Expressions for loop counters update for CodeGen.
Definition: StmtOpenMP.h:830
clang::OMPTaskDirective
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:1986
clang::OMPLoopDirective::setEnsureUpperBound
void setEnsureUpperBound(Expr *EUB)
Definition: StmtOpenMP.h:636
clang::OMPMasterTaskLoopSimdDirective::CreateEmpty
static OMPMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1211
clang::OMPMasterDirective::CreateEmpty
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:418
clang::OMPDistributeParallelForDirective::Create
static OMPDistributeParallelForDirective * 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:1410
clang::OMPAtomicDirective::Create
static OMPAtomicDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V, Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate)
Creates directive with a list of Clauses and &#39;x&#39;, &#39;v&#39; and &#39;expr&#39; parts of the atomic construct (see S...
Definition: StmtOpenMP.cpp:788
clang::OMPParallelMasterTaskLoopDirective::Create
static OMPParallelMasterTaskLoopDirective * 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:1223
clang::OMPLoopDirective::setCombinedCond
void setCombinedCond(Expr *CombCond)
Definition: StmtOpenMP.h:704
clang::OMPTeamsDirective::Create
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:988
clang::OMPLoopDirective::setCombinedLowerBoundVariable
void setCombinedLowerBoundVariable(Expr *CombLB)
Definition: StmtOpenMP.h:684
clang::OMPTaskwaitDirective::CreateEmpty
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:664
clang::OMPTargetParallelDirective::CreateEmpty
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:860
clang::OMPSectionDirective::setHasCancel
void setHasCancel(bool Has)
Set cancel state.
Definition: StmtOpenMP.h:1517
clang::Stmt
Stmt - This represents one statement.
Definition: Stmt.h:66
clang::OMPTaskgroupDirective::CreateEmpty
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:685
clang::OMPLoopDirective::setLastIteration
void setLastIteration(Expr *LI)
Definition: StmtOpenMP.h:591
clang::OMPExecutableDirective::isStandaloneDirective
bool isStandaloneDirective() const
Returns whether or not this is a Standalone directive.
Definition: StmtOpenMP.cpp:26
clang::OMPTaskgroupDirective::Create
static OMPTaskgroupDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef)
Creates directive.
Definition: StmtOpenMP.cpp:670
clang::OMPLoopDirective::setPrivateCounters
void setPrivateCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:119
clang::OMPTargetTeamsDistributeParallelForDirective::Create
static OMPTargetTeamsDistributeParallelForDirective * 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:2037
clang::OMPForSimdDirective
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1337
clang::OMPLoopDirective::HelperExprs::EUB
Expr * EUB
EnsureUpperBound – expression UB = min(UB, NumIterations).
Definition: StmtOpenMP.h:802
clang::OMPLoopDirective::HelperExprs::DistInc
Expr * DistInc
DistInc - increment expression for distribute loop when found combined with a further loop level (e...
Definition: StmtOpenMP.h:816
clang::OMPTeamsDistributeParallelForDirective
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:4171
clang::OMPSectionDirective::Create
static OMPSectionDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, bool HasCancel)
Creates directive.
Definition: StmtOpenMP.cpp:361
clang::OMPLoopDirective::setPrevEnsureUpperBound
void setPrevEnsureUpperBound(Expr *PrevEUB)
Definition: StmtOpenMP.h:679
clang::OMPParallelMasterDirective
This represents &#39;#pragma omp parallel master&#39; directive.
Definition: StmtOpenMP.h:1863
clang::OMPLoopDirective::setUpperBoundVariable
void setUpperBoundVariable(Expr *UB)
Definition: StmtOpenMP.h:622
clang::OMPLoopDirective::setNumIterations
void setNumIterations(Expr *NI)
Definition: StmtOpenMP.h:657
clang::OMPTargetTeamsDistributeDirective
This represents &#39;#pragma omp target teams distribute&#39; combined directive.
Definition: StmtOpenMP.h:4310
clang::OMPParallelMasterDirective::CreateEmpty
static OMPParallelMasterDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:568
clang::OMPLoopDirective::setNextLowerBound
void setNextLowerBound(Expr *NLB)
Definition: StmtOpenMP.h:643
clang::OMPMasterTaskLoopDirective::Create
static OMPMasterTaskLoopDirective * 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:1117
clang::OMPParallelForDirective
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1715
clang::OMPTargetTeamsDistributeParallelForDirective
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:4379
clang::OMPTeamsDistributeParallelForDirective::Create
static OMPTeamsDistributeParallelForDirective * 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:1885
clang::OMPLoopDirective::setDependentInits
void setDependentInits(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:151
clang::OMPLoopDirective::setIsLastIterVariable
void setIsLastIterVariable(Expr *IL)
Definition: StmtOpenMP.h:608
clang::OMPLoopDirective::HelperExprs::PrevLB
Expr * PrevLB
PreviousLowerBound - local variable passed to runtime in the enclosing schedule or null if that does ...
Definition: StmtOpenMP.h:809
clang::OMPTargetExitDataDirective
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2690
clang::OMPTargetTeamsDistributeSimdDirective::CreateEmpty
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:2230
clang::OMPTeamsDistributeDirective::Create
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:1705
clang::OMPParallelDirective::CreateEmpty
static OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:178
clang::OMPLoopDirective::setCombinedDistCond
void setCombinedDistCond(Expr *CombDistCond)
Definition: StmtOpenMP.h:719
clang::OMPTeamsDistributeParallelForSimdDirective::Create
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:1812
clang::OMPLoopDirective::setInit
void setInit(Expr *Init)
Definition: StmtOpenMP.h:603
clang::OMPMasterTaskLoopSimdDirective::Create
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:1169
clang::OMPLoopDirective::HelperExprs::LastIteration
Expr * LastIteration
Loop last iteration number.
Definition: StmtOpenMP.h:780
clang::OMPTargetExitDataDirective::CreateEmpty
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:980
clang::OMPTargetParallelForSimdDirective::Create
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:1605
clang::OMPTargetTeamsDistributeDirective::CreateEmpty
static OMPTargetTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:2023
clang::OMPExecutableDirective::getStructuredBlock
const Stmt * getStructuredBlock() const
Returns the AST node representing OpenMP structured-block of this OpenMP executable directive...
Definition: StmtOpenMP.cpp:37
clang::OMPTargetDirective::CreateEmpty
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:835
clang::OMPParallelDirective
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:357
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:168
clang::OMPTaskLoopSimdDirective::CreateEmpty
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1107
clang::OMPTargetEnterDataDirective::Create
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:944
clang::OMPTargetParallelForDirective::CreateEmpty
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:911
clang::OMPTargetUpdateDirective::Create
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:1386
clang::OMPFlushDirective::CreateEmpty
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:753
clang::OMPTargetSimdDirective
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:3895
clang::OMPTaskDirective::Create
static OMPTaskDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:604
clang::OMPDistributeDirective::Create
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:1335
clang::OMPBarrierDirective
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:2101
clang::OMPCriticalDirective
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1640
clang::OMPCriticalDirective::CreateEmpty
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:440
clang::OMPLoopDirective::setCond
void setCond(Expr *Cond)
Definition: StmtOpenMP.h:600
clang::OMPTaskLoopDirective::CreateEmpty
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1054
clang::OMPDistributeParallelForDirective
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3606
clang::OMPTeamsDistributeParallelForSimdDirective
This represents &#39;#pragma omp teams distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:4100
clang::OMPDistributeSimdDirective::CreateEmpty
static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1593
clang::OMPLoopDirective::DistCombinedHelperExprs::LB
Expr * LB
DistributeLowerBound - used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same construct...
Definition: StmtOpenMP.h:745
clang::OMPLoopDirective::DistCombinedHelperExprs::EUB
Expr * EUB
DistributeEnsureUpperBound - used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same construct...
Definition: StmtOpenMP.h:751
clang::OMPTeamsDistributeSimdDirective::Create
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:1757
clang::OMPTargetTeamsDistributeParallelForDirective::CreateEmpty
static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:2096
clang::OMPParallelMasterTaskLoopDirective::CreateEmpty
static OMPParallelMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1265
clang::OMPCancellationPointDirective
This represents &#39;#pragma omp cancellation point&#39; directive.
Definition: StmtOpenMP.h:2946
clang::OMPLoopDirective::setCombinedInit
void setCombinedInit(Expr *CombInit)
Definition: StmtOpenMP.h:699
clang::getFinals
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
Definition: OpenMPClause.h:3249
clang::OMPTeamsDirective
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:2888
clang::OMPFlushDirective::Create
static OMPFlushDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:740
clang::OMPLoopDirective::HelperExprs::CalcLastIteration
Expr * CalcLastIteration
Calculation of last iteration.
Definition: StmtOpenMP.h:784
clang::OMPTargetTeamsDistributeDirective::Create
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:1980
clang::OMPTeamsDistributeSimdDirective
This represents &#39;#pragma omp teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4029
clang::OMPTargetParallelForSimdDirective::CreateEmpty
static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1648
clang::OMPLoopDirective::HelperExprs::FinalsConditions
SmallVector< Expr *, 4 > FinalsConditions
List of final conditions required for the generation of the non-rectangular loops.
Definition: StmtOpenMP.h:841
clang::OMPTaskyieldDirective::CreateEmpty
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:636
clang::OMPParallelMasterTaskLoopSimdDirective::CreateEmpty
static OMPParallelMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1321
clang::OMPParallelForSimdDirective::Create
static OMPParallelForSimdDirective * 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:502
llvm::ArrayRef
Definition: LLVM.h:31
clang::OpenMPDirectiveKind
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:62
clang::OMPLoopDirective::HelperExprs::NUB
Expr * NUB
Update of UpperBound for statically scheduled &#39;omp for&#39; loops.
Definition: StmtOpenMP.h:806
clang::OMPLoopDirective::HelperExprs::Cond
Expr * Cond
Loop condition.
Definition: StmtOpenMP.h:788
clang::OMPDistributeSimdDirective::Create
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:1551
clang::OMPTargetParallelForDirective::Create
static OMPTargetParallelForDirective * 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:869
clang::OMPTargetDataDirective::CreateEmpty
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:935
clang::OMPTeamsDistributeSimdDirective::CreateEmpty
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1799
clang::OMPTargetParallelDirective::Create
static OMPTargetParallelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:845
clang::OMPLoopDirective::HelperExprs::PreCond
Expr * PreCond
Loop pre-condition.
Definition: StmtOpenMP.h:786
clang::OMPTargetParallelForSimdDirective
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:3825
clang::OMPLoopDirective::setDependentCounters
void setDependentCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:144
clang::OMPLoopDirective::HelperExprs
The expressions built for the OpenMP loop CodeGen for the whole collapsed loop nest.
Definition: StmtOpenMP.h:776
clang::OMPTargetSimdDirective::CreateEmpty
static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1695
clang::OMPTaskgroupDirective
This represents &#39;#pragma omp taskgroup&#39; directive.
Definition: StmtOpenMP.h:2193
clang::OMPSingleDirective::CreateEmpty
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:397
clang::OMPCriticalDirective::Create
static OMPCriticalDirective * Create(const ASTContext &C, const DeclarationNameInfo &Name, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:425
clang::OMPLoopDirective::DistCombinedHelperExprs::DistCond
Expr * DistCond
Distribute Loop condition used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same construct whe...
Definition: StmtOpenMP.h:767
clang::OMPLoopDirective::HelperExprs::IterationVarRef
Expr * IterationVarRef
Loop iteration variable.
Definition: StmtOpenMP.h:778
clang::OMPDistributeParallelForSimdDirective::Create
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:1481
clang::OMPLoopDirective::DistCombinedHelperExprs::Init
Expr * Init
Distribute loop iteration variable init used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same...
Definition: StmtOpenMP.h:755
clang::OMPTeamsDirective::CreateEmpty
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1004
clang::OMPDistributeDirective
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:3480
clang::OMPLoopDirective::setInits
void setInits(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:126
clang::OMPSimdDirective::CreateEmpty
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:220
clang::Expr
This represents one expression.
Definition: Expr.h:108
clang::OMPTargetTeamsDistributeParallelForSimdDirective::Create
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:2113
clang::getUpdates
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
Definition: OpenMPClause.h:3241
clang::Stmt::IgnoreContainers
Stmt * IgnoreContainers(bool IgnoreCaptured=false)
Skip no-op (attributed, compound) container stmts and skip captured stmt at the top, if IgnoreCaptured is true.
Definition: Stmt.cpp:134
clang::OMPLoopDirective::HelperExprs::DependentInits
SmallVector< Expr *, 4 > DependentInits
List of initializers required for the generation of the non-rectangular loops.
Definition: StmtOpenMP.h:838
clang::OMPMasterTaskLoopDirective
This represents &#39;#pragma omp master taskloop&#39; directive.
Definition: StmtOpenMP.h:3204
clang::OMPMasterTaskLoopDirective::CreateEmpty
static OMPMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1158
V
#define V(N, I)
Definition: ASTContext.h:2941
clang::OMPDistributeParallelForSimdDirective::CreateEmpty
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1537
clang::OMPMasterDirective::Create
static OMPMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:407
clang::OMPTargetTeamsDistributeParallelForSimdDirective
This represents &#39;#pragma omp target teams distribute parallel for simd&#39; combined directive.
Definition: StmtOpenMP.h:4463
clang::OMPTargetSimdDirective::Create
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:1662
clang::OMPTargetDirective::Create
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:819
clang::OMPTargetTeamsDistributeSimdDirective
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4536
clang::OMPLoopDirective::HelperExprs::PrevUB
Expr * PrevUB
PreviousUpperBound - local variable passed to runtime in the enclosing schedule or null if that does ...
Definition: StmtOpenMP.h:812
clang::OMPOrderedDirective::Create
static OMPOrderedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive.
Definition: StmtOpenMP.cpp:762
clang::OMPForDirective
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1259
clang::OMPTargetEnterDataDirective::CreateEmpty
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:958
clang::OMPTargetTeamsDirective
This represents &#39;#pragma omp target teams&#39; directive.
Definition: StmtOpenMP.h:4251
clang::OMPExecutableDirective::setAssociatedStmt
void setAssociatedStmt(Stmt *S)
Set the associated statement for the directive.
Definition: StmtOpenMP.h:85
clang::OMPDistributeDirective::CreateEmpty
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1376
clang::OMPLoopDirective::DistCombinedHelperExprs::ParForInDistCond
Expr * ParForInDistCond
&#39;omp parallel for&#39; loop condition used when composed with &#39;omp distribute&#39; in the same construct and ...
Definition: StmtOpenMP.h:771
clang::OMPParallelForSimdDirective::CreateEmpty
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:543
clang::OMPCancelDirective
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:3005
clang::OMPLoopDirective::setDistInc
void setDistInc(Expr *DistInc)
Definition: StmtOpenMP.h:674
clang::OMPLoopDirective::DistCombinedHelperExprs::NLB
Expr * NLB
Update of LowerBound for statically scheduled omp loops for outer loop in combined constructs (e...
Definition: StmtOpenMP.h:761
clang::OMPDistributeParallelForDirective::CreateEmpty
static OMPDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1467
clang::OMPExecutableDirective::setClauses
void setClauses(ArrayRef< OMPClause *> Clauses)
Sets the list of variables for this clause.
Definition: StmtOpenMP.cpp:20
clang::OMPLoopDirective::tryToFindNextInnerLoop
static Stmt * tryToFindNextInnerLoop(Stmt *CurStmt, bool TryImperfectlyNestedLoops)
Try to find the next loop sub-statement in the specified statement CurStmt.
Definition: StmtOpenMP.cpp:45
clang::OMPFlushDirective
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:2267
clang::OMPParallelForSimdDirective
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1796
clang::OMPLoopDirective::HelperExprs::NumIterations
Expr * NumIterations
Loop number of iterations.
Definition: StmtOpenMP.h:782
clang::OMPForDirective::Create
static OMPForDirective * 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:232
clang::OMPLoopDirective::HelperExprs::ST
Expr * ST
Stride - local variable passed to runtime.
Definition: StmtOpenMP.h:800
clang::OMPParallelMasterTaskLoopDirective
This represents &#39;#pragma omp parallel master taskloop&#39; directive.
Definition: StmtOpenMP.h:3340
clang::OMPParallelForDirective::CreateEmpty
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:492
clang::OMPTargetEnterDataDirective
This represents &#39;#pragma omp target enter data&#39; directive.
Definition: StmtOpenMP.h:2631
clang::OMPLoopDirective::setUpdates
void setUpdates(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:132
clang::OMPLoopDirective::HelperExprs::PrivateCounters
SmallVector< Expr *, 4 > PrivateCounters
PrivateCounters Loop counters.
Definition: StmtOpenMP.h:826
clang::OMPLoopDirective::setLowerBoundVariable
void setLowerBoundVariable(Expr *LB)
Definition: StmtOpenMP.h:615
clang::OMPMasterTaskLoopSimdDirective
This represents &#39;#pragma omp master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3272
clang::OMPSectionDirective::CreateEmpty
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:374
clang::OMPLoopDirective::HelperExprs::Counters
SmallVector< Expr *, 4 > Counters
Counters Loop counters.
Definition: StmtOpenMP.h:824
omp
clang::OMPSingleDirective
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1535
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:86
clang::OMPLoopDirective::setPrevLowerBoundVariable
void setPrevLowerBoundVariable(Expr *PrevLB)
Definition: StmtOpenMP.h:664
clang::OMPLoopDirective::setIterationVariable
void setIterationVariable(Expr *IV)
Definition: StmtOpenMP.h:588
clang::getInits
MutableArrayRef< Expr * > getInits()
Definition: OpenMPClause.h:3233
clang::OMPTaskDirective::CreateEmpty
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:618
clang::OMPTargetUpdateDirective::CreateEmpty
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1401
clang::OMPLoopDirective::setCombinedNextLowerBound
void setCombinedNextLowerBound(Expr *CombNLB)
Definition: StmtOpenMP.h:709
clang::OMPParallelForDirective::Create
static OMPParallelForDirective * 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:450
clang::OMPParallelDirective::Create
static OMPParallelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:163
clang::OMPTargetExitDataDirective::Create
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:966
clang::OMPAtomicDirective::CreateEmpty
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:809
clang::OMPTaskwaitDirective
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:2147
clang::OMPLoopDirective::HelperExprs::PrevEUB
Expr * PrevEUB
PrevEUB - expression similar to EUB but to be used when loop scheduling uses PrevLB and PrevUB (e...
Definition: StmtOpenMP.h:822
clang::OMPClause
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:51
clang::OMPLoopDirective::setFinalsConditions
void setFinalsConditions(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:157
clang::OMPOrderedDirective::CreateEmpty
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:778
llvm::SmallVector
Definition: LLVM.h:35
clang::OMPTargetDirective
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2514
clang::OMPTeamsDistributeParallelForDirective::CreateEmpty
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1942
clang::OMPTeamsDistributeDirective::CreateEmpty
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1746
clang::OMPLoopDirective::HelperExprs::DistCombinedFields
DistCombinedHelperExprs DistCombinedFields
Expressions used when combining OpenMP loop pragmas.
Definition: StmtOpenMP.h:846
clang::OMPForSimdDirective::Create
static OMPForSimdDirective * 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:284
clang::OMPOrderedDirective
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2323
clang::OMPLoopDirective::HelperExprs::LB
Expr * LB
LowerBound - local variable passed to runtime.
Definition: StmtOpenMP.h:796
clang::OMPTargetUpdateDirective
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:3547
clang::OMPLoopDirective::HelperExprs::Init
Expr * Init
Loop iteration variable init.
Definition: StmtOpenMP.h:790
clang::OMPParallelMasterTaskLoopSimdDirective
This represents &#39;#pragma omp parallel master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3411
clang::OMPSingleDirective::Create
static OMPSingleDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:381
clang::Stmt::EmptyShell
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
Definition: Stmt.h:1056
clang::ASTContext::Allocate
void * Allocate(size_t Size, unsigned Align=8) const
Definition: ASTContext.h:686
clang::OMPLoopDirective::setPrevUpperBoundVariable
void setPrevUpperBoundVariable(Expr *PrevUB)
Definition: StmtOpenMP.h:669
clang::OMPLoopDirective::setCombinedEnsureUpperBound
void setCombinedEnsureUpperBound(Expr *CombEUB)
Definition: StmtOpenMP.h:694
clang::OMPForDirective::CreateEmpty
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:272
clang::OMPLoopDirective::setCounters
void setCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:113
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:21
clang::OMPLoopDirective::HelperExprs::Inits
SmallVector< Expr *, 4 > Inits
Expressions for loop counters inits for CodeGen.
Definition: StmtOpenMP.h:828
clang::OMPLoopDirective::setCombinedUpperBoundVariable
void setCombinedUpperBoundVariable(Expr *CombUB)
Definition: StmtOpenMP.h:689
clang::OMPTargetTeamsDirective::CreateEmpty
static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1971
clang::OMPSectionDirective
This represents &#39;#pragma omp section&#39; directive.
Definition: StmtOpenMP.h:1472
clang::OMPLoopDirective::HelperExprs::DependentCounters
SmallVector< Expr *, 4 > DependentCounters
List of counters required for the generation of the non-rectangular loops.
Definition: StmtOpenMP.h:835
clang::OMPTeamsDistributeDirective
This represents &#39;#pragma omp teams distribute&#39; directive.
Definition: StmtOpenMP.h:3961
clang::OMPParallelSectionsDirective::Create
static OMPParallelSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:578
clang::OMPSimdDirective
This represents &#39;#pragma omp simd&#39; directive.
Definition: StmtOpenMP.h:1194
clang::DeclarationNameInfo
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
Definition: DeclarationName.h:690
clang::OMPAtomicDirective
This represents &#39;#pragma omp atomic&#39; directive.
Definition: StmtOpenMP.h:2379
clang::OMPForSimdDirective::CreateEmpty
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:324
clang::OMPBarrierDirective::CreateEmpty
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:650
StmtOpenMP.h
This file defines OpenMP AST classes for executable directives and clauses.
clang::OMPSectionsDirective::Create
static OMPSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:336
clang::OMPLoopDirective::HelperExprs::Inc
Expr * Inc
Loop increment.
Definition: StmtOpenMP.h:792
clang::OMPTargetTeamsDirective::Create
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:1956
clang::OMPTargetTeamsDistributeParallelForSimdDirective::CreateEmpty
static OMPTargetTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:2171
clang::OMPTaskLoopDirective::Create
static OMPTaskLoopDirective * 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:1014
clang::OMPLoopDirective::DistCombinedHelperExprs::UB
Expr * UB
DistributeUpperBound - used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same construct...
Definition: StmtOpenMP.h:748
X
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
Definition: SemaDecl.cpp:14780
clang::OMPTaskyieldDirective::Create
static OMPTaskyieldDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:627
clang::OMPTargetDataDirective::Create
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:922
clang::OMPLoopDirective::HelperExprs::UB
Expr * UB
UpperBound - local variable passed to runtime.
Definition: StmtOpenMP.h:798
clang::OMPTargetParallelDirective
This represents &#39;#pragma omp target parallel&#39; directive.
Definition: StmtOpenMP.h:2748
clang::OMPLoopDirective::setStrideVariable
void setStrideVariable(Expr *ST)
Definition: StmtOpenMP.h:629
clang::OMPLoopDirective::getBody
Stmt * getBody()
Definition: StmtOpenMP.cpp:89
clang::OMPParallelSectionsDirective::CreateEmpty
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:594
clang::OMPBarrierDirective::Create
static OMPBarrierDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:642
clang::AttrSyntax::C
clang::OMPSimdDirective::Create
static OMPSimdDirective * 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:189
clang::OMPTaskLoopSimdDirective
This represents &#39;#pragma omp taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3137
clang::OMPSectionsDirective::CreateEmpty
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:351
clang::OMPLoopDirective::setPreCond
void setPreCond(Expr *PC)
Definition: StmtOpenMP.h:597
clang::OMPCancelDirective::CreateEmpty
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:730
clang::OMPTaskwaitDirective::Create
static OMPTaskwaitDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
Definition: StmtOpenMP.cpp:656
clang::OMPSectionsDirective
This represents &#39;#pragma omp sections&#39; directive.
Definition: StmtOpenMP.h:1403
clang::OMPLoopDirective::DistCombinedHelperExprs::Cond
Expr * Cond
Distribute Loop condition used when composing &#39;omp distribute&#39; with &#39;omp for&#39; in a same construct...
Definition: StmtOpenMP.h:758
clang::OMPLoopDirective::HelperExprs::PreInits
Stmt * PreInits
Init statement for all captured expressions.
Definition: StmtOpenMP.h:843
clang::OMPTargetDataDirective
This represents &#39;#pragma omp target data&#39; directive.
Definition: StmtOpenMP.h:2573
clang::OMPLoopDirective::setNextUpperBound
void setNextUpperBound(Expr *NUB)
Definition: StmtOpenMP.h:650
clang::OMPTargetTeamsDistributeSimdDirective::Create
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:2187
clang::OMPLoopDirective::setInc
void setInc(Expr *Inc)
Definition: StmtOpenMP.h:604
clang::OMPCancelDirective::Create
static OMPCancelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, OpenMPDirectiveKind CancelRegion)
Creates directive.
Definition: StmtOpenMP.cpp:716
clang::OMPLoopDirective::HelperExprs::IL
Expr * IL
IsLastIteration - local flag variable passed to runtime.
Definition: StmtOpenMP.h:794
clang::OMPTaskyieldDirective
This represents &#39;#pragma omp taskyield&#39; directive.
Definition: StmtOpenMP.h:2055
clang::OMPDistributeParallelForSimdDirective
This represents &#39;#pragma omp distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3688
clang::OMPCancellationPointDirective::Create
static OMPCancellationPointDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Creates directive.
Definition: StmtOpenMP.cpp:695
clang::OMPParallelSectionsDirective
This represents &#39;#pragma omp parallel sections&#39; directive.
Definition: StmtOpenMP.h:1914
clang::OMPLoopDirective::setCalcLastIteration
void setCalcLastIteration(Expr *CLI)
Definition: StmtOpenMP.h:594
clang::OMPLoopDirective::setCombinedNextUpperBound
void setCombinedNextUpperBound(Expr *CombNUB)
Definition: StmtOpenMP.h:714
clang::OMPTaskLoopSimdDirective::Create
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:1066
clang::OMPParallelMasterTaskLoopSimdDirective::Create
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:1279
clang::OMPLoopDirective::setFinals
void setFinals(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:138
clang::OMPTeamsDistributeParallelForSimdDirective::CreateEmpty
static OMPTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:1869
clang::OMPTargetParallelForDirective
This represents &#39;#pragma omp target parallel for&#39; directive.
Definition: StmtOpenMP.h:2808
clang::OMPCancellationPointDirective::CreateEmpty
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:708
clang::OMPParallelMasterDirective::Create
static OMPParallelMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Definition: StmtOpenMP.cpp:554
clang::OMPTaskLoopDirective
This represents &#39;#pragma omp taskloop&#39; directive.
Definition: StmtOpenMP.h:3071