14#ifndef LLVM_CLANG_AST_DECLOPENMP_H
15#define LLVM_CLANG_AST_DECLOPENMP_H
23#include "llvm/ADT/ArrayRef.h"
24#include "llvm/Support/TrailingObjects.h"
46 template <
typename... Params>
49 template <
typename T,
typename... Params>
53 auto *Inst =
new (
C, DC,
size(Clauses.size(), NumChildren))
54 T(DC, std::forward<Params>(
P)...);
55 Inst->Data = OMPChildren::Create(Inst + 1, Clauses,
56 nullptr, NumChildren);
57 Inst->Data->setClauses(Clauses);
61 template <
typename T,
typename... Params>
63 unsigned NumClauses,
unsigned NumChildren,
65 auto *Inst =
new (
C,
ID,
size(NumClauses, NumChildren))
66 T(
nullptr, std::forward<Params>(
P)...);
67 Inst->Data = OMPChildren::CreateEmpty(
68 Inst + 1, NumClauses,
false, NumChildren);
72 static size_t size(
unsigned NumClauses,
unsigned NumChildren) {
73 return OMPChildren::size(NumClauses,
false,
113 virtual void anchor();
183 Expr *Combiner =
nullptr;
185 Expr *Initializer =
nullptr;
191 Expr *Priv =
nullptr;
193 Expr *Orig =
nullptr;
200 void anchor()
override;
207 PrevDeclInScope = Prev;
293 Expr *MapperVarRef =
nullptr;
300 void anchor()
override;
307 PrevDeclInScope(PrevDeclInScope) {}
310 PrevDeclInScope = Prev;
315 static OMPDeclareMapperDecl *
Create(ASTContext &
C, DeclContext *DC,
316 SourceLocation L, DeclarationName Name,
317 QualType
T, DeclarationName VarName,
318 ArrayRef<OMPClause *> Clauses,
319 OMPDeclareMapperDecl *PrevDeclInScope);
322 GlobalDeclID
ID,
unsigned N);
328 llvm::iterator_range<clauselist_const_iterator>;
385 void anchor()
override;
390 :
VarDecl(OMPCapturedExpr,
C, DC, StartLoc, StartLoc,
Id,
Type, TInfo,
421 virtual void anchor();
478 virtual void anchor();
488 MutableArrayRef<Expr *> getVars() {
489 auto **Storage =
reinterpret_cast<Expr **
>(
Data->
getChildren().data());
493 void setVars(ArrayRef<Expr *> VL);
496 static OMPAllocateDecl *
Create(ASTContext &
C, DeclContext *DC,
497 SourceLocation L, ArrayRef<Expr *> VL,
498 ArrayRef<OMPClause *> CL);
500 unsigned NVars,
unsigned NClauses);
Defines the clang::ASTContext interface.
enum clang::sema::@1653::IndirectLocalPathEntry::EntryKind Kind
This file defines OpenMP AST classes for clauses.
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
OMPDeclareReductionDeclBitfields OMPDeclareReductionDeclBits
Decl - This represents one declaration (or definition), e.g.
Kind
Lists the kind of concrete classes of Decl.
void setImplicit(bool I=true)
The name of a declaration.
This represents one expression.
One of these records is kept for each identifier that is lexed.
This represents '#pragma omp allocate ...' directive.
llvm::iterator_range< clauselist_iterator > clauselist_range
clauselist_iterator clauselist_end()
static OMPAllocateDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID, unsigned NVars, unsigned NClauses)
MutableArrayRef< OMPClause * >::iterator clauselist_iterator
clauselist_iterator clauselist_begin()
static bool classofKind(Kind K)
bool varlist_empty() const
clauselist_const_iterator clauselist_begin() const
ArrayRef< const OMPClause * >::iterator clauselist_const_iterator
bool clauselist_empty() const
varlist_const_iterator varlist_end() const
varlist_iterator varlist_begin()
llvm::iterator_range< clauselist_const_iterator > clauselist_const_range
MutableArrayRef< Expr * >::iterator varlist_iterator
llvm::iterator_range< varlist_iterator > varlist_range
static bool classof(const Decl *D)
varlist_const_iterator varlist_begin() const
varlist_const_range varlist() const
unsigned varlist_size() const
clauselist_const_iterator clauselist_end() const
clauselist_const_range clauselists() const
clauselist_range clauselists()
unsigned clauselist_size() const
ArrayRef< constExpr * >::iterator varlist_const_iterator
llvm::iterator_range< varlist_const_iterator > varlist_const_range
varlist_iterator varlist_end()
Pseudo declaration for capturing expressions.
static bool classof(const Decl *D)
static bool classofKind(Kind K)
static OMPCapturedExprDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Contains data for OpenMP directives: clauses, children expressions/statements (helpers for codegen) a...
unsigned getNumClauses() const
unsigned getNumChildren() const
MutableArrayRef< OMPClause * > getClauses()
Get the clauses storage.
MutableArrayRef< Stmt * > getChildren()
This is a basic class for representing single OpenMP clause.
This is a basic class for representing single OpenMP declarative directive.
static T * createEmptyDirective(const ASTContext &C, GlobalDeclID ID, unsigned NumClauses, unsigned NumChildren, Params &&... P)
OMPDeclarativeDirective(Params &&... P)
Build instance of directive.
unsigned getNumClauses() const
Get number of clauses.
OMPClause * getClause(unsigned I) const
Returns specified clause.
OMPChildren * Data
Data, associated with the directive.
static size_t size(unsigned NumClauses, unsigned NumChildren)
static T * createDirective(const ASTContext &C, DeclContext *DC, ArrayRef< OMPClause * > Clauses, unsigned NumChildren, Params &&... P)
ArrayRef< OMPClause * > clauses() const
This represents '#pragma omp declare mapper ...' directive.
static OMPDeclareMapperDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID, unsigned N)
Creates deserialized declare mapper node.
ArrayRef< const OMPClause * >::iterator clauselist_const_iterator
const Expr * getMapperVarRef() const
clauselist_const_iterator clauselist_begin() const
void setMapperVarRef(Expr *MapperVarRefE)
Set the variable declared in the mapper.
clauselist_const_iterator clauselist_end() const
OMPDeclareMapperDecl * getPrevDeclInScope()
Get reference to previous declare mapper construct in the same scope with the same name.
unsigned clauselist_size() const
clauselist_iterator clauselist_begin()
clauselist_range clauselists()
DeclarationName getVarName()
Get the name of the variable declared in the mapper.
static DeclContext * castToDeclContext(const OMPDeclareMapperDecl *D)
clauselist_const_range clauselists() const
MutableArrayRef< OMPClause * >::iterator clauselist_iterator
static OMPDeclareMapperDecl * castFromDeclContext(const DeclContext *DC)
static bool classofKind(Kind K)
bool clauselist_empty() const
llvm::iterator_range< clauselist_const_iterator > clauselist_const_range
Expr * getMapperVarRef()
Get the variable declared in the mapper.
llvm::iterator_range< clauselist_iterator > clauselist_range
static bool classof(const Decl *D)
clauselist_iterator clauselist_end()
This represents '#pragma omp declare reduction ...' directive.
Expr * getInitializer()
Get initializer expression (if specified) of the declare reduction construct.
void setInitializerData(Expr *OrigE, Expr *PrivE)
Set initializer Orig and Priv vars.
void setInitializer(Expr *E, OMPDeclareReductionInitKind IK)
Set initializer expression for the declare reduction construct.
Expr * getInitPriv()
Get Priv variable of the initializer.
const Expr * getCombinerIn() const
Expr * getCombinerOut()
Get Out variable of the combiner.
const Expr * getCombiner() const
void setCombiner(Expr *E)
Set combiner expression for the declare reduction construct.
Expr * getCombinerIn()
Get In variable of the combiner.
const Expr * getInitOrig() const
Expr * getCombiner()
Get combiner expression of the declare reduction construct.
static bool classofKind(Kind K)
void setCombinerData(Expr *InE, Expr *OutE)
Set combiner In and Out vars.
static DeclContext * castToDeclContext(const OMPDeclareReductionDecl *D)
const Expr * getInitializer() const
OMPDeclareReductionDecl * getPrevDeclInScope()
Get reference to previous declare reduction construct in the same scope with the same name.
Expr * getInitOrig()
Get Orig variable of the initializer.
static OMPDeclareReductionDecl * castFromDeclContext(const DeclContext *DC)
OMPDeclareReductionInitKind getInitializerKind() const
Get initializer kind.
static bool classof(const Decl *D)
const Expr * getInitPriv() const
const Expr * getCombinerOut() const
static OMPDeclareReductionDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
Create deserialized declare reduction node.
This represents '#pragma omp requires...' directive.
static OMPRequiresDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID, unsigned N)
Create deserialized requires node.
clauselist_iterator clauselist_begin()
ArrayRef< const OMPClause * >::iterator clauselist_const_iterator
MutableArrayRef< OMPClause * >::iterator clauselist_iterator
clauselist_range clauselists()
clauselist_const_range clauselists() const
bool clauselist_empty() const
clauselist_const_iterator clauselist_begin() const
llvm::iterator_range< clauselist_iterator > clauselist_range
llvm::iterator_range< clauselist_const_iterator > clauselist_const_range
static bool classof(const Decl *D)
unsigned clauselist_size() const
clauselist_iterator clauselist_end()
static bool classofKind(Kind K)
clauselist_const_iterator clauselist_end() const
This represents '#pragma omp threadprivate ...' directive.
static OMPThreadPrivateDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID, unsigned N)
MutableArrayRef< Expr * >::iterator varlist_iterator
varlist_const_iterator varlist_begin() const
unsigned varlist_size() const
llvm::iterator_range< varlist_iterator > varlist_range
ArrayRef< constExpr * >::iterator varlist_const_iterator
varlist_const_range varlist() const
varlist_const_iterator varlist_end() const
bool varlist_empty() const
varlist_iterator varlist_end()
static bool classof(const Decl *D)
static bool classofKind(Kind K)
friend class OMPDeclarativeDirective< Decl >
varlist_iterator varlist_begin()
llvm::iterator_range< varlist_const_iterator > varlist_const_range
A (possibly-)qualified type.
Encodes a location in the source.
A trivial tuple used to represent a source range.
A container of type source information.
The base class of the type hierarchy.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
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',...
OMPDeclareReductionInitKind
const FunctionProtoType * T