14#ifndef LLVM_CLANG_AST_OPENACCCLAUSE_H
15#define LLVM_CLANG_AST_OPENACCCLAUSE_H
29 : Kind(K), Location(BeginLoc, EndLoc) {}
85 DefaultClauseKind(K) {
88 "Invalid Clause Kind");
93 return DefaultClauseKind;
106 Expr *ConditionExpr =
nullptr;
113 ConditionExpr(ConditionExpr) {}
123 reinterpret_cast<Stmt **
>(&ConditionExpr + 1));
130 reinterpret_cast<Stmt *
const *
>(&ConditionExpr),
131 reinterpret_cast<Stmt *
const *
>(&ConditionExpr + 1));
172 assert(IntExprs.empty() &&
"Cannot change IntExprs list");
173 IntExprs = NewIntExprs;
183 reinterpret_cast<Stmt **
>(IntExprs.end()));
195 public llvm::TrailingObjects<OpenACCNumGangsClause, Expr *> {
201 std::uninitialized_copy(IntExprs.begin(), IntExprs.end(),
202 getTrailingObjects<Expr *>());
265 Impl &getDerived() {
return static_cast<Impl &
>(*this); }
277 switch (
C->getClauseKind()) {
278#define VISIT_CLAUSE(CLAUSE_NAME) \
279 case OpenACCClauseKind::CLAUSE_NAME: \
280 Visit##CLAUSE_NAME##Clause(*cast<OpenACC##CLAUSE_NAME##Clause>(C)); \
282#include "clang/Basic/OpenACCClauses.def"
285 llvm_unreachable(
"Clause visitor not yet implemented");
287 llvm_unreachable(
"Invalid Clause kind");
290#define VISIT_CLAUSE(CLAUSE_NAME) \
291 void Visit##CLAUSE_NAME##Clause( \
292 const OpenACC##CLAUSE_NAME##Clause &Clause) { \
293 return getDerived().Visit##CLAUSE_NAME##Clause(Clause); \
296#include "clang/Basic/OpenACCClauses.def"
308 if (Clause != List.back())
314#define VISIT_CLAUSE(CLAUSE_NAME) \
315 void Visit##CLAUSE_NAME##Clause(const OpenACC##CLAUSE_NAME##Clause &Clause);
316#include "clang/Basic/OpenACCClauses.def"
Defines the clang::ASTContext interface.
Defines some OpenACC-specific enums and functions.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
This represents one expression.
void VisitClauseList(ArrayRef< const OpenACCClause * > List)
OpenACCClausePrinter(raw_ostream &OS)
void Visit(const OpenACCClause *C)
void VisitClauseList(ArrayRef< const OpenACCClause * > List)
Represents one of the handful of classes that has an optional/required 'condition' expression as an a...
bool hasConditionExpr() const
const Expr * getConditionExpr() const
Expr * getConditionExpr()
OpenACCClauseWithCondition(OpenACCClauseKind K, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *ConditionExpr, SourceLocation EndLoc)
const_child_range children() const
Represents a clause that has one or more IntExprs.
void setIntExprs(MutableArrayRef< Expr * > NewIntExprs)
Used only for initialization, the leaf class can initialize this to trailing storage.
const_child_range children() const
llvm::ArrayRef< Expr * > getIntExprs() const
Gets the entire list of integer expressions, but leave it to the individual clauses to expose this ho...
OpenACCClauseWithIntExprs(OpenACCClauseKind K, SourceLocation BeginLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Represents a clause that has a list of parameters.
SourceLocation getLParenLoc() const
OpenACCClauseWithParams(OpenACCClauseKind K, SourceLocation BeginLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
const_child_range children() const
Represents one of a handful of clauses that have a single integer expression.
OpenACCClauseWithSingleIntExpr(OpenACCClauseKind K, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
const Expr * getIntExpr() const
This is the base type for all OpenACC Clauses.
StmtIterator child_iterator
OpenACCClauseKind getClauseKind() const
SourceLocation getBeginLoc() const
const_child_range children() const
static bool classof(const OpenACCClause *)
llvm::iterator_range< child_iterator > child_range
ConstStmtIterator const_child_iterator
OpenACCClause(OpenACCClauseKind K, SourceLocation BeginLoc, SourceLocation EndLoc)
virtual ~OpenACCClause()=default
llvm::iterator_range< const_child_iterator > const_child_range
SourceLocation getEndLoc() const
A 'default' clause, has the optional 'none' or 'present' argument.
OpenACCDefaultClause(OpenACCDefaultClauseKind K, SourceLocation BeginLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
friend class ASTWriterStmt
OpenACCDefaultClauseKind getDefaultClauseKind() const
friend class ASTReaderStmt
An 'if' clause, which has a required condition expression.
llvm::ArrayRef< Expr * > getIntExprs() const
llvm::ArrayRef< Expr * > getIntExprs()
A 'self' clause, which has an optional condition expression.
Encodes a location in the source.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
Stmt - This represents one statement.
The JSON file list parser is used to communicate input to InstallAPI.
OpenACCClauseKind
Represents the kind of an OpenACC clause.
@ Create
'copyin' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
@ NumGangs
'num_gangs' clause, allowed on 'parallel', 'kernels', parallel loop', and 'kernels loop' constructs.
@ Present
'present' option.