#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/SetVector.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>
usingnamespaceclang;
usingnamespacellvm::omp;
static const Expr *checkMapClauseExpressionBase(
Sema &SemaRef, Expr *E,
OMPClauseMappableExprCommon::MappableExprComponentList &CurComponents,
OpenMPClauseKind CKind, OpenMPDirectiveKind DKind, bool NoDiagnose);
namespace {
enum DefaultDataSharingAttributes { … };
class DSAStackTy { … };
bool isImplicitTaskingRegion(OpenMPDirectiveKind DKind) { … }
bool isImplicitOrExplicitTaskingRegion(OpenMPDirectiveKind DKind) { … }
}
static const Expr *getExprAsWritten(const Expr *E) { … }
static Expr *getExprAsWritten(Expr *E) { … }
static const ValueDecl *getCanonicalDecl(const ValueDecl *D) { … }
static ValueDecl *getCanonicalDecl(ValueDecl *D) { … }
DSAStackTy::DSAVarData DSAStackTy::getDSA(const_iterator &Iter,
ValueDecl *D) const { … }
const Expr *DSAStackTy::addUniqueAligned(const ValueDecl *D,
const Expr *NewDE) { … }
const Expr *DSAStackTy::addUniqueNontemporal(const ValueDecl *D,
const Expr *NewDE) { … }
void DSAStackTy::addLoopControlVariable(const ValueDecl *D, VarDecl *Capture) { … }
const DSAStackTy::LCDeclInfo
DSAStackTy::isLoopControlVariable(const ValueDecl *D) const { … }
const DSAStackTy::LCDeclInfo
DSAStackTy::isLoopControlVariable(const ValueDecl *D, unsigned Level) const { … }
const DSAStackTy::LCDeclInfo
DSAStackTy::isParentLoopControlVariable(const ValueDecl *D) const { … }
const ValueDecl *DSAStackTy::getParentLoopControlVariable(unsigned I) const { … }
void DSAStackTy::addDSA(const ValueDecl *D, const Expr *E, OpenMPClauseKind A,
DeclRefExpr *PrivateCopy, unsigned Modifier,
bool AppliedToPointee) { … }
static VarDecl *buildVarDecl(Sema &SemaRef, SourceLocation Loc, QualType Type,
StringRef Name, const AttrVec *Attrs = nullptr,
DeclRefExpr *OrigRef = nullptr) { … }
static DeclRefExpr *buildDeclRefExpr(Sema &S, VarDecl *D, QualType Ty,
SourceLocation Loc,
bool RefersToCapture = false) { … }
void DSAStackTy::addTaskgroupReductionData(const ValueDecl *D, SourceRange SR,
BinaryOperatorKind BOK) { … }
void DSAStackTy::addTaskgroupReductionData(const ValueDecl *D, SourceRange SR,
const Expr *ReductionRef) { … }
const DSAStackTy::DSAVarData DSAStackTy::getTopMostTaskgroupReductionData(
const ValueDecl *D, SourceRange &SR, BinaryOperatorKind &BOK,
Expr *&TaskgroupDescriptor) const { … }
const DSAStackTy::DSAVarData DSAStackTy::getTopMostTaskgroupReductionData(
const ValueDecl *D, SourceRange &SR, const Expr *&ReductionRef,
Expr *&TaskgroupDescriptor) const { … }
bool DSAStackTy::isOpenMPLocal(VarDecl *D, const_iterator I) const { … }
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) { … }
const DSAStackTy::DSAVarData DSAStackTy::getTopDSA(ValueDecl *D,
bool FromParent) { … }
const DSAStackTy::DSAVarData DSAStackTy::getImplicitDSA(ValueDecl *D,
bool FromParent) const { … }
const DSAStackTy::DSAVarData DSAStackTy::getImplicitDSA(ValueDecl *D,
unsigned Level) const { … }
const DSAStackTy::DSAVarData
DSAStackTy::hasDSA(ValueDecl *D,
const llvm::function_ref<bool(OpenMPClauseKind, bool,
DefaultDataSharingAttributes)>
CPred,
const llvm::function_ref<bool(OpenMPDirectiveKind)> DPred,
bool FromParent) const { … }
const DSAStackTy::DSAVarData DSAStackTy::hasInnermostDSA(
ValueDecl *D, const llvm::function_ref<bool(OpenMPClauseKind, bool)> CPred,
const llvm::function_ref<bool(OpenMPDirectiveKind)> DPred,
bool FromParent) const { … }
bool DSAStackTy::hasExplicitDSA(
const ValueDecl *D,
const llvm::function_ref<bool(OpenMPClauseKind, bool)> CPred,
unsigned Level, bool NotLastprivate) const { … }
bool DSAStackTy::hasExplicitDirective(
const llvm::function_ref<bool(OpenMPDirectiveKind)> DPred,
unsigned Level) const { … }
bool DSAStackTy::hasDirective(
const llvm::function_ref<bool(OpenMPDirectiveKind,
const DeclarationNameInfo &, SourceLocation)>
DPred,
bool FromParent) const { … }
void SemaOpenMP::InitDataSharingAttributesStack() { … }
#define DSAStack …
void SemaOpenMP::pushOpenMPFunctionRegion() { … }
void SemaOpenMP::popOpenMPFunctionRegion(const FunctionScopeInfo *OldFSI) { … }
static bool isOpenMPDeviceDelayedContext(Sema &S) { … }
namespace {
enum class FunctionEmissionStatus { … };
}
SemaBase::SemaDiagnosticBuilder
SemaOpenMP::diagIfOpenMPDeviceCode(SourceLocation Loc, unsigned DiagID,
const FunctionDecl *FD) { … }
SemaBase::SemaDiagnosticBuilder
SemaOpenMP::diagIfOpenMPHostCode(SourceLocation Loc, unsigned DiagID,
const FunctionDecl *FD) { … }
static OpenMPDefaultmapClauseKind
getVariableCategoryFromDecl(const LangOptions &LO, const ValueDecl *VD) { … }
bool SemaOpenMP::isOpenMPCapturedByRef(const ValueDecl *D, unsigned Level,
unsigned OpenMPCaptureLevel) const { … }
unsigned SemaOpenMP::getOpenMPNestingLevel() const { … }
bool SemaOpenMP::isInOpenMPTaskUntiedContext() const { … }
bool SemaOpenMP::isInOpenMPTargetExecutionDirective() const { … }
bool SemaOpenMP::isOpenMPRebuildMemberExpr(ValueDecl *D) { … }
static OMPCapturedExprDecl *buildCaptureDecl(Sema &S, IdentifierInfo *Id,
Expr *CaptureExpr, bool WithInit,
DeclContext *CurContext,
bool AsExpression);
VarDecl *SemaOpenMP::isOpenMPCapturedDecl(ValueDecl *D, bool CheckScopeInfo,
unsigned StopAt) { … }
void SemaOpenMP::adjustOpenMPTargetScopeIndex(unsigned &FunctionScopesIndex,
unsigned Level) const { … }
void SemaOpenMP::startOpenMPLoop() { … }
void SemaOpenMP::startOpenMPCXXRangeFor() { … }
OpenMPClauseKind SemaOpenMP::isOpenMPPrivateDecl(ValueDecl *D, unsigned Level,
unsigned CapLevel) const { … }
void SemaOpenMP::setOpenMPCaptureKind(FieldDecl *FD, const ValueDecl *D,
unsigned Level) { … }
bool SemaOpenMP::isOpenMPTargetCapturedDecl(const ValueDecl *D, unsigned Level,
unsigned CaptureLevel) const { … }
bool SemaOpenMP::isOpenMPGlobalCapturedDecl(ValueDecl *D, unsigned Level,
unsigned CaptureLevel) const { … }
void SemaOpenMP::DestroyDataSharingAttributesStack() { … }
void SemaOpenMP::ActOnOpenMPBeginDeclareVariant(SourceLocation Loc,
OMPTraitInfo &TI) { … }
void SemaOpenMP::ActOnOpenMPEndDeclareVariant() { … }
void SemaOpenMP::finalizeOpenMPDelayedAnalysis(const FunctionDecl *Caller,
const FunctionDecl *Callee,
SourceLocation Loc) { … }
void SemaOpenMP::StartOpenMPDSABlock(OpenMPDirectiveKind DKind,
const DeclarationNameInfo &DirName,
Scope *CurScope, SourceLocation Loc) { … }
void SemaOpenMP::StartOpenMPClause(OpenMPClauseKind K) { … }
void SemaOpenMP::EndOpenMPClause() { … }
static std::pair<ValueDecl *, bool>
getPrivateItem(Sema &S, Expr *&RefExpr, SourceLocation &ELoc,
SourceRange &ERange, bool AllowArraySection = false,
StringRef DiagType = "");
static void checkReductionClauses(Sema &S, DSAStackTy *Stack,
ArrayRef<OMPClause *> Clauses) { … }
static void checkAllocateClauses(Sema &S, DSAStackTy *Stack,
ArrayRef<OMPClause *> Clauses);
static DeclRefExpr *buildCapture(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);
void SemaOpenMP::EndOpenMPDSABlock(Stmt *CurDirective) { … }
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) { … }
namespace {
class VarDeclFilterCCC final : public CorrectionCandidateCallback { … };
class VarOrFuncDeclFilterCCC final : public CorrectionCandidateCallback { … };
}
ExprResult SemaOpenMP::ActOnOpenMPIdExpression(Scope *CurScope,
CXXScopeSpec &ScopeSpec,
const DeclarationNameInfo &Id,
OpenMPDirectiveKind Kind) { … }
SemaOpenMP::DeclGroupPtrTy
SemaOpenMP::ActOnOpenMPThreadprivateDirective(SourceLocation Loc,
ArrayRef<Expr *> VarList) { … }
namespace {
class LocalVarRefChecker final
: public ConstStmtVisitor<LocalVarRefChecker, bool> { … };
}
OMPThreadPrivateDecl *
SemaOpenMP::CheckOMPThreadPrivateDecl(SourceLocation Loc,
ArrayRef<Expr *> VarList) { … }
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) { … }
SemaOpenMP::DeclGroupPtrTy SemaOpenMP::ActOnOpenMPAllocateDirective(
SourceLocation Loc, ArrayRef<Expr *> VarList, ArrayRef<OMPClause *> Clauses,
DeclContext *Owner) { … }
SemaOpenMP::DeclGroupPtrTy
SemaOpenMP::ActOnOpenMPRequiresDirective(SourceLocation Loc,
ArrayRef<OMPClause *> ClauseList) { … }
void SemaOpenMP::ActOnOpenMPAssumesDirective(SourceLocation Loc,
OpenMPDirectiveKind DKind,
ArrayRef<std::string> Assumptions,
bool SkippedClauses) { … }
void SemaOpenMP::ActOnOpenMPEndAssumesDirective() { … }
StmtResult SemaOpenMP::ActOnOpenMPAssumeDirective(ArrayRef<OMPClause *> Clauses,
Stmt *AStmt,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPRequiresDecl *
SemaOpenMP::CheckOMPRequiresDecl(SourceLocation Loc,
ArrayRef<OMPClause *> ClauseList) { … }
static void reportOriginalDsa(Sema &SemaRef, const DSAStackTy *Stack,
const ValueDecl *D,
const DSAStackTy::DSAVarData &DVar,
bool IsLoopIterVar) { … }
static OpenMPMapClauseKind
getMapClauseKindFromModifier(OpenMPDefaultmapClauseModifier M,
bool IsAggregateOrDeclareTarget) { … }
namespace {
struct VariableImplicitInfo { … };
class DSAAttrChecker final : public StmtVisitor<DSAAttrChecker, void> { … };
}
static void handleDeclareVariantConstructTrait(DSAStackTy *Stack,
OpenMPDirectiveKind DKind,
bool ScopeEntry) { … }
static SmallVector<SemaOpenMP::CapturedParamNameType>
getParallelRegionParams(Sema &SemaRef, bool LoopBoundSharing) { … }
static SmallVector<SemaOpenMP::CapturedParamNameType>
getTeamsRegionParams(Sema &SemaRef) { … }
static SmallVector<SemaOpenMP::CapturedParamNameType>
getTaskRegionParams(Sema &SemaRef) { … }
static SmallVector<SemaOpenMP::CapturedParamNameType>
getTargetRegionParams(Sema &SemaRef) { … }
static SmallVector<SemaOpenMP::CapturedParamNameType>
getUnknownRegionParams(Sema &SemaRef) { … }
static SmallVector<SemaOpenMP::CapturedParamNameType>
getTaskloopRegionParams(Sema &SemaRef) { … }
static void processCapturedRegions(Sema &SemaRef, OpenMPDirectiveKind DKind,
Scope *CurScope, SourceLocation Loc) { … }
void SemaOpenMP::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind,
Scope *CurScope) { … }
int SemaOpenMP::getNumberOfConstructScopes(unsigned Level) const { … }
int SemaOpenMP::getOpenMPCaptureLevels(OpenMPDirectiveKind DKind) { … }
static OMPCapturedExprDecl *buildCaptureDecl(Sema &S, IdentifierInfo *Id,
Expr *CaptureExpr, bool WithInit,
DeclContext *CurContext,
bool AsExpression) { … }
static DeclRefExpr *buildCapture(Sema &S, ValueDecl *D, Expr *CaptureExpr,
bool WithInit) { … }
static ExprResult buildCapture(Sema &S, Expr *CaptureExpr, DeclRefExpr *&Ref,
StringRef Name) { … }
namespace {
class CaptureRegionUnwinderRAII { … };
}
void SemaOpenMP::tryCaptureOpenMPLambdas(ValueDecl *V) { … }
static bool checkOrderedOrderSpecified(Sema &S,
const ArrayRef<OMPClause *> Clauses) { … }
StmtResult SemaOpenMP::ActOnOpenMPRegionEnd(StmtResult S,
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) { … }
struct Kind2Unsigned { … };
static bool checkIfClauses(Sema &S, OpenMPDirectiveKind Kind,
ArrayRef<OMPClause *> Clauses,
ArrayRef<OpenMPDirectiveKind> AllowedNameModifiers) { … }
static std::pair<ValueDecl *, bool> getPrivateItem(Sema &S, Expr *&RefExpr,
SourceLocation &ELoc,
SourceRange &ERange,
bool AllowArraySection,
StringRef DiagType) { … }
namespace {
class AllocatorChecker final : public ConstStmtVisitor<AllocatorChecker, bool> { … };
}
static void checkAllocateClauses(Sema &S, DSAStackTy *Stack,
ArrayRef<OMPClause *> Clauses) { … }
namespace {
class CaptureVars : public TreeTransform<CaptureVars> { … };
}
static VarDecl *precomputeExpr(Sema &Actions,
SmallVectorImpl<Stmt *> &BodyStmts, Expr *E,
StringRef Name) { … }
static CapturedStmt *buildDistanceFunc(Sema &Actions, QualType LogicalTy,
BinaryOperator::Opcode Rel,
Expr *StartExpr, Expr *StopExpr,
Expr *StepExpr) { … }
static CapturedStmt *buildLoopVarFunc(Sema &Actions, QualType LoopVarTy,
QualType LogicalTy,
DeclRefExpr *StartExpr, Expr *Step,
bool Deref) { … }
StmtResult SemaOpenMP::ActOnOpenMPCanonicalLoop(Stmt *AStmt) { … }
StmtResult SemaOpenMP::ActOnOpenMPLoopnest(Stmt *AStmt) { … }
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) { … }
namespace {
class TeamsLoopChecker final : public ConstStmtVisitor<TeamsLoopChecker> { … };
}
static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { … }
StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective(
OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName,
OpenMPDirectiveKind CancelRegion, ArrayRef<OMPClause *> Clauses,
Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc) { … }
SemaOpenMP::DeclGroupPtrTy SemaOpenMP::ActOnOpenMPDeclareSimdDirective(
DeclGroupPtrTy DG, OMPDeclareSimdDeclAttr::BranchStateTy BS, Expr *Simdlen,
ArrayRef<Expr *> Uniforms, ArrayRef<Expr *> Aligneds,
ArrayRef<Expr *> Alignments, ArrayRef<Expr *> Linears,
ArrayRef<unsigned> LinModifiers, ArrayRef<Expr *> Steps, SourceRange SR) { … }
StmtResult SemaOpenMP::ActOnOpenMPInformationalDirective(
OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName,
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc) { … }
static void setPrototype(Sema &S, FunctionDecl *FD, FunctionDecl *FDWithProto,
QualType NewType) { … }
void SemaOpenMP::ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(Decl *D) { … }
SemaOpenMP::OMPDeclareVariantScope::OMPDeclareVariantScope(OMPTraitInfo &TI)
: … { … }
void SemaOpenMP::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(
Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParamLists,
SmallVectorImpl<FunctionDecl *> &Bases) { … }
void SemaOpenMP::ActOnFinishedFunctionDefinitionInOpenMPDeclareVariantScope(
Decl *D, SmallVectorImpl<FunctionDecl *> &Bases) { … }
ExprResult SemaOpenMP::ActOnOpenMPCall(ExprResult Call, Scope *Scope,
SourceLocation LParenLoc,
MultiExprArg ArgExprs,
SourceLocation RParenLoc,
Expr *ExecConfig) { … }
std::optional<std::pair<FunctionDecl *, Expr *>>
SemaOpenMP::checkOpenMPDeclareVariantFunction(SemaOpenMP::DeclGroupPtrTy DG,
Expr *VariantRef,
OMPTraitInfo &TI,
unsigned NumAppendArgs,
SourceRange SR) { … }
void SemaOpenMP::ActOnOpenMPDeclareVariantDirective(
FunctionDecl *FD, Expr *VariantRef, OMPTraitInfo &TI,
ArrayRef<Expr *> AdjustArgsNothing,
ArrayRef<Expr *> AdjustArgsNeedDevicePtr,
ArrayRef<OMPInteropInfo> AppendArgs, SourceLocation AdjustArgsLoc,
SourceLocation AppendArgsLoc, SourceRange SR) { … }
static CapturedStmt *
setBranchProtectedScope(Sema &SemaRef, OpenMPDirectiveKind DKind, Stmt *AStmt) { … }
StmtResult
SemaOpenMP::ActOnOpenMPParallelDirective(ArrayRef<OMPClause *> Clauses,
Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc) { … }
namespace {
struct LoopIterationSpace final { … };
class ForSubExprChecker final : public RecursiveASTVisitor<ForSubExprChecker> { … };
class OpenMPIterationSpaceChecker { … };
bool OpenMPIterationSpaceChecker::dependent() const { … }
bool OpenMPIterationSpaceChecker::setLCDeclAndLB(ValueDecl *NewLCDecl,
Expr *NewLCRefExpr,
Expr *NewLB, bool EmitDiags) { … }
bool OpenMPIterationSpaceChecker::setUB(Expr *NewUB, std::optional<bool> LessOp,
bool StrictOp, SourceRange SR,
SourceLocation SL) { … }
bool OpenMPIterationSpaceChecker::setStep(Expr *NewStep, bool Subtract) { … }
namespace {
class LoopCounterRefChecker final
: public ConstStmtVisitor<LoopCounterRefChecker, bool> { … };
}
std::optional<unsigned>
OpenMPIterationSpaceChecker::doesDependOnLoopCounter(const Stmt *S,
bool IsInitializer) { … }
bool OpenMPIterationSpaceChecker::checkAndSetInit(Stmt *S, bool EmitDiags) { … }
static const ValueDecl *getInitLCDecl(const Expr *E) { … }
bool OpenMPIterationSpaceChecker::checkAndSetCond(Expr *S) { … }
bool OpenMPIterationSpaceChecker::checkAndSetIncRHS(Expr *RHS) { … }
bool OpenMPIterationSpaceChecker::checkAndSetInc(Expr *S) { … }
static ExprResult
tryBuildCapture(Sema &SemaRef, Expr *Capture,
llvm::MapVector<const Expr *, DeclRefExpr *> &Captures,
StringRef Name = ".capture_expr.") { … }
static Expr *
calculateNumIters(Sema &SemaRef, Scope *S, SourceLocation DefaultLoc,
Expr *Lower, Expr *Upper, Expr *Step, QualType LCTy,
bool TestIsStrictOp, bool RoundToStep,
llvm::MapVector<const Expr *, DeclRefExpr *> &Captures) { … }
Expr *OpenMPIterationSpaceChecker::buildNumIterations(
Scope *S, ArrayRef<LoopIterationSpace> ResultIterSpaces, bool LimitedType,
llvm::MapVector<const Expr *, DeclRefExpr *> &Captures) const { … }
std::pair<Expr *, Expr *> OpenMPIterationSpaceChecker::buildMinMaxValues(
Scope *S, llvm::MapVector<const Expr *, DeclRefExpr *> &Captures) const { … }
Expr *OpenMPIterationSpaceChecker::buildFinalCondition(Scope *S) const { … }
Expr *OpenMPIterationSpaceChecker::buildPreCond(
Scope *S, Expr *Cond,
llvm::MapVector<const Expr *, DeclRefExpr *> &Captures) const { … }
DeclRefExpr *OpenMPIterationSpaceChecker::buildCounterVar(
llvm::MapVector<const Expr *, DeclRefExpr *> &Captures,
DSAStackTy &DSA) const { … }
Expr *OpenMPIterationSpaceChecker::buildPrivateCounterVar() const { … }
Expr *OpenMPIterationSpaceChecker::buildCounterInit() const { … }
Expr *OpenMPIterationSpaceChecker::buildCounterStep() const { … }
Expr *OpenMPIterationSpaceChecker::buildOrderedLoopData(
Scope *S, Expr *Counter,
llvm::MapVector<const Expr *, DeclRefExpr *> &Captures, SourceLocation Loc,
Expr *Inc, OverloadedOperatorKind OOK) { … }
}
void SemaOpenMP::ActOnOpenMPLoopInitialization(SourceLocation ForLoc,
Stmt *Init) { … }
namespace {
class OMPDoacrossKind { … };
}
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 ExprResult
buildCounterInit(Sema &SemaRef, Scope *S, SourceLocation Loc, ExprResult VarRef,
ExprResult Start, bool IsNonRectangularLB,
llvm::MapVector<const Expr *, DeclRefExpr *> &Captures) { … }
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 ExprResult widenIterationCount(unsigned Bits, Expr *E, Sema &SemaRef) { … }
static bool fitsInto(unsigned Bits, bool Signed, const Expr *E, Sema &SemaRef) { … }
static Stmt *buildPreInits(ASTContext &Context,
MutableArrayRef<Decl *> PreInits) { … }
static void appendFlattenedStmtList(SmallVectorImpl<Stmt *> &TargetList,
Stmt *Item) { … }
static Stmt *
buildPreInits(ASTContext &Context,
const llvm::MapVector<const Expr *, DeclRefExpr *> &Captures) { … }
static Stmt *buildPreInits(ASTContext &Context, ArrayRef<Stmt *> PreInits) { … }
static Expr *buildPostUpdate(Sema &S, ArrayRef<Expr *> PostUpdates) { … }
class ForVarDeclFinder final : public RecursiveASTVisitor<ForVarDeclFinder> { … };
static unsigned
checkOpenMPLoop(OpenMPDirectiveKind DKind, Expr *CollapseLoopCountExpr,
Expr *OrderedLoopCountExpr, Stmt *AStmt, Sema &SemaRef,
DSAStackTy &DSA,
SemaOpenMP::VarsWithInheritedDSAType &VarsWithImplicitDSA,
OMPLoopBasedDirective::HelperExprs &Built) { … }
static Expr *getCollapseNumberExpr(ArrayRef<OMPClause *> Clauses) { … }
static Expr *getOrderedNumberExpr(ArrayRef<OMPClause *> Clauses) { … }
static bool checkSimdlenSafelenSpecified(Sema &S,
const ArrayRef<OMPClause *> Clauses) { … }
StmtResult SemaOpenMP::ActOnOpenMPSimdDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPForDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPForSimdDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
static bool checkSectionsDirective(Sema &SemaRef, OpenMPDirectiveKind DKind,
Stmt *AStmt, DSAStackTy *Stack) { … }
StmtResult
SemaOpenMP::ActOnOpenMPSectionsDirective(ArrayRef<OMPClause *> Clauses,
Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPSectionDirective(Stmt *AStmt,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
static Expr *getDirectCallExpr(Expr *E) { … }
StmtResult
SemaOpenMP::ActOnOpenMPDispatchDirective(ArrayRef<OMPClause *> Clauses,
Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc) { … }
static bool checkGenericLoopLastprivate(Sema &S, ArrayRef<OMPClause *> Clauses,
OpenMPDirectiveKind K,
DSAStackTy *Stack) { … }
StmtResult SemaOpenMP::ActOnOpenMPGenericLoopDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPTeamsGenericLoopDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPTargetTeamsGenericLoopDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPParallelGenericLoopDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPTargetParallelGenericLoopDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPSingleDirective(ArrayRef<OMPClause *> Clauses,
Stmt *AStmt,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPMasterDirective(Stmt *AStmt,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPMaskedDirective(ArrayRef<OMPClause *> Clauses,
Stmt *AStmt,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPCriticalDirective(
const DeclarationNameInfo &DirName, ArrayRef<OMPClause *> Clauses,
Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPParallelForDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPParallelForSimdDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPParallelMasterDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPParallelMaskedDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPParallelSectionsDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc) { … }
static bool checkMutuallyExclusiveClauses(
Sema &S, ArrayRef<OMPClause *> Clauses,
ArrayRef<OpenMPClauseKind> MutuallyExclusiveClauses) { … }
StmtResult SemaOpenMP::ActOnOpenMPTaskDirective(ArrayRef<OMPClause *> Clauses,
Stmt *AStmt,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPTaskyieldDirective(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPBarrierDirective(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPErrorDirective(ArrayRef<OMPClause *> Clauses,
SourceLocation StartLoc,
SourceLocation EndLoc,
bool InExContext) { … }
StmtResult
SemaOpenMP::ActOnOpenMPTaskwaitDirective(ArrayRef<OMPClause *> Clauses,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult
SemaOpenMP::ActOnOpenMPTaskgroupDirective(ArrayRef<OMPClause *> Clauses,
Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPFlushDirective(ArrayRef<OMPClause *> Clauses,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPDepobjDirective(ArrayRef<OMPClause *> Clauses,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPScanDirective(ArrayRef<OMPClause *> Clauses,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult
SemaOpenMP::ActOnOpenMPOrderedDirective(ArrayRef<OMPClause *> Clauses,
Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc) { … }
namespace {
class OpenMPAtomicUpdateChecker { … };
bool OpenMPAtomicUpdateChecker::checkBinaryOperation(
BinaryOperator *AtomicBinOp, unsigned DiagId, unsigned NoteId) { … }
bool OpenMPAtomicUpdateChecker::checkStatement(Stmt *S, unsigned DiagId,
unsigned NoteId) { … }
llvm::FoldingSetNodeID getNodeId(ASTContext &Context, const Expr *S) { … }
bool checkIfTwoExprsAreSame(ASTContext &Context, const Expr *LHS,
const Expr *RHS) { … }
class OpenMPAtomicCompareChecker { … };
bool OpenMPAtomicCompareChecker::checkCondUpdateStmt(IfStmt *S,
ErrorInfoTy &ErrorInfo) { … }
bool OpenMPAtomicCompareChecker::checkCondExprStmt(Stmt *S,
ErrorInfoTy &ErrorInfo) { … }
bool OpenMPAtomicCompareChecker::checkType(ErrorInfoTy &ErrorInfo) const { … }
bool OpenMPAtomicCompareChecker::checkStmt(
Stmt *S, OpenMPAtomicCompareChecker::ErrorInfoTy &ErrorInfo) { … }
class OpenMPAtomicCompareCaptureChecker final
: public OpenMPAtomicCompareChecker { … };
bool OpenMPAtomicCompareCaptureChecker::checkType(ErrorInfoTy &ErrorInfo) { … }
bool OpenMPAtomicCompareCaptureChecker::checkForm3(IfStmt *S,
ErrorInfoTy &ErrorInfo) { … }
bool OpenMPAtomicCompareCaptureChecker::checkForm45(Stmt *S,
ErrorInfoTy &ErrorInfo) { … }
bool OpenMPAtomicCompareCaptureChecker::checkStmt(Stmt *S,
ErrorInfoTy &ErrorInfo) { … }
}
StmtResult SemaOpenMP::ActOnOpenMPAtomicDirective(ArrayRef<OMPClause *> Clauses,
Stmt *AStmt,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPTargetDirective(ArrayRef<OMPClause *> Clauses,
Stmt *AStmt,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPTargetParallelDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPTargetParallelForDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
static bool hasClauses(ArrayRef<OMPClause *> Clauses,
const OpenMPClauseKind K) { … }
template <typename... Params>
static bool hasClauses(ArrayRef<OMPClause *> Clauses, const OpenMPClauseKind K,
const Params... ClauseTypes) { … }
static bool isClauseMappable(ArrayRef<OMPClause *> Clauses) { … }
StmtResult
SemaOpenMP::ActOnOpenMPTargetDataDirective(ArrayRef<OMPClause *> Clauses,
Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPTargetEnterDataDirective(
ArrayRef<OMPClause *> Clauses, SourceLocation StartLoc,
SourceLocation EndLoc, Stmt *AStmt) { … }
StmtResult SemaOpenMP::ActOnOpenMPTargetExitDataDirective(
ArrayRef<OMPClause *> Clauses, SourceLocation StartLoc,
SourceLocation EndLoc, Stmt *AStmt) { … }
StmtResult SemaOpenMP::ActOnOpenMPTargetUpdateDirective(
ArrayRef<OMPClause *> Clauses, SourceLocation StartLoc,
SourceLocation EndLoc, Stmt *AStmt) { … }
template <typename ClauseType>
static bool checkNumExprsInClause(SemaBase &SemaRef,
ArrayRef<OMPClause *> Clauses,
unsigned MaxNum, unsigned Diag) { … }
StmtResult SemaOpenMP::ActOnOpenMPTeamsDirective(ArrayRef<OMPClause *> Clauses,
Stmt *AStmt,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPCancellationPointDirective(
SourceLocation StartLoc, SourceLocation EndLoc,
OpenMPDirectiveKind CancelRegion) { … }
StmtResult SemaOpenMP::ActOnOpenMPCancelDirective(
ArrayRef<OMPClause *> Clauses, SourceLocation StartLoc,
SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion) { … }
static bool checkReductionClauseWithNogroup(Sema &S,
ArrayRef<OMPClause *> Clauses) { … }
StmtResult SemaOpenMP::ActOnOpenMPTaskLoopDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPTaskLoopSimdDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPMasterTaskLoopDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPMaskedTaskLoopDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPMasterTaskLoopSimdDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPMaskedTaskLoopSimdDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopSimdDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopSimdDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPDistributeDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPDistributeParallelForDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPDistributeParallelForSimdDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPDistributeSimdDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPTargetParallelForSimdDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPTargetSimdDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPTeamsDistributeDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPTeamsDistributeSimdDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForSimdDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPTargetTeamsDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPTargetTeamsDistributeDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
StmtResult SemaOpenMP::ActOnOpenMPTargetTeamsDistributeSimdDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA) { … }
bool SemaOpenMP::checkTransformableLoopNest(
OpenMPDirectiveKind Kind, Stmt *AStmt, int NumLoops,
SmallVectorImpl<OMPLoopBasedDirective::HelperExprs> &LoopHelpers,
Stmt *&Body, SmallVectorImpl<SmallVector<Stmt *, 0>> &OriginalInits) { … }
static void addLoopPreInits(ASTContext &Context,
OMPLoopBasedDirective::HelperExprs &LoopHelper,
Stmt *LoopStmt, ArrayRef<Stmt *> OriginalInit,
SmallVectorImpl<Stmt *> &PreInits) { … }
static void collectLoopStmts(Stmt *AStmt, MutableArrayRef<Stmt *> LoopStmts) { … }
StmtResult SemaOpenMP::ActOnOpenMPTileDirective(ArrayRef<OMPClause *> Clauses,
Stmt *AStmt,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPUnrollDirective(ArrayRef<OMPClause *> Clauses,
Stmt *AStmt,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPReverseDirective(Stmt *AStmt,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult SemaOpenMP::ActOnOpenMPInterchangeDirective(
ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind,
Expr *Expr,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
static OpenMPDirectiveKind getOpenMPCaptureRegionForClause(
OpenMPDirectiveKind DKind, OpenMPClauseKind CKind, unsigned OpenMPVersion,
OpenMPDirectiveKind NameModifier = OMPD_unknown) { … }
OMPClause *SemaOpenMP::ActOnOpenMPIfClause(
OpenMPDirectiveKind NameModifier, Expr *Condition, SourceLocation StartLoc,
SourceLocation LParenLoc, SourceLocation NameModifierLoc,
SourceLocation ColonLoc, SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPFinalClause(Expr *Condition,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
ExprResult
SemaOpenMP::PerformOpenMPImplicitIntegerConversion(SourceLocation Loc,
Expr *Op) { … }
static bool
isNonNegativeIntegerValue(Expr *&ValExpr, Sema &SemaRef, OpenMPClauseKind CKind,
bool StrictlyPositive, bool BuildCapture = false,
OpenMPDirectiveKind DKind = OMPD_unknown,
OpenMPDirectiveKind *CaptureRegion = nullptr,
Stmt **HelperValStmt = nullptr) { … }
OMPClause *SemaOpenMP::ActOnOpenMPNumThreadsClause(Expr *NumThreads,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
ExprResult SemaOpenMP::VerifyPositiveIntegerConstantInClause(
Expr *E, OpenMPClauseKind CKind, bool StrictlyPositive,
bool SuppressExprDiags) { … }
OMPClause *SemaOpenMP::ActOnOpenMPSafelenClause(Expr *Len,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPSimdlenClause(Expr *Len,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
static bool findOMPAllocatorHandleT(Sema &S, SourceLocation Loc,
DSAStackTy *Stack) { … }
OMPClause *SemaOpenMP::ActOnOpenMPAllocatorClause(Expr *A,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPCollapseClause(Expr *NumForLoops,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPOrderedClause(SourceLocation StartLoc,
SourceLocation EndLoc,
SourceLocation LParenLoc,
Expr *NumForLoops) { … }
OMPClause *SemaOpenMP::ActOnOpenMPSimpleClause(
OpenMPClauseKind Kind, unsigned Argument, SourceLocation ArgumentLoc,
SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) { … }
static std::string
getListOfPossibleValues(OpenMPClauseKind K, unsigned First, unsigned Last,
ArrayRef<unsigned> Exclude = std::nullopt) { … }
OMPClause *SemaOpenMP::ActOnOpenMPDefaultClause(DefaultKind Kind,
SourceLocation KindKwLoc,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPProcBindClause(ProcBindKind Kind,
SourceLocation KindKwLoc,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPAtomicDefaultMemOrderClause(
OpenMPAtomicDefaultMemOrderClauseKind Kind, SourceLocation KindKwLoc,
SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPAtClause(OpenMPAtClauseKind Kind,
SourceLocation KindKwLoc,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPSeverityClause(OpenMPSeverityClauseKind Kind,
SourceLocation KindKwLoc,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPMessageClause(Expr *ME,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPOrderClause(
OpenMPOrderClauseModifier Modifier, OpenMPOrderClauseKind Kind,
SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc,
SourceLocation KindLoc, SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPUpdateClause(OpenMPDependClauseKind Kind,
SourceLocation KindKwLoc,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPSizesClause(ArrayRef<Expr *> SizeExprs,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPPermutationClause(ArrayRef<Expr *> PermExprs,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPFullClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPPartialClause(Expr *FactorExpr,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPAlignClause(Expr *A, SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPSingleExprWithArgClause(
OpenMPClauseKind Kind, ArrayRef<unsigned> Argument, Expr *Expr,
SourceLocation StartLoc, SourceLocation LParenLoc,
ArrayRef<SourceLocation> ArgumentLoc, SourceLocation DelimLoc,
SourceLocation EndLoc) { … }
static bool checkScheduleModifiers(Sema &S, OpenMPScheduleClauseModifier M1,
OpenMPScheduleClauseModifier M2,
SourceLocation M1Loc, SourceLocation M2Loc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPScheduleClause(
OpenMPScheduleClauseModifier M1, OpenMPScheduleClauseModifier M2,
OpenMPScheduleClauseKind Kind, Expr *ChunkSize, SourceLocation StartLoc,
SourceLocation LParenLoc, SourceLocation M1Loc, SourceLocation M2Loc,
SourceLocation KindLoc, SourceLocation CommaLoc, SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPClause(OpenMPClauseKind Kind,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPNowaitClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPUntiedClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPMergeableClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPReadClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPWriteClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPUpdateClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPCaptureClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPCompareClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPFailClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPFailClause(OpenMPClauseKind Parameter,
SourceLocation KindLoc,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPSeqCstClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPAcqRelClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPAcquireClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPReleaseClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPRelaxedClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPWeakClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPThreadsClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPSIMDClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPNogroupClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPUnifiedAddressClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *
SemaOpenMP::ActOnOpenMPUnifiedSharedMemoryClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPReverseOffloadClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
OMPClause *
SemaOpenMP::ActOnOpenMPDynamicAllocatorsClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }
StmtResult
SemaOpenMP::ActOnOpenMPInteropDirective(ArrayRef<OMPClause *> Clauses,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }
static bool isValidInteropVariable(Sema &SemaRef, Expr *InteropVarExpr,
SourceLocation VarLoc,
OpenMPClauseKind Kind) { … }
OMPClause *SemaOpenMP::ActOnOpenMPInitClause(
Expr *InteropVar, OMPInteropInfo &InteropInfo, SourceLocation StartLoc,
SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPUseClause(Expr *InteropVar,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation VarLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPDestroyClause(Expr *InteropVar,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation VarLoc,
SourceLocation EndLoc) { … }
OMPClause *SemaOpenMP::ActOnOpenMPNovariantsClause(Expr *Condition,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPNocontextClause(Expr *Condition,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPFilterClause(Expr *ThreadID,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPVarListClause(OpenMPClauseKind Kind,
ArrayRef<Expr *> VarList,
const OMPVarListLocTy &Locs,
OpenMPVarListDataTy &Data) { … }ExprResult SemaOpenMP::getOpenMPCapturedExpr(VarDecl *Capture, ExprValueKind VK,
ExprObjectKind OK,
SourceLocation Loc) { … }OMPClause *SemaOpenMP::ActOnOpenMPPrivateClause(ArrayRef<Expr *> VarList,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPFirstprivateClause(ArrayRef<Expr *> VarList,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPLastprivateClause(
ArrayRef<Expr *> VarList, OpenMPLastprivateModifier LPKind,
SourceLocation LPKindLoc, SourceLocation ColonLoc, SourceLocation StartLoc,
SourceLocation LParenLoc, SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPSharedClause(ArrayRef<Expr *> VarList,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }class DSARefChecker : public StmtVisitor<DSARefChecker, bool> { … }class TransformExprToCaptures : public TreeTransform<TransformExprToCaptures> { … }template <typename T, typename U>
static T filterLookupForUDReductionAndMapper(
SmallVectorImpl<U> &Lookups, const llvm::function_ref<T(ValueDecl *)> Gen) { … }static NamedDecl *findAcceptableDecl(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) { … }struct ReductionData { … }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) { … }OMPClause *SemaOpenMP::ActOnOpenMPReductionClause(
ArrayRef<Expr *> VarList, OpenMPReductionClauseModifier Modifier,
SourceLocation StartLoc, SourceLocation LParenLoc,
SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc,
CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId,
ArrayRef<Expr *> UnresolvedReductions) { … }OMPClause *SemaOpenMP::ActOnOpenMPTaskReductionClause(
ArrayRef<Expr *> VarList, SourceLocation StartLoc, SourceLocation LParenLoc,
SourceLocation ColonLoc, SourceLocation EndLoc,
CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId,
ArrayRef<Expr *> UnresolvedReductions) { … }OMPClause *SemaOpenMP::ActOnOpenMPInReductionClause(
ArrayRef<Expr *> VarList, SourceLocation StartLoc, SourceLocation LParenLoc,
SourceLocation ColonLoc, SourceLocation EndLoc,
CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId,
ArrayRef<Expr *> UnresolvedReductions) { … }bool SemaOpenMP::CheckOpenMPLinearModifier(OpenMPLinearClauseKind LinKind,
SourceLocation LinLoc) { … }bool SemaOpenMP::CheckOpenMPLinearDecl(const ValueDecl *D, SourceLocation ELoc,
OpenMPLinearClauseKind LinKind,
QualType Type, bool IsDeclareSimd) { … }OMPClause *SemaOpenMP::ActOnOpenMPLinearClause(
ArrayRef<Expr *> VarList, Expr *Step, SourceLocation StartLoc,
SourceLocation LParenLoc, OpenMPLinearClauseKind LinKind,
SourceLocation LinLoc, SourceLocation ColonLoc,
SourceLocation StepModifierLoc, SourceLocation EndLoc) { … }static bool FinishOpenMPLinearClause(OMPLinearClause &Clause, DeclRefExpr *IV,
Expr *NumIterations, Sema &SemaRef,
Scope *S, DSAStackTy *Stack) { … }OMPClause *SemaOpenMP::ActOnOpenMPAlignedClause(
ArrayRef<Expr *> VarList, Expr *Alignment, SourceLocation StartLoc,
SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPCopyinClause(ArrayRef<Expr *> VarList,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPCopyprivateClause(ArrayRef<Expr *> VarList,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPFlushClause(ArrayRef<Expr *> VarList,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }static bool findOMPDependT(Sema &S, SourceLocation Loc, DSAStackTy *Stack,
bool Diagnose = true) { … }OMPClause *SemaOpenMP::ActOnOpenMPDepobjClause(Expr *Depobj,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }struct DoacrossDataInfoTy { … }static DoacrossDataInfoTy
ProcessOpenMPDoacrossClauseCommon(Sema &SemaRef, bool IsSource,
ArrayRef<Expr *> VarList, DSAStackTy *Stack,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPDependClause(
const OMPDependClause::DependDataTy &Data, Expr *DepModifier,
ArrayRef<Expr *> VarList, SourceLocation StartLoc, SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPDeviceClause(
OpenMPDeviceClauseModifier Modifier, Expr *Device, SourceLocation StartLoc,
SourceLocation LParenLoc, SourceLocation ModifierLoc,
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) { … }static bool checkArrayExpressionDoesNotReferToUnitySize(Sema &SemaRef,
const Expr *E,
QualType BaseQTy) { … }class MapBaseChecker final : public StmtVisitor<MapBaseChecker, bool> { … }static const Expr *checkMapClauseExpressionBase(
Sema &SemaRef, Expr *E,
OMPClauseMappableExprCommon::MappableExprComponentList &CurComponents,
OpenMPClauseKind CKind, OpenMPDirectiveKind DKind, bool NoDiagnose) { … }static bool checkMapConflicts(
Sema &SemaRef, DSAStackTy *DSAS, const ValueDecl *VD, const Expr *E,
bool CurrentRegionOnly,
OMPClauseMappableExprCommon::MappableExprComponentListRef CurComponents,
OpenMPClauseKind CKind) { … }static ExprResult buildUserDefinedMapperRef(Sema &SemaRef, Scope *S,
CXXScopeSpec &MapperIdScopeSpec,
const DeclarationNameInfo &MapperId,
QualType Type,
Expr *UnresolvedMapper) { … }struct MappableVarListInfo { … }static DeclRefExpr *buildImplicitMap(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) { … }OMPClause *SemaOpenMP::ActOnOpenMPMapClause(
Expr *IteratorModifier, ArrayRef<OpenMPMapModifierKind> MapTypeModifiers,
ArrayRef<SourceLocation> MapTypeModifiersLoc,
CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId,
OpenMPMapClauseKind MapType, bool IsMapTypeImplicit, SourceLocation MapLoc,
SourceLocation ColonLoc, ArrayRef<Expr *> VarList,
const OMPVarListLocTy &Locs, bool NoDiagnose,
ArrayRef<Expr *> UnresolvedMappers) { … }QualType SemaOpenMP::ActOnOpenMPDeclareReductionType(SourceLocation TyLoc,
TypeResult ParsedType) { … }SemaOpenMP::DeclGroupPtrTy
SemaOpenMP::ActOnOpenMPDeclareReductionDirectiveStart(
Scope *S, DeclContext *DC, DeclarationName Name,
ArrayRef<std::pair<QualType, SourceLocation>> ReductionTypes,
AccessSpecifier AS, Decl *PrevDeclInScope) { … }void SemaOpenMP::ActOnOpenMPDeclareReductionCombinerStart(Scope *S, Decl *D) { … }void SemaOpenMP::ActOnOpenMPDeclareReductionCombinerEnd(Decl *D,
Expr *Combiner) { … }VarDecl *SemaOpenMP::ActOnOpenMPDeclareReductionInitializerStart(Scope *S,
Decl *D) { … }void SemaOpenMP::ActOnOpenMPDeclareReductionInitializerEnd(
Decl *D, Expr *Initializer, VarDecl *OmpPrivParm) { … }SemaOpenMP::DeclGroupPtrTy SemaOpenMP::ActOnOpenMPDeclareReductionDirectiveEnd(
Scope *S, DeclGroupPtrTy DeclReductions, bool IsValid) { … }TypeResult SemaOpenMP::ActOnOpenMPDeclareMapperVarDecl(Scope *S,
Declarator &D) { … }QualType SemaOpenMP::ActOnOpenMPDeclareMapperType(SourceLocation TyLoc,
TypeResult ParsedType) { … }SemaOpenMP::DeclGroupPtrTy SemaOpenMP::ActOnOpenMPDeclareMapperDirective(
Scope *S, DeclContext *DC, DeclarationName Name, QualType MapperType,
SourceLocation StartLoc, DeclarationName VN, AccessSpecifier AS,
Expr *MapperVarRef, ArrayRef<OMPClause *> Clauses, Decl *PrevDeclInScope) { … }ExprResult SemaOpenMP::ActOnOpenMPDeclareMapperDirectiveVarDecl(
Scope *S, QualType MapperType, SourceLocation StartLoc,
DeclarationName VN) { … }void SemaOpenMP::ActOnOpenMPIteratorVarDecl(VarDecl *VD) { … }bool SemaOpenMP::isOpenMPDeclareMapperVarDeclAllowed(const VarDecl *VD) const { … }const ValueDecl *SemaOpenMP::getOpenMPDeclareMapperVarName() const { … }OMPClause *SemaOpenMP::ActOnOpenMPNumTeamsClause(ArrayRef<Expr *> VarList,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPThreadLimitClause(ArrayRef<Expr *> VarList,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPPriorityClause(Expr *Priority,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPGrainsizeClause(
OpenMPGrainsizeClauseModifier Modifier, Expr *Grainsize,
SourceLocation StartLoc, SourceLocation LParenLoc,
SourceLocation ModifierLoc, SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPNumTasksClause(
OpenMPNumTasksClauseModifier Modifier, Expr *NumTasks,
SourceLocation StartLoc, SourceLocation LParenLoc,
SourceLocation ModifierLoc, SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPHintClause(Expr *Hint,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }static bool findOMPEventHandleT(Sema &S, SourceLocation Loc,
DSAStackTy *Stack) { … }OMPClause *SemaOpenMP::ActOnOpenMPDetachClause(Expr *Evt,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPDistScheduleClause(
OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize, SourceLocation StartLoc,
SourceLocation LParenLoc, SourceLocation KindLoc, SourceLocation CommaLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPDefaultmapClause(
OpenMPDefaultmapClauseModifier M, OpenMPDefaultmapClauseKind Kind,
SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc,
SourceLocation KindLoc, SourceLocation EndLoc) { … }bool SemaOpenMP::ActOnStartOpenMPDeclareTargetContext(
DeclareTargetContextInfo &DTCI) { … }const SemaOpenMP::DeclareTargetContextInfo
SemaOpenMP::ActOnOpenMPEndDeclareTargetDirective() { … }void SemaOpenMP::ActOnFinishedOpenMPDeclareTargetContext(
DeclareTargetContextInfo &DTCI) { … }void SemaOpenMP::DiagnoseUnterminatedOpenMPDeclareTarget() { … }NamedDecl *SemaOpenMP::lookupOpenMPDeclareTargetName(
Scope *CurScope, CXXScopeSpec &ScopeSpec, const DeclarationNameInfo &Id) { … }void SemaOpenMP::ActOnOpenMPDeclareTargetName(
NamedDecl *ND, SourceLocation Loc, OMPDeclareTargetDeclAttr::MapTypeTy MT,
DeclareTargetContextInfo &DTCI) { … }static void checkDeclInTargetContext(SourceLocation SL, SourceRange SR,
Sema &SemaRef, Decl *D) { … }static bool checkValueDeclInTarget(SourceLocation SL, SourceRange SR,
Sema &SemaRef, DSAStackTy *Stack,
ValueDecl *VD) { … }void SemaOpenMP::checkDeclIsAllowedInOpenMPTarget(Expr *E, Decl *D,
SourceLocation IdLoc) { … }class GlobalDeclRefChecker final : public StmtVisitor<GlobalDeclRefChecker> { … }void SemaOpenMP::ActOnOpenMPDeclareTargetInitializer(Decl *TargetDecl) { … }OMPClause *SemaOpenMP::ActOnOpenMPToClause(
ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
ArrayRef<SourceLocation> MotionModifiersLoc,
CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId,
SourceLocation ColonLoc, ArrayRef<Expr *> VarList,
const OMPVarListLocTy &Locs, ArrayRef<Expr *> UnresolvedMappers) { … }OMPClause *SemaOpenMP::ActOnOpenMPFromClause(
ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
ArrayRef<SourceLocation> MotionModifiersLoc,
CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId,
SourceLocation ColonLoc, ArrayRef<Expr *> VarList,
const OMPVarListLocTy &Locs, ArrayRef<Expr *> UnresolvedMappers) { … }OMPClause *
SemaOpenMP::ActOnOpenMPUseDevicePtrClause(ArrayRef<Expr *> VarList,
const OMPVarListLocTy &Locs) { … }OMPClause *
SemaOpenMP::ActOnOpenMPUseDeviceAddrClause(ArrayRef<Expr *> VarList,
const OMPVarListLocTy &Locs) { … }OMPClause *
SemaOpenMP::ActOnOpenMPIsDevicePtrClause(ArrayRef<Expr *> VarList,
const OMPVarListLocTy &Locs) { … }OMPClause *
SemaOpenMP::ActOnOpenMPHasDeviceAddrClause(ArrayRef<Expr *> VarList,
const OMPVarListLocTy &Locs) { … }OMPClause *SemaOpenMP::ActOnOpenMPAllocateClause(
Expr *Allocator, ArrayRef<Expr *> VarList, SourceLocation StartLoc,
SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPNontemporalClause(ArrayRef<Expr *> VarList,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }StmtResult SemaOpenMP::ActOnOpenMPScopeDirective(ArrayRef<OMPClause *> Clauses,
Stmt *AStmt,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPInclusiveClause(ArrayRef<Expr *> VarList,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPExclusiveClause(ArrayRef<Expr *> VarList,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }static bool findOMPAlloctraitT(Sema &S, SourceLocation Loc, DSAStackTy *Stack) { … }OMPClause *SemaOpenMP::ActOnOpenMPUsesAllocatorClause(
SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc,
ArrayRef<UsesAllocatorsData> Data) { … }OMPClause *SemaOpenMP::ActOnOpenMPAffinityClause(
SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc,
SourceLocation EndLoc, Expr *Modifier, ArrayRef<Expr *> Locators) { … }OMPClause *SemaOpenMP::ActOnOpenMPBindClause(OpenMPBindClauseKind Kind,
SourceLocation KindLoc,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPXDynCGroupMemClause(Expr *Size,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPDoacrossClause(
OpenMPDoacrossClauseModifier DepType, SourceLocation DepLoc,
SourceLocation ColonLoc, ArrayRef<Expr *> VarList, SourceLocation StartLoc,
SourceLocation LParenLoc, SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPXAttributeClause(ArrayRef<const Attr *> Attrs,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPXBareClause(SourceLocation StartLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPHoldsClause(Expr *E, SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPDirectivePresenceClause(
OpenMPClauseKind CK, llvm::ArrayRef<OpenMPDirectiveKind> DKVec,
SourceLocation Loc, SourceLocation LLoc, SourceLocation RLoc) { … }OMPClause *SemaOpenMP::ActOnOpenMPNullaryAssumptionClause(OpenMPClauseKind CK,
SourceLocation Loc,
SourceLocation RLoc) { … }ExprResult SemaOpenMP::ActOnOMPArraySectionExpr(
Expr *Base, SourceLocation LBLoc, Expr *LowerBound,
SourceLocation ColonLocFirst, SourceLocation ColonLocSecond, Expr *Length,
Expr *Stride, SourceLocation RBLoc) { … }ExprResult SemaOpenMP::ActOnOMPArrayShapingExpr(
Expr *Base, SourceLocation LParenLoc, SourceLocation RParenLoc,
ArrayRef<Expr *> Dims, ArrayRef<SourceRange> Brackets) { … }ExprResult SemaOpenMP::ActOnOMPIteratorExpr(Scope *S,
SourceLocation IteratorKwLoc,
SourceLocation LLoc,
SourceLocation RLoc,
ArrayRef<OMPIteratorData> Data) { … }static void checkOMPAssumeAttr(Sema &S, SourceLocation Loc,
StringRef AssumptionStr) { … }void SemaOpenMP::handleOMPAssumeAttr(Decl *D, const ParsedAttr &AL) { … }SemaOpenMP::SemaOpenMP(Sema &S)
: … { … }