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