14#ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_CONTROLFLOWCONTEXT_H
15#define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_CONTROLFLOWCONTEXT_H
21#include "llvm/ADT/BitVector.h"
22#include "llvm/ADT/DenseMap.h"
23#include "llvm/Support/Error.h"
51 const llvm::DenseMap<const Stmt *, const CFGBlock *> &
getStmtToBlock()
const {
62 llvm::DenseMap<const Stmt *, const CFGBlock *> StmtToBlock,
63 llvm::BitVector BlockReachable)
64 : ContainingDecl(D), Cfg(
std::move(Cfg)),
65 StmtToBlock(
std::move(StmtToBlock)),
66 BlockReachable(
std::move(BlockReachable)) {}
69 const Decl &ContainingDecl;
70 std::unique_ptr<CFG> Cfg;
71 llvm::DenseMap<const Stmt *, const CFGBlock *> StmtToBlock;
72 llvm::BitVector BlockReachable;
Defines the clang::ASTContext interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Represents a single basic block in a source-level CFG.
unsigned getBlockID() const
Represents a source-level, intra-procedural CFG that represents the control-flow of a Stmt.
Decl - This represents one declaration (or definition), e.g.
Represents a function declaration or definition.
Stmt - This represents one statement.
Holds CFG and other derived context that is needed to perform dataflow analysis.
bool isBlockReachable(const CFGBlock &B) const
Returns whether B is reachable from the entry block.
static llvm::Expected< ControlFlowContext > build(const FunctionDecl &Func)
Builds a ControlFlowContext from a FunctionDecl.
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.