clang: clang::AnalysisDeclContext Class Reference (original) (raw)

AnalysisDeclContext contains the context data for the function, method or block under analysis. More...

#include "[clang/Analysis/AnalysisDeclContext.h](AnalysisDeclContext%5F8h%5Fsource.html)"

Public Member Functions
AnalysisDeclContext (AnalysisDeclContextManager *Mgr, const Decl *D)
AnalysisDeclContext (AnalysisDeclContextManager *Mgr, const Decl *D, const CFG::BuildOptions &BuildOptions)
~AnalysisDeclContext ()
ASTContext & getASTContext () const
const Decl * getDecl () const
AnalysisDeclContextManager * getManager () const
CFG::BuildOptions & getCFGBuildOptions ()
const CFG::BuildOptions & getCFGBuildOptions () const
bool getAddEHEdges () const
bool getUseUnoptimizedCFG () const
bool getAddImplicitDtors () const
bool getAddInitializers () const
void registerForcedBlockExpression (const Stmt *stmt)
const CFGBlock * getBlockForRegisteredExpression (const Stmt *stmt)
Stmt * getBody () const
Stmt * getBody (bool &IsAutosynthesized) const
bool isBodyAutosynthesized () const
bool isBodyAutosynthesizedFromModelFile () const
CFG * getCFG ()
CFGStmtMap * getCFGStmtMap ()
CFGReverseBlockReachabilityAnalysis * getCFGReachablityAnalysis ()
CFG * getUnoptimizedCFG ()
void dumpCFG (bool ShowColors)
bool isCFGBuilt () const
ParentMap & getParentMap ()
llvm::iterator_range< referenced_decls_iterator > getReferencedBlockVars (const BlockDecl *BD)
const ImplicitParamDecl * getSelfDecl () const
const StackFrameContext * getStackFrame (LocationContext const *ParentLC, const Stmt *S, const CFGBlock *Blk, unsigned BlockCount, unsigned Index)
Obtain a context of the call stack using its parent context.
const BlockInvocationContext * getBlockInvocationContext (const LocationContext *ParentLC, const BlockDecl *BD, const void *Data)
Obtain a context of the block invocation using its parent context.
template<typename T>
T * getAnalysis ()
Static Public Member Functions
static bool isInStdNamespace (const Decl *D)
static std::string getFunctionName (const Decl *D)

AnalysisDeclContext contains the context data for the function, method or block under analysis.

Definition at line 72 of file AnalysisDeclContext.h.

referenced_decls_iterator

AnalysisDeclContext() [2/2]

~AnalysisDeclContext()

AnalysisDeclContext::~AnalysisDeclContext ( )

dumpCFG()

void AnalysisDeclContext::dumpCFG ( bool ShowColors )

getAddEHEdges()

bool clang::AnalysisDeclContext::getAddEHEdges ( ) const inline

Returns

Whether we are adding exception handling edges from CallExprs. If this is false, then try/catch statements and blocks reachable from them can appear to be dead in the CFG, analysis passes must cope with that.

Definition at line 119 of file AnalysisDeclContext.h.

Referenced by CheckFallThrough().

getAddImplicitDtors()

bool clang::AnalysisDeclContext::getAddImplicitDtors ( ) const inline

getAddInitializers()

bool clang::AnalysisDeclContext::getAddInitializers ( ) const inline

getAnalysis()

template<typename T>

T * clang::AnalysisDeclContext::getAnalysis ( ) inline

getASTContext()

ASTContext & clang::AnalysisDeclContext::getASTContext ( ) const inline

Definition at line 104 of file AnalysisDeclContext.h.

Referenced by areAllValuesNoReturn(), clang::ento::SValBuilder::conjureSymbolVal(), dumpCFG(), clang::LocationContext::dumpStack(), clang::reachable_code::FindUnreachableCode(), clang::ento::getWidenedLoopState(), clang::ento::isPossiblyEscaped(), printIndicesOfElementsToConstructJson(), clang::LocationContext::printJson(), clang::ProgramPoint::printJson(), printObjectsUnderConstructionJson(), printPendingInitLoopJson(), clang::consumed::ConsumedAnalyzer::run(), and timeTraceMetadata().

getBlockForRegisteredExpression()

const CFGBlock * AnalysisDeclContext::getBlockForRegisteredExpression ( const Stmt * stmt )

getBlockInvocationContext()

getBody() [1/2]

Stmt * AnalysisDeclContext::getBody ( ) const

Returns

The body of the stored Decl D.

Definition at line 129 of file AnalysisDeclContext.cpp.

References getBody().

Referenced by DiagnoseSwitchLabelsFallthrough(), getBody(), getCFG(), getLocationForCaller(), getParentMap(), clang::ento::AnyFunctionCall::getRuntimeDefinition(), getUnoptimizedCFG(), clang::ento::PathDiagnosticLocation::getValidSourceLocation(), isBodyAutosynthesized(), isBodyAutosynthesizedFromModelFile(), clang::ento::ExprEngine::processCallExit(), and clang::ento::ExprEngine::removeDeadOnEndOfFunction().

getBody() [2/2]

Stmt * AnalysisDeclContext::getBody ( bool & IsAutosynthesized ) const

getCFG()

CFG * AnalysisDeclContext::getCFG ( )

Definition at line 216 of file AnalysisDeclContext.cpp.

References addParentsForSyntheticStmts(), clang::CFG::buildCFG(), getBody(), getCFGBuildOptions(), getUnoptimizedCFG(), and clang::CFG::BuildOptions::Observer.

Referenced by areAllValuesNoReturn(), CheckFallThrough(), checkRecursiveFunction(), checkThrowInNonThrowingFunc(), clang::LiveVariables::computeLiveness(), clang::PostOrderCFGView::create(), DiagnoseSwitchLabelsFallthrough(), dumpCFG(), emitPossiblyUnreachableDiags(), clang::reachable_code::FindUnreachableCode(), getCFGReachablityAnalysis(), getCFGStmtMap(), getParentMap(), clang::threadSafety::CFGWalker::init(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), clang::consumed::ConsumedAnalyzer::run(), and clang::LiveVariables::runOnAllBlocks().

getCFGBuildOptions() [1/2]

getCFGBuildOptions() [2/2]

const CFG::BuildOptions & clang::AnalysisDeclContext::getCFGBuildOptions ( ) const inline

getCFGReachablityAnalysis()

getCFGStmtMap()

CFGStmtMap * AnalysisDeclContext::getCFGStmtMap ( )

getDecl()

const Decl * clang::AnalysisDeclContext::getDecl ( ) const inline

Definition at line 106 of file AnalysisDeclContext.h.

Referenced by CheckUnreachable(), DiagnoseSwitchLabelsFallthrough(), clang::lifetimes::internal::FactManager::dump(), emitDiagnostics(), emitDiagnostics(), emitDiagnostics(), getLocationForCaller(), getParentMap(), clang::ento::AnyFunctionCall::getRuntimeDefinition(), clang::ento::PathDiagnosticLocation::getValidSourceLocation(), clang::threadSafety::CFGWalker::init(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), and clang::consumed::ConsumedAnalyzer::run().

getFunctionName()

std::string AnalysisDeclContext::getFunctionName ( const Decl * D) static

getManager()

getParentMap()

ParentMap & AnalysisDeclContext::getParentMap ( )

getReferencedBlockVars()

llvm::iterator_range< AnalysisDeclContext::referenced_decls_iterator > AnalysisDeclContext::getReferencedBlockVars ( const BlockDecl * BD )

getSelfDecl()

getStackFrame()

Obtain a context of the call stack using its parent context.

Parameters

ADC The AnalysisDeclContext.
ParentLC The parent context of this newly created context.
S The call.
Block The basic block.
BlockCount The current count of entering into Blk.
Index The index of Blk.

Returns

The context for D with parent context ParentLC.

Definition at line 314 of file AnalysisDeclContext.cpp.

References clang::LocationContext::getStackFrame().

getUnoptimizedCFG()

CFG * AnalysisDeclContext::getUnoptimizedCFG ( )

getUseUnoptimizedCFG()

bool clang::AnalysisDeclContext::getUseUnoptimizedCFG ( ) const inline

isBodyAutosynthesized()

bool AnalysisDeclContext::isBodyAutosynthesized ( ) const

isBodyAutosynthesizedFromModelFile()

bool AnalysisDeclContext::isBodyAutosynthesizedFromModelFile ( ) const

isCFGBuilt()

bool clang::AnalysisDeclContext::isCFGBuilt ( ) const inline

isInStdNamespace()

bool AnalysisDeclContext::isInStdNamespace ( const Decl * D) static

registerForcedBlockExpression()

void AnalysisDeclContext::registerForcedBlockExpression ( const Stmt * stmt )

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