;
73 return new(Mem)
OpenACCIfClause(BeginLoc, LParenLoc, ConditionExpr, EndLoc);
80ConditionExpr, EndLoc) {
81assert(ConditionExpr &&
"if clause requires condition expr");
84 "Condition expression type not scalar/dependent");
92 void*Mem =
C.Allocate(OpenACCSelfClause::totalSizeToAlloc<Expr *>(1));
103 C.Allocate(OpenACCSelfClause::totalSizeToAlloc<Expr *>(VarList.size()));
113HasConditionExpr(
std::nullopt), NumExprs(VarList.size()) {
114std::uninitialized_copy(VarList.begin(), VarList.end(),
115getTrailingObjects<Expr *>());
123HasConditionExpr(ConditionExpr != nullptr), NumExprs(1) {
126 "Condition expression type not scalar/dependent");
127std::uninitialized_copy(&ConditionExpr, &ConditionExpr + 1,
128getTrailingObjects<Expr *>());
134assert(
false&&
"Clause children function not implemented");
136#define VISIT_CLAUSE(CLAUSE_NAME) \ 137 case OpenACCClauseKind::CLAUSE_NAME: \ 138 return cast<OpenACC##CLAUSE_NAME##Clause>(this)->children(); 139#define CLAUSE_ALIAS(ALIAS_NAME, CLAUSE_NAME, DEPRECATED) \ 140 case OpenACCClauseKind::ALIAS_NAME: \ 141 return cast<OpenACC##CLAUSE_NAME##Clause>(this)->children(); 143#include "clang/Basic/OpenACCClauses.def" 148OpenACCNumWorkersClause::OpenACCNumWorkersClause(
SourceLocationBeginLoc,
153LParenLoc, IntExpr, EndLoc) {
156 "Condition expression type not scalar/dependent");
166assert(GangKinds.size() == IntExprs.size() &&
"Mismatch exprs/kind?");
167std::uninitialized_copy(IntExprs.begin(), IntExprs.end(),
168getTrailingObjects<Expr *>());
170std::uninitialized_copy(GangKinds.begin(), GangKinds.end(),
171getTrailingObjects<OpenACCGangKind>());
184OpenACCCollapseClause::OpenACCCollapseClause(
SourceLocationBeginLoc,
186 boolHasForce,
Expr*LoopCount,
189LParenLoc, LoopCount, EndLoc),
191assert(LoopCount &&
"LoopCount required");
201 "Loop count not constant expression");
208OpenACCVectorLengthClause::OpenACCVectorLengthClause(
SourceLocationBeginLoc,
213LParenLoc, IntExpr, EndLoc) {
216 "Condition expression type not scalar/dependent");
233LParenLoc, IntExpr, EndLoc) {
236 "Condition expression type not scalar/dependent");
249OpenACCDeviceNumClause::OpenACCDeviceNumClause(
SourceLocationBeginLoc,
253LParenLoc, IntExpr, EndLoc) {
256 "device_num expression type not scalar/dependent");
269OpenACCDefaultAsyncClause::OpenACCDefaultAsyncClause(
SourceLocationBeginLoc,
274LParenLoc, IntExpr, EndLoc) {
277 "default_async expression type not scalar/dependent");
296 void*Mem =
C.Allocate(
297OpenACCWaitClause::totalSizeToAlloc<Expr *>(QueueIdExprs.size() + 1));
299QueueIdExprs, EndLoc);
307 void*Mem =
C.Allocate(
308OpenACCNumGangsClause::totalSizeToAlloc<Expr *>(IntExprs.size()));
318 C.Allocate(OpenACCTileClause::totalSizeToAlloc<Expr *>(SizeExprs.size()));
327 void*Mem =
C.Allocate(
328OpenACCPrivateClause::totalSizeToAlloc<Expr *>(VarList.size()));
335 void*Mem =
C.Allocate(
336OpenACCFirstPrivateClause::totalSizeToAlloc<Expr *>(VarList.size()));
347 C.Allocate(OpenACCAttachClause::totalSizeToAlloc<Expr *>(VarList.size()));
357 C.Allocate(OpenACCDetachClause::totalSizeToAlloc<Expr *>(VarList.size()));
367 C.Allocate(OpenACCDeleteClause::totalSizeToAlloc<Expr *>(VarList.size()));
376 void*Mem =
C.Allocate(
377OpenACCUseDeviceClause::totalSizeToAlloc<Expr *>(VarList.size()));
386 void*Mem =
C.Allocate(
387OpenACCDevicePtrClause::totalSizeToAlloc<Expr *>(VarList.size()));
396 void*Mem =
C.Allocate(
397OpenACCNoCreateClause::totalSizeToAlloc<Expr *>(VarList.size()));
406 void*Mem =
C.Allocate(
407OpenACCPresentClause::totalSizeToAlloc<Expr *>(VarList.size()));
417 C.Allocate(OpenACCHostClause::totalSizeToAlloc<Expr *>(VarList.size()));
427 C.Allocate(OpenACCDeviceClause::totalSizeToAlloc<Expr *>(VarList.size()));
436 C.Allocate(OpenACCCopyClause::totalSizeToAlloc<Expr *>(VarList.size()));
447 C.Allocate(OpenACCCopyInClause::totalSizeToAlloc<Expr *>(VarList.size()));
449IsReadOnly, VarList, EndLoc);
457 void*Mem =
C.Allocate(
458OpenACCCopyOutClause::totalSizeToAlloc<Expr *>(VarList.size()));
469 C.Allocate(OpenACCCreateClause::totalSizeToAlloc<Expr *>(VarList.size()));
479 C.Allocate(OpenACCDeviceTypeClause::totalSizeToAlloc<DeviceTypeArgument>(
489 void*Mem =
C.Allocate(
490OpenACCReductionClause::totalSizeToAlloc<Expr *>(VarList.size()));
522 C.Allocate(OpenACCGangClause::totalSizeToAlloc<Expr *, OpenACCGangKind>(
523IntExprs.size(), GangKinds.size()));
532LParenLoc, IntExpr, EndLoc) {
535 "Int expression type not scalar/dependent");
552LParenLoc, IntExpr, EndLoc) {
555 "Int expression type not scalar/dependent");
588voidOpenACCClausePrinter::printExpr(
const Expr*
E) {
593OS <<
"default("<<
C.getDefaultClauseKind() <<
")";
598printExpr(
C.getConditionExpr());
605 if(
C.isConditionExprClause()) {
606 if(
const Expr*CondExpr =
C.getConditionExpr()) {
613llvm::interleaveComma(
C.getVarList(), OS,
614[&](
const Expr*
E) { printExpr(E); });
621llvm::interleaveComma(
C.getIntExprs(), OS,
622[&](
const Expr*
E) { printExpr(E); });
628llvm::interleaveComma(
C.getSizeExprs(), OS,
629[&](
const Expr*
E) { printExpr(E); });
633voidOpenACCClausePrinter::VisitNumWorkersClause(
635OS <<
"num_workers(";
636printExpr(
C.getIntExpr());
640voidOpenACCClausePrinter::VisitVectorLengthClause(
642OS <<
"vector_length(";
643printExpr(
C.getIntExpr());
647voidOpenACCClausePrinter::VisitDeviceNumClause(
649OS <<
"device_num(";
650printExpr(
C.getIntExpr());
654voidOpenACCClausePrinter::VisitDefaultAsyncClause(
656OS <<
"default_async(";
657printExpr(
C.getIntExpr());
663 if(
C.hasIntExpr()) {
665printExpr(
C.getIntExpr());
672llvm::interleaveComma(
C.getVarList(), OS,
673[&](
const Expr*
E) { printExpr(E); });
677voidOpenACCClausePrinter::VisitFirstPrivateClause(
679OS <<
"firstprivate(";
680llvm::interleaveComma(
C.getVarList(), OS,
681[&](
const Expr*
E) { printExpr(E); });
687llvm::interleaveComma(
C.getVarList(), OS,
688[&](
const Expr*
E) { printExpr(E); });
694llvm::interleaveComma(
C.getVarList(), OS,
695[&](
const Expr*
E) { printExpr(E); });
701llvm::interleaveComma(
C.getVarList(), OS,
702[&](
const Expr*
E) { printExpr(E); });
706voidOpenACCClausePrinter::VisitUseDeviceClause(
708OS <<
"use_device(";
709llvm::interleaveComma(
C.getVarList(), OS,
710[&](
const Expr*
E) { printExpr(E); });
714voidOpenACCClausePrinter::VisitDevicePtrClause(
717llvm::interleaveComma(
C.getVarList(), OS,
718[&](
const Expr*
E) { printExpr(E); });
724llvm::interleaveComma(
C.getVarList(), OS,
725[&](
const Expr*
E) { printExpr(E); });
731llvm::interleaveComma(
C.getVarList(), OS,
732[&](
const Expr*
E) { printExpr(E); });
738llvm::interleaveComma(
C.getVarList(), OS,
739[&](
const Expr*
E) { printExpr(E); });
745llvm::interleaveComma(
C.getVarList(), OS,
746[&](
const Expr*
E) { printExpr(E); });
751OS <<
C.getClauseKind() <<
'(';
752llvm::interleaveComma(
C.getVarList(), OS,
753[&](
const Expr*
E) { printExpr(E); });
758OS <<
C.getClauseKind() <<
'(';
759 if(
C.isReadOnly())
761llvm::interleaveComma(
C.getVarList(), OS,
762[&](
const Expr*
E) { printExpr(E); });
767OS <<
C.getClauseKind() <<
'(';
770llvm::interleaveComma(
C.getVarList(), OS,
771[&](
const Expr*
E) { printExpr(E); });
776OS <<
C.getClauseKind() <<
'(';
779llvm::interleaveComma(
C.getVarList(), OS,
780[&](
const Expr*
E) { printExpr(E); });
784voidOpenACCClausePrinter::VisitReductionClause(
786OS <<
"reduction("<<
C.getReductionOp() <<
": ";
787llvm::interleaveComma(
C.getVarList(), OS,
788[&](
const Expr*
E) { printExpr(E); });
794 if(!
C.getLParenLoc().isInvalid()) {
796 if(
C.hasDevNumExpr()) {
798printExpr(
C.getDevNumExpr());
802 if(
C.hasQueuesTag())
805llvm::interleaveComma(
C.getQueueIdExprs(), OS,
806[&](
const Expr*
E) { printExpr(E); });
811voidOpenACCClausePrinter::VisitDeviceTypeClause(
813OS <<
C.getClauseKind();
815llvm::interleaveComma(
C.getArchitectures(), OS,
817if (Arch.first == nullptr)
820OS << Arch.first->getName();
829voidOpenACCClausePrinter::VisitIndependentClause(
831OS <<
"independent";
842printExpr(
C.getLoopCount());
849 if(
C.getNumExprs() > 0) {
852 for(
unsignedI = 0; I <
C.getNumExprs(); ++I) {
857OS <<
C.getExpr(I).first <<
": ";
858printExpr(
C.getExpr(I).second);
867 if(
C.hasIntExpr()) {
869printExpr(
C.getIntExpr());
877 if(
C.hasIntExpr()) {
879printExpr(
C.getIntExpr());
888voidOpenACCClausePrinter::VisitIfPresentClause(
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.
static bool classof(const OpenACCClause *C)
static OpenACCAsyncClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static OpenACCAttachClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCAutoClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
Represents one of the handful of classes that has an optional/required 'condition' expression as an a...
static bool classof(const OpenACCClause *C)
Represents a clause that has one or more expressions associated with it.
static bool classof(const OpenACCClause *C)
void setExprs(MutableArrayRef< Expr * > NewExprs)
Used only for initialization, the leaf class can initialize this to trailing storage.
Represents a clause that has a list of parameters.
static bool classof(const OpenACCClause *C)
Represents one of a handful of clauses that have a single integer expression.
static bool classof(const OpenACCClause *C)
static bool classof(const OpenACCClause *C)
This is the base type for all OpenACC Clauses.
StmtIterator child_iterator
OpenACCClauseKind getClauseKind() const
llvm::iterator_range< child_iterator > child_range
Represents a 'collapse' clause on a 'loop' construct.
static OpenACCCollapseClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, bool HasForce, Expr *LoopCount, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCCopyClause * Create(const ASTContext &C, OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static bool classof(const OpenACCClause *C)
static OpenACCCopyInClause * Create(const ASTContext &C, OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, bool IsReadOnly, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCCopyOutClause * Create(const ASTContext &C, OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, bool IsZero, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCCreateClause * Create(const ASTContext &C, OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, bool IsZero, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCDefaultAsyncClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
A 'default' clause, has the optional 'none' or 'present' argument.
static OpenACCDefaultClause * Create(const ASTContext &C, OpenACCDefaultClauseKind K, SourceLocation BeginLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
static OpenACCDeleteClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCDetachClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static bool classof(const OpenACCClause *C)
static OpenACCDeviceClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCDeviceNumClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCDevicePtrClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
A 'device_type' or 'dtype' clause, takes a list of either an 'asterisk' or an identifier.
static OpenACCDeviceTypeClause * Create(const ASTContext &C, OpenACCClauseKind K, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< DeviceTypeArgument > Archs, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCFinalizeClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCFirstPrivateClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCGangClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< OpenACCGangKind > GangKinds, ArrayRef< Expr * > IntExprs, SourceLocation EndLoc)
OpenACCGangClause(SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< OpenACCGangKind > GangKinds, ArrayRef< Expr * > IntExprs, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCHostClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
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 bool classof(const OpenACCClause *C)
static OpenACCIfPresentClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCIndependentClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCNoCreateClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCNumGangsClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > IntExprs, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCNumWorkersClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static bool classof(const OpenACCClause *C)
static OpenACCPresentClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCPrivateClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCReductionClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, OpenACCReductionOperator Operator, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
A 'self' clause, which has an optional condition expression, or, in the event of an 'update' directiv...
static bool classof(const OpenACCClause *C)
static OpenACCSelfClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *ConditionExpr, SourceLocation EndLoc)
static OpenACCSeqClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCTileClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > SizeExprs, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCUseDeviceClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCVectorClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
OpenACCVectorClause(SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCVectorLengthClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCWaitClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *DevNumExpr, SourceLocation QueuesLoc, ArrayRef< Expr * > QueueIdExprs, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static bool classof(const OpenACCClause *C)
static OpenACCWorkerClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
OpenACCWorkerClause(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.
@ Gang
'gang' clause, allowed on 'loop' and Combined constructs.
@ 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.
@ Collapse
'collapse' clause, allowed on 'loop' and Combined constructs.
@ DeviceNum
'device_num' clause, allowed on 'init', 'shutdown', and 'set' constructs.
@ Vector
'vector' clause, allowed on 'loop', Combined, and 'routine' directives.
@ Worker
'worker' clause, allowed on 'loop', Combined, and 'routine' directives.
@ DefaultAsync
'default_async' clause, allowed on 'set' construct.
@ 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...
std::pair< IdentifierInfo *, SourceLocation > DeviceTypeArgument
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4