clang 20.0.0git
SemaOpenACC.h
Go to the documentation of this file.
1//===----- SemaOpenACC.h - Semantic Analysis for OpenACC constructs -------===//
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/// \file
9/// This file declares semantic analysis for OpenACC constructs and
10/// clauses.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_SEMA_SEMAOPENACC_H
15#define LLVM_CLANG_SEMA_SEMAOPENACC_H
16
17#include "clang/AST/DeclGroup.h"
19#include "clang/Basic/LLVM.h"
23#include "clang/Sema/SemaBase.h"
24#include "llvm/ADT/SmallVector.h"
25#include <cassert>
26#include <optional>
27#include <utility>
28#include <variant>
29
30namespace clang {
31class IdentifierInfo;
32class OpenACCClause;
33
34class SemaOpenACC : public SemaBase {
35private:
36 /// A collection of loop constructs in the compute construct scope that
37 /// haven't had their 'parent' compute construct set yet. Entires will only be
38 /// made to this list in the case where we know the loop isn't an orphan.
39 llvm::SmallVector<OpenACCLoopConstruct *> ParentlessLoopConstructs;
40 /// Whether we are inside of a compute construct, and should add loops to the
41 /// above collection.
42 bool InsideComputeConstruct = false;
43
44public:
45 // Redeclaration of the version in OpenACCClause.h.
46 using DeviceTypeArgument = std::pair<IdentifierInfo *, SourceLocation>;
47
48 /// A type to represent all the data for an OpenACC Clause that has been
49 /// parsed, but not yet created/semantically analyzed. This is effectively a
50 /// discriminated union on the 'Clause Kind', with all of the individual
51 /// clause details stored in a std::variant.
54 OpenACCClauseKind ClauseKind;
55 SourceRange ClauseRange;
56 SourceLocation LParenLoc;
57
58 struct DefaultDetails {
59 OpenACCDefaultClauseKind DefaultClauseKind;
60 };
61
62 struct ConditionDetails {
63 Expr *ConditionExpr;
64 };
65
66 struct IntExprDetails {
67 SmallVector<Expr *> IntExprs;
68 };
69
70 struct VarListDetails {
71 SmallVector<Expr *> VarList;
72 bool IsReadOnly;
73 bool IsZero;
74 };
75
76 struct WaitDetails {
77 Expr *DevNumExpr;
78 SourceLocation QueuesLoc;
79 SmallVector<Expr *> QueueIdExprs;
80 };
81
82 struct DeviceTypeDetails {
84 };
85 struct ReductionDetails {
87 SmallVector<Expr *> VarList;
88 };
89
90 std::variant<std::monostate, DefaultDetails, ConditionDetails,
91 IntExprDetails, VarListDetails, WaitDetails, DeviceTypeDetails,
92 ReductionDetails>
93 Details = std::monostate{};
94
95 public:
97 OpenACCClauseKind ClauseKind, SourceLocation BeginLoc)
98 : DirKind(DirKind), ClauseKind(ClauseKind), ClauseRange(BeginLoc, {}) {}
99
100 OpenACCDirectiveKind getDirectiveKind() const { return DirKind; }
101
102 OpenACCClauseKind getClauseKind() const { return ClauseKind; }
103
104 SourceLocation getBeginLoc() const { return ClauseRange.getBegin(); }
105
106 SourceLocation getLParenLoc() const { return LParenLoc; }
107
108 SourceLocation getEndLoc() const { return ClauseRange.getEnd(); }
109
111 assert(ClauseKind == OpenACCClauseKind::Default &&
112 "Parsed clause is not a default clause");
113 return std::get<DefaultDetails>(Details).DefaultClauseKind;
114 }
115
116 const Expr *getConditionExpr() const {
117 return const_cast<OpenACCParsedClause *>(this)->getConditionExpr();
118 }
119
121 assert((ClauseKind == OpenACCClauseKind::If ||
122 (ClauseKind == OpenACCClauseKind::Self &&
123 DirKind != OpenACCDirectiveKind::Update)) &&
124 "Parsed clause kind does not have a condition expr");
125
126 // 'self' has an optional ConditionExpr, so be tolerant of that. This will
127 // assert in variant otherwise.
128 if (ClauseKind == OpenACCClauseKind::Self &&
129 std::holds_alternative<std::monostate>(Details))
130 return nullptr;
131
132 return std::get<ConditionDetails>(Details).ConditionExpr;
133 }
134
135 unsigned getNumIntExprs() const {
136 assert((ClauseKind == OpenACCClauseKind::NumGangs ||
137 ClauseKind == OpenACCClauseKind::NumWorkers ||
138 ClauseKind == OpenACCClauseKind::Async ||
139 ClauseKind == OpenACCClauseKind::VectorLength) &&
140 "Parsed clause kind does not have a int exprs");
141
142 // 'async' and 'wait' have an optional IntExpr, so be tolerant of that.
143 if ((ClauseKind == OpenACCClauseKind::Async ||
144 ClauseKind == OpenACCClauseKind::Wait) &&
145 std::holds_alternative<std::monostate>(Details))
146 return 0;
147 return std::get<IntExprDetails>(Details).IntExprs.size();
148 }
149
151 assert(ClauseKind == OpenACCClauseKind::Wait &&
152 "Parsed clause kind does not have a queues location");
153
154 if (std::holds_alternative<std::monostate>(Details))
155 return SourceLocation{};
156
157 return std::get<WaitDetails>(Details).QueuesLoc;
158 }
159
161 assert(ClauseKind == OpenACCClauseKind::Wait &&
162 "Parsed clause kind does not have a device number expr");
163
164 if (std::holds_alternative<std::monostate>(Details))
165 return nullptr;
166
167 return std::get<WaitDetails>(Details).DevNumExpr;
168 }
169
171 assert(ClauseKind == OpenACCClauseKind::Wait &&
172 "Parsed clause kind does not have a queue id expr list");
173
174 if (std::holds_alternative<std::monostate>(Details))
175 return ArrayRef<Expr *>{std::nullopt};
176
177 return std::get<WaitDetails>(Details).QueueIdExprs;
178 }
179
181 assert((ClauseKind == OpenACCClauseKind::NumGangs ||
182 ClauseKind == OpenACCClauseKind::NumWorkers ||
183 ClauseKind == OpenACCClauseKind::Async ||
184 ClauseKind == OpenACCClauseKind::VectorLength) &&
185 "Parsed clause kind does not have a int exprs");
186
187 return std::get<IntExprDetails>(Details).IntExprs;
188 }
189
191 return const_cast<OpenACCParsedClause *>(this)->getIntExprs();
192 }
193
195 return std::get<ReductionDetails>(Details).Op;
196 }
197
199 assert((ClauseKind == OpenACCClauseKind::Private ||
200 ClauseKind == OpenACCClauseKind::NoCreate ||
201 ClauseKind == OpenACCClauseKind::Present ||
202 ClauseKind == OpenACCClauseKind::Copy ||
203 ClauseKind == OpenACCClauseKind::PCopy ||
204 ClauseKind == OpenACCClauseKind::PresentOrCopy ||
205 ClauseKind == OpenACCClauseKind::CopyIn ||
206 ClauseKind == OpenACCClauseKind::PCopyIn ||
208 ClauseKind == OpenACCClauseKind::CopyOut ||
209 ClauseKind == OpenACCClauseKind::PCopyOut ||
211 ClauseKind == OpenACCClauseKind::Create ||
212 ClauseKind == OpenACCClauseKind::PCreate ||
214 ClauseKind == OpenACCClauseKind::Attach ||
215 ClauseKind == OpenACCClauseKind::DevicePtr ||
216 ClauseKind == OpenACCClauseKind::Reduction ||
217 ClauseKind == OpenACCClauseKind::FirstPrivate) &&
218 "Parsed clause kind does not have a var-list");
219
220 if (ClauseKind == OpenACCClauseKind::Reduction)
221 return std::get<ReductionDetails>(Details).VarList;
222
223 return std::get<VarListDetails>(Details).VarList;
224 }
225
227 return const_cast<OpenACCParsedClause *>(this)->getVarList();
228 }
229
230 bool isReadOnly() const {
231 assert((ClauseKind == OpenACCClauseKind::CopyIn ||
232 ClauseKind == OpenACCClauseKind::PCopyIn ||
233 ClauseKind == OpenACCClauseKind::PresentOrCopyIn) &&
234 "Only copyin accepts 'readonly:' tag");
235 return std::get<VarListDetails>(Details).IsReadOnly;
236 }
237
238 bool isZero() const {
239 assert((ClauseKind == OpenACCClauseKind::CopyOut ||
240 ClauseKind == OpenACCClauseKind::PCopyOut ||
242 ClauseKind == OpenACCClauseKind::Create ||
243 ClauseKind == OpenACCClauseKind::PCreate ||
244 ClauseKind == OpenACCClauseKind::PresentOrCreate) &&
245 "Only copyout/create accepts 'zero' tag");
246 return std::get<VarListDetails>(Details).IsZero;
247 }
248
250 assert((ClauseKind == OpenACCClauseKind::DeviceType ||
251 ClauseKind == OpenACCClauseKind::DType) &&
252 "Only 'device_type'/'dtype' has a device-type-arg list");
253 return std::get<DeviceTypeDetails>(Details).Archs;
254 }
255
256 void setLParenLoc(SourceLocation EndLoc) { LParenLoc = EndLoc; }
257 void setEndLoc(SourceLocation EndLoc) { ClauseRange.setEnd(EndLoc); }
258
260 assert(ClauseKind == OpenACCClauseKind::Default &&
261 "Parsed clause is not a default clause");
262 Details = DefaultDetails{DefKind};
263 }
264
265 void setConditionDetails(Expr *ConditionExpr) {
266 assert((ClauseKind == OpenACCClauseKind::If ||
267 (ClauseKind == OpenACCClauseKind::Self &&
268 DirKind != OpenACCDirectiveKind::Update)) &&
269 "Parsed clause kind does not have a condition expr");
270 // In C++ we can count on this being a 'bool', but in C this gets left as
271 // some sort of scalar that codegen will have to take care of converting.
272 assert((!ConditionExpr || ConditionExpr->isInstantiationDependent() ||
273 ConditionExpr->getType()->isScalarType()) &&
274 "Condition expression type not scalar/dependent");
275
276 Details = ConditionDetails{ConditionExpr};
277 }
278
280 assert((ClauseKind == OpenACCClauseKind::NumGangs ||
281 ClauseKind == OpenACCClauseKind::NumWorkers ||
282 ClauseKind == OpenACCClauseKind::Async ||
283 ClauseKind == OpenACCClauseKind::VectorLength) &&
284 "Parsed clause kind does not have a int exprs");
285 Details = IntExprDetails{{IntExprs.begin(), IntExprs.end()}};
286 }
288 assert((ClauseKind == OpenACCClauseKind::NumGangs ||
289 ClauseKind == OpenACCClauseKind::NumWorkers ||
290 ClauseKind == OpenACCClauseKind::Async ||
291 ClauseKind == OpenACCClauseKind::VectorLength) &&
292 "Parsed clause kind does not have a int exprs");
293 Details = IntExprDetails{std::move(IntExprs)};
294 }
295
296 void setVarListDetails(ArrayRef<Expr *> VarList, bool IsReadOnly,
297 bool IsZero) {
298 assert((ClauseKind == OpenACCClauseKind::Private ||
299 ClauseKind == OpenACCClauseKind::NoCreate ||
300 ClauseKind == OpenACCClauseKind::Present ||
301 ClauseKind == OpenACCClauseKind::Copy ||
302 ClauseKind == OpenACCClauseKind::PCopy ||
303 ClauseKind == OpenACCClauseKind::PresentOrCopy ||
304 ClauseKind == OpenACCClauseKind::CopyIn ||
305 ClauseKind == OpenACCClauseKind::PCopyIn ||
307 ClauseKind == OpenACCClauseKind::CopyOut ||
308 ClauseKind == OpenACCClauseKind::PCopyOut ||
310 ClauseKind == OpenACCClauseKind::Create ||
311 ClauseKind == OpenACCClauseKind::PCreate ||
313 ClauseKind == OpenACCClauseKind::Attach ||
314 ClauseKind == OpenACCClauseKind::DevicePtr ||
315 ClauseKind == OpenACCClauseKind::FirstPrivate) &&
316 "Parsed clause kind does not have a var-list");
317 assert((!IsReadOnly || ClauseKind == OpenACCClauseKind::CopyIn ||
318 ClauseKind == OpenACCClauseKind::PCopyIn ||
319 ClauseKind == OpenACCClauseKind::PresentOrCopyIn) &&
320 "readonly: tag only valid on copyin");
321 assert((!IsZero || ClauseKind == OpenACCClauseKind::CopyOut ||
322 ClauseKind == OpenACCClauseKind::PCopyOut ||
324 ClauseKind == OpenACCClauseKind::Create ||
325 ClauseKind == OpenACCClauseKind::PCreate ||
326 ClauseKind == OpenACCClauseKind::PresentOrCreate) &&
327 "zero: tag only valid on copyout/create");
328 Details =
329 VarListDetails{{VarList.begin(), VarList.end()}, IsReadOnly, IsZero};
330 }
331
332 void setVarListDetails(llvm::SmallVector<Expr *> &&VarList, bool IsReadOnly,
333 bool IsZero) {
334 assert((ClauseKind == OpenACCClauseKind::Private ||
335 ClauseKind == OpenACCClauseKind::NoCreate ||
336 ClauseKind == OpenACCClauseKind::Present ||
337 ClauseKind == OpenACCClauseKind::Copy ||
338 ClauseKind == OpenACCClauseKind::PCopy ||
339 ClauseKind == OpenACCClauseKind::PresentOrCopy ||
340 ClauseKind == OpenACCClauseKind::CopyIn ||
341 ClauseKind == OpenACCClauseKind::PCopyIn ||
343 ClauseKind == OpenACCClauseKind::CopyOut ||
344 ClauseKind == OpenACCClauseKind::PCopyOut ||
346 ClauseKind == OpenACCClauseKind::Create ||
347 ClauseKind == OpenACCClauseKind::PCreate ||
349 ClauseKind == OpenACCClauseKind::Attach ||
350 ClauseKind == OpenACCClauseKind::DevicePtr ||
351 ClauseKind == OpenACCClauseKind::FirstPrivate) &&
352 "Parsed clause kind does not have a var-list");
353 assert((!IsReadOnly || ClauseKind == OpenACCClauseKind::CopyIn ||
354 ClauseKind == OpenACCClauseKind::PCopyIn ||
355 ClauseKind == OpenACCClauseKind::PresentOrCopyIn) &&
356 "readonly: tag only valid on copyin");
357 assert((!IsZero || ClauseKind == OpenACCClauseKind::CopyOut ||
358 ClauseKind == OpenACCClauseKind::PCopyOut ||
360 ClauseKind == OpenACCClauseKind::Create ||
361 ClauseKind == OpenACCClauseKind::PCreate ||
362 ClauseKind == OpenACCClauseKind::PresentOrCreate) &&
363 "zero: tag only valid on copyout/create");
364 Details = VarListDetails{std::move(VarList), IsReadOnly, IsZero};
365 }
366
368 llvm::SmallVector<Expr *> &&VarList) {
369 assert(ClauseKind == OpenACCClauseKind::Reduction &&
370 "reduction details only valid on reduction");
371 Details = ReductionDetails{Op, std::move(VarList)};
372 }
373
374 void setWaitDetails(Expr *DevNum, SourceLocation QueuesLoc,
375 llvm::SmallVector<Expr *> &&IntExprs) {
376 assert(ClauseKind == OpenACCClauseKind::Wait &&
377 "Parsed clause kind does not have a wait-details");
378 Details = WaitDetails{DevNum, QueuesLoc, std::move(IntExprs)};
379 }
380
382 assert((ClauseKind == OpenACCClauseKind::DeviceType ||
383 ClauseKind == OpenACCClauseKind::DType) &&
384 "Only 'device_type'/'dtype' has a device-type-arg list");
385 Details = DeviceTypeDetails{std::move(Archs)};
386 }
387 };
388
389 SemaOpenACC(Sema &S);
390
391 /// Called after parsing an OpenACC Clause so that it can be checked.
393 OpenACCParsedClause &Clause);
394
395 /// Called after the construct has been parsed, but clauses haven't been
396 /// parsed. This allows us to diagnose not-implemented, as well as set up any
397 /// state required for parsing the clauses.
399
400 /// Called after the directive, including its clauses, have been parsed and
401 /// parsing has consumed the 'annot_pragma_openacc_end' token. This DOES
402 /// happen before any associated declarations or statements have been parsed.
403 /// This function is only called when we are parsing a 'statement' context.
405
406 /// Called after the directive, including its clauses, have been parsed and
407 /// parsing has consumed the 'annot_pragma_openacc_end' token. This DOES
408 /// happen before any associated declarations or statements have been parsed.
409 /// This function is only called when we are parsing a 'Decl' context.
411 /// Called when we encounter an associated statement for our construct, this
412 /// should check legality of the statement as it appertains to this Construct.
414 OpenACCDirectiveKind K, StmtResult AssocStmt);
415
416 /// Called after the directive has been completely parsed, including the
417 /// declaration group or associated statement.
419 SourceLocation StartLoc,
420 SourceLocation DirLoc,
421 SourceLocation EndLoc,
423 StmtResult AssocStmt);
424
425 /// Called after the directive has been completely parsed, including the
426 /// declaration group or associated statement.
428
429 /// Called when encountering an 'int-expr' for OpenACC, and manages
430 /// conversions and diagnostics to 'int'.
432 SourceLocation Loc, Expr *IntExpr);
433
434 /// Called when encountering a 'var' for OpenACC, ensures it is actually a
435 /// declaration reference to a variable of the correct type.
437
438 /// Called while semantically analyzing the reduction clause, ensuring the var
439 /// is the correct kind of reference.
441
442 /// Called to check the 'var' type is a variable of pointer type, necessary
443 /// for 'deviceptr' and 'attach' clauses. Returns true on success.
444 bool CheckVarIsPointerType(OpenACCClauseKind ClauseKind, Expr *VarExpr);
445
446 /// Checks and creates an Array Section used in an OpenACC construct/clause.
448 Expr *LowerBound,
449 SourceLocation ColonLocFirst, Expr *Length,
450 SourceLocation RBLoc);
451
452 /// Helper type for the registration/assignment of constructs that need to
453 /// 'know' about their parent constructs and hold a reference to them, such as
454 /// Loop needing its parent construct.
456 SemaOpenACC &SemaRef;
457 bool WasInsideComputeConstruct;
458 OpenACCDirectiveKind DirKind;
459 llvm::SmallVector<OpenACCLoopConstruct *> ParentlessLoopConstructs;
460
461 public:
464 };
465};
466
467} // namespace clang
468
469#endif // LLVM_CLANG_SEMA_SEMAOPENACC_H
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines some OpenACC-specific enums and functions.
SourceLocation Loc
Definition: SemaObjC.cpp:759
Defines the clang::SourceLocation class and associated facilities.
This file defines OpenACC AST classes for statement-level contructs.
This represents one expression.
Definition: Expr.h:110
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
Definition: Expr.h:221
QualType getType() const
Definition: Expr.h:142
This is the base type for all OpenACC Clauses.
Definition: OpenACCClause.h:24
Helper type for the registration/assignment of constructs that need to 'know' about their parent cons...
Definition: SemaOpenACC.h:455
A type to represent all the data for an OpenACC Clause that has been parsed, but not yet created/sema...
Definition: SemaOpenACC.h:52
ArrayRef< Expr * > getQueueIdExprs() const
Definition: SemaOpenACC.h:170
OpenACCDirectiveKind getDirectiveKind() const
Definition: SemaOpenACC.h:100
OpenACCParsedClause(OpenACCDirectiveKind DirKind, OpenACCClauseKind ClauseKind, SourceLocation BeginLoc)
Definition: SemaOpenACC.h:96
OpenACCReductionOperator getReductionOp() const
Definition: SemaOpenACC.h:194
void setLParenLoc(SourceLocation EndLoc)
Definition: SemaOpenACC.h:256
void setConditionDetails(Expr *ConditionExpr)
Definition: SemaOpenACC.h:265
OpenACCClauseKind getClauseKind() const
Definition: SemaOpenACC.h:102
SourceLocation getLParenLoc() const
Definition: SemaOpenACC.h:106
ArrayRef< DeviceTypeArgument > getDeviceTypeArchitectures() const
Definition: SemaOpenACC.h:249
void setIntExprDetails(llvm::SmallVector< Expr * > &&IntExprs)
Definition: SemaOpenACC.h:287
void setReductionDetails(OpenACCReductionOperator Op, llvm::SmallVector< Expr * > &&VarList)
Definition: SemaOpenACC.h:367
ArrayRef< Expr * > getVarList() const
Definition: SemaOpenACC.h:226
SourceLocation getBeginLoc() const
Definition: SemaOpenACC.h:104
void setDefaultDetails(OpenACCDefaultClauseKind DefKind)
Definition: SemaOpenACC.h:259
SourceLocation getQueuesLoc() const
Definition: SemaOpenACC.h:150
void setVarListDetails(llvm::SmallVector< Expr * > &&VarList, bool IsReadOnly, bool IsZero)
Definition: SemaOpenACC.h:332
void setVarListDetails(ArrayRef< Expr * > VarList, bool IsReadOnly, bool IsZero)
Definition: SemaOpenACC.h:296
void setWaitDetails(Expr *DevNum, SourceLocation QueuesLoc, llvm::SmallVector< Expr * > &&IntExprs)
Definition: SemaOpenACC.h:374
void setEndLoc(SourceLocation EndLoc)
Definition: SemaOpenACC.h:257
ArrayRef< Expr * > getIntExprs() const
Definition: SemaOpenACC.h:190
void setIntExprDetails(ArrayRef< Expr * > IntExprs)
Definition: SemaOpenACC.h:279
void setDeviceTypeDetails(llvm::SmallVector< DeviceTypeArgument > &&Archs)
Definition: SemaOpenACC.h:381
OpenACCDefaultClauseKind getDefaultClauseKind() const
Definition: SemaOpenACC.h:110
ExprResult ActOnVar(OpenACCClauseKind CK, Expr *VarExpr)
Called when encountering a 'var' for OpenACC, ensures it is actually a declaration reference to a var...
ExprResult ActOnIntExpr(OpenACCDirectiveKind DK, OpenACCClauseKind CK, SourceLocation Loc, Expr *IntExpr)
Called when encountering an 'int-expr' for OpenACC, and manages conversions and diagnostics to 'int'.
OpenACCClause * ActOnClause(ArrayRef< const OpenACCClause * > ExistingClauses, OpenACCParsedClause &Clause)
Called after parsing an OpenACC Clause so that it can be checked.
bool ActOnStartDeclDirective(OpenACCDirectiveKind K, SourceLocation StartLoc)
Called after the directive, including its clauses, have been parsed and parsing has consumed the 'ann...
bool CheckVarIsPointerType(OpenACCClauseKind ClauseKind, Expr *VarExpr)
Called to check the 'var' type is a variable of pointer type, necessary for 'deviceptr' and 'attach' ...
StmtResult ActOnAssociatedStmt(SourceLocation DirectiveLoc, OpenACCDirectiveKind K, StmtResult AssocStmt)
Called when we encounter an associated statement for our construct, this should check legality of the...
StmtResult ActOnEndStmtDirective(OpenACCDirectiveKind K, SourceLocation StartLoc, SourceLocation DirLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses, StmtResult AssocStmt)
Called after the directive has been completely parsed, including the declaration group or associated ...
bool ActOnStartStmtDirective(OpenACCDirectiveKind K, SourceLocation StartLoc)
Called after the directive, including its clauses, have been parsed and parsing has consumed the 'ann...
DeclGroupRef ActOnEndDeclDirective()
Called after the directive has been completely parsed, including the declaration group or associated ...
std::pair< IdentifierInfo *, SourceLocation > DeviceTypeArgument
Definition: SemaOpenACC.h:46
ExprResult CheckReductionVar(Expr *VarExpr)
Called while semantically analyzing the reduction clause, ensuring the var is the correct kind of ref...
void ActOnConstruct(OpenACCDirectiveKind K, SourceLocation DirLoc)
Called after the construct has been parsed, but clauses haven't been parsed.
ExprResult ActOnArraySectionExpr(Expr *Base, SourceLocation LBLoc, Expr *LowerBound, SourceLocation ColonLocFirst, Expr *Length, SourceLocation RBLoc)
Checks and creates an Array Section used in an OpenACC construct/clause.
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:493
Encodes a location in the source.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
void setEnd(SourceLocation e)
bool isScalarType() const
Definition: Type.h:8423
The JSON file list parser is used to communicate input to InstallAPI.
OpenACCClauseKind
Represents the kind of an OpenACC clause.
Definition: OpenACCKinds.h:164
@ Wait
'wait' clause, allowed on Compute, Data, 'update', and Combined constructs.
@ DevicePtr
'deviceptr' clause, allowed on Compute and Combined Constructs, plus 'data' and 'declare'.
@ PCopyOut
'copyout' clause alias 'pcopyout'. Preserved for diagnostic purposes.
@ VectorLength
'vector_length' clause, allowed on 'parallel', 'kernels', 'parallel loop', and 'kernels loop' constru...
@ Async
'async' clause, allowed on Compute, Data, 'update', 'wait', and Combined constructs.
@ PresentOrCreate
'create' clause alias 'present_or_create'.
@ PresentOrCopy
'copy' clause alias 'present_or_copy'. Preserved for diagnostic purposes.
@ Private
'private' clause, allowed on 'parallel', 'serial', 'loop', 'parallel loop', and 'serial loop' constru...
@ Copy
'copy' clause, allowed on Compute and Combined Constructs, plus 'data' and 'declare'.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
@ DeviceType
'device_type' clause, allowed on Compute, 'data', 'init', 'shutdown', 'set', update',...
@ Attach
'attach' clause, allowed on Compute and Combined constructs, plus 'data' and 'enter data'.
@ NumGangs
'num_gangs' clause, allowed on 'parallel', 'kernels', parallel loop', and 'kernels loop' constructs.
@ If
'if' clause, allowed on all the Compute Constructs, Data Constructs, Executable Constructs,...
@ Default
'default' clause, allowed on parallel, serial, kernel (and compound) constructs.
@ NoCreate
'no_create' clause, allowed on allowed on Compute and Combined constructs, plus 'data'.
@ PresentOrCopyOut
'copyout' clause alias 'present_or_copyout'.
@ Reduction
'reduction' clause, allowed on Parallel, Serial, Loop, and the combined constructs.
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
@ CopyOut
'copyout' clause, allowed on Compute and Combined constructs, plus 'data', 'exit data',...
@ FirstPrivate
'firstprivate' clause, allowed on 'parallel', 'serial', 'parallel loop', and 'serial loop' constructs...
@ PCopy
'copy' clause alias 'pcopy'. Preserved for diagnostic purposes.
@ PCopyIn
'copyin' clause alias 'pcopyin'. Preserved for diagnostic purposes.
@ PCreate
'create' clause alias 'pcreate'. Preserved for diagnostic purposes.
@ Present
'present' clause, allowed on Compute and Combined constructs, plus 'data' and 'declare'.
@ DType
'dtype' clause, an alias for 'device_type', stored separately for diagnostic purposes.
@ CopyIn
'copyin' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
@ NumWorkers
'num_workers' clause, allowed on 'parallel', 'kernels', parallel loop', and 'kernels loop' constructs...
@ PresentOrCopyIn
'copyin' clause alias 'present_or_copyin'.
OpenACCDefaultClauseKind
Definition: OpenACCKinds.h:462
OpenACCDirectiveKind
Definition: OpenACCKinds.h:25
OpenACCReductionOperator
Definition: OpenACCKinds.h:495