Coverage Report

Created: 2020-02-25 14:32

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