20 using namespace clang;
26 void OMPThreadPrivateDecl::anchor() { }
33 new (
C, DC, additionalSizeToAlloc<Expr *>(VL.size()))
35 D->NumVars = VL.size();
50 assert(VL.size() == NumVars &&
51 "Number of variables is not the same as the preallocated buffer");
52 std::uninitialized_copy(VL.begin(), VL.end(), getTrailingObjects<Expr *>());
59 void OMPAllocateDecl::anchor() { }
65 C, DC, additionalSizeToAlloc<Expr *, OMPClause *>(VL.size(), CL.size()))
67 D->NumVars = VL.size();
69 D->NumClauses = CL.size();
78 new (
C,
ID, additionalSizeToAlloc<Expr *, OMPClause *>(NVars, NClauses))
81 D->NumClauses = NClauses;
86 assert(VL.size() == NumVars &&
87 "Number of variables is not the same as the preallocated buffer");
88 std::uninitialized_copy(VL.begin(), VL.end(), getTrailingObjects<Expr *>());
92 assert(CL.size() == NumClauses &&
93 "Number of variables is not the same as the preallocated buffer");
94 std::uninitialized_copy(CL.begin(), CL.end(),
95 getTrailingObjects<OMPClause *>());
102 void OMPRequiresDecl::anchor() {}
108 new (
C, DC, additionalSizeToAlloc<OMPClause *>(CL.size()))
110 D->NumClauses = CL.size();
124 assert(CL.size() == NumClauses &&
125 "Number of clauses is not the same as the preallocated buffer");
126 std::uninitialized_copy(CL.begin(), CL.end(),
127 getTrailingObjects<OMPClause *>());
134 OMPDeclareReductionDecl::OMPDeclareReductionDecl(
138 PrevDeclInScope(PrevDeclInScope) {
139 setInitializer(
nullptr, CallInit);
142 void OMPDeclareReductionDecl::anchor() {}
159 return cast_or_null<OMPDeclareReductionDecl>(
164 return cast_or_null<OMPDeclareReductionDecl>(
172 void OMPDeclareMapperDecl::anchor() {}
180 VarName, PrevDeclInScope);
186 auto *D =
new (
C,
ID)
192 D->Clauses = llvm::makeMutableArrayRef<OMPClause *>(ClauseStorage, N);
203 assert(Clauses.empty() &&
"Number of clauses should be 0 on initialization");
204 size_t NumClauses = CL.size();
207 Clauses = llvm::makeMutableArrayRef<OMPClause *>(ClauseStorage, NumClauses);
213 assert(CL.size() == Clauses.size() &&
214 "Number of clauses is not the same as the preallocated buffer");
215 std::uninitialized_copy(CL.begin(), CL.end(), Clauses.data());
219 return cast_or_null<OMPDeclareMapperDecl>(
224 return cast_or_null<OMPDeclareMapperDecl>(
232 void OMPCapturedExprDecl::anchor() {}
Defines the clang::ASTContext interface.
OMPDeclareMapperDecl * getPrevDeclInScope()
Get reference to previous declare mapper construct in the same scope with the same name...
A (possibly-)qualified type.
This represents '#pragma omp allocate ...' directive.
SourceLocation getBeginLoc() const LLVM_READONLY
static OMPDeclareReductionDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, QualType T, OMPDeclareReductionDecl *PrevDeclInScope)
Create declare reduction node.
SourceLocation getEndLoc() const LLVM_READONLY
static OMPDeclareMapperDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned N)
Creates deserialized declare mapper node.
One of these records is kept for each identifier that is lexed.
static OMPThreadPrivateDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned N)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
void CreateClauses(ASTContext &C, ArrayRef< OMPClause *> CL)
Creates an array of clauses to this mapper declaration and intializes them.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
static OMPCapturedExprDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static OMPRequiresDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned N)
Create deserialized requires node.
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location, which defaults to the empty location.
This represents '#pragma omp requires...' directive.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
OMPDeclareReductionDecl * getPrevDeclInScope()
Get reference to previous declare reduction construct in the same scope with the same name...
static OMPAllocateDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned NVars, unsigned NClauses)
Encodes a location in the source.
This represents '#pragma omp declare reduction ...' directive.
Pseudo declaration for capturing expressions.
static OMPAllocateDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, ArrayRef< Expr *> VL, ArrayRef< OMPClause *> CL)
ASTContext & getASTContext() const LLVM_READONLY
This file defines OpenMP nodes for declarative directives.
This is a basic class for representing single OpenMP clause.
void * Allocate(size_t Size, unsigned Align=8) const
static OMPCapturedExprDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, QualType T, SourceLocation StartLoc)
static OMPDeclareMapperDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, QualType T, DeclarationName VarName, OMPDeclareMapperDecl *PrevDeclInScope)
Creates declare mapper node.
Dataflow Directional Tag Classes.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
static OMPThreadPrivateDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, ArrayRef< Expr *> VL)
The name of a declaration.
static OMPRequiresDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, ArrayRef< OMPClause *> CL)
Create requires node.
static OMPDeclareReductionDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Create deserialized declare reduction node.
This represents '#pragma omp declare mapper ...' directive.
Kind
Lists the kind of concrete classes of Decl.
A trivial tuple used to represent a source range.
This represents '#pragma omp threadprivate ...' directive.