clang 20.0.0git
Classes | Macros | Functions
SemaOpenMP.cpp File Reference

This file implements semantic analysis for OpenMP directives and clauses. More...

#include "clang/Sema/SemaOpenMP.h"
#include "TreeTransform.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclOpenMP.h"
#include "clang/AST/OpenMPClause.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/StmtCXX.h"
#include "clang/AST/StmtOpenMP.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/AST/TypeOrdering.h"
#include "clang/Basic/DiagnosticSema.h"
#include "clang/Basic/OpenMPKinds.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Sema/EnterExpressionEvaluationContext.h"
#include "clang/Sema/Initialization.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/ParsedAttr.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/Sema.h"
#include "clang/Sema/SemaInternal.h"
#include "llvm/ADT/IndexedMap.h"
#include "llvm/ADT/PointerEmbeddedInt.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Frontend/OpenMP/OMPAssume.h"
#include "llvm/Frontend/OpenMP/OMPConstants.h"
#include "llvm/IR/Assumptions.h"
#include <optional>
#include <set>

Go to the source code of this file.

Classes

struct  Kind2Unsigned
 
class  ForVarDeclFinder
 Look for variables declared in the body parts of a for-loop nest. More...
 
class  GlobalDeclRefChecker
 This class visits every VarDecl that the initializer references and adds OMPDeclareTargetDeclAttr to each of them. More...
 

Macros

#define DSAStack   static_cast<DSAStackTy *>(VarDataSharingAttributesStack)
 

Functions

static const ExprcheckMapClauseExpressionBase (Sema &SemaRef, Expr *E, OMPClauseMappableExprCommon::MappableExprComponentList &CurComponents, OpenMPClauseKind CKind, OpenMPDirectiveKind DKind, bool NoDiagnose)
 Return the expression of the base of the mappable expression or null if it cannot be determined and do all the necessary checks to see if the expression is valid as a standalone mappable expression.
 
static const ExprgetExprAsWritten (const Expr *E)
 
static ExprgetExprAsWritten (Expr *E)
 
static const ValueDeclgetCanonicalDecl (const ValueDecl *D)
 
static ValueDeclgetCanonicalDecl (ValueDecl *D)
 
static VarDeclbuildVarDecl (Sema &SemaRef, SourceLocation Loc, QualType Type, StringRef Name, const AttrVec *Attrs=nullptr, DeclRefExpr *OrigRef=nullptr)
 Build a variable declaration for OpenMP loop iteration variable.
 
static DeclRefExprbuildDeclRefExpr (Sema &S, VarDecl *D, QualType Ty, SourceLocation Loc, bool RefersToCapture=false)
 
static bool isConstNotMutableType (Sema &SemaRef, QualType Type, bool AcceptIfMutable=true, bool *IsClassType=nullptr)
 
static bool rejectConstNotMutableType (Sema &SemaRef, const ValueDecl *D, QualType Type, OpenMPClauseKind CKind, SourceLocation ELoc, bool AcceptIfMutable=true, bool ListItemNotVar=false)
 
static bool isOpenMPDeviceDelayedContext (Sema &S)
 
static OpenMPDefaultmapClauseKind getVariableCategoryFromDecl (const LangOptions &LO, const ValueDecl *VD)
 
static OMPCapturedExprDeclbuildCaptureDecl (Sema &S, IdentifierInfo *Id, Expr *CaptureExpr, bool WithInit, DeclContext *CurContext, bool AsExpression)
 
static std::pair< ValueDecl *, boolgetPrivateItem (Sema &S, Expr *&RefExpr, SourceLocation &ELoc, SourceRange &ERange, bool AllowArraySection=false, StringRef DiagType="")
 
static void checkReductionClauses (Sema &S, DSAStackTy *Stack, ArrayRef< OMPClause * > Clauses)
 Check consistency of the reduction clauses.
 
static void checkAllocateClauses (Sema &S, DSAStackTy *Stack, ArrayRef< OMPClause * > Clauses)
 
static DeclRefExprbuildCapture (Sema &S, ValueDecl *D, Expr *CaptureExpr, bool WithInit)
 
static void reportOriginalDsa (Sema &SemaRef, const DSAStackTy *Stack, const ValueDecl *D, const DSAStackTy::DSAVarData &DVar, bool IsLoopIterVar=false)
 
static bool FinishOpenMPLinearClause (OMPLinearClause &Clause, DeclRefExpr *IV, Expr *NumIterations, Sema &SemaRef, Scope *S, DSAStackTy *Stack)
 
static bool finishLinearClauses (Sema &SemaRef, ArrayRef< OMPClause * > Clauses, OMPLoopBasedDirective::HelperExprs &B, DSAStackTy *Stack)
 
static OMPAllocateDeclAttr::AllocatorTypeTy getAllocatorKind (Sema &S, DSAStackTy *Stack, Expr *Allocator)
 
static bool checkPreviousOMPAllocateAttribute (Sema &S, DSAStackTy *Stack, Expr *RefExpr, VarDecl *VD, OMPAllocateDeclAttr::AllocatorTypeTy AllocatorKind, Expr *Allocator)
 
static void applyOMPAllocateAttribute (Sema &S, VarDecl *VD, OMPAllocateDeclAttr::AllocatorTypeTy AllocatorKind, Expr *Allocator, Expr *Alignment, SourceRange SR)
 
static OpenMPMapClauseKind getMapClauseKindFromModifier (OpenMPDefaultmapClauseModifier M, bool IsAggregateOrDeclareTarget)
 
static void handleDeclareVariantConstructTrait (DSAStackTy *Stack, OpenMPDirectiveKind DKind, bool ScopeEntry)
 
static SmallVector< SemaOpenMP::CapturedParamNameTypegetParallelRegionParams (Sema &SemaRef, bool LoopBoundSharing)
 
static SmallVector< SemaOpenMP::CapturedParamNameTypegetTeamsRegionParams (Sema &SemaRef)
 
static SmallVector< SemaOpenMP::CapturedParamNameTypegetTaskRegionParams (Sema &SemaRef)
 
static SmallVector< SemaOpenMP::CapturedParamNameTypegetTargetRegionParams (Sema &SemaRef)
 
static SmallVector< SemaOpenMP::CapturedParamNameTypegetUnknownRegionParams (Sema &SemaRef)
 
static SmallVector< SemaOpenMP::CapturedParamNameTypegetTaskloopRegionParams (Sema &SemaRef)
 
static void processCapturedRegions (Sema &SemaRef, OpenMPDirectiveKind DKind, Scope *CurScope, SourceLocation Loc)
 
static ExprResult buildCapture (Sema &S, Expr *CaptureExpr, DeclRefExpr *&Ref, StringRef Name)
 
static bool checkOrderedOrderSpecified (Sema &S, const ArrayRef< OMPClause * > Clauses)
 
static bool checkCancelRegion (Sema &SemaRef, OpenMPDirectiveKind CurrentRegion, OpenMPDirectiveKind CancelRegion, SourceLocation StartLoc)
 
static bool checkNestingOfRegions (Sema &SemaRef, const DSAStackTy *Stack, OpenMPDirectiveKind CurrentRegion, const DeclarationNameInfo &CurrentName, OpenMPDirectiveKind CancelRegion, OpenMPBindClauseKind BindKind, SourceLocation StartLoc)
 
static bool checkIfClauses (Sema &S, OpenMPDirectiveKind Kind, ArrayRef< OMPClause * > Clauses, ArrayRef< OpenMPDirectiveKind > AllowedNameModifiers)
 
static VarDeclprecomputeExpr (Sema &Actions, SmallVectorImpl< Stmt * > &BodyStmts, Expr *E, StringRef Name)
 
static CapturedStmtbuildDistanceFunc (Sema &Actions, QualType LogicalTy, BinaryOperator::Opcode Rel, Expr *StartExpr, Expr *StopExpr, Expr *StepExpr)
 Create a closure that computes the number of iterations of a loop.
 
static CapturedStmtbuildLoopVarFunc (Sema &Actions, QualType LoopVarTy, QualType LogicalTy, DeclRefExpr *StartExpr, Expr *Step, bool Deref)
 Create a closure that computes the loop variable from the logical iteration number.
 
static ExprResult buildUserDefinedMapperRef (Sema &SemaRef, Scope *S, CXXScopeSpec &MapperIdScopeSpec, const DeclarationNameInfo &MapperId, QualType Type, Expr *UnresolvedMapper)
 
static void processImplicitMapsWithDefaultMappers (Sema &S, DSAStackTy *Stack, SmallVectorImpl< OMPClause * > &Clauses)
 Perform DFS through the structure/class data members trying to find member(s) with user-defined 'default' mapper and generate implicit map clauses for such members with the found 'default' mapper.
 
static bool teamsLoopCanBeParallelFor (Stmt *AStmt, Sema &SemaRef)
 
static void setPrototype (Sema &S, FunctionDecl *FD, FunctionDecl *FDWithProto, QualType NewType)
 
