clang  14.0.0git
ExprOpenMP.h
Go to the documentation of this file.
1 //===--- ExprOpenMP.h - Classes for representing expressions ----*- 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 // This file defines the Expr interface and subclasses.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CLANG_AST_EXPROPENMP_H
14 #define LLVM_CLANG_AST_EXPROPENMP_H
15 
17 #include "clang/AST/Expr.h"
18 
19 namespace clang {
20 /// OpenMP 5.0 [2.1.5, Array Sections].
21 /// To specify an array section in an OpenMP construct, array subscript
22 /// expressions are extended with the following syntax:
23 /// \code
24 /// [ lower-bound : length : stride ]
25 /// [ lower-bound : length : ]
26 /// [ lower-bound : length ]
27 /// [ lower-bound : : stride ]
28 /// [ lower-bound : : ]
29 /// [ lower-bound : ]
30 /// [ : length : stride ]
31 /// [ : length : ]
32 /// [ : length ]
33 /// [ : : stride ]
34 /// [ : : ]
35 /// [ : ]
36 /// \endcode
37 /// The array section must be a subset of the original array.
38 /// Array sections are allowed on multidimensional arrays. Base language array
39 /// subscript expressions can be used to specify length-one dimensions of
40 /// multidimensional array sections.
41 /// Each of the lower-bound, length, and stride expressions if specified must be
42 /// an integral type expressions of the base language. When evaluated
43 /// they represent a set of integer values as follows:
44 /// \code
45 /// { lower-bound, lower-bound + stride, lower-bound + 2 * stride,... ,
46 /// lower-bound + ((length - 1) * stride) }
47 /// \endcode
48 /// The lower-bound and length must evaluate to non-negative integers.
49 /// The stride must evaluate to a positive integer.
50 /// When the size of the array dimension is not known, the length must be
51 /// specified explicitly.
52 /// When the stride is absent it defaults to 1.
53 /// When the length is absent it defaults to ⌈(size − lower-bound)/stride⌉,
54 /// where size is the size of the array dimension. When the lower-bound is
55 /// absent it defaults to 0.
56 class OMPArraySectionExpr : public Expr {
57  enum { BASE, LOWER_BOUND, LENGTH, STRIDE, END_EXPR };
58  Stmt *SubExprs[END_EXPR];
59  SourceLocation ColonLocFirst;
60  SourceLocation ColonLocSecond;
61  SourceLocation RBracketLoc;
62 
63 public:
64  OMPArraySectionExpr(Expr *Base, Expr *LowerBound, Expr *Length, Expr *Stride,
66  SourceLocation ColonLocFirst,
67  SourceLocation ColonLocSecond, SourceLocation RBracketLoc)
68  : Expr(OMPArraySectionExprClass, Type, VK, OK),
69  ColonLocFirst(ColonLocFirst), ColonLocSecond(ColonLocSecond),
70  RBracketLoc(RBracketLoc) {
71  SubExprs[BASE] = Base;
72  SubExprs[LOWER_BOUND] = LowerBound;
73  SubExprs[LENGTH] = Length;
74  SubExprs[STRIDE] = Stride;
76  }
77 
78  /// Create an empty array section expression.
80  : Expr(OMPArraySectionExprClass, Shell) {}
81 
82  /// An array section can be written only as Base[LowerBound:Length].
83 
84  /// Get base of the array section.
85  Expr *getBase() { return cast<Expr>(SubExprs[BASE]); }
86  const Expr *getBase() const { return cast<Expr>(SubExprs[BASE]); }
87  /// Set base of the array section.
88  void setBase(Expr *E) { SubExprs[BASE] = E; }
89 
90  /// Return original type of the base expression for array section.
91  static QualType getBaseOriginalType(const Expr *Base);
92 
93  /// Get lower bound of array section.
94  Expr *getLowerBound() { return cast_or_null<Expr>(SubExprs[LOWER_BOUND]); }
95  const Expr *getLowerBound() const {
96  return cast_or_null<Expr>(SubExprs[LOWER_BOUND]);
97  }
98  /// Set lower bound of the array section.
99  void setLowerBound(Expr *E) { SubExprs[LOWER_BOUND] = E; }
100 
101  /// Get length of array section.
102  Expr *getLength() { return cast_or_null<Expr>(SubExprs[LENGTH]); }
103  const Expr *getLength() const { return cast_or_null<Expr>(SubExprs[LENGTH]); }
104  /// Set length of the array section.
105  void setLength(Expr *E) { SubExprs[LENGTH] = E; }
106 
107  /// Get stride of array section.
108  Expr *getStride() { return cast_or_null<Expr>(SubExprs[STRIDE]); }
109  const Expr *getStride() const { return cast_or_null<Expr>(SubExprs[STRIDE]); }
110  /// Set length of the array section.
111  void setStride(Expr *E) { SubExprs[STRIDE] = E; }
112 
113  SourceLocation getBeginLoc() const LLVM_READONLY {
114  return getBase()->getBeginLoc();
115  }
116  SourceLocation getEndLoc() const LLVM_READONLY { return RBracketLoc; }
117 
118  SourceLocation getColonLocFirst() const { return ColonLocFirst; }
119  void setColonLocFirst(SourceLocation L) { ColonLocFirst = L; }
120 
121  SourceLocation getColonLocSecond() const { return ColonLocSecond; }
122  void setColonLocSecond(SourceLocation L) { ColonLocSecond = L; }
123 
124  SourceLocation getRBracketLoc() const { return RBracketLoc; }
125  void setRBracketLoc(SourceLocation L) { RBracketLoc = L; }
126 
127  SourceLocation getExprLoc() const LLVM_READONLY {
128  return getBase()->getExprLoc();
129  }
130 
131  static bool classof(const Stmt *T) {
132  return T->getStmtClass() == OMPArraySectionExprClass;
133  }
134 
136  return child_range(&SubExprs[BASE], &SubExprs[END_EXPR]);
137  }
138 
140  return const_child_range(&SubExprs[BASE], &SubExprs[END_EXPR]);
141  }
142 };
143 
144 /// An explicit cast in C or a C-style cast in C++, which uses the syntax
145 /// ([s1][s2]...[sn])expr. For example: @c ([3][3])f.
147  : public Expr,
148  private llvm::TrailingObjects<OMPArrayShapingExpr, Expr *, SourceRange> {
149  friend TrailingObjects;
150  friend class ASTStmtReader;
151  friend class ASTStmtWriter;
152  /// Base node.
153  SourceLocation LPLoc; /// The location of the left paren
154  SourceLocation RPLoc; /// The location of the right paren
155  unsigned NumDims = 0; /// Number of dimensions in the shaping expression.
156 
157  /// Construct full expression.
160 
161  /// Construct an empty expression.
162  explicit OMPArrayShapingExpr(EmptyShell Shell, unsigned NumDims)
163  : Expr(OMPArrayShapingExprClass, Shell), NumDims(NumDims) {}
164 
165  /// Sets the dimensions for the array shaping.
166  void setDimensions(ArrayRef<Expr *> Dims);
167 
168  /// Sets the base expression for array shaping operation.
169  void setBase(Expr *Op) { getTrailingObjects<Expr *>()[NumDims] = Op; }
170 
171  /// Sets source ranges for the brackets in the array shaping operation.
172  void setBracketsRanges(ArrayRef<SourceRange> BR);
173 
174  unsigned numTrailingObjects(OverloadToken<Expr *>) const {
175  // Add an extra one for the base expression.
176  return NumDims + 1;
177  }
178 
179  unsigned numTrailingObjects(OverloadToken<SourceRange>) const {
180  return NumDims;
181  }
182 
183 public:
184  static OMPArrayShapingExpr *Create(const ASTContext &Context, QualType T,
185  Expr *Op, SourceLocation L,
186  SourceLocation R, ArrayRef<Expr *> Dims,
187  ArrayRef<SourceRange> BracketRanges);
188 
189  static OMPArrayShapingExpr *CreateEmpty(const ASTContext &Context,
190  unsigned NumDims);
191 
192  SourceLocation getLParenLoc() const { return LPLoc; }
193  void setLParenLoc(SourceLocation L) { LPLoc = L; }
194 
195  SourceLocation getRParenLoc() const { return RPLoc; }
196  void setRParenLoc(SourceLocation L) { RPLoc = L; }
197 
198  SourceLocation getBeginLoc() const LLVM_READONLY { return LPLoc; }
199  SourceLocation getEndLoc() const LLVM_READONLY {
200  return getBase()->getEndLoc();
201  }
202 
203  /// Fetches the dimensions for array shaping expression.
205  return llvm::makeArrayRef(getTrailingObjects<Expr *>(), NumDims);
206  }
207 
208  /// Fetches source ranges for the brackets os the array shaping expression.
210  return llvm::makeArrayRef(getTrailingObjects<SourceRange>(), NumDims);
211  }
212 
213  /// Fetches base expression of array shaping expression.
214  Expr *getBase() { return getTrailingObjects<Expr *>()[NumDims]; }
215  const Expr *getBase() const { return getTrailingObjects<Expr *>()[NumDims]; }
216 
217  static bool classof(const Stmt *T) {
218  return T->getStmtClass() == OMPArrayShapingExprClass;
219  }
220 
221  // Iterators
223  Stmt **Begin = reinterpret_cast<Stmt **>(getTrailingObjects<Expr *>());
224  return child_range(Begin, Begin + NumDims + 1);
225  }
227  Stmt *const *Begin =
228  reinterpret_cast<Stmt *const *>(getTrailingObjects<Expr *>());
229  return const_child_range(Begin, Begin + NumDims + 1);
230  }
231 };
232 
233 /// Helper expressions and declaration for OMPIteratorExpr class for each
234 /// iteration space.
236  /// Internal normalized counter.
237  VarDecl *CounterVD = nullptr;
238  /// Normalized upper bound. Normalized loop iterates from 0 to Upper with
239  /// step 1.
240  Expr *Upper = nullptr;
241  /// Update expression for the originally specified iteration variable,
242  /// calculated as VD = Begin + CounterVD * Step;
243  Expr *Update = nullptr;
244  /// Updater for the internal counter: ++CounterVD;
245  Expr *CounterUpdate = nullptr;
246 };
247 
248 /// OpenMP 5.0 [2.1.6 Iterators]
249 /// Iterators are identifiers that expand to multiple values in the clause on
250 /// which they appear.
251 /// The syntax of the iterator modifier is as follows:
252 /// \code
253 /// iterator(iterators-definition)
254 /// \endcode
255 /// where iterators-definition is one of the following:
256 /// \code
257 /// iterator-specifier [, iterators-definition ]
258 /// \endcode
259 /// where iterator-specifier is one of the following:
260 /// \code
261 /// [ iterator-type ] identifier = range-specification
262 /// \endcode
263 /// where identifier is a base language identifier.
264 /// iterator-type is a type name.
265 /// range-specification is of the form begin:end[:step], where begin and end are
266 /// expressions for which their types can be converted to iterator-type and step
267 /// is an integral expression.
268 /// In an iterator-specifier, if the iterator-type is not specified then the
269 /// type of that iterator is of int type.
270 /// The iterator-type must be an integral or pointer type.
271 /// The iterator-type must not be const qualified.
272 class OMPIteratorExpr final
273  : public Expr,
274  private llvm::TrailingObjects<OMPIteratorExpr, Decl *, Expr *,
275  SourceLocation, OMPIteratorHelperData> {
276 public:
277  /// Iterator range representation begin:end[:step].
278  struct IteratorRange {
279  Expr *Begin = nullptr;
280  Expr *End = nullptr;
281  Expr *Step = nullptr;
282  };
283  /// Iterator definition representation.
285  Decl *IteratorDecl = nullptr;
289  };
290 
291 private:
292  friend TrailingObjects;
293  friend class ASTStmtReader;
294  friend class ASTStmtWriter;
295 
296  /// Offset in the list of expressions for subelements of the ranges.
297  enum class RangeExprOffset {
298  Begin = 0,
299  End = 1,
300  Step = 2,
301  Total = 3,
302  };
303  /// Offset in the list of locations for subelements of colon symbols
304  /// locations.
305  enum class RangeLocOffset {
306  AssignLoc = 0,
307  FirstColonLoc = 1,
308  SecondColonLoc = 2,
309  Total = 3,
310  };
311  /// Location of 'iterator' keyword.
312  SourceLocation IteratorKwLoc;
313  /// Location of '('.
314  SourceLocation LPLoc;
315  /// Location of ')'.
316  SourceLocation RPLoc;
317  /// Number of iterator definitions.
318  unsigned NumIterators = 0;
319 
320  OMPIteratorExpr(QualType ExprTy, SourceLocation IteratorKwLoc,
321  SourceLocation L, SourceLocation R,
322  ArrayRef<IteratorDefinition> Data,
323  ArrayRef<OMPIteratorHelperData> Helpers);
324 
325  /// Construct an empty expression.
326  explicit OMPIteratorExpr(EmptyShell Shell, unsigned NumIterators)
327  : Expr(OMPIteratorExprClass, Shell), NumIterators(NumIterators) {}
328 
329  /// Sets basic declaration for the specified iterator definition.
330  void setIteratorDeclaration(unsigned I, Decl *D);
331 
332  /// Sets the location of the assignment symbol for the specified iterator
333  /// definition.
334  void setAssignmentLoc(unsigned I, SourceLocation Loc);
335 
336  /// Sets begin, end and optional step expressions for specified iterator
337  /// definition.
338  void setIteratorRange(unsigned I, Expr *Begin, SourceLocation ColonLoc,
339  Expr *End, SourceLocation SecondColonLoc, Expr *Step);
340 
341  /// Sets helpers for the specified iteration space.
342  void setHelper(unsigned I, const OMPIteratorHelperData &D);
343 
344  unsigned numTrailingObjects(OverloadToken<Decl *>) const {
345  return NumIterators;
346  }
347 
348  unsigned numTrailingObjects(OverloadToken<Expr *>) const {
349  return NumIterators * static_cast<int>(RangeExprOffset::Total);
350  }
351 
352  unsigned numTrailingObjects(OverloadToken<SourceLocation>) const {
353  return NumIterators * static_cast<int>(RangeLocOffset::Total);
354  }
355 
356 public:
357  static OMPIteratorExpr *Create(const ASTContext &Context, QualType T,
358  SourceLocation IteratorKwLoc, SourceLocation L,
359  SourceLocation R,
360  ArrayRef<IteratorDefinition> Data,
361  ArrayRef<OMPIteratorHelperData> Helpers);
362 
363  static OMPIteratorExpr *CreateEmpty(const ASTContext &Context,
364  unsigned NumIterators);
365 
366  SourceLocation getLParenLoc() const { return LPLoc; }
367  void setLParenLoc(SourceLocation L) { LPLoc = L; }
368 
369  SourceLocation getRParenLoc() const { return RPLoc; }
370  void setRParenLoc(SourceLocation L) { RPLoc = L; }
371 
372  SourceLocation getIteratorKwLoc() const { return IteratorKwLoc; }
373  void setIteratorKwLoc(SourceLocation L) { IteratorKwLoc = L; }
374  SourceLocation getBeginLoc() const LLVM_READONLY { return IteratorKwLoc; }
375  SourceLocation getEndLoc() const LLVM_READONLY { return RPLoc; }
376 
377  /// Gets the iterator declaration for the given iterator.
378  Decl *getIteratorDecl(unsigned I);
379  const Decl *getIteratorDecl(unsigned I) const {
380  return const_cast<OMPIteratorExpr *>(this)->getIteratorDecl(I);
381  }
382 
383  /// Gets the iterator range for the given iterator.
384  IteratorRange getIteratorRange(unsigned I);
385  const IteratorRange getIteratorRange(unsigned I) const {
386  return const_cast<OMPIteratorExpr *>(this)->getIteratorRange(I);
387  }
388 
389  /// Gets the location of '=' for the given iterator definition.
390  SourceLocation getAssignLoc(unsigned I) const;
391  /// Gets the location of the first ':' in the range for the given iterator
392  /// definition.
393  SourceLocation getColonLoc(unsigned I) const;
394  /// Gets the location of the second ':' (if any) in the range for the given
395  /// iteratori definition.
396  SourceLocation getSecondColonLoc(unsigned I) const;
397 
398  /// Returns number of iterator definitions.
399  unsigned numOfIterators() const { return NumIterators; }
400 
401  /// Fetches helper data for the specified iteration space.
402  OMPIteratorHelperData &getHelper(unsigned I);
403  const OMPIteratorHelperData &getHelper(unsigned I) const;
404 
405  static bool classof(const Stmt *T) {
406  return T->getStmtClass() == OMPIteratorExprClass;
407  }
408 
409  // Iterators
411  Stmt **Begin = reinterpret_cast<Stmt **>(getTrailingObjects<Expr *>());
412  return child_range(
413  Begin, Begin + NumIterators * static_cast<int>(RangeExprOffset::Total));
414  }
416  Stmt *const *Begin =
417  reinterpret_cast<Stmt *const *>(getTrailingObjects<Expr *>());
418  return const_child_range(
419  Begin, Begin + NumIterators * static_cast<int>(RangeExprOffset::Total));
420  }
421 };
422 
423 } // end namespace clang
424 
425 #endif
clang::OMPIteratorHelperData::Update
Expr * Update
Update expression for the originally specified iteration variable, calculated as VD = Begin + Counter...
Definition: ExprOpenMP.h:243
clang::OMPIteratorExpr::setLParenLoc
void setLParenLoc(SourceLocation L)
Definition: ExprOpenMP.h:367
clang::OMPIteratorExpr::numOfIterators
unsigned numOfIterators() const
Returns number of iterator definitions.
Definition: ExprOpenMP.h:399
clang::OMPIteratorExpr
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition: ExprOpenMP.h:272
clang::OMPArraySectionExpr::getRBracketLoc
SourceLocation getRBracketLoc() const
Definition: ExprOpenMP.h:124
clang::OMPArraySectionExpr::getBase
const Expr * getBase() const
Definition: ExprOpenMP.h:86
clang::OMPArraySectionExpr::getLowerBound
const Expr * getLowerBound() const
Definition: ExprOpenMP.h:95
clang::OMPArrayShapingExpr::CreateEmpty
static OMPArrayShapingExpr * CreateEmpty(const ASTContext &Context, unsigned NumDims)
Definition: Expr.cpp:4845
clang::OMPArrayShapingExpr::children
const_child_range children() const
Definition: ExprOpenMP.h:226
clang::OMPIteratorHelperData
Helper expressions and declaration for OMPIteratorExpr class for each iteration space.
Definition: ExprOpenMP.h:235
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:88
clang::OMPIteratorExpr::getIteratorRange
IteratorRange getIteratorRange(unsigned I)
Gets the iterator range for the given iterator.
Definition: Expr.cpp:4894
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:673
clang::OMPArraySectionExpr::setColonLocFirst
void setColonLocFirst(SourceLocation L)
Definition: ExprOpenMP.h:119
clang::ExprObjectKind
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
Definition: Specifiers.h:134
clang::Expr::Expr
Expr()=delete
clang::OMPIteratorExpr::CreateEmpty
static OMPIteratorExpr * CreateEmpty(const ASTContext &Context, unsigned NumIterators)
Definition: Expr.cpp:4976
clang::OMPArraySectionExpr::getStride
Expr * getStride()
Get stride of array section.
Definition: ExprOpenMP.h:108
clang::OMPArraySectionExpr::getStride
const Expr * getStride() const
Definition: ExprOpenMP.h:109
clang::OMPIteratorExpr::setRParenLoc
void setRParenLoc(SourceLocation L)
Definition: ExprOpenMP.h:370
clang::OMPArrayShapingExpr::getEndLoc
SourceLocation getEndLoc() const LLVM_READONLY
Definition: ExprOpenMP.h:199
clang::OMPIteratorExpr::Create
static OMPIteratorExpr * Create(const ASTContext &Context, QualType T, SourceLocation IteratorKwLoc, SourceLocation L, SourceLocation R, ArrayRef< IteratorDefinition > Data, ArrayRef< OMPIteratorHelperData > Helpers)
Definition: Expr.cpp:4960
clang::ASTStmtWriter
Definition: ASTWriterStmt.cpp:32
clang::Stmt::EmptyShell
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....
Definition: Stmt.h:1103
clang::OMPArraySectionExpr::setLowerBound
void setLowerBound(Expr *E)
Set lower bound of the array section.
Definition: ExprOpenMP.h:99
clang::OMPArrayShapingExpr::getLParenLoc
SourceLocation getLParenLoc() const
Definition: ExprOpenMP.h:192
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1490
clang::OMPIteratorHelperData::CounterVD
VarDecl * CounterVD
Internal normalized counter.
Definition: ExprOpenMP.h:237
clang::OMPArraySectionExpr::classof
static bool classof(const Stmt *T)
Definition: ExprOpenMP.h:131
clang::OMPIteratorExpr::IteratorDefinition::ColonLoc
SourceLocation ColonLoc
Definition: ExprOpenMP.h:288
clang::OMPIteratorExpr::setIteratorKwLoc
void setIteratorKwLoc(SourceLocation L)
Definition: ExprOpenMP.h:373
clang::OMPArraySectionExpr::getExprLoc
SourceLocation getExprLoc() const LLVM_READONLY
Definition: ExprOpenMP.h:127
clang::OMPIteratorExpr::IteratorRange::Begin
Expr * Begin
Definition: ExprOpenMP.h:279
clang::OMPIteratorHelperData::CounterUpdate
Expr * CounterUpdate
Updater for the internal counter: ++CounterVD;.
Definition: ExprOpenMP.h:245
clang::ASTStmtReader
Definition: ASTReaderStmt.cpp:71
clang::OMPArraySectionExpr::getBaseOriginalType
static QualType getBaseOriginalType(const Expr *Base)
Return original type of the base expression for array section.
Definition: Expr.cpp:4750
clang::OMPIteratorExpr::getIteratorDecl
const Decl * getIteratorDecl(unsigned I) const
Definition: ExprOpenMP.h:379
clang::OMPIteratorExpr::getIteratorDecl
Decl * getIteratorDecl(unsigned I)
Gets the iterator declaration for the given iterator.
Definition: Expr.cpp:4890
clang::Stmt::getEndLoc
SourceLocation getEndLoc() const LLVM_READONLY
Definition: Stmt.cpp:348
clang::OMPIteratorExpr::IteratorDefinition::IteratorDecl
Decl * IteratorDecl
Definition: ExprOpenMP.h:285
Expr.h
clang::VarDecl
Represents a variable declaration or definition.
Definition: Decl.h:876
clang::OMPArraySectionExpr::getLowerBound
Expr * getLowerBound()
Get lower bound of array section.
Definition: ExprOpenMP.h:94
ComputeDependence.h
clang::OMPIteratorExpr::getIteratorKwLoc
SourceLocation getIteratorKwLoc() const
Definition: ExprOpenMP.h:372
clang::OMPArrayShapingExpr::children
child_range children()
Definition: ExprOpenMP.h:222
clang::OMPArraySectionExpr::children
child_range children()
Definition: ExprOpenMP.h:135
clang::OMPArraySectionExpr::OMPArraySectionExpr
OMPArraySectionExpr(Expr *Base, Expr *LowerBound, Expr *Length, Expr *Stride, QualType Type, ExprValueKind VK, ExprObjectKind OK, SourceLocation ColonLocFirst, SourceLocation ColonLocSecond, SourceLocation RBracketLoc)
Definition: ExprOpenMP.h:64
Base
clang::Stmt::child_range
llvm::iterator_range< child_iterator > child_range
Definition: Stmt.h:1247
clang::computeDependence
ExprDependence computeDependence(FullExpr *E)
Definition: ComputeDependence.cpp:24
clang::OMPArraySectionExpr::getLength
const Expr * getLength() const
Definition: ExprOpenMP.h:103
clang::OMPArraySectionExpr::getLength
Expr * getLength()
Get length of array section.
Definition: ExprOpenMP.h:102
clang::OMPArrayShapingExpr
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
Definition: ExprOpenMP.h:146
clang::Stmt::const_child_range
llvm::iterator_range< const_child_iterator > const_child_range
Definition: Stmt.h:1248
clang::OMPArraySectionExpr::children
const_child_range children() const
Definition: ExprOpenMP.h:139
clang::OMPIteratorExpr::IteratorDefinition::AssignmentLoc
SourceLocation AssignmentLoc
Definition: ExprOpenMP.h:287
clang::Stmt::getStmtClass
StmtClass getStmtClass() const
Definition: Stmt.h:1163
clang::OMPIteratorExpr::IteratorRange
Iterator range representation begin:end[:step].
Definition: ExprOpenMP.h:278
clang::OMPArraySectionExpr::setStride
void setStride(Expr *E)
Set length of the array section.
Definition: ExprOpenMP.h:111
clang::OMPIteratorExpr::IteratorRange::Step
Expr * Step
Definition: ExprOpenMP.h:281
clang::OMPArraySectionExpr::setLength
void setLength(Expr *E)
Set length of the array section.
Definition: ExprOpenMP.h:105
clang::OMPIteratorHelperData::Upper
Expr * Upper
Normalized upper bound.
Definition: ExprOpenMP.h:240
clang::OMPIteratorExpr::getSecondColonLoc
SourceLocation getSecondColonLoc(unsigned I) const
Gets the location of the second ':' (if any) in the range for the given iteratori definition.
Definition: Expr.cpp:4923
clang::OMPArrayShapingExpr::getBracketsRanges
ArrayRef< SourceRange > getBracketsRanges() const
Fetches source ranges for the brackets os the array shaping expression.
Definition: ExprOpenMP.h:209
clang::OMPArraySectionExpr::getBase
Expr * getBase()
An array section can be written only as Base[LowerBound:Length].
Definition: ExprOpenMP.h:85
clang::OMPIteratorExpr::children
child_range children()
Definition: ExprOpenMP.h:410
clang::OMPIteratorExpr::getColonLoc
SourceLocation getColonLoc(unsigned I) const
Gets the location of the first ':' in the range for the given iterator definition.
Definition: Expr.cpp:4917
clang::OMPIteratorExpr::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: ExprOpenMP.h:374
clang::Expr::getExprLoc
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Definition: Expr.cpp:229
clang::OMPArrayShapingExpr::getBase
Expr * getBase()
Fetches base expression of array shaping expression.
Definition: ExprOpenMP.h:214
clang::OMPArrayShapingExpr::Create
static OMPArrayShapingExpr * Create(const ASTContext &Context, QualType T, Expr *Op, SourceLocation L, SourceLocation R, ArrayRef< Expr * > Dims, ArrayRef< SourceRange > BracketRanges)
Definition: Expr.cpp:4831
clang::OMPArraySectionExpr::setBase
void setBase(Expr *E)
Set base of the array section.
Definition: ExprOpenMP.h:88
Begin
SourceLocation Begin
Definition: USRLocFinder.cpp:165
llvm::ArrayRef
Definition: LLVM.h:34
clang::OMPArrayShapingExpr::getRParenLoc
SourceLocation getRParenLoc() const
Definition: ExprOpenMP.h:195
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:89
clang::OMPArrayShapingExpr::setRParenLoc
void setRParenLoc(SourceLocation L)
Definition: ExprOpenMP.h:196
clang::OMPArrayShapingExpr::classof
static bool classof(const Stmt *T)
Definition: ExprOpenMP.h:217
clang::ExprValueKind
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
Definition: Specifiers.h:117
clang::OMPIteratorExpr::classof
static bool classof(const Stmt *T)
Definition: ExprOpenMP.h:405
clang::OMPArraySectionExpr::setColonLocSecond
void setColonLocSecond(SourceLocation L)
Definition: ExprOpenMP.h:122
clang::Expr::setDependence
void setDependence(ExprDependence Deps)
Each concrete expr subclass is expected to compute its dependence and call this in the constructor.
Definition: Expr.h:134
clang::OMPArrayShapingExpr::getDimensions
ArrayRef< Expr * > getDimensions() const
Fetches the dimensions for array shaping expression.
Definition: ExprOpenMP.h:204
clang::OMPIteratorExpr::getEndLoc
SourceLocation getEndLoc() const LLVM_READONLY
Definition: ExprOpenMP.h:375
clang::OMPArrayShapingExpr::setLParenLoc
void setLParenLoc(SourceLocation L)
Definition: ExprOpenMP.h:193
clang::OMPArraySectionExpr::OMPArraySectionExpr
OMPArraySectionExpr(EmptyShell Shell)
Create an empty array section expression.
Definition: ExprOpenMP.h:79
clang::OMPArrayShapingExpr::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: ExprOpenMP.h:198
clang::OMPArraySectionExpr
OpenMP 5.0 [2.1.5, Array Sections].
Definition: ExprOpenMP.h:56
clang
Definition: CalledOnceCheck.h:17
clang::Stmt
Stmt - This represents one statement.
Definition: Stmt.h:69
clang::OMPIteratorExpr::getRParenLoc
SourceLocation getRParenLoc() const
Definition: ExprOpenMP.h:369
clang::Stmt::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: Stmt.cpp:336
clang::OMPArraySectionExpr::setRBracketLoc
void setRBracketLoc(SourceLocation L)
Definition: ExprOpenMP.h:125
clang::OMPIteratorExpr::getAssignLoc
SourceLocation getAssignLoc(unsigned I) const
Gets the location of '=' for the given iterator definition.
Definition: Expr.cpp:4911
clang::OMPArraySectionExpr::getEndLoc
SourceLocation getEndLoc() const LLVM_READONLY
Definition: ExprOpenMP.h:116
clang::OMPIteratorExpr::getHelper
OMPIteratorHelperData & getHelper(unsigned I)
Fetches helper data for the specified iteration space.
Definition: Expr.cpp:4933
clang::OMPIteratorExpr::IteratorDefinition
Iterator definition representation.
Definition: ExprOpenMP.h:284
clang::Expr
This represents one expression.
Definition: Expr.h:109
clang::OMPIteratorExpr::children
const_child_range children() const
Definition: ExprOpenMP.h:415
clang::OMPArrayShapingExpr::getBase
const Expr * getBase() const
Definition: ExprOpenMP.h:215
clang::OMPIteratorExpr::IteratorRange::End
Expr * End
Definition: ExprOpenMP.h:280
clang::OMPArraySectionExpr::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: ExprOpenMP.h:113
clang::OMPArraySectionExpr::getColonLocSecond
SourceLocation getColonLocSecond() const
Definition: ExprOpenMP.h:121
clang::OMPIteratorExpr::getLParenLoc
SourceLocation getLParenLoc() const
Definition: ExprOpenMP.h:366
clang::OMPIteratorExpr::IteratorDefinition::SecondColonLoc
SourceLocation SecondColonLoc
Definition: ExprOpenMP.h:288
clang::OMPIteratorExpr::getIteratorRange
const IteratorRange getIteratorRange(unsigned I) const
Definition: ExprOpenMP.h:385
clang::OMPIteratorExpr::IteratorDefinition::Range
IteratorRange Range
Definition: ExprOpenMP.h:286
clang::OMPArraySectionExpr::getColonLocFirst
SourceLocation getColonLocFirst() const
Definition: ExprOpenMP.h:118