clang
3.7.0
|
#include <ScopeInfo.h>
Classes | |
class | Capture |
Public Types | |
enum | ImplicitCaptureStyle { ImpCap_None, ImpCap_LambdaByval, ImpCap_LambdaByref, ImpCap_Block, ImpCap_CapturedRegion } |
![]() | |
typedef SmallVector< WeakUseTy, 4 > | WeakUseVector |
typedef llvm::SmallDenseMap < WeakObjectProfileTy, WeakUseVector, 8, WeakObjectProfileTy::DenseMapInfo > | WeakObjectUseMap |
Public Member Functions | |
CapturingScopeInfo (DiagnosticsEngine &Diag, ImplicitCaptureStyle Style) | |
void | addCapture (VarDecl *Var, bool isBlock, bool isByref, bool isNested, SourceLocation Loc, SourceLocation EllipsisLoc, QualType CaptureType, Expr *Cpy) |
void | addVLATypeCapture (SourceLocation Loc, QualType CaptureType) |
void | addThisCapture (bool isNested, SourceLocation Loc, QualType CaptureType, Expr *Cpy) |
bool | isCXXThisCaptured () const |
Determine whether the C++ 'this' is captured. More... | |
Capture & | getCXXThisCapture () |
Retrieve the capture of C++ 'this', if it has been captured. More... | |
bool | isCaptured (VarDecl *Var) const |
Determine whether the given variable has been captured. More... | |
bool | isVLATypeCaptured (const VariableArrayType *VAT) const |
Determine whether the given variable-array type has been captured. More... | |
Capture & | getCapture (VarDecl *Var) |
Retrieve the capture of the given variable, if it has been captured already. More... | |
const Capture & | getCapture (VarDecl *Var) const |
![]() | |
template<typename ExprT > | |
void | recordUseOfWeak (const ExprT *E, bool IsRead=true) |
void | recordUseOfWeak (const ObjCMessageExpr *Msg, const ObjCPropertyDecl *Prop) |
void | markSafeWeakUse (const Expr *E) |
const WeakObjectUseMap & | getWeakObjectUses () const |
void | setHasBranchIntoScope () |
void | setHasBranchProtectedScope () |
void | setHasIndirectGoto () |
void | setHasDroppedStmt () |
void | setHasCXXTry (SourceLocation TryLoc) |
void | setHasSEHTry (SourceLocation TryLoc) |
bool | NeedsScopeChecking () const |
FunctionScopeInfo (DiagnosticsEngine &Diag) | |
virtual | ~FunctionScopeInfo () |
void | Clear () |
Clear out the information in this function scope, making it suitable for reuse. More... | |
Static Public Member Functions | |
static bool | classof (const FunctionScopeInfo *FSI) |
Public Attributes | |
ImplicitCaptureStyle | ImpCaptureStyle |
llvm::DenseMap< VarDecl *, unsigned > | CaptureMap |
CaptureMap - A map of captured variables to (index+1) into Captures. More... | |
unsigned | CXXThisCaptureIndex |
SmallVector< Capture, 4 > | Captures |
Captures - The captures. More... | |
bool | HasImplicitReturnType |
| |
QualType | ReturnType |
![]() | |
ScopeKind | Kind |
What kind of scope we are describing. More... | |
bool | HasBranchProtectedScope |
Whether this function contains a VLA, @try, try, C++ initializer, or anything else that can't be jumped past. More... | |
bool | HasBranchIntoScope |
Whether this function contains any switches or direct gotos. More... | |
bool | HasIndirectGoto |
Whether this function contains any indirect gotos. More... | |
bool | HasDroppedStmt |
Whether a statement was dropped because it was invalid. More... | |
bool | ObjCShouldCallSuper |
bool | ObjCIsDesignatedInit |
True when this is a method marked as a designated initializer. More... | |
bool | ObjCWarnForNoDesignatedInitChain |
bool | ObjCIsSecondaryInit |
bool | ObjCWarnForNoInitDelegation |
SourceLocation | FirstCXXTryLoc |
First C++ 'try' statement in the current function. More... | |
SourceLocation | FirstSEHTryLoc |
First SEH '__try' statement in the current function. More... | |
DiagnosticErrorTrap | ErrorTrap |
Used to determine if errors occurred in this function or block. More... | |
SmallVector< SwitchStmt *, 8 > | SwitchStack |
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. More... | |
SmallVector< CompoundScopeInfo, 4 > | CompoundScopes |
The stack of currently active compound stamement scopes in the function. More... | |
SmallVector < PossiblyUnreachableDiag, 4 > | PossiblyUnreachableDiags |
A list of PartialDiagnostics created but delayed within the current function scope. These diagnostics are vetted for reachability prior to being emitted. More... | |
llvm::SmallPtrSet< const ParmVarDecl *, 8 > | ModifiedNonNullParams |
A list of parameters which have the nonnull attribute and are modified in the function. More... | |
Additional Inherited Members | |
![]() | |
enum | ScopeKind { SK_Function, SK_Block, SK_Lambda, SK_CapturedRegion } |
Definition at line 366 of file ScopeInfo.h.
Enumerator | |
---|---|
ImpCap_None | |
ImpCap_LambdaByval | |
ImpCap_LambdaByref | |
ImpCap_Block | |
ImpCap_CapturedRegion |
Definition at line 368 of file ScopeInfo.h.
|
inline |
Definition at line 473 of file ScopeInfo.h.
|
inline |
Definition at line 496 of file ScopeInfo.h.
References CaptureMap, and Captures.
Referenced by clang::Sema::buildInitCaptureField(), captureInBlock(), captureInCapturedRegion(), captureInLambda(), and RebuildLambdaScopeInfo().
|
inline |
Definition at line 833 of file ScopeInfo.h.
Referenced by clang::Sema::CheckCXXThisCapture(), and RebuildLambdaScopeInfo().
|
inline |
Definition at line 504 of file ScopeInfo.h.
References Captures.
Referenced by RebuildLambdaScopeInfo(), and clang::Sema::tryCaptureVariable().
|
inlinestatic |
Definition at line 545 of file ScopeInfo.h.
References clang::sema::FunctionScopeInfo::Kind, clang::sema::FunctionScopeInfo::SK_Block, clang::sema::FunctionScopeInfo::SK_CapturedRegion, and clang::sema::FunctionScopeInfo::SK_Lambda.
Retrieve the capture of the given variable, if it has been captured already.
Definition at line 533 of file ScopeInfo.h.
References CaptureMap, Captures, and isCaptured().
Referenced by clang::Sema::ActOnStartOfLambdaDefinition(), and isVariableAlreadyCapturedInScopeInfo().
Definition at line 538 of file ScopeInfo.h.
References CaptureMap, and Captures.
|
inline |
Retrieve the capture of C++ 'this', if it has been captured.
Definition at line 518 of file ScopeInfo.h.
References Captures, CXXThisCaptureIndex, and isCXXThisCaptured().
Referenced by clang::Sema::ActOnStartOfLambdaDefinition().
Determine whether the given variable has been captured.
Definition at line 524 of file ScopeInfo.h.
References CaptureMap.
Referenced by clang::Sema::ActOnStartOfLambdaDefinition(), getCapture(), and getStackIndexOfNearestEnclosingCaptureReadyLambda().
|
inline |
Determine whether the C++ 'this' is captured.
Definition at line 515 of file ScopeInfo.h.
References CXXThisCaptureIndex.
Referenced by clang::Sema::ActOnStartOfLambdaDefinition(), getCXXThisCapture(), and getStackIndexOfNearestEnclosingCaptureReadyLambda().
bool CapturingScopeInfo::isVLATypeCaptured | ( | const VariableArrayType * | VAT | ) | const |
Determine whether the given variable-array type has been captured.
Definition at line 100 of file ScopeInfo.cpp.
References clang::RecordDecl::fields().
Referenced by clang::Sema::tryCaptureVariable().
CaptureMap - A map of captured variables to (index+1) into Captures.
Definition at line 479 of file ScopeInfo.h.
Referenced by addCapture(), getCapture(), isCaptured(), and isVariableAlreadyCapturedInScopeInfo().
SmallVector<Capture, 4> clang::sema::CapturingScopeInfo::Captures |
Captures - The captures.
Definition at line 486 of file ScopeInfo.h.
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnCapturedRegionEnd(), addCapture(), addVLATypeCapture(), clang::Sema::BuildLambdaExpr(), clang::sema::LambdaScopeInfo::finishedExplicitCaptures(), getCapture(), and getCXXThisCapture().
unsigned clang::sema::CapturingScopeInfo::CXXThisCaptureIndex |
CXXThisCaptureIndex - The (index+1) of the capture of 'this'; zero if 'this' is not captured.
Definition at line 483 of file ScopeInfo.h.
Referenced by clang::Sema::ActOnBlockStmtExpr(), getCXXThisCapture(), and isCXXThisCaptured().
bool clang::sema::CapturingScopeInfo::HasImplicitReturnType |
Definition at line 490 of file ScopeInfo.h.
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnCapScopeReturnStmt(), clang::Sema::BuildLambdaExpr(), clang::Sema::buildLambdaScope(), clang::Sema::deduceClosureReturnType(), and clang::Sema::DeduceFunctionTypeFromReturnExpr().
ImplicitCaptureStyle clang::sema::CapturingScopeInfo::ImpCaptureStyle |
Definition at line 373 of file ScopeInfo.h.
Referenced by clang::Sema::BuildLambdaExpr(), clang::Sema::buildLambdaScope(), clang::Sema::BuildMemberReferenceExpr(), captureInLambda(), getStackIndexOfNearestEnclosingCaptureReadyLambda(), RebuildLambdaScopeInfo(), and clang::Sema::tryCaptureVariable().
QualType clang::sema::CapturingScopeInfo::ReturnType |
ReturnType - The target type of return statements in this context, or null if unknown.
Definition at line 494 of file ScopeInfo.h.
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnCapScopeReturnStmt(), AddOrdinaryNameResults(), clang::Sema::buildLambdaScope(), clang::Sema::deduceClosureReturnType(), clang::Sema::PushCapturedRegionScope(), and RebuildLambdaScopeInfo().