static CapturedStmtsetBranchProtectedScope (Sema &SemaRef, OpenMPDirectiveKind DKind, Stmt *AStmt)
 
static bool checkOpenMPIterationSpace (OpenMPDirectiveKind DKind, Stmt *S, Sema &SemaRef, DSAStackTy &DSA, unsigned CurrentNestedLoopCount, unsigned NestedLoopCount, unsigned TotalNestedLoopCount, Expr *CollapseLoopCountExpr, Expr *OrderedLoopCountExpr, SemaOpenMP::VarsWithInheritedDSAType &VarsWithImplicitDSA, llvm::MutableArrayRef< LoopIterationSpace > ResultIterSpaces, llvm::MapVector< const Expr *, DeclRefExpr * > &Captures, const llvm::SmallPtrSetImpl< const Decl * > &CollapsedLoopVarDecls)
 Called on a for stmt to check and extract its iteration space for further processing (such as collapsing).
 
static ExprResult buildCounterInit (Sema &SemaRef, Scope *S, SourceLocation Loc, ExprResult VarRef, ExprResult Start, bool IsNonRectangularLB, llvm::MapVector< const Expr *, DeclRefExpr * > &Captures)
 Build 'VarRef = Start.
 
static ExprResult buildCounterUpdate (Sema &SemaRef, Scope *S, SourceLocation Loc, ExprResult VarRef, ExprResult Start, ExprResult Iter, ExprResult Step, bool Subtract, bool IsNonRectangularLB, llvm::MapVector< const Expr *, DeclRefExpr * > *Captures=nullptr)
 Build 'VarRef = Start + Iter * Step'.
 
static ExprResult widenIterationCount (unsigned Bits, Expr *E, Sema &SemaRef)
 Convert integer expression E to make it have at least Bits bits.
 
static bool fitsInto (unsigned Bits, bool Signed, const Expr *E, Sema &SemaRef)
 Check if the given expression E is a constant integer that fits into Bits bits.
 
static StmtbuildPreInits (ASTContext &Context, MutableArrayRef< Decl * > PreInits)
 Build preinits statement for the given declarations.
 
static void appendFlattenedStmtList (SmallVectorImpl< Stmt * > &TargetList, Stmt *Item)
 Append the Item or the content of a CompoundStmt to the list TargetList.
 
static StmtbuildPreInits (ASTContext &Context, const llvm::MapVector< const Expr *, DeclRefExpr * > &Captures)
 Build preinits statement for the given declarations.
 
static StmtbuildPreInits (ASTContext &Context, ArrayRef< Stmt * > PreInits)
 Build pre-init statement for the given statements.
 
static ExprbuildPostUpdate (Sema &S, ArrayRef< Expr * > PostUpdates)
 Build postupdate expression for the given list of postupdates expressions.
 
static unsigned checkOpenMPLoop (OpenMPDirectiveKind DKind, Expr *CollapseLoopCountExpr, Expr *OrderedLoopCountExpr, Stmt *AStmt, Sema &SemaRef, DSAStackTy &DSA, SemaOpenMP::VarsWithInheritedDSAType &VarsWithImplicitDSA, OMPLoopBasedDirective::HelperExprs &Built)
 Called on a for stmt to check itself and nested loops (if any).
 
static ExprgetCollapseNumberExpr (ArrayRef< OMPClause * > Clauses)
 
static ExprgetOrderedNumberExpr (ArrayRef< OMPClause * > Clauses)
 
static bool checkSimdlenSafelenSpecified (Sema &S, const ArrayRef< OMPClause * > Clauses)
 
static bool checkSectionsDirective (Sema &SemaRef, OpenMPDirectiveKind DKind, Stmt *AStmt, DSAStackTy *Stack)
 
static ExprgetDirectCallExpr (Expr *E)
 
static bool checkGenericLoopLastprivate (Sema &S, ArrayRef< OMPClause * > Clauses, OpenMPDirectiveKind K, DSAStackTy *Stack)
 
static bool checkMutuallyExclusiveClauses (Sema &S, ArrayRef< OMPClause * > Clauses, ArrayRef< OpenMPClauseKind > MutuallyExclusiveClauses)
 Find and diagnose mutually exclusive clause kinds.
 
static bool hasClauses (ArrayRef< OMPClause * > Clauses, const OpenMPClauseKind K)
 Check for existence of a map clause in the list of clauses.
 
template<typename... Params>
static bool hasClauses (ArrayRef< OMPClause * > Clauses, const OpenMPClauseKind K, const Params... ClauseTypes)
 
static bool isClauseMappable (ArrayRef< OMPClause * > Clauses)
 Check if the variables in the mapping clause are externally visible.
 
template<typename ClauseType >
static bool checkNumExprsInClause (SemaBase &SemaRef, ArrayRef< OMPClause * > Clauses, unsigned MaxNum, unsigned Diag)
 This checks whether a ClauseType clause C has at most Max expression.
 
static bool checkReductionClauseWithNogroup (Sema &S, ArrayRef< OMPClause * > Clauses)
 
static void addLoopPreInits (ASTContext &Context, OMPLoopBasedDirective::HelperExprs &LoopHelper, Stmt *LoopStmt, ArrayRef< Stmt * > OriginalInit, SmallVectorImpl< Stmt * > &PreInits)
 Add preinit statements that need to be propageted from the selected loop.
 
static void collectLoopStmts (Stmt *AStmt, MutableArrayRef< Stmt * > LoopStmts)
 Collect the loop statements (ForStmt or CXXRangeForStmt) of the affected loop of a construct.
 
static OpenMPDirectiveKind getOpenMPCaptureRegionForClause (OpenMPDirectiveKind DKind, OpenMPClauseKind CKind, unsigned OpenMPVersion, OpenMPDirectiveKind NameModifier=OMPD_unknown)
 
static bool isNonNegativeIntegerValue (Expr *&ValExpr, Sema &SemaRef, OpenMPClauseKind CKind, bool StrictlyPositive, bool BuildCapture=false, OpenMPDirectiveKind DKind=OMPD_unknown, OpenMPDirectiveKind *CaptureRegion=nullptr, Stmt **HelperValStmt=nullptr)
 
static bool findOMPAllocatorHandleT (Sema &S, SourceLocation Loc, DSAStackTy *Stack)
 Tries to find omp_allocator_handle_t type.
 
static std::string getListOfPossibleValues (OpenMPClauseKind K, unsigned First, unsigned Last, ArrayRef< unsigned > Exclude=std::nullopt)
 
static bool checkScheduleModifiers (Sema &S, OpenMPScheduleClauseModifier M1, OpenMPScheduleClauseModifier M2, SourceLocation M1Loc, SourceLocation M2Loc)
 
static bool isValidInteropVariable (Sema &SemaRef, Expr *InteropVarExpr, SourceLocation VarLoc, OpenMPClauseKind Kind)
 
template<typename T , typename U >
static T filterLookupForUDReductionAndMapper (SmallVectorImpl< U > &Lookups, const llvm::function_ref< T(ValueDecl *)> Gen)
 
static NamedDeclfindAcceptableDecl (Sema &SemaRef, NamedDecl *D)
 
static void argumentDependentLookup (Sema &SemaRef, const DeclarationNameInfo &Id, SourceLocation Loc, QualType Ty, SmallVectorImpl< UnresolvedSet< 8 > > &Lookups)
 
static ExprResult buildDeclareReductionRef (Sema &SemaRef, SourceLocation Loc, SourceRange Range, Scope *S, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, QualType Ty, CXXCastPath &BasePath, Expr *UnresolvedReduction)
 
static bool checkOMPArraySectionConstantForReduction (ASTContext &Context, const ArraySectionExpr *OASE, bool &SingleElement, SmallVectorImpl< llvm::APSInt > &ArraySizes)
 
static BinaryOperatorKind getRelatedCompoundReductionOp (BinaryOperatorKind BOK)
 
static bool actOnOMPReductionKindClause (Sema &S, DSAStackTy *Stack, OpenMPClauseKind ClauseKind, ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions, ReductionData &RD)
 
static bool findOMPDependT (Sema &S, SourceLocation Loc, DSAStackTy *Stack, bool Diagnose=true)
 Tries to find omp_depend_t. type.
 
static DoacrossDataInfoTy ProcessOpenMPDoacrossClauseCommon (Sema &SemaRef, bool IsSource, ArrayRef< Expr * > VarList, DSAStackTy *Stack, SourceLocation EndLoc)
 
static bool checkTypeMappable (SourceLocation SL, SourceRange SR, Sema &SemaRef, DSAStackTy *Stack, QualType QTy, bool FullCheck=true)
 
static bool checkArrayExpressionDoesNotReferToWholeSize (Sema &SemaRef, const Expr *E, QualType BaseQTy)
 Return true if it can be proven that the provided array expression (array section or array subscript) does NOT specify the whole size of the array whose base type is BaseQTy.
 
static bool checkArrayExpressionDoesNotReferToUnitySize (Sema &SemaRef, const Expr *E, QualType BaseQTy)
 
