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"
22#include "clang/Sema/SemaBase.h"
23#include <variant>
24
25namespace clang {
26class OpenACCClause;
27
28class SemaOpenACC : public SemaBase {
29private:
30 /// A collection of loop constructs in the compute construct scope that
31 /// haven't had their 'parent' compute construct set yet. Entires will only be
32 /// made to this list in the case where we know the loop isn't an orphan.
33 llvm::SmallVector<OpenACCLoopConstruct *> ParentlessLoopConstructs;
34 /// Whether we are inside of a compute construct, and should add loops to the
35 /// above collection.
36 bool InsideComputeConstruct = false;
37
38public:
39 // Redeclaration of the version in OpenACCClause.h.
40 using DeviceTypeArgument = std::pair<IdentifierInfo *, SourceLocation>;
41
42 /// A type to represent all the data for an OpenACC Clause that has been
43 /// parsed, but not yet created/semantically analyzed. This is effectively a
44 /// discriminated union on the 'Clause Kind', with all of the individual
45 /// clause details stored in a std::variant.
48 OpenACCClauseKind ClauseKind;
49 SourceRange ClauseRange;
50 SourceLocation LParenLoc;
51
52 struct DefaultDetails {
53 OpenACCDefaultClauseKind DefaultClauseKind;
54 };
55
56 struct ConditionDetails {
57 Expr *ConditionExpr;
58 };
59
60 struct IntExprDetails {
61 SmallVector<Expr *> IntExprs;
62 };
63
64 struct VarListDetails {
65 SmallVector<Expr *> VarList;
66 bool IsReadOnly;
67 bool IsZero;
68 };
69
70 struct WaitDetails {
71 Expr *DevNumExpr;
72 SourceLocation QueuesLoc;
73 SmallVector<Expr *> QueueIdExprs;
74 };
75
76 struct DeviceTypeDetails {
78 };
79 struct ReductionDetails {
81 SmallVector<Expr *> VarList;
82 };
83
84 std::variant<std::monostate, DefaultDetails, ConditionDetails,
85 IntExprDetails, VarListDetails, WaitDetails, DeviceTypeDetails,
86 ReductionDetails>
87 Details = std::monostate{};
88
89 public:
91 OpenACCClauseKind ClauseKind, SourceLocation BeginLoc)
92 : DirKind(DirKind), ClauseKind(ClauseKind), ClauseRange(BeginLoc, {}) {}
93
94 OpenACCDirectiveKind getDirectiveKind() const { return DirKind; }
95
96 OpenACCClauseKind getClauseKind() const { return ClauseKind; }
97
98 SourceLocation getBeginLoc() const { return ClauseRange.getBegin(); }
99
100 SourceLocation getLParenLoc() const { return LParenLoc; }
101
102 SourceLocation getEndLoc() const { return ClauseRange.getEnd(); }
103
105 assert(ClauseKind == OpenACCClauseKind::Default &&
106 "Parsed clause is not a default clause");
107 return std::get<DefaultDetails>(Details).DefaultClauseKind;
108 }
109
110 const Expr *getConditionExpr() const {
111 return const_cast<OpenACCParsedClause *>(this)->getConditionExpr();
112 }
113
115 assert((ClauseKind == OpenACCClauseKind::If ||
116 (ClauseKind == OpenACCClauseKind::Self &&
117 DirKind != OpenACCDirectiveKind::Update)) &&
118 "Parsed clause kind does not have a condition expr");
119
120 // 'self' has an optional ConditionExpr, so be tolerant of that. This will
121 // assert in variant otherwise.
122 if (ClauseKind == OpenACCClauseKind::Self &&
123 std::holds_alternative<std::monostate>(Details))
124 return nullptr;
125
126 return std::get<ConditionDetails>(Details).ConditionExpr;
127 }
128
129 unsigned getNumIntExprs() const {
130 assert((ClauseKind == OpenACCClauseKind::NumGangs ||
131 ClauseKind == OpenACCClauseKind::NumWorkers ||
132 ClauseKind == OpenACCClauseKind::Async ||
133 ClauseKind == OpenACCClauseKind::VectorLength) &&
134 "Parsed clause kind does not have a int exprs");
135
136 // 'async' and 'wait' have an optional IntExpr, so be tolerant of that.
137 if ((ClauseKind == OpenACCClauseKind::Async ||
138 ClauseKind == OpenACCClauseKind::Wait) &&
139 std::holds_alternative<std::monostate>(Details))
140 return 0;
141 return std::get<IntExprDetails>(Details).IntExprs.size();
142 }
143
145 assert(ClauseKind == OpenACCClauseKind::Wait &&
146 "Parsed clause kind does not have a queues location");
147
148 if (std::holds_alternative<std::monostate>(Details))
149 return SourceLocation{};
150
151 return std::get<WaitDetails>(Details).QueuesLoc;
152 }
153
155 assert(ClauseKind == OpenACCClauseKind::Wait &&
156 "Parsed clause kind does not have a device number expr");
157
158 if (std::holds_alternative<std::monostate>(Details))
159 return nullptr;
160
161 return std::get<WaitDetails>(Details).DevNumExpr;
162 }
163
165 assert(ClauseKind == OpenACCClauseKind::Wait &&
166 "Parsed clause kind does not have a queue id expr list");
167
168 if (std::holds_alternative<std::monostate>(Details))
169 return ArrayRef<Expr *>{std::nullopt};
170
171 return std::get<WaitDetails>(Details).QueueIdExprs;
172 }
173
175 assert((ClauseKind == OpenACCClauseKind::NumGangs ||
176 ClauseKind == OpenACCClauseKind::NumWorkers ||
177 ClauseKind == OpenACCClauseKind::Async ||
178 ClauseKind == OpenACCClauseKind::VectorLength) &&
179 "Parsed clause kind does not have a int exprs");
180
181 return std::get<IntExprDetails>(Details).IntExprs;
182 }
183
185 return const_cast<OpenACCParsedClause *>(this)->getIntExprs();
186 }
187
189 return std::get<ReductionDetails>(Details).Op;
190 }
191
193 assert((ClauseKind == OpenACCClauseKind::Private ||
194 ClauseKind == OpenACCClauseKind::NoCreate ||
195 ClauseKind == OpenACCClauseKind::Present ||
196 ClauseKind == OpenACCClauseKind::Copy ||
197 ClauseKind == OpenACCClauseKind::PCopy ||
198 ClauseKind == OpenACCClauseKind::PresentOrCopy ||
199 ClauseKind == OpenACCClauseKind::CopyIn ||
200 ClauseKind == OpenACCClauseKind::PCopyIn ||
202 ClauseKind == OpenACCClauseKind::CopyOut ||
203 ClauseKind == OpenACCClauseKind::PCopyOut ||
205 ClauseKind == OpenACCClauseKind::Create ||
206 ClauseKind == OpenACCClauseKind::PCreate ||
208 ClauseKind == OpenACCClauseKind::Attach ||
209 ClauseKind == OpenACCClauseKind::DevicePtr ||
210 ClauseKind == OpenACCClauseKind::Reduction ||
211 ClauseKind == OpenACCClauseKind::FirstPrivate) &&
212 "Parsed clause kind does not have a var-list");
213
214 if (ClauseKind == OpenACCClauseKind::Reduction)
215 return std::get<ReductionDetails>(Details).VarList;
216
217 return std::get<VarListDetails>(Details).VarList;
218 }
219
221 return const_cast<OpenACCParsedClause *>(this)->getVarList();
222 }
223
224 bool isReadOnly() const {
225 assert((ClauseKind == OpenACCClauseKind::CopyIn ||
226 ClauseKind == OpenACCClauseKind::PCopyIn ||
227 ClauseKind == OpenACCClauseKind::PresentOrCopyIn) &&
228 "Only copyin accepts 'readonly:' tag");
229 return std::get<VarListDetails>(Details).IsReadOnly;
230 }
231
232 bool isZero() const {
233 assert((ClauseKind == OpenACCClauseKind::CopyOut ||
234 ClauseKind == OpenACCClauseKind::PCopyOut ||
236 ClauseKind == OpenACCClauseKind::Create ||
237 ClauseKind == OpenACCClauseKind::PCreate ||
238 ClauseKind == OpenACCClauseKind::PresentOrCreate) &&
239 "Only copyout/create accepts 'zero' tag");
240 return std::get<VarListDetails>(Details).IsZero;
241 }
242
244 assert((ClauseKind == OpenACCClauseKind::DeviceType ||
245 ClauseKind == OpenACCClauseKind::DType) &&
246 "Only 'device_type'/'dtype' has a device-type-arg list");
247 return std::get<DeviceTypeDetails>(Details).Archs;
248 }
249
250 void setLParenLoc(SourceLocation EndLoc) { LParenLoc = EndLoc; }
251 void setEndLoc(SourceLocation EndLoc) { ClauseRange.setEnd(EndLoc); }
252
254 assert(ClauseKind == OpenACCClauseKind::Default &&
255 "Parsed clause is not a default clause");
256 Details = DefaultDetails{DefKind};
257 }
258
259 void setConditionDetails(Expr *ConditionExpr) {
260 assert((ClauseKind == OpenACCClauseKind::If ||
261 (ClauseKind == OpenACCClauseKind::Self &&
262 DirKind != OpenACCDirectiveKind::Update)) &&
263 "Parsed clause kind does not have a condition expr");
264 // In C++ we can count on this being a 'bool', but in C this gets left as
265 // some sort of scalar that codegen will have to take care of converting.
266 assert((!ConditionExpr || ConditionExpr->isInstantiationDependent() ||
267 ConditionExpr->getType()->isScalarType()) &&
268 "Condition expression type not scalar/dependent");
269
270 Details = ConditionDetails{ConditionExpr};
271 }
272
274 assert((ClauseKind == OpenACCClauseKind::NumGangs ||
275 ClauseKind == OpenACCClauseKind::NumWorkers ||
276 ClauseKind == OpenACCClauseKind::Async ||
277 ClauseKind == OpenACCClauseKind::VectorLength) &&
278 "Parsed clause kind does not have a int exprs");
279 Details = IntExprDetails{{IntExprs.begin(), IntExprs.end()}};
280 }
282 assert((ClauseKind == OpenACCClauseKind::NumGangs ||
283 ClauseKind == OpenACCClauseKind::NumWorkers ||
284 ClauseKind == OpenACCClauseKind::Async ||
285 ClauseKind == OpenACCClauseKind::VectorLength) &&
286 "Parsed clause kind does not have a int exprs");
287 Details = IntExprDetails{std::move(IntExprs)};
288 }
289
290 void setVarListDetails(ArrayRef<Expr *> VarList, bool IsReadOnly,
291 bool IsZero) {
292 assert((ClauseKind == OpenACCClauseKind::Private ||
293 ClauseKind == OpenACCClauseKind::NoCreate ||
294 ClauseKind == OpenACCClauseKind::Present ||
295 ClauseKind == OpenACCClauseKind::Copy ||
296 ClauseKind == OpenACCClauseKind::PCopy ||
297 ClauseKind == OpenACCClauseKind::PresentOrCopy ||
298 ClauseKind == OpenACCClauseKind::CopyIn ||
299 ClauseKind == OpenACCClauseKind::PCopyIn ||
301 ClauseKind == OpenACCClauseKind::CopyOut ||
302 ClauseKind == OpenACCClauseKind::PCopyOut ||
304 ClauseKind == OpenACCClauseKind::Create ||
305 ClauseKind == OpenACCClauseKind::PCreate ||
307 ClauseKind == OpenACCClauseKind::Attach ||
308 ClauseKind == OpenACCClauseKind::DevicePtr ||
309 ClauseKind == OpenACCClauseKind::FirstPrivate) &&
310 "Parsed clause kind does not have a var-list");
311 assert((!IsReadOnly || ClauseKind == OpenACCClauseKind::CopyIn ||
312 ClauseKind == OpenACCClauseKind::PCopyIn ||
313 ClauseKind == OpenACCClauseKind::PresentOrCopyIn) &&
314 "readonly: tag only valid on copyin");
315 assert((!IsZero || ClauseKind == OpenACCClauseKind::CopyOut ||
316 ClauseKind == OpenACCClauseKind::PCopyOut ||
318 ClauseKind == OpenACCClauseKind::Create ||
319 ClauseKind == OpenACCClauseKind::PCreate ||
320 ClauseKind == OpenACCClauseKind::PresentOrCreate) &&
321 "zero: tag only valid on copyout/create");
322 Details =
323 VarListDetails{{VarList.begin(), VarList.end()}, IsReadOnly, IsZero};
324 }
325
326 void setVarListDetails(llvm::SmallVector<Expr *> &&VarList, bool IsReadOnly,
327 bool IsZero) {
328 assert((ClauseKind == OpenACCClauseKind::Private ||
329 ClauseKind == OpenACCClauseKind::NoCreate ||
330 ClauseKind == OpenACCClauseKind::Present ||
331 ClauseKind == OpenACCClauseKind::Copy ||
332 ClauseKind == OpenACCClauseKind::PCopy ||
333 ClauseKind == OpenACCClauseKind::PresentOrCopy ||
334 ClauseKind == OpenACCClauseKind::CopyIn ||
335 ClauseKind == OpenACCClauseKind::PCopyIn ||
337 ClauseKind == OpenACCClauseKind::CopyOut ||
338 ClauseKind == OpenACCClauseKind::PCopyOut ||
340 ClauseKind == OpenACCClauseKind::Create ||
341 ClauseKind == OpenACCClauseKind::PCreate ||
343 ClauseKind == OpenACCClauseKind::Attach ||
344 ClauseKind == OpenACCClauseKind::DevicePtr ||
345 ClauseKind == OpenACCClauseKind::FirstPrivate) &&
346 "Parsed clause kind does not have a var-list");
347 assert((!IsReadOnly || ClauseKind == OpenACCClauseKind::CopyIn ||
348 ClauseKind == OpenACCClauseKind::PCopyIn ||
349 ClauseKind == OpenACCClauseKind::PresentOrCopyIn) &&
350 "readonly: tag only valid on copyin");
351 assert((!IsZero || ClauseKind == OpenACCClauseKind::CopyOut ||
352 ClauseKind == OpenACCClauseKind::PCopyOut ||
354 ClauseKind == OpenACCClauseKind::Create ||
355 ClauseKind == OpenACCClauseKind::PCreate ||
356 ClauseKind == OpenACCClauseKind::PresentOrCreate) &&
357 "zero: tag only valid on copyout/create");
358 Details = VarListDetails{std::move(VarList), IsReadOnly, IsZero};
359 }
360
362 llvm::SmallVector<Expr *> &&VarList) {
363 assert(ClauseKind == OpenACCClauseKind::Reduction &&
364 "reduction details only valid on reduction");
365 Details = ReductionDetails{Op, std::move(VarList)};
366 }
367
368 void setWaitDetails(Expr *DevNum, SourceLocation QueuesLoc,
369 llvm::SmallVector<Expr *> &&IntExprs) {
370 assert(ClauseKind == OpenACCClauseKind::Wait &&
371 "Parsed clause kind does not have a wait-details");
372 Details = WaitDetails{DevNum, QueuesLoc, std::move(IntExprs)};
373 }
374
376 assert((ClauseKind == OpenACCClauseKind::DeviceType ||
377 ClauseKind == OpenACCClauseKind::DType) &&
378 "Only 'device_type'/'dtype' has a device-type-arg list");
379 Details = DeviceTypeDetails{std::move(Archs)};
380 }
381 };
382
383 SemaOpenACC(Sema &S);
384
385 /// Called after parsing an OpenACC Clause so that it can be checked.
387 OpenACCParsedClause &Clause);
388
389 /// Called after the construct has been parsed, but clauses haven't been
390 /// parsed. This allows us to diagnose not-implemented, as well as set up any
391 /// state required for parsing the clauses.
393
394 /// Called after the directive, including its clauses, have been parsed and
395 /// parsing has consumed the 'annot_pragma_openacc_end' token. This DOES
396 /// happen before any associated declarations or statements have been parsed.
397 /// This function is only called when we are parsing a 'statement' context.
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 'Decl' context.
405 /// Called when we encounter an associated statement for our construct, this
406 /// should check legality of the statement as it appertains to this Construct.
408 OpenACCDirectiveKind K, StmtResult AssocStmt);
409
410 /// Called after the directive has been completely parsed, including the
411 /// declaration group or associated statement.
413 SourceLocation StartLoc,
414 SourceLocation DirLoc,
415 SourceLocation EndLoc,
417 StmtResult AssocStmt);
418
419 /// Called after the directive has been completely parsed, including the
420 /// declaration group or associated statement.
422
423 /// Called when encountering an 'int-expr' for OpenACC, and manages
424 /// conversions and diagnostics to 'int'.
426 SourceLocation Loc, Expr *IntExpr);
427
428 /// Called when encountering a 'var' for OpenACC, ensures it is actually a
429 /// declaration reference to a variable of the correct type.
431
432 /// Called while semantically analyzing the reduction clause, ensuring the var
433 /// is the correct kind of reference.
435
436 /// Called to check the 'var' type is a variable of pointer type, necessary
437 /// for 'deviceptr' and 'attach' clauses. Returns true on success.
438 bool CheckVarIsPointerType(OpenACCClauseKind ClauseKind, Expr *VarExpr);
439
440 /// Checks and creates an Array Section used in an OpenACC construct/clause.
442 Expr *LowerBound,
443 SourceLocation ColonLocFirst, Expr *Length,
444 SourceLocation RBLoc);
445
446 /// Helper type for the registration/assignment of constructs that need to
447 /// 'know' about their parent constructs and hold a reference to them, such as
448 /// Loop needing its parent construct.
450 SemaOpenACC &SemaRef;
451 bool WasInsideComputeConstruct;
452 OpenACCDirectiveKind DirKind;
453 llvm::SmallVector<OpenACCLoopConstruct *> ParentlessLoopConstructs;
454
455 public:
458 };
459};
460
461} // namespace clang
462
463#endif // LLVM_CLANG_SEMA_SEMAOPENACC_H
Defines some OpenACC-specific enums and functions.
SourceLocation Loc
Definition: SemaObjC.cpp:758
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:449
A type to represent all the data for an OpenACC Clause that has been parsed, but not yet created/sema...
Definition: SemaOpenACC.h:46
ArrayRef< Expr * > getQueueIdExprs() const
Definition: SemaOpenACC.h:164
OpenACCDirectiveKind getDirectiveKind() const
Definition: SemaOpenACC.h:94
OpenACCParsedClause(OpenACCDirectiveKind DirKind, OpenACCClauseKind ClauseKind, SourceLocation BeginLoc)
Definition: SemaOpenACC.h:90
OpenACCReductionOperator getReductionOp() const
Definition: SemaOpenACC.h:188
void setLParenLoc(SourceLocation EndLoc)
Definition: SemaOpenACC.h:250
void setConditionDetails(Expr *ConditionExpr)
Definition: SemaOpenACC.h:259
OpenACCClauseKind getClauseKind() const
Definition: SemaOpenACC.h:96
SourceLocation getLParenLoc() const
Definition: SemaOpenACC.h:100
ArrayRef< DeviceTypeArgument > getDeviceTypeArchitectures() const
Definition: SemaOpenACC.h:243
void setIntExprDetails(llvm::SmallVector< Expr * > &&IntExprs)
Definition: SemaOpenACC.h:281
void setReductionDetails(OpenACCReductionOperator Op, llvm::SmallVector< Expr * > &&VarList)
Definition: SemaOpenACC.h:361
ArrayRef< Expr * > getVarList() const
Definition: SemaOpenACC.h:220
SourceLocation getBeginLoc() const
Definition: SemaOpenACC.h:98
void setDefaultDetails(OpenACCDefaultClauseKind DefKind)
Definition: SemaOpenACC.h:253
SourceLocation getQueuesLoc() const
Definition: SemaOpenACC.h:144
void setVarListDetails(llvm::SmallVector< Expr * > &&VarList, bool IsReadOnly, bool IsZero)
Definition: SemaOpenACC.h:326
void setVarListDetails(ArrayRef< Expr * > VarList, bool IsReadOnly, bool IsZero)
Definition: SemaOpenACC.h:290
void setWaitDetails(Expr *DevNum, SourceLocation QueuesLoc, llvm::SmallVector< Expr * > &&IntExprs)
Definition: SemaOpenACC.h:368
void setEndLoc(SourceLocation EndLoc)
Definition: SemaOpenACC.h:251
ArrayRef< Expr * > getIntExprs() const
Definition: SemaOpenACC.h:184
void setIntExprDetails(ArrayRef< Expr * > IntExprs)
Definition: SemaOpenACC.h:273
void setDeviceTypeDetails(llvm::SmallVector< DeviceTypeArgument > &&Archs)
Definition: SemaOpenACC.h:375
OpenACCDefaultClauseKind getDefaultClauseKind() const
Definition: SemaOpenACC.h:104
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:40
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:535
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:8394
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