13#ifndef LLVM_CLANG_AST_EXPROPENMP_H
14#define LLVM_CLANG_AST_EXPROPENMP_H
24 private llvm::TrailingObjects<OMPArrayShapingExpr, Expr *, SourceRange> {
25 friend TrailingObjects;
39 :
Expr(OMPArrayShapingExprClass, Shell), NumDims(NumDims) {}
45 void setBase(
Expr *Op) { getTrailingObjects<Expr *>()[NumDims] = Op; }
48 void setBracketsRanges(ArrayRef<SourceRange> BR);
50 unsigned numTrailingObjects(OverloadToken<Expr *>)
const {
55 unsigned numTrailingObjects(OverloadToken<SourceRange>)
const {
60 static OMPArrayShapingExpr *
Create(
const ASTContext &Context, QualType
T,
61 Expr *Op, SourceLocation L,
62 SourceLocation R, ArrayRef<Expr *> Dims,
63 ArrayRef<SourceRange> BracketRanges);
65 static OMPArrayShapingExpr *
CreateEmpty(
const ASTContext &Context,
90 Expr *
getBase() {
return getTrailingObjects<Expr *>()[NumDims]; }
91 const Expr *
getBase()
const {
return getTrailingObjects<Expr *>()[NumDims]; }
94 return T->getStmtClass() == OMPArrayShapingExprClass;
99 Stmt **
Begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
104 reinterpret_cast<Stmt *
const *
>(getTrailingObjects<Expr *>());
150 private llvm::TrailingObjects<OMPIteratorExpr, Decl *, Expr *,
151 SourceLocation, OMPIteratorHelperData> {
168 friend TrailingObjects;
173 enum class RangeExprOffset {
181 enum class RangeLocOffset {
188 SourceLocation IteratorKwLoc;
190 SourceLocation LPLoc;
192 SourceLocation RPLoc;
194 unsigned NumIterators = 0;
196 OMPIteratorExpr(QualType ExprTy, SourceLocation IteratorKwLoc,
197 SourceLocation L, SourceLocation R,
198 ArrayRef<IteratorDefinition>
Data,
199 ArrayRef<OMPIteratorHelperData> Helpers);
202 explicit OMPIteratorExpr(EmptyShell Shell,
unsigned NumIterators)
203 :
Expr(OMPIteratorExprClass, Shell), NumIterators(NumIterators) {}
206 void setIteratorDeclaration(
unsigned I, Decl *
D);
210 void setAssignmentLoc(
unsigned I, SourceLocation
Loc);
214 void setIteratorRange(
unsigned I,
Expr *
Begin, SourceLocation ColonLoc,
215 Expr *End, SourceLocation SecondColonLoc,
Expr *Step);
218 void setHelper(
unsigned I,
const OMPIteratorHelperData &
D);
220 unsigned numTrailingObjects(OverloadToken<Decl *>)
const {
224 unsigned numTrailingObjects(OverloadToken<Expr *>)
const {
225 return NumIterators *
static_cast<int>(RangeExprOffset::Total);
228 unsigned numTrailingObjects(OverloadToken<SourceLocation>)
const {
229 return NumIterators *
static_cast<int>(RangeLocOffset::Total);
233 static OMPIteratorExpr *
Create(
const ASTContext &Context, QualType
T,
234 SourceLocation IteratorKwLoc, SourceLocation L,
236 ArrayRef<IteratorDefinition>
Data,
237 ArrayRef<OMPIteratorHelperData> Helpers);
239 static OMPIteratorExpr *
CreateEmpty(
const ASTContext &Context,
240 unsigned NumIterators);
282 return T->getStmtClass() == OMPIteratorExprClass;
287 Stmt **
Begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
289 Begin,
Begin + NumIterators *
static_cast<int>(RangeExprOffset::Total));
293 reinterpret_cast<Stmt *
const *
>(getTrailingObjects<Expr *>());
295 Begin,
Begin + NumIterators *
static_cast<int>(RangeExprOffset::Total));
Decl - This represents one declaration (or definition), e.g.
This represents one expression.
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
const_child_range children() const
Expr * getBase()
Fetches base expression of array shaping expression.
void setLParenLoc(SourceLocation L)
SourceLocation getEndLoc() const LLVM_READONLY
static OMPArrayShapingExpr * CreateEmpty(const ASTContext &Context, unsigned NumDims)
SourceLocation getLParenLoc() const
ArrayRef< Expr * > getDimensions() const
Fetches the dimensions for array shaping expression.
SourceLocation getRParenLoc() const
SourceLocation getBeginLoc() const LLVM_READONLY
void setRParenLoc(SourceLocation L)
static bool classof(const Stmt *T)
ArrayRef< SourceRange > getBracketsRanges() const
Fetches source ranges for the brackets os the array shaping expression.
const Expr * getBase() const
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
void setLParenLoc(SourceLocation L)
SourceLocation getLParenLoc() const
static OMPIteratorExpr * CreateEmpty(const ASTContext &Context, unsigned NumIterators)
SourceLocation getSecondColonLoc(unsigned I) const
Gets the location of the second ':' (if any) in the range for the given iteratori definition.
void setRParenLoc(SourceLocation L)
SourceLocation getColonLoc(unsigned I) const
Gets the location of the first ':' in the range for the given iterator definition.
SourceLocation getRParenLoc() const
const IteratorRange getIteratorRange(unsigned I) const
SourceLocation getBeginLoc() const LLVM_READONLY
IteratorRange getIteratorRange(unsigned I)
Gets the iterator range for the given iterator.
const Decl * getIteratorDecl(unsigned I) const
OMPIteratorHelperData & getHelper(unsigned I)
Fetches helper data for the specified iteration space.
const_child_range children() const
void setIteratorKwLoc(SourceLocation L)
SourceLocation getAssignLoc(unsigned I) const
Gets the location of '=' for the given iterator definition.
SourceLocation getIteratorKwLoc() const
unsigned numOfIterators() const
Returns number of iterator definitions.
Decl * getIteratorDecl(unsigned I)
Gets the iterator declaration for the given iterator.
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
A (possibly-)qualified type.
Encodes a location in the source.
Stmt - This represents one statement.
SourceLocation getEndLoc() const LLVM_READONLY
llvm::iterator_range< child_iterator > child_range
llvm::iterator_range< const_child_iterator > const_child_range
Represents a variable declaration or definition.
The JSON file list parser is used to communicate input to InstallAPI.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
const FunctionProtoType * T
Iterator definition representation.
SourceLocation AssignmentLoc
SourceLocation SecondColonLoc
Iterator range representation begin:end[:step].
Helper expressions and declaration for OMPIteratorExpr class for each iteration space.
Expr * CounterUpdate
Updater for the internal counter: ++CounterVD;.
Expr * Upper
Normalized upper bound.
Expr * Update
Update expression for the originally specified iteration variable, calculated as VD = Begin + Counter...
VarDecl * CounterVD
Internal normalized counter.
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....