37 return new (Mem)
OpenACCIfClause(BeginLoc, LParenLoc, ConditionExpr, EndLoc);
44 ConditionExpr, EndLoc) {
45 assert(ConditionExpr &&
"if clause requires condition expr");
48 "Condition expression type not scalar/dependent");
65 ConditionExpr, EndLoc) {
68 "Condition expression type not scalar/dependent");
74 assert(
false &&
"Clause children function not implemented");
76#define VISIT_CLAUSE(CLAUSE_NAME) \
77 case OpenACCClauseKind::CLAUSE_NAME: \
78 return cast<OpenACC##CLAUSE_NAME##Clause>(this)->children();
80#include "clang/Basic/OpenACCClauses.def"
85OpenACCNumWorkersClause::OpenACCNumWorkersClause(
SourceLocation BeginLoc,
90 LParenLoc, IntExpr, EndLoc) {
93 "Condition expression type not scalar/dependent");
106OpenACCVectorLengthClause::OpenACCVectorLengthClause(
SourceLocation BeginLoc,
111 LParenLoc, IntExpr, EndLoc) {
114 "Condition expression type not scalar/dependent");
132 void *Mem =
C.Allocate(
133 OpenACCNumGangsClause::totalSizeToAlloc<Expr *>(IntExprs.size()));
142 void *Mem =
C.Allocate(
143 OpenACCPrivateClause::totalSizeToAlloc<Expr *>(VarList.size()));
151void OpenACCClausePrinter::printExpr(
const Expr *E) {
156 OS <<
"default(" <<
C.getDefaultClauseKind() <<
")";
161 printExpr(
C.getConditionExpr());
167 if (
const Expr *CondExpr =
C.getConditionExpr()) {
176 llvm::interleaveComma(
C.getIntExprs(), OS,
177 [&](
const Expr *E) { printExpr(E); });
181void OpenACCClausePrinter::VisitNumWorkersClause(
183 OS <<
"num_workers(";
184 printExpr(
C.getIntExpr());
188void OpenACCClausePrinter::VisitVectorLengthClause(
190 OS <<
"vector_length(";
191 printExpr(
C.getIntExpr());
197 llvm::interleaveComma(
C.getVarList(), OS,
198 [&](
const Expr *E) { printExpr(E); });
Defines the clang::ASTContext interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
This represents one expression.
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
Represents one of the handful of classes that has an optional/required 'condition' expression as an a...
Represents one of a handful of clauses that have a single integer expression.
StmtIterator child_iterator
OpenACCClauseKind getClauseKind() const
llvm::iterator_range< child_iterator > child_range
A 'default' clause, has the optional 'none' or 'present' argument.
static OpenACCDefaultClause * Create(const ASTContext &C, OpenACCDefaultClauseKind K, SourceLocation BeginLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
An 'if' clause, which has a required condition expression.
OpenACCIfClause(SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *ConditionExpr, SourceLocation EndLoc)
static OpenACCIfClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *ConditionExpr, SourceLocation EndLoc)
static OpenACCNumGangsClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > IntExprs, SourceLocation EndLoc)
static OpenACCNumWorkersClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static OpenACCPrivateClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
A 'self' clause, which has an optional condition expression.
static OpenACCSelfClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *ConditionExpr, SourceLocation EndLoc)
static OpenACCVectorLengthClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
Encodes a location in the source.
void printPretty(raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, StringRef NewlineSymbol="\n", const ASTContext *Context=nullptr) const
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
bool isScalarType() const
The JSON file list parser is used to communicate input to InstallAPI.
OpenACCClauseKind
Represents the kind of an OpenACC clause.
@ VectorLength
'vector_length' clause, allowed on 'parallel', 'kernels', 'parallel loop', and 'kernels loop' constru...
@ If
'if' clause, allowed on all the Compute Constructs, Data Constructs, Executable Constructs,...
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
@ NumWorkers
'num_workers' clause, allowed on 'parallel', 'kernels', parallel loop', and 'kernels loop' constructs...