class FunctionScopeInfo

Declaration

class FunctionScopeInfo { /* full declaration omitted */ };

Description

Retains information about a function, method, or block that is currently being parsed.

Declared at: clang/include/clang/Sema/ScopeInfo.h:102

Member Variables

public clang::sema::FunctionScopeInfo::ScopeKind Kind
What kind of scope we are describing.
public bool HasBranchProtectedScope
Whether this function contains a VLA, @ try, try, C++ initializer, or anything else that can't be jumped past.
public bool HasBranchIntoScope
Whether this function contains any switches or direct gotos.
public bool HasIndirectGoto
Whether this function contains any indirect gotos.
public bool HasMustTail
Whether this function contains any statement marked with\c [[clang::musttail]].
public bool HasDroppedStmt
Whether a statement was dropped because it was invalid.
public bool HasOMPDeclareReductionCombiner
True if current scope is for OpenMP declare reduction combiner.
public bool HasFallthroughStmt
Whether there is a fallthrough statement in this function.
public bool UsesFPIntrin
Whether this function uses constrained floating point intrinsics
public bool HasPotentialAvailabilityViolations
Whether we make reference to a declaration that could be unavailable.
public bool ObjCShouldCallSuper
A flag that is set when parsing a method that must call super's implementation, such as \c -dealloc, \c -finalize, or any method marked with \c __attribute__((objc_requires_super)).
public bool ObjCIsDesignatedInit
True when this is a method marked as a designated initializer.
public bool ObjCWarnForNoDesignatedInitChain
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.
public bool ObjCIsSecondaryInit
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.
public bool ObjCWarnForNoInitDelegation
This starts true for a secondary initializer method and will be set to false if there is an invocation of an initializer on 'self'.
public bool NeedsCoroutineSuspends
True only when this function has not already built, or attempted to build, the initial and final coroutine suspend points
public unsigned char FirstCoroutineStmtKind
An enumeration represeting the kind of the first coroutine statement in the function. One of co_return, co_await, or co_yield.
public clang::SourceLocation FirstCoroutineStmtLoc
First coroutine statement in the current function. (ex co_return, co_await, co_yield)
public clang::SourceLocation FirstReturnLoc
First 'return' statement in the current function.
public clang::SourceLocation FirstCXXOrObjCTryLoc
First C++ 'try' or ObjC @trystatement in the current function.
public enum(unnamed enum at / home / hdoc / tmp / llvm - project / clang / include / clang / Sema / ScopeInfo.h : 184 : 3) FirstTryType = Unknown
public clang::SourceLocation FirstSEHTryLoc
First SEH '__try' statement in the current function.
private clang::DiagnosticErrorTrap ErrorTrap
Used to determine if errors occurred in this function or block.
public SmallVector< clang::sema::FunctionScopeInfo::SwitchInfo, 8> SwitchStack
SwitchStack - This is the current set of active switch statements in the block.
public SmallVector<clang::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.
public clang::VarDecl* CoroutinePromise = nullptr
The promise object for this coroutine, if any.
public llvm::SmallMapVector<ParmVarDecl*, Stmt*, 4> CoroutineParameterMoves
A mapping between the coroutine function parameters that were moved to the coroutine frame, and their move statements.
public std::pair<Stmt*, Stmt*> CoroutineSuspends
The initial and final coroutine suspend points.
public SmallVector<clang::sema::CompoundScopeInfo, 4> CompoundScopes
The stack of currently active compound stamement scopes in the function.
public llvm::SmallPtrSet<const BlockDecl*, 1> Blocks
The set of blocks that are introduced in this function.
public llvm::TinyPtrVector<VarDecl*> ByrefBlockVars
The set of __block variables that are introduced in this function.
public SmallVector<clang::sema::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.
public llvm::SmallPtrSet<const ParmVarDecl*, 8> ModifiedNonNullParams
A list of parameters which have the nonnull attribute and are modified in the function.
private clang::sema::FunctionScopeInfo::WeakObjectUseMap WeakObjectUses
Part of the implementation of -Wrepeated-use-of-weak.

Method Overview

Methods

void Clear()

Description

Clear out the information in this function scope, making it suitable for reuse.

Declared at: clang/include/clang/Sema/ScopeInfo.h:528

FunctionScopeInfo(clang::DiagnosticsEngine& Diag)

Declared at: clang/include/clang/Sema/ScopeInfo.h:380

Parameters

clang::DiagnosticsEngine& Diag

FunctionScopeInfo(
    const clang::sema::FunctionScopeInfo&)

Declared at: clang/include/clang/Sema/ScopeInfo.h:377

Parameters

const clang::sema::FunctionScopeInfo&

bool NeedsScopeChecking() const

