clang: lib/AST/DeclOpenMP.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
19
20using namespace clang;
21
22
23
24
25
26void OMPThreadPrivateDecl::anchor() {}
27
32 auto *D = OMPDeclarativeDirective::createDirective(
33 C, DC, {}, VL.size(), L);
34 D->setVars(VL);
35 return D;
36}
37
40 unsigned N) {
41 return OMPDeclarativeDirective::createEmptyDirective(
42 C, ID, 0, N);
43}
44
47 "Number of variables is not the same as the preallocated buffer");
48 llvm::copy(VL, getVars().begin());
49}
50
51
52
53
54
55void OMPAllocateDecl::anchor() { }
56
60 auto *D = OMPDeclarativeDirective::createDirective(
61 C, DC, CL, VL.size(), L);
62 D->setVars(VL);
63 return D;
64}
65
68 unsigned NVars,
69 unsigned NClauses) {
70 return OMPDeclarativeDirective::createEmptyDirective(
72}
73
76 "Number of variables is not the same as the preallocated buffer");
77 llvm::copy(VL, getVars().begin());
78}
79
80
81
82
83
84void OMPRequiresDecl::anchor() {}
85
89 return OMPDeclarativeDirective::createDirective(C, DC, CL, 0,
90 L);
91}
92
95 unsigned N) {
96 return OMPDeclarativeDirective::createEmptyDirective(
98}
99
100
101
102
103
104OMPDeclareReductionDecl::OMPDeclareReductionDecl(
108 PrevDeclInScope(PrevDeclInScope) {
110}
111
112void OMPDeclareReductionDecl::anchor() {}
113
118 T, PrevDeclInScope);
119}
120
125 QualType(), nullptr);
126}
127
129 return cast_or_null(
131}
134 return cast_or_null(
136}
137
138
139
140
141
142void OMPDeclareMapperDecl::anchor() {}
143
148 return OMPDeclarativeDirective::createDirective(
149 C, DC, Clauses, 1, L, Name, T, VarName, PrevDeclInScope);
150}
151
154 unsigned N) {
155 return OMPDeclarativeDirective::createEmptyDirective(
158}
159
161 return cast_or_null(
163}
164
166 return cast_or_null(
168}
169
170
171
172
173
174void OMPCapturedExprDecl::anchor() {}
175
180 C, DC, Id, T, C.getTrivialTypeSourceInfo(T), StartLoc);
181}
182
187}
188
192}
Defines the clang::ASTContext interface.
This file defines OpenMP nodes for declarative directives.
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...
SourceLocation getEndLoc() const LLVM_READONLY
ASTContext & getASTContext() const LLVM_READONLY
The name of a declaration.
SourceLocation getBeginLoc() const LLVM_READONLY
One of these records is kept for each identifier that is lexed.
This represents '#pragma omp allocate ...' directive.
static OMPAllocateDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, ArrayRef< Expr * > VL, ArrayRef< OMPClause * > CL)
static OMPAllocateDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID, unsigned NVars, unsigned NClauses)
Pseudo declaration for capturing expressions.
static OMPCapturedExprDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, QualType T, SourceLocation StartLoc)
static OMPCapturedExprDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
unsigned getNumChildren() const
OMPChildren * Data
Data, associated with the directive.
This represents '#pragma omp declare mapper ...' directive.
static OMPDeclareMapperDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID, unsigned N)
Creates deserialized declare mapper node.
OMPDeclareMapperDecl * getPrevDeclInScope()
Get reference to previous declare mapper construct in the same scope with the same name.
static OMPDeclareMapperDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, QualType T, DeclarationName VarName, ArrayRef< OMPClause * > Clauses, OMPDeclareMapperDecl *PrevDeclInScope)
Creates declare mapper node.
This represents '#pragma omp declare reduction ...' directive.
static OMPDeclareReductionDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, QualType T, OMPDeclareReductionDecl *PrevDeclInScope)
Create declare reduction node.
OMPDeclareReductionDecl * getPrevDeclInScope()
Get reference to previous declare reduction construct in the same scope with the same name.
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.
static OMPRequiresDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, ArrayRef< OMPClause * > CL)
Create requires node.
This represents '#pragma omp threadprivate ...' directive.
static OMPThreadPrivateDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID, unsigned N)
static OMPThreadPrivateDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, ArrayRef< Expr * > VL)
A (possibly-)qualified type.
Encodes a location in the source.
A trivial tuple used to represent a source range.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
const Expr * getInit() const
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
T * get(ExternalASTSource *Source) const
Retrieve the pointer to the AST node that this lazy pointer points to.