static bool checkMapConflicts (Sema &SemaRef, DSAStackTy *DSAS, const ValueDecl *VD, const Expr *E, bool CurrentRegionOnly, OMPClauseMappableExprCommon::MappableExprComponentListRef CurComponents, OpenMPClauseKind CKind)
 
static DeclRefExprbuildImplicitMap (Sema &S, QualType BaseType, DSAStackTy *Stack, SmallVectorImpl< OMPClause * > &Maps)
 
static ExprResult buildImplicitMapper (Sema &S, QualType BaseType, DSAStackTy *Stack)
 
static bool hasUserDefinedMapper (Sema &SemaRef, Scope *S, CXXScopeSpec &MapperIdScopeSpec, const DeclarationNameInfo &MapperId, QualType Type)
 
static bool isImplicitMapperNeeded (Sema &S, DSAStackTy *Stack, QualType CanonType, const Expr *E)
 
static void checkMappableExpressionList (Sema &SemaRef, DSAStackTy *DSAS, OpenMPClauseKind CKind, MappableVarListInfo &MVLI, SourceLocation StartLoc, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo MapperId, ArrayRef< Expr * > UnresolvedMappers, OpenMPMapClauseKind MapType=OMPC_MAP_unknown, ArrayRef< OpenMPMapModifierKind > Modifiers=std::nullopt, bool IsMapTypeImplicit=false, bool NoDiagnose=false)
 
static bool findOMPEventHandleT (Sema &S, SourceLocation Loc, DSAStackTy *Stack)
 Tries to find omp_event_handle_t type.
 
static void checkDeclInTargetContext (SourceLocation SL, SourceRange SR, Sema &SemaRef, Decl *D)
 
static bool checkValueDeclInTarget (SourceLocation SL, SourceRange SR, Sema &SemaRef, DSAStackTy *Stack, ValueDecl *VD)
 
static bool findOMPAlloctraitT (Sema &S, SourceLocation Loc, DSAStackTy *Stack)
 Tries to find omp_alloctrait_t type.
 
static void checkOMPAssumeAttr (Sema &S, SourceLocation Loc, StringRef AssumptionStr)
 Check if AssumptionStr is a known assumption and warn if not.
 

Detailed Description

This file implements semantic analysis for OpenMP directives and clauses.

Definition in file SemaOpenMP.cpp.

Macro Definition Documentation

◆ DSAStack

#define DSAStack   static_cast<DSAStackTy *>(VarDataSharingAttributesStack)

Definition at line 2002 of file SemaOpenMP.cpp.

Function Documentation

◆ actOnOMPReductionKindClause()

static bool actOnOMPReductionKindClause ( Sema S,
DSAStackTy *  Stack,
OpenMPClauseKind  ClauseKind,
ArrayRef< Expr * >  VarList,
SourceLocation  StartLoc,
SourceLocation  LParenLoc,
SourceLocation  ColonLoc,
SourceLocation  EndLoc,
CXXScopeSpec ReductionIdScopeSpec,
const DeclarationNameInfo ReductionId,
ArrayRef< Expr * >  UnresolvedReductions,
ReductionData &  RD 
)
static

Definition at line 18301 of file SemaOpenMP.cpp.

