clang  10.0.0svn
DeclOpenMP.h
Go to the documentation of this file.
1 //===- DeclOpenMP.h - Classes for representing OpenMP directives -*- C++ -*-===//
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 /// \file
10 /// This file defines OpenMP nodes for declarative directives.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CLANG_AST_DECLOPENMP_H
15 #define LLVM_CLANG_AST_DECLOPENMP_H
16 
17 #include "clang/AST/Decl.h"
18 #include "clang/AST/Expr.h"
20 #include "clang/AST/OpenMPClause.h"
21 #include "clang/AST/Type.h"
22 #include "llvm/ADT/ArrayRef.h"
23 #include "llvm/Support/TrailingObjects.h"
24 
25 namespace clang {
26 
27 /// This represents '#pragma omp threadprivate ...' directive.
28 /// For example, in the following, both 'a' and 'A::b' are threadprivate:
29 ///
30 /// \code
31 /// int a;
32 /// #pragma omp threadprivate(a)
33 /// struct A {
34 /// static int b;
35 /// #pragma omp threadprivate(b)
36 /// };
37 /// \endcode
38 ///
40  : public Decl,
41  private llvm::TrailingObjects<OMPThreadPrivateDecl, Expr *> {
42  friend class ASTDeclReader;
43  friend TrailingObjects;
44 
45  unsigned NumVars;
46 
47  virtual void anchor();
48 
50  Decl(DK, DC, L), NumVars(0) { }
51 
52  ArrayRef<const Expr *> getVars() const {
53  return llvm::makeArrayRef(getTrailingObjects<Expr *>(), NumVars);
54  }
55 
56  MutableArrayRef<Expr *> getVars() {
57  return MutableArrayRef<Expr *>(getTrailingObjects<Expr *>(), NumVars);
58  }
59 
60  void setVars(ArrayRef<Expr *> VL);
61 
62 public:
65  ArrayRef<Expr *> VL);
67  unsigned ID, unsigned N);
68 
71  typedef llvm::iterator_range<varlist_iterator> varlist_range;
72  typedef llvm::iterator_range<varlist_const_iterator> varlist_const_range;
73 
74  unsigned varlist_size() const { return NumVars; }
75  bool varlist_empty() const { return NumVars == 0; }
76 
77  varlist_range varlists() {
79  }
80  varlist_const_range varlists() const {
82  }
83  varlist_iterator varlist_begin() { return getVars().begin(); }
84  varlist_iterator varlist_end() { return getVars().end(); }
85  varlist_const_iterator varlist_begin() const { return getVars().begin(); }
86  varlist_const_iterator varlist_end() const { return getVars().end(); }
87 
88  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
89  static bool classofKind(Kind K) { return K == OMPThreadPrivate; }
90 };
91 
92 /// This represents '#pragma omp declare reduction ...' directive.
93 /// For example, in the following, declared reduction 'foo' for types 'int' and
94 /// 'float':
95 ///
96 /// \code
97 /// #pragma omp declare reduction (foo : int,float : omp_out += omp_in) \
98 /// initializer (omp_priv = 0)
99 /// \endcode
100 ///
101 /// Here 'omp_out += omp_in' is a combiner and 'omp_priv = 0' is an initializer.
102 class OMPDeclareReductionDecl final : public ValueDecl, public DeclContext {
103  // This class stores some data in DeclContext::OMPDeclareReductionDeclBits
104  // to save some space. Use the provided accessors to access it.
105 public:
106  enum InitKind {
107  CallInit, // Initialized by function call.
108  DirectInit, // omp_priv(<expr>)
109  CopyInit // omp_priv = <expr>
110  };
111 
112 private:
113  friend class ASTDeclReader;
114  /// Combiner for declare reduction construct.
115  Expr *Combiner = nullptr;
116  /// Initializer for declare reduction construct.
117  Expr *Initializer = nullptr;
118  /// In parameter of the combiner.
119  Expr *In = nullptr;
120  /// Out parameter of the combiner.
121  Expr *Out = nullptr;
122  /// Priv parameter of the initializer.
123  Expr *Priv = nullptr;
124  /// Orig parameter of the initializer.
125  Expr *Orig = nullptr;
126 
127  /// Reference to the previous declare reduction construct in the same
128  /// scope with the same name. Required for proper templates instantiation if
129  /// the declare reduction construct is declared inside compound statement.
130  LazyDeclPtr PrevDeclInScope;
131 
132  virtual void anchor();
133 
135  DeclarationName Name, QualType Ty,
136  OMPDeclareReductionDecl *PrevDeclInScope);
137 
138  void setPrevDeclInScope(OMPDeclareReductionDecl *Prev) {
139  PrevDeclInScope = Prev;
140  }
141 
142 public:
143  /// Create declare reduction node.
144  static OMPDeclareReductionDecl *
146  QualType T, OMPDeclareReductionDecl *PrevDeclInScope);
147  /// Create deserialized declare reduction node.
149  unsigned ID);
150 
151  /// Get combiner expression of the declare reduction construct.
152  Expr *getCombiner() { return Combiner; }
153  const Expr *getCombiner() const { return Combiner; }
154  /// Get In variable of the combiner.
155  Expr *getCombinerIn() { return In; }
156  const Expr *getCombinerIn() const { return In; }
157  /// Get Out variable of the combiner.
158  Expr *getCombinerOut() { return Out; }
159  const Expr *getCombinerOut() const { return Out; }
160  /// Set combiner expression for the declare reduction construct.
161  void setCombiner(Expr *E) { Combiner = E; }
162  /// Set combiner In and Out vars.
163  void setCombinerData(Expr *InE, Expr *OutE) {
164  In = InE;
165  Out = OutE;
166  }
167 
168  /// Get initializer expression (if specified) of the declare reduction
169  /// construct.
171  const Expr *getInitializer() const { return Initializer; }
172  /// Get initializer kind.
174  return static_cast<InitKind>(OMPDeclareReductionDeclBits.InitializerKind);
175  }
176  /// Get Orig variable of the initializer.
177  Expr *getInitOrig() { return Orig; }
178  const Expr *getInitOrig() const { return Orig; }
179  /// Get Priv variable of the initializer.
180  Expr *getInitPriv() { return Priv; }
181  const Expr *getInitPriv() const { return Priv; }
182  /// Set initializer expression for the declare reduction construct.
183  void setInitializer(Expr *E, InitKind IK) {
184  Initializer = E;
185  OMPDeclareReductionDeclBits.InitializerKind = IK;
186  }
187  /// Set initializer Orig and Priv vars.
188  void setInitializerData(Expr *OrigE, Expr *PrivE) {
189  Orig = OrigE;
190  Priv = PrivE;
191  }
192 
193  /// Get reference to previous declare reduction construct in the same
194  /// scope with the same name.
195  OMPDeclareReductionDecl *getPrevDeclInScope();
196  const OMPDeclareReductionDecl *getPrevDeclInScope() const;
197 
198  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
199  static bool classofKind(Kind K) { return K == OMPDeclareReduction; }
201  return static_cast<DeclContext *>(const_cast<OMPDeclareReductionDecl *>(D));
202  }
204  return static_cast<OMPDeclareReductionDecl *>(
205  const_cast<DeclContext *>(DC));
206  }
207 };
208 
209 /// This represents '#pragma omp declare mapper ...' directive. Map clauses are
210 /// allowed to use with this directive. The following example declares a user
211 /// defined mapper for the type 'struct vec'. This example instructs the fields
212 /// 'len' and 'data' should be mapped when mapping instances of 'struct vec'.
213 ///
214 /// \code
215 /// #pragma omp declare mapper(mid: struct vec v) map(v.len, v.data[0:N])
216 /// \endcode
217 class OMPDeclareMapperDecl final : public ValueDecl, public DeclContext {
218  friend class ASTDeclReader;
219 
220  /// Clauses associated with this mapper declaration
222 
223  /// Mapper variable, which is 'v' in the example above
224  Expr *MapperVarRef = nullptr;
225 
226  /// Name of the mapper variable
227  DeclarationName VarName;
228 
229  LazyDeclPtr PrevDeclInScope;
230 
231  virtual void anchor();
232 
234  DeclarationName Name, QualType Ty,
235  DeclarationName VarName,
236  OMPDeclareMapperDecl *PrevDeclInScope)
237  : ValueDecl(DK, DC, L, Name, Ty), DeclContext(DK), VarName(VarName),
238  PrevDeclInScope(PrevDeclInScope) {}
239 
240  void setPrevDeclInScope(OMPDeclareMapperDecl *Prev) {
241  PrevDeclInScope = Prev;
242  }
243 
244  /// Sets an array of clauses to this mapper declaration
245  void setClauses(ArrayRef<OMPClause *> CL);
246 
247 public:
248  /// Creates declare mapper node.
251  QualType T, DeclarationName VarName,
252  OMPDeclareMapperDecl *PrevDeclInScope);
253  /// Creates deserialized declare mapper node.
255  unsigned N);
256 
257  /// Creates an array of clauses to this mapper declaration and intializes
258  /// them.
259  void CreateClauses(ASTContext &C, ArrayRef<OMPClause *> CL);
260 
263  using clauselist_range = llvm::iterator_range<clauselist_iterator>;
264  using clauselist_const_range =
265  llvm::iterator_range<clauselist_const_iterator>;
266 
267  unsigned clauselist_size() const { return Clauses.size(); }
268  bool clauselist_empty() const { return Clauses.empty(); }
269 
271  return clauselist_range(clauselist_begin(), clauselist_end());
272  }
274  return clauselist_const_range(clauselist_begin(), clauselist_end());
275  }
276  clauselist_iterator clauselist_begin() { return Clauses.begin(); }
277  clauselist_iterator clauselist_end() { return Clauses.end(); }
278  clauselist_const_iterator clauselist_begin() const { return Clauses.begin(); }
279  clauselist_const_iterator clauselist_end() const { return Clauses.end(); }
280 
281  /// Get the variable declared in the mapper
282  Expr *getMapperVarRef() { return MapperVarRef; }
283  const Expr *getMapperVarRef() const { return MapperVarRef; }
284  /// Set the variable declared in the mapper
285  void setMapperVarRef(Expr *MapperVarRefE) { MapperVarRef = MapperVarRefE; }
286 
287  /// Get the name of the variable declared in the mapper
288  DeclarationName getVarName() { return VarName; }
289 
290  /// Get reference to previous declare mapper construct in the same
291  /// scope with the same name.
292  OMPDeclareMapperDecl *getPrevDeclInScope();
293  const OMPDeclareMapperDecl *getPrevDeclInScope() const;
294 
295  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
296  static bool classofKind(Kind K) { return K == OMPDeclareMapper; }
298  return static_cast<DeclContext *>(const_cast<OMPDeclareMapperDecl *>(D));
299  }
301  return static_cast<OMPDeclareMapperDecl *>(const_cast<DeclContext *>(DC));
302  }
303 };
304 
305 /// Pseudo declaration for capturing expressions. Also is used for capturing of
306 /// non-static data members in non-static member functions.
307 ///
308 /// Clang supports capturing of variables only, but OpenMP 4.5 allows to
309 /// privatize non-static members of current class in non-static member
310 /// functions. This pseudo-declaration allows properly handle this kind of
311 /// capture by wrapping captured expression into a variable-like declaration.
312 class OMPCapturedExprDecl final : public VarDecl {
313  friend class ASTDeclReader;
314  void anchor() override;
315 
317  QualType Type, TypeSourceInfo *TInfo,
318  SourceLocation StartLoc)
319  : VarDecl(OMPCapturedExpr, C, DC, StartLoc, StartLoc, Id, Type, TInfo,
320  SC_None) {
321  setImplicit();
322  }
323 
324 public:
327  SourceLocation StartLoc);
328 
330 
331  SourceRange getSourceRange() const override LLVM_READONLY;
332 
333  // Implement isa/cast/dyncast/etc.
334  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
335  static bool classofKind(Kind K) { return K == OMPCapturedExpr; }
336 };
337 
338 /// This represents '#pragma omp requires...' directive.
339 /// For example
340 ///
341 /// \code
342 /// #pragma omp requires unified_address
343 /// \endcode
344 ///
345 class OMPRequiresDecl final
346  : public Decl,
347  private llvm::TrailingObjects<OMPRequiresDecl, OMPClause *> {
348  friend class ASTDeclReader;
349  friend TrailingObjects;
350 
351  // Number of clauses associated with this requires declaration
352  unsigned NumClauses = 0;
353 
354  virtual void anchor();
355 
357  : Decl(DK, DC, L), NumClauses(0) {}
358 
359  /// Returns an array of immutable clauses associated with this requires
360  /// declaration
361  ArrayRef<const OMPClause *> getClauses() const {
362  return llvm::makeArrayRef(getTrailingObjects<OMPClause *>(), NumClauses);
363  }
364 
365  /// Returns an array of clauses associated with this requires declaration
366  MutableArrayRef<OMPClause *> getClauses() {
367  return MutableArrayRef<OMPClause *>(getTrailingObjects<OMPClause *>(),
368  NumClauses);
369  }
370 
371  /// Sets an array of clauses to this requires declaration
372  void setClauses(ArrayRef<OMPClause *> CL);
373 
374 public:
375  /// Create requires node.
378  /// Create deserialized requires node.
379  static OMPRequiresDecl *CreateDeserialized(ASTContext &C, unsigned ID,
380  unsigned N);
381 
384  using clauselist_range = llvm::iterator_range<clauselist_iterator>;
385  using clauselist_const_range = llvm::iterator_range<clauselist_const_iterator>;
386 
387  unsigned clauselist_size() const { return NumClauses; }
388  bool clauselist_empty() const { return NumClauses == 0; }
389 
391  return clauselist_range(clauselist_begin(), clauselist_end());
392  }
394  return clauselist_const_range(clauselist_begin(), clauselist_end());
395  }
396  clauselist_iterator clauselist_begin() { return getClauses().begin(); }
397  clauselist_iterator clauselist_end() { return getClauses().end(); }
399  return getClauses().begin();
400  }
402  return getClauses().end();
403  }
404 
405  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
406  static bool classofKind(Kind K) { return K == OMPRequires; }
407 };
408 
409 /// This represents '#pragma omp allocate ...' directive.
410 /// For example, in the following, the default allocator is used for both 'a'
411 /// and 'A::b':
412 ///
413 /// \code
414 /// int a;
415 /// #pragma omp allocate(a)
416 /// struct A {
417 /// static int b;
418 /// #pragma omp allocate(b)
419 /// };
420 /// \endcode
421 ///
422 class OMPAllocateDecl final
423  : public Decl,
424  private llvm::TrailingObjects<OMPAllocateDecl, Expr *, OMPClause *> {
425  friend class ASTDeclReader;
426  friend TrailingObjects;
427 
428  /// Number of variable within the allocate directive.
429  unsigned NumVars = 0;
430  /// Number of clauses associated with the allocate directive.
431  unsigned NumClauses = 0;
432 
433  size_t numTrailingObjects(OverloadToken<Expr *>) const {
434  return NumVars;
435  }
436  size_t numTrailingObjects(OverloadToken<OMPClause *>) const {
437  return NumClauses;
438  }
439 
440  virtual void anchor();
441 
443  : Decl(DK, DC, L) {}
444 
445  ArrayRef<const Expr *> getVars() const {
446  return llvm::makeArrayRef(getTrailingObjects<Expr *>(), NumVars);
447  }
448 
449  MutableArrayRef<Expr *> getVars() {
450  return MutableArrayRef<Expr *>(getTrailingObjects<Expr *>(), NumVars);
451  }
452 
453  void setVars(ArrayRef<Expr *> VL);
454 
455  /// Returns an array of immutable clauses associated with this directive.
456  ArrayRef<OMPClause *> getClauses() const {
457  return llvm::makeArrayRef(getTrailingObjects<OMPClause *>(), NumClauses);
458  }
459 
460  /// Returns an array of clauses associated with this directive.
461  MutableArrayRef<OMPClause *> getClauses() {
462  return MutableArrayRef<OMPClause *>(getTrailingObjects<OMPClause *>(),
463  NumClauses);
464  }
465 
466  /// Sets an array of clauses to this requires declaration
467  void setClauses(ArrayRef<OMPClause *> CL);
468 
469 public:
473  static OMPAllocateDecl *CreateDeserialized(ASTContext &C, unsigned ID,
474  unsigned NVars, unsigned NClauses);
475 
478  typedef llvm::iterator_range<varlist_iterator> varlist_range;
479  typedef llvm::iterator_range<varlist_const_iterator> varlist_const_range;
482  using clauselist_range = llvm::iterator_range<clauselist_iterator>;
483  using clauselist_const_range = llvm::iterator_range<clauselist_const_iterator>;
484 
485 
486  unsigned varlist_size() const { return NumVars; }
487  bool varlist_empty() const { return NumVars == 0; }
488  unsigned clauselist_size() const { return NumClauses; }
489  bool clauselist_empty() const { return NumClauses == 0; }
490 
491  varlist_range varlists() {
493  }
494  varlist_const_range varlists() const {
496  }
497  varlist_iterator varlist_begin() { return getVars().begin(); }
498  varlist_iterator varlist_end() { return getVars().end(); }
499  varlist_const_iterator varlist_begin() const { return getVars().begin(); }
500  varlist_const_iterator varlist_end() const { return getVars().end(); }
501 
503  return clauselist_range(clauselist_begin(), clauselist_end());
504  }
506  return clauselist_const_range(clauselist_begin(), clauselist_end());
507  }
508  clauselist_iterator clauselist_begin() { return getClauses().begin(); }
509  clauselist_iterator clauselist_end() { return getClauses().end(); }
511  return getClauses().begin();
512  }
514  return getClauses().end();
515  }
516 
517  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
518  static bool classofKind(Kind K) { return K == OMPAllocate; }
519 };
520 
521 } // end namespace clang
522 
523 #endif
clauselist_range clauselists()
Definition: DeclOpenMP.h:270
static bool classof(const Decl *D)
Definition: DeclOpenMP.h:295
static bool classof(const Decl *D)
Definition: DeclOpenMP.h:517
void setImplicit(bool I=true)
Definition: DeclBase.h:559
void setInitializerData(Expr *OrigE, Expr *PrivE)
Set initializer Orig and Priv vars.
Definition: DeclOpenMP.h:188
const Expr * getCombiner() const
Definition: DeclOpenMP.h:153
MutableArrayRef< OMPClause * >::iterator clauselist_iterator
Definition: DeclOpenMP.h:382
A (possibly-)qualified type.
Definition: Type.h:643
clauselist_const_range clauselists() const
Definition: DeclOpenMP.h:505
varlist_iterator varlist_end()
Definition: DeclOpenMP.h:498
clauselist_iterator clauselist_end()
Definition: DeclOpenMP.h:509
This represents &#39;#pragma omp allocate ...&#39; directive.
Definition: DeclOpenMP.h:422
C Language Family Type Representation.
unsigned clauselist_size() const
Definition: DeclOpenMP.h:488
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:88
ArrayRef< const OMPClause * >::iterator clauselist_const_iterator
Definition: DeclOpenMP.h:262
clauselist_iterator clauselist_end()
Definition: DeclOpenMP.h:277
clauselist_const_range clauselists() const
Definition: DeclOpenMP.h:393
The base class of the type hierarchy.
Definition: Type.h:1436
llvm::iterator_range< clauselist_iterator > clauselist_range
Definition: DeclOpenMP.h:482
static OMPDeclareReductionDecl * castFromDeclContext(const DeclContext *DC)
Definition: DeclOpenMP.h:203
bool clauselist_empty() const
Definition: DeclOpenMP.h:489
static bool classofKind(Kind K)
Definition: DeclOpenMP.h:406
A container of type source information.
Definition: Decl.h:86
clauselist_iterator clauselist_begin()
Definition: DeclOpenMP.h:276
llvm::iterator_range< varlist_const_iterator > varlist_const_range
Definition: DeclOpenMP.h:72
clauselist_const_iterator clauselist_begin() const
Definition: DeclOpenMP.h:510
Represents a variable declaration or definition.
Definition: Decl.h:812
ArrayRef< const Expr * >::iterator varlist_const_iterator
Definition: DeclOpenMP.h:477
bool clauselist_empty() const
Definition: DeclOpenMP.h:268
void setCombinerData(Expr *InE, Expr *OutE)
Set combiner In and Out vars.
Definition: DeclOpenMP.h:163
static bool classofKind(Kind K)
Definition: DeclOpenMP.h:199
static bool classof(const Decl *D)
Definition: DeclOpenMP.h:198
clauselist_range clauselists()
Definition: DeclOpenMP.h:390
clauselist_const_iterator clauselist_end() const
Definition: DeclOpenMP.h:279
One of these records is kept for each identifier that is lexed.
llvm::iterator_range< clauselist_const_iterator > clauselist_const_range
Definition: DeclOpenMP.h:385
static OMPThreadPrivateDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned N)
Definition: DeclOpenMP.cpp:40
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:160
varlist_const_range varlists() const
Definition: DeclOpenMP.h:80
InitKind getInitializerKind() const
Get initializer kind.
Definition: DeclOpenMP.h:173
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
Definition: DeclBase.h:417
MutableArrayRef< OMPClause * >::iterator clauselist_iterator
Definition: DeclOpenMP.h:480
static bool classof(const Decl *D)
Definition: DeclOpenMP.h:88
Expr * getMapperVarRef()
Get the variable declared in the mapper.
Definition: DeclOpenMP.h:282
Expr * getInitializer()
Get initializer expression (if specified) of the declare reduction construct.
Definition: DeclOpenMP.h:170
bool clauselist_empty() const
Definition: DeclOpenMP.h:388
clauselist_const_iterator clauselist_begin() const
Definition: DeclOpenMP.h:398
varlist_const_iterator varlist_begin() const
Definition: DeclOpenMP.h:499
static DeclContext * castToDeclContext(const OMPDeclareMapperDecl *D)
Definition: DeclOpenMP.h:297
ArrayRef< const OMPClause * >::iterator clauselist_const_iterator
Definition: DeclOpenMP.h:383
llvm::iterator_range< varlist_const_iterator > varlist_const_range
Definition: DeclOpenMP.h:479
static bool classofKind(Kind K)
Definition: DeclOpenMP.h:296
unsigned varlist_size() const
Definition: DeclOpenMP.h:486
varlist_const_iterator varlist_begin() const
Definition: DeclOpenMP.h:85
const Expr * getInitPriv() const
Definition: DeclOpenMP.h:181
DeclarationName getVarName()
Get the name of the variable declared in the mapper.
Definition: DeclOpenMP.h:288
Expr * getCombiner()
Get combiner expression of the declare reduction construct.
Definition: DeclOpenMP.h:152
MutableArrayRef< Expr * >::iterator varlist_iterator
Definition: DeclOpenMP.h:69
clauselist_const_range clauselists() const
Definition: DeclOpenMP.h:273
This represents &#39;#pragma omp requires...&#39; directive.
Definition: DeclOpenMP.h:345
varlist_iterator varlist_begin()
Definition: DeclOpenMP.h:497
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:636
This represents one expression.
Definition: Expr.h:108
const Expr * getCombinerIn() const
Definition: DeclOpenMP.h:156
int Id
Definition: ASTDiff.cpp:190
const Expr * getCombinerOut() const
Definition: DeclOpenMP.h:159
static bool classof(const Decl *D)
Definition: DeclOpenMP.h:405
clauselist_range clauselists()
Definition: DeclOpenMP.h:502
Expr * getInitPriv()
Get Priv variable of the initializer.
Definition: DeclOpenMP.h:180
llvm::iterator_range< clauselist_iterator > clauselist_range
Definition: DeclOpenMP.h:263
This file defines OpenMP AST classes for clauses.
clauselist_const_iterator clauselist_end() const
Definition: DeclOpenMP.h:513
varlist_const_iterator varlist_end() const
Definition: DeclOpenMP.h:500
clauselist_const_iterator clauselist_end() const
Definition: DeclOpenMP.h:401
static bool classofKind(Kind K)
Definition: DeclOpenMP.h:518
Encodes a location in the source.
clauselist_iterator clauselist_begin()
Definition: DeclOpenMP.h:508
This represents &#39;#pragma omp declare reduction ...&#39; directive.
Definition: DeclOpenMP.h:102
Pseudo declaration for capturing expressions.
Definition: DeclOpenMP.h:312
varlist_const_range varlists() const
Definition: DeclOpenMP.h:494
varlist_iterator varlist_begin()
Definition: DeclOpenMP.h:83
void setInitializer(Expr *E, InitKind IK)
Set initializer expression for the declare reduction construct.
Definition: DeclOpenMP.h:183
void setMapperVarRef(Expr *MapperVarRefE)
Set the variable declared in the mapper.
Definition: DeclOpenMP.h:285
static bool classofKind(Kind K)
Definition: DeclOpenMP.h:335
clauselist_iterator clauselist_begin()
Definition: DeclOpenMP.h:396
static DeclContext * castToDeclContext(const OMPDeclareReductionDecl *D)
Definition: DeclOpenMP.h:200
Expr * getInitOrig()
Get Orig variable of the initializer.
Definition: DeclOpenMP.h:177
bool varlist_empty() const
Definition: DeclOpenMP.h:75
Dataflow Directional Tag Classes.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1271
static OMPThreadPrivateDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, ArrayRef< Expr *> VL)
Definition: DeclOpenMP.cpp:28
static OMPDeclareMapperDecl * castFromDeclContext(const DeclContext *DC)
Definition: DeclOpenMP.h:300
The name of a declaration.
Kind getKind() const
Definition: DeclBase.h:432
varlist_const_iterator varlist_end() const
Definition: DeclOpenMP.h:86
static bool classofKind(Kind K)
Definition: DeclOpenMP.h:89
const Expr * getInitOrig() const
Definition: DeclOpenMP.h:178
MutableArrayRef< Expr * >::iterator varlist_iterator
Definition: DeclOpenMP.h:476
friend TrailingObjects
Definition: OpenMPClause.h:98
llvm::iterator_range< clauselist_const_iterator > clauselist_const_range
Definition: DeclOpenMP.h:265
void setCombiner(Expr *E)
Set combiner expression for the declare reduction construct.
Definition: DeclOpenMP.h:161
clauselist_const_iterator clauselist_begin() const
Definition: DeclOpenMP.h:278
clauselist_iterator clauselist_end()
Definition: DeclOpenMP.h:397
const Expr * getInitializer() const
Definition: DeclOpenMP.h:171
MutableArrayRef< OMPClause * >::iterator clauselist_iterator
Definition: DeclOpenMP.h:261
ArrayRef< const OMPClause * >::iterator clauselist_const_iterator
Definition: DeclOpenMP.h:481
unsigned clauselist_size() const
Definition: DeclOpenMP.h:267
varlist_iterator varlist_end()
Definition: DeclOpenMP.h:84
bool varlist_empty() const
Definition: DeclOpenMP.h:487
This represents &#39;#pragma omp declare mapper ...&#39; directive.
Definition: DeclOpenMP.h:217
llvm::iterator_range< clauselist_const_iterator > clauselist_const_range
Definition: DeclOpenMP.h:483
unsigned clauselist_size() const
Definition: DeclOpenMP.h:387
varlist_range varlists()
Definition: DeclOpenMP.h:491
Kind
Lists the kind of concrete classes of Decl.
Definition: DeclBase.h:91
Expr * getCombinerIn()
Get In variable of the combiner.
Definition: DeclOpenMP.h:155
unsigned varlist_size() const
Definition: DeclOpenMP.h:74
varlist_range varlists()
Definition: DeclOpenMP.h:77
llvm::iterator_range< varlist_iterator > varlist_range
Definition: DeclOpenMP.h:71
llvm::iterator_range< clauselist_iterator > clauselist_range
Definition: DeclOpenMP.h:384
A trivial tuple used to represent a source range.
llvm::iterator_range< varlist_iterator > varlist_range
Definition: DeclOpenMP.h:478
Expr * getCombinerOut()
Get Out variable of the combiner.
Definition: DeclOpenMP.h:158
ArrayRef< const Expr * >::iterator varlist_const_iterator
Definition: DeclOpenMP.h:70
This represents &#39;#pragma omp threadprivate ...&#39; directive.
Definition: DeclOpenMP.h:39
const Expr * getMapperVarRef() const
Definition: DeclOpenMP.h:283