clang 19.0.0git
Classes | Public Types | Public Member Functions | List of all members
clang::SemaOpenACC Class Reference

#include "clang/Sema/SemaOpenACC.h"

Inheritance diagram for clang::SemaOpenACC:
Inheritance graph
[legend]

Classes

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 DeviceTypeArgument = std::pair< IdentifierInfo *, SourceLocation >
 

Public Member Functions

 SemaOpenACC (Sema &S)
 
OpenACCClauseActOnClause (ArrayRef< const OpenACCClause * > ExistingClauses, OpenACCParsedClause &Clause)
 Called after parsing an OpenACC Clause so that it can be checked.
 
void ActOnConstruct (OpenACCDirectiveKind K, SourceLocation StartLoc)
 Called after the construct has been parsed, but clauses haven't been parsed.
 
bool ActOnStartStmtDirective (OpenACCDirectiveKind K, SourceLocation StartLoc)
 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)
 Called after the directive, including its clauses, have been parsed and parsing has consumed the 'annot_pragma_openacc_end' token.
 
StmtResult ActOnAssociatedStmt (OpenACCDirectiveKind K, 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 ActOnEndStmtDirective (OpenACCDirectiveKind K, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses, StmtResult AssocStmt)
 Called after the directive has been completely parsed, including the declaration group or associated statement.
 
DeclGroupRef ActOnEndDeclDirective ()
 Called after the directive has been completely parsed, including the declaration group or associated statement.
 
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'.
 
ExprResult ActOnVar (Expr *VarExpr)
 Called when encountering a 'var' for OpenACC, ensures it is actually a declaration reference to a variable of the correct type.
 
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.
 
- Public Member Functions inherited from clang::SemaBase
 SemaBase (Sema &S)
 
ASTContextgetASTContext () const
 
DiagnosticsEnginegetDiagnostics () const
 
const LangOptionsgetLangOpts () 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.
 

Additional Inherited Members

- Public Attributes inherited from clang::SemaBase
SemaSemaRef
 

Detailed Description

Definition at line 27 of file SemaOpenACC.h.

Member Typedef Documentation

◆ DeviceTypeArgument

Definition at line 30 of file SemaOpenACC.h.

Constructor & Destructor Documentation

◆ SemaOpenACC()

SemaOpenACC::SemaOpenACC ( Sema S)

Definition at line 287 of file SemaOpenACC.cpp.

Member Function Documentation

◆ ActOnArraySectionExpr()

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 913 of file SemaOpenACC.cpp.

References ActOnIntExpr(), clang::ASTContext::ArraySectionTy, clang::Sema::CheckPlaceholderExpr(), clang::Sema::CreateRecoveryExpr(), clang::Sema::DefaultFunctionArrayLvalueConversion(), clang::Sema::DefaultLvalueConversion(), clang::ASTContext::DependentTy, clang::SemaBase::Diag(), clang::Expr::EvaluateAsInt(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsArrayTypeUnsafe(), clang::ASTContext::getAsConstantArrayType(), 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::ConstantArrayType::getSize(), clang::Expr::getType(), clang::ASTContext::IntTy, clang::Invalid, clang::Type::isAnyPointerType(), clang::Type::isArrayType(), clang::Type::isConstantArrayType(), clang::Type::isDependentSizedArrayType(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Expr::isInstantiationDependent(), clang::Type::isNonOverloadPlaceholderType(), clang::QualType::isNull(), clang::Expr::isTypeDependent(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::OK_Ordinary, clang::Sema::RequireCompleteType(), clang::Result, clang::SemaBase::SemaRef, toString(), clang::Expr::EvalResult::Val, and clang::VK_LValue.

Referenced by clang::Sema::ActOnArraySubscriptExpr(), and clang::TreeTransform< Derived >::RebuildArraySectionExpr().

◆ ActOnAssociatedStmt()

StmtResult SemaOpenACC::ActOnAssociatedStmt ( OpenACCDirectiveKind  K,
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 1153 of file SemaOpenACC.cpp.

References clang::Kernels, clang::Parallel, and clang::Serial.

Referenced by clang::Parser::ParseOpenACCDirectiveStmt().

◆ ActOnClause()

OpenACCClause * SemaOpenACC::ActOnClause ( ArrayRef< const OpenACCClause * >  ExistingClauses,
OpenACCParsedClause Clause 
)

Called after parsing an OpenACC Clause so that it can be checked.

Definition at line 290 of file SemaOpenACC.cpp.

References clang::Async, clang::Attach, clang::C, clang::Copy, clang::CopyIn, clang::CopyOut, clang::OpenACCDeviceTypeClause::Create(), clang::OpenACCCopyClause::Create(), clang::OpenACCCopyInClause::Create(), clang::OpenACCCopyOutClause::Create(), clang::OpenACCCreateClause::Create(), clang::OpenACCDefaultClause::Create(), clang::OpenACCNumGangsClause::Create(), clang::OpenACCPrivateClause::Create(), clang::OpenACCFirstPrivateClause::Create(), clang::OpenACCDevicePtrClause::Create(), clang::OpenACCAttachClause::Create(), clang::OpenACCNoCreateClause::Create(), clang::OpenACCPresentClause::Create(), clang::OpenACCIfClause::Create(), clang::OpenACCSelfClause::Create(), clang::OpenACCWaitClause::Create(), clang::OpenACCNumWorkersClause::Create(), clang::OpenACCVectorLengthClause::Create(), clang::OpenACCAsyncClause::Create(), clang::Create, clang::Default, clang::DevicePtr, clang::DeviceType, clang::SemaBase::Diag(), clang::DType, clang::FirstPrivate, clang::SemaBase::getASTContext(), clang::SemaOpenACC::OpenACCParsedClause::getBeginLoc(), clang::SemaOpenACC::OpenACCParsedClause::getClauseKind(), clang::SemaOpenACC::OpenACCParsedClause::getConditionExpr(), clang::SemaOpenACC::OpenACCParsedClause::getDefaultClauseKind(), clang::SemaOpenACC::OpenACCParsedClause::getDeviceTypeArchitectures(), clang::SemaOpenACC::OpenACCParsedClause::getDevNumExpr(), clang::SemaOpenACC::OpenACCParsedClause::getDirectiveKind(), clang::SemaOpenACC::OpenACCParsedClause::getEndLoc(), clang::SemaOpenACC::OpenACCParsedClause::getIntExprs(), clang::SemaOpenACC::OpenACCParsedClause::getLParenLoc(), clang::SemaOpenACC::OpenACCParsedClause::getNumIntExprs(), clang::SemaOpenACC::OpenACCParsedClause::getQueueIdExprs(), clang::SemaOpenACC::OpenACCParsedClause::getQueuesLoc(), clang::SemaOpenACC::OpenACCParsedClause::getVarList(), clang::If, clang::Invalid, clang::isOpenACCComputeDirectiveKind(), clang::SemaOpenACC::OpenACCParsedClause::isReadOnly(), clang::SemaOpenACC::OpenACCParsedClause::isZero(), clang::NoCreate, clang::NumGangs, clang::NumWorkers, clang::Parallel, clang::ParallelLoop, clang::PCopy, clang::PCopyIn, clang::PCopyOut, clang::PCreate, clang::Present, clang::PresentOrCopy, clang::PresentOrCopyIn, clang::PresentOrCopyOut, clang::PresentOrCreate, clang::Private, clang::Self, clang::SemaOpenACC::OpenACCParsedClause::setVarListDetails(), clang::VectorLength, and clang::Wait.

◆ ActOnConstruct()

void SemaOpenACC::ActOnConstruct ( OpenACCDirectiveKind  K,
SourceLocation  StartLoc 
)

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 718 of file SemaOpenACC.cpp.

References clang::SemaBase::Diag(), clang::Invalid, clang::Kernels, clang::Parallel, and clang::Serial.

◆ ActOnEndDeclDirective()

DeclGroupRef SemaOpenACC::ActOnEndDeclDirective ( )

Called after the directive has been completely parsed, including the declaration group or associated statement.

Definition at line 1180 of file SemaOpenACC.cpp.

◆ ActOnEndStmtDirective()

StmtResult SemaOpenACC::ActOnEndStmtDirective ( OpenACCDirectiveKind  K,
SourceLocation  StartLoc,
SourceLocation  EndLoc,
ArrayRef< OpenACCClause * >  Clauses,
StmtResult  AssocStmt 
)

◆ ActOnIntExpr()

ExprResult SemaOpenACC::ActOnIntExpr ( OpenACCDirectiveKind  DK,
OpenACCClauseKind  CK,
SourceLocation  Loc,
Expr IntExpr 
)

◆ ActOnStartDeclDirective()

bool SemaOpenACC::ActOnStartDeclDirective ( OpenACCDirectiveKind  K,
SourceLocation  StartLoc 
)

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 1175 of file SemaOpenACC.cpp.

◆ ActOnStartStmtDirective()

bool SemaOpenACC::ActOnStartStmtDirective ( OpenACCDirectiveKind  K,
SourceLocation  StartLoc 
)

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 1127 of file SemaOpenACC.cpp.

◆ ActOnVar()

ExprResult SemaOpenACC::ActOnVar ( 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 867 of file SemaOpenACC.cpp.

References clang::SemaBase::Diag(), clang::ExprError(), clang::Expr::getExprLoc(), and clang::Expr::IgnoreParenImpCasts().

◆ CheckVarIsPointerType()

bool SemaOpenACC::CheckVarIsPointerType ( OpenACCClauseKind  ClauseKind,
Expr VarExpr 
)

The documentation for this class was generated from the following files: