Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/lib/AST/StmtOpenMP.cpp
Line
Count
Source
1
//===--- StmtOpenMP.cpp - Classes for OpenMP directives -------------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file implements the subclesses of Stmt class declared in StmtOpenMP.h
10
//
11
//===----------------------------------------------------------------------===//
12
13
#include "clang/AST/StmtOpenMP.h"
14
15
#include "clang/AST/ASTContext.h"
16
17
using namespace clang;
18
19
156k
void OMPExecutableDirective::setClauses(ArrayRef<OMPClause *> Clauses) {
20
156k
  assert(Clauses.size() == getNumClauses() &&
21
156k
         "Number of clauses is not the same as the preallocated buffer");
22
156k
  std::copy(Clauses.begin(), Clauses.end(), getClauses().begin());
23
156k
}
24
25
161k
bool OMPExecutableDirective::isStandaloneDirective() const {
26
161k
  // Special case: 'omp target enter data', 'omp target exit data',
27
161k
  // 'omp target update' are stand-alone directives, but for implementation
28
161k
  // reasons they have empty synthetic structured block, to simplify codegen.
29
161k
  if (isa<OMPTargetEnterDataDirective>(this) ||
30
161k
      
isa<OMPTargetExitDataDirective>(this)160k
||
31
161k
      
isa<OMPTargetUpdateDirective>(this)159k
)
32
3.25k
    return true;
33
158k
  return !hasAssociatedStmt() || 
!getAssociatedStmt()157k
;
34
158k
}
35
36
156k
const Stmt *OMPExecutableDirective::getStructuredBlock() const {
37
156k
  assert(!isStandaloneDirective() &&
38
156k
         "Standalone Executable Directives don't have Structured Blocks.");
39
156k
  if (auto *LD = dyn_cast<OMPLoopDirective>(this))
40
79.7k
    return LD->getBody();
41
76.8k
  return getInnermostCapturedStmt()->getCapturedStmt();
42
76.8k
}
43
44
77.0k
void OMPLoopDirective::setCounters(ArrayRef<Expr *> A) {
45
77.0k
  assert(A.size() == getCollapsedNumber() &&
46
77.0k
         "Number of loop counters is not the same as the collapsed number");
47
77.0k
  std::copy(A.begin(), A.end(), getCounters().begin());
48
77.0k
}
49
50
77.0k
void OMPLoopDirective::setPrivateCounters(ArrayRef<Expr *> A) {
51
77.0k
  assert(A.size() == getCollapsedNumber() && "Number of loop private counters "
52
77.0k
                                             "is not the same as the collapsed "
53
77.0k
                                             "number");
54
77.0k
  std::copy(A.begin(), A.end(), getPrivateCounters().begin());
55
77.0k
}
56
57
77.0k
void OMPLoopDirective::setInits(ArrayRef<Expr *> A) {
58
77.0k
  assert(A.size() == getCollapsedNumber() &&
59
77.0k
         "Number of counter inits is not the same as the collapsed number");
60
77.0k
  std::copy(A.begin(), A.end(), getInits().begin());
61
77.0k
}
62
63
77.0k
void OMPLoopDirective::setUpdates(ArrayRef<Expr *> A) {
64
77.0k
  assert(A.size() == getCollapsedNumber() &&
65
77.0k
         "Number of counter updates is not the same as the collapsed number");
66
77.0k
  std::copy(A.begin(), A.end(), getUpdates().begin());
67
77.0k
}
68
69
77.0k
void OMPLoopDirective::setFinals(ArrayRef<Expr *> A) {
70
77.0k
  assert(A.size() == getCollapsedNumber() &&
71
77.0k
         "Number of counter finals is not the same as the collapsed number");
72
77.0k
  std::copy(A.begin(), A.end(), getFinals().begin());
73
77.0k
}
74
75
OMPParallelDirective *OMPParallelDirective::Create(
76
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
77
11.1k
    ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
78
11.1k
  unsigned Size =
79
11.1k
      llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *));
80
11.1k
  void *Mem =
81
11.1k
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
82
11.1k
  OMPParallelDirective *Dir =
83
11.1k
      new (Mem) OMPParallelDirective(StartLoc, EndLoc, Clauses.size());
84
11.1k
  Dir->setClauses(Clauses);
85
11.1k
  Dir->setAssociatedStmt(AssociatedStmt);
86
11.1k
  Dir->setHasCancel(HasCancel);
87
11.1k
  return Dir;
88
11.1k
}
89
90
OMPParallelDirective *OMPParallelDirective::CreateEmpty(const ASTContext &C,
91
                                                        unsigned NumClauses,
92
461
                                                        EmptyShell) {
93
461
  unsigned Size =
94
461
      llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *));
95
461
  void *Mem =
96
461
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
97
461
  return new (Mem) OMPParallelDirective(NumClauses);
98
461
}
99
100
OMPSimdDirective *
101
OMPSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc,
102
                         SourceLocation EndLoc, unsigned CollapsedNum,
103
                         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
104
3.09k
                         const HelperExprs &Exprs) {
105
3.09k
  unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *));
106
3.09k
  void *Mem =
107
3.09k
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
108
3.09k
                 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
109
3.09k
  OMPSimdDirective *Dir = new (Mem)
110
3.09k
      OMPSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
111
3.09k
  Dir->setClauses(Clauses);
112
3.09k
  Dir->setAssociatedStmt(AssociatedStmt);
113
3.09k
  Dir->setIterationVariable(Exprs.IterationVarRef);
114
3.09k
  Dir->setLastIteration(Exprs.LastIteration);
115
3.09k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
116
3.09k
  Dir->setPreCond(Exprs.PreCond);
117
3.09k
  Dir->setCond(Exprs.Cond);
118
3.09k
  Dir->setInit(Exprs.Init);
119
3.09k
  Dir->setInc(Exprs.Inc);
120
3.09k
  Dir->setCounters(Exprs.Counters);
121
3.09k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
122
3.09k
  Dir->setInits(Exprs.Inits);
123
3.09k
  Dir->setUpdates(Exprs.Updates);
124
3.09k
  Dir->setFinals(Exprs.Finals);
125
3.09k
  Dir->setPreInits(Exprs.PreInits);
126
3.09k
  return Dir;
127
3.09k
}
128
129
OMPSimdDirective *OMPSimdDirective::CreateEmpty(const ASTContext &C,
130
                                                unsigned NumClauses,
131
                                                unsigned CollapsedNum,
132
84
                                                EmptyShell) {
133
84
  unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *));
134
84
  void *Mem =
135
84
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
136
84
                 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
137
84
  return new (Mem) OMPSimdDirective(CollapsedNum, NumClauses);
138
84
}
139
140
OMPForDirective *
141
OMPForDirective::Create(const ASTContext &C, SourceLocation StartLoc,
142
                        SourceLocation EndLoc, unsigned CollapsedNum,
143
                        ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
144
3.52k
                        const HelperExprs &Exprs, bool HasCancel) {
145
3.52k
  unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *));
146
3.52k
  void *Mem =
147
3.52k
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
148
3.52k
                 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
149
3.52k
  OMPForDirective *Dir =
150
3.52k
      new (Mem) OMPForDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
151
3.52k
  Dir->setClauses(Clauses);
152
3.52k
  Dir->setAssociatedStmt(AssociatedStmt);
153
3.52k
  Dir->setIterationVariable(Exprs.IterationVarRef);
154
3.52k
  Dir->setLastIteration(Exprs.LastIteration);
155
3.52k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
156
3.52k
  Dir->setPreCond(Exprs.PreCond);
157
3.52k
  Dir->setCond(Exprs.Cond);
158
3.52k
  Dir->setInit(Exprs.Init);
159
3.52k
  Dir->setInc(Exprs.Inc);
160
3.52k
  Dir->setIsLastIterVariable(Exprs.IL);
161
3.52k
  Dir->setLowerBoundVariable(Exprs.LB);
162
3.52k
  Dir->setUpperBoundVariable(Exprs.UB);
163
3.52k
  Dir->setStrideVariable(Exprs.ST);
164
3.52k
  Dir->setEnsureUpperBound(Exprs.EUB);
165
3.52k
  Dir->setNextLowerBound(Exprs.NLB);
166
3.52k
  Dir->setNextUpperBound(Exprs.NUB);
167
3.52k
  Dir->setNumIterations(Exprs.NumIterations);
168
3.52k
  Dir->setCounters(Exprs.Counters);
169
3.52k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
170
3.52k
  Dir->setInits(Exprs.Inits);
171
3.52k
  Dir->setUpdates(Exprs.Updates);
172
3.52k
  Dir->setFinals(Exprs.Finals);
173
3.52k
  Dir->setPreInits(Exprs.PreInits);
174
3.52k
  Dir->setHasCancel(HasCancel);
175
3.52k
  return Dir;
176
3.52k
}
177
178
OMPForDirective *OMPForDirective::CreateEmpty(const ASTContext &C,
179
                                              unsigned NumClauses,
180
                                              unsigned CollapsedNum,
181
202
                                              EmptyShell) {
182
202
  unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *));
183
202
  void *Mem =
184
202
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
185
202
                 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
186
202
  return new (Mem) OMPForDirective(CollapsedNum, NumClauses);
187
202
}
188
189
OMPForSimdDirective *
190
OMPForSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc,
191
                            SourceLocation EndLoc, unsigned CollapsedNum,
192
                            ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
193
3.05k
                            const HelperExprs &Exprs) {
194
3.05k
  unsigned Size =
195
3.05k
      llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *));
196
3.05k
  void *Mem =
197
3.05k
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
198
3.05k
                 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
199
3.05k
  OMPForSimdDirective *Dir = new (Mem)
200
3.05k
      OMPForSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
201
3.05k
  Dir->setClauses(Clauses);
202
3.05k
  Dir->setAssociatedStmt(AssociatedStmt);
203
3.05k
  Dir->setIterationVariable(Exprs.IterationVarRef);
204
3.05k
  Dir->setLastIteration(Exprs.LastIteration);
205
3.05k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
206
3.05k
  Dir->setPreCond(Exprs.PreCond);
207
3.05k
  Dir->setCond(Exprs.Cond);
208
3.05k
  Dir->setInit(Exprs.Init);
209
3.05k
  Dir->setInc(Exprs.Inc);
210
3.05k
  Dir->setIsLastIterVariable(Exprs.IL);
211
3.05k
  Dir->setLowerBoundVariable(Exprs.LB);
212
3.05k
  Dir->setUpperBoundVariable(Exprs.UB);
213
3.05k
  Dir->setStrideVariable(Exprs.ST);
214
3.05k
  Dir->setEnsureUpperBound(Exprs.EUB);
215
3.05k
  Dir->setNextLowerBound(Exprs.NLB);
216
3.05k
  Dir->setNextUpperBound(Exprs.NUB);
217
3.05k
  Dir->setNumIterations(Exprs.NumIterations);
218
3.05k
  Dir->setCounters(Exprs.Counters);
219
3.05k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
220
3.05k
  Dir->setInits(Exprs.Inits);
221
3.05k
  Dir->setUpdates(Exprs.Updates);
222
3.05k
  Dir->setFinals(Exprs.Finals);
223
3.05k
  Dir->setPreInits(Exprs.PreInits);
224
3.05k
  return Dir;
225
3.05k
}
226
227
OMPForSimdDirective *OMPForSimdDirective::CreateEmpty(const ASTContext &C,
228
                                                      unsigned NumClauses,
229
                                                      unsigned CollapsedNum,
230
54
                                                      EmptyShell) {
231
54
  unsigned Size =
232
54
      llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *));
233
54
  void *Mem =
234
54
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
235
54
                 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
236
54
  return new (Mem) OMPForSimdDirective(CollapsedNum, NumClauses);
237
54
}
238
239
OMPSectionsDirective *OMPSectionsDirective::Create(
240
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
241
1.66k
    ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
242
1.66k
  unsigned Size =
243
1.66k
      llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *));
244
1.66k
  void *Mem =
245
1.66k
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
246
1.66k
  OMPSectionsDirective *Dir =
247
1.66k
      new (Mem) OMPSectionsDirective(StartLoc, EndLoc, Clauses.size());
248
1.66k
  Dir->setClauses(Clauses);
249
1.66k
  Dir->setAssociatedStmt(AssociatedStmt);
250
1.66k
  Dir->setHasCancel(HasCancel);
251
1.66k
  return Dir;
252
1.66k
}
253
254
OMPSectionsDirective *OMPSectionsDirective::CreateEmpty(const ASTContext &C,
255
                                                        unsigned NumClauses,
256
40
                                                        EmptyShell) {
257
40
  unsigned Size =
258
40
      llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *));
259
40
  void *Mem =
260
40
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
261
40
  return new (Mem) OMPSectionsDirective(NumClauses);
262
40
}
263
264
OMPSectionDirective *OMPSectionDirective::Create(const ASTContext &C,
265
                                                 SourceLocation StartLoc,
266
                                                 SourceLocation EndLoc,
267
                                                 Stmt *AssociatedStmt,
268
359
                                                 bool HasCancel) {
269
359
  unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *));
270
359
  void *Mem = C.Allocate(Size + sizeof(Stmt *));
271
359
  OMPSectionDirective *Dir = new (Mem) OMPSectionDirective(StartLoc, EndLoc);
272
359
  Dir->setAssociatedStmt(AssociatedStmt);
273
359
  Dir->setHasCancel(HasCancel);
274
359
  return Dir;
275
359
}
276
277
OMPSectionDirective *OMPSectionDirective::CreateEmpty(const ASTContext &C,
278
38
                                                      EmptyShell) {
279
38
  unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *));
280
38
  void *Mem = C.Allocate(Size + sizeof(Stmt *));
281
38
  return new (Mem) OMPSectionDirective();
282
38
}
283
284
OMPSingleDirective *OMPSingleDirective::Create(const ASTContext &C,
285
                                               SourceLocation StartLoc,
286
                                               SourceLocation EndLoc,
287
                                               ArrayRef<OMPClause *> Clauses,
288
939
                                               Stmt *AssociatedStmt) {
289
939
  unsigned Size =
290
939
      llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *));
291
939
  void *Mem =
292
939
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
293
939
  OMPSingleDirective *Dir =
294
939
      new (Mem) OMPSingleDirective(StartLoc, EndLoc, Clauses.size());
295
939
  Dir->setClauses(Clauses);
296
939
  Dir->setAssociatedStmt(AssociatedStmt);
297
939
  return Dir;
298
939
}
299
300
OMPSingleDirective *OMPSingleDirective::CreateEmpty(const ASTContext &C,
301
                                                    unsigned NumClauses,
302
36
                                                    EmptyShell) {
303
36
  unsigned Size =
304
36
      llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *));
305
36
  void *Mem =
306
36
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
307
36
  return new (Mem) OMPSingleDirective(NumClauses);
308
36
}
309
310
OMPMasterDirective *OMPMasterDirective::Create(const ASTContext &C,
311
                                               SourceLocation StartLoc,
312
                                               SourceLocation EndLoc,
313
367
                                               Stmt *AssociatedStmt) {
314
367
  unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *));
315
367
  void *Mem = C.Allocate(Size + sizeof(Stmt *));
316
367
  OMPMasterDirective *Dir = new (Mem) OMPMasterDirective(StartLoc, EndLoc);
317
367
  Dir->setAssociatedStmt(AssociatedStmt);
318
367
  return Dir;
319
367
}
320
321
OMPMasterDirective *OMPMasterDirective::CreateEmpty(const ASTContext &C,
322
8
                                                    EmptyShell) {
323
8
  unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *));
324
8
  void *Mem = C.Allocate(Size + sizeof(Stmt *));
325
8
  return new (Mem) OMPMasterDirective();
326
8
}
327
328
OMPCriticalDirective *OMPCriticalDirective::Create(
329
    const ASTContext &C, const DeclarationNameInfo &Name,
330
    SourceLocation StartLoc, SourceLocation EndLoc,
331
653
    ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
332
653
  unsigned Size =
333
653
      llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *));
334
653
  void *Mem =
335
653
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
336
653
  OMPCriticalDirective *Dir =
337
653
      new (Mem) OMPCriticalDirective(Name, StartLoc, EndLoc, Clauses.size());
338
653
  Dir->setClauses(Clauses);
339
653
  Dir->setAssociatedStmt(AssociatedStmt);
340
653
  return Dir;
341
653
}
342
343
OMPCriticalDirective *OMPCriticalDirective::CreateEmpty(const ASTContext &C,
344
                                                        unsigned NumClauses,
345
24
                                                        EmptyShell) {
346
24
  unsigned Size =
347
24
      llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *));
348
24
  void *Mem =
349
24
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
350
24
  return new (Mem) OMPCriticalDirective(NumClauses);
351
24
}
352
353
OMPParallelForDirective *OMPParallelForDirective::Create(
354
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
355
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
356
2.93k
    const HelperExprs &Exprs, bool HasCancel) {
357
2.93k
  unsigned Size =
358
2.93k
      llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *));
359
2.93k
  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
360
2.93k
                         sizeof(Stmt *) *
361
2.93k
                             numLoopChildren(CollapsedNum, OMPD_parallel_for));
362
2.93k
  OMPParallelForDirective *Dir = new (Mem)
363
2.93k
      OMPParallelForDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
364
2.93k
  Dir->setClauses(Clauses);
365
2.93k
  Dir->setAssociatedStmt(AssociatedStmt);
366
2.93k
  Dir->setIterationVariable(Exprs.IterationVarRef);
367
2.93k
  Dir->setLastIteration(Exprs.LastIteration);
368
2.93k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
369
2.93k
  Dir->setPreCond(Exprs.PreCond);
370
2.93k
  Dir->setCond(Exprs.Cond);
371
2.93k
  Dir->setInit(Exprs.Init);
372
2.93k
  Dir->setInc(Exprs.Inc);
373
2.93k
  Dir->setIsLastIterVariable(Exprs.IL);
374
2.93k
  Dir->setLowerBoundVariable(Exprs.LB);
375
2.93k
  Dir->setUpperBoundVariable(Exprs.UB);
376
2.93k
  Dir->setStrideVariable(Exprs.ST);
377
2.93k
  Dir->setEnsureUpperBound(Exprs.EUB);
378
2.93k
  Dir->setNextLowerBound(Exprs.NLB);
379
2.93k
  Dir->setNextUpperBound(Exprs.NUB);
380
2.93k
  Dir->setNumIterations(Exprs.NumIterations);
381
2.93k
  Dir->setCounters(Exprs.Counters);
382
2.93k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
383
2.93k
  Dir->setInits(Exprs.Inits);
384
2.93k
  Dir->setUpdates(Exprs.Updates);
385
2.93k
  Dir->setFinals(Exprs.Finals);
386
2.93k
  Dir->setPreInits(Exprs.PreInits);
387
2.93k
  Dir->setHasCancel(HasCancel);
388
2.93k
  return Dir;
389
2.93k
}
390
391
OMPParallelForDirective *
392
OMPParallelForDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
393
60
                                     unsigned CollapsedNum, EmptyShell) {
394
60
  unsigned Size =
395
60
      llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *));
396
60
  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
397
60
                         sizeof(Stmt *) *
398
60
                             numLoopChildren(CollapsedNum, OMPD_parallel_for));
399
60
  return new (Mem) OMPParallelForDirective(CollapsedNum, NumClauses);
400
60
}
401
402
OMPParallelForSimdDirective *OMPParallelForSimdDirective::Create(
403
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
404
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
405
3.38k
    const HelperExprs &Exprs) {
406
3.38k
  unsigned Size =
407
3.38k
      llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *));
408
3.38k
  void *Mem = C.Allocate(
409
3.38k
      Size + sizeof(OMPClause *) * Clauses.size() +
410
3.38k
      sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
411
3.38k
  OMPParallelForSimdDirective *Dir = new (Mem) OMPParallelForSimdDirective(
412
3.38k
      StartLoc, EndLoc, CollapsedNum, Clauses.size());
413
3.38k
  Dir->setClauses(Clauses);
414
3.38k
  Dir->setAssociatedStmt(AssociatedStmt);
415
3.38k
  Dir->setIterationVariable(Exprs.IterationVarRef);
416
3.38k
  Dir->setLastIteration(Exprs.LastIteration);
417
3.38k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
418
3.38k
  Dir->setPreCond(Exprs.PreCond);
419
3.38k
  Dir->setCond(Exprs.Cond);
420
3.38k
  Dir->setInit(Exprs.Init);
421
3.38k
  Dir->setInc(Exprs.Inc);
422
3.38k
  Dir->setIsLastIterVariable(Exprs.IL);
423
3.38k
  Dir->setLowerBoundVariable(Exprs.LB);
424
3.38k
  Dir->setUpperBoundVariable(Exprs.UB);
425
3.38k
  Dir->setStrideVariable(Exprs.ST);
426
3.38k
  Dir->setEnsureUpperBound(Exprs.EUB);
427
3.38k
  Dir->setNextLowerBound(Exprs.NLB);
428
3.38k
  Dir->setNextUpperBound(Exprs.NUB);
429
3.38k
  Dir->setNumIterations(Exprs.NumIterations);
430
3.38k
  Dir->setCounters(Exprs.Counters);
431
3.38k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
432
3.38k
  Dir->setInits(Exprs.Inits);
433
3.38k
  Dir->setUpdates(Exprs.Updates);
434
3.38k
  Dir->setFinals(Exprs.Finals);
435
3.38k
  Dir->setPreInits(Exprs.PreInits);
436
3.38k
  return Dir;
437
3.38k
}
438
439
OMPParallelForSimdDirective *
440
OMPParallelForSimdDirective::CreateEmpty(const ASTContext &C,
441
                                         unsigned NumClauses,
442
52
                                         unsigned CollapsedNum, EmptyShell) {
443
52
  unsigned Size =
444
52
      llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *));
445
52
  void *Mem = C.Allocate(
446
52
      Size + sizeof(OMPClause *) * NumClauses +
447
52
      sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
448
52
  return new (Mem) OMPParallelForSimdDirective(CollapsedNum, NumClauses);
449
52
}
450
451
OMPParallelSectionsDirective *OMPParallelSectionsDirective::Create(
452
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
453
1.76k
    ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
454
1.76k
  unsigned Size =
455
1.76k
      llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *));
456
1.76k
  void *Mem =
457
1.76k
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
458
1.76k
  OMPParallelSectionsDirective *Dir =
459
1.76k
      new (Mem) OMPParallelSectionsDirective(StartLoc, EndLoc, Clauses.size());
460
1.76k
  Dir->setClauses(Clauses);
461
1.76k
  Dir->setAssociatedStmt(AssociatedStmt);
462
1.76k
  Dir->setHasCancel(HasCancel);
463
1.76k
  return Dir;
464
1.76k
}
465
466
OMPParallelSectionsDirective *
467
OMPParallelSectionsDirective::CreateEmpty(const ASTContext &C,
468
22
                                          unsigned NumClauses, EmptyShell) {
469
22
  unsigned Size =
470
22
      llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *));
471
22
  void *Mem =
472
22
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
473
22
  return new (Mem) OMPParallelSectionsDirective(NumClauses);
474
22
}
475
476
OMPTaskDirective *
477
OMPTaskDirective::Create(const ASTContext &C, SourceLocation StartLoc,
478
                         SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
479
1.84k
                         Stmt *AssociatedStmt, bool HasCancel) {
480
1.84k
  unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *));
481
1.84k
  void *Mem =
482
1.84k
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
483
1.84k
  OMPTaskDirective *Dir =
484
1.84k
      new (Mem) OMPTaskDirective(StartLoc, EndLoc, Clauses.size());
485
1.84k
  Dir->setClauses(Clauses);
486
1.84k
  Dir->setAssociatedStmt(AssociatedStmt);
487
1.84k
  Dir->setHasCancel(HasCancel);
488
1.84k
  return Dir;
