Coverage Report

Created: 2022-05-14 11:35

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