Declared at: clang/include/clang/Sema/ScopeInfo.h:469

void addBlock(const clang::BlockDecl* BD)

Declared at: clang/include/clang/Sema/ScopeInfo.h:475

Parameters

const clang::BlockDecl* BD

void addByrefBlockVar(clang::VarDecl* VD)

Declared at: clang/include/clang/Sema/ScopeInfo.h:480

Parameters

clang::VarDecl* VD

llvm::StringRef getFirstCoroutineStmtKeyword()
    const

Declared at: clang/include/clang/Sema/ScopeInfo.h:496

const clang::sema::FunctionScopeInfo::
    WeakObjectUseMap&
    getWeakObjectUses() const

Declared at: clang/include/clang/Sema/ScopeInfo.h:418

bool hasInvalidCoroutineSuspends() const

Declared at: clang/include/clang/Sema/ScopeInfo.h:514

bool hasUnrecoverableErrorOccurred() const

Description

Determine whether an unrecoverable error has occurred within this function. Note that this may return false even if the function body is invalid, because the errors may be suppressed if they're caused by prior invalid declarations. FIXME: Migrate the caller of this to use containsErrors() instead once it's ready.

Declared at: clang/include/clang/Sema/ScopeInfo.h:399

bool isCoroutine() const

Declared at: clang/include/clang/Sema/ScopeInfo.h:484

bool isPlainFunction() const

Declared at: clang/include/clang/Sema/ScopeInfo.h:530

void markSafeWeakUse(const clang::Expr* E)

Description

Record that a given expression is a "safe" access of a weak object (e.g. assigning it to a strong variable.) Part of the implementation of -Wrepeated-use-of-weak.

Declared at: clang/include/clang/Sema/ScopeInfo.h:416

Parameters

const clang::Expr* E

template <typename ExprT>
inline void recordUseOfWeak(const ExprT* E,
                            bool IsRead = true)

Description

Record that a weak object was accessed. Part of the implementation of -Wrepeated-use-of-weak.

Declared at: clang/include/clang/Sema/ScopeInfo.h:407

Templates

ExprT

Parameters

const ExprT* E
bool IsRead = true

void recordUseOfWeak(
    const clang::ObjCMessageExpr* Msg,
    const clang::ObjCPropertyDecl* Prop)

Declared at: clang/include/clang/Sema/ScopeInfo.h:409

Parameters

const clang::ObjCMessageExpr* Msg
const clang::ObjCPropertyDecl* Prop

void setCoroutineSuspends(clang::Stmt* Initial,
                          clang::Stmt* Final)

Declared at: clang/include/clang/Sema/ScopeInfo.h:518

Parameters

clang::Stmt* Initial
clang::Stmt* Final

void setFirstCoroutineStmt(
    clang::SourceLocation Loc,
    llvm::StringRef Keyword)

Declared at: clang/include/clang/Sema/ScopeInfo.h:486

Parameters

clang::SourceLocation Loc
llvm::StringRef Keyword

void setHasBranchIntoScope()

Declared at: clang/include/clang/Sema/ScopeInfo.h:422

void setHasBranchProtectedScope()

Declared at: clang/include/clang/Sema/ScopeInfo.h:426

void setHasCXXTry(clang::SourceLocation TryLoc)

Declared at: clang/include/clang/Sema/ScopeInfo.h:452

Parameters

clang::SourceLocation TryLoc

void setHasDroppedStmt()

Declared at: clang/include/clang/Sema/ScopeInfo.h:436

void setHasFallthroughStmt()

Declared at: clang/include/clang/Sema/ScopeInfo.h:444

void setHasIndirectGoto()

Declared at: clang/include/clang/Sema/ScopeInfo.h:430

void setHasMustTail()

Declared at: clang/include/clang/Sema/ScopeInfo.h:434

void setHasOMPDeclareReductionCombiner()

Declared at: clang/include/clang/Sema/ScopeInfo.h:440

void setHasObjCTry(clang::SourceLocation TryLoc)

Declared at: clang/include/clang/Sema/ScopeInfo.h:458

Parameters

clang::SourceLocation TryLoc

void setHasSEHTry(clang::SourceLocation TryLoc)

Declared at: clang/include/clang/Sema/ScopeInfo.h:464

Parameters

clang::SourceLocation TryLoc

void setNeedsCoroutineSuspends(bool value = true)

Declared at: clang/include/clang/Sema/ScopeInfo.h:508

Parameters

bool value = true

void setUsesFPIntrin()

Declared at: clang/include/clang/Sema/ScopeInfo.h:448

virtual ~FunctionScopeInfo()

Declared at: clang/include/clang/Sema/ScopeInfo.h:390