489
1.84k
}
490
491
OMPTaskDirective *OMPTaskDirective::CreateEmpty(const ASTContext &C,
492
                                                unsigned NumClauses,
493
100
                                                EmptyShell) {
494
100
  unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *));
495
100
  void *Mem =
496
100
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
497
100
  return new (Mem) OMPTaskDirective(NumClauses);
498
100
}
499
500
OMPTaskyieldDirective *OMPTaskyieldDirective::Create(const ASTContext &C,
501
                                                     SourceLocation StartLoc,
502
290
                                                     SourceLocation EndLoc) {
503
290
  void *Mem = C.Allocate(sizeof(OMPTaskyieldDirective));
504
290
  OMPTaskyieldDirective *Dir =
505
290
      new (Mem) OMPTaskyieldDirective(StartLoc, EndLoc);
506
290
  return Dir;
507
290
}
508
509
OMPTaskyieldDirective *OMPTaskyieldDirective::CreateEmpty(const ASTContext &C,
510
10
                                                          EmptyShell) {
511
10
  void *Mem = C.Allocate(sizeof(OMPTaskyieldDirective));
512
10
  return new (Mem) OMPTaskyieldDirective();
513
10
}
514
515
OMPBarrierDirective *OMPBarrierDirective::Create(const ASTContext &C,
516
                                                 SourceLocation StartLoc,
517
254
                                                 SourceLocation EndLoc) {
518
254
  void *Mem = C.Allocate(sizeof(OMPBarrierDirective));
519
254
  OMPBarrierDirective *Dir = new (Mem) OMPBarrierDirective(StartLoc, EndLoc);
520
254
  return Dir;
521
254
}
522
523
OMPBarrierDirective *OMPBarrierDirective::CreateEmpty(const ASTContext &C,
524
22
                                                      EmptyShell) {
525
22
  void *Mem = C.Allocate(sizeof(OMPBarrierDirective));
526
22
  return new (Mem) OMPBarrierDirective();
527
22
}
528
529
OMPTaskwaitDirective *OMPTaskwaitDirective::Create(const ASTContext &C,
530
                                                   SourceLocation StartLoc,
531
276
                                                   SourceLocation EndLoc) {
532
276
  void *Mem = C.Allocate(sizeof(OMPTaskwaitDirective));
533
276
  OMPTaskwaitDirective *Dir = new (Mem) OMPTaskwaitDirective(StartLoc, EndLoc);
534
276
  return Dir;
535
276
}
536
537
OMPTaskwaitDirective *OMPTaskwaitDirective::CreateEmpty(const ASTContext &C,
538
10
                                                        EmptyShell) {
539
10
  void *Mem = C.Allocate(sizeof(OMPTaskwaitDirective));
540
10
  return new (Mem) OMPTaskwaitDirective();
541
10
}
542
543
OMPTaskgroupDirective *OMPTaskgroupDirective::Create(
544
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
545
1.77k
    ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) {
546
1.77k
  unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective) +
547
1.77k
                                    sizeof(OMPClause *) * Clauses.size(),
548
1.77k
                                alignof(Stmt *));
549
1.77k
  void *Mem = C.Allocate(Size + sizeof(Stmt *) + sizeof(Expr *));
550
1.77k
  OMPTaskgroupDirective *Dir =
551
1.77k
      new (Mem) OMPTaskgroupDirective(StartLoc, EndLoc, Clauses.size());
552
1.77k
  Dir->setAssociatedStmt(AssociatedStmt);
553
1.77k
  Dir->setReductionRef(ReductionRef);
554
1.77k
  Dir->setClauses(Clauses);
555
1.77k
  return Dir;
556
1.77k
}
557
558
OMPTaskgroupDirective *OMPTaskgroupDirective::CreateEmpty(const ASTContext &C,
559
                                                          unsigned NumClauses,
560
52
                                                          EmptyShell) {
561
52
  unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective) +
562
52
                                    sizeof(OMPClause *) * NumClauses,
563
52
                                alignof(Stmt *));
564
52
  void *Mem = C.Allocate(Size + sizeof(Stmt *) + sizeof(Expr *));
565
52
  return new (Mem) OMPTaskgroupDirective(NumClauses);
566
52
}
567
568
OMPCancellationPointDirective *OMPCancellationPointDirective::Create(
569
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
570
83
    OpenMPDirectiveKind CancelRegion) {
571
83
  unsigned Size =
572
83
      llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *));
573
83
  void *Mem = C.Allocate(Size);
574
83
  OMPCancellationPointDirective *Dir =
575
83
      new (Mem) OMPCancellationPointDirective(StartLoc, EndLoc);
576
83
  Dir->setCancelRegion(CancelRegion);
577
83
  return Dir;
578
83
}
579
580
OMPCancellationPointDirective *
581
38
OMPCancellationPointDirective::CreateEmpty(const ASTContext &C, EmptyShell) {
582
38
  unsigned Size =
583
38
      llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *));
584
38
  void *Mem = C.Allocate(Size);
585
38
  return new (Mem) OMPCancellationPointDirective();
586
38
}
587
588
OMPCancelDirective *
589
OMPCancelDirective::Create(const ASTContext &C, SourceLocation StartLoc,
590
                           SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
591
282
                           OpenMPDirectiveKind CancelRegion) {
592
282
  unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
593
282
                                    sizeof(OMPClause *) * Clauses.size(),
594
282
                                alignof(Stmt *));
595
282
  void *Mem = C.Allocate(Size);
596
282
  OMPCancelDirective *Dir =
597
282
      new (Mem) OMPCancelDirective(StartLoc, EndLoc, Clauses.size());
598
282
  Dir->setClauses(Clauses);
599
282
  Dir->setCancelRegion(CancelRegion);
600
282
  return Dir;
601
282
}
602
603
OMPCancelDirective *OMPCancelDirective::CreateEmpty(const ASTContext &C,
604
                                                    unsigned NumClauses,
605
70
                                                    EmptyShell) {
606
70
  unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
607
70
                                    sizeof(OMPClause *) * NumClauses,
608
70
                                alignof(Stmt *));
609
70
  void *Mem = C.Allocate(Size);
610
70
  return new (Mem) OMPCancelDirective(NumClauses);
611
70
}
612
613
OMPFlushDirective *OMPFlushDirective::Create(const ASTContext &C,
614
                                             SourceLocation StartLoc,
615
                                             SourceLocation EndLoc,
616
344
                                             ArrayRef<OMPClause *> Clauses) {
617
344
  unsigned Size =
618
344
      llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *));
619
344
  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size());
620
344
  OMPFlushDirective *Dir =
621
344
      new (Mem) OMPFlushDirective(StartLoc, EndLoc, Clauses.size());
622
344
  Dir->setClauses(Clauses);
623
344
  return Dir;
624
344
}
625
626
OMPFlushDirective *OMPFlushDirective::CreateEmpty(const ASTContext &C,
627
                                                  unsigned NumClauses,
628
16
                                                  EmptyShell) {
629
16
  unsigned Size =
630
16
      llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *));
631
16
  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses);
632
16
  return new (Mem) OMPFlushDirective(NumClauses);
633
16
}
634
635
OMPOrderedDirective *OMPOrderedDirective::Create(const ASTContext &C,
636
                                                 SourceLocation StartLoc,
637
                                                 SourceLocation EndLoc,
638
                                                 ArrayRef<OMPClause *> Clauses,
639
666
                                                 Stmt *AssociatedStmt) {
640
666
  unsigned Size =
641
666
      llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *));
642
666
  void *Mem =
643
666
      C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * Clauses.size());
644
666
  OMPOrderedDirective *Dir =
645
666
      new (Mem) OMPOrderedDirective(StartLoc, EndLoc, Clauses.size());
646
666
  Dir->setClauses(Clauses);
647
666
  Dir->setAssociatedStmt(AssociatedStmt);
648
666
  return Dir;
649
666
}
650
651
OMPOrderedDirective *OMPOrderedDirective::CreateEmpty(const ASTContext &C,
652
                                                      unsigned NumClauses,
653
52
                                                      EmptyShell) {
654
52
  unsigned Size =
655
52
      llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *));
656
52
  void *Mem =
657
52
      C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * NumClauses);
658
52
  return new (Mem) OMPOrderedDirective(NumClauses);
659
52
}
660
661
OMPAtomicDirective *OMPAtomicDirective::Create(
662
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
663
    ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V,
664
1.81k
    Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate) {
665
1.81k
  unsigned Size =
666
1.81k
      llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *));
667
1.81k
  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
668
1.81k
                         5 * sizeof(Stmt *));
669
1.81k
  OMPAtomicDirective *Dir =
670
1.81k
      new (Mem) OMPAtomicDirective(StartLoc, EndLoc, Clauses.size());
671
1.81k
  Dir->setClauses(Clauses);
672
1.81k
  Dir->setAssociatedStmt(AssociatedStmt);
673
1.81k
  Dir->setX(X);
674
1.81k
  Dir->setV(V);
675
1.81k
  Dir->setExpr(E);
676
1.81k
  Dir->setUpdateExpr(UE);
677
1.81k
  Dir->IsXLHSInRHSPart = IsXLHSInRHSPart;
678
1.81k
  Dir->IsPostfixUpdate = IsPostfixUpdate;
679
1.81k
  return Dir;
680
1.81k
}
681
682
OMPAtomicDirective *OMPAtomicDirective::CreateEmpty(const ASTContext &C,
683
                                                    unsigned NumClauses,
684
430
                                                    EmptyShell) {
685
430
  unsigned Size =
686
430
      llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *));
687
430
  void *Mem =
688
430
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 5 * sizeof(Stmt *));
689
430
  return new (Mem) OMPAtomicDirective(NumClauses);
690
430
}
691
692
OMPTargetDirective *OMPTargetDirective::Create(const ASTContext &C,
693
                                               SourceLocation StartLoc,
694
                                               SourceLocation EndLoc,
695
                                               ArrayRef<OMPClause *> Clauses,
696
27.8k
                                               Stmt *AssociatedStmt) {
697
27.8k
  unsigned Size =
698
27.8k
      llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *));
699
27.8k
  void *Mem =
700
27.8k
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
701
27.8k
  OMPTargetDirective *Dir =
702
27.8k
      new (Mem) OMPTargetDirective(StartLoc, EndLoc, Clauses.size());
703
27.8k
  Dir->setClauses(Clauses);
704
27.8k
  Dir->setAssociatedStmt(AssociatedStmt);
705
27.8k
  return Dir;
706
27.8k
}
707
708
OMPTargetDirective *OMPTargetDirective::CreateEmpty(const ASTContext &C,
709
                                                    unsigned NumClauses,
710
2.51k
                                                    EmptyShell) {
711
2.51k
  unsigned Size =
712
2.51k
      llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *));
713
2.51k
  void *Mem =
714
2.51k
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
715
2.51k
  return new (Mem) OMPTargetDirective(NumClauses);
716
2.51k
}
717
718
OMPTargetParallelDirective *OMPTargetParallelDirective::Create(
719
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
720
3.79k
    ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
721
3.79k
  unsigned Size =
722
3.79k
      llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *));
723
3.79k
  void *Mem =
724
3.79k
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
725
3.79k
  OMPTargetParallelDirective *Dir =
726
3.79k
      new (Mem) OMPTargetParallelDirective(StartLoc, EndLoc, Clauses.size());
727
3.79k
  Dir->setClauses(Clauses);
728
3.79k
  Dir->setAssociatedStmt(AssociatedStmt);
729
3.79k
  return Dir;
730
3.79k
}
731
732
OMPTargetParallelDirective *
733
OMPTargetParallelDirective::CreateEmpty(const ASTContext &C,
734
380
                                        unsigned NumClauses, EmptyShell) {
735
380
  unsigned Size =
736
380
      llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *));
737
380
  void *Mem =
738
380
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
739
380
  return new (Mem) OMPTargetParallelDirective(NumClauses);
740
380
}
741
742
OMPTargetParallelForDirective *OMPTargetParallelForDirective::Create(
743
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
744
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
745
4.18k
    const HelperExprs &Exprs, bool HasCancel) {
746
4.18k
  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
747
4.18k
                                alignof(OMPClause *));
