|
clang
5.0.0
|
CFGBlock - Represents a single basic block in a source-level CFG. More...
#include "clang/Analysis/CFG.h"
Classes | |
| class | AdjacentBlock |
| This class represents a potential adjacent block in the CFG. More... | |
| class | FilteredCFGBlockIterator |
| class | FilterOptions |
Static Public Member Functions | |
| static bool | FilterEdge (const FilterOptions &F, const CFGBlock *Src, const CFGBlock *Dst) |
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:
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 |
| typedef llvm::iterator_range<const_pred_iterator> clang::CFGBlock::pred_const_range |
| typedef llvm::iterator_range<pred_iterator> clang::CFGBlock::pred_range |
| typedef llvm::iterator_range<const_succ_iterator> clang::CFGBlock::succ_const_range |
| typedef llvm::iterator_range<succ_iterator> clang::CFGBlock::succ_range |
|
inlineexplicit |
| void CFGBlock::addSuccessor | ( | AdjacentBlock | Succ, |
| BumpVectorContext & | C | ||
| ) |
Adds a (potentially unreachable) successor block to the current block.
Definition at line 4096 of file CFG.cpp.
References clang::CFGBlock::AdjacentBlock::getPossiblyUnreachableBlock(), clang::CFGBlock::AdjacentBlock::getReachableBlock(), clang::CFGBlock::AdjacentBlock::isReachable(), and clang::BumpVector< T >::push_back().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 527 of file CFG.h.
Referenced by neverReturns().
|
inline |
Definition at line 529 of file CFG.h.
Referenced by Accumulate(), clang::LiveVariables::computeLiveness(), print_block(), and runOnBlock().
|
inline |
|
inline |
|
inline |
| LLVM_DUMP_METHOD void CFGBlock::dump | ( | ) | const |
Definition at line 4694 of file CFG.cpp.
References getParent().
| void CFGBlock::dump | ( | const CFG * | cfg, |
| const LangOptions & | LO, | ||
| bool | ShowColors = false |
||
| ) | const |
|
inline |
Definition at line 540 of file CFG.h.
Referenced by DiagnoseSwitchLabelsFallthrough(), clang::ento::CoreEngine::ExecuteWorkList(), clang::BlockEntrance::getFirstElement(), neverReturns(), clang::ento::ExprEngine::processCallEnter(), and clang::ento::ExprEngine::VisitLogicalExpr().
|
inline |
Definition at line 530 of file CFG.h.
Referenced by Accumulate(), clang::LiveVariables::computeLiveness(), print_block(), and runOnBlock().
|
inline |
|
inline |
Definition at line 649 of file CFG.h.
References pred_begin(), and pred_end().
|
inline |
Definition at line 653 of file CFG.h.
References succ_begin(), and succ_end().
|
static |
Definition at line 4107 of file CFG.cpp.
References getLabel(), clang::CFGTerminator::getStmt(), getTerminator(), clang::CFGBlock::FilterOptions::IgnoreDefaultsWithCoveredEnums, and clang::CFGBlock::FilterOptions::IgnoreNullPredecessors.
|
inline |
Definition at line 526 of file CFG.h.
Referenced by clang::BlockEntrance::getFirstElement().
|
inline |
Definition at line 680 of file CFG.h.
Referenced by clang::consumed::ConsumedBlockInfo::addInfo(), clang::consumed::ConsumedBlockInfo::allBackEdgesVisited(), clang::PostOrderCFGView::CFGBlockSet::alreadySet(), clang::ento::NodeBuilderContext::blockCount(), clang::consumed::ConsumedBlockInfo::borrowInfo(), CheckFallThrough(), checkForRecursiveFunctionCall(), clang::LiveVariables::computeLiveness(), clang::consumed::ConsumedBlockInfo::discardInfo(), clang::ento::CoreEngine::ExecuteWorkList(), clang::reachable_code::FindUnreachableCode(), clang::ento::CheckerContext::getBlockID(), clang::consumed::ConsumedBlockInfo::getInfo(), llvm::DOTGraphTraits< ExplodedNode * >::getNodeLabel(), hasThrowOutNonThrowingFunc(), clang::PostOrderCFGView::CFGBlockSet::insert(), clang::consumed::ConsumedBlockInfo::isBackEdge(), clang::consumed::ConsumedBlockInfo::isBackEdgeTarget(), clang::CFGReverseBlockReachabilityAnalysis::isReachable(), clang::threadSafety::SExprBuilder::lookupBlock(), print_block(), printAsOperand(), runOnBlock(), clang::runUninitializedVariablesAnalysis(), and scanFromBlock().
|
inline |
Definition at line 675 of file CFG.h.
Referenced by Accumulate(), DiagnoseSwitchLabelsFallthrough(), FilterEdge(), GenerateMinimalPathDiagnostic(), llvm::DOTGraphTraits< ExplodedNode * >::getNodeLabel(), and print_block().
|
inline |
|
inline |
Definition at line 664 of file CFG.h.
Referenced by Accumulate(), CheckFallThrough(), DiagnoseSwitchLabelsFallthrough(), FilterEdge(), GenerateAlternateExtensivePathDiagnostic(), GenerateExtensivePathDiagnostic(), GenerateMinimalPathDiagnostic(), getLastStmtLoc(), llvm::DOTGraphTraits< ExplodedNode * >::getNodeLabel(), clang::ento::SwitchNodeBuilder::getSwitch(), clang::BlockExit::getTerminator(), isDeadReturn(), isTrivialDoWhile(), peelOffOuterExpr(), print_block(), printTerminator(), clang::ento::ExprEngine::processCFGBlockEntrance(), ResolveCondition(), shouldTreatSuccessorsAsReachable(), clang::ento::ExprEngine::VisitLogicalExpr(), clang::ento::SuppressInlineDefensiveChecksVisitor::VisitNode(), and clang::ento::ConditionBRVisitor::VisitNodeImpl().
|
inline |
Definition at line 4714 of file CFG.cpp.
References E, clang::Stmt::getStmtClass(), and clang::Expr::IgnoreParens().
Referenced by clang::ento::PathDiagnosticLocation::create(), GenerateExtensivePathDiagnostic(), getTerminatorCondition(), getTerminatorCondition(), and shouldTreatSuccessorsAsReachable().
Definition at line 669 of file CFG.h.
References getTerminatorCondition().
|
inline |
Definition at line 678 of file CFG.h.
Referenced by CheckFallThrough(), neverReturns(), and print_block().
|
inline |
|
inline |
Definition at line 559 of file CFG.h.
References clang::BumpVector< T >::begin().
Referenced by clang::consumed::ConsumedBlockInfo::allBackEdgesVisited(), llvm::GraphTraits< Inverse< ::clang::CFGBlock * > >::child_begin(), filtered_pred_start_end(), getLastStmtLoc(), clang::consumed::ConsumedBlockInfo::isBackEdgeTarget(), preds(), print_block(), and runOnBlock().
|
inline |
Definition at line 561 of file CFG.h.
References clang::BumpVector< T >::begin().
|
inline |
Definition at line 597 of file CFG.h.
References clang::BumpVector< T >::empty().
Referenced by checkRecursiveFunction(), checkThrowInNonThrowingFunc(), and print_block().
|
inline |
Definition at line 560 of file CFG.h.
References clang::BumpVector< T >::end().
Referenced by clang::consumed::ConsumedBlockInfo::allBackEdgesVisited(), llvm::GraphTraits< Inverse< ::clang::CFGBlock * > >::child_end(), filtered_pred_start_end(), clang::consumed::ConsumedBlockInfo::isBackEdgeTarget(), preds(), print_block(), and runOnBlock().
|
inline |
Definition at line 562 of file CFG.h.
References clang::BumpVector< T >::end().
|
inline |
Definition at line 564 of file CFG.h.
References clang::BumpVector< T >::rbegin().
|
inline |
Definition at line 566 of file CFG.h.
References clang::BumpVector< T >::rbegin().
|
inline |
Definition at line 565 of file CFG.h.
References clang::BumpVector< T >::rend().
|
inline |
Definition at line 567 of file CFG.h.
References clang::BumpVector< T >::rend().
|
inline |
Definition at line 596 of file CFG.h.
References clang::BumpVector< T >::size().
Referenced by getLastStmtLoc(), clang::consumed::ConsumedBlockInfo::isBackEdgeTarget(), isDeadReturn(), and print_block().
|
inline |
Definition at line 569 of file CFG.h.
References pred_begin(), and pred_end().
|
inline |
Definition at line 572 of file CFG.h.
References pred_begin(), and pred_end().
| 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 4700 of file CFG.cpp.
References print_block().
Referenced by dump(), and clang::CFG::dump().
|
inline |
Definition at line 690 of file CFG.h.
References getBlockID().
| void CFGBlock::printTerminator | ( | raw_ostream & | OS, |
| const LangOptions & | LO | ||
| ) | const |
printTerminator - A simple pretty printer of the terminator of a CFGBlock.
Definition at line 4708 of file CFG.cpp.
References getTerminator().
Referenced by llvm::DOTGraphTraits< ExplodedNode * >::getNodeLabel().
|
inline |
Definition at line 534 of file CFG.h.
Referenced by CheckFallThrough(), getLastStmtLoc(), isDeadReturn(), ResolveCondition(), and clang::ento::ExprEngine::VisitLogicalExpr().
|
inline |
|
inline |
Definition at line 535 of file CFG.h.
Referenced by CheckFallThrough(), getLastStmtLoc(), isDeadReturn(), and ResolveCondition().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 576 of file CFG.h.
References clang::BumpVector< T >::begin().
Referenced by clang::ento::IndirectGotoNodeBuilder::begin(), CheckFallThrough(), checkForRecursiveFunctionCall(), llvm::GraphTraits< ::clang::CFGBlock * >::child_begin(), clang::LiveVariables::computeLiveness(), DiagnoseSwitchLabelsFallthrough(), clang::ento::CoreEngine::ExecuteWorkList(), filtered_succ_start_end(), GenerateMinimalPathDiagnostic(), getLastStmtLoc(), llvm::DOTGraphTraits< ExplodedNode * >::getNodeLabel(), isDeadReturn(), isJumpToFalseBranch(), peelOffOuterExpr(), print_block(), clang::ento::ExprEngine::processCallEnter(), scanFromBlock(), succs(), clang::ento::ExprEngine::VisitLogicalExpr(), and clang::ento::ConditionBRVisitor::VisitTerminator().
|
inline |
Definition at line 578 of file CFG.h.
References clang::BumpVector< T >::begin().
|
inline |
Definition at line 594 of file CFG.h.
References clang::BumpVector< T >::empty().
Referenced by print_block().
|
inline |
Definition at line 577 of file CFG.h.
References clang::BumpVector< T >::end().
Referenced by CheckFallThrough(), checkForRecursiveFunctionCall(), llvm::GraphTraits< ::clang::CFGBlock * >::child_end(), clang::LiveVariables::computeLiveness(), clang::ento::IndirectGotoNodeBuilder::end(), filtered_succ_start_end(), print_block(), scanFromBlock(), and succs().
|
inline |
Definition at line 579 of file CFG.h.
References clang::BumpVector< T >::end().
|
inline |
Definition at line 581 of file CFG.h.
References clang::BumpVector< T >::rbegin().
Referenced by clang::ento::SwitchNodeBuilder::begin(), and clang::ento::SwitchNodeBuilder::generateDefaultCaseNode().
|
inline |
Definition at line 583 of file CFG.h.
References clang::BumpVector< T >::rbegin().
|
inline |
Definition at line 582 of file CFG.h.
References clang::BumpVector< T >::rend().
Referenced by clang::ento::SwitchNodeBuilder::end().
|
inline |
Definition at line 584 of file CFG.h.
References clang::BumpVector< T >::rend().
|
inline |
Definition at line 593 of file CFG.h.
References clang::BumpVector< T >::size().
Referenced by DiagnoseSwitchLabelsFallthrough(), clang::ento::CoreEngine::ExecuteWorkList(), getLastStmtLoc(), isDeadReturn(), isJumpToFalseBranch(), print_block(), clang::ento::ExprEngine::processCallEnter(), clang::ento::ExprEngine::VisitLogicalExpr(), and clang::ento::ConditionBRVisitor::VisitTerminator().
|
inline |
Definition at line 586 of file CFG.h.
References succ_begin(), and succ_end().
Referenced by hasThrowOutNonThrowingFunc().
|
inline |
Definition at line 589 of file CFG.h.
References succ_begin(), and succ_end().
1.8.6