clang 8.0.0

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
clang::sema::BlockScopeInfo Class Referencefinal

Retains information about a block that is currently being parsed. More...

`#include "clang/Sema/ScopeInfo.h"`

Inheritance diagram for clang::sema::BlockScopeInfo:
[legend]
Collaboration diagram for clang::sema::BlockScopeInfo:
[legend]

## Public Member Functions
| BlockScopeInfo (DiagnosticsEngine &Diag, Scope *BlockScope, BlockDecl *Block)
| ~BlockScopeInfo () override
Public Member Functions inherited from clang::sema::CapturingScopeInfo
| 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, Expr *Cpy, bool ByCopy)
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
Public Member Functions inherited from clang::sema::FunctionScopeInfo
| FunctionScopeInfo (DiagnosticsEngine &Diag)
virtual | ~FunctionScopeInfo ()
template<typename ExprT >
void | recordUseOfWeak (const ExprT *E, bool IsRead=true)
| Record that a weak object was accessed. More...
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. More...
const WeakObjectUseMap & | getWeakObjectUses () const
void | setHasBranchIntoScope ()
void | setHasBranchProtectedScope ()
void | setHasIndirectGoto ()
void | setHasDroppedStmt ()
void | setHasOMPDeclareReductionCombiner ()
void | setHasFallthroughStmt ()
void | setHasCXXTry (SourceLocation TryLoc)
void | setHasSEHTry (SourceLocation TryLoc)
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. More...

## Static Public Member Functions
static bool | classof (const FunctionScopeInfo *FSI)
Static Public Member Functions inherited from clang::sema::CapturingScopeInfo
static bool | classof (const FunctionScopeInfo *FSI)

## Public Attributes
BlockDecl * | TheDecl
Scope * | TheScope
| TheScope - This is the scope for the block itself, which contains arguments etc. More...
QualType | FunctionType
| BlockType - The function type of the block, if one was given. More...
Public Attributes inherited from clang::sema::CapturingScopeInfo
ImplicitCaptureStyle | ImpCaptureStyle
llvm::DenseMap< VarDecl *, unsigned > | CaptureMap
| CaptureMap - A map of captured variables to (index+1) into Captures. More...
unsigned | CXXThisCaptureIndex = 0
| CXXThisCaptureIndex - The (index+1) of the capture of 'this'; zero if 'this' is not captured. More...
SmallVector< Capture, 4 > | Captures
| Captures - The captures. More...
bool | HasImplicitReturnType = false
QualType | ReturnType
| ReturnType - The target type of return statements in this context, or null if unknown. More...
Public Attributes inherited from clang::sema::FunctionScopeInfo
ScopeKind | Kind: 3
| What kind of scope we are describing. More...
bool | HasBranchProtectedScope: 1
| Whether this function contains a VLA, @try, try, C++ initializer, or anything else that can't be jumped past. More...
bool | HasBranchIntoScope: 1
| Whether this function contains any switches or direct gotos. More...
bool | HasIndirectGoto: 1
| Whether this function contains any indirect gotos. More...
bool | HasDroppedStmt: 1
| Whether a statement was dropped because it was invalid. More...
bool | HasOMPDeclareReductionCombiner: 1
| True if current scope is for OpenMP declare reduction combiner. More...
bool | HasFallthroughStmt: 1
| Whether there is a fallthrough statement in this function. More...
bool | HasPotentialAvailabilityViolations: 1
| Whether we make reference to a declaration that could be unavailable. More...
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)). More...
bool | ObjCIsDesignatedInit: 1
| True when this is a method marked as a designated initializer. More...
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. More...
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. More...
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'. More...
bool | NeedsCoroutineSuspends: 1
| True only when this function has not already built, or attempted to build, the initial and final coroutine suspend points. More...
unsigned char | FirstCoroutineStmtKind: 2
| An enumeration represeting the kind of the first coroutine statement in the function. More...
SourceLocation | FirstCoroutineStmtLoc
| First coroutine statement in the current function. More...
SourceLocation | FirstReturnLoc
| First 'return' statement in the current function. More...
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< SwitchInfo, 8 > | SwitchStack
| SwitchStack - This is the current set of active switch statements in the block. More...
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...
VarDecl * | CoroutinePromise = nullptr
| The promise object for this coroutine, if any. More...
llvm::SmallMapVector< ParmVarDecl *, Stmt *, 4 > | CoroutineParameterMoves
| A mapping between the coroutine function parameters that were moved to the coroutine frame, and their move statements. More...
std::pair< Stmt *, Stmt * > | CoroutineSuspends
| The initial and final coroutine suspend points. More...
SmallVector< CompoundScopeInfo, 4 > | CompoundScopes
| The stack of currently active compound stamement scopes in the function. More...
llvm::SmallPtrSet< const BlockDecl *, 1 > | Blocks
| The set of blocks that are introduced in this function. More...
llvm::TinyPtrVector< VarDecl * > | ByrefBlockVars
| The set of __block variables that are introduced in this function. More...
SmallVector< PossiblyUnreachableDiag, 4 > | PossiblyUnreachableDiags
| A list of PartialDiagnostics created but delayed within the current function scope. 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
Public Types inherited from clang::sema::CapturingScopeInfo
enum | ImplicitCaptureStyle { ImpCap_None, ImpCap_LambdaByval, ImpCap_LambdaByref, ImpCap_Block, ImpCap_CapturedRegion }
Public Types inherited from clang::sema::FunctionScopeInfo
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). More...
using | WeakUseVector = SmallVector< WeakUseTy, 4 >
| Used to collect uses of a particular weak object in a function body. More...
using | WeakObjectUseMap = llvm::SmallDenseMap< WeakObjectProfileTy, WeakUseVector, 8, WeakObjectProfileTy::DenseMapInfo >
| Used to collect all uses of weak objects in a function body. More...
Protected Types inherited from clang::sema::FunctionScopeInfo
enum | ScopeKind { SK_Function, SK_Block, SK_Lambda, SK_CapturedRegion }
Protected Member Functions inherited from clang::sema::CapturingScopeInfo
| CapturingScopeInfo (const CapturingScopeInfo &)=default
Protected Member Functions inherited from clang::sema::FunctionScopeInfo
| FunctionScopeInfo (const FunctionScopeInfo &)=default

