14#ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_ADORNEDCFG_H
15#define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_ADORNEDCFG_H
21#include "llvm/ADT/BitVector.h"
22#include "llvm/ADT/DenseMap.h"
23#include "llvm/Support/Error.h"
52 const llvm::DenseMap<const Stmt *, const CFGBlock *> &
getStmtToBlock()
const {
70 return ContainsExprConsumedInDifferentBlock.contains(&B);
75 const Decl &D, std::unique_ptr<CFG> Cfg,
76 llvm::DenseMap<const Stmt *, const CFGBlock *> StmtToBlock,
77 llvm::BitVector BlockReachable,
79 : ContainingDecl(D), Cfg(
std::move(Cfg)),
80 StmtToBlock(
std::move(StmtToBlock)),
81 BlockReachable(
std::move(BlockReachable)),
82 ContainsExprConsumedInDifferentBlock(
83 std::move(ContainsExprConsumedInDifferentBlock)) {}
86 const Decl &ContainingDecl;
87 std::unique_ptr<CFG> Cfg;
88 llvm::DenseMap<const Stmt *, const CFGBlock *> StmtToBlock;
89 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 with additional information derived from it that is needed to perform dataflow analysis.
const CFG & getCFG() const
Returns the CFG that is stored in this context.
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....
const llvm::DenseMap< const Stmt *, const CFGBlock * > & getStmtToBlock() const
Returns a mapping from statements to basic blocks that contain them.
static llvm::Expected< AdornedCFG > build(const FunctionDecl &Func)
Builds an AdornedCFG from a FunctionDecl.
const Decl & getDecl() const
Returns the Decl containing the statement used to construct the CFG, if available.
The JSON file list parser is used to communicate input to InstallAPI.