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
const DeclgetDecl () const
AnalysisDeclContextManagergetManager () 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
 Get the body of the Declaration.
StmtgetBody (bool &IsAutosynthesized) const
 Get the body of the Declaration.
bool isBodyAutosynthesized () const
 Checks if the body of the Decl is generated by the BodyFarm.
bool isBodyAutosynthesizedFromModelFile () const
 Checks if the body of the Decl is generated by the BodyFarm from a model file.
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)
const BlockInvocationContextgetBlockInvocationContext (const LocationContext *parent, const BlockDecl *BD, const void *ContextData)
template<typename T >
T * getAnalysis ()

Detailed Description

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

Definition at line 66 of file AnalysisContext.h.


Member Typedef Documentation

Definition at line 174 of file AnalysisContext.h.


Constructor & Destructor Documentation

Definition at line 53 of file AnalysisDeclContext.cpp.

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

Definition at line 38 of file AnalysisDeclContext.cpp.

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

Definition at line 556 of file AnalysisDeclContext.cpp.


Member Function Documentation

void AnalysisDeclContext::dumpCFG ( bool  ShowColors)

Definition at line 249 of file AnalysisDeclContext.cpp.

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

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

Definition at line 126 of file AnalysisContext.h.

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

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 196 of file AnalysisContext.h.

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

Referenced by clang::ento::AnalysisManager::getAnalysis(), clang::LocationContext::getAnalysis(), clang::threadSafety::CFGWalker::init(), mayInlineDecl(), clang::consumed::ConsumedAnalyzer::run(), and clang::runUninitializedVariablesAnalysis().

const BlockInvocationContext * AnalysisDeclContext::getBlockInvocationContext ( const LocationContext parent,
const BlockDecl BD,
const void *  ContextData 
)
Stmt * AnalysisDeclContext::getBody ( bool IsAutosynthesized) const

Get the body of the Declaration.

Parameters:
[out]IsAutosynthesizedSpecifies if the body is auto-generated by the BodyFarm.

Definition at line 93 of file AnalysisDeclContext.cpp.

References getASTContext(), getBody(), getBodyFarm(), and clang::AnalysisDeclContextManager::synthesizeBodies().

Definition at line 114 of file AnalysisContext.h.

Definition at line 237 of file AnalysisDeclContext.cpp.

References getCFG().

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

Definition at line 225 of file AnalysisDeclContext.cpp.

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

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

Return the AnalysisDeclContextManager (if any) that created this AnalysisDeclContext.

Definition at line 105 of file AnalysisContext.h.

Definition at line 269 of file AnalysisDeclContext.cpp.

References getBody().

Definition at line 535 of file AnalysisDeclContext.cpp.

References LazyInitializeReferencedDecls().

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

Definition at line 139 of file AnalysisDeclContext.cpp.

References clang::NamedDecl::getName().

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

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

Checks if the body of the Decl is generated by the BodyFarm.

Note, the lookup is not free. We are going to call getBody behind the scenes.

See also:
getBody

Definition at line 126 of file AnalysisDeclContext.cpp.

References getBody().

Referenced by clang::ento::BugReporter::emitReport(), and wasSynthesizedProperty().

Checks if the body of the Decl is generated by the BodyFarm from a model file.

Note, the lookup is not free. We are going to call getBody behind the scenes.

See also:
getBody

Definition at line 132 of file AnalysisDeclContext.cpp.

References getBody(), clang::Stmt::getLocStart(), and clang::SourceLocation::isValid().

Referenced by clang::ento::BugReporter::emitReport().

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 169 of file AnalysisContext.h.

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


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