## Detailed Description

Retains information about a block that is currently being parsed.

Definition at line 711 of file ScopeInfo.h.

## Constructor & Destructor Documentation

## ◆ BlockScopeInfo()

clang::sema::BlockScopeInfo::BlockScopeInfo | ( | DiagnosticsEngine & | Diag,
|  | Scope * | BlockScope,
|  | BlockDecl * | Block
| ) |  |
| inline

Definition at line 723 of file ScopeInfo.h.

## ◆ ~BlockScopeInfo()

BlockScopeInfo::~BlockScopeInfo | ( |  | ) |
| override

Definition at line 252 of file ScopeInfo.cpp.

## Member Function Documentation

## ◆ classof()

static bool clang::sema::BlockScopeInfo::classof | ( | const FunctionScopeInfo * | FSI | ) |
| inline static

Definition at line 731 of file ScopeInfo.h.

References clang::sema::FunctionScopeInfo::Kind.

## Member Data Documentation

## ◆ FunctionType

QualType clang::sema::BlockScopeInfo::FunctionType

BlockType - The function type of the block, if one was given.

Its return type may be BuiltinType::Dependent.

Definition at line 721 of file ScopeInfo.h.

## ◆ TheDecl

BlockDecl* clang::sema::BlockScopeInfo::TheDecl

Definition at line 713 of file ScopeInfo.h.

Referenced by clang::Sema::ActOnBlockStmtExpr().

## ◆ TheScope

Scope* clang::sema::BlockScopeInfo::TheScope

TheScope - This is the scope for the block itself, which contains arguments etc.

Definition at line 717 of file ScopeInfo.h.

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

- include/clang/Sema/ScopeInfo.h
- lib/Sema/ScopeInfo.cpp