References clang::Sema::ActOnFinishFullExpr(), clang::Sema::ActOnIntegerConstant(), clang::Sema::ActOnUninitializedDecl(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildBinOp(), buildCapture(), clang::Sema::BuildCStyleCastExpr(), buildDeclareReductionRef(), buildDeclRefExpr(), buildVarDecl(), clang::VarDecl::CallInit, checkOMPArraySectionConstantForReduction(), clang::Sema::Context, clang::FloatingLiteral::Create(), clang::IntegerLiteral::Create(), clang::ImplicitCastExpr::Create(), clang::CallExpr::Create(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::Sema::CreateBuiltinBinOp(), clang::Sema::CreateBuiltinUnaryOp(), clang::Sema::CurContext, clang::Sema::CurFPFeatureOverrides(), D, clang::VarDecl::DeclarationOnly, clang::Sema::DefaultFunctionArrayLvalueConversion(), clang::Sema::DefaultLvalueConversion(), clang::ASTContext::DependentTy, clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::Type::getAs(), clang::ASTContext::getAsArrayType(), clang::Type::getAsArrayTypeUnsafe(), clang::DeclarationName::getAsIdentifierInfo(), clang::Decl::getAttrs(), clang::ASTContext::getBaseElementType(), clang::ArraySectionExpr::getBaseOriginalType(), clang::SourceRange::getBegin(), clang::DeclarationNameInfo::getBeginLoc(), clang::CXXScopeSpec::getBeginLoc(), clang::ASTContext::getConstantArrayType(), clang::DeclarationName::getCXXOverloadedOperator(), clang::DeclRefExpr::getDecl(), clang::DeclarationNameInfo::getEndLoc(), clang::ASTContext::getFloatTypeSemantics(), clang::ASTContext::getFunctionType(), clang::VarDecl::getInit(), clang::VarDecl::getInitStyle(), clang::ASTContext::getIntTypeForBitwidth(), clang::Sema::getLangOpts(), clang::DeclarationNameInfo::getLoc(), clang::Decl::getLocation(), clang::DeclarationNameInfo::getName(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), getPrivateItem(), getRelatedCompoundReductionOp(), clang::ASTContext::getSizeType(), clang::ASTContext::getTargetInfo(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::Expr::getValueKind(), clang::ASTContext::getVariableArrayType(), clang::Decl::hasAttr(), clang::Decl::hasAttrs(), clang::VarDecl::hasInit(), clang::Type::hasSignedIntegerRepresentation(), clang::Sema::IgnoredValueConversions(), clang::Expr::IgnoreParens(), clang::Init, clang::Type::isAnyComplexType(), clang::Type::isArithmeticType(), clang::DeclContext::isDependentContext(), clang::Type::isFloatingType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::SemaOpenMP::isOpenMPCapturedDecl(), clang::isOpenMPParallelDirective(), clang::isOpenMPSimdDirective(), clang::isOpenMPTargetExecutionDirective(), clang::isOpenMPTaskingDirective(), clang::isOpenMPTeamsDirective(), clang::isOpenMPWorksharingDirective(), clang::Type::isPointerType(), clang::Type::isRealFloatingType(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::Type::isScalarType(), clang::ActionResult< PtrTy, Compress >::isUnset(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::CXXScopeSpec::isValid(), clang::TargetInfo::isVLASupported(), clang::Sema::LangOpts, clang::Normal, clang::NUM_OVERLOADED_OPERATORS, clang::OK_Ordinary, clang::OO_None, clang::Sema::OpenMP(), clang::Stmt::Profile(), rejectConstNotMutableType(), reportOriginalDsa(), clang::Sema::RequireCompleteType(), clang::SourceRange::setBegin(), clang::SourceRange::setEnd(), clang::VarDecl::setInit(), clang::VarDecl::setInitStyle(), clang::Sema::targetDiag(), clang::VK_LValue, clang::VK_PRValue, and clang::ASTContext::VoidTy.

Referenced by clang::SemaOpenMP::ActOnOpenMPInReductionClause(), clang::SemaOpenMP::ActOnOpenMPReductionClause(), and clang::SemaOpenMP::ActOnOpenMPTaskReductionClause().

◆ addLoopPreInits()

static void addLoopPreInits ( ASTContext Context,
OMPLoopBasedDirective::HelperExprs LoopHelper,
Stmt LoopStmt,
ArrayRef< Stmt * >  OriginalInit,
SmallVectorImpl< Stmt * > &  PreInits 
)
static

◆ appendFlattenedStmtList()

static void appendFlattenedStmtList ( SmallVectorImpl< Stmt * > &  TargetList,
Stmt Item 
)
static

Append the Item or the content of a CompoundStmt to the list TargetList.

A CompoundStmt is used as container in case multiple statements need to be stored in lieu of using an explicit list. Flattening is necessary because contained DeclStmts need to be visible after the execution of the list. Used for OpenMP pre-init declarations/statements.

Definition at line 9527 of file SemaOpenMP.cpp.

Referenced by buildPreInits(), and checkOpenMPLoop().

◆ applyOMPAllocateAttribute()

static void applyOMPAllocateAttribute ( Sema S,
VarDecl VD,
OMPAllocateDeclAttr::AllocatorTypeTy  AllocatorKind,
Expr Allocator,
Expr Alignment,
SourceRange  SR 
)
static

◆ argumentDependentLookup()

static void argumentDependentLookup ( Sema SemaRef,
const DeclarationNameInfo Id,
SourceLocation  Loc,
QualType  Ty,
SmallVectorImpl< UnresolvedSet< 8 > > &  Lookups 
)
static

◆ buildCapture() [1/2]

static ExprResult buildCapture ( Sema S,
Expr CaptureExpr,
DeclRefExpr *&  Ref,
StringRef  Name 
)
static

◆ buildCapture() [2/2]

static DeclRefExpr * buildCapture ( Sema S,
ValueDecl D,
Expr CaptureExpr,
bool  WithInit 
)
static

◆ buildCaptureDecl()

static OMPCapturedExprDecl * buildCaptureDecl ( Sema S,
IdentifierInfo Id,
Expr CaptureExpr,
bool  WithInit,
DeclContext CurContext,
bool  AsExpression 
)
static

◆ buildCounterInit()

static ExprResult buildCounterInit ( Sema SemaRef,
Scope S,
SourceLocation  Loc,
ExprResult  VarRef,
ExprResult  Start,
bool  IsNonRectangularLB,
llvm::MapVector< const Expr *, DeclRefExpr * > &  Captures 
)
static

◆ buildCounterUpdate()

static ExprResult buildCounterUpdate ( Sema SemaRef,
Scope S,
SourceLocation  Loc,
ExprResult  VarRef,
ExprResult  Start,
ExprResult  Iter,
ExprResult  Step,
bool  Subtract,
bool  IsNonRectangularLB,
llvm::MapVector< const Expr *, DeclRefExpr * > *  Captures = nullptr 
)
static

◆ buildDeclareReductionRef()

static ExprResult buildDeclareReductionRef ( Sema SemaRef,
SourceLocation  Loc,
SourceRange  Range,
Scope S,
CXXScopeSpec ReductionIdScopeSpec,
const DeclarationNameInfo ReductionId,
QualType  Ty,
CXXCastPath BasePath,
Expr UnresolvedReduction 
)
static

Definition at line 18007 of file SemaOpenMP.cpp.

References clang::UnresolvedSetImpl::addDecl(), clang::UnresolvedSetImpl::append(), clang::Sema::AR_inaccessible, argumentDependentLookup(), clang::UnresolvedSetImpl::begin(), clang::LookupResult::begin(), clang::Sema::BuildBasePathArray(), clang::Sema::BuildDeclRefExpr(), clang::Sema::CheckBaseClassAccess(), clang::LookupResult::clear(), clang::Type::containsUnexpandedParameterPack(), clang::Sema::Context, clang::UnresolvedLookupExpr::Create(), clang::Sema::CurContext, D, clang::SemaBase::Diag(), clang::LookupResult::empty(), clang::UnresolvedSetImpl::end(), clang::LookupResult::end(), clang::ExprEmpty(), clang::ExprError(), clang::Type::getAs(), clang::ASTContext::getCanonicalType(), clang::Sema::getLangOpts(), clang::QualType::getNonReferenceType(), clang::LookupResult::getRepresentativeDecl(), clang::ValueDecl::getType(), clang::QualType::getUnqualifiedType(), clang::CXXScopeSpec::getWithLocInContext(), clang::ASTContext::hasSameType(), clang::Sema::isCompleteType(), clang::DeclContext::isDependentContext(), clang::Type::isDependentType(), clang::Sema::IsDerivedFrom(), clang::Type::isInstantiationDependentType(), clang::CXXScopeSpec::isInvalid(), clang::Decl::isInvalidDecl(), clang::QualType::isMoreQualifiedThan(), clang::CXXScopeSpec::isSet(), Loc, clang::Sema::LookupOMPReductionName, clang::Sema::LookupParsedName(), clang::Sema::LookupQualifiedName(), Range, clang::Set, clang::LookupResult::suppressDiagnostics(), and clang::VK_LValue.

Referenced by actOnOMPReductionKindClause().

◆ buildDeclRefExpr()

static DeclRefExpr * buildDeclRefExpr ( Sema S,
VarDecl D,
QualType  Ty,
SourceLocation  Loc,
bool  RefersToCapture = false 
)
static

◆ buildDistanceFunc()

static CapturedStmt * buildDistanceFunc ( Sema Actions,
QualType  LogicalTy,
BinaryOperator::Opcode  Rel,
Expr StartExpr,
Expr StopExpr,
Expr StepExpr 
)
static

Create a closure that computes the number of iterations of a loop.

Parameters
ActionsThe Sema object.
LogicalTyType for the logical iteration number.
RelComparison operator of the loop condition.
StartExprValue of the loop counter at the first iteration.
StopExprExpression the loop counter is compared against in the loop condition.
StepExprAmount of increment after each iteration.
Returns
Closure (CapturedStmt) of the distance calculation.

Definition at line 5381 of file SemaOpenMP.cpp.

References clang::Sema::ActOnCapturedRegionEnd(), clang::Sema::ActOnCapturedRegionStart(), clang::Sema::ActOnCompoundStmt(), clang::Sema::ActOnConditionalOp(), clang::AssertSuccess(), clang::Sema::BuildBinOp(), clang::Sema::BuildCStyleCastExpr(), buildDeclRefExpr(), clang::Sema::BuildDeclRefExpr(), clang::Sema::BuildUnaryOp(), clang::CR_Default, clang::IntegerLiteral::Create(), clang::Sema::CurContext, clang::Sema::getASTContext(), clang::Sema::getCurScope(), clang::ASTContext::getIntWidth(), clang::ASTContext::getLValueReferenceType(), clang::CapturedDecl::getParam(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ValueDecl::getType(), precomputeExpr(), Range, and clang::VK_LValue.

Referenced by clang::SemaOpenMP::ActOnOpenMPCanonicalLoop().

◆ buildImplicitMap()

static DeclRefExpr * buildImplicitMap ( Sema S,
QualType  BaseType,
DSAStackTy *  Stack,
SmallVectorImpl< OMPClause * > &  Maps 
)
static

◆ buildImplicitMapper()

static ExprResult buildImplicitMapper ( Sema S,
QualType  BaseType,
DSAStackTy *  Stack 
)
static

◆ buildLoopVarFunc()

static CapturedStmt * buildLoopVarFunc ( Sema Actions,
QualType  LoopVarTy,
QualType  LogicalTy,
DeclRefExpr StartExpr,
Expr Step,
bool  Deref 
)
static

Create a closure that computes the loop variable from the logical iteration number.

Parameters
ActionsThe Sema object.
LoopVarTyType for the loop variable used for result value.
LogicalTyType for the logical iteration number.
StartExprValue of the loop counter at the first iteration.
StepAmount of increment after each iteration.
DerefWhether the loop variable is a dereference of the loop counter variable.
Returns
Closure (CapturedStmt) of the loop value calculation.

Definition at line 5529 of file SemaOpenMP.cpp.

References clang::Sema::ActOnCapturedRegionEnd(), clang::Sema::ActOnCapturedRegionStart(), clang::AssertSuccess(), clang::Sema::BuildBinOp(), clang::Sema::BuildDeclRefExpr(), clang::Sema::BuildUnaryOp(), clang::CR_Default, clang::Sema::CurContext, clang::Sema::getASTContext(), clang::Sema::getCurScope(), clang::DeclRefExpr::getDecl(), clang::ASTContext::getLValueReferenceType(), clang::Invalid, clang::Sema::TryCapture_ExplicitByVal, clang::Sema::tryCaptureVariable(), and clang::VK_LValue.

Referenced by clang::SemaOpenMP::ActOnOpenMPCanonicalLoop().

◆ buildPostUpdate()

static Expr * buildPostUpdate ( Sema S,
ArrayRef< Expr * >  PostUpdates 
)
static

◆ buildPreInits() [1/3]

static Stmt * buildPreInits ( ASTContext Context,
ArrayRef< Stmt * >  PreInits 
)
static

Build pre-init statement for the given statements.

Definition at line 9553 of file SemaOpenMP.cpp.

References appendFlattenedStmtList(), and clang::CompoundStmt::Create().

◆ buildPreInits() [2/3]

static Stmt * buildPreInits ( ASTContext Context,
const llvm::MapVector< const Expr *, DeclRefExpr * > &  Captures 
)
static

Build preinits statement for the given declarations.

Definition at line 9541 of file SemaOpenMP.cpp.

References buildPreInits().

◆ buildPreInits() [3/3]

static Stmt * buildPreInits ( ASTContext Context,
MutableArrayRef< Decl * >  PreInits 
)
static

◆ buildUserDefinedMapperRef()

static ExprResult buildUserDefinedMapperRef ( Sema SemaRef,
Scope S,
CXXScopeSpec MapperIdScopeSpec,
const DeclarationNameInfo MapperId,
QualType  Type,
Expr UnresolvedMapper 
)
static

Definition at line 20871 of file SemaOpenMP.cpp.

References clang::UnresolvedSetImpl::append(), clang::Sema::AR_inaccessible, argumentDependentLookup(), clang::UnresolvedSetImpl::begin(), clang::LookupResult::begin(), clang::Sema::BuildDeclRefExpr(), clang::Sema::CheckBaseClassAccess(), clang::LookupResult::clear(), clang::Type::containsUnexpandedParameterPack(), clang::Sema::Context, clang::UnresolvedLookupExpr::Create(), clang::Sema::CurContext, D, clang::SemaBase::Diag(), clang::UnresolvedSetImpl::end(), clang::LookupResult::end(), clang::ExprEmpty(), clang::ExprError(), clang::Type::getAsArrayTypeUnsafe(), clang::DeclarationNameInfo::getAsString(), clang::QualType::getCanonicalType(), clang::ASTContext::getCanonicalType(), clang::ArrayType::getElementType(), clang::Sema::getLangOpts(), clang::DeclarationNameInfo::getLoc(), clang::DeclarationNameInfo::getName(), clang::LookupResult::getRepresentativeDecl(), clang::ValueDecl::getType(), clang::QualType::getUnqualifiedType(), clang::CXXScopeSpec::getWithLocInContext(), clang::ASTContext::hasSameType(), clang::Type::isArrayType(), clang::DeclContext::isDependentContext(), clang::Type::isDependentType(), clang::Sema::IsDerivedFrom(), clang::Type::isInstantiationDependentType(), clang::CXXScopeSpec::isInvalid(), clang::Decl::isInvalidDecl(), clang::CXXScopeSpec::isSet(), clang::Type::isStructureOrClassType(), clang::Type::isUnionType(), Loc, clang::Sema::LookupOMPMapperName, clang::Sema::LookupParsedName(), clang::Set, clang::LookupResult::suppressDiagnostics(), and clang::VK_LValue.

Referenced by checkMappableExpressionList(), and processImplicitMapsWithDefaultMappers().

◆ buildVarDecl()

static VarDecl * buildVarDecl ( Sema SemaRef,
SourceLocation  Loc,
QualType  Type,
StringRef  Name,
const AttrVec Attrs = nullptr,
DeclRefExpr OrigRef = nullptr 
)
static

◆ checkAllocateClauses()

static void checkAllocateClauses ( Sema S,
DSAStackTy *  Stack,
ArrayRef< OMPClause * >  Clauses 
)
static

◆ checkArrayExpressionDoesNotReferToUnitySize()

static bool checkArrayExpressionDoesNotReferToUnitySize ( Sema SemaRef,
const Expr E,
QualType  BaseQTy 
)
static

◆ checkArrayExpressionDoesNotReferToWholeSize()

static bool checkArrayExpressionDoesNotReferToWholeSize ( Sema SemaRef,
const Expr E,
QualType  BaseQTy 
)
static

Return true if it can be proven that the provided array expression (array section or array subscript) does NOT specify the whole size of the array whose base type is BaseQTy.

Definition at line 20152 of file SemaOpenMP.cpp.

References E, clang::Expr::EvaluateAsInt(), clang::Sema::getASTContext(), clang::QualType::getTypePtr(), clang::Type::isPointerType(), and clang::Result.

Referenced by checkMapConflicts().

◆ checkCancelRegion()

static bool checkCancelRegion ( Sema SemaRef,
OpenMPDirectiveKind  CurrentRegion,
OpenMPDirectiveKind  CancelRegion,
SourceLocation  StartLoc 
)
static

◆ checkDeclInTargetContext()

static void checkDeclInTargetContext ( SourceLocation  SL,
SourceRange  SR,
Sema SemaRef,
Decl D 
)
static

◆ checkGenericLoopLastprivate()

static bool checkGenericLoopLastprivate ( Sema S,
ArrayRef< OMPClause * >  Clauses,
OpenMPDirectiveKind  K,
DSAStackTy *  Stack 
)
static

◆ checkIfClauses()

static bool checkIfClauses ( Sema S,
OpenMPDirectiveKind  Kind,
ArrayRef< OMPClause * >  Clauses,
ArrayRef< OpenMPDirectiveKind AllowedNameModifiers 
)
static

◆ checkMapClauseExpressionBase()

static const Expr * checkMapClauseExpressionBase ( Sema SemaRef,
Expr E,
OMPClauseMappableExprCommon::MappableExprComponentList CurComponents,
OpenMPClauseKind  CKind,
OpenMPDirectiveKind  DKind,
bool  NoDiagnose 
)
static

Return the expression of the base of the mappable expression or null if it cannot be determined and do all the necessary checks to see if the expression is valid as a standalone mappable expression.

In the process, record all the components of the expression.

Definition at line 20592 of file SemaOpenMP.cpp.

References clang::SemaBase::Diag(), E, clang::Expr::getExprLoc(), clang::Sema::getLangOpts(), clang::ArraySectionExpr::getLength(), clang::Stmt::getSourceRange(), and clang::Expr::IgnoreParens().

Referenced by checkMappableExpressionList().

◆ checkMapConflicts()

static bool checkMapConflicts ( Sema SemaRef,
DSAStackTy *  DSAS,
const ValueDecl VD,
const Expr E,
bool  CurrentRegionOnly,
OMPClauseMappableExprCommon::MappableExprComponentListRef  CurComponents,
OpenMPClauseKind  CKind 
)
static

◆ checkMappableExpressionList()

static void checkMappableExpressionList ( Sema SemaRef,
DSAStackTy *  DSAS,
OpenMPClauseKind  CKind,
MappableVarListInfo &  MVLI,
SourceLocation  StartLoc,
CXXScopeSpec MapperIdScopeSpec,
DeclarationNameInfo  MapperId,
ArrayRef< Expr * >  UnresolvedMappers,
OpenMPMapClauseKind  MapType = OMPC_MAP_unknown,
ArrayRef< OpenMPMapModifierKind Modifiers = std::nullopt,
bool  IsMapTypeImplicit = false,
bool  NoDiagnose = false 
)
static

Definition at line 21210 of file SemaOpenMP.cpp.

References buildImplicitMapper(), buildUserDefinedMapperRef(), checkMapClauseExpressionBase(), checkMapConflicts(), checkTypeMappable(), clang::Expr::containsUnexpandedParameterPack(), clang::ASTContext::DeclarationNames, clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::IdentifierTable::get(), clang::Type::getAsArrayTypeUnsafe(), clang::Type::getAsRecordDecl(), clang::OMPClauseMappableExprCommon::MappableComponent::getAssociatedDeclaration(), clang::Sema::getASTContext(), clang::ArraySectionExpr::getBase(), clang::ArraySectionExpr::getBaseOriginalType(), clang::QualType::getCanonicalType(), clang::Sema::getCurScope(), clang::Expr::getExprLoc(), clang::Sema::getLangOpts(), clang::DeclarationNameInfo::getName(), clang::getOpenMPSimpleClauseTypeName(), clang::Type::getPointeeType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::Idents, clang::Expr::IgnoreParenCasts(), clang::Expr::IgnoreParenImpCasts(), clang::Expr::IgnoreParenLValueCasts(), clang::Expr::IgnoreParens(), clang::Decl::isCanonicalDecl(), clang::DeclarationName::isEmpty(), isImplicitMapperNeeded(), clang::Expr::isInstantiationDependent(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isLValue(), clang::isOpenMPPrivate(), clang::isOpenMPTargetExecutionDirective(), clang::Type::isSpecificBuiltinType(), clang::Expr::isTypeDependent(), clang::SourceLocation::isValid(), clang::Expr::isValueDependent(), clang::Sema::LangOpts, reportOriginalDsa(), clang::DeclarationNameInfo::setLoc(), and clang::DeclarationNameInfo::setName().

Referenced by clang::SemaOpenMP::ActOnOpenMPFromClause(), clang::SemaOpenMP::ActOnOpenMPMapClause(), and clang::SemaOpenMP::ActOnOpenMPToClause().

◆ checkMutuallyExclusiveClauses()

static bool checkMutuallyExclusiveClauses ( Sema S,
ArrayRef< OMPClause * >  Clauses,
ArrayRef< OpenMPClauseKind MutuallyExclusiveClauses 
)
static

◆ checkNestingOfRegions()

static bool checkNestingOfRegions ( Sema SemaRef,
const DSAStackTy *  Stack,
OpenMPDirectiveKind  CurrentRegion,
const DeclarationNameInfo CurrentName,
OpenMPDirectiveKind  CancelRegion,
OpenMPBindClauseKind  BindKind,
SourceLocation  StartLoc 
)
static

◆ checkNumExprsInClause()

template<typename ClauseType >
static bool checkNumExprsInClause ( SemaBase SemaRef,
ArrayRef< OMPClause * >  Clauses,
unsigned  MaxNum,
unsigned  Diag 
)
static

This checks whether a ClauseType clause C has at most Max expression.

If not, a diag of number Diag will be emitted.

Definition at line 13154 of file SemaOpenMP.cpp.

References clang::C, Diag(), and clang::SemaBase::Diag().

◆ checkOMPArraySectionConstantForReduction()

static bool checkOMPArraySectionConstantForReduction ( ASTContext Context,
const ArraySectionExpr OASE,
bool SingleElement,
SmallVectorImpl< llvm::APSInt > &  ArraySizes 
)
static

◆ checkOMPAssumeAttr()

static void checkOMPAssumeAttr ( Sema S,
SourceLocation  Loc,
StringRef  AssumptionStr 
)
static

Check if AssumptionStr is a known assumption and warn if not.

Definition at line 24163 of file SemaOpenMP.cpp.

References clang::SemaBase::Diag(), and Loc.

Referenced by clang::SemaOpenMP::handleOMPAssumeAttr().

◆ checkOpenMPIterationSpace()

static bool checkOpenMPIterationSpace ( OpenMPDirectiveKind  DKind,
Stmt S,
Sema SemaRef,
DSAStackTy &  DSA,
unsigned  CurrentNestedLoopCount,
unsigned  NestedLoopCount,
unsigned  TotalNestedLoopCount,
Expr CollapseLoopCountExpr,
Expr OrderedLoopCountExpr,
SemaOpenMP::VarsWithInheritedDSAType VarsWithImplicitDSA,
llvm::MutableArrayRef< LoopIterationSpace >  ResultIterSpaces,
llvm::MapVector< const Expr *, DeclRefExpr * > &  Captures,
const llvm::SmallPtrSetImpl< const Decl * > &  CollapsedLoopVarDecls 
)
static

◆ checkOpenMPLoop()

static unsigned checkOpenMPLoop ( OpenMPDirectiveKind  DKind,
Expr CollapseLoopCountExpr,
Expr OrderedLoopCountExpr,
Stmt AStmt,
Sema SemaRef,
DSAStackTy &  DSA,
SemaOpenMP::VarsWithInheritedDSAType VarsWithImplicitDSA,
OMPLoopBasedDirective::HelperExprs Built 
)
static

Called on a for stmt to check itself and nested loops (if any).

Returns
Returns 0 if one of the collapsed stmts is not canonical for loop, number of collapsed loops otherwise.

Definition at line 9620 of file SemaOpenMP.cpp.

References clang::Sema::AA_Converting, clang::Sema::ActOnConditionalOp(), clang::Sema::ActOnFinishFullExpr(), clang::Sema::ActOnIntegerConstant(), clang::Sema::AddInitializerToDecl(), appendFlattenedStmtList(), clang::Sema::BuildBinOp(), buildCounterInit(), buildCounterUpdate(), clang::Sema::BuildCStyleCastExpr(), buildDeclRefExpr(), buildPreInits(), buildVarDecl(), clang::C, clang::OMPLoopBasedDirective::HelperExprs::CalcLastIteration, checkOpenMPIterationSpace(), clang::OMPLoopBasedDirective::HelperExprs::clear(), clang::OMPLoopBasedDirective::DistCombinedHelperExprs::Cond, clang::OMPLoopBasedDirective::HelperExprs::Cond, clang::Sema::Context, clang::OMPLoopBasedDirective::HelperExprs::Counters, clang::Sema::CurContext, D, clang::OMPLoopBasedDirective::HelperExprs::DependentCounters, clang::OMPLoopBasedDirective::HelperExprs::DependentInits, clang::SemaBase::Diag(), clang::OMPLoopBasedDirective::HelperExprs::DistCombinedFields, clang::OMPLoopBasedDirective::DistCombinedHelperExprs::DistCond, clang::OMPLoopBasedDirective::HelperExprs::DistInc, clang::OMPLoopBasedDirective::doForAllLoops(), clang::OMPLoopBasedDirective::DistCombinedHelperExprs::EUB, clang::OMPLoopBasedDirective::HelperExprs::EUB, clang::Expr::EvaluateAsInt(), clang::OMPLoopBasedDirective::HelperExprs::Finals, clang::OMPLoopBasedDirective::HelperExprs::FinalsConditions, fitsInto(), clang::ActionResult< PtrTy, Compress >::get(), clang::Sema::getASTContext(), clang::Decl::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::DeclRefExpr::getDecl(), clang::Expr::getExprLoc(), clang::APValue::getInt(), clang::ASTContext::getIntTypeForBitwidth(), clang::Sema::getLangOpts(), clang::CapturedDecl::getNumParams(), clang::CapturedDecl::getParam(), clang::Stmt::getSourceRange(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::ASTContext::hasSameType(), clang::Type::hasSignedIntegerRepresentation(), clang::Type::hasUnsignedIntegerRepresentation(), clang::Stmt::IgnoreContainers(), clang::Expr::IgnoreImpCasts(), clang::OMPLoopBasedDirective::HelperExprs::IL, clang::OMPLoopBasedDirective::HelperExprs::Inc, clang::OMPLoopBasedDirective::DistCombinedHelperExprs::Init, clang::OMPLoopBasedDirective::HelperExprs::Init, clang::Init, clang::OMPLoopBasedDirective::HelperExprs::Inits, clang::DeclContext::isDependentContext(), clang::Expr::isIntegerConstantExpr(), clang::isOpenMPDistributeDirective(), clang::isOpenMPGenericLoopDirective(), clang::isOpenMPLoopBoundSharingDirective(), clang::isOpenMPLoopTransformationDirective(), clang::isOpenMPTaskLoopDirective(), clang::isOpenMPWorksharingDirective(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Expr::isValueDependent(), Iter, clang::OMPLoopBasedDirective::HelperExprs::IterationVarRef, clang::Sema::LangOpts, clang::OMPLoopBasedDirective::HelperExprs::LastIteration, clang::OMPLoopBasedDirective::DistCombinedHelperExprs::LB, clang::OMPLoopBasedDirective::HelperExprs::LB, Loc, clang::OMPLoopBasedDirective::DistCombinedHelperExprs::NLB, clang::OMPLoopBasedDirective::HelperExprs::NLB, clang::OMPLoopBasedDirective::DistCombinedHelperExprs::NUB, clang::OMPLoopBasedDirective::HelperExprs::NUB, clang::OMPLoopBasedDirective::HelperExprs::NumIterations, clang::OMPLoopBasedDirective::DistCombinedHelperExprs::ParForInDistCond, clang::Sema::PerformImplicitConversion(), clang::OMPLoopBasedDirective::HelperExprs::PreCond, clang::OMPLoopBasedDirective::HelperExprs::PreInits, clang::OMPLoopBasedDirective::HelperExprs::PrevEUB, clang::OMPLoopBasedDirective::HelperExprs::PrevLB, clang::OMPLoopBasedDirective::HelperExprs::PrevUB, clang::OMPLoopBasedDirective::HelperExprs::PrivateCounters, clang::Result, clang::OMPLoopBasedDirective::HelperExprs::ST, clang::OMPLoopBasedDirective::DistCombinedHelperExprs::UB, clang::OMPLoopBasedDirective::HelperExprs::UB, clang::Update, clang::OMPLoopBasedDirective::HelperExprs::Updates, clang::Expr::EvalResult::Val, and widenIterationCount().

Referenced by clang::SemaOpenMP::ActOnOpenMPDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPForDirective(), clang::SemaOpenMP::ActOnOpenMPForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPMaskedTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPMaskedTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPMasterTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPMasterTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTargetSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeSimdDirective(), and clang::SemaOpenMP::ActOnOpenMPTeamsGenericLoopDirective().

◆ checkOrderedOrderSpecified()

static bool checkOrderedOrderSpecified ( Sema S,
const ArrayRef< OMPClause * >  Clauses 
)
static

◆ checkPreviousOMPAllocateAttribute()

static bool checkPreviousOMPAllocateAttribute ( Sema S,
DSAStackTy *  Stack,
Expr RefExpr,
VarDecl VD,
OMPAllocateDeclAttr::AllocatorTypeTy  AllocatorKind,
Expr Allocator 
)
static

◆ checkReductionClauses()

static void checkReductionClauses ( Sema S,
DSAStackTy *  Stack,
ArrayRef< OMPClause * >  Clauses 
)
static

◆ checkReductionClauseWithNogroup()

static bool checkReductionClauseWithNogroup ( Sema S,
ArrayRef< OMPClause * >  Clauses 
)
static

◆ checkScheduleModifiers()

static bool checkScheduleModifiers ( Sema S,
OpenMPScheduleClauseModifier  M1,
OpenMPScheduleClauseModifier  M2,
SourceLocation  M1Loc,
SourceLocation  M2Loc 
)
static

◆ checkSectionsDirective()

static bool checkSectionsDirective ( Sema SemaRef,
OpenMPDirectiveKind  DKind,
Stmt AStmt,
DSAStackTy *  Stack 
)
static

◆ checkSimdlenSafelenSpecified()

static bool checkSimdlenSafelenSpecified ( Sema S,
const ArrayRef< OMPClause * >  Clauses 
)
static

Definition at line 10340 of file SemaOpenMP.cpp.

References clang::Expr::containsUnexpandedParameterPack(), clang::Sema::Context, clang::SemaBase::Diag(), clang::Expr::EvaluateAsInt(), clang::OMPClause::getClauseKind(), clang::Expr::getExprLoc(), clang::APValue::getInt(), clang::OMPSafelenClause::getSafelen(), clang::OMPSimdlenClause::getSimdlen(), clang::Stmt::getSourceRange(), clang::Expr::isInstantiationDependent(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::Expr::EvalResult::Val.

Referenced by clang::SemaOpenMP::ActOnOpenMPDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPMaskedTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPMasterTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForSimdDirective(), and clang::SemaOpenMP::ActOnOpenMPTeamsDistributeSimdDirective().

◆ checkTypeMappable()

static bool checkTypeMappable ( SourceLocation  SL,
SourceRange  SR,
Sema SemaRef,
DSAStackTy *  Stack,
QualType  QTy,
bool  FullCheck = true 
)
static

◆ checkValueDeclInTarget()

static bool checkValueDeclInTarget ( SourceLocation  SL,
SourceRange  SR,
Sema SemaRef,
DSAStackTy *  Stack,
ValueDecl VD 
)
static

◆ collectLoopStmts()

static void collectLoopStmts ( Stmt AStmt,
MutableArrayRef< Stmt * >  LoopStmts 
)
static

◆ filterLookupForUDReductionAndMapper()

template<typename T , typename U >
static T filterLookupForUDReductionAndMapper ( SmallVectorImpl< U > &  Lookups,
const llvm::function_ref< T(ValueDecl *)>  Gen 
)
static

Definition at line 17921 of file SemaOpenMP.cpp.

References D, clang::Set, and clang::T.

◆ findAcceptableDecl()

static NamedDecl * findAcceptableDecl ( Sema SemaRef,
NamedDecl D 
)
static

Definition at line 17932 of file SemaOpenMP.cpp.

References D, clang::LookupResult::isVisible(), and clang::Decl::redecls().

◆ findOMPAllocatorHandleT()

static bool findOMPAllocatorHandleT ( Sema S,
SourceLocation  Loc,
DSAStackTy *  Stack 
)
static

◆ findOMPAlloctraitT()

static bool findOMPAlloctraitT ( Sema S,
SourceLocation  Loc,
DSAStackTy *  Stack 
)
static

◆ findOMPDependT()

static bool findOMPDependT ( Sema S,
SourceLocation  Loc,
DSAStackTy *  Stack,
bool  Diagnose = true 
)
static

◆ findOMPEventHandleT()

static bool findOMPEventHandleT ( Sema S,
SourceLocation  Loc,
DSAStackTy *  Stack 
)
static

◆ finishLinearClauses()

static bool finishLinearClauses ( Sema SemaRef,
ArrayRef< OMPClause * >  Clauses,
OMPLoopBasedDirective::HelperExprs B,
DSAStackTy *  Stack 
)
static

Definition at line 2987 of file SemaOpenMP.cpp.

References clang::OMPLoopBasedDirective::HelperExprs::builtAll(), clang::C, clang::Sema::CurContext, FinishOpenMPLinearClause(), clang::Sema::getCurScope(), clang::DeclContext::isDependentContext(), clang::OMPLoopBasedDirective::HelperExprs::IterationVarRef, and clang::OMPLoopBasedDirective::HelperExprs::NumIterations.

Referenced by clang::SemaOpenMP::ActOnOpenMPDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPForDirective(), clang::SemaOpenMP::ActOnOpenMPForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPMaskedTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPMasterTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForSimdDirective(), and clang::SemaOpenMP::ActOnOpenMPTeamsDistributeSimdDirective().

◆ FinishOpenMPLinearClause()

static bool FinishOpenMPLinearClause ( OMPLinearClause Clause,
DeclRefExpr IV,
Expr NumIterations,
Sema SemaRef,
Scope S,
DSAStackTy *  Stack 
)
static

◆ fitsInto()

static bool fitsInto ( unsigned  Bits,
bool  Signed,
const Expr E,
Sema SemaRef 
)
static

Check if the given expression E is a constant integer that fits into Bits bits.

Definition at line 9500 of file SemaOpenMP.cpp.

References clang::Sema::Context, E, clang::Expr::getIntegerConstantExpr(), clang::Result, and clang::Signed.

Referenced by checkOpenMPLoop().

◆ getAllocatorKind()

static OMPAllocateDeclAttr::AllocatorTypeTy getAllocatorKind ( Sema S,
DSAStackTy *  Stack,
Expr Allocator 
)
static

◆ getCanonicalDecl() [1/2]

static const ValueDecl * getCanonicalDecl ( const ValueDecl D)
static

Definition at line 1255 of file SemaOpenMP.cpp.

References D, clang::Decl::getCanonicalDecl(), and getExprAsWritten().

Referenced by getCanonicalDecl().

◆ getCanonicalDecl() [2/2]

static ValueDecl * getCanonicalDecl ( ValueDecl D)
static

Definition at line 1264 of file SemaOpenMP.cpp.

References D, and getCanonicalDecl().

◆ getCollapseNumberExpr()

static Expr * getCollapseNumberExpr ( ArrayRef< OMPClause * >  Clauses)
static

Definition at line 10324 of file SemaOpenMP.cpp.

Referenced by clang::SemaOpenMP::ActOnOpenMPDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPForDirective(), clang::SemaOpenMP::ActOnOpenMPForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPMaskedTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPMaskedTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPMasterTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPMasterTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTargetSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeSimdDirective(), and clang::SemaOpenMP::ActOnOpenMPTeamsGenericLoopDirective().

◆ getDirectCallExpr()

static Expr * getDirectCallExpr ( Expr E)
static

◆ getExprAsWritten() [1/2]

static const Expr * getExprAsWritten ( const Expr E)
static

Definition at line 1236 of file SemaOpenMP.cpp.

References E, and clang::Expr::IgnoreParens().

Referenced by getCanonicalDecl(), and getExprAsWritten().

◆ getExprAsWritten() [2/2]

static Expr * getExprAsWritten ( Expr E)
static

Definition at line 1251 of file SemaOpenMP.cpp.

References E, and getExprAsWritten().

◆ getListOfPossibleValues()

static std::string getListOfPossibleValues ( OpenMPClauseKind  K,
unsigned  First,
unsigned  Last,
ArrayRef< unsigned Exclude = std::nullopt 
)
static

◆ getMapClauseKindFromModifier()

static OpenMPMapClauseKind getMapClauseKindFromModifier ( OpenMPDefaultmapClauseModifier  M,
bool  IsAggregateOrDeclareTarget 
)
static

◆ getOpenMPCaptureRegionForClause()

static OpenMPDirectiveKind getOpenMPCaptureRegionForClause ( OpenMPDirectiveKind  DKind,
OpenMPClauseKind  CKind,
unsigned  OpenMPVersion,
OpenMPDirectiveKind  NameModifier = OMPD_unknown 
)
static

◆ getOrderedNumberExpr()

static Expr * getOrderedNumberExpr ( ArrayRef< OMPClause * >  Clauses)
static

◆ getParallelRegionParams()

static SmallVector< SemaOpenMP::CapturedParamNameType > getParallelRegionParams ( Sema SemaRef,
bool  LoopBoundSharing 
)
static

◆ getPrivateItem()

static std::pair< ValueDecl *, bool > getPrivateItem ( Sema S,
Expr *&  RefExpr,
SourceLocation ELoc,
SourceRange ERange,
bool  AllowArraySection = false,
StringRef  DiagType = "" 
)
static

Definition at line 5131 of file SemaOpenMP.cpp.

References clang::Expr::containsUnexpandedParameterPack(), clang::SemaBase::Diag(), getCanonicalDecl(), clang::Sema::getCurrentThisType(), clang::Expr::getExprLoc(), clang::Sema::getLangOpts(), clang::Stmt::getSourceRange(), clang::Expr::IgnoreParenImpCasts(), clang::Expr::IgnoreParens(), clang::QualType::isNull(), clang::Expr::isTypeDependent(), and clang::Expr::isValueDependent().

Referenced by actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPAlignedClause(), clang::SemaOpenMP::ActOnOpenMPAllocateClause(), clang::SemaOpenMP::ActOnOpenMPCopyprivateClause(), clang::SemaOpenMP::ActOnOpenMPExclusiveClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPHasDeviceAddrClause(), clang::SemaOpenMP::ActOnOpenMPInclusiveClause(), clang::SemaOpenMP::ActOnOpenMPInteropDirective(), clang::SemaOpenMP::ActOnOpenMPIsDevicePtrClause(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPNontemporalClause(), clang::SemaOpenMP::ActOnOpenMPPrivateClause(), clang::SemaOpenMP::ActOnOpenMPSharedClause(), clang::SemaOpenMP::ActOnOpenMPUseDeviceAddrClause(), clang::SemaOpenMP::ActOnOpenMPUseDevicePtrClause(), checkAllocateClauses(), checkGenericLoopLastprivate(), checkReductionClauses(), clang::SemaOpenMP::EndOpenMPDSABlock(), FinishOpenMPLinearClause(), getDistributeLastprivateVars(), getTeamsReductionVars(), isValidInteropVariable(), and ProcessOpenMPDoacrossClauseCommon().

◆ getRelatedCompoundReductionOp()

static BinaryOperatorKind getRelatedCompoundReductionOp ( BinaryOperatorKind  BOK)
static

Definition at line 18287 of file SemaOpenMP.cpp.

Referenced by actOnOMPReductionKindClause().

◆ getTargetRegionParams()

static SmallVector< SemaOpenMP::CapturedParamNameType > getTargetRegionParams ( Sema SemaRef)
static

◆ getTaskloopRegionParams()

static SmallVector< SemaOpenMP::CapturedParamNameType > getTaskloopRegionParams ( Sema SemaRef)
static

◆ getTaskRegionParams()

static SmallVector< SemaOpenMP::CapturedParamNameType > getTaskRegionParams ( Sema SemaRef)
static

◆ getTeamsRegionParams()

static SmallVector< SemaOpenMP::CapturedParamNameType > getTeamsRegionParams ( Sema SemaRef)
static

Definition at line 4243 of file SemaOpenMP.cpp.

References getParallelRegionParams().

Referenced by processCapturedRegions().

◆ getUnknownRegionParams()

static SmallVector< SemaOpenMP::CapturedParamNameType > getUnknownRegionParams ( Sema SemaRef)
static

Definition at line 4285 of file SemaOpenMP.cpp.

Referenced by processCapturedRegions().

◆ getVariableCategoryFromDecl()

static OpenMPDefaultmapClauseKind getVariableCategoryFromDecl ( const LangOptions LO,
const ValueDecl VD 
)
static

◆ handleDeclareVariantConstructTrait()

static void handleDeclareVariantConstructTrait ( DSAStackTy *  Stack,
OpenMPDirectiveKind  DKind,
bool  ScopeEntry 
)
static

◆ hasClauses() [1/2]

static bool hasClauses ( ArrayRef< OMPClause * >  Clauses,
const OpenMPClauseKind  K 
)
static

◆ hasClauses() [2/2]

template<typename... Params>
static bool hasClauses ( ArrayRef< OMPClause * >  Clauses,
const OpenMPClauseKind  K,
const Params...  ClauseTypes 
)
static

Definition at line 13033 of file SemaOpenMP.cpp.

References hasClauses().

◆ hasUserDefinedMapper()

static bool hasUserDefinedMapper ( Sema SemaRef,
Scope S,
CXXScopeSpec MapperIdScopeSpec,
const DeclarationNameInfo MapperId,
QualType  Type 
)
static

◆ isClauseMappable()

static bool isClauseMappable ( ArrayRef< OMPClause * >  Clauses)
static

Check if the variables in the mapping clause are externally visible.

Definition at line 13039 of file SemaOpenMP.cpp.

References clang::C.

Referenced by clang::SemaOpenMP::ActOnOpenMPTargetUpdateDirective().

◆ isConstNotMutableType()

static bool isConstNotMutableType ( Sema SemaRef,
QualType  Type,
bool  AcceptIfMutable = true,
bool IsClassType = nullptr 
)
static

◆ isImplicitMapperNeeded()

static bool isImplicitMapperNeeded ( Sema S,
DSAStackTy *  Stack,
QualType  CanonType,
const Expr E 
)
static

◆ isNonNegativeIntegerValue()

static bool isNonNegativeIntegerValue ( Expr *&  ValExpr,
Sema SemaRef,
OpenMPClauseKind  CKind,
bool  StrictlyPositive,
bool  BuildCapture = false,
OpenMPDirectiveKind  DKind = OMPD_unknown,
OpenMPDirectiveKind CaptureRegion = nullptr,
Stmt **  HelperValStmt = nullptr 
)
static

◆ isOpenMPDeviceDelayedContext()

static bool isOpenMPDeviceDelayedContext ( Sema S)
static

◆ isValidInteropVariable()

static bool isValidInteropVariable ( Sema SemaRef,
Expr InteropVarExpr,
SourceLocation  VarLoc,
OpenMPClauseKind  Kind 
)
static

◆ precomputeExpr()

static VarDecl * precomputeExpr ( Sema Actions,
SmallVectorImpl< Stmt * > &  BodyStmts,
Expr E,
StringRef  Name 
)
static

◆ processCapturedRegions()

static void processCapturedRegions ( Sema SemaRef,
OpenMPDirectiveKind  DKind,
Scope CurScope,
SourceLocation  Loc 
)
static

◆ processImplicitMapsWithDefaultMappers()

static void processImplicitMapsWithDefaultMappers ( Sema S,
DSAStackTy *  Stack,
SmallVectorImpl< OMPClause * > &  Clauses 
)
static

Perform DFS through the structure/class data members trying to find member(s) with user-defined 'default' mapper and generate implicit map clauses for such members with the found 'default' mapper.

Definition at line 5764 of file SemaOpenMP.cpp.

References clang::SemaOpenMP::ActOnOpenMPMapClause(), clang::Sema::BuildMemberExpr(), buildUserDefinedMapperRef(), clang::C, clang::Expr::containsUnexpandedParameterPack(), clang::Sema::Context, clang::ASTContext::DeclarationNames, clang::Sema::DefaultLvalueConversion(), E, clang::RecordDecl::fields(), clang::ActionResult< PtrTy, Compress >::get(), clang::IdentifierTable::get(), clang::Decl::getAccess(), clang::Type::getAsArrayTypeUnsafe(), clang::Type::getAsRecordDecl(), clang::ArraySectionExpr::getBaseOriginalType(), clang::QualType::getCanonicalType(), clang::Expr::getExprLoc(), clang::DeclarationNameTable::getIdentifier(), clang::Sema::getLangOpts(), clang::Type::getPointeeType(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::QualType::getTypePtr(), clang::ASTContext::Idents, clang::Expr::IgnoreParenImpCasts(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Type::isSpecificBuiltinType(), clang::Type::isStructureOrClassType(), clang::Expr::isTypeDependent(), clang::Type::isUnionType(), clang::Expr::isValueDependent(), clang::DeclAccessPair::make(), clang::OK_Ordinary, clang::Sema::OpenMP(), P, clang::OpaqueValueExpr::setIsUnique(), clang::DeclarationNameInfo::setLoc(), clang::DeclarationNameInfo::setName(), Visited, and clang::VK_LValue.

Referenced by clang::SemaOpenMP::ActOnOpenMPDeclareMapperDirective(), and clang::SemaOpenMP::ActOnOpenMPExecutableDirective().

◆ ProcessOpenMPDoacrossClauseCommon()

static DoacrossDataInfoTy ProcessOpenMPDoacrossClauseCommon ( Sema SemaRef,
bool  IsSource,
ArrayRef< Expr * >  VarList,
DSAStackTy *  Stack,
SourceLocation  EndLoc 
)
static

◆ rejectConstNotMutableType()

static bool rejectConstNotMutableType ( Sema SemaRef,
const ValueDecl D,
QualType  Type,
OpenMPClauseKind  CKind,
SourceLocation  ELoc,
bool  AcceptIfMutable = true,
bool  ListItemNotVar = false 
)
static

◆ reportOriginalDsa()

static void reportOriginalDsa ( Sema SemaRef,
const DSAStackTy *  Stack,
const ValueDecl D,
const DSAStackTy::DSAVarData &  DVar,
bool  IsLoopIterVar = false 
)
static

◆ setBranchProtectedScope()

static CapturedStmt * setBranchProtectedScope ( Sema SemaRef,
OpenMPDirectiveKind  DKind,
Stmt AStmt 
)
static

Definition at line 7604 of file SemaOpenMP.cpp.

References clang::CapturedStmt::getCapturedDecl(), clang::CapturedStmt::getCapturedStmt(), clang::SemaOpenMP::getOpenMPCaptureLevels(), clang::Sema::OpenMP(), clang::Sema::setFunctionHasBranchProtectedScope(), and clang::CapturedDecl::setNothrow().

Referenced by clang::SemaOpenMP::ActOnOpenMPDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPMaskedTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPMasterTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelDirective(), clang::SemaOpenMP::ActOnOpenMPParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetDirective(), clang::SemaOpenMP::ActOnOpenMPTargetEnterDataDirective(), clang::SemaOpenMP::ActOnOpenMPTargetExitDataDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTargetSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTargetUpdateDirective(), clang::SemaOpenMP::ActOnOpenMPTaskDirective(), clang::SemaOpenMP::ActOnOpenMPTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeSimdDirective(), and clang::SemaOpenMP::ActOnOpenMPTeamsGenericLoopDirective().

◆ setPrototype()

static void setPrototype ( Sema S,
FunctionDecl FD,
FunctionDecl FDWithProto,
QualType  NewType 
)
static

◆ teamsLoopCanBeParallelFor()

static bool teamsLoopCanBeParallelFor ( Stmt AStmt,
Sema SemaRef 
)
static

◆ widenIterationCount()

static ExprResult widenIterationCount ( unsigned  Bits,
Expr E,
Sema SemaRef 
)
static

Convert integer expression E to make it have at least Bits bits.

Definition at line 9484 of file SemaOpenMP.cpp.

References clang::Sema::AA_Converting, clang::C, clang::Sema::Context, E, clang::ExprError(), clang::Expr::getType(), and clang::Sema::PerformImplicitConversion().

Referenced by checkOpenMPLoop().