748
4.18k
  void *Mem = C.Allocate(
749
4.18k
      Size + sizeof(OMPClause *) * Clauses.size() +
750
4.18k
      sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
751
4.18k
  OMPTargetParallelForDirective *Dir = new (Mem) OMPTargetParallelForDirective(
752
4.18k
      StartLoc, EndLoc, CollapsedNum, Clauses.size());
753
4.18k
  Dir->setClauses(Clauses);
754
4.18k
  Dir->setAssociatedStmt(AssociatedStmt);
755
4.18k
  Dir->setIterationVariable(Exprs.IterationVarRef);
756
4.18k
  Dir->setLastIteration(Exprs.LastIteration);
757
4.18k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
758
4.18k
  Dir->setPreCond(Exprs.PreCond);
759
4.18k
  Dir->setCond(Exprs.Cond);
760
4.18k
  Dir->setInit(Exprs.Init);
761
4.18k
  Dir->setInc(Exprs.Inc);
762
4.18k
  Dir->setIsLastIterVariable(Exprs.IL);
763
4.18k
  Dir->setLowerBoundVariable(Exprs.LB);
764
4.18k
  Dir->setUpperBoundVariable(Exprs.UB);
765
4.18k
  Dir->setStrideVariable(Exprs.ST);
766
4.18k
  Dir->setEnsureUpperBound(Exprs.EUB);
767
4.18k
  Dir->setNextLowerBound(Exprs.NLB);
768
4.18k
  Dir->setNextUpperBound(Exprs.NUB);
769
4.18k
  Dir->setNumIterations(Exprs.NumIterations);
770
4.18k
  Dir->setCounters(Exprs.Counters);
771
4.18k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
772
4.18k
  Dir->setInits(Exprs.Inits);
773
4.18k
  Dir->setUpdates(Exprs.Updates);
774
4.18k
  Dir->setFinals(Exprs.Finals);
775
4.18k
  Dir->setPreInits(Exprs.PreInits);
776
4.18k
  Dir->setHasCancel(HasCancel);
777
4.18k
  return Dir;
778
4.18k
}
779
780
OMPTargetParallelForDirective *
781
OMPTargetParallelForDirective::CreateEmpty(const ASTContext &C,
782
                                           unsigned NumClauses,
783
290
                                           unsigned CollapsedNum, EmptyShell) {
784
290
  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
785
290
                                alignof(OMPClause *));
786
290
  void *Mem = C.Allocate(
787
290
      Size + sizeof(OMPClause *) * NumClauses +
788
290
      sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
789
290
  return new (Mem) OMPTargetParallelForDirective(CollapsedNum, NumClauses);
790
290
}
791
792
OMPTargetDataDirective *OMPTargetDataDirective::Create(
793
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
794
1.27k
    ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
795
1.27k
  void *Mem = C.Allocate(
796
1.27k
      llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) +
797
1.27k
      sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
798
1.27k
  OMPTargetDataDirective *Dir =
799
1.27k
      new (Mem) OMPTargetDataDirective(StartLoc, EndLoc, Clauses.size());
800
1.27k
  Dir->setClauses(Clauses);
801
1.27k
  Dir->setAssociatedStmt(AssociatedStmt);
802
1.27k
  return Dir;
803
1.27k
}
804
805
OMPTargetDataDirective *OMPTargetDataDirective::CreateEmpty(const ASTContext &C,
806
                                                            unsigned N,
807
148
                                                            EmptyShell) {
808
148
  void *Mem = C.Allocate(
809
148
      llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) +
810
148
      sizeof(OMPClause *) * N + sizeof(Stmt *));
811
148
  return new (Mem) OMPTargetDataDirective(N);
812
148
}
813
814
OMPTargetEnterDataDirective *OMPTargetEnterDataDirective::Create(
815
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
816
860
    ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
817
860
  void *Mem = C.Allocate(
818
860
      llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) +
819
860
      sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
820
860
  OMPTargetEnterDataDirective *Dir =
821
860
      new (Mem) OMPTargetEnterDataDirective(StartLoc, EndLoc, Clauses.size());
822
860
  Dir->setClauses(Clauses);
823
860
  Dir->setAssociatedStmt(AssociatedStmt);
824
860
  return Dir;
825
860
}
826
827
OMPTargetEnterDataDirective *
828
OMPTargetEnterDataDirective::CreateEmpty(const ASTContext &C, unsigned N,
829
152
                                         EmptyShell) {
830
152
  void *Mem = C.Allocate(
831
152
      llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) +
832
152
      sizeof(OMPClause *) * N + sizeof(Stmt *));
833
152
  return new (Mem) OMPTargetEnterDataDirective(N);
834
152
}
835
836
OMPTargetExitDataDirective *OMPTargetExitDataDirective::Create(
837
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
838
872
    ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
839
872
  void *Mem = C.Allocate(
840
872
      llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) +
841
872
      sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
842
872
  OMPTargetExitDataDirective *Dir =
843
872
      new (Mem) OMPTargetExitDataDirective(StartLoc, EndLoc, Clauses.size());
844
872
  Dir->setClauses(Clauses);
845
872
  Dir->setAssociatedStmt(AssociatedStmt);
846
872
  return Dir;
847
872
}
848
849
OMPTargetExitDataDirective *
850
OMPTargetExitDataDirective::CreateEmpty(const ASTContext &C, unsigned N,
851
152
                                        EmptyShell) {
852
152
  void *Mem = C.Allocate(
853
152
      llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) +
854
152
      sizeof(OMPClause *) * N + sizeof(Stmt *));
855
152
  return new (Mem) OMPTargetExitDataDirective(N);
856
152
}
857
858
OMPTeamsDirective *OMPTeamsDirective::Create(const ASTContext &C,
859
                                             SourceLocation StartLoc,
860
                                             SourceLocation EndLoc,
861
                                             ArrayRef<OMPClause *> Clauses,
862
11.3k
                                             Stmt *AssociatedStmt) {
863
11.3k
  unsigned Size =
864
11.3k
      llvm::alignTo(sizeof(OMPTeamsDirective), alignof(OMPClause *));
865
11.3k
  void *Mem =
866
11.3k
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
867
11.3k
  OMPTeamsDirective *Dir =
868
11.3k
      new (Mem) OMPTeamsDirective(StartLoc, EndLoc, Clauses.size());
869
11.3k
  Dir->setClauses(Clauses);
870
11.3k
  Dir->setAssociatedStmt(AssociatedStmt);
871
11.3k
  return Dir;
872
11.3k
}
873
874
OMPTeamsDirective *OMPTeamsDirective::CreateEmpty(const ASTContext &C,
875
                                                  unsigned NumClauses,
876
674
                                                  EmptyShell) {
877
674
  unsigned Size =
878
674
      llvm::alignTo(sizeof(OMPTeamsDirective), alignof(OMPClause *));
879
674
  void *Mem =
880
674
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
881
674
  return new (Mem) OMPTeamsDirective(NumClauses);
882
674
}
883
884
OMPTaskLoopDirective *OMPTaskLoopDirective::Create(
885
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
886
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
887
2.81k
    const HelperExprs &Exprs) {
888
2.81k
  unsigned Size =
889
2.81k
      llvm::alignTo(sizeof(OMPTaskLoopDirective), alignof(OMPClause *));
890
2.81k
  void *Mem =
891
2.81k
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
892
2.81k
                 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
893
2.81k
  OMPTaskLoopDirective *Dir = new (Mem)
894
2.81k
      OMPTaskLoopDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
895
2.81k
  Dir->setClauses(Clauses);
896
2.81k
  Dir->setAssociatedStmt(AssociatedStmt);
897
2.81k
  Dir->setIterationVariable(Exprs.IterationVarRef);
898
2.81k
  Dir->setLastIteration(Exprs.LastIteration);
899
2.81k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
900
2.81k
  Dir->setPreCond(Exprs.PreCond);
901
2.81k
  Dir->setCond(Exprs.Cond);
902
2.81k
  Dir->setInit(Exprs.Init);
903
2.81k
  Dir->setInc(Exprs.Inc);
904
2.81k
  Dir->setIsLastIterVariable(Exprs.IL);
905
2.81k
  Dir->setLowerBoundVariable(Exprs.LB);
906
2.81k
  Dir->setUpperBoundVariable(Exprs.UB);
907
2.81k
  Dir->setStrideVariable(Exprs.ST);
908
2.81k
  Dir->setEnsureUpperBound(Exprs.EUB);
909
2.81k
  Dir->setNextLowerBound(Exprs.NLB);
910
2.81k
  Dir->setNextUpperBound(Exprs.NUB);
911
2.81k
  Dir->setNumIterations(Exprs.NumIterations);
912
2.81k
  Dir->setCounters(Exprs.Counters);
913
2.81k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
914
2.81k
  Dir->setInits(Exprs.Inits);
915
2.81k
  Dir->setUpdates(Exprs.Updates);
916
2.81k
  Dir->setFinals(Exprs.Finals);
917
2.81k
  Dir->setPreInits(Exprs.PreInits);
918
2.81k
  return Dir;
919
2.81k
}
920
921
OMPTaskLoopDirective *OMPTaskLoopDirective::CreateEmpty(const ASTContext &C,
922
                                                        unsigned NumClauses,
923
                                                        unsigned CollapsedNum,
924
30
                                                        EmptyShell) {
925
30
  unsigned Size =
926
30
      llvm::alignTo(sizeof(OMPTaskLoopDirective), alignof(OMPClause *));
927
30
  void *Mem =
928
30
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
929
30
                 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
930
30
  return new (Mem) OMPTaskLoopDirective(CollapsedNum, NumClauses);
931
30
}
932
933
OMPTaskLoopSimdDirective *OMPTaskLoopSimdDirective::Create(
934
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
935
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
936
3.17k
    const HelperExprs &Exprs) {
937
3.17k
  unsigned Size =
938
3.17k
      llvm::alignTo(sizeof(OMPTaskLoopSimdDirective), alignof(OMPClause *));
939
3.17k
  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
940
3.17k
                         sizeof(Stmt *) *
941
3.17k
                             numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
942
3.17k
  OMPTaskLoopSimdDirective *Dir = new (Mem)
943
3.17k
      OMPTaskLoopSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
944
3.17k
  Dir->setClauses(Clauses);
945
3.17k
  Dir->setAssociatedStmt(AssociatedStmt);
946
3.17k
  Dir->setIterationVariable(Exprs.IterationVarRef);
947
3.17k
  Dir->setLastIteration(Exprs.LastIteration);
948
3.17k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
949
3.17k
  Dir->setPreCond(Exprs.PreCond);
950
3.17k
  Dir->setCond(Exprs.Cond);
951
3.17k
  Dir->setInit(Exprs.Init);
952
3.17k
  Dir->setInc(Exprs.Inc);
953
3.17k
  Dir->setIsLastIterVariable(Exprs.IL);
954
3.17k
  Dir->setLowerBoundVariable(Exprs.LB);
955
3.17k
  Dir->setUpperBoundVariable(Exprs.UB);
956
3.17k
  Dir->setStrideVariable(Exprs.ST);
957
3.17k
  Dir->setEnsureUpperBound(Exprs.EUB);
958
3.17k
  Dir->setNextLowerBound(Exprs.NLB);
959
3.17k
  Dir->setNextUpperBound(Exprs.NUB);
960
3.17k
  Dir->setNumIterations(Exprs.NumIterations);
961
3.17k
  Dir->setCounters(Exprs.Counters);
962
3.17k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
963
3.17k
  Dir->setInits(Exprs.Inits);
964
3.17k
  Dir->setUpdates(Exprs.Updates);
965
3.17k
  Dir->setFinals(Exprs.Finals);
966
3.17k
  Dir->setPreInits(Exprs.PreInits);
967
3.17k
  return Dir;
968
3.17k
}
969
970
OMPTaskLoopSimdDirective *
971
OMPTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
972
30
                                      unsigned CollapsedNum, EmptyShell) {
973
30
  unsigned Size =
974
30
      llvm::alignTo(sizeof(OMPTaskLoopSimdDirective), alignof(OMPClause *));
975
30
  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
976
30
                         sizeof(Stmt *) *
977
30
                             numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
978
30
  return new (Mem) OMPTaskLoopSimdDirective(CollapsedNum, NumClauses);
979
30
}
980
981
OMPDistributeDirective *OMPDistributeDirective::Create(
982
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
983
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
984
1.11k
    const HelperExprs &Exprs) {
985
1.11k
  unsigned Size =
986
1.11k
      llvm::alignTo(sizeof(OMPDistributeDirective), alignof(OMPClause *));
987
1.11k
  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
988
1.11k
                         sizeof(Stmt *) *
989
1.11k
                             numLoopChildren(CollapsedNum, OMPD_distribute));
990
1.11k
  OMPDistributeDirective *Dir = new (Mem)
991
1.11k
      OMPDistributeDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
992
1.11k
  Dir->setClauses(Clauses);
993
1.11k
  Dir->setAssociatedStmt(AssociatedStmt);
994
1.11k
  Dir->setIterationVariable(Exprs.IterationVarRef);
995
1.11k
  Dir->setLastIteration(Exprs.LastIteration);
996
1.11k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
997
1.11k
  Dir->setPreCond(Exprs.PreCond);
998
1.11k
  Dir->setCond(Exprs.Cond);
999
1.11k
  Dir->setInit(Exprs.Init);
1000
1.11k
  Dir->setInc(Exprs.Inc);
1001
1.11k
  Dir->setIsLastIterVariable(Exprs.IL);
1002
1.11k
  Dir->setLowerBoundVariable(Exprs.LB);
1003
1.11k
  Dir->setUpperBoundVariable(Exprs.UB);
1004
1.11k
  Dir->setStrideVariable(Exprs.ST);
1005
1.11k
  Dir->setEnsureUpperBound(Exprs.EUB);
1006
1.11k
  Dir->setNextLowerBound(Exprs.NLB);
1007
1.11k
  Dir->setNextUpperBound(Exprs.NUB);
1008
1.11k
  Dir->setNumIterations(Exprs.NumIterations);
1009
1.11k
  Dir->setCounters(Exprs.Counters);
1010
1.11k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
1011
1.11k
  Dir->setInits(Exprs.Inits);
1012
1.11k
  Dir->setUpdates(Exprs.Updates);
1013
1.11k
  Dir->setFinals(Exprs.Finals);
1014
1.11k
  Dir->setPreInits(Exprs.PreInits);
1015
1.11k
  return Dir;
1016
1.11k
}
1017
1018
OMPDistributeDirective *
1019
OMPDistributeDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
1020
120
                                    unsigned CollapsedNum, EmptyShell) {
1021
120
  unsigned Size =
1022
120
      llvm::alignTo(sizeof(OMPDistributeDirective), alignof(OMPClause *));
1023
120
  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1024
120
                         sizeof(Stmt *) *
1025
120
                             numLoopChildren(CollapsedNum, OMPD_distribute));
1026
120
  return new (Mem) OMPDistributeDirective(CollapsedNum, NumClauses);
1027
120
}
1028
1029
OMPTargetUpdateDirective *OMPTargetUpdateDirective::Create(
1030
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1031
1.07k
    ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1032
1.07k
  unsigned Size =
1033
1.07k
      llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *));
1034
1.07k
  void *Mem =
1035
1.07k
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
1036
1.07k
  OMPTargetUpdateDirective *Dir =
1037
1.07k
      new (Mem) OMPTargetUpdateDirective(StartLoc, EndLoc, Clauses.size());
1038
1.07k
  Dir->setClauses(Clauses);
1039
1.07k
  Dir->setAssociatedStmt(AssociatedStmt);
1040
1.07k
  return Dir;
1041
1.07k
}
1042
1043
OMPTargetUpdateDirective *
1044
OMPTargetUpdateDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
1045
90
                                      EmptyShell) {
1046
90
  unsigned Size =
1047
90
      llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *));
1048
90
  void *Mem =
1049
90
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
1050
90
  return new (Mem) OMPTargetUpdateDirective(NumClauses);
1051
90
}
1052
1053
OMPDistributeParallelForDirective *OMPDistributeParallelForDirective::Create(
1054
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1055
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1056
2.93k
    const HelperExprs &Exprs, bool HasCancel) {
1057
2.93k
  unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
1058
2.93k
                                alignof(OMPClause *));
1059
2.93k
  void *Mem = C.Allocate(
1060
2.93k
      Size + sizeof(OMPClause *) * Clauses.size() +
1061
2.93k
      sizeof(Stmt *) *
1062
2.93k
          numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for));
1063
2.93k
  OMPDistributeParallelForDirective *Dir =
1064
2.93k
      new (Mem) OMPDistributeParallelForDirective(StartLoc, EndLoc,
1065
2.93k
                                                  CollapsedNum, Clauses.size());
1066
2.93k
  Dir->setClauses(Clauses);
1067
2.93k
  Dir->setAssociatedStmt(AssociatedStmt);
1068
2.93k
  Dir->setIterationVariable(Exprs.IterationVarRef);
1069
2.93k
  Dir->setLastIteration(Exprs.LastIteration);
1070
2.93k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1071
2.93k
  Dir->setPreCond(Exprs.PreCond);
1072
2.93k
  Dir->setCond(Exprs.Cond);
1073
2.93k
  Dir->setInit(Exprs.Init);
1074
2.93k
  Dir->setInc(Exprs.Inc);
1075
2.93k
  Dir->setIsLastIterVariable(Exprs.IL);
1076
2.93k
  Dir->setLowerBoundVariable(Exprs.LB);
1077
2.93k
  Dir->setUpperBoundVariable(Exprs.UB);
1078
2.93k
  Dir->setStrideVariable(Exprs.ST);
1079
2.93k
  Dir->setEnsureUpperBound(Exprs.EUB);
1080
2.93k
  Dir->setNextLowerBound(Exprs.NLB);
1081
2.93k
  Dir->setNextUpperBound(Exprs.NUB);
1082
2.93k
  Dir->setNumIterations(Exprs.NumIterations);
1083
2.93k
  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1084
2.93k
  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1085
2.93k
  Dir->setDistInc(Exprs.DistInc);
1086
2.93k
  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1087
2.93k
  Dir->setCounters(Exprs.Counters);
1088
2.93k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
1089
2.93k
  Dir->setInits(Exprs.Inits);
1090
2.93k
  Dir->setUpdates(Exprs.Updates);
1091
2.93k
  Dir->setFinals(Exprs.Finals);
1092
2.93k
  Dir->setPreInits(Exprs.PreInits);
1093
2.93k
  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1094
2.93k
  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1095
2.93k
  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1096
2.93k
  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1097
2.93k
  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1098
2.93k
  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1099
2.93k
  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1100
2.93k
  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1101
2.93k
  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1102
2.93k
  Dir->HasCancel = HasCancel;
1103
2.93k
  return Dir;
1104
2.93k
}
1105
1106
OMPDistributeParallelForDirective *
1107
OMPDistributeParallelForDirective::CreateEmpty(const ASTContext &C,
1108
                                               unsigned NumClauses,
1109
                                               unsigned CollapsedNum,
1110
178
                                               EmptyShell) {
1111
178
  unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
1112
178
                                alignof(OMPClause *));
1113
178
  void *Mem = C.Allocate(
1114
178
      Size + sizeof(OMPClause *) * NumClauses +
1115
178
      sizeof(Stmt *) *
1116
178
          numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for));
1117
178
  return new (Mem) OMPDistributeParallelForDirective(CollapsedNum, NumClauses);
1118
178
}
1119
1120
OMPDistributeParallelForSimdDirective *
1121
OMPDistributeParallelForSimdDirective::Create(
1122
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1123
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1124
3.65k
    const HelperExprs &Exprs) {
1125
3.65k
  unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
1126
3.65k
                                alignof(OMPClause *));
1127
3.65k
  void *Mem = C.Allocate(
1128
3.65k
      Size + sizeof(OMPClause *) * Clauses.size() +
1129
3.65k
      sizeof(Stmt *) *
1130
3.65k
          numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd));
1131
3.65k
  OMPDistributeParallelForSimdDirective *Dir = new (Mem)
1132
3.65k
      OMPDistributeParallelForSimdDirective(StartLoc, EndLoc, CollapsedNum,
1133
3.65k
                                            Clauses.size());
1134
3.65k
  Dir->setClauses(Clauses);
1135
3.65k
  Dir->setAssociatedStmt(AssociatedStmt);
1136
3.65k
  Dir->setIterationVariable(Exprs.IterationVarRef);
1137
3.65k
  Dir->setLastIteration(Exprs.LastIteration);
1138
3.65k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1139
3.65k
  Dir->setPreCond(Exprs.PreCond);
1140
3.65k
  Dir->setCond(Exprs.Cond);
1141
3.65k
  Dir->setInit(Exprs.Init);
1142
3.65k
  Dir->setInc(Exprs.Inc);
1143
3.65k
  Dir->setIsLastIterVariable(Exprs.IL);
1144
3.65k
  Dir->setLowerBoundVariable(Exprs.LB);
1145
3.65k
  Dir->setUpperBoundVariable(Exprs.UB);
1146
3.65k
  Dir->setStrideVariable(Exprs.ST);
1147
3.65k
  Dir->setEnsureUpperBound(Exprs.EUB);
1148
3.65k
  Dir->setNextLowerBound(Exprs.NLB);
1149
3.65k
  Dir->setNextUpperBound(Exprs.NUB);
1150
3.65k
  Dir->setNumIterations(Exprs.NumIterations);
1151
3.65k
  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1152
3.65k
  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1153
3.65k
  Dir->setDistInc(Exprs.DistInc);
1154
3.65k
  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1155
3.65k
  Dir->setCounters(Exprs.Counters);
1156
3.65k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
1157
3.65k
  Dir->setInits(Exprs.Inits);
1158
3.65k
  Dir->setUpdates(Exprs.Updates);
1159
3.65k
  Dir->setFinals(Exprs.Finals);
1160
3.65k
  Dir->setPreInits(Exprs.PreInits);
1161
3.65k
  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1162
3.65k
  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1163
3.65k
  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1164
3.65k
  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1165
3.65k
  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1166
3.65k
  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1167
3.65k
  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1168
3.65k
  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1169
3.65k
  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1170
3.65k
  return Dir;
1171
3.65k
}
1172
1173
OMPDistributeParallelForSimdDirective *
1174
OMPDistributeParallelForSimdDirective::CreateEmpty(const ASTContext &C,
1175
                                                   unsigned NumClauses,
1176
                                                   unsigned CollapsedNum,
1177
168
                                                   EmptyShell) {
1178
168
  unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
1179
168
                                alignof(OMPClause *));
1180
168
  void *Mem = C.Allocate(
1181
168
      Size + sizeof(OMPClause *) * NumClauses +
1182
168
      sizeof(Stmt *) *
1183
168
          numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd));
1184
168
  return new (Mem)
1185
168
      OMPDistributeParallelForSimdDirective(CollapsedNum, NumClauses);
1186
168
}
1187
1188
OMPDistributeSimdDirective *OMPDistributeSimdDirective::Create(
1189
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1190
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1191
2.63k
    const HelperExprs &Exprs) {
1192
2.63k
  unsigned Size =
1193
2.63k
      llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *));
1194
2.63k
  void *Mem = C.Allocate(
1195
2.63k
      Size + sizeof(OMPClause *) * Clauses.size() +
1196
2.63k
      sizeof(Stmt *) *
1197
2.63k
          numLoopChildren(CollapsedNum, OMPD_distribute_simd));
1198
2.63k
  OMPDistributeSimdDirective *Dir = new (Mem) OMPDistributeSimdDirective(
1199
2.63k
      StartLoc, EndLoc, CollapsedNum, Clauses.size());
1200
2.63k
  Dir->setClauses(Clauses);
1201
2.63k
  Dir->setAssociatedStmt(AssociatedStmt);
