clang API Documentation
Retains information about a function, method, or block that is currently being parsed. More...
#include <ScopeInfo.h>


Public Member Functions | |
| void | setHasBranchIntoScope () |
| void | setHasBranchProtectedScope () |
| void | setHasIndirectGoto () |
| bool | NeedsScopeChecking () const |
| FunctionScopeInfo (DiagnosticsEngine &Diag) | |
| virtual | ~FunctionScopeInfo () |
| void | Clear () |
| Clear out the information in this function scope, making it suitable for reuse. | |
Static Public Member Functions | |
| static bool | classof (const FunctionScopeInfo *FSI) |
Public Attributes | |
| ScopeKind | Kind |
| What kind of scope we are describing. | |
| bool | HasBranchProtectedScope |
| Whether this function contains a VLA, , try, C++ initializer, or anything else that can't be jumped past. | |
| bool | HasBranchIntoScope |
| Whether this function contains any switches or direct gotos. | |
| bool | HasIndirectGoto |
| Whether this function contains any indirect gotos. | |
| DiagnosticErrorTrap | ErrorTrap |
| Used to determine if errors occurred in this function or block. | |
| 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. | |
| SmallVector< CompoundScopeInfo, 4 > | CompoundScopes |
| The stack of currently active compound stamement scopes in the function. | |
| 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. | |
Protected Types | |
| enum | ScopeKind { SK_Function, SK_Block, SK_Lambda } |
Retains information about a function, method, or block that is currently being parsed.
Definition at line 64 of file ScopeInfo.h.
enum clang::sema::FunctionScopeInfo::ScopeKind [protected] |
Definition at line 66 of file ScopeInfo.h.
| clang::sema::FunctionScopeInfo::FunctionScopeInfo | ( | DiagnosticsEngine & | Diag | ) | [inline] |
Definition at line 125 of file ScopeInfo.h.
| static bool clang::sema::FunctionScopeInfo::classof | ( | const FunctionScopeInfo * | FSI | ) | [inline, static] |
Reimplemented in clang::sema::LambdaScopeInfo, clang::sema::BlockScopeInfo, and clang::sema::CapturingScopeInfo.
Definition at line 138 of file ScopeInfo.h.
| void FunctionScopeInfo::Clear | ( | ) |
Clear out the information in this function scope, making it suitable for reuse.
Definition at line 47 of file Sema.cpp.
References ErrorTrap, HasBranchIntoScope, HasBranchProtectedScope, HasIndirectGoto, PossiblyUnreachableDiags, clang::DiagnosticErrorTrap::reset(), Returns, and SwitchStack.
| bool clang::sema::FunctionScopeInfo::NeedsScopeChecking | ( | ) | const [inline] |
Definition at line 120 of file ScopeInfo.h.
References HasBranchIntoScope, HasBranchProtectedScope, and HasIndirectGoto.
| void clang::sema::FunctionScopeInfo::setHasBranchIntoScope | ( | ) | [inline] |
Definition at line 108 of file ScopeInfo.h.
References HasBranchIntoScope.
| void clang::sema::FunctionScopeInfo::setHasBranchProtectedScope | ( | ) | [inline] |
Definition at line 112 of file ScopeInfo.h.
References HasBranchProtectedScope.
| void clang::sema::FunctionScopeInfo::setHasIndirectGoto | ( | ) | [inline] |
Definition at line 116 of file ScopeInfo.h.
References HasIndirectGoto.
| SmallVector<CompoundScopeInfo, 4> clang::sema::FunctionScopeInfo::CompoundScopes |
The stack of currently active compound stamement scopes in the function.
Definition at line 101 of file ScopeInfo.h.
Referenced by clang::Sema::PopCompoundScope(), and clang::Sema::PushCompoundScope().
Used to determine if errors occurred in this function or block.
Definition at line 88 of file ScopeInfo.h.
Referenced by Clear(), and clang::Sema::hasAnyUnrecoverableErrorsInThisFunction().
Whether this function contains any switches or direct gotos.
Definition at line 82 of file ScopeInfo.h.
Referenced by Clear(), NeedsScopeChecking(), and setHasBranchIntoScope().
Whether this function contains a VLA, , try, C++ initializer, or anything else that can't be jumped past.
Definition at line 79 of file ScopeInfo.h.
Referenced by Clear(), NeedsScopeChecking(), and setHasBranchProtectedScope().
Whether this function contains any indirect gotos.
Definition at line 85 of file ScopeInfo.h.
Referenced by Clear(), NeedsScopeChecking(), and setHasIndirectGoto().
What kind of scope we are describing.
Definition at line 75 of file ScopeInfo.h.
Referenced by clang::sema::CapturingScopeInfo::classof(), clang::sema::BlockScopeInfo::classof(), and clang::sema::LambdaScopeInfo::classof().
A list of PartialDiagnostics created but delayed within the current function scope. These diagnostics are vetted for reachability prior to being emitted.
Definition at line 106 of file ScopeInfo.h.
Referenced by Clear(), flushDiagnostics(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), and clang::Sema::PopFunctionScopeInfo().
| SmallVector<ReturnStmt*, 4> clang::sema::FunctionScopeInfo::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.
Definition at line 97 of file ScopeInfo.h.
Referenced by Clear(), and clang::Sema::computeNRVO().
| SmallVector<SwitchStmt*, 8> clang::sema::FunctionScopeInfo::SwitchStack |
SwitchStack - This is the current set of active switch statements in the block.
Definition at line 92 of file ScopeInfo.h.
Referenced by AddKeywordsToConsumer(), AddOrdinaryNameResults(), Clear(), and handleFallThroughAttr().