clang API Documentation
#include <CFG.h>
CFGBlock - Represents a single basic block in a source-level CFG. It consists of:
(1) A set of statements/expressions (which may contain subexpressions). (2) A "terminator" statement (not in the set of statements). (3) A list of successors and predecessors.
Terminator: The terminator represents the type of control-flow that occurs at the end of the basic block. The terminator is a Stmt* referring to an AST node that has control-flow: if-statements, breaks, loops, etc. If the control-flow is conditional, the condition expression will appear within the set of statements in the block (usually the last statement).
Predecessors: the order in the set of predecessors is arbitrary.
Successors: the order in the set of successors is NOT arbitrary. We currently have the following orderings based on the terminator:
Terminator Successor Ordering ----------------------------------------------------- if Then Block; Else Block ? operator LHS expression; RHS expression &&, || expression that uses result of && or ||, RHS
But note that any of that may be NULL in case of optimized-out edges.
| typedef ElementList::const_iterator clang::CFGBlock::const_iterator |
| typedef ElementList::iterator clang::CFGBlock::iterator |
| clang::CFGBlock::CFGBlock | ( | unsigned | blockid, |
| BumpVectorContext & | C, | ||
| CFG * | parent | ||
| ) | [inline, explicit] |
| void clang::CFGBlock::addSuccessor | ( | CFGBlock * | Block, |
| BumpVectorContext & | C | ||
| ) | [inline] |
Definition at line 504 of file CFG.h.
References clang::BumpVector< T >::push_back().
| void clang::CFGBlock::appendAutomaticObjDtor | ( | VarDecl * | VD, |
| Stmt * | S, | ||
| BumpVectorContext & | C | ||
| ) | [inline] |
| void clang::CFGBlock::appendBaseDtor | ( | const CXXBaseSpecifier * | BS, |
| BumpVectorContext & | C | ||
| ) | [inline] |
| void clang::CFGBlock::appendInitializer | ( | CXXCtorInitializer * | initializer, |
| BumpVectorContext & | C | ||
| ) | [inline] |
| void clang::CFGBlock::appendMemberDtor | ( | FieldDecl * | FD, |
| BumpVectorContext & | C | ||
| ) | [inline] |
| void clang::CFGBlock::appendStmt | ( | Stmt * | statement, |
| BumpVectorContext & | C | ||
| ) | [inline] |
| void clang::CFGBlock::appendTemporaryDtor | ( | CXXBindTemporaryExpr * | E, |
| BumpVectorContext & | C | ||
| ) | [inline] |
| CFGElement clang::CFGBlock::back | ( | ) | const [inline] |
| iterator clang::CFGBlock::begin | ( | ) | [inline] |
Definition at line 367 of file CFG.h.
Referenced by Accumulate(), clang::LiveVariables::computeLiveness(), print_block(), runOnBlock(), and clang::dataflow::ItrTraits< forward_analysis_tag >::StmtBegin().
| const_iterator clang::CFGBlock::begin | ( | ) | const [inline] |
| iterator clang::CFGBlock::beginAutomaticObjDtorsInsert | ( | iterator | I, |
| size_t | Cnt, | ||
| BumpVectorContext & | C | ||
| ) | [inline] |
| void CFGBlock::dump | ( | const CFG * | cfg, |
| const LangOptions & | LO, | ||
| bool | ShowColors = false |
||
| ) | const |
| bool clang::CFGBlock::empty | ( | ) | const [inline] |
Definition at line 378 of file CFG.h.
Referenced by clang::BlockEntrance::getFirstElement(), getLogicalOperatorInChain(), and clang::ento::SubEngine::processCallEnter().
| iterator clang::CFGBlock::end | ( | ) | [inline] |
Definition at line 368 of file CFG.h.
Referenced by Accumulate(), clang::LiveVariables::computeLiveness(), print_block(), runOnBlock(), and clang::dataflow::ItrTraits< forward_analysis_tag >::StmtEnd().
| const_iterator clang::CFGBlock::end | ( | ) | const [inline] |
| filtered_pred_iterator clang::CFGBlock::filtered_pred_start_end | ( | const FilterOptions & | f | ) | const [inline] |
Definition at line 464 of file CFG.h.
References pred_begin(), and pred_end().
Referenced by CheckFallThrough().
| filtered_succ_iterator clang::CFGBlock::filtered_succ_start_end | ( | const FilterOptions & | f | ) | const [inline] |
Definition at line 468 of file CFG.h.
References succ_begin(), and succ_end().
| bool CFGBlock::FilterEdge | ( | const FilterOptions & | F, |
| const CFGBlock * | Src, | ||
| const CFGBlock * | Dst | ||
| ) | [static] |
Definition at line 3321 of file CFG.cpp.
References getLabel(), clang::CFGTerminator::getStmt(), getTerminator(), and clang::CFGBlock::FilterOptions::IgnoreDefaultsWithCoveredEnums.
| CFGElement clang::CFGBlock::front | ( | ) | const [inline] |
Definition at line 364 of file CFG.h.
Referenced by clang::BlockEntrance::getFirstElement(), and getLogicalOperatorInChain().
| unsigned clang::CFGBlock::getBlockID | ( | ) | const [inline] |
Definition at line 495 of file CFG.h.
Referenced by clang::PostOrderCFGView::CFGBlockSet::alreadySet(), CheckFallThrough(), compare_entries(), clang::LiveVariables::computeLiveness(), clang::reachable_code::FindUnreachableCode(), clang::ento::NodeBuilderContext::getCurrentBlockCount(), llvm::DOTGraphTraits< ExplodedNode * >::getNodeLabel(), clang::PostOrderCFGView::CFGBlockSet::insert(), clang::CFGReverseBlockReachabilityAnalysis::isReachable(), print_block(), runOnBlock(), clang::runUninitializedVariablesAnalysis(), clang::reachable_code::ScanReachableFromBlock(), and clang::WriteAsOperand().
| Stmt* clang::CFGBlock::getLabel | ( | ) | [inline] |
Definition at line 490 of file CFG.h.
Referenced by Accumulate(), DiagnoseSwitchLabelsFallthrough(), FilterEdge(), GenerateMinimalPathDiagnostic(), llvm::DOTGraphTraits< ExplodedNode * >::getNodeLabel(), and print_block().
| CFGTerminator clang::CFGBlock::getTerminator | ( | ) | [inline] |
Definition at line 479 of file CFG.h.
Referenced by Accumulate(), CheckFallThrough(), FilterEdge(), GenerateExtensivePathDiagnostic(), GenerateMinimalPathDiagnostic(), llvm::DOTGraphTraits< ExplodedNode * >::getNodeLabel(), clang::ento::SwitchNodeBuilder::getSwitch(), clang::BlockExit::getTerminator(), print_block(), printTerminator(), and clang::ento::ConditionBRVisitor::VisitNodeImpl().
| const CFGTerminator clang::CFGBlock::getTerminator | ( | ) | const [inline] |
| Stmt * CFGBlock::getTerminatorCondition | ( | ) |
Definition at line 3869 of file CFG.cpp.
References clang::Stmt::getStmtClass(), clang::Expr::IgnoreParens(), and NULL.
Referenced by clang::ento::PathDiagnosticLocation::create(), getLogicalOperatorInChain(), and getTerminatorCondition().
| const Stmt* clang::CFGBlock::getTerminatorCondition | ( | ) | const [inline] |
Definition at line 484 of file CFG.h.
References getTerminatorCondition().
| bool clang::CFGBlock::hasNoReturnElement | ( | ) | const [inline] |
Definition at line 493 of file CFG.h.
Referenced by CheckFallThrough().
| CFGElement clang::CFGBlock::operator[] | ( | size_t | i | ) | const [inline] |
| pred_iterator clang::CFGBlock::pred_begin | ( | ) | [inline] |
Definition at line 393 of file CFG.h.
References clang::BumpVector< T >::begin().
Referenced by CheckFallThrough(), llvm::GraphTraits< Inverse< ::clang::CFGBlock * > >::child_begin(), llvm::GraphTraits< Inverse< const ::clang::CFGBlock * > >::child_begin(), filtered_pred_start_end(), getLastStmt(), clang::dataflow::ItrTraits< backward_analysis_tag >::NextBegin(), clang::dataflow::ItrTraits< forward_analysis_tag >::PrevBegin(), print_block(), and runOnBlock().
| const_pred_iterator clang::CFGBlock::pred_begin | ( | ) | const [inline] |
Definition at line 395 of file CFG.h.
References clang::BumpVector< T >::begin().
| bool clang::CFGBlock::pred_empty | ( | ) | const [inline] |
Definition at line 417 of file CFG.h.
References clang::BumpVector< T >::empty().
Referenced by print_block().
| pred_iterator clang::CFGBlock::pred_end | ( | ) | [inline] |
Definition at line 394 of file CFG.h.
References clang::BumpVector< T >::end().
Referenced by CheckFallThrough(), llvm::GraphTraits< Inverse< ::clang::CFGBlock * > >::child_end(), llvm::GraphTraits< Inverse< const ::clang::CFGBlock * > >::child_end(), filtered_pred_start_end(), clang::dataflow::ItrTraits< backward_analysis_tag >::NextEnd(), clang::dataflow::ItrTraits< forward_analysis_tag >::PrevEnd(), print_block(), and runOnBlock().
| const_pred_iterator clang::CFGBlock::pred_end | ( | ) | const [inline] |
Definition at line 396 of file CFG.h.
References clang::BumpVector< T >::end().
| pred_reverse_iterator clang::CFGBlock::pred_rbegin | ( | ) | [inline] |
Definition at line 398 of file CFG.h.
References clang::BumpVector< T >::rbegin().
| const_pred_reverse_iterator clang::CFGBlock::pred_rbegin | ( | ) | const [inline] |
Definition at line 400 of file CFG.h.
References clang::BumpVector< T >::rbegin().
| pred_reverse_iterator clang::CFGBlock::pred_rend | ( | ) | [inline] |
Definition at line 399 of file CFG.h.
References clang::BumpVector< T >::rend().
| const_pred_reverse_iterator clang::CFGBlock::pred_rend | ( | ) | const [inline] |
Definition at line 401 of file CFG.h.
References clang::BumpVector< T >::rend().
| unsigned clang::CFGBlock::pred_size | ( | ) | const [inline] |
Definition at line 416 of file CFG.h.
References clang::BumpVector< T >::size().
Referenced by getLogicalOperatorInChain(), and print_block().
| void CFGBlock::print | ( | raw_ostream & | OS, |
| const CFG * | cfg, | ||
| const LangOptions & | LO, | ||
| bool | ShowColors | ||
| ) | const |
print - A simple pretty printer of a CFGBlock that outputs to an ostream. Generally this will only be called from CFG::print.
Definition at line 3855 of file CFG.cpp.
References print_block().
Referenced by dump().
| void CFGBlock::printTerminator | ( | raw_ostream & | OS, |
| const LangOptions & | LO | ||
| ) | const |
printTerminator - A simple pretty printer of the terminator of a CFGBlock.
Definition at line 3863 of file CFG.cpp.
References getTerminator(), and NULL.
Referenced by llvm::DOTGraphTraits< ExplodedNode * >::getNodeLabel().
| reverse_iterator clang::CFGBlock::rbegin | ( | ) | [inline] |
Definition at line 372 of file CFG.h.
Referenced by CheckFallThrough(), and clang::dataflow::ItrTraits< backward_analysis_tag >::StmtBegin().
| const_reverse_iterator clang::CFGBlock::rbegin | ( | ) | const [inline] |
| reverse_iterator clang::CFGBlock::rend | ( | ) | [inline] |
Definition at line 373 of file CFG.h.
Referenced by CheckFallThrough(), and clang::dataflow::ItrTraits< backward_analysis_tag >::StmtEnd().
| const_reverse_iterator clang::CFGBlock::rend | ( | ) | const [inline] |
| void clang::CFGBlock::setLoopTarget | ( | const Stmt * | loopTarget | ) | [inline] |
| void clang::CFGBlock::setTerminator | ( | Stmt * | Statement | ) | [inline] |
| unsigned clang::CFGBlock::size | ( | ) | const [inline] |
Definition at line 377 of file CFG.h.
Referenced by getLogicalOperatorInChain().
| succ_iterator clang::CFGBlock::succ_begin | ( | ) | [inline] |
Definition at line 403 of file CFG.h.
References clang::BumpVector< T >::begin().
Referenced by clang::ento::IndirectGotoNodeBuilder::begin(), CheckFallThrough(), llvm::GraphTraits< ::clang::CFGBlock * >::child_begin(), llvm::GraphTraits< const ::clang::CFGBlock * >::child_begin(), clang::LiveVariables::computeLiveness(), filtered_succ_start_end(), GenerateMinimalPathDiagnostic(), llvm::DOTGraphTraits< ExplodedNode * >::getNodeLabel(), clang::dataflow::ItrTraits< forward_analysis_tag >::NextBegin(), clang::dataflow::ItrTraits< backward_analysis_tag >::PrevBegin(), print_block(), clang::ento::SubEngine::processCallEnter(), clang::runUninitializedVariablesAnalysis(), clang::reachable_code::ScanReachableFromBlock(), and clang::ento::ConditionBRVisitor::VisitTerminator().
| const_succ_iterator clang::CFGBlock::succ_begin | ( | ) | const [inline] |
Definition at line 405 of file CFG.h.
References clang::BumpVector< T >::begin().
| bool clang::CFGBlock::succ_empty | ( | ) | const [inline] |
Definition at line 414 of file CFG.h.
References clang::BumpVector< T >::empty().
Referenced by print_block().
| succ_iterator clang::CFGBlock::succ_end | ( | ) | [inline] |
Definition at line 404 of file CFG.h.
References clang::BumpVector< T >::end().
Referenced by CheckFallThrough(), llvm::GraphTraits< ::clang::CFGBlock * >::child_end(), llvm::GraphTraits< const ::clang::CFGBlock * >::child_end(), clang::LiveVariables::computeLiveness(), clang::ento::IndirectGotoNodeBuilder::end(), filtered_succ_start_end(), clang::dataflow::ItrTraits< forward_analysis_tag >::NextEnd(), clang::dataflow::ItrTraits< backward_analysis_tag >::PrevEnd(), print_block(), clang::runUninitializedVariablesAnalysis(), and clang::reachable_code::ScanReachableFromBlock().
| const_succ_iterator clang::CFGBlock::succ_end | ( | ) | const [inline] |
Definition at line 406 of file CFG.h.
References clang::BumpVector< T >::end().
| succ_reverse_iterator clang::CFGBlock::succ_rbegin | ( | ) | [inline] |
Definition at line 408 of file CFG.h.
References clang::BumpVector< T >::rbegin().
Referenced by clang::ento::SwitchNodeBuilder::begin(), and clang::ento::SwitchNodeBuilder::generateDefaultCaseNode().
| const_succ_reverse_iterator clang::CFGBlock::succ_rbegin | ( | ) | const [inline] |
Definition at line 410 of file CFG.h.
References clang::BumpVector< T >::rbegin().
| succ_reverse_iterator clang::CFGBlock::succ_rend | ( | ) | [inline] |
Definition at line 409 of file CFG.h.
References clang::BumpVector< T >::rend().
Referenced by clang::ento::SwitchNodeBuilder::end().
| const_succ_reverse_iterator clang::CFGBlock::succ_rend | ( | ) | const [inline] |
Definition at line 411 of file CFG.h.
References clang::BumpVector< T >::rend().
| unsigned clang::CFGBlock::succ_size | ( | ) | const [inline] |
Definition at line 413 of file CFG.h.
References clang::BumpVector< T >::size().
Referenced by getLogicalOperatorInChain(), print_block(), clang::ento::SubEngine::processCallEnter(), and clang::ento::ConditionBRVisitor::VisitTerminator().