clang API Documentation

Public Types | Public Member Functions
clang::AnalysisDeclContext Class Reference

#include <AnalysisContext.h>

List of all members.

Public Types

typedef const VarDecl *const * referenced_decls_iterator

Public Member Functions

 AnalysisDeclContext (AnalysisDeclContextManager *Mgr, const Decl *D)
 AnalysisDeclContext (AnalysisDeclContextManager *Mgr, const Decl *D, const CFG::BuildOptions &BuildOptions)
 ~AnalysisDeclContext ()
ASTContextgetASTContext ()
const DeclgetDecl () const
CFG::BuildOptionsgetCFGBuildOptions ()
 Return the build options used to construct the CFG.
const CFG::BuildOptionsgetCFGBuildOptions () const
bool getAddEHEdges () const
bool getUseUnoptimizedCFG () const
bool getAddImplicitDtors () const
bool getAddInitializers () const
void registerForcedBlockExpression (const Stmt *stmt)
const CFGBlockgetBlockForRegisteredExpression (const Stmt *stmt)
StmtgetBody () const
CFGgetCFG ()
CFGStmtMapgetCFGStmtMap ()
CFGReverseBlockReachabilityAnalysisgetCFGReachablityAnalysis ()
CFGgetUnoptimizedCFG ()
 Return a version of the CFG without any edges pruned.
void dumpCFG (bool ShowColors)
bool isCFGBuilt () const
 Returns true if we have built a CFG for this analysis context. Note that this doesn't correspond to whether or not a valid CFG exists, it corresponds to whether we *attempted* to build one.
ParentMapgetParentMap ()
PseudoConstantAnalysisgetPseudoConstantAnalysis ()
std::pair
< referenced_decls_iterator,
referenced_decls_iterator
getReferencedBlockVars (const BlockDecl *BD)
const ImplicitParamDeclgetSelfDecl () const
const StackFrameContextgetStackFrame (LocationContext const *Parent, const Stmt *S, const CFGBlock *Blk, unsigned Idx)
template<typename T >
T * getAnalysis ()

Detailed Description

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

Definition at line 69 of file AnalysisContext.h.


Member Typedef Documentation

Definition at line 152 of file AnalysisContext.h.


Constructor & Destructor Documentation

AnalysisDeclContext::AnalysisDeclContext ( AnalysisDeclContextManager Mgr,
const Decl D 
)

Definition at line 50 of file AnalysisDeclContext.cpp.

References clang::CFG::BuildOptions::forcedBlkExprs.

AnalysisDeclContext::AnalysisDeclContext ( AnalysisDeclContextManager Mgr,
const Decl D,
const CFG::BuildOptions BuildOptions 
)

Definition at line 35 of file AnalysisDeclContext.cpp.

References clang::CFG::BuildOptions::forcedBlkExprs.

AnalysisDeclContext::~AnalysisDeclContext ( )

Definition at line 425 of file AnalysisDeclContext.cpp.


Member Function Documentation

void AnalysisDeclContext::dumpCFG ( bool  ShowColors)

Definition at line 178 of file AnalysisDeclContext.cpp.

References clang::CFG::dump(), getASTContext(), and getCFG().

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

getAddEHEdges - Return true iff we are adding exceptional 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 122 of file AnalysisContext.h.

References clang::CFG::BuildOptions::AddEHEdges.

Referenced by CheckFallThrough().

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

Definition at line 126 of file AnalysisContext.h.

References clang::CFG::BuildOptions::AddImplicitDtors.

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

Definition at line 127 of file AnalysisContext.h.

References clang::CFG::BuildOptions::AddInitializers.

template<typename T >
T* clang::AnalysisDeclContext::getAnalysis ( ) [inline]

Return the specified analysis object, lazily running the analysis if necessary. Return NULL if the analysis could not run.

Definition at line 169 of file AnalysisContext.h.

References clang::serialized_diags::create(), and data().

Referenced by clang::ento::AnalysisManager::getAnalysis(), and clang::LocationContext::getAnalysis().

ASTContext& clang::AnalysisDeclContext::getASTContext ( ) [inline]

Definition at line 106 of file AnalysisContext.h.

References clang::Decl::getASTContext().

Referenced by dumpCFG().

const CFGBlock * AnalysisDeclContext::getBlockForRegisteredExpression ( const Stmt stmt)
Stmt * AnalysisDeclContext::getBody ( ) const
CFG * AnalysisDeclContext::getCFG ( )
CFG::BuildOptions& clang::AnalysisDeclContext::getCFGBuildOptions ( ) [inline]

Return the build options used to construct the CFG.

Definition at line 110 of file AnalysisContext.h.

Referenced by clang::reachable_code::FindUnreachableCode(), and clang::sema::AnalysisBasedWarnings::IssueWarnings().

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

Definition at line 114 of file AnalysisContext.h.

CFGReverseBlockReachabilityAnalysis * AnalysisDeclContext::getCFGReachablityAnalysis ( )

Definition at line 166 of file AnalysisDeclContext.cpp.

References getCFG().

Referenced by clang::sema::AnalysisBasedWarnings::IssueWarnings().

CFGStmtMap * AnalysisDeclContext::getCFGStmtMap ( )

Definition at line 154 of file AnalysisDeclContext.cpp.

References clang::CFGStmtMap::Build(), getCFG(), and getParentMap().

const Decl* clang::AnalysisDeclContext::getDecl ( ) const [inline]
ParentMap & AnalysisDeclContext::getParentMap ( )
PseudoConstantAnalysis * AnalysisDeclContext::getPseudoConstantAnalysis ( )

Definition at line 188 of file AnalysisDeclContext.cpp.

References getBody().

std::pair< AnalysisDeclContext::referenced_decls_iterator, AnalysisDeclContext::referenced_decls_iterator > AnalysisDeclContext::getReferencedBlockVars ( const BlockDecl BD)

Definition at line 404 of file AnalysisDeclContext.cpp.

References LazyInitializeReferencedDecls().

const ImplicitParamDecl * AnalysisDeclContext::getSelfDecl ( ) const

Return the ImplicitParamDecl* associated with 'self' if this AnalysisDeclContext wraps an ObjCMethodDecl. Returns NULL otherwise.

Definition at line 91 of file AnalysisDeclContext.cpp.

References clang::NamedDecl::getName(), and NULL.

Referenced by clang::LocationContext::getSelfDecl(), and isSelfVar().

const StackFrameContext * AnalysisDeclContext::getStackFrame ( LocationContext const *  Parent,
const Stmt S,
const CFGBlock Blk,
unsigned  Idx 
)
CFG * AnalysisDeclContext::getUnoptimizedCFG ( )

Return a version of the CFG without any edges pruned.

Definition at line 141 of file AnalysisDeclContext.cpp.

References clang::CFG::buildCFG(), clang::Decl::getASTContext(), getBody(), and clang::CFG::BuildOptions::PruneTriviallyFalseEdges.

Referenced by getCFG().

bool clang::AnalysisDeclContext::getUseUnoptimizedCFG ( ) const [inline]
bool clang::AnalysisDeclContext::isCFGBuilt ( ) const [inline]

Returns true if we have built a CFG for this analysis context. Note that this doesn't correspond to whether or not a valid CFG exists, it corresponds to whether we *attempted* to build one.

Definition at line 147 of file AnalysisContext.h.

Referenced by clang::sema::AnalysisBasedWarnings::IssueWarnings().

void AnalysisDeclContext::registerForcedBlockExpression ( const Stmt stmt)

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