clang API Documentation
#include <CFG.h>
Classes | |
| struct | BlkExprNumTy |
| 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 |
Public Member Functions | |
| CFGBlock * | createBlock () |
| void | setEntry (CFGBlock *B) |
| void | setIndirectGotoBlock (CFGBlock *B) |
| CFGBlock & | front () |
| CFGBlock & | back () |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| graph_iterator | nodes_begin () |
| graph_iterator | nodes_end () |
| const_graph_iterator | nodes_begin () const |
| const_graph_iterator | nodes_end () const |
| reverse_iterator | rbegin () |
| reverse_iterator | rend () |
| const_reverse_iterator | rbegin () const |
| const_reverse_iterator | rend () const |
| CFGBlock & | getEntry () |
| const CFGBlock & | getEntry () const |
| CFGBlock & | getExit () |
| const CFGBlock & | getExit () const |
| CFGBlock * | getIndirectGotoBlock () |
| const CFGBlock * | getIndirectGotoBlock () const |
| try_block_iterator | try_blocks_begin () const |
| try_block_iterator | try_blocks_end () const |
| void | addTryDispatchBlock (const CFGBlock *block) |
| template<typename CALLBACK > | |
| void | VisitBlockStmts (CALLBACK &O) const |
| bool | isBlkExpr (const Stmt *S) |
| bool | isBlkExpr (const Stmt *S) const |
| BlkExprNumTy | getBlkExprNum (const Stmt *S) |
| unsigned | getNumBlkExprs () |
| unsigned | getNumBlockIDs () const |
| unsigned | size () const |
| void | viewCFG (const LangOptions &LO) const |
| void | print (raw_ostream &OS, const LangOptions &LO, bool ShowColors) const |
| print - A simple pretty printer of a CFG that outputs to an ostream. | |
| void | dump (const LangOptions &LO, bool ShowColors) const |
| dump - A simple pretty printer of a CFG that outputs to stderr. | |
| CFG () | |
| ~CFG () | |
| llvm::BumpPtrAllocator & | getAllocator () |
| BumpVectorContext & | getBumpVectorContext () |
Static Public Member Functions | |
| static CFG * | buildCFG (const Decl *D, Stmt *AST, ASTContext *C, const BuildOptions &BO) |
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 std::vector<const CFGBlock*>::const_iterator clang::CFG::try_block_iterator |
| void clang::CFG::addTryDispatchBlock | ( | const CFGBlock * | block | ) | [inline] |
| CFGBlock& clang::CFG::back | ( | ) | [inline] |
Definition at line 672 of file CFG.h.
References clang::BumpVector< T >::back().
Referenced by createBlock().
| iterator clang::CFG::begin | ( | ) | [inline] |
Definition at line 674 of file CFG.h.
References clang::BumpVector< T >::begin().
Referenced by clang::CFGStmtMap::Build(), CheckFallThrough(), clang::LiveVariables::computeLiveness(), createBlock(), clang::DominatorTree::dump(), clang::reachable_code::FindUnreachableCode(), PopulateBlkExprMap(), clang::LiveVariables::runOnAllBlocks(), clang::DataflowSolver< _DFValuesTy, _TransferFuncsTy, _MergeOperatorTy, _Equal >::runOnAllBlocks(), clang::runUninitializedVariablesAnalysis(), and VisitBlockStmts().
| const_iterator clang::CFG::begin | ( | ) | const [inline] |
Definition at line 676 of file CFG.h.
References clang::BumpVector< T >::begin().
| CFG * CFG::buildCFG | ( | const Decl * | D, |
| Stmt * | Statement, | ||
| ASTContext * | C, | ||
| const BuildOptions & | BO | ||
| ) | [static] |
buildCFG - Builds a CFG from an AST. The responsibility to free the constructed CFG belongs to the caller.
buildCFG - Constructs a CFG from an AST. Ownership of the returned CFG is returned to the caller.
Definition at line 3161 of file CFG.cpp.
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 3143 of file CFG.cpp.
References back(), begin(), end(), getAllocator(), and clang::BumpVector< T >::push_back().
| void CFG::dump | ( | const LangOptions & | LO, |
| bool | ShowColors | ||
| ) | const |
| iterator clang::CFG::end | ( | ) | [inline] |
Definition at line 675 of file CFG.h.
References clang::BumpVector< T >::end().
Referenced by clang::CFGStmtMap::Build(), CheckFallThrough(), clang::LiveVariables::computeLiveness(), createBlock(), clang::DominatorTree::dump(), clang::reachable_code::FindUnreachableCode(), PopulateBlkExprMap(), clang::LiveVariables::runOnAllBlocks(), clang::DataflowSolver< _DFValuesTy, _TransferFuncsTy, _MergeOperatorTy, _Equal >::runOnAllBlocks(), clang::runUninitializedVariablesAnalysis(), and VisitBlockStmts().
| const_iterator clang::CFG::end | ( | ) | const [inline] |
Definition at line 677 of file CFG.h.
References clang::BumpVector< T >::end().
| CFGBlock& clang::CFG::front | ( | ) | [inline] |
Definition at line 671 of file CFG.h.
References clang::BumpVector< T >::front().
| llvm::BumpPtrAllocator& clang::CFG::getAllocator | ( | ) | [inline] |
Definition at line 772 of file CFG.h.
References clang::BumpVectorContext::getAllocator().
Referenced by createBlock().
| CFG::BlkExprNumTy CFG::getBlkExprNum | ( | const Stmt * | S | ) |
Definition at line 3298 of file CFG.cpp.
References NULL, and PopulateBlkExprMap().
Referenced by clang::StmtDeclBitVector_Types::AnalysisDataTy::getIdx(), and isBlkExpr().
| BumpVectorContext& clang::CFG::getBumpVectorContext | ( | ) | [inline] |
| CFGBlock& clang::CFG::getEntry | ( | ) | [inline] |
Definition at line 693 of file CFG.h.
Referenced by CheckFallThrough(), clang::reachable_code::FindUnreachableCode(), llvm::GraphTraits< ::clang::CFG * >::getEntryNode(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), print(), print_block(), clang::ento::SubEngine::processCallEnter(), and clang::runUninitializedVariablesAnalysis().
| CFGBlock& clang::CFG::getExit | ( | ) | [inline] |
Definition at line 695 of file CFG.h.
Referenced by CheckFallThrough(), llvm::GraphTraits< Inverse< ::clang::CFG * > >::getEntryNode(), print(), and print_block().
| CFGBlock* clang::CFG::getIndirectGotoBlock | ( | ) | [inline] |
Definition at line 698 of file CFG.h.
Referenced by print_block().
| const CFGBlock* clang::CFG::getIndirectGotoBlock | ( | ) | const [inline] |
| unsigned CFG::getNumBlkExprs | ( | ) |
Definition at line 3307 of file CFG.cpp.
References PopulateBlkExprMap(), and size().
Referenced by clang::StmtDeclBitVector_Types::AnalysisDataTy::getNumBlkExprs().
| unsigned clang::CFG::getNumBlockIDs | ( | ) | const [inline] |
getNumBlockIDs - Returns the total number of BlockIDs allocated (which start at 0).
Definition at line 748 of file CFG.h.
Referenced by CheckFallThrough(), clang::LiveVariables::computeLiveness(), clang::reachable_code::FindUnreachableCode(), clang::PostOrderCFGView::PostOrderCFGView(), and clang::runUninitializedVariablesAnalysis().
| bool clang::CFG::isBlkExpr | ( | const Stmt * | S | ) | [inline] |
Definition at line 739 of file CFG.h.
References getBlkExprNum().
Referenced by isBlkExpr(), and clang::StmtDeclBitVector_Types::AnalysisDataTy::isTracked().
| bool clang::CFG::isBlkExpr | ( | const Stmt * | S | ) | const [inline] |
Definition at line 740 of file CFG.h.
References isBlkExpr().
| graph_iterator clang::CFG::nodes_begin | ( | ) | [inline] |
Definition at line 679 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().
| const_graph_iterator clang::CFG::nodes_begin | ( | ) | const [inline] |
Definition at line 681 of file CFG.h.
References clang::BumpVector< T >::begin().
| graph_iterator clang::CFG::nodes_end | ( | ) | [inline] |
Definition at line 680 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().
| const_graph_iterator clang::CFG::nodes_end | ( | ) | const [inline] |
Definition at line 684 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 3826 of file CFG.cpp.
References clang::BumpVector< T >::begin(), clang::BumpVector< T >::end(), getEntry(), getExit(), and print_block().
Referenced by dump().
| reverse_iterator clang::CFG::rbegin | ( | ) | [inline] |
Definition at line 688 of file CFG.h.
References clang::BumpVector< T >::rbegin().
Referenced by DiagnoseSwitchLabelsFallthrough().
| const_reverse_iterator clang::CFG::rbegin | ( | ) | const [inline] |
Definition at line 690 of file CFG.h.
References clang::BumpVector< T >::rbegin().
| reverse_iterator clang::CFG::rend | ( | ) | [inline] |
Definition at line 689 of file CFG.h.
References clang::BumpVector< T >::rend().
Referenced by DiagnoseSwitchLabelsFallthrough().
| const_reverse_iterator clang::CFG::rend | ( | ) | const [inline] |
Definition at line 691 of file CFG.h.
References clang::BumpVector< T >::rend().
| void clang::CFG::setEntry | ( | CFGBlock * | B | ) | [inline] |
| void clang::CFG::setIndirectGotoBlock | ( | CFGBlock * | B | ) | [inline] |
| unsigned clang::CFG::size | ( | ) | const [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 753 of file CFG.h.
Referenced by getNumBlkExprs(), and llvm::GraphTraits< ::clang::CFG * >::size().
| try_block_iterator clang::CFG::try_blocks_begin | ( | ) | const [inline] |
Definition at line 702 of file CFG.h.
Referenced by clang::reachable_code::FindUnreachableCode().
| try_block_iterator clang::CFG::try_blocks_end | ( | ) | const [inline] |
Definition at line 705 of file CFG.h.
Referenced by clang::reachable_code::FindUnreachableCode().
| void CFG::viewCFG | ( | const LangOptions & | LO | ) | const |
Definition at line 3936 of file CFG.cpp.
References GraphHelper, and NULL.
| void clang::CFG::VisitBlockStmts | ( | CALLBACK & | O | ) | const [inline] |
Definition at line 718 of file CFG.h.
References begin(), end(), and clang::CFGElement::getAs().