clang
3.7.0
|
#include <CFG.h>
Classes | |
class | BuildOptions |
class | const_graph_iterator |
class | graph_iterator |
Provides a custom implementation of the iterator class to have the same interface as Function::iterator - iterator returns CFGBlock (not a pointer to CFGBlock). More... | |
Public Types | |
typedef BumpVector< CFGBlock * > | CFGBlockListTy |
typedef CFGBlockListTy::iterator | iterator |
typedef CFGBlockListTy::const_iterator | const_iterator |
typedef std::reverse_iterator < iterator > | reverse_iterator |
typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
typedef std::vector< const CFGBlock * >::const_iterator | try_block_iterator |
typedef llvm::DenseMap< const DeclStmt *, const DeclStmt * > ::const_iterator | synthetic_stmt_iterator |
Static Public Member Functions | |
static std::unique_ptr< CFG > | buildCFG (const Decl *D, Stmt *AST, ASTContext *C, const BuildOptions &BO) |
buildCFG - Builds a CFG from an AST. More... | |
CFG - Represents a source-level, intra-procedural CFG that represents the control-flow of a Stmt. The Stmt can represent an entire function body, or a single expression. A CFG will always contain one empty block that represents the Exit point of the CFG. A CFG will also contain a designated Entry block. The CFG solely represents control-flow; it consists of CFGBlocks which are simply containers of Stmt*'s in the AST the CFG was constructed from.
typedef BumpVector<CFGBlock*> clang::CFG::CFGBlockListTy |
typedef std::reverse_iterator<const_iterator> clang::CFG::const_reverse_iterator |
typedef std::reverse_iterator<iterator> clang::CFG::reverse_iterator |
typedef llvm::DenseMap<const DeclStmt *, const DeclStmt *>::const_iterator clang::CFG::synthetic_stmt_iterator |
typedef std::vector<const CFGBlock*>::const_iterator clang::CFG::try_block_iterator |
|
inline |
|
inline |
Definition at line 842 of file CFG.h.
References clang::BumpVector< T >::back().
Referenced by createBlock().
|
inline |
Definition at line 844 of file CFG.h.
References clang::BumpVector< T >::begin().
Referenced by clang::CFGStmtMap::Build(), clang::LiveVariables::computeLiveness(), createBlock(), clang::DominatorTree::dump(), clang::reachable_code::FindUnreachableCode(), clang::LiveVariables::runOnAllBlocks(), clang::runUninitializedVariablesAnalysis(), and VisitBlockStmts().
|
inline |
Definition at line 846 of file CFG.h.
References clang::BumpVector< T >::begin().
|
static |
buildCFG - Builds a CFG from an AST.
buildCFG - Constructs a CFG from an AST.
Definition at line 3790 of file CFG.cpp.
References Builder.
Referenced by clang::AnalysisDeclContext::getCFG(), and clang::AnalysisDeclContext::getUnoptimizedCFG().
CFGBlock * CFG::createBlock | ( | ) |
createBlock - Create a new block in the CFG. The CFG owns the block; the caller should not directly free it.
createBlock - Constructs and adds a new CFGBlock to the CFG. The block has no successors or predecessors. If this is the first block created in the CFG, it is automatically set to be the Entry and Exit of the CFG.
Definition at line 3773 of file CFG.cpp.
References back(), begin(), end(), getAllocator(), and clang::BumpVector< T >::push_back().
void CFG::dump | ( | const LangOptions & | LO, |
bool | ShowColors | ||
) | const |
dump - A simple pretty printer of a CFG that outputs to stderr.
Definition at line 4418 of file CFG.cpp.
References clang::CFGBlock::print().
Referenced by clang::AnalysisDeclContext::dumpCFG().
|
inline |
Definition at line 845 of file CFG.h.
References clang::BumpVector< T >::end().
Referenced by clang::CFGStmtMap::Build(), clang::LiveVariables::computeLiveness(), createBlock(), clang::DominatorTree::dump(), clang::reachable_code::FindUnreachableCode(), clang::LiveVariables::runOnAllBlocks(), clang::runUninitializedVariablesAnalysis(), and VisitBlockStmts().
|
inline |
Definition at line 847 of file CFG.h.
References clang::BumpVector< T >::end().
|
inline |
Definition at line 841 of file CFG.h.
References clang::BumpVector< T >::front().
|
inline |
Definition at line 955 of file CFG.h.
References clang::BumpVectorContext::getAllocator().
Referenced by createBlock().
|
inline |
|
inline |
Definition at line 863 of file CFG.h.
Referenced by CheckFallThrough(), checkRecursiveFunction(), clang::ento::CoreEngine::ExecuteWorkList(), clang::reachable_code::FindUnreachableCode(), llvm::GraphTraits< ::clang::CFG * >::getEntryNode(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), print_block(), clang::ento::ExprEngine::processCallEnter(), clang::runUninitializedVariablesAnalysis(), and clang::threadSafety::CFGWalker::walk().
|
inline |
Definition at line 865 of file CFG.h.
Referenced by checkRecursiveFunction(), llvm::GraphTraits< Inverse< ::clang::CFG * > >::getEntryNode(), clang::ento::BugReport::getStmt(), print_block(), clang::consumed::ConsumedAnalyzer::run(), and clang::threadSafety::CFGWalker::walk().
|
inline |
Definition at line 868 of file CFG.h.
Referenced by print_block().
|
inline |
|
inline |
getNumBlockIDs - Returns the total number of BlockIDs allocated (which start at 0).
Definition at line 932 of file CFG.h.
Referenced by CheckFallThrough(), checkRecursiveFunction(), clang::LiveVariables::computeLiveness(), clang::ento::CoreEngine::ExecuteWorkList(), clang::reachable_code::FindUnreachableCode(), mayInlineDecl(), clang::PostOrderCFGView::PostOrderCFGView(), clang::consumed::ConsumedAnalyzer::run(), and clang::runUninitializedVariablesAnalysis().
|
inline |
Definition at line 849 of file CFG.h.
References clang::BumpVector< T >::begin().
Referenced by llvm::GraphTraits< ::clang::CFG * >::nodes_begin(), and llvm::GraphTraits< Inverse< ::clang::CFG * > >::nodes_begin().
|
inline |
Definition at line 851 of file CFG.h.
References clang::BumpVector< T >::begin().
|
inline |
Definition at line 850 of file CFG.h.
References clang::BumpVector< T >::end().
Referenced by llvm::GraphTraits< ::clang::CFG * >::nodes_end(), and llvm::GraphTraits< Inverse< ::clang::CFG * > >::nodes_end().
|
inline |
Definition at line 854 of file CFG.h.
References clang::BumpVector< T >::end().
void CFG::print | ( | raw_ostream & | OS, |
const LangOptions & | LO, | ||
bool | ShowColors | ||
) | const |
print - A simple pretty printer of a CFG that outputs to an ostream.
Definition at line 4423 of file CFG.cpp.
References print_block().
|
inline |
Definition at line 858 of file CFG.h.
References clang::BumpVector< T >::rbegin().
Referenced by DiagnoseSwitchLabelsFallthrough().
|
inline |
Definition at line 860 of file CFG.h.
References clang::BumpVector< T >::rbegin().
|
inline |
Definition at line 859 of file CFG.h.
References clang::BumpVector< T >::rend().
Referenced by DiagnoseSwitchLabelsFallthrough().
|
inline |
Definition at line 861 of file CFG.h.
References clang::BumpVector< T >::rend().
|
inline |
|
inline |
|
inline |
size - Return the total number of CFGBlocks within the CFG This is simply a renaming of the getNumBlockIDs(). This is necessary because the dominator implementation needs such an interface.
Definition at line 937 of file CFG.h.
Referenced by llvm::GraphTraits< ::clang::CFG * >::size().
|
inline |
Iterates over synthetic DeclStmts in the CFG.
Each element is a (synthetic statement, source statement) pair.
Definition at line 903 of file CFG.h.
Referenced by addParentsForSyntheticStmts().
|
inline |
Definition at line 908 of file CFG.h.
Referenced by addParentsForSyntheticStmts().
|
inline |
Definition at line 872 of file CFG.h.
Referenced by clang::reachable_code::FindUnreachableCode().
|
inline |
Definition at line 875 of file CFG.h.
Referenced by clang::reachable_code::FindUnreachableCode().
void CFG::viewCFG | ( | const LangOptions & | LO | ) | const |
|
inline |
Definition at line 917 of file CFG.h.
References begin(), end(), and clang::ast_matchers::stmt.
Referenced by clang::runUninitializedVariablesAnalysis().