clang 22.0.0git
|
#include "clang/Sema/SemaOpenACC.h"
Classes | |
class | AssociatedStmtRAII |
Helper type for the registration/assignment of constructs that need to 'know' about their parent constructs and hold a reference to them, such as Loop needing its parent construct. More... | |
struct | LoopGangOnKernelTy |
If there is a current 'active' loop construct with a 'gang' clause on a 'kernel' construct, this will have the source location for it, and the 'kernel kind'. More... | |
class | LoopInConstructRAII |
Helper type to restore the state of various 'loop' constructs when we run into a loop (for, etc) inside the construct. More... | |
struct | LoopWithoutSeqCheckingInfo |
If there is a current 'active' loop construct that does NOT have a 'seq' clause on it, this has that source location and loop Directive 'kind'. More... | |
class | OpenACCParsedClause |
A type to represent all the data for an OpenACC Clause that has been parsed, but not yet created/semantically analyzed. More... |
Public Types | |
using | DeclGroupPtrTy = OpaquePtr<DeclGroupRef> |
using | DeviceTypeArgument = IdentifierLoc |
Public Member Functions | |
bool | DiagnoseAllowedOnceClauses (OpenACCDirectiveKind DK, OpenACCClauseKind CK, SourceLocation ClauseLoc, ArrayRef< const OpenACCClause * > Clauses) |
bool | DiagnoseExclusiveClauses (OpenACCDirectiveKind DK, OpenACCClauseKind CK, SourceLocation ClauseLoc, ArrayRef< const OpenACCClause * > Clauses) |
OpenACCPrivateRecipe | CreatePrivateInitRecipe (const Expr *VarExpr) |
OpenACCFirstPrivateRecipe | CreateFirstPrivateInitRecipe (const Expr *VarExpr) |
OpenACCReductionRecipe | CreateReductionInitRecipe (OpenACCReductionOperator ReductionOperator, const Expr *VarExpr) |
ComputeConstructInfo & | getActiveComputeConstructInfo () |
SemaOpenACC (Sema &S) | |
void | ActOnWhileStmt (SourceLocation WhileLoc) |
void | ActOnDoStmt (SourceLocation DoLoc) |
void | ActOnRangeForStmtBegin (SourceLocation ForLoc, const Stmt *OldRangeFor, const Stmt *RangeFor) |
void | ActOnRangeForStmtBegin (SourceLocation ForLoc, const Stmt *RangeFor) |
void | ActOnForStmtBegin (SourceLocation ForLoc, const Stmt *First, const Stmt *Second, const Stmt *Third) |
void | ActOnForStmtBegin (SourceLocation ForLoc, const Stmt *OldFirst, const Stmt *First, const Stmt *OldSecond, const Stmt *Second, const Stmt *OldThird, const Stmt *Third) |
void | ActOnForStmtEnd (SourceLocation ForLoc, StmtResult Body) |
OpenACCClause * | ActOnClause (ArrayRef< const OpenACCClause * > ExistingClauses, OpenACCParsedClause &Clause) |
Called after parsing an OpenACC Clause so that it can be checked. | |
void | ActOnConstruct (OpenACCDirectiveKind K, SourceLocation DirLoc) |
Called after the construct has been parsed, but clauses haven't been parsed. | |
bool | ActOnStartStmtDirective (OpenACCDirectiveKind K, SourceLocation StartLoc, ArrayRef< const OpenACCClause * > Clauses) |
Called after the directive, including its clauses, have been parsed and parsing has consumed the 'annot_pragma_openacc_end' token. | |
bool | ActOnStartDeclDirective (OpenACCDirectiveKind K, SourceLocation StartLoc, ArrayRef< const OpenACCClause * > Clauses) |
Called after the directive, including its clauses, have been parsed and parsing has consumed the 'annot_pragma_openacc_end' token. | |
StmtResult | ActOnAssociatedStmt (SourceLocation DirectiveLoc, OpenACCDirectiveKind K, OpenACCAtomicKind AtKind, ArrayRef< const OpenACCClause * > Clauses, StmtResult AssocStmt) |
Called when we encounter an associated statement for our construct, this should check legality of the statement as it appertains to this Construct. | |
StmtResult | ActOnAssociatedStmt (SourceLocation DirectiveLoc, OpenACCDirectiveKind K, ArrayRef< const OpenACCClause * > Clauses, StmtResult AssocStmt) |
StmtResult | CheckAtomicAssociatedStmt (SourceLocation AtomicDirLoc, OpenACCAtomicKind AtKind, StmtResult AssocStmt) |
Called to check the form of the atomic construct which has some fairly sizable restrictions. | |
StmtResult | ActOnEndStmtDirective (OpenACCDirectiveKind K, SourceLocation StartLoc, SourceLocation DirLoc, SourceLocation LParenLoc, SourceLocation MiscLoc, ArrayRef< Expr * > Exprs, OpenACCAtomicKind AK, SourceLocation RParenLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses, StmtResult AssocStmt) |
Called after the directive has been completely parsed, including the declaration group or associated statement. | |
DeclGroupRef | ActOnEndDeclDirective (OpenACCDirectiveKind K, SourceLocation StartLoc, SourceLocation DirLoc, SourceLocation LParenLoc, SourceLocation RParenLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses) |
Called after the directive has been completely parsed, including the declaration group or associated statement. | |
void | CheckRoutineDecl (SourceLocation DirLoc, ArrayRef< const OpenACCClause * > Clauses, Decl *NextParsedDecl) |
OpenACCRoutineDecl * | CheckRoutineDecl (SourceLocation StartLoc, SourceLocation DirLoc, SourceLocation LParenLoc, Expr *FuncRef, SourceLocation RParenLoc, ArrayRef< const OpenACCClause * > Clauses, SourceLocation EndLoc) |
OpenACCRoutineDeclAttr * | mergeRoutineDeclAttr (const OpenACCRoutineDeclAttr &Old) |
DeclGroupRef | ActOnEndRoutineDeclDirective (SourceLocation StartLoc, SourceLocation DirLoc, SourceLocation LParenLoc, Expr *ReferencedFunc, SourceLocation RParenLoc, ArrayRef< const OpenACCClause * > Clauses, SourceLocation EndLoc, DeclGroupPtrTy NextDecl) |
StmtResult | ActOnEndRoutineStmtDirective (SourceLocation StartLoc, SourceLocation DirLoc, SourceLocation LParenLoc, Expr *ReferencedFunc, SourceLocation RParenLoc, ArrayRef< const OpenACCClause * > Clauses, SourceLocation EndLoc, Stmt *NextStmt) |
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'. | |
void | ActOnStartParseVar (OpenACCDirectiveKind DK, OpenACCClauseKind CK) |
Called right before a 'var' is parsed, so we can set the state for parsing a 'cache' var. | |
void | ActOnInvalidParseVar () |
Called only if the parse of a 'var' was invalid, else 'ActOnVar' should be called. | |
ExprResult | ActOnVar (OpenACCDirectiveKind DK, OpenACCClauseKind CK, Expr *VarExpr) |
Called when encountering a 'var' for OpenACC, ensures it is actually a declaration reference to a variable of the correct type. | |
ExprResult | ActOnCacheVar (Expr *VarExpr) |
Helper function called by ActonVar that is used to check a 'cache' var. | |
void | ActOnVariableDeclarator (VarDecl *VD) |
Function called when a variable declarator is created, which lets us implement the 'routine' 'function static variables' restriction. | |
void | ActOnFunctionDeclarator (FunctionDecl *FD) |
Called when a function decl is created, which lets us implement the 'routine' 'doesn't match next thing' warning. | |
void | ActOnVariableInit (VarDecl *VD, QualType InitType) |
Called when a variable is initialized, so we can implement the 'routine 'doesn't match the next thing' warning for lambda init. | |
llvm::SmallVector< Expr * > | CheckLinkClauseVarList (ArrayRef< Expr * > VarExpr) |
bool | CheckDeclareClause (SemaOpenACC::OpenACCParsedClause &Clause, OpenACCModifierKind Mods) |
ExprResult | ActOnRoutineName (Expr *RoutineName) |
ExprResult | CheckReductionVar (OpenACCDirectiveKind DirectiveKind, OpenACCReductionOperator ReductionOp, Expr *VarExpr) |
Called while semantically analyzing the reduction clause, ensuring the var is the correct kind of reference. | |
bool | CheckVarIsPointerType (OpenACCClauseKind ClauseKind, Expr *VarExpr) |
Called to check the 'var' type is a variable of pointer type, necessary for 'deviceptr' and 'attach' clauses. | |
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. | |
ExprResult | CheckCollapseLoopCount (Expr *LoopCount) |
Checks the loop depth value for a collapse clause. | |
ExprResult | CheckTileSizeExpr (Expr *SizeExpr) |
Checks a single size expr for a tile clause. | |
ExprResult | CheckGangExpr (ArrayRef< const OpenACCClause * > ExistingClauses, OpenACCDirectiveKind DK, OpenACCGangKind GK, Expr *E) |
void | CheckDeclReference (SourceLocation Loc, Expr *E, Decl *D) |
OpenACCClause * | CheckGangClause (OpenACCDirectiveKind DirKind, ArrayRef< const OpenACCClause * > ExistingClauses, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< OpenACCGangKind > GangKinds, ArrayRef< Expr * > IntExprs, SourceLocation EndLoc) |
OpenACCClause * | CheckReductionClause (ArrayRef< const OpenACCClause * > ExistingClauses, OpenACCDirectiveKind DirectiveKind, SourceLocation BeginLoc, SourceLocation LParenLoc, OpenACCReductionOperator ReductionOp, ArrayRef< Expr * > Vars, ArrayRef< OpenACCReductionRecipe > Recipes, SourceLocation EndLoc) |
ExprResult | BuildOpenACCAsteriskSizeExpr (SourceLocation AsteriskLoc) |
ExprResult | ActOnOpenACCAsteriskSizeExpr (SourceLocation AsteriskLoc) |
Public Member Functions inherited from clang::SemaBase | |
SemaBase (Sema &S) | |
ASTContext & | getASTContext () const |
DiagnosticsEngine & | getDiagnostics () const |
const LangOptions & | getLangOpts () const |
DeclContext * | getCurContext () const |
SemaDiagnosticBuilder | Diag (SourceLocation Loc, unsigned DiagID, bool DeferHint=false) |
Emit a diagnostic. | |
SemaDiagnosticBuilder | Diag (SourceLocation Loc, const PartialDiagnostic &PD, bool DeferHint=false) |
Emit a partial diagnostic. | |
SemaDiagnosticBuilder | DiagCompat (SourceLocation Loc, unsigned CompatDiagId, bool DeferHint=false) |
Emit a compatibility diagnostic. | |
PartialDiagnostic | PDiag (unsigned DiagID=0) |
Build a partial diagnostic. |
Public Attributes | |
struct clang::SemaOpenACC::LoopGangOnKernelTy | LoopGangClauseOnKernel |
SourceLocation | LoopWorkerClauseLoc |
If there is a current 'active' loop construct with a 'worker' clause on it (on any sort of construct), this has the source location for it. | |
SourceLocation | LoopVectorClauseLoc |
If there is a current 'active' loop construct with a 'vector' clause on it (on any sort of construct), this has the source location for it. | |
struct clang::SemaOpenACC::LoopWithoutSeqCheckingInfo | LoopWithoutSeqInfo |
Public Attributes inherited from clang::SemaBase | |
Sema & | SemaRef |
Definition at line 37 of file SemaOpenACC.h.
Definition at line 39 of file SemaOpenACC.h.
Definition at line 282 of file SemaOpenACC.h.
SemaOpenACC::SemaOpenACC | ( | Sema & | S | ) |
Definition at line 106 of file SemaOpenACC.cpp.
References clang::SemaBase::SemaBase().
Referenced by clang::SemaOpenACC::AssociatedStmtRAII::AssociatedStmtRAII(), and clang::SemaOpenACC::LoopInConstructRAII::LoopInConstructRAII().
ExprResult SemaOpenACC::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.
Definition at line 818 of file SemaOpenACC.cpp.
References ActOnIntExpr(), clang::SemaBase::Diag(), clang::Expr::EvaluateAsInt(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsArrayTypeUnsafe(), clang::SemaBase::getASTContext(), clang::ArraySectionExpr::getBaseOriginalType(), clang::Stmt::getBeginLoc(), clang::ArrayType::getElementType(), clang::Stmt::getEndLoc(), clang::Expr::getExprLoc(), clang::APValue::getInt(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::Invalid, clang::Type::isAnyPointerType(), clang::Type::isArrayType(), clang::Type::isConstantArrayType(), clang::Type::isDependentSizedArrayType(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Expr::isInstantiationDependent(), clang::SourceLocation::isInvalid(), clang::Type::isNonOverloadPlaceholderType(), clang::QualType::isNull(), clang::Expr::isTypeDependent(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::OK_Ordinary, clang::Result, clang::SemaBase::SemaRef, toString(), clang::Expr::EvalResult::Val, and clang::VK_LValue.
Referenced by clang::Sema::ActOnArraySubscriptExpr(), and clang::TreeTransform< AdjustConstraintDepth >::RebuildArraySectionExpr().
|
inline |
Definition at line 803 of file SemaOpenACC.h.
References ActOnAssociatedStmt(), and clang::None.
StmtResult SemaOpenACC::ActOnAssociatedStmt | ( | SourceLocation | DirectiveLoc, |
OpenACCDirectiveKind | K, | ||
OpenACCAtomicKind | AtKind, | ||
ArrayRef< const OpenACCClause * > | Clauses, | ||
StmtResult | AssocStmt ) |
Called when we encounter an associated statement for our construct, this should check legality of the statement as it appertains to this Construct.
Definition at line 2156 of file SemaOpenACC.cpp.
References clang::Atomic, clang::Cache, CheckAtomicAssociatedStmt(), clang::Collapse, clang::Data, clang::SemaBase::Diag(), clang::EnterData, clang::ExitData, clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::HostData, clang::Init, clang::isa(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Kernels, clang::KernelsLoop, clang::Loop, clang::Parallel, clang::ParallelLoop, clang::Serial, clang::SerialLoop, clang::Set, clang::Shutdown, clang::StmtError(), clang::Tile, and clang::Wait.
Referenced by ActOnAssociatedStmt(), and clang::Parser::ParseOpenACCDirectiveStmt().
ExprResult SemaOpenACC::ActOnCacheVar | ( | Expr * | VarExpr | ) |
Helper function called by ActonVar that is used to check a 'cache' var.
Definition at line 536 of file SemaOpenACC.cpp.
References clang::cast(), clang::SemaBase::Diag(), clang::ExprEmpty(), clang::ExprError(), clang::Expr::getExprLoc(), clang::Expr::IgnoreParenImpCasts(), and clang::isa().
Referenced by ActOnVar().
OpenACCClause * SemaOpenACC::ActOnClause | ( | ArrayRef< const OpenACCClause * > | ExistingClauses, |
OpenACCParsedClause & | Clause ) |
Called after parsing an OpenACC Clause so that it can be checked.
Definition at line 1886 of file SemaOpenACCClause.cpp.
References clang::cast(), clang::Invalid, and clang::Result.
void SemaOpenACC::ActOnConstruct | ( | OpenACCDirectiveKind | K, |
SourceLocation | DirLoc ) |
Called after the construct has been parsed, but clauses haven't been parsed.
This allows us to diagnose not-implemented, as well as set up any state required for parsing the clauses.
Definition at line 382 of file SemaOpenACC.cpp.
References clang::Sema::PotentiallyEvaluated, and clang::SemaBase::SemaRef.
void SemaOpenACC::ActOnDoStmt | ( | SourceLocation | DoLoc | ) |
Definition at line 1067 of file SemaOpenACC.cpp.
References clang::Collapse, clang::SemaBase::Diag(), clang::SemaBase::getLangOpts(), and clang::Tile.
DeclGroupRef SemaOpenACC::ActOnEndDeclDirective | ( | OpenACCDirectiveKind | K, |
SourceLocation | StartLoc, | ||
SourceLocation | DirLoc, | ||
SourceLocation | LParenLoc, | ||
SourceLocation | RParenLoc, | ||
SourceLocation | EndLoc, | ||
ArrayRef< OpenACCClause * > | Clauses ) |
Called after the directive has been completely parsed, including the declaration group or associated statement.
Definition at line 2303 of file SemaOpenACC.cpp.
References clang::DeclContext::addDecl(), clang::AS_public, clang::OpenACCDeclareDecl::Create(), clang::Declare, clang::SemaBase::Diag(), clang::SemaBase::getASTContext(), clang::SemaBase::getCurContext(), clang::Invalid, and clang::Routine.
Referenced by ActOnEndStmtDirective().
DeclGroupRef SemaOpenACC::ActOnEndRoutineDeclDirective | ( | SourceLocation | StartLoc, |
SourceLocation | DirLoc, | ||
SourceLocation | LParenLoc, | ||
Expr * | ReferencedFunc, | ||
SourceLocation | RParenLoc, | ||
ArrayRef< const OpenACCClause * > | Clauses, | ||
SourceLocation | EndLoc, | ||
DeclGroupPtrTy | NextDecl ) |
Definition at line 2528 of file SemaOpenACC.cpp.
References CheckRoutineDecl(), clang::OpaquePtr< PtrTy >::get(), clang::DeclGroupRef::getSingleDecl(), clang::SourceLocation::isInvalid(), and clang::DeclGroupRef::isSingleDecl().
StmtResult SemaOpenACC::ActOnEndRoutineStmtDirective | ( | SourceLocation | StartLoc, |
SourceLocation | DirLoc, | ||
SourceLocation | LParenLoc, | ||
Expr * | ReferencedFunc, | ||
SourceLocation | RParenLoc, | ||
ArrayRef< const OpenACCClause * > | Clauses, | ||
SourceLocation | EndLoc, | ||
Stmt * | NextStmt ) |
Definition at line 2550 of file SemaOpenACC.cpp.
References CheckRoutineDecl(), clang::SourceLocation::isInvalid(), clang::DeclStmt::isSingleDecl(), clang::OpaquePtr< DeclGroupRef >::make(), and clang::SemaBase::SemaRef.
StmtResult SemaOpenACC::ActOnEndStmtDirective | ( | OpenACCDirectiveKind | K, |
SourceLocation | StartLoc, | ||
SourceLocation | DirLoc, | ||
SourceLocation | LParenLoc, | ||
SourceLocation | MiscLoc, | ||
ArrayRef< Expr * > | Exprs, | ||
OpenACCAtomicKind | AK, | ||
SourceLocation | RParenLoc, | ||
SourceLocation | EndLoc, | ||
ArrayRef< OpenACCClause * > | Clauses, | ||
StmtResult | AssocStmt ) |
Called after the directive has been completely parsed, including the declaration group or associated statement.
DirLoc: Location of the actual directive keyword. LParenLoc: Location of the left paren, if it exists (not on all constructs). MiscLoc: First misc location, if necessary (not all constructs). Exprs: List of expressions on the construct itself, if necessary (not all constructs). FuncRef: used only for Routine, this is the function being referenced. AK: The atomic kind of the directive, if necessary (atomic only) RParenLoc: Location of the right paren, if it exists (not on all constructs). EndLoc: The last source location of the driective. Clauses: The list of clauses for the directive, if present. AssocStmt: The associated statement for this construct, if necessary.
Definition at line 2064 of file SemaOpenACC.cpp.
References ActOnEndDeclDirective(), clang::Atomic, clang::Cache, OpenACCAtomicConstruct::Create(), OpenACCCacheConstruct::Create(), OpenACCCombinedConstruct::Create(), OpenACCDataConstruct::Create(), OpenACCEnterDataConstruct::Create(), OpenACCExitDataConstruct::Create(), OpenACCHostDataConstruct::Create(), OpenACCInitConstruct::Create(), OpenACCLoopConstruct::Create(), OpenACCSetConstruct::Create(), OpenACCShutdownConstruct::Create(), OpenACCUpdateConstruct::Create(), OpenACCWaitConstruct::Create(), clang::Data, clang::Declare, clang::EnterData, clang::ExitData, clang::ActionResult< PtrTy, Compress >::get(), clang::SemaBase::getASTContext(), clang::HostData, clang::Init, clang::Invalid, clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Kernels, clang::KernelsLoop, clang::Loop, clang::OpaquePtr< DeclGroupRef >::make(), clang::Parallel, clang::ParallelLoop, clang::Routine, clang::SemaBase::SemaRef, clang::Serial, clang::SerialLoop, clang::Set, clang::Shutdown, clang::StmtError(), clang::Update, and clang::Wait.
Referenced by clang::Parser::ParseOpenACCDirectiveStmt(), clang::TreeTransform< AdjustConstraintDepth >::RebuildOpenACCAtomicConstruct(), clang::TreeTransform< AdjustConstraintDepth >::RebuildOpenACCCacheConstruct(), clang::TreeTransform< AdjustConstraintDepth >::RebuildOpenACCCombinedConstruct(), clang::TreeTransform< AdjustConstraintDepth >::RebuildOpenACCComputeConstruct(), clang::TreeTransform< AdjustConstraintDepth >::RebuildOpenACCDataConstruct(), clang::TreeTransform< AdjustConstraintDepth >::RebuildOpenACCEnterDataConstruct(), clang::TreeTransform< AdjustConstraintDepth >::RebuildOpenACCExitDataConstruct(), clang::TreeTransform< AdjustConstraintDepth >::RebuildOpenACCHostDataConstruct(), clang::TreeTransform< AdjustConstraintDepth >::RebuildOpenACCInitConstruct(), clang::TreeTransform< AdjustConstraintDepth >::RebuildOpenACCLoopConstruct(), clang::TreeTransform< AdjustConstraintDepth >::RebuildOpenACCSetConstruct(), clang::TreeTransform< AdjustConstraintDepth >::RebuildOpenACCShutdownConstruct(), clang::TreeTransform< AdjustConstraintDepth >::RebuildOpenACCUpdateConstruct(), and clang::TreeTransform< AdjustConstraintDepth >::RebuildOpenACCWaitConstruct().
void SemaOpenACC::ActOnForStmtBegin | ( | SourceLocation | ForLoc, |
const Stmt * | First, | ||
const Stmt * | Second, | ||
const Stmt * | Third ) |
Definition at line 1707 of file SemaOpenACC.cpp.
References clang::First, and clang::SemaBase::getLangOpts().
void SemaOpenACC::ActOnForStmtBegin | ( | SourceLocation | ForLoc, |
const Stmt * | OldFirst, | ||
const Stmt * | First, | ||
const Stmt * | OldSecond, | ||
const Stmt * | Second, | ||
const Stmt * | OldThird, | ||
const Stmt * | Third ) |
Definition at line 1689 of file SemaOpenACC.cpp.
References clang::First, and clang::SemaBase::getLangOpts().
void SemaOpenACC::ActOnForStmtEnd | ( | SourceLocation | ForLoc, |
StmtResult | Body ) |
Definition at line 1785 of file SemaOpenACC.cpp.
References clang::Collapse, clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::SemaBase::getLangOpts(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::SourceLocation::isValid(), and clang::Tile.
void SemaOpenACC::ActOnFunctionDeclarator | ( | FunctionDecl * | FD | ) |
Called when a function decl is created, which lets us implement the 'routine' 'doesn't match next thing' warning.
Definition at line 2018 of file SemaOpenACC.cpp.
References clang::SemaBase::getLangOpts().
Referenced by clang::Sema::ActOnFunctionDeclarator().
ExprResult SemaOpenACC::ActOnIntExpr | ( | OpenACCDirectiveKind | DK, |
OpenACCClauseKind | CK, | ||
SourceLocation | Loc, | ||
Expr * | IntExpr ) |
Called when encountering an 'int-expr' for OpenACC, and manages conversions and diagnostics to 'int'.
Definition at line 392 of file SemaOpenACC.cpp.
References clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Decl::getLocation(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Invalid, clang::Type::isEnumeralType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), clang::ast_matchers::match(), clang::SemaBase::SemaRef, and clang::T.
Referenced by ActOnArraySectionExpr().
void SemaOpenACC::ActOnInvalidParseVar | ( | ) |
Called only if the parse of a 'var' was invalid, else 'ActOnVar' should be called.
Definition at line 531 of file SemaOpenACC.cpp.
ExprResult SemaOpenACC::ActOnOpenACCAsteriskSizeExpr | ( | SourceLocation | AsteriskLoc | ) |
Definition at line 2588 of file SemaOpenACC.cpp.
References BuildOpenACCAsteriskSizeExpr().
Referenced by clang::TreeTransform< AdjustConstraintDepth >::RebuildOpenACCAsteriskSizeExpr().
void SemaOpenACC::ActOnRangeForStmtBegin | ( | SourceLocation | ForLoc, |
const Stmt * | OldRangeFor, | ||
const Stmt * | RangeFor ) |
Definition at line 1722 of file SemaOpenACC.cpp.
References clang::SemaBase::getLangOpts().
void SemaOpenACC::ActOnRangeForStmtBegin | ( | SourceLocation | ForLoc, |
const Stmt * | RangeFor ) |
Definition at line 1739 of file SemaOpenACC.cpp.
References clang::SemaBase::getLangOpts().
ExprResult SemaOpenACC::ActOnRoutineName | ( | Expr * | RoutineName | ) |
Definition at line 1864 of file SemaOpenACC.cpp.
References clang::SemaBase::Diag(), clang::ExprError(), clang::Type::getAsCXXRecordDecl(), clang::Stmt::getBeginLoc(), clang::Expr::IgnoreParenImpCasts(), clang::isa(), clang::Type::isDependentType(), and clang::QualType::isNull().
bool SemaOpenACC::ActOnStartDeclDirective | ( | OpenACCDirectiveKind | K, |
SourceLocation | StartLoc, | ||
ArrayRef< const OpenACCClause * > | Clauses ) |
Called after the directive, including its clauses, have been parsed and parsing has consumed the 'annot_pragma_openacc_end' token.
This DOES happen before any associated declarations or statements have been parsed. This function is only called when we are parsing a 'Decl' context.
Definition at line 2285 of file SemaOpenACC.cpp.
References clang::Routine, and clang::SemaBase::SemaRef.
Referenced by ActOnStartStmtDirective().
void SemaOpenACC::ActOnStartParseVar | ( | OpenACCDirectiveKind | DK, |
OpenACCClauseKind | CK ) |
Called right before a 'var' is parsed, so we can set the state for parsing a 'cache' var.
Definition at line 523 of file SemaOpenACC.cpp.
References clang::Cache.
bool SemaOpenACC::ActOnStartStmtDirective | ( | OpenACCDirectiveKind | K, |
SourceLocation | StartLoc, | ||
ArrayRef< const OpenACCClause * > | Clauses ) |
Called after the directive, including its clauses, have been parsed and parsing has consumed the 'annot_pragma_openacc_end' token.
This DOES happen before any associated declarations or statements have been parsed. This function is only called when we are parsing a 'statement' context.
Definition at line 2024 of file SemaOpenACC.cpp.
References ActOnStartDeclDirective(), clang::Collapse, clang::Declare, clang::SemaBase::Diag(), clang::Routine, clang::SemaBase::SemaRef, and clang::Tile.
ExprResult SemaOpenACC::ActOnVar | ( | OpenACCDirectiveKind | DK, |
OpenACCClauseKind | CK, | ||
Expr * | VarExpr ) |
Called when encountering a 'var' for OpenACC, ensures it is actually a declaration reference to a variable of the correct type.
Definition at line 718 of file SemaOpenACC.cpp.
References ActOnCacheVar(), clang::Cache, clang::cast(), clang::Declare, clang::SemaBase::Diag(), clang::ExprError(), clang::Expr::getExprLoc(), clang::Expr::IgnoreParenImpCasts(), clang::isa(), clang::Reduction, and clang::UseDevice.
void SemaOpenACC::ActOnVariableDeclarator | ( | VarDecl * | VD | ) |
Function called when a variable declarator is created, which lets us implement the 'routine' 'function static variables' restriction.
Definition at line 1919 of file SemaOpenACC.cpp.
References clang::SemaBase::Diag(), clang::DeclaratorDecl::getBeginLoc(), clang::SemaBase::getCurContext(), clang::SemaBase::getLangOpts(), clang::isa(), clang::Decl::isInvalidDecl(), clang::VarDecl::isStaticLocal(), and clang::Routine.
Referenced by clang::Sema::ActOnVariableDeclarator().
Called when a variable is initialized, so we can implement the 'routine 'doesn't match the next thing' warning for lambda init.
Definition at line 2000 of file SemaOpenACC.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::SemaBase::getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::DeclContext::isDependentContext(), and clang::QualType::isNull().
Referenced by clang::Sema::AddInitializerToDecl().
void SemaOpenACC::ActOnWhileStmt | ( | SourceLocation | WhileLoc | ) |
Definition at line 1032 of file SemaOpenACC.cpp.
References clang::Collapse, clang::SemaBase::Diag(), clang::SemaBase::getLangOpts(), and clang::Tile.
ExprResult SemaOpenACC::BuildOpenACCAsteriskSizeExpr | ( | SourceLocation | AsteriskLoc | ) |
Definition at line 2583 of file SemaOpenACC.cpp.
References clang::OpenACCAsteriskSizeExpr::Create(), and clang::SemaBase::getASTContext().
Referenced by ActOnOpenACCAsteriskSizeExpr().
StmtResult SemaOpenACC::CheckAtomicAssociatedStmt | ( | SourceLocation | AtomicDirLoc, |
OpenACCAtomicKind | AtKind, | ||
StmtResult | AssocStmt ) |
Called to check the form of the atomic construct which has some fairly sizable restrictions.
Definition at line 732 of file SemaOpenACCAtomic.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), clang::isa(), and clang::ActionResult< PtrTy, Compress >::isUsable().
Referenced by ActOnAssociatedStmt().
ExprResult SemaOpenACC::CheckCollapseLoopCount | ( | Expr * | LoopCount | ) |
Checks the loop depth value for a collapse clause.
Definition at line 2075 of file SemaOpenACCClause.cpp.
References clang::ConstantExpr::Create(), Diag(), clang::ExprError(), clang::SemaBase::getASTContext(), clang::Stmt::getBeginLoc(), clang::Expr::getIntegerConstantExpr(), clang::Expr::getType(), clang::Expr::isInstantiationDependent(), and clang::Type::isIntegerType().
bool SemaOpenACC::CheckDeclareClause | ( | SemaOpenACC::OpenACCParsedClause & | Clause, |
OpenACCModifierKind | Mods ) |
Definition at line 2272 of file SemaOpenACCClause.cpp.
References clang::cast(), clang::CopyIn, clang::Create, clang::Declare, clang::DevicePtr, clang::DeviceResident, Diag(), clang::Decl::getCanonicalDecl(), clang::SemaBase::getCurContext(), clang::Decl::getLexicalDeclContext(), clang::DeclContext::getPrimaryContext(), clang::Expr::IgnoreParenImpCasts(), clang::isa(), and clang::Link.
void SemaOpenACC::CheckDeclReference | ( | SourceLocation | Loc, |
Expr * | E, | ||
Decl * | D ) |
Definition at line 590 of file SemaOpenACC.cpp.
References clang::SemaBase::Diag(), clang::Scope::getDepth(), clang::SemaBase::getLangOpts(), clang::Scope::getParent(), clang::Scope::isDeclScope(), clang::Decl::isInvalidDecl(), clang::Scope::isOpenACCLoopConstructScope(), and clang::SemaBase::SemaRef.
Referenced by MarkExprReferenced().
OpenACCClause * SemaOpenACC::CheckGangClause | ( | OpenACCDirectiveKind | DirKind, |
ArrayRef< const OpenACCClause * > | ExistingClauses, | ||
SourceLocation | BeginLoc, | ||
SourceLocation | LParenLoc, | ||
ArrayRef< OpenACCGangKind > | GangKinds, | ||
ArrayRef< Expr * > | IntExprs, | ||
SourceLocation | EndLoc ) |
Definition at line 2155 of file SemaOpenACCClause.cpp.
References clang::OpenACCGangClause::Create(), Diag(), clang::Dim, clang::SemaBase::getASTContext(), clang::isa(), clang::Expr::isInstantiationDependent(), and clang::Routine.
ExprResult SemaOpenACC::CheckGangExpr | ( | ArrayRef< const OpenACCClause * > | ExistingClauses, |
OpenACCDirectiveKind | DK, | ||
OpenACCGangKind | GK, | ||
Expr * | E ) |
Definition at line 2104 of file SemaOpenACCClause.cpp.
References clang::ExprError(), clang::Invalid, clang::Kernels, clang::KernelsLoop, clang::Loop, clang::Parallel, clang::ParallelLoop, clang::Routine, clang::Serial, and clang::SerialLoop.
llvm::SmallVector< Expr * > SemaOpenACC::CheckLinkClauseVarList | ( | ArrayRef< Expr * > | VarExpr | ) |
Definition at line 2236 of file SemaOpenACCClause.cpp.
References clang::cast(), Diag(), clang::SemaBase::getCurContext(), clang::VarDecl::hasExternalStorage(), and clang::isa().
OpenACCClause * SemaOpenACC::CheckReductionClause | ( | ArrayRef< const OpenACCClause * > | ExistingClauses, |
OpenACCDirectiveKind | DirectiveKind, | ||
SourceLocation | BeginLoc, | ||
SourceLocation | LParenLoc, | ||
OpenACCReductionOperator | ReductionOp, | ||
ArrayRef< Expr * > | Vars, | ||
ArrayRef< OpenACCReductionRecipe > | Recipes, | ||
SourceLocation | EndLoc ) |
Definition at line 2197 of file SemaOpenACCClause.cpp.
References clang::cast(), clang::OpenACCReductionClause::Create(), Diag(), clang::Dim, clang::SemaBase::getASTContext(), clang::isOpenACCCombinedDirectiveKind(), and clang::Loop.
ExprResult SemaOpenACC::CheckReductionVar | ( | OpenACCDirectiveKind | DirectiveKind, |
OpenACCReductionOperator | ReductionOp, | ||
Expr * | VarExpr ) |
Called while semantically analyzing the reduction clause, ensuring the var is the correct kind of reference.
OpenACC 3.3 section 2.5.15: At a mininmum, the supported data types include ... the numerical data types in C, C++, and Fortran.
If the reduction var is a composite variable, each member of the composite variable must be a supported datatype for the reduction operation.
Definition at line 1925 of file SemaOpenACCClause.cpp.
References Diag(), clang::ExprError(), clang::Type::getAsRecordDecl(), clang::SemaBase::getASTContext(), clang::ArraySectionExpr::getBaseOriginalType(), clang::Stmt::getBeginLoc(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::Expr::IgnoreParenCasts(), clang::Expr::isInstantiationDependent(), and clang::SemaBase::PDiag().
void SemaOpenACC::CheckRoutineDecl | ( | SourceLocation | DirLoc, |
ArrayRef< const OpenACCClause * > | Clauses, | ||
Decl * | NextParsedDecl ) |
Definition at line 2393 of file SemaOpenACC.cpp.
References clang::Decl::attrs(), clang::cast(), clang::SemaBase::Diag(), clang::FunctionDecl::getCanonicalDecl(), clang::Routine, and clang::SemaBase::SemaRef.
Referenced by ActOnEndRoutineDeclDirective(), and ActOnEndRoutineStmtDirective().
OpenACCRoutineDecl * SemaOpenACC::CheckRoutineDecl | ( | SourceLocation | StartLoc, |
SourceLocation | DirLoc, | ||
SourceLocation | LParenLoc, | ||
Expr * | FuncRef, | ||
SourceLocation | RParenLoc, | ||
ArrayRef< const OpenACCClause * > | Clauses, | ||
SourceLocation | EndLoc ) |
Definition at line 2454 of file SemaOpenACC.cpp.
References clang::DeclContext::addDecl(), clang::AS_public, clang::OpenACCRoutineDecl::Create(), clang::SemaBase::Diag(), clang::SemaBase::getASTContext(), clang::SemaBase::getCurContext(), clang::SourceLocation::isValid(), and clang::Routine.
ExprResult SemaOpenACC::CheckTileSizeExpr | ( | Expr * | SizeExpr | ) |
Checks a single size expr for a tile clause.
Definition at line 2047 of file SemaOpenACCClause.cpp.
References clang::ConstantExpr::Create(), Diag(), clang::ExprError(), clang::SemaBase::getASTContext(), clang::Stmt::getBeginLoc(), clang::Expr::getIntegerConstantExpr(), clang::Expr::getType(), clang::isa(), clang::Expr::isInstantiationDependent(), and clang::Type::isIntegerType().
bool SemaOpenACC::CheckVarIsPointerType | ( | OpenACCClauseKind | ClauseKind, |
Expr * | VarExpr ) |
Called to check the 'var' type is a variable of pointer type, necessary for 'deviceptr' and 'attach' clauses.
Returns true on success.
Definition at line 493 of file SemaOpenACC.cpp.
References clang::Expr::containsErrors(), clang::SemaBase::Diag(), clang::Expr::getExprLoc(), clang::QualType::getNonReferenceType(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::Expr::hasPlaceholderType(), clang::Expr::IgnoreParenImpCasts(), clang::isa(), clang::Type::isDependentType(), and clang::Type::isPointerType().
OpenACCFirstPrivateRecipe SemaOpenACC::CreateFirstPrivateInitRecipe | ( | const Expr * | VarExpr | ) |
Definition at line 2787 of file SemaOpenACC.cpp.
References clang::DeclRefExpr::Create(), clang::ImplicitCastExpr::Create(), clang::IntegerLiteral::Create(), clang::InitializationKind::CreateCopy(), clang::OpenACCFirstPrivateRecipe::Empty(), clang::ActionResult< PtrTy, Compress >::get(), clang::ASTContext::getAsConstantArrayType(), clang::SemaBase::getASTContext(), clang::Stmt::getBeginLoc(), clang::NamedDecl::getDeclName(), clang::Stmt::getEndLoc(), clang::QualType::getNonReferenceType(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::Init, clang::InitializedEntity::InitializeElement(), clang::InitializedEntity::InitializeVariable(), clang::Type::isDependentType(), clang::NOUR_None, clang::OK_Ordinary, clang::InitializationSequence::Perform(), clang::SemaBase::SemaRef, clang::Expr::setType(), and clang::VK_LValue.
OpenACCPrivateRecipe SemaOpenACC::CreatePrivateInitRecipe | ( | const Expr * | VarExpr | ) |
Definition at line 2760 of file SemaOpenACC.cpp.
References clang::InitializationKind::CreateDefault(), clang::OpenACCPrivateRecipe::Empty(), clang::SemaBase::getASTContext(), clang::Stmt::getBeginLoc(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::Init, clang::InitializedEntity::InitializeVariable(), clang::Type::isDependentType(), clang::InitializationSequence::Perform(), and clang::SemaBase::SemaRef.
OpenACCReductionRecipe SemaOpenACC::CreateReductionInitRecipe | ( | OpenACCReductionOperator | ReductionOperator, |
const Expr * | VarExpr ) |
Definition at line 2870 of file SemaOpenACC.cpp.
References clang::Addition, clang::And, clang::BitwiseAnd, clang::BitwiseOr, clang::BitwiseXOr, clang::OpenACCReductionRecipe::Empty(), clang::SemaBase::getASTContext(), clang::Stmt::getBeginLoc(), clang::QualType::getNonReferenceType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::Init, clang::InitializedEntity::InitializeVariable(), clang::Invalid, clang::Type::isDependentType(), clang::Max, clang::Min, clang::Multiplication, clang::Or, and clang::SemaBase::SemaRef.
bool SemaOpenACC::DiagnoseAllowedOnceClauses | ( | OpenACCDirectiveKind | DK, |
OpenACCClauseKind | CK, | ||
SourceLocation | ClauseLoc, | ||
ArrayRef< const OpenACCClause * > | Clauses ) |
Definition at line 161 of file SemaOpenACCClauseAppertainment.cpp.
References clang::C, clang::SemaBase::Diag(), and clang::Invalid.
bool SemaOpenACC::DiagnoseExclusiveClauses | ( | OpenACCDirectiveKind | DK, |
OpenACCClauseKind | CK, | ||
SourceLocation | ClauseLoc, | ||
ArrayRef< const OpenACCClause * > | Clauses ) |
Definition at line 187 of file SemaOpenACCClauseAppertainment.cpp.
References clang::C, clang::SemaBase::Diag(), and clang::Invalid.
|
inline |
Definition at line 248 of file SemaOpenACC.h.
OpenACCRoutineDeclAttr * SemaOpenACC::mergeRoutineDeclAttr | ( | const OpenACCRoutineDeclAttr & | Old | ) |
Definition at line 2574 of file SemaOpenACC.cpp.
References clang::SemaBase::getASTContext(), and New.
Referenced by mergeDeclAttribute().
struct clang::SemaOpenACC::LoopGangOnKernelTy clang::SemaOpenACC::LoopGangClauseOnKernel |
Referenced by clang::SemaOpenACC::AssociatedStmtRAII::AssociatedStmtRAII().
SourceLocation clang::SemaOpenACC::LoopVectorClauseLoc |
If there is a current 'active' loop construct with a 'vector' clause on it (on any sort of construct), this has the source location for it.
This permits us to implement the restriction of no further 'gang', 'vector', or 'worker' clauses.
Definition at line 270 of file SemaOpenACC.h.
Referenced by clang::SemaOpenACC::AssociatedStmtRAII::AssociatedStmtRAII().
struct clang::SemaOpenACC::LoopWithoutSeqCheckingInfo clang::SemaOpenACC::LoopWithoutSeqInfo |
Referenced by clang::SemaOpenACC::AssociatedStmtRAII::AssociatedStmtRAII().
SourceLocation clang::SemaOpenACC::LoopWorkerClauseLoc |
If there is a current 'active' loop construct with a 'worker' clause on it (on any sort of construct), this has the source location for it.
This permits us to implement the restriction of no further 'gang' or 'worker' clauses.
Definition at line 265 of file SemaOpenACC.h.
Referenced by clang::SemaOpenACC::AssociatedStmtRAII::AssociatedStmtRAII().