1202
2.63k
  Dir->setIterationVariable(Exprs.IterationVarRef);
1203
2.63k
  Dir->setLastIteration(Exprs.LastIteration);
1204
2.63k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1205
2.63k
  Dir->setPreCond(Exprs.PreCond);
1206
2.63k
  Dir->setCond(Exprs.Cond);
1207
2.63k
  Dir->setInit(Exprs.Init);
1208
2.63k
  Dir->setInc(Exprs.Inc);
1209
2.63k
  Dir->setIsLastIterVariable(Exprs.IL);
1210
2.63k
  Dir->setLowerBoundVariable(Exprs.LB);
1211
2.63k
  Dir->setUpperBoundVariable(Exprs.UB);
1212
2.63k
  Dir->setStrideVariable(Exprs.ST);
1213
2.63k
  Dir->setEnsureUpperBound(Exprs.EUB);
1214
2.63k
  Dir->setNextLowerBound(Exprs.NLB);
1215
2.63k
  Dir->setNextUpperBound(Exprs.NUB);
1216
2.63k
  Dir->setNumIterations(Exprs.NumIterations);
1217
2.63k
  Dir->setCounters(Exprs.Counters);
1218
2.63k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
1219
2.63k
  Dir->setInits(Exprs.Inits);
1220
2.63k
  Dir->setUpdates(Exprs.Updates);
1221
2.63k
  Dir->setFinals(Exprs.Finals);
1222
2.63k
  Dir->setPreInits(Exprs.PreInits);
1223
2.63k
  return Dir;
1224
2.63k
}
1225
1226
OMPDistributeSimdDirective *
1227
OMPDistributeSimdDirective::CreateEmpty(const ASTContext &C,
1228
                                        unsigned NumClauses,
1229
108
                                        unsigned CollapsedNum, EmptyShell) {
1230
108
  unsigned Size =
1231
108
      llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *));
1232
108
  void *Mem = C.Allocate(
1233
108
      Size + sizeof(OMPClause *) * NumClauses +
1234
108
      sizeof(Stmt *) *
1235
108
          numLoopChildren(CollapsedNum, OMPD_distribute_simd));
1236
108
  return new (Mem) OMPDistributeSimdDirective(CollapsedNum, NumClauses);
1237
108
}
1238
1239
OMPTargetParallelForSimdDirective *OMPTargetParallelForSimdDirective::Create(
1240
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1241
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1242
4.41k
    const HelperExprs &Exprs) {
1243
4.41k
  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
1244
4.41k
                                alignof(OMPClause *));
1245
4.41k
  void *Mem = C.Allocate(
1246
4.41k
      Size + sizeof(OMPClause *) * Clauses.size() +
1247
4.41k
      sizeof(Stmt *) *
1248
4.41k
          numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd));
1249
4.41k
  OMPTargetParallelForSimdDirective *Dir =
1250
4.41k
      new (Mem) OMPTargetParallelForSimdDirective(StartLoc, EndLoc,
1251
4.41k
                                                  CollapsedNum, Clauses.size());
1252
4.41k
  Dir->setClauses(Clauses);
1253
4.41k
  Dir->setAssociatedStmt(AssociatedStmt);
1254
4.41k
  Dir->setIterationVariable(Exprs.IterationVarRef);
1255
4.41k
  Dir->setLastIteration(Exprs.LastIteration);
1256
4.41k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1257
4.41k
  Dir->setPreCond(Exprs.PreCond);
1258
4.41k
  Dir->setCond(Exprs.Cond);
1259
4.41k
  Dir->setInit(Exprs.Init);
1260
4.41k
  Dir->setInc(Exprs.Inc);
1261
4.41k
  Dir->setIsLastIterVariable(Exprs.IL);
1262
4.41k
  Dir->setLowerBoundVariable(Exprs.LB);
1263
4.41k
  Dir->setUpperBoundVariable(Exprs.UB);
1264
4.41k
  Dir->setStrideVariable(Exprs.ST);
1265
4.41k
  Dir->setEnsureUpperBound(Exprs.EUB);
1266
4.41k
  Dir->setNextLowerBound(Exprs.NLB);
1267
4.41k
  Dir->setNextUpperBound(Exprs.NUB);
1268
4.41k
  Dir->setNumIterations(Exprs.NumIterations);
1269
4.41k
  Dir->setCounters(Exprs.Counters);
1270
4.41k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
1271
4.41k
  Dir->setInits(Exprs.Inits);
1272
4.41k
  Dir->setUpdates(Exprs.Updates);
1273
4.41k
  Dir->setFinals(Exprs.Finals);
1274
4.41k
  Dir->setPreInits(Exprs.PreInits);
1275
4.41k
  return Dir;
1276
4.41k
}
1277
1278
OMPTargetParallelForSimdDirective *
1279
OMPTargetParallelForSimdDirective::CreateEmpty(const ASTContext &C,
1280
                                               unsigned NumClauses,
1281
                                               unsigned CollapsedNum,
1282
302
                                               EmptyShell) {
1283
302
  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
1284
302
                                alignof(OMPClause *));
1285
302
  void *Mem = C.Allocate(
1286
302
      Size + sizeof(OMPClause *) * NumClauses +
1287
302
      sizeof(Stmt *) *
1288
302
          numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd));
1289
302
  return new (Mem) OMPTargetParallelForSimdDirective(CollapsedNum, NumClauses);
1290
302
}
1291
1292
OMPTargetSimdDirective *
1293
OMPTargetSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc,
1294
                               SourceLocation EndLoc, unsigned CollapsedNum,
1295
                               ArrayRef<OMPClause *> Clauses,
1296
4.10k
                               Stmt *AssociatedStmt, const HelperExprs &Exprs) {
1297
4.10k
  unsigned Size =
1298
4.10k
      llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *));
1299
4.10k
  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1300
4.10k
                         sizeof(Stmt *) *
1301
4.10k
                             numLoopChildren(CollapsedNum, OMPD_target_simd));
1302
4.10k
  OMPTargetSimdDirective *Dir = new (Mem)
1303
4.10k
      OMPTargetSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
1304
4.10k
  Dir->setClauses(Clauses);
1305
4.10k
  Dir->setAssociatedStmt(AssociatedStmt);
1306
4.10k
  Dir->setIterationVariable(Exprs.IterationVarRef);
1307
4.10k
  Dir->setLastIteration(Exprs.LastIteration);
1308
4.10k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1309
4.10k
  Dir->setPreCond(Exprs.PreCond);
1310
4.10k
  Dir->setCond(Exprs.Cond);
1311
4.10k
  Dir->setInit(Exprs.Init);
1312
4.10k
  Dir->setInc(Exprs.Inc);
1313
4.10k
  Dir->setCounters(Exprs.Counters);
1314
4.10k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
1315
4.10k
  Dir->setInits(Exprs.Inits);
1316
4.10k
  Dir->setUpdates(Exprs.Updates);
1317
4.10k
  Dir->setFinals(Exprs.Finals);
1318
4.10k
  Dir->setPreInits(Exprs.PreInits);
1319
4.10k
  return Dir;
1320
4.10k
}
1321
1322
OMPTargetSimdDirective *
1323
OMPTargetSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
1324
260
                                    unsigned CollapsedNum, EmptyShell) {
1325
260
  unsigned Size =
1326
260
      llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *));
1327
260
  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1328
260
                         sizeof(Stmt *) *
1329
260
                             numLoopChildren(CollapsedNum, OMPD_target_simd));
1330
260
  return new (Mem) OMPTargetSimdDirective(CollapsedNum, NumClauses);
1331
260
}
1332
1333
OMPTeamsDistributeDirective *OMPTeamsDistributeDirective::Create(
1334
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1335
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1336
2.24k
    const HelperExprs &Exprs) {
1337
2.24k
  unsigned Size =
1338
2.24k
      llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *));
1339
2.24k
  void *Mem = C.Allocate(
1340
2.24k
      Size + sizeof(OMPClause *) * Clauses.size() +
1341
2.24k
      sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
1342
2.24k
  OMPTeamsDistributeDirective *Dir = new (Mem) OMPTeamsDistributeDirective(
1343
2.24k
      StartLoc, EndLoc, CollapsedNum, Clauses.size());
1344
2.24k
  Dir->setClauses(Clauses);
1345
2.24k
  Dir->setAssociatedStmt(AssociatedStmt);
1346
2.24k
  Dir->setIterationVariable(Exprs.IterationVarRef);
1347
2.24k
  Dir->setLastIteration(Exprs.LastIteration);
1348
2.24k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1349
2.24k
  Dir->setPreCond(Exprs.PreCond);
1350
2.24k
  Dir->setCond(Exprs.Cond);
1351
2.24k
  Dir->setInit(Exprs.Init);
1352
2.24k
  Dir->setInc(Exprs.Inc);
1353
2.24k
  Dir->setIsLastIterVariable(Exprs.IL);
1354
2.24k
  Dir->setLowerBoundVariable(Exprs.LB);
1355
2.24k
  Dir->setUpperBoundVariable(Exprs.UB);
1356
2.24k
  Dir->setStrideVariable(Exprs.ST);
1357
2.24k
  Dir->setEnsureUpperBound(Exprs.EUB);
1358
2.24k
  Dir->setNextLowerBound(Exprs.NLB);
1359
2.24k
  Dir->setNextUpperBound(Exprs.NUB);
1360
2.24k
  Dir->setNumIterations(Exprs.NumIterations);
1361
2.24k
  Dir->setCounters(Exprs.Counters);
1362
2.24k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
1363
2.24k
  Dir->setInits(Exprs.Inits);
1364
2.24k
  Dir->setUpdates(Exprs.Updates);
1365
2.24k
  Dir->setFinals(Exprs.Finals);
1366
2.24k
  Dir->setPreInits(Exprs.PreInits);
1367
2.24k
  return Dir;
1368
2.24k
}
1369
1370
OMPTeamsDistributeDirective *
1371
OMPTeamsDistributeDirective::CreateEmpty(const ASTContext &C,
1372
                                         unsigned NumClauses,
1373
142
                                         unsigned CollapsedNum, EmptyShell) {
1374
142
  unsigned Size =
1375
142
      llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *));
1376
142
  void *Mem = C.Allocate(
1377
142
      Size + sizeof(OMPClause *) * NumClauses +
1378
142
      sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
1379
142
  return new (Mem) OMPTeamsDistributeDirective(CollapsedNum, NumClauses);
1380
142
}
1381
1382
OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::Create(
1383
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1384
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1385
2.73k
    const HelperExprs &Exprs) {
1386
2.73k
  unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeSimdDirective),
1387
2.73k
                                alignof(OMPClause *));
1388
2.73k
  void *Mem =
1389
2.73k
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1390
2.73k
                 sizeof(Stmt *) *
1391
2.73k
                     numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd));
1392
2.73k
  OMPTeamsDistributeSimdDirective *Dir =
1393
2.73k
      new (Mem) OMPTeamsDistributeSimdDirective(StartLoc, EndLoc, CollapsedNum,
1394
2.73k
                                                Clauses.size());
1395
2.73k
  Dir->setClauses(Clauses);
1396
2.73k
  Dir->setAssociatedStmt(AssociatedStmt);
1397
2.73k
  Dir->setIterationVariable(Exprs.IterationVarRef);
1398
2.73k
  Dir->setLastIteration(Exprs.LastIteration);
1399
2.73k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1400
2.73k
  Dir->setPreCond(Exprs.PreCond);
1401
2.73k
  Dir->setCond(Exprs.Cond);
1402
2.73k
  Dir->setInit(Exprs.Init);
1403
2.73k
  Dir->setInc(Exprs.Inc);
1404
2.73k
  Dir->setIsLastIterVariable(Exprs.IL);
1405
2.73k
  Dir->setLowerBoundVariable(Exprs.LB);
1406
2.73k
  Dir->setUpperBoundVariable(Exprs.UB);
1407
2.73k
  Dir->setStrideVariable(Exprs.ST);
1408
2.73k
  Dir->setEnsureUpperBound(Exprs.EUB);
