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

Methods

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)

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:97

Parameters

clang::AnalysisDeclContextManager* Mgr
const clang::Decl* D

void dumpCFG(bool ShowColors)

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:161

Parameters

bool ShowColors

clang::ASTContext& getASTContext() const

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:104

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

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:123

bool getAddInitializers() const

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:124

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)

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:206

Parameters

const void* tag

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)

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

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

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:130

Returns

The body of the stored Decl \c D.

clang::CFG* getCFG()

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:152

const CFG::BuildOptions& getCFGBuildOptions()
    const

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:112

CFG::BuildOptions& getCFGBuildOptions()

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:110

clang::CFGReverseBlockReachabilityAnalysis*
getCFGReachablityAnalysis()

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:156

clang::CFGStmtMap* getCFGStmtMap()

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:154

const clang::Decl* getDecl() const

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:106

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()

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:208

clang::AnalysisDeclContextManager* getManager()
    const

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:108

clang::ParentMap& getParentMap()

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:169

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

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)

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()

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:159

Returns

A version of the CFG without any edges pruned.

bool getUseUnoptimizedCFG() const

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:120

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

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

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)

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)

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:126

Parameters

const clang::Stmt* stmt

~AnalysisDeclContext()

Declared at: clang/include/clang/Analysis/AnalysisDeclContext.h:102