clang 22.0.0git
|
Holds CFG with additional information derived from it that is needed to perform dataflow analysis. More...
#include "clang/Analysis/FlowSensitive/AdornedCFG.h"
Public Member Functions | |
const Decl & | getDecl () const |
Returns the Decl containing the statement used to construct the CFG, if available. | |
const CFG & | getCFG () const |
Returns the CFG that is stored in this context. | |
const CFGBlock * | blockForStmt (const Stmt &S) const |
Returns the basic block that contains S, or null if no basic block containing S is found. | |
bool | isBlockReachable (const CFGBlock &B) const |
Returns whether B is reachable from the entry block. | |
bool | containsExprConsumedInDifferentBlock (const CFGBlock &B) const |
Returns whether B contains an expression that is consumed in a different block than B (i.e. |
Static Public Member Functions | |
static llvm::Expected< AdornedCFG > | build (const FunctionDecl &Func) |
Builds an AdornedCFG from a FunctionDecl. | |
static llvm::Expected< AdornedCFG > | build (const Decl &D, Stmt &S, ASTContext &C) |
Builds an AdornedCFG from an AST node. |
Holds CFG with additional information derived from it that is needed to perform dataflow analysis.
Definition at line 47 of file AdornedCFG.h.
Returns the basic block that contains S, or null if no basic block containing S is found.
Definition at line 68 of file AdornedCFG.h.
Referenced by clang::dataflow::computeBlockInputState().
|
static |
Builds an AdornedCFG from an AST node.
D is the function in which S resides. D.isTemplated() must be false.
Definition at line 144 of file AdornedCFG.cpp.
References clang::CFG::BuildOptions::AddCXXDefaultInitExprInCtors, clang::CFG::BuildOptions::AddImplicitDtors, clang::CFG::BuildOptions::AddInitializers, clang::CFG::BuildOptions::AddLifetime, clang::CFG::BuildOptions::AddTemporaryDtors, clang::CFG::buildCFG(), clang::dataflow::buildContainsExprConsumedInDifferentBlock(), clang::C, clang::dataflow::findReachableBlocks(), clang::Decl::isTemplated(), clang::CFG::BuildOptions::PruneTriviallyFalseEdges, and clang::CFG::BuildOptions::setAllAlwaysAdd().
|
static |
Builds an AdornedCFG from a FunctionDecl.
Func.doesThisDeclarationHaveABody() must be true, and Func.isTemplated() must be false.
Definition at line 135 of file AdornedCFG.cpp.
References build(), and clang::Func.
Referenced by build(), clang::dataflow::diagnoseFunction(), and clang::dataflow::DataflowAnalysisContext::getAdornedCFG().
|
inline |
Returns whether B contains an expression that is consumed in a different block than B (i.e.
the parent of the expression is in a different block). This happens if there is control flow within a full-expression (triggered by &&, ||, or the conditional operator). Note that the operands of these operators are not the only expressions that can be consumed in a different block. For example, in the function call f(&i, cond() ? 1 : 0), &i is in a different block than the CallExpr.
Definition at line 85 of file AdornedCFG.h.
Referenced by clang::dataflow::computeBlockInputState().
|
inline |
Returns the CFG that is stored in this context.
Definition at line 64 of file AdornedCFG.h.
Referenced by clang::dataflow::runTypeErasedDataflowAnalysis().
|
inline |
Returns the Decl containing the statement used to construct the CFG, if available.
Definition at line 61 of file AdornedCFG.h.
Returns whether B is reachable from the entry block.
Definition at line 73 of file AdornedCFG.h.
References clang::CFGBlock::getBlockID().