clang  3.8.0
OpenMPClause.cpp
Go to the documentation of this file.
1 //===--- OpenMPClause.cpp - Classes for OpenMP clauses --------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements the subclesses of Stmt class declared in OpenMPClause.h
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "clang/AST/OpenMPClause.h"
15 
16 #include "clang/AST/ASTContext.h"
17 
18 using namespace clang;
19 
21  switch (getClauseKind()) {
22  default:
23  break;
24 #define OPENMP_CLAUSE(Name, Class) \
25  case OMPC_##Name: \
26  return static_cast<Class *>(this)->children();
27 #include "clang/Basic/OpenMPKinds.def"
28  }
29  llvm_unreachable("unknown OMPClause");
30 }
31 
32 void OMPPrivateClause::setPrivateCopies(ArrayRef<Expr *> VL) {
33  assert(VL.size() == varlist_size() &&
34  "Number of private copies is not the same as the preallocated buffer");
35  std::copy(VL.begin(), VL.end(), varlist_end());
36 }
37 
40  SourceLocation LParenLoc, SourceLocation EndLoc,
41  ArrayRef<Expr *> VL, ArrayRef<Expr *> PrivateVL) {
42  // Allocate space for private variables and initializer expressions.
43  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(2 * VL.size()));
44  OMPPrivateClause *Clause =
45  new (Mem) OMPPrivateClause(StartLoc, LParenLoc, EndLoc, VL.size());
46  Clause->setVarRefs(VL);
47  Clause->setPrivateCopies(PrivateVL);
48  return Clause;
49 }
50 
52  unsigned N) {
53  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(2 * N));
54  return new (Mem) OMPPrivateClause(N);
55 }
56 
57 void OMPFirstprivateClause::setPrivateCopies(ArrayRef<Expr *> VL) {
58  assert(VL.size() == varlist_size() &&
59  "Number of private copies is not the same as the preallocated buffer");
60  std::copy(VL.begin(), VL.end(), varlist_end());
61 }
62 
63 void OMPFirstprivateClause::setInits(ArrayRef<Expr *> VL) {
64  assert(VL.size() == varlist_size() &&
65  "Number of inits is not the same as the preallocated buffer");
66  std::copy(VL.begin(), VL.end(), getPrivateCopies().end());
67 }
68 
71  SourceLocation LParenLoc, SourceLocation EndLoc,
72  ArrayRef<Expr *> VL, ArrayRef<Expr *> PrivateVL,
73  ArrayRef<Expr *> InitVL) {
74  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(3 * VL.size()));
75  OMPFirstprivateClause *Clause =
76  new (Mem) OMPFirstprivateClause(StartLoc, LParenLoc, EndLoc, VL.size());
77  Clause->setVarRefs(VL);
78  Clause->setPrivateCopies(PrivateVL);
79  Clause->setInits(InitVL);
80  return Clause;
81 }
82 
84  unsigned N) {
85  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(3 * N));
86  return new (Mem) OMPFirstprivateClause(N);
87 }
88 
90  assert(PrivateCopies.size() == varlist_size() &&
91  "Number of private copies is not the same as the preallocated buffer");
92  std::copy(PrivateCopies.begin(), PrivateCopies.end(), varlist_end());
93 }
94 
95 void OMPLastprivateClause::setSourceExprs(ArrayRef<Expr *> SrcExprs) {
96  assert(SrcExprs.size() == varlist_size() && "Number of source expressions is "
97  "not the same as the "
98  "preallocated buffer");
99  std::copy(SrcExprs.begin(), SrcExprs.end(), getPrivateCopies().end());
100 }
101 
102 void OMPLastprivateClause::setDestinationExprs(ArrayRef<Expr *> DstExprs) {
103  assert(DstExprs.size() == varlist_size() && "Number of destination "
104  "expressions is not the same as "
105  "the preallocated buffer");
106  std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
107 }
108 
109 void OMPLastprivateClause::setAssignmentOps(ArrayRef<Expr *> AssignmentOps) {
110  assert(AssignmentOps.size() == varlist_size() &&
111  "Number of assignment expressions is not the same as the preallocated "
112  "buffer");
113  std::copy(AssignmentOps.begin(), AssignmentOps.end(),
114  getDestinationExprs().end());
115 }
116 
118  const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
119  SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
120  ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps) {
121  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
122  OMPLastprivateClause *Clause =
123  new (Mem) OMPLastprivateClause(StartLoc, LParenLoc, EndLoc, VL.size());
124  Clause->setVarRefs(VL);
125  Clause->setSourceExprs(SrcExprs);
126  Clause->setDestinationExprs(DstExprs);
127  Clause->setAssignmentOps(AssignmentOps);
128  return Clause;
129 }
130 
132  unsigned N) {
133  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(5 * N));
134  return new (Mem) OMPLastprivateClause(N);
135 }
136 
138  SourceLocation StartLoc,
139  SourceLocation LParenLoc,
140  SourceLocation EndLoc,
141  ArrayRef<Expr *> VL) {
142  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
143  OMPSharedClause *Clause =
144  new (Mem) OMPSharedClause(StartLoc, LParenLoc, EndLoc, VL.size());
145  Clause->setVarRefs(VL);
146  return Clause;
147 }
148 
150  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(N));
151  return new (Mem) OMPSharedClause(N);
152 }
153 
155  assert(PL.size() == varlist_size() &&
156  "Number of privates is not the same as the preallocated buffer");
157  std::copy(PL.begin(), PL.end(), varlist_end());
158 }
159 
161  assert(IL.size() == varlist_size() &&
162  "Number of inits is not the same as the preallocated buffer");
163  std::copy(IL.begin(), IL.end(), getPrivates().end());
164 }
165 
167  assert(UL.size() == varlist_size() &&
168  "Number of updates is not the same as the preallocated buffer");
169  std::copy(UL.begin(), UL.end(), getInits().end());
170 }
171 
173  assert(FL.size() == varlist_size() &&
174  "Number of final updates is not the same as the preallocated buffer");
175  std::copy(FL.begin(), FL.end(), getUpdates().end());
176 }
177 
179  const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
183  // Allocate space for 4 lists (Vars, Inits, Updates, Finals) and 2 expressions
184  // (Step and CalcStep).
185  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(5 * VL.size() + 2));
186  OMPLinearClause *Clause = new (Mem) OMPLinearClause(
187  StartLoc, LParenLoc, Modifier, ModifierLoc, ColonLoc, EndLoc, VL.size());
188  Clause->setVarRefs(VL);
189  Clause->setPrivates(PL);
190  Clause->setInits(IL);
191  // Fill update and final expressions with zeroes, they are provided later,
192  // after the directive construction.
193  std::fill(Clause->getInits().end(), Clause->getInits().end() + VL.size(),
194  nullptr);
195  std::fill(Clause->getUpdates().end(), Clause->getUpdates().end() + VL.size(),
196  nullptr);
197  Clause->setStep(Step);
198  Clause->setCalcStep(CalcStep);
199  return Clause;
200 }
201 
203  unsigned NumVars) {
204  // Allocate space for 4 lists (Vars, Inits, Updates, Finals) and 2 expressions
205  // (Step and CalcStep).
206  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(5 * NumVars + 2));
207  return new (Mem) OMPLinearClause(NumVars);
208 }
209 
212  SourceLocation LParenLoc, SourceLocation ColonLoc,
213  SourceLocation EndLoc, ArrayRef<Expr *> VL, Expr *A) {
214  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(VL.size() + 1));
215  OMPAlignedClause *Clause = new (Mem)
216  OMPAlignedClause(StartLoc, LParenLoc, ColonLoc, EndLoc, VL.size());
217  Clause->setVarRefs(VL);
218  Clause->setAlignment(A);
219  return Clause;
220 }
221 
223  unsigned NumVars) {
224  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(NumVars + 1));
225  return new (Mem) OMPAlignedClause(NumVars);
226 }
227 
228 void OMPCopyinClause::setSourceExprs(ArrayRef<Expr *> SrcExprs) {
229  assert(SrcExprs.size() == varlist_size() && "Number of source expressions is "
230  "not the same as the "
231  "preallocated buffer");
232  std::copy(SrcExprs.begin(), SrcExprs.end(), varlist_end());
233 }
234 
235 void OMPCopyinClause::setDestinationExprs(ArrayRef<Expr *> DstExprs) {
236  assert(DstExprs.size() == varlist_size() && "Number of destination "
237  "expressions is not the same as "
238  "the preallocated buffer");
239  std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
240 }
241 
242 void OMPCopyinClause::setAssignmentOps(ArrayRef<Expr *> AssignmentOps) {
243  assert(AssignmentOps.size() == varlist_size() &&
244  "Number of assignment expressions is not the same as the preallocated "
245  "buffer");
246  std::copy(AssignmentOps.begin(), AssignmentOps.end(),
247  getDestinationExprs().end());
248 }
249 
251  const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
252  SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
253  ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps) {
254  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(4 * VL.size()));
255  OMPCopyinClause *Clause =
256  new (Mem) OMPCopyinClause(StartLoc, LParenLoc, EndLoc, VL.size());
257  Clause->setVarRefs(VL);
258  Clause->setSourceExprs(SrcExprs);
259  Clause->setDestinationExprs(DstExprs);
260  Clause->setAssignmentOps(AssignmentOps);
261  return Clause;
262 }
263 
265  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(4 * N));
266  return new (Mem) OMPCopyinClause(N);
267 }
268 
269 void OMPCopyprivateClause::setSourceExprs(ArrayRef<Expr *> SrcExprs) {
270  assert(SrcExprs.size() == varlist_size() && "Number of source expressions is "
271  "not the same as the "
272  "preallocated buffer");
273  std::copy(SrcExprs.begin(), SrcExprs.end(), varlist_end());
274 }
275 
276 void OMPCopyprivateClause::setDestinationExprs(ArrayRef<Expr *> DstExprs) {
277  assert(DstExprs.size() == varlist_size() && "Number of destination "
278  "expressions is not the same as "
279  "the preallocated buffer");
280  std::copy(DstExprs.begin(), DstExprs.end(), getSourceExprs().end());
281 }
282 
283 void OMPCopyprivateClause::setAssignmentOps(ArrayRef<Expr *> AssignmentOps) {
284  assert(AssignmentOps.size() == varlist_size() &&
285  "Number of assignment expressions is not the same as the preallocated "
286  "buffer");
287  std::copy(AssignmentOps.begin(), AssignmentOps.end(),
288  getDestinationExprs().end());
289 }
290 
292  const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
293  SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
294  ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps) {
295  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(4 * VL.size()));
296  OMPCopyprivateClause *Clause =
297  new (Mem) OMPCopyprivateClause(StartLoc, LParenLoc, EndLoc, VL.size());
298  Clause->setVarRefs(VL);
299  Clause->setSourceExprs(SrcExprs);
300  Clause->setDestinationExprs(DstExprs);
301  Clause->setAssignmentOps(AssignmentOps);
302  return Clause;
303 }
304 
306  unsigned N) {
307  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(4 * N));
308  return new (Mem) OMPCopyprivateClause(N);
309 }
310 
311 void OMPReductionClause::setPrivates(ArrayRef<Expr *> Privates) {
312  assert(Privates.size() == varlist_size() &&
313  "Number of private copies is not the same as the preallocated buffer");
314  std::copy(Privates.begin(), Privates.end(), varlist_end());
315 }
316 
317 void OMPReductionClause::setLHSExprs(ArrayRef<Expr *> LHSExprs) {
318  assert(
319  LHSExprs.size() == varlist_size() &&
320  "Number of LHS expressions is not the same as the preallocated buffer");
321  std::copy(LHSExprs.begin(), LHSExprs.end(), getPrivates().end());
322 }
323 
324 void OMPReductionClause::setRHSExprs(ArrayRef<Expr *> RHSExprs) {
325  assert(
326  RHSExprs.size() == varlist_size() &&
327  "Number of RHS expressions is not the same as the preallocated buffer");
328  std::copy(RHSExprs.begin(), RHSExprs.end(), getLHSExprs().end());
329 }
330 
331 void OMPReductionClause::setReductionOps(ArrayRef<Expr *> ReductionOps) {
332  assert(ReductionOps.size() == varlist_size() && "Number of reduction "
333  "expressions is not the same "
334  "as the preallocated buffer");
335  std::copy(ReductionOps.begin(), ReductionOps.end(), getRHSExprs().end());
336 }
337 
339  const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
340  SourceLocation EndLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VL,
341  NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo,
342  ArrayRef<Expr *> Privates, ArrayRef<Expr *> LHSExprs,
343  ArrayRef<Expr *> RHSExprs, ArrayRef<Expr *> ReductionOps) {
344  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(5 * VL.size()));
345  OMPReductionClause *Clause = new (Mem) OMPReductionClause(
346  StartLoc, LParenLoc, EndLoc, ColonLoc, VL.size(), QualifierLoc, NameInfo);
347  Clause->setVarRefs(VL);
348  Clause->setPrivates(Privates);
349  Clause->setLHSExprs(LHSExprs);
350  Clause->setRHSExprs(RHSExprs);
351  Clause->setReductionOps(ReductionOps);
352  return Clause;
353 }
354 
356  unsigned N) {
357  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(5 * N));
358  return new (Mem) OMPReductionClause(N);
359 }
360 
362  SourceLocation StartLoc,
363  SourceLocation LParenLoc,
364  SourceLocation EndLoc,
365  ArrayRef<Expr *> VL) {
366  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
367  OMPFlushClause *Clause =
368  new (Mem) OMPFlushClause(StartLoc, LParenLoc, EndLoc, VL.size());
369  Clause->setVarRefs(VL);
370  return Clause;
371 }
372 
374  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(N));
375  return new (Mem) OMPFlushClause(N);
376 }
377 
380  SourceLocation LParenLoc, SourceLocation EndLoc,
381  OpenMPDependClauseKind DepKind, SourceLocation DepLoc,
382  SourceLocation ColonLoc, ArrayRef<Expr *> VL) {
383  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
384  OMPDependClause *Clause =
385  new (Mem) OMPDependClause(StartLoc, LParenLoc, EndLoc, VL.size());
386  Clause->setVarRefs(VL);
387  Clause->setDependencyKind(DepKind);
388  Clause->setDependencyLoc(DepLoc);
389  Clause->setColonLoc(ColonLoc);
390  return Clause;
391 }
392 
394  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(N));
395  return new (Mem) OMPDependClause(N);
396 }
397 
399  SourceLocation LParenLoc,
400  SourceLocation EndLoc, ArrayRef<Expr *> VL,
401  OpenMPMapClauseKind TypeModifier,
404  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
405  OMPMapClause *Clause = new (Mem) OMPMapClause(
406  TypeModifier, Type, TypeLoc, StartLoc, LParenLoc, EndLoc, VL.size());
407  Clause->setVarRefs(VL);
408  Clause->setMapTypeModifier(TypeModifier);
409  Clause->setMapType(Type);
410  Clause->setMapLoc(TypeLoc);
411  return Clause;
412 }
413 
415  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(N));
416  return new (Mem) OMPMapClause(N);
417 }
static OMPPrivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > PrivateVL)
Creates clause with a list of variables VL.
static OMPDependClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
Defines the clang::ASTContext interface.
static OMPCopyinClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
This represents clause 'copyin' in the '#pragma omp ...' directives.
static OMPCopyprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > SrcExprs, ArrayRef< Expr * > DstExprs, ArrayRef< Expr * > AssignmentOps)
Creates clause with a list of variables VL.
static OMPFirstprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
llvm::iterator_range< child_iterator > child_range
Definition: OpenMPClause.h:62
static OMPCopyinClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > SrcExprs, ArrayRef< Expr * > DstExprs, ArrayRef< Expr * > AssignmentOps)
Creates clause with a list of variables VL.
The base class of the type hierarchy.
Definition: Type.h:1249
static OMPReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents clause 'private' in the '#pragma omp ...' directives.
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
Base wrapper for a particular "section" of type source info.
Definition: TypeLoc.h:40
CalcStep
Definition: OpenMPClause.h:311
static OMPSharedClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL)
Creates clause with a list of variables VL.
Step
Definition: OpenMPClause.h:311
static OMPFirstprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > PrivateVL, ArrayRef< Expr * > InitVL)
Creates clause with a list of variables VL.
clang::OMPLinearClause OMPVarListClause, llvm::TrailingObjects getPrivates()
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:91
A C++ nested-name-specifier augmented with source location information.
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
Definition: OpenMPKinds.h:83
This represents clause 'lastprivate' in the '#pragma omp ...' directives.
void setUpdates(ArrayRef< Expr * > UL)
Sets the list of update expressions for linear variables.
This represents clause 'map' in the '#pragma omp ...' directives.
static OMPMapClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
void setFinals(ArrayRef< Expr * > FL)
Sets the list of final update expressions for linear variables.
This represents clause 'reduction' in the '#pragma omp ...' directives.
OpenMPClauseKind getClauseKind() const
Returns kind of OpenMP clause (private, shared, reduction, etc.).
Definition: OpenMPClause.h:56
child_range children()
This represents clause 'aligned' in the '#pragma omp ...' directives.
static OMPAlignedClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
This represents implicit clause 'depend' for the '#pragma omp task' directive.
static OMPFlushClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL)
Creates clause with a list of variables VL.
Expr - This represents one expression.
Definition: Expr.h:104
static OMPMapClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, OpenMPMapClauseKind TypeModifier, OpenMPMapClauseKind Type, SourceLocation TypeLoc)
Creates clause with a list of variables VL.
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
void setInits(ArrayRef< Expr * > IL)
Sets the list of the initial values for linear variables.
static OMPReductionClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, ArrayRef< Expr * > Privates, ArrayRef< Expr * > LHSExprs, ArrayRef< Expr * > RHSExprs, ArrayRef< Expr * > ReductionOps)
Creates clause with a list of variables VL.
static OMPFlushClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
void setPrivateCopies(ArrayRef< Expr * > PrivateCopies)
Set list of helper expressions, required for generation of private copies of original lastprivate var...
static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > PL, ArrayRef< Expr * > IL, Expr *Step, Expr *CalcStep)
Creates clause with a list of variables VL and a linear step Step.
static OMPPrivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents clause 'firstprivate' in the '#pragma omp ...' directives.
static OMPDependClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, OpenMPDependClauseKind DepKind, SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef< Expr * > VL)
Creates clause with a list of variables VL.
This file defines OpenMP AST classes for clauses.
Encodes a location in the source.
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Definition: OpenMPKinds.h:75
MutableArrayRef< Expr * > getInits()
void setVarRefs(ArrayRef< Expr * > VL)
Sets the list of variables for this clause.
Definition: OpenMPClause.h:91
This represents clause 'shared' in the '#pragma omp ...' directives.
OpenMPLinearClauseKind Modifier
Modifier of 'linear' clause.
Definition: OpenMPClause.h:262
static OMPAlignedClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, Expr *A)
Creates clause with a list of variables VL and alignment A.
SourceLocation ModifierLoc
Location of linear modifier if any.
Definition: OpenMPClause.h:264
This represents clause 'linear' in the '#pragma omp ...' directives.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
static OMPSharedClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
static OMPCopyprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
Privates[]
Gets the list of initial values for linear variables.
Definition: OpenMPClause.h:310
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
Definition: OpenMPKinds.h:91
void * Allocate(size_t Size, unsigned Align=8) const
Definition: ASTContext.h:560
void setPrivates(ArrayRef< Expr * > PL)
Sets the list of the copies of original linear variables.
static OMPLastprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
SourceLocation ColonLoc
Location of ':'.
Definition: OpenMPClause.h:266
static OMPLastprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > SrcExprs, ArrayRef< Expr * > DstExprs, ArrayRef< Expr * > AssignmentOps)
Creates clause with a list of variables VL.