|
clang 22.0.0git
|
#include "clang/Sema/ScopeInfo.h"
Public Types | |
| enum | ImplicitCaptureStyle { ImpCap_None , ImpCap_LambdaByval , ImpCap_LambdaByref , ImpCap_Block , ImpCap_CapturedRegion } |
| Public Types inherited from clang::sema::FunctionScopeInfo | |
| enum | { TryLocIsCXX , TryLocIsObjC , Unknown } |
| using | SwitchInfo = llvm::PointerIntPair<SwitchStmt*, 1, bool> |
| A SwitchStmt, along with a flag indicating if its list of case statements is incomplete (because we dropped an invalid one while parsing). | |
| using | WeakUseVector = SmallVector<WeakUseTy, 4> |
| Used to collect uses of a particular weak object in a function body. | |
| using | WeakObjectUseMap |
| Used to collect all uses of weak objects in a function body. | |
Public Member Functions | |
| CapturingScopeInfo (DiagnosticsEngine &Diag, ImplicitCaptureStyle Style) | |
| void | addCapture (ValueDecl *Var, bool isBlock, bool isByref, bool isNested, SourceLocation Loc, SourceLocation EllipsisLoc, QualType CaptureType, bool Invalid) |
| void | addVLATypeCapture (SourceLocation Loc, const VariableArrayType *VLAType, QualType CaptureType) |
| void | addThisCapture (bool isNested, SourceLocation Loc, QualType CaptureType, bool ByCopy) |
| bool | isCXXThisCaptured () const |
| Determine whether the C++ 'this' is captured. | |
| Capture & | getCXXThisCapture () |
| Retrieve the capture of C++ 'this', if it has been captured. | |
| bool | isCaptured (ValueDecl *Var) const |
| Determine whether the given variable has been captured. | |
| bool | isVLATypeCaptured (const VariableArrayType *VAT) const |
| Determine whether the given variable-array type has been captured. | |
| Capture & | getCapture (ValueDecl *Var) |
| Retrieve the capture of the given variable, if it has been captured already. | |
| const Capture & | getCapture (ValueDecl *Var) const |
| Public Member Functions inherited from clang::sema::FunctionScopeInfo | |
| FunctionScopeInfo (DiagnosticsEngine &Diag) | |
| virtual | ~FunctionScopeInfo () |
| bool | hasUnrecoverableErrorOccurred () const |
| Determine whether an unrecoverable error has occurred within this function. | |
| template<typename ExprT> | |
| void | recordUseOfWeak (const ExprT *E, bool IsRead=true) |
| Record that a weak object was accessed. | |
| void | recordUseOfWeak (const ObjCMessageExpr *Msg, const ObjCPropertyDecl *Prop) |
| void | markSafeWeakUse (const Expr *E) |
| Record that a given expression is a "safe" access of a weak object (e.g. | |
| const WeakObjectUseMap & | getWeakObjectUses () const |
| void | setHasBranchIntoScope () |
| void | setHasBranchProtectedScope () |
| void | setHasIndirectGoto () |
| void | setHasMustTail () |
| void | setHasDroppedStmt () |
| void | setHasOMPDeclareReductionCombiner () |
| void | setHasFallthroughStmt () |
| void | setUsesFPIntrin () |
| void | setHasCXXTry (SourceLocation TryLoc) |
| void | setHasObjCTry (SourceLocation TryLoc) |
| void | setHasSEHTry (SourceLocation TryLoc) |
| void | setHasVLA (SourceLocation VLALoc) |
| bool | NeedsScopeChecking () const |
| void | addBlock (const BlockDecl *BD) |
| void | addByrefBlockVar (VarDecl *VD) |
| bool | isCoroutine () const |
| void | setFirstCoroutineStmt (SourceLocation Loc, StringRef Keyword) |
| StringRef | getFirstCoroutineStmtKeyword () const |
| void | setNeedsCoroutineSuspends (bool value=true) |
| bool | hasInvalidCoroutineSuspends () const |
| void | setCoroutineSuspends (Stmt *Initial, Stmt *Final) |
| void | Clear () |
| Clear out the information in this function scope, making it suitable for reuse. | |
| bool | isPlainFunction () const |
Static Public Member Functions | |
| static bool | classof (const FunctionScopeInfo *FSI) |
Public Attributes | |
| ImplicitCaptureStyle | ImpCaptureStyle |
| llvm::DenseMap< ValueDecl *, unsigned > | CaptureMap |
| CaptureMap - A map of captured variables to (index+1) into Captures. | |
| unsigned | CXXThisCaptureIndex = 0 |
| CXXThisCaptureIndex - The (index+1) of the capture of 'this'; zero if 'this' is not captured. | |
| SmallVector< Capture, 4 > | Captures |
| Captures - The captures. | |
| bool | HasImplicitReturnType = false |
| bool | ContainsUnexpandedParameterPack = false |
| Whether this contains an unexpanded parameter pack. | |
| QualType | ReturnType |
| ReturnType - The target type of return statements in this context, or null if unknown. | |
| SmallVector< NamedDecl *, 4 > | LocalPacks |
| Packs introduced by this, if any. | |
| Public Attributes inherited from clang::sema::FunctionScopeInfo | |
| ScopeKind | Kind: 3 |
| What kind of scope we are describing. | |
| bool | HasBranchProtectedScope: 1 |
| Whether this function contains a VLA, @try, try, C++ initializer, or anything else that can't be jumped past. | |
| bool | HasBranchIntoScope: 1 |
| Whether this function contains any switches or direct gotos. | |
| bool | HasIndirectGoto: 1 |
| Whether this function contains any indirect gotos. | |
| bool | HasMustTail: 1 |
Whether this function contains any statement marked with [[clang::musttail]]. | |
| bool | HasDroppedStmt: 1 |
| Whether a statement was dropped because it was invalid. | |
| bool | HasOMPDeclareReductionCombiner: 1 |
| True if current scope is for OpenMP declare reduction combiner. | |
| bool | HasFallthroughStmt: 1 |
| Whether there is a fallthrough statement in this function. | |
| bool | UsesFPIntrin: 1 |
| Whether this function uses constrained floating point intrinsics. | |
| bool | HasPotentialAvailabilityViolations: 1 |
| Whether we make reference to a declaration that could be unavailable. | |
| bool | ObjCShouldCallSuper: 1 |
A flag that is set when parsing a method that must call super's implementation, such as -dealloc, -finalize, or any method marked with __attribute__((objc_requires_super)). | |
| bool | ObjCIsDesignatedInit: 1 |
| True when this is a method marked as a designated initializer. | |
| bool | ObjCWarnForNoDesignatedInitChain: 1 |
| This starts true for a method marked as designated initializer and will be set to false if there is an invocation to a designated initializer of the super class. | |
| bool | ObjCIsSecondaryInit: 1 |
| True when this is an initializer method not marked as a designated initializer within a class that has at least one initializer marked as a designated initializer. | |
| bool | ObjCWarnForNoInitDelegation: 1 |
| This starts true for a secondary initializer method and will be set to false if there is an invocation of an initializer on 'self'. | |
| bool | NeedsCoroutineSuspends: 1 |
| True only when this function has not already built, or attempted to build, the initial and final coroutine suspend points. | |
| unsigned char | FirstCoroutineStmtKind: 2 |
| An enumeration representing the kind of the first coroutine statement in the function. | |
| bool | FoundImmediateEscalatingExpression: 1 |
| Whether we found an immediate-escalating expression. | |
| SourceLocation | FirstCoroutineStmtLoc |
| First coroutine statement in the current function. | |
| SourceLocation | FirstReturnLoc |
| First 'return' statement in the current function. | |
| SourceLocation | FirstCXXOrObjCTryLoc |
| First C++ 'try' or ObjC @try statement in the current function. | |
| enum clang::sema::FunctionScopeInfo:: { ... } | FirstTryType = Unknown |
| SourceLocation | FirstSEHTryLoc |
| First SEH '__try' statement in the current function. | |
| SourceLocation | FirstVLALoc |
| First use of a VLA within the current function. | |
| SmallVector< SwitchInfo, 8 > | SwitchStack |
| SwitchStack - This is the current set of active switch statements in the block. | |
| SmallVector< ReturnStmt *, 4 > | Returns |
| The list of return statements that occur within the function or block, if there is any chance of applying the named return value optimization, or if we need to infer a return type. | |
| VarDecl * | CoroutinePromise = nullptr |
| The promise object for this coroutine, if any. | |
| llvm::SmallMapVector< ParmVarDecl *, Stmt *, 4 > | CoroutineParameterMoves |
| A mapping between the coroutine function parameters that were moved to the coroutine frame, and their move statements. | |
| std::pair< Stmt *, Stmt * > | CoroutineSuspends |
| The initial and final coroutine suspend points. | |
| SmallVector< CompoundScopeInfo, 4 > | CompoundScopes |
| The stack of currently active compound statement scopes in the function. | |
| llvm::SmallPtrSet< const BlockDecl *, 1 > | Blocks |
| The set of blocks that are introduced in this function. | |
| llvm::TinyPtrVector< VarDecl * > | ByrefBlockVars |
| The set of __block variables that are introduced in this function. | |
| SmallVector< PossiblyUnreachableDiag, 4 > | PossiblyUnreachableDiags |
| A list of PartialDiagnostics created but delayed within the current function scope. | |
| llvm::SmallPtrSet< const ParmVarDecl *, 8 > | ModifiedNonNullParams |
| A list of parameters which have the nonnull attribute and are modified in the function. | |
| llvm::SmallVector< AddrLabelExpr *, 4 > | AddrLabels |
| The set of GNU address of label extension "&&label". | |
Protected Member Functions | |
| CapturingScopeInfo (const CapturingScopeInfo &)=default | |
| Protected Member Functions inherited from clang::sema::FunctionScopeInfo | |
| FunctionScopeInfo (const FunctionScopeInfo &)=default | |
Additional Inherited Members | |
| Protected Types inherited from clang::sema::FunctionScopeInfo | |
| enum | ScopeKind : uint8_t { SK_Function , SK_Block , SK_Lambda , SK_CapturedRegion } |
Definition at line 698 of file ScopeInfo.h.
| Enumerator | |
|---|---|
| ImpCap_None | |
| ImpCap_LambdaByval | |
| ImpCap_LambdaByref | |
| ImpCap_Block | |
| ImpCap_CapturedRegion | |
Definition at line 703 of file ScopeInfo.h.
|
protecteddefault |
|
inline |
Definition at line 710 of file ScopeInfo.h.
References Diag(), clang::sema::FunctionScopeInfo::FunctionScopeInfo(), and ImpCaptureStyle.
|
inline |
Definition at line 737 of file ScopeInfo.h.
References clang::Capture, CaptureMap, Captures, and clang::Invalid.
Referenced by clang::Sema::addInitCapture(), captureInBlock(), captureInCapturedRegion(), captureInLambda(), and clang::Sema::RebuildLambdaScopeInfo().
|
inline |
Definition at line 1096 of file ScopeInfo.h.
References clang::Capture, Captures, CXXThisCaptureIndex, and clang::sema::Capture::ThisCapture.
Referenced by clang::Sema::CheckCXXThisCapture(), and clang::Sema::RebuildLambdaScopeInfo().
|
inline |
Definition at line 745 of file ScopeInfo.h.
References clang::Capture, Captures, and clang::sema::Capture::VLACapture.
Referenced by captureVariablyModifiedType(), and clang::Sema::RebuildLambdaScopeInfo().
|
inlinestatic |
Retrieve the capture of the given variable, if it has been captured already.
Definition at line 771 of file ScopeInfo.h.
References CaptureMap, Captures, and isCaptured().
Referenced by isVariableAlreadyCapturedInScopeInfo(), and clang::Sema::tryCaptureVariable().
Definition at line 776 of file ScopeInfo.h.
References CaptureMap, and Captures.
|
inline |
Retrieve the capture of C++ 'this', if it has been captured.
Definition at line 758 of file ScopeInfo.h.
References Captures, CXXThisCaptureIndex, and isCXXThisCaptured().
Referenced by clang::Sema::ActOnLambdaExpressionAfterIntroducer(), adjustCVQualifiersForCXXThisWithinLambda(), and buildLambdaCaptureFixit().
Determine whether the given variable has been captured.
Definition at line 764 of file ScopeInfo.h.
References CaptureMap.
Referenced by getCapture(), and getStackIndexOfNearestEnclosingCaptureReadyLambda().
|
inline |
Determine whether the C++ 'this' is captured.
Definition at line 755 of file ScopeInfo.h.
References CXXThisCaptureIndex.
Referenced by clang::Sema::ActOnLambdaExpressionAfterIntroducer(), adjustCVQualifiersForCXXThisWithinLambda(), buildLambdaCaptureFixit(), buildLambdaThisCaptureFixit(), clang::Sema::DiagnoseShadowingLambdaDecls(), getCXXThisCapture(), getStackIndexOfNearestEnclosingCaptureReadyLambda(), and tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs().
| bool CapturingScopeInfo::isVLATypeCaptured | ( | const VariableArrayType * | VAT | ) | const |
Determine whether the given variable-array type has been captured.
Definition at line 228 of file ScopeInfo.cpp.
References Captures.
Referenced by captureVariablyModifiedType().
CaptureMap - A map of captured variables to (index+1) into Captures.
Definition at line 714 of file ScopeInfo.h.
Referenced by addCapture(), getCapture(), getCapture(), isCaptured(), and isVariableAlreadyCapturedInScopeInfo().
| SmallVector<Capture, 4> clang::sema::CapturingScopeInfo::Captures |
Captures - The captures.
Definition at line 721 of file ScopeInfo.h.
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnLambdaExpressionAfterIntroducer(), clang::Sema::ActOnStartOfLambdaDefinition(), addCapture(), addThisCapture(), addVLATypeCapture(), buildCapturedStmtCaptureList(), buildLambdaCaptureFixit(), clang::Sema::BuildLambdaExpr(), clang::sema::LambdaScopeInfo::finishedExplicitCaptures(), getCapture(), getCapture(), getCaptureLocation(), getCXXThisCapture(), and isVLATypeCaptured().
Whether this contains an unexpanded parameter pack.
Definition at line 728 of file ScopeInfo.h.
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnLambdaClosureParameters(), clang::Sema::ActOnLambdaExpressionAfterIntroducer(), clang::Sema::BuildLambdaExpr(), and clang::TreeTransform< AdjustConstraintDepth >::RebuildLambdaExpr().
| unsigned clang::sema::CapturingScopeInfo::CXXThisCaptureIndex = 0 |
CXXThisCaptureIndex - The (index+1) of the capture of 'this'; zero if 'this' is not captured.
Definition at line 718 of file ScopeInfo.h.
Referenced by clang::Sema::ActOnBlockStmtExpr(), addThisCapture(), getCXXThisCapture(), and isCXXThisCaptured().
Definition at line 725 of file ScopeInfo.h.
Referenced by clang::Sema::ActOnBlockArguments(), clang::Sema::ActOnBlockStart(), clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnCapScopeReturnStmt(), clang::Sema::BuildLambdaExpr(), buildLambdaScopeReturnType(), clang::Sema::deduceClosureReturnType(), and clang::Sema::DeduceFunctionTypeFromReturnExpr().
| ImplicitCaptureStyle clang::sema::CapturingScopeInfo::ImpCaptureStyle |
Definition at line 708 of file ScopeInfo.h.
Referenced by clang::Sema::ActOnLambdaExpressionAfterIntroducer(), buildLambdaCaptureFixit(), clang::Sema::BuildLambdaExpr(), clang::Sema::buildLambdaScope(), buildLambdaThisCaptureFixit(), captureInLambda(), CapturingScopeInfo(), getStackIndexOfNearestEnclosingCaptureReadyLambda(), clang::Sema::RebuildLambdaScopeInfo(), clang::Sema::tryCaptureVariable(), and tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs().
| SmallVector<NamedDecl *, 4> clang::sema::CapturingScopeInfo::LocalPacks |
Packs introduced by this, if any.
Definition at line 735 of file ScopeInfo.h.
Referenced by clang::Sema::createLambdaInitCaptureVarDecl().
| QualType clang::sema::CapturingScopeInfo::ReturnType |
ReturnType - The target type of return statements in this context, or null if unknown.
Definition at line 732 of file ScopeInfo.h.
Referenced by clang::Sema::ActOnBlockArguments(), clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnCapScopeReturnStmt(), AddOrdinaryNameResults(), buildLambdaScopeReturnType(), clang::Sema::deduceClosureReturnType(), and clang::Sema::RebuildLambdaScopeInfo().