14#ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_ADORNEDCFG_H
15#define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_ADORNEDCFG_H
22#include "llvm/ADT/BitVector.h"
23#include "llvm/ADT/DenseMap.h"
24#include "llvm/Support/Error.h"
41 llvm::DenseMap<const Stmt *, const CFGBlock *> StmtToBlock;
69 return StmtToBlock.
lookup(S);
86 return ContainsExprConsumedInDifferentBlock.contains(&B);
91 const Decl &
D, std::unique_ptr<CFG> Cfg,
93 llvm::DenseSet<const CFGBlock *> ContainsExprConsumedInDifferentBlock)
94 : ContainingDecl(
D), Cfg(
std::move(Cfg)),
95 StmtToBlock(
std::move(StmtToBlock)),
96 BlockReachable(
std::move(BlockReachable)),
97 ContainsExprConsumedInDifferentBlock(
98 std::move(ContainsExprConsumedInDifferentBlock)) {}
101 const Decl &ContainingDecl;
102 std::unique_ptr<CFG> Cfg;
103 internal::StmtToBlockMap StmtToBlock;
104 llvm::BitVector BlockReachable;
105 llvm::DenseSet<const CFGBlock *> ContainsExprConsumedInDifferentBlock;
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.
const CFGBlock * blockForStmt(const Stmt &S) const
Returns the basic block that contains S, or null if no basic block containing S is found.
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....
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.
const CFGBlock * lookup(const Stmt &S) const
const Expr & ignoreCFGOmittedNodes(const Expr &E)
Skip past nodes that the CFG does not emit.
The JSON file list parser is used to communicate input to InstallAPI.