clang 18.0.0git
|
Holds CFG and other derived context that is needed to perform dataflow analysis. More...
#include "clang/Analysis/FlowSensitive/ControlFlowContext.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. | |
Static Public Member Functions | |
static llvm::Expected< ControlFlowContext > | build (const FunctionDecl &Func) |
Builds a ControlFlowContext from a FunctionDecl . | |
static llvm::Expected< ControlFlowContext > | build (const Decl &D, Stmt &S, ASTContext &C) |
Builds a ControlFlowContext from an AST node. | |
Holds CFG and other derived context that is needed to perform dataflow analysis.
Definition at line 32 of file ControlFlowContext.h.
|
static |
Builds a ControlFlowContext from an AST node.
D
is the function in which S
resides. D.isTemplated()
must be false.
Definition at line 81 of file ControlFlowContext.cpp.
References clang::CFG::buildCFG(), clang::dataflow::buildStmtToBasicBlockMap(), clang::C, clang::dataflow::findReachableBlocks(), and clang::Decl::isTemplated().
|
static |
Builds a ControlFlowContext from a FunctionDecl
.
Func.hasBody()
must be true, and Func.isTemplated()
must be false.
Definition at line 71 of file ControlFlowContext.cpp.
References build(), clang::Decl::getASTContext(), clang::FunctionDecl::getBody(), and clang::FunctionDecl::hasBody().
Referenced by build(), clang::dataflow::diagnoseFunction(), and clang::dataflow::DataflowAnalysisContext::getControlFlowContext().
|
inline |
Returns the CFG that is stored in this context.
Definition at line 48 of file ControlFlowContext.h.
Referenced by clang::dataflow::runTypeErasedDataflowAnalysis().
|
inline |
Returns the Decl
containing the statement used to construct the CFG, if available.
Definition at line 45 of file ControlFlowContext.h.
|
inline |
Returns a mapping from statements to basic blocks that contain them.
Definition at line 51 of file ControlFlowContext.h.
Referenced by clang::dataflow::StmtToEnvMap::getEnvironment().
Returns whether B
is reachable from the entry block.
Definition at line 56 of file ControlFlowContext.h.
References clang::CFGBlock::getBlockID().
Referenced by clang::dataflow::StmtToEnvMap::getEnvironment().