3#ifndef INCLUDE_GRAPHS_SPARSEOBJGRAPH_H_
4#define INCLUDE_GRAPHS_SPARSEOBJGRAPH_H_
97 void dump(
const std::string& file);
105 typedef std::pair<const ICFGNode*, const IntraCFGEdge*>
NodeKey;
const NodeBS & getBases() const
Base Obj IDs routed over this edge; each base carries all its fields.
friend class SparseObjGraph
SparseObjEdge(SparseObjNode *source, SparseObjNode *target, const NodeBS *bases)
std::string toString() const
const std::vector< const Edge * > & getInputs(const ICFGNode *node) const
Return incoming edges at this ICFG location for client-side value flow.
void addSource(const ICFGNode *node, const NodeBS &bases)
bool isBranch(const ICFGNode *node) const
SparseObjGraph & operator=(const SparseObjGraph &)=delete
Map< const ICFGNode *, std::vector< const Edge * > > inputs
static const NodeBS & getEvents(const Map< const ICFGNode *, NodeBS > &eventsAt, const ICFGNode *node)
const PAG & getPAG() const
Map< NodeKey, Node * > nodes
std::pair< const ICFGNode *, const IntraCFGEdge * > NodeKey
Map< u64_t, std::vector< std::unique_ptr< NodeBS > > > labels
Interned labels, bucketed by hash.
SparseObjGraph(const SVFG &svfg, ICFG &icfg, PointerAnalysis &pta, const PAG &pag)
Construction uses static graphs and points-to results, not AE state.
void connectCallBypass(const CallICFGNode *call, const NodeBS &bases)
Route the bases that no callee returns from the call to its return site.
Map< const ICFGNode *, NodeBS > returnedGroups
Map< const ICFGNode *, Map< const FunObjVar *, NodeBS > > returnedGroupsByCallee
bool isControlBoundary(const ICFGNode *node) const
std::map< EdgeKey, NodeBS > routeLabels
Map< const ICFGNode *, NodeBS > doneSources
Worklist of connectFunction for the function being connected.
Node * getOrCreateNode(const ICFGNode *location, const IntraCFGEdge *branch)
void connectFunction(const FunObjVar *fun, const NodeBS &funBases, const Map< const ICFGNode *, NodeBS > &eventsAt)
Walk one function once, carrying base sets instead of one base.
void connectSegment(const FunObjVar *fun, const ICFGNode *source, const ICFGNode *start, const IntraCFGEdge *branch, const NodeBS &bases, const Map< const ICFGNode *, NodeBS > &eventsAt)
~SparseObjGraph() override
std::deque< const ICFGNode * > sourceWorklist
std::string toString() const
Describe the static nodes and edges as text, without AE values.
SparseObjGraph(const SparseObjGraph &)=delete
const NodeBS * intern(const NodeBS &bases)
Map< const ICFGNode *, NodeBS > pendingSources
void dump(const std::string &file)
Write a DOT graph to <file>.dot through GraphPrinter.
void addRoute(const NodeBS &bases, const ICFGNode *source, const ICFGNode *target, const IntraCFGEdge *branch)
std::pair< NodeKey, NodeKey > EdgeKey
const IntraCFGEdge * branch
const ICFGNode * location
std::string toString() const
SparseObjNode(NodeID id, const ICFGNode *location, const IntraCFGEdge *branch)
const ICFGNode * getICFGNode() const
GenericGraph< SparseObjNode, SparseObjEdge > GenericSparseObjGraphTy
GenericNode< SparseObjNode, SparseObjEdge > GenericSparseObjNodeTy
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map
GenericEdge< SparseObjNode > GenericSparseObjEdgeTy