1409
2.73k
  Dir->setNextLowerBound(Exprs.NLB);
1410
2.73k
  Dir->setNextUpperBound(Exprs.NUB);
1411
2.73k
  Dir->setNumIterations(Exprs.NumIterations);
1412
2.73k
  Dir->setCounters(Exprs.Counters);
1413
2.73k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
1414
2.73k
  Dir->setInits(Exprs.Inits);
1415
2.73k
  Dir->setUpdates(Exprs.Updates);
1416
2.73k
  Dir->setFinals(Exprs.Finals);
1417
2.73k
  Dir->setPreInits(Exprs.PreInits);
1418
2.73k
  return Dir;
1419
2.73k
}
1420
1421
OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::CreateEmpty(
1422
    const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1423
154
    EmptyShell) {
1424
154
  unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeSimdDirective),
1425
154
                                alignof(OMPClause *));
1426
154
  void *Mem =
1427
154
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1428
154
                 sizeof(Stmt *) *
1429
154
                     numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd));
1430
154
  return new (Mem) OMPTeamsDistributeSimdDirective(CollapsedNum, NumClauses);
1431
154
}
1432
1433
OMPTeamsDistributeParallelForSimdDirective *
1434
OMPTeamsDistributeParallelForSimdDirective::Create(
1435
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1436
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1437
3.25k
    const HelperExprs &Exprs) {
1438
3.25k
  auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForSimdDirective),
1439
3.25k
                            alignof(OMPClause *));
1440
3.25k
  void *Mem =
1441
3.25k
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
1442
3.25k
                 sizeof(Stmt *) *
1443
3.25k
                     numLoopChildren(CollapsedNum,
1444
3.25k
                                     OMPD_teams_distribute_parallel_for_simd));
1445
3.25k
  OMPTeamsDistributeParallelForSimdDirective *Dir = new (Mem)
1446
3.25k
      OMPTeamsDistributeParallelForSimdDirective(StartLoc, EndLoc, CollapsedNum,
1447
3.25k
                                                 Clauses.size());
1448
3.25k
  Dir->setClauses(Clauses);
1449
3.25k
  Dir->setAssociatedStmt(AssociatedStmt);
1450
3.25k
  Dir->setIterationVariable(Exprs.IterationVarRef);
1451
3.25k
  Dir->setLastIteration(Exprs.LastIteration);
1452
3.25k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1453
3.25k
  Dir->setPreCond(Exprs.PreCond);
1454
3.25k
  Dir->setCond(Exprs.Cond);
1455
3.25k
  Dir->setInit(Exprs.Init);
1456
3.25k
  Dir->setInc(Exprs.Inc);
1457
3.25k
  Dir->setIsLastIterVariable(Exprs.IL);
1458
3.25k
  Dir->setLowerBoundVariable(Exprs.LB);
1459
3.25k
  Dir->setUpperBoundVariable(Exprs.UB);
1460
3.25k
  Dir->setStrideVariable(Exprs.ST);
1461
3.25k
  Dir->setEnsureUpperBound(Exprs.EUB);
1462
3.25k
  Dir->setNextLowerBound(Exprs.NLB);
1463
3.25k
  Dir->setNextUpperBound(Exprs.NUB);
1464
3.25k
  Dir->setNumIterations(Exprs.NumIterations);
1465
3.25k
  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1466
3.25k
  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1467
3.25k
  Dir->setDistInc(Exprs.DistInc);
1468
3.25k
  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1469
3.25k
  Dir->setCounters(Exprs.Counters);
1470
3.25k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
1471
3.25k
  Dir->setInits(Exprs.Inits);
1472
3.25k
  Dir->setUpdates(Exprs.Updates);
1473
3.25k
  Dir->setFinals(Exprs.Finals);
1474
3.25k
  Dir->setPreInits(Exprs.PreInits);
1475
3.25k
  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1476
3.25k
  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1477
3.25k
  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1478
3.25k
  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1479
3.25k
  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1480
3.25k
  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1481
3.25k
  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1482
3.25k
  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1483
3.25k
  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1484
3.25k
  return Dir;
1485
3.25k
}
1486
1487
OMPTeamsDistributeParallelForSimdDirective *
1488
OMPTeamsDistributeParallelForSimdDirective::CreateEmpty(const ASTContext &C,
1489
                                                        unsigned NumClauses,
1490
                                                        unsigned CollapsedNum,
1491
244
                                                        EmptyShell) {
1492
244
  auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForSimdDirective),
1493
244
                            alignof(OMPClause *));
1494
244
  void *Mem =
1495
244
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
1496
244
                 sizeof(Stmt *) *
1497
244
                     numLoopChildren(CollapsedNum,
1498
244
                                     OMPD_teams_distribute_parallel_for_simd));
1499
244
  return new (Mem)
1500
244
      OMPTeamsDistributeParallelForSimdDirective(CollapsedNum, NumClauses);
1501
244
}
1502
1503
OMPTeamsDistributeParallelForDirective *
1504
OMPTeamsDistributeParallelForDirective::Create(
1505
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1506
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1507
2.72k
    const HelperExprs &Exprs, bool HasCancel) {
1508
2.72k
  auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForDirective),
1509
2.72k
                            alignof(OMPClause *));
1510
2.72k
  void *Mem = C.Allocate(
1511
2.72k
      Size + sizeof(OMPClause *) * Clauses.size() +
1512
2.72k
      sizeof(Stmt *) *
1513
2.72k
          numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for));
1514
2.72k
  OMPTeamsDistributeParallelForDirective *Dir = new (Mem)
1515
2.72k
      OMPTeamsDistributeParallelForDirective(StartLoc, EndLoc, CollapsedNum,
1516
2.72k
                                             Clauses.size());
1517
2.72k
  Dir->setClauses(Clauses);
1518
2.72k
  Dir->setAssociatedStmt(AssociatedStmt);
1519
2.72k
  Dir->setIterationVariable(Exprs.IterationVarRef);
1520
2.72k
  Dir->setLastIteration(Exprs.LastIteration);
1521
2.72k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1522
2.72k
  Dir->setPreCond(Exprs.PreCond);
1523
2.72k
  Dir->setCond(Exprs.Cond);
1524
2.72k
  Dir->setInit(Exprs.Init);
1525
2.72k
  Dir->setInc(Exprs.Inc);
1526
2.72k
  Dir->setIsLastIterVariable(Exprs.IL);
1527
2.72k
  Dir->setLowerBoundVariable(Exprs.LB);
1528
2.72k
  Dir->setUpperBoundVariable(Exprs.UB);
1529
2.72k
  Dir->setStrideVariable(Exprs.ST);
1530
2.72k
  Dir->setEnsureUpperBound(Exprs.EUB);
1531
2.72k
  Dir->setNextLowerBound(Exprs.NLB);
1532
2.72k
  Dir->setNextUpperBound(Exprs.NUB);
1533
2.72k
  Dir->setNumIterations(Exprs.NumIterations);
1534
2.72k
  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1535
2.72k
  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1536
2.72k
  Dir->setDistInc(Exprs.DistInc);
1537
2.72k
  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1538
2.72k
  Dir->setCounters(Exprs.Counters);
1539
2.72k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
1540
2.72k
  Dir->setInits(Exprs.Inits);
1541
2.72k
  Dir->setUpdates(Exprs.Updates);
1542
2.72k
  Dir->setFinals(Exprs.Finals);
1543
2.72k
  Dir->setPreInits(Exprs.PreInits);
1544
2.72k
  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1545
2.72k
  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1546
2.72k
  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1547
2.72k
  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1548
2.72k
  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1549
2.72k
  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1550
2.72k
  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1551
2.72k
  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1552
2.72k
  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1553
2.72k
  Dir->HasCancel = HasCancel;
1554
2.72k
  return Dir;
1555
2.72k
}
1556
1557
OMPTeamsDistributeParallelForDirective *
1558
OMPTeamsDistributeParallelForDirective::CreateEmpty(const ASTContext &C,
1559
                                                    unsigned NumClauses,
1560
                                                    unsigned CollapsedNum,
1561
246
                                                    EmptyShell) {
1562
246
  auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForDirective),
1563
246
                            alignof(OMPClause *));
1564
246
  void *Mem = C.Allocate(
1565
246
      Size + sizeof(OMPClause *) * NumClauses +
1566
246
      sizeof(Stmt *) *
1567
246
          numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for));
1568
246
  return new (Mem)
1569
246
      OMPTeamsDistributeParallelForDirective(CollapsedNum, NumClauses);
1570
246
}
1571
1572
OMPTargetTeamsDirective *OMPTargetTeamsDirective::Create(
1573
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1574
3.51k
    ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
1575
3.51k
  auto Size =
1576
3.51k
      llvm::alignTo(sizeof(OMPTargetTeamsDirective), alignof(OMPClause *));
1577
3.51k
  void *Mem =
1578
3.51k
      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
1579
3.51k
  OMPTargetTeamsDirective *Dir =
1580
3.51k
      new (Mem) OMPTargetTeamsDirective(StartLoc, EndLoc, Clauses.size());
1581
3.51k
  Dir->setClauses(Clauses);
1582
3.51k
  Dir->setAssociatedStmt(AssociatedStmt);
1583
3.51k
  return Dir;
1584
3.51k
}
1585
1586
OMPTargetTeamsDirective *
1587
OMPTargetTeamsDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
1588
348
                                     EmptyShell) {
1589
348
  auto Size =
1590
348
      llvm::alignTo(sizeof(OMPTargetTeamsDirective), alignof(OMPClause *));
1591
348
  void *Mem =
1592
348
      C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
1593
348
  return new (Mem) OMPTargetTeamsDirective(NumClauses);
1594
348
}
1595
1596
OMPTargetTeamsDistributeDirective *OMPTargetTeamsDistributeDirective::Create(
1597
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1598
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1599
3.41k
    const HelperExprs &Exprs) {
1600
3.41k
  auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeDirective),
1601
3.41k
                            alignof(OMPClause *));
1602
3.41k
  void *Mem = C.Allocate(
1603
3.41k
      Size + sizeof(OMPClause *) * Clauses.size() +
1604
3.41k
      sizeof(Stmt *) *
1605
3.41k
          numLoopChildren(CollapsedNum, OMPD_target_teams_distribute));
1606
3.41k
  OMPTargetTeamsDistributeDirective *Dir =
1607
3.41k
      new (Mem) OMPTargetTeamsDistributeDirective(StartLoc, EndLoc, CollapsedNum,
1608
3.41k
                                                  Clauses.size());
1609
3.41k
  Dir->setClauses(Clauses);
1610
3.41k
  Dir->setAssociatedStmt(AssociatedStmt);
1611
3.41k
  Dir->setIterationVariable(Exprs.IterationVarRef);
1612
3.41k
  Dir->setLastIteration(Exprs.LastIteration);
1613
3.41k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1614
3.41k
  Dir->setPreCond(Exprs.PreCond);
1615
3.41k
  Dir->setCond(Exprs.Cond);
1616
3.41k
  Dir->setInit(Exprs.Init);
1617
3.41k
  Dir->setInc(Exprs.Inc);
1618
3.41k
  Dir->setIsLastIterVariable(Exprs.IL);
1619
3.41k
  Dir->setLowerBoundVariable(Exprs.LB);
1620
3.41k
  Dir->setUpperBoundVariable(Exprs.UB);
1621
3.41k
  Dir->setStrideVariable(Exprs.ST);
1622
3.41k
  Dir->setEnsureUpperBound(Exprs.EUB);
1623
3.41k
  Dir->setNextLowerBound(Exprs.NLB);
1624
3.41k
  Dir->setNextUpperBound(Exprs.NUB);
1625
3.41k
  Dir->setNumIterations(Exprs.NumIterations);
1626
3.41k
  Dir->setCounters(Exprs.Counters);
1627
3.41k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
1628
3.41k
  Dir->setInits(Exprs.Inits);
1629
3.41k
  Dir->setUpdates(Exprs.Updates);
1630
3.41k
  Dir->setFinals(Exprs.Finals);
