13#ifndef LLVM_CLANG_AST_STMTOPENACC_H
14#define LLVM_CLANG_AST_STMTOPENACC_H
46 :
Stmt(SC),
Kind(K),
Range(Start, End), DirectiveLoc(DirectiveLoc) {}
51 assert(Clauses.empty() &&
"Cannot change clause list");
59 return S->getStmtClass() >= firstOpenACCConstructStmtConstant &&
60 S->getStmtClass() <= lastOpenACCConstructStmtConstant;
84 Stmt *AssociatedStmt =
nullptr;
92 AssociatedStmt(AssocStmt) {}
108 return child_range(&AssociatedStmt, &AssociatedStmt + 1);
130 private llvm::TrailingObjects<OpenACCComputeConstruct,
131 const OpenACCClause *> {
135 friend TrailingObjects;
144 std::uninitialized_value_construct(
145 getTrailingObjects<const OpenACCClause *>(),
146 getTrailingObjects<const OpenACCClause *>() + NumClauses);
154 Stmt *StructuredBlock)
156 DirectiveLoc, End, StructuredBlock) {
158 "Only parallel, serial, and kernels constructs should be "
159 "represented by this type");
162 std::uninitialized_copy(Clauses.begin(), Clauses.end(),
163 getTrailingObjects<const OpenACCClause *>());
173 return T->getStmtClass() == OpenACCComputeConstructClass;
177 unsigned NumClauses);
193 private llvm::TrailingObjects<OpenACCLoopConstruct,
194 const OpenACCClause *> {
206 friend TrailingObjects;
216 return T->getStmtClass() == OpenACCLoopConstructClass;
220 unsigned NumClauses);
242 return ParentComputeConstructKind;
250 private llvm::TrailingObjects<OpenACCCombinedConstruct,
251 const OpenACCClause *> {
252 friend TrailingObjects;
258 std::uninitialized_value_construct(
259 getTrailingObjects<const OpenACCClause *>(),
260 getTrailingObjects<const OpenACCClause *>() + NumClauses);
268 Stmt *StructuredBlock)
270 DirectiveLoc, End, StructuredBlock) {
272 "Only parallel loop, serial loop, and kernels loop constructs "
273 "should be represented by this type");
275 std::uninitialized_copy(Clauses.begin(), Clauses.end(),
276 getTrailingObjects<const OpenACCClause *>());
284 return T->getStmtClass() == OpenACCCombinedConstructClass;
288 unsigned NumClauses);
303 private llvm::TrailingObjects<OpenACCDataConstruct,
304 const OpenACCClause *> {
305 friend TrailingObjects;
311 std::uninitialized_value_construct(
312 getTrailingObjects<const OpenACCClause *>(),
313 getTrailingObjects<const OpenACCClause *>() + NumClauses);
321 Stmt *StructuredBlock)
324 DirectiveLoc, End, StructuredBlock) {
325 std::uninitialized_copy(Clauses.begin(), Clauses.end(),
326 getTrailingObjects<const OpenACCClause *>());
334 return T->getStmtClass() == OpenACCDataConstructClass;
338 unsigned NumClauses);
343 Stmt *StructuredBlock);
352 private llvm::TrailingObjects<OpenACCEnterDataConstruct,
353 const OpenACCClause *> {
354 friend TrailingObjects;
359 std::uninitialized_value_construct(
360 getTrailingObjects<const OpenACCClause *>(),
361 getTrailingObjects<const OpenACCClause *>() + NumClauses);
371 std::uninitialized_copy(Clauses.begin(), Clauses.end(),
372 getTrailingObjects<const OpenACCClause *>());
379 return T->getStmtClass() == OpenACCEnterDataConstructClass;
382 unsigned NumClauses);
390 private llvm::TrailingObjects<OpenACCExitDataConstruct,
391 const OpenACCClause *> {
392 friend TrailingObjects;
397 std::uninitialized_value_construct(
398 getTrailingObjects<const OpenACCClause *>(),
399 getTrailingObjects<const OpenACCClause *>() + NumClauses);
409 std::uninitialized_copy(Clauses.begin(), Clauses.end(),
410 getTrailingObjects<const OpenACCClause *>());
417 return T->getStmtClass() == OpenACCExitDataConstructClass;
420 unsigned NumClauses);
429 private llvm::TrailingObjects<OpenACCHostDataConstruct,
430 const OpenACCClause *> {
431 friend TrailingObjects;
437 std::uninitialized_value_construct(
438 getTrailingObjects<const OpenACCClause *>(),
439 getTrailingObjects<const OpenACCClause *>() + NumClauses);
446 Stmt *StructuredBlock)
449 DirectiveLoc, End, StructuredBlock) {
450 std::uninitialized_copy(Clauses.begin(), Clauses.end(),
451 getTrailingObjects<const OpenACCClause *>());
459 return T->getStmtClass() == OpenACCHostDataConstructClass;
462 unsigned NumClauses);
466 Stmt *StructuredBlock);
477 private llvm::TrailingObjects<OpenACCWaitConstruct, Expr *,
483 friend TrailingObjects;
494 unsigned NumExprs = 0;
501 assert(NumExprs >= 1 &&
502 "NumExprs should always be >= 1 because the 'devnum' "
503 "expr is represented by a null if necessary");
504 std::uninitialized_value_construct(getExprPtr(),
505 getExprPtr() + NumExprs);
506 std::uninitialized_value_construct(getTrailingObjects<OpenACCClause *>(),
507 getTrailingObjects<OpenACCClause *>() +
510 getTrailingObjects<OpenACCClause *>()),
522 LParenLoc(LParenLoc), RParenLoc(RParenLoc), QueuesLoc(QueuesLoc),
523 NumExprs(QueueIdExprs.size() + 1) {
524 assert(NumExprs >= 1 &&
525 "NumExprs should always be >= 1 because the 'devnum' "
526 "expr is represented by a null if necessary");
528 std::uninitialized_copy(&DevNumExpr, &DevNumExpr + 1,
530 std::uninitialized_copy(QueueIdExprs.begin(), QueueIdExprs.end(),
533 std::uninitialized_copy(
const_cast<OpenACCClause **
>(Clauses.begin()),
535 getTrailingObjects<OpenACCClause *>());
537 getTrailingObjects<OpenACCClause *>()),
541 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
return NumExprs; }
542 size_t numTrailingObjects(OverloadToken<const OpenACCClause *>)
const {
546 Expr **getExprPtr()
const {
547 return const_cast<Expr**
>(getTrailingObjects<Expr *>());
560 return T->getStmtClass() == OpenACCWaitConstructClass;
581 return getExprs().drop_front();
591 reinterpret_cast<Stmt *
const *
>(getExprPtr());
599 private llvm::TrailingObjects<OpenACCInitConstruct,
600 const OpenACCClause *> {
601 friend TrailingObjects;
606 std::uninitialized_value_construct(
607 getTrailingObjects<const OpenACCClause *>(),
608 getTrailingObjects<const OpenACCClause *>() + NumClauses);
618 std::uninitialized_copy(Clauses.begin(), Clauses.end(),
619 getTrailingObjects<const OpenACCClause *>());
626 return T->getStmtClass() == OpenACCInitConstructClass;
629 unsigned NumClauses);
639 private llvm::TrailingObjects<OpenACCShutdownConstruct,
640 const OpenACCClause *> {
641 friend TrailingObjects;
646 std::uninitialized_value_construct(
647 getTrailingObjects<const OpenACCClause *>(),
648 getTrailingObjects<const OpenACCClause *>() + NumClauses);
658 std::uninitialized_copy(Clauses.begin(), Clauses.end(),
659 getTrailingObjects<const OpenACCClause *>());
666 return T->getStmtClass() == OpenACCShutdownConstructClass;
669 unsigned NumClauses);
enum clang::sema::@1718::IndirectLocalPathEntry::EntryKind Kind
Defines some OpenACC-specific enums and functions.
Defines the clang::SourceLocation class and associated facilities.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
This represents one expression.
This is a base class for any OpenACC statement-level constructs that have an associated statement.
void setAssociatedStmt(Stmt *S)
Stmt * getAssociatedStmt()
const_child_range children() const
const Stmt * getAssociatedStmt() const
OpenACCAssociatedStmtConstruct(StmtClass SC, OpenACCDirectiveKind K, SourceLocation Start, SourceLocation DirectiveLoc, SourceLocation End, Stmt *AssocStmt)
static bool classof(const Stmt *T)
This is the base type for all OpenACC Clauses.
static OpenACCCombinedConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static bool classof(const Stmt *T)
const Stmt * getLoop() const
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
static OpenACCComputeConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static bool classof(const Stmt *T)
Stmt * getStructuredBlock()
const Stmt * getStructuredBlock() const
This is the base class for an OpenACC statement-level construct, other construct types are expected t...
SourceLocation getEndLoc() const
SourceLocation getBeginLoc() const
OpenACCDirectiveKind getDirectiveKind() const
void setClauseList(MutableArrayRef< const OpenACCClause * > NewClauses)
ArrayRef< const OpenACCClause * > clauses() const
const_child_range children() const
SourceLocation getDirectiveLoc() const
static bool classof(const Stmt *S)
OpenACCConstructStmt(StmtClass SC, OpenACCDirectiveKind K, SourceLocation Start, SourceLocation DirectiveLoc, SourceLocation End)
const Stmt * getStructuredBlock() const
static OpenACCDataConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static bool classof(const Stmt *T)
Stmt * getStructuredBlock()
static bool classof(const Stmt *T)
static OpenACCEnterDataConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static bool classof(const Stmt *T)
static OpenACCExitDataConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCHostDataConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Stmt * getStructuredBlock()
static bool classof(const Stmt *T)
const Stmt * getStructuredBlock() const
static bool classof(const Stmt *T)
static OpenACCInitConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
This class represents a 'loop' construct.
static OpenACCLoopConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
OpenACCDirectiveKind getParentComputeConstructKind() const
const Stmt * getLoop() const
bool isOrphanedLoopConstruct() const
OpenACC 3.3 2.9: An orphaned loop construct is a loop construct that is not lexically enclosed within...
static bool classof(const Stmt *T)
static OpenACCShutdownConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static bool classof(const Stmt *T)
llvm::ArrayRef< Expr * > getQueueIdExprs()
static bool classof(const Stmt *T)
SourceLocation getRParenLoc() const
bool hasDevNumExpr() const
static OpenACCWaitConstruct * CreateEmpty(const ASTContext &C, unsigned NumExprs, unsigned NumClauses)
llvm::ArrayRef< Expr * > getQueueIdExprs() const
SourceLocation getQueuesLoc() const
const_child_range children() const
bool hasQueuesTag() const
SourceLocation getLParenLoc() const
Expr * getDevNumExpr() const
A class that does preorder or postorder depth-first traversal on the entire Clang AST and visits each...
Encodes a location in the source.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
StmtIterator child_iterator
Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatem...
llvm::iterator_range< child_iterator > child_range
llvm::iterator_range< const_child_iterator > const_child_range
The JSON file list parser is used to communicate input to InstallAPI.
bool isOpenACCComputeDirectiveKind(OpenACCDirectiveKind K)
bool isOpenACCCombinedDirectiveKind(OpenACCDirectiveKind K)
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
const FunctionProtoType * T