|
Static Value-Flow Analysis
|
#include <SparseAbstractInterpretation.h>
Private Member Functions | |
| void | pullObjValueFlows (const ICFGNode *node) |
| bool | isIndirectSVFGEdgeFeasible (const IndirectSVFGEdge *edge, const VFGNode *dst) |
| bool | isICFGPathFeasible (const ICFGNode *src, const ICFGNode *dst) |
| bool | isIntraEdgeBranchFeasible (const IntraCFGEdge *edge, const ICFGNode *src) |
| Return whether this intra edge is allowed by the current branch state. | |
| void | propagateAndApplyRefinement (const ICFGNode *node) |
| void | buildSVFG () |
| Build the SVFG on top of the semi-sparse precompute. | |
Private Attributes | |
| Map< const ICFGNode *, Map< NodeID, IntervalValue > > | refinementTrace |
| std::unique_ptr< SVFGBuilder > | svfgBuilder |
| SVFG * | svfg {nullptr} |
| View pointer into svfgBuilder's graph; non-null after buildSVFG(). | |
Additional Inherited Members | |
Public Types inherited from SVF::AbstractInterpretation | |
| enum | AESparsity { Dense , SemiSparse , Sparse } |
| enum | HandleRecur { TOP , WIDEN_ONLY , WIDEN_NARROW } |
| enum | AEFunEntryMode { MAIN , NO_MAIN } |
Static Public Member Functions inherited from SVF::AbstractInterpretation | |
| static AbstractInterpretation & | getAEInstance () |
Protected Attributes inherited from SVF::AbstractInterpretation | |
| SVFIR * | svfir {nullptr} |
| Data and helpers reachable from SparseAbstractInterpretation. | |
| AEWTO * | preAnalysis {nullptr} |
| Map< const ICFGNode *, AbstractState > | abstractTrace |
| per-node trace; owned here | |
Abstract Interpretation for Options::AESparsity::Sparse (full-sparse).
In full-sparse mode both ValVars and ObjVars live at their SVFG def-sites; reads query the SVFG for the reaching-def site, writes happen at def-sites. See doc/plan-full-sparse.md for the phase plan; Phase 1 routes ValVar and ObjVar reads through the SVFG.
Definition at line 85 of file SparseAbstractInterpretation.h.
|
inline |
Definition at line 88 of file SparseAbstractInterpretation.h.
|
overridedefault |
|
private |
Build the SVFG on top of the semi-sparse precompute.
Definition at line 44 of file SparseAbstractInterpretation.cpp.
|
private |
Return whether a branch-feasible ICFG path exists from src to dst. Conditional edges are checked with a pure branch-feasibility query, so path probing does not create branch-refinement side effects.
Definition at line 363 of file SparseAbstractInterpretation.cpp.
|
private |
Return whether an indirect SVFG edge should be pulled into dst. Besides branch-feasible ICFG reachability, this rejects paths where another store to the same points-to object kills the edge's value.
Definition at line 253 of file SparseAbstractInterpretation.cpp.
|
private |
Return whether this intra edge is allowed by the current branch state.
Definition at line 462 of file SparseAbstractInterpretation.cpp.
|
overrideprotectedvirtual |
Full-sparse does not merge normal value-flow state along ICFG edges. The ICFG join carries only side-channel state that is not represented as MemorySSA def-use flow: GepObjVar field snapshots and _freedAddrs. Base/Dummy ObjVars are populated later by pullObjValueFlows from SVFG indirect in-edges; ValVars stay at their def-sites.
Reimplemented from SVF::AbstractInterpretation.
Definition at line 64 of file SparseAbstractInterpretation.cpp.
|
overrideprotectedvirtual |
Thin wrapper: defer to base for ICFG-edge bookkeeping (predecessor iteration, branch feasibility, joinStates, updateAbsState, reachability return). For reachable nodes, additionally run pullObjValueFlows to populate trace[node] with obj values from SVFG def-sites.
Reimplemented from SVF::AbstractInterpretation.
Definition at line 112 of file SparseAbstractInterpretation.cpp.
Compose pred-inherited refinement into refinementTrace[node] (single-pred linear copy / multi-pred intersect-JOIN; any pred without refinement drops the inheritance), then MEET the final refinementTrace[node] into trace[node]._addrToAbsVal so the inherited base getAbsValue(ObjVar*, node) returns the narrowed value directly — no read-time override or cache. Called once per merge as the last step.
Definition at line 502 of file SparseAbstractInterpretation.cpp.
SVFG-pull helper: walk each VFG node's indirect SVFG in-edges and pull obj values from upstream def-site traces into trace[node]. Multiple sources (e.g. mphi operands) JOIN.
Definition at line 128 of file SparseAbstractInterpretation.cpp.
|
overrideprotectedvirtual |
Capture branch narrowings into refinementTrace[succ] instead of writing them into the local as: in FullSparse as would be discarded by joinStates (no-op for ObjVar), so we route the narrowing to refinementTrace and let propagateAndApplyRefinement bake it into trace at the end of mergeStatesFromPredecessors.
Reimplemented from SVF::AbstractInterpretation.
Definition at line 483 of file SparseAbstractInterpretation.cpp.
|
overrideprotectedvirtual |
After a store overwrites an ObjVar, clear any branch refinement for that ObjVar at the store's node so stale branch constraints don't propagate past the redefinition.
Reimplemented from SVF::AbstractInterpretation.
Definition at line 90 of file SparseAbstractInterpretation.cpp.
|
private |
Path-refined obj values produced by branch narrowing. Each entry is the interval constraint (not effective value) so base trace can widen/narrow independently. Cached at branch successors by recordBranchRefinement; propagated and applied by propagateAndApplyRefinement at the end of mergeStatesFromPredecessors.
Definition at line 161 of file SparseAbstractInterpretation.h.
View pointer into svfgBuilder's graph; non-null after buildSVFG().
Definition at line 171 of file SparseAbstractInterpretation.h.
|
private |
Owns the SVFG (via SVFGBuilder's internal unique_ptr). Without this, SVFGBuilder would be a local in buildSVFG() and free the graph at scope exit, leaving svfg dangling.
Definition at line 169 of file SparseAbstractInterpretation.h.