1631
3.41k
  Dir->setPreInits(Exprs.PreInits);
1632
3.41k
  return Dir;
1633
3.41k
}
1634
1635
OMPTargetTeamsDistributeDirective *
1636
OMPTargetTeamsDistributeDirective::CreateEmpty(const ASTContext &C,
1637
                                               unsigned NumClauses,
1638
                                               unsigned CollapsedNum,
1639
302
                                               EmptyShell) {
1640
302
  auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeDirective),
1641
302
                            alignof(OMPClause *));
1642
302
  void *Mem = C.Allocate(
1643
302
      Size + sizeof(OMPClause *) * NumClauses +
1644
302
      sizeof(Stmt *) *
1645
302
           numLoopChildren(CollapsedNum, OMPD_target_teams_distribute));
1646
302
  return new (Mem) OMPTargetTeamsDistributeDirective(CollapsedNum, NumClauses);
1647
302
}
1648
1649
OMPTargetTeamsDistributeParallelForDirective *
1650
OMPTargetTeamsDistributeParallelForDirective::Create(
1651
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1652
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1653
4.03k
    const HelperExprs &Exprs, bool HasCancel) {
1654
4.03k
  auto Size =
1655
4.03k
      llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForDirective),
1656
4.03k
                    alignof(OMPClause *));
1657
4.03k
  void *Mem = C.Allocate(
1658
4.03k
      Size + sizeof(OMPClause *) * Clauses.size() +
1659
4.03k
      sizeof(Stmt *) *
1660
4.03k
          numLoopChildren(CollapsedNum,
1661
4.03k
                          OMPD_target_teams_distribute_parallel_for));
1662
4.03k
  OMPTargetTeamsDistributeParallelForDirective *Dir =
1663
4.03k
      new (Mem) OMPTargetTeamsDistributeParallelForDirective(
1664
4.03k
           StartLoc, EndLoc, CollapsedNum, Clauses.size());
1665
4.03k
  Dir->setClauses(Clauses);
1666
4.03k
  Dir->setAssociatedStmt(AssociatedStmt);
1667
4.03k
  Dir->setIterationVariable(Exprs.IterationVarRef);
1668
4.03k
  Dir->setLastIteration(Exprs.LastIteration);
1669
4.03k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1670
4.03k
  Dir->setPreCond(Exprs.PreCond);
1671
4.03k
  Dir->setCond(Exprs.Cond);
1672
4.03k
  Dir->setInit(Exprs.Init);
1673
4.03k
  Dir->setInc(Exprs.Inc);
1674
4.03k
  Dir->setIsLastIterVariable(Exprs.IL);
1675
4.03k
  Dir->setLowerBoundVariable(Exprs.LB);
1676
4.03k
  Dir->setUpperBoundVariable(Exprs.UB);
1677
4.03k
  Dir->setStrideVariable(Exprs.ST);
1678
4.03k
  Dir->setEnsureUpperBound(Exprs.EUB);
1679
4.03k
  Dir->setNextLowerBound(Exprs.NLB);
1680
4.03k
  Dir->setNextUpperBound(Exprs.NUB);
1681
4.03k
  Dir->setNumIterations(Exprs.NumIterations);
1682
4.03k
  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1683
4.03k
  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1684
4.03k
  Dir->setDistInc(Exprs.DistInc);
1685
4.03k
  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1686
4.03k
  Dir->setCounters(Exprs.Counters);
1687
4.03k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
1688
4.03k
  Dir->setInits(Exprs.Inits);
1689
4.03k
  Dir->setUpdates(Exprs.Updates);
1690
4.03k
  Dir->setFinals(Exprs.Finals);
1691
4.03k
  Dir->setPreInits(Exprs.PreInits);
1692
4.03k
  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1693
4.03k
  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1694
4.03k
  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1695
4.03k
  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1696
4.03k
  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1697
4.03k
  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1698
4.03k
  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1699
4.03k
  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1700
4.03k
  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1701
4.03k
  Dir->HasCancel = HasCancel;
1702
4.03k
  return Dir;
1703
4.03k
}
1704
1705
OMPTargetTeamsDistributeParallelForDirective *
1706
OMPTargetTeamsDistributeParallelForDirective::CreateEmpty(const ASTContext &C,
1707
                                                          unsigned NumClauses,
1708
                                                          unsigned CollapsedNum,
1709
306
                                                          EmptyShell) {
1710
306
  auto Size =
1711
306
      llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForDirective),
1712
306
                    alignof(OMPClause *));
1713
306
  void *Mem = C.Allocate(
1714
306
      Size + sizeof(OMPClause *) * NumClauses +
1715
306
      sizeof(Stmt *) *
1716
306
           numLoopChildren(CollapsedNum,
1717
306
                           OMPD_target_teams_distribute_parallel_for));
1718
306
  return new (Mem)
1719
306
      OMPTargetTeamsDistributeParallelForDirective(CollapsedNum, NumClauses);
1720
306
}
1721
1722
OMPTargetTeamsDistributeParallelForSimdDirective *
1723
OMPTargetTeamsDistributeParallelForSimdDirective::Create(
1724
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1725
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1726
5.04k
    const HelperExprs &Exprs) {
1727
5.04k
  auto Size =
1728
5.04k
      llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForSimdDirective),
1729
5.04k
                    alignof(OMPClause *));
1730
5.04k
  void *Mem = C.Allocate(
1731
5.04k
      Size + sizeof(OMPClause *) * Clauses.size() +
1732
5.04k
      sizeof(Stmt *) *
1733
5.04k
          numLoopChildren(CollapsedNum,
1734
5.04k
                          OMPD_target_teams_distribute_parallel_for_simd));
1735
5.04k
  OMPTargetTeamsDistributeParallelForSimdDirective *Dir =
1736
5.04k
      new (Mem) OMPTargetTeamsDistributeParallelForSimdDirective(
1737
5.04k
           StartLoc, EndLoc, CollapsedNum, Clauses.size());
1738
5.04k
  Dir->setClauses(Clauses);
1739
5.04k
  Dir->setAssociatedStmt(AssociatedStmt);
1740
5.04k
  Dir->setIterationVariable(Exprs.IterationVarRef);
1741
5.04k
  Dir->setLastIteration(Exprs.LastIteration);
1742
5.04k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1743
5.04k
  Dir->setPreCond(Exprs.PreCond);
1744
5.04k
  Dir->setCond(Exprs.Cond);
1745
5.04k
  Dir->setInit(Exprs.Init);
1746
5.04k
  Dir->setInc(Exprs.Inc);
1747
5.04k
  Dir->setIsLastIterVariable(Exprs.IL);
1748
5.04k
  Dir->setLowerBoundVariable(Exprs.LB);
1749
5.04k
  Dir->setUpperBoundVariable(Exprs.UB);
1750
5.04k
  Dir->setStrideVariable(Exprs.ST);
1751
5.04k
  Dir->setEnsureUpperBound(Exprs.EUB);
1752
5.04k
  Dir->setNextLowerBound(Exprs.NLB);
1753
5.04k
  Dir->setNextUpperBound(Exprs.NUB);
1754
5.04k
  Dir->setNumIterations(Exprs.NumIterations);
1755
5.04k
  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1756
5.04k
  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1757
5.04k
  Dir->setDistInc(Exprs.DistInc);
1758
5.04k
  Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1759
5.04k
  Dir->setCounters(Exprs.Counters);
1760
5.04k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
1761
5.04k
  Dir->setInits(Exprs.Inits);
1762
5.04k
  Dir->setUpdates(Exprs.Updates);
1763
5.04k
  Dir->setFinals(Exprs.Finals);
1764
5.04k
  Dir->setPreInits(Exprs.PreInits);
1765
5.04k
  Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1766
5.04k
  Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1767
5.04k
  Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1768
5.04k
  Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1769
5.04k
  Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1770
5.04k
  Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1771
5.04k
  Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1772
5.04k
  Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1773
5.04k
  Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1774
5.04k
  return Dir;
1775
5.04k
}
1776
1777
OMPTargetTeamsDistributeParallelForSimdDirective *
1778
OMPTargetTeamsDistributeParallelForSimdDirective::CreateEmpty(
1779
    const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
1780
406
    EmptyShell) {
1781
406
  auto Size =
1782
406
      llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForSimdDirective),
1783
406
                    alignof(OMPClause *));
1784
406
  void *Mem = C.Allocate(
1785
406
      Size + sizeof(OMPClause *) * NumClauses +
1786
406
      sizeof(Stmt *) *
1787
406
          numLoopChildren(CollapsedNum,
1788
406
                          OMPD_target_teams_distribute_parallel_for_simd));
1789
406
  return new (Mem) OMPTargetTeamsDistributeParallelForSimdDirective(
1790
406
      CollapsedNum, NumClauses);
1791
406
}
1792
1793
OMPTargetTeamsDistributeSimdDirective *
1794
OMPTargetTeamsDistributeSimdDirective::Create(
1795
    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1796
    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1797
4.46k
    const HelperExprs &Exprs) {
1798
4.46k
  auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeSimdDirective),
1799
4.46k
                            alignof(OMPClause *));
1800
4.46k
  void *Mem = C.Allocate(
1801
4.46k
      Size + sizeof(OMPClause *) * Clauses.size() +
1802
4.46k
      sizeof(Stmt *) *
1803
4.46k
          numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd));
1804
4.46k
  OMPTargetTeamsDistributeSimdDirective *Dir = new (Mem)
1805
4.46k
      OMPTargetTeamsDistributeSimdDirective(StartLoc, EndLoc, CollapsedNum,
1806
4.46k
                                            Clauses.size());
1807
4.46k
  Dir->setClauses(Clauses);
1808
4.46k
  Dir->setAssociatedStmt(AssociatedStmt);
1809
4.46k
  Dir->setIterationVariable(Exprs.IterationVarRef);
1810
4.46k
  Dir->setLastIteration(Exprs.LastIteration);
1811
4.46k
  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1812
4.46k
  Dir->setPreCond(Exprs.PreCond);
1813
4.46k
  Dir->setCond(Exprs.Cond);
1814
4.46k
  Dir->setInit(Exprs.Init);
1815
4.46k
  Dir->setInc(Exprs.Inc);
1816
4.46k
  Dir->setIsLastIterVariable(Exprs.IL);
1817
4.46k
  Dir->setLowerBoundVariable(Exprs.LB);
1818
4.46k
  Dir->setUpperBoundVariable(Exprs.UB);
1819
4.46k
  Dir->setStrideVariable(Exprs.ST);
1820
4.46k
  Dir->setEnsureUpperBound(Exprs.EUB);
1821
4.46k
  Dir->setNextLowerBound(Exprs.NLB);
1822
4.46k
  Dir->setNextUpperBound(Exprs.NUB);
1823
4.46k
  Dir->setNumIterations(Exprs.NumIterations);
1824
4.46k
  Dir->setCounters(Exprs.Counters);
1825
4.46k
  Dir->setPrivateCounters(Exprs.PrivateCounters);
1826
4.46k
  Dir->setInits(Exprs.Inits);
1827
4.46k
  Dir->setUpdates(Exprs.Updates);
1828
4.46k
  Dir->setFinals(Exprs.Finals);
1829
4.46k
  Dir->setPreInits(Exprs.PreInits);
1830
4.46k
  return Dir;
1831
4.46k
}
1832
1833
OMPTargetTeamsDistributeSimdDirective *
1834
OMPTargetTeamsDistributeSimdDirective::CreateEmpty(const ASTContext &C,
1835
                                                   unsigned NumClauses,
1836
                                                   unsigned CollapsedNum,
1837
356
                                                   EmptyShell) {
1838
356
  auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeSimdDirective),
1839
356
                            alignof(OMPClause *));
1840
356
  void *Mem = C.Allocate(
1841
356
      Size + sizeof(OMPClause *) * NumClauses +
1842
356
      sizeof(Stmt *) *
1843
356
          numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd));
1844
356
  return new (Mem)
1845
356
      OMPTargetTeamsDistributeSimdDirective(CollapsedNum, NumClauses);
1846
356
}