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"
46 LLVM_DEPRECATED(
"Use the version that takes a const Decl & instead",
"")
58 const llvm::DenseMap<const Stmt *, const CFGBlock *> &
getStmtToBlock()
const {
71 llvm::DenseMap<const Stmt *, const CFGBlock *> StmtToBlock,
72 llvm::BitVector BlockReachable)
73 : ContainingDecl(D), Cfg(
std::move(Cfg)),
74 StmtToBlock(
std::move(StmtToBlock)),
75 BlockReachable(
std::move(BlockReachable)) {}
78 const Decl *ContainingDecl;
79 std::unique_ptr<CFG> Cfg;
80 llvm::DenseMap<const Stmt *, const CFGBlock *> StmtToBlock;
81 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.
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.
static llvm::Expected< ControlFlowContext > build(const FunctionDecl &Func, ASTContext &C)
Builds a ControlFlowContext from a FunctionDecl.
const llvm::DenseMap< const Stmt *, const CFGBlock * > & getStmtToBlock() const
Returns a mapping from statements to basic blocks that contain them.
@ C
Languages that the frontend can parse and compile.