clang 19.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 llvm::DenseMap< const Stmt *, const CFGBlock * > & | getStmtToBlock () const |
Returns a mapping from statements to basic blocks that contain them. | |
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 32 of file AdornedCFG.h.
|
static |
Builds an AdornedCFG
from an AST node.
D
is the function in which S
resides. D.isTemplated()
must be false.
Definition at line 138 of file AdornedCFG.cpp.
References clang::dataflow::buildContainsExprConsumedInDifferentBlock(), clang::dataflow::buildStmtToBasicBlockMap(), clang::dataflow::findReachableBlocks(), and clang::Decl::isTemplated().
|
static |
Builds an AdornedCFG
from a FunctionDecl
.
Func.doesThisDeclarationHaveABody()
must be true, and Func.isTemplated()
must be false.
Definition at line 129 of file AdornedCFG.cpp.
References clang::Func.
Referenced by clang::dataflow::diagnoseFunction().
|
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 69 of file AdornedCFG.h.
|
inline |
Returns the CFG that is stored in this context.
Definition at line 49 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 46 of file AdornedCFG.h.
|
inline |
Returns a mapping from statements to basic blocks that contain them.
Definition at line 52 of file AdornedCFG.h.
Referenced by clang::dataflow::StmtToEnvMap::getEnvironment().
Returns whether B
is reachable from the entry block.
Definition at line 57 of file AdornedCFG.h.
References clang::CFGBlock::getBlockID().
Referenced by clang::dataflow::StmtToEnvMap::getEnvironment().