class AnalysisDeclContext
Declaration
class AnalysisDeclContext { /* full declaration omitted */ };
Description
AnalysisDeclContext contains the context data for the function, method or block under analysis.
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:72
Member Variables
- private clang::AnalysisDeclContextManager* ADCMgr
- private const clang::Decl* const D
- private std::unique_ptr<CFG> cfg
- private std::unique_ptr<CFG> completeCFG
- private std::unique_ptr<CFGStmtMap> cfgStmtMap
- private CFG::BuildOptions cfgBuildOptions
- private CFG::BuildOptions::ForcedBlkExprs* forcedBlkExprs = nullptr
- private bool builtCFG = false
- private bool builtCompleteCFG = false
- private std::unique_ptr<ParentMap> PM
- private std::unique_ptr< CFGReverseBlockReachabilityAnalysis> CFA
- private llvm::BumpPtrAllocator A
- private llvm::DenseMap<const BlockDecl*, void*>* ReferencedBlockVars = nullptr
- private void* ManagedAnalyses = nullptr
Method Overview
- public AnalysisDeclContext(clang::AnalysisDeclContextManager * Mgr, const clang::Decl * D, const CFG::BuildOptions & BuildOptions)
- public AnalysisDeclContext(clang::AnalysisDeclContextManager * Mgr, const clang::Decl * D)
- public void dumpCFG(bool ShowColors)
- public clang::ASTContext & getASTContext() const
- public bool getAddEHEdges() const
- public bool getAddImplicitDtors() const
- public bool getAddInitializers() const
- public template <typename T>T * getAnalysis()
- private std::unique_ptr<ManagedAnalysis> & getAnalysisImpl(const void * tag)
- public const clang::CFGBlock * getBlockForRegisteredExpression(const clang::Stmt * stmt)
- public const clang::BlockInvocationContext * getBlockInvocationContext(const clang::LocationContext * ParentLC, const clang::BlockDecl * BD, const void * Data)
- public clang::Stmt * getBody(bool & IsAutosynthesized) const
- public clang::Stmt * getBody() const
- public clang::CFG * getCFG()
- public const CFG::BuildOptions & getCFGBuildOptions() const
- public CFG::BuildOptions & getCFGBuildOptions()
- public clang::CFGReverseBlockReachabilityAnalysis * getCFGReachablityAnalysis()
- public clang::CFGStmtMap * getCFGStmtMap()
- public const clang::Decl * getDecl() const
- public static std::string getFunctionName(const clang::Decl * D)
- private clang::LocationContextManager & getLocationContextManager()
- public clang::AnalysisDeclContextManager * getManager() const
- public clang::ParentMap & getParentMap()
- public llvm::iterator_range<referenced_decls_iterator> getReferencedBlockVars(const clang::BlockDecl * BD)
- public const clang::ImplicitParamDecl * getSelfDecl() const
- public const clang::StackFrameContext * getStackFrame(const clang::LocationContext * ParentLC, const clang::Stmt * S, const clang::CFGBlock * Blk, unsigned int BlockCount, unsigned int Index)
- public clang::CFG * getUnoptimizedCFG()
- public bool getUseUnoptimizedCFG() const
- public bool isBodyAutosynthesized() const
- public bool isBodyAutosynthesizedFromModelFile() const
- public bool isCFGBuilt() const
- public static bool isInStdNamespace(const clang::Decl * D)
- public void registerForcedBlockExpression(const clang::Stmt * stmt)
- public ~AnalysisDeclContext()
Methods
¶AnalysisDeclContext(
clang::AnalysisDeclContextManager* Mgr,
const clang::Decl* D,
const CFG::BuildOptions& BuildOptions)
AnalysisDeclContext(
clang::AnalysisDeclContextManager* Mgr,
const clang::Decl* D,
const CFG::BuildOptions& BuildOptions)
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:99
Parameters
- clang::AnalysisDeclContextManager* Mgr
- const clang::Decl* D
- const CFG::BuildOptions& BuildOptions
¶AnalysisDeclContext(
clang::AnalysisDeclContextManager* Mgr,
const clang::Decl* D)
AnalysisDeclContext(
clang::AnalysisDeclContextManager* Mgr,
const clang::Decl* D)
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:97
Parameters
- clang::AnalysisDeclContextManager* Mgr
- const clang::Decl* D
¶void dumpCFG(bool ShowColors)
void dumpCFG(bool ShowColors)
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:161
Parameters
- bool ShowColors
¶clang::ASTContext& getASTContext() const
clang::ASTContext& getASTContext() const
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:104
¶bool getAddEHEdges() const
bool getAddEHEdges() const
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:119
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.
¶bool getAddImplicitDtors() const
bool getAddImplicitDtors() const
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:123
¶bool getAddInitializers() const
bool getAddInitializers() const
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:124
¶template <typename T>
T* getAnalysis()
template <typename T>
T* getAnalysis()
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:192
Templates
- T
Returns
The specified analysis object, lazily running the analysis if necessary or nullptr if the analysis could not run.
¶std::unique_ptr<ManagedAnalysis>& getAnalysisImpl(
const void* tag)
std::unique_ptr<ManagedAnalysis>& getAnalysisImpl(
const void* tag)
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:206
Parameters
- const void* tag
¶const clang::CFGBlock*
getBlockForRegisteredExpression(
const clang::Stmt* stmt)
const clang::CFGBlock*
getBlockForRegisteredExpression(
const clang::Stmt* stmt)
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:127
Parameters
- const clang::Stmt* stmt
¶const clang::BlockInvocationContext*
getBlockInvocationContext(
const clang::LocationContext* ParentLC,
const clang::BlockDecl* BD,
const void* Data)
const clang::BlockInvocationContext*
getBlockInvocationContext(
const clang::LocationContext* ParentLC,
const clang::BlockDecl* BD,
const void* Data)
Description
\copydoc LocationContextManager::getBlockInvocationContext()
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:187
Parameters
- const clang::LocationContext* ParentLC
- const clang::BlockDecl* BD
- const void* Data
¶clang::Stmt* getBody(
bool& IsAutosynthesized) const
clang::Stmt* getBody(
bool& IsAutosynthesized) const
Description
\copydoc AnalysisDeclContext::getBody()
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:135
Parameters
- bool& IsAutosynthesized
- Specifies if the body is auto-generated by the BodyFarm.
¶clang::Stmt* getBody() const
clang::Stmt* getBody() const
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:130
Returns
The body of the stored Decl \c D.
¶clang::CFG* getCFG()
clang::CFG* getCFG()
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:152
¶const CFG::BuildOptions& getCFGBuildOptions()
const
const CFG::BuildOptions& getCFGBuildOptions()
const
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:112
¶CFG::BuildOptions& getCFGBuildOptions()
CFG::BuildOptions& getCFGBuildOptions()
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:110
¶clang::CFGReverseBlockReachabilityAnalysis*
getCFGReachablityAnalysis()
clang::CFGReverseBlockReachabilityAnalysis*
getCFGReachablityAnalysis()
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:156
¶clang::CFGStmtMap* getCFGStmtMap()
clang::CFGStmtMap* getCFGStmtMap()
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:154
¶const clang::Decl* getDecl() const
const clang::Decl* getDecl() const
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:106
¶static std::string getFunctionName(
const clang::Decl* D)
static std::string getFunctionName(
const clang::Decl* D)
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:203
Parameters
- const clang::Decl* D
¶clang::LocationContextManager&
getLocationContextManager()
clang::LocationContextManager&
getLocationContextManager()
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:208
¶clang::AnalysisDeclContextManager* getManager()
const
clang::AnalysisDeclContextManager* getManager()
const
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:108
¶clang::ParentMap& getParentMap()
clang::ParentMap& getParentMap()
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:169
¶llvm::iterator_range<referenced_decls_iterator>
getReferencedBlockVars(const clang::BlockDecl* BD)
llvm::iterator_range<referenced_decls_iterator>
getReferencedBlockVars(const clang::BlockDecl* BD)
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:174
Parameters
- const clang::BlockDecl* BD
¶const clang::ImplicitParamDecl* getSelfDecl()
const
const clang::ImplicitParamDecl* getSelfDecl()
const
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:178
Returns
The ImplicitParamDecl associated with \c self if this AnalysisDeclContext wraps an ObjCMethodDecl or nullptr otherwise.
¶const clang::StackFrameContext* getStackFrame(
const clang::LocationContext* ParentLC,
const clang::Stmt* S,
const clang::CFGBlock* Blk,
unsigned int BlockCount,
unsigned int Index)
const clang::StackFrameContext* getStackFrame(
const clang::LocationContext* ParentLC,
const clang::Stmt* S,
const clang::CFGBlock* Blk,
unsigned int BlockCount,
unsigned int Index)
Description
\copydoc LocationContextManager::getStackFrame()
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:181
Parameters
- const clang::LocationContext* ParentLC
- const clang::Stmt* S
- const clang::CFGBlock* Blk
- unsigned int BlockCount
- unsigned int Index
¶clang::CFG* getUnoptimizedCFG()
clang::CFG* getUnoptimizedCFG()
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:159
Returns
A version of the CFG without any edges pruned.
¶bool getUseUnoptimizedCFG() const
bool getUseUnoptimizedCFG() const
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:120
¶bool isBodyAutosynthesized() const
bool isBodyAutosynthesized() const
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:142
Returns
Whether the body of the Decl \c D is generated by the BodyFarm.
¶bool isBodyAutosynthesizedFromModelFile() const
bool isBodyAutosynthesizedFromModelFile() const
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:150
Returns
Whether the body of the Decl \c D is generated by the BodyFarm from a model file.
¶bool isCFGBuilt() const
bool isCFGBuilt() const
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:167
Returns
Whether we have built a CFG for this analysis context.
¶static bool isInStdNamespace(const clang::Decl* D)
static bool isInStdNamespace(const clang::Decl* D)
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:201
Parameters
- const clang::Decl* D
Returns
Whether the root namespace of \p D is the \c std C++ namespace.
¶void registerForcedBlockExpression(
const clang::Stmt* stmt)
void registerForcedBlockExpression(
const clang::Stmt* stmt)
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:126
Parameters
- const clang::Stmt* stmt
¶~AnalysisDeclContext()
~AnalysisDeclContext()
Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:102