|
Static Value-Flow Analysis
|
#include <SparseAbstractInterpretation.h>
Public Member Functions | |
| SemiSparseAbstractInterpretation () | |
| ~SemiSparseAbstractInterpretation () override=default | |
| Public Member Functions inherited from SVF::AbstractInterpretation | |
| virtual void | runOnModule () |
| virtual | ~AbstractInterpretation () |
| Destructor. | |
| void | analyse () |
| Program entry. | |
| void | analyzeFromAllProgEntries () |
| Analyze all entry points (functions without callers). | |
| FIFOWorkList< const FunObjVar * > | collectProgEntryFuns () |
| Get all entry point functions (functions without callers). | |
| void | addDetector (std::unique_ptr< AEDetector > detector) |
| const SVFVar * | getSVFVar (NodeID varId) const |
| Retrieve SVFVar given its ID; asserts if no such variable exists. | |
| AbstractState & | getAbsState (const ICFGNode *node) |
| bool | hasAbsState (const ICFGNode *node) |
| void | getAbsState (const Set< const ValVar * > &vars, AbstractState &result, const ICFGNode *node) |
| void | getAbsState (const Set< const ObjVar * > &vars, AbstractState &result, const ICFGNode *node) |
| void | getAbsState (const Set< const SVFVar * > &vars, AbstractState &result, const ICFGNode *node) |
| IntervalValue | getGepElementIndex (const GepStmt *gep) |
| IntervalValue | getGepByteOffset (const GepStmt *gep) |
| AddressValue | getGepObjAddrs (const ValVar *pointer, IntervalValue offset) |
| virtual AbstractValue | loadValue (const ValVar *pointer, const ICFGNode *node) |
| Read memory through the pointer's address targets. | |
| virtual void | storeValue (const ValVar *pointer, const AbstractValue &val, const ICFGNode *node) |
| const SVFType * | getPointeeElement (const ObjVar *var, const ICFGNode *node) |
| AllocationSizeBounds | getAllocaInstByteSize (const AddrStmt *addr) |
| Map< const ICFGNode *, AbstractState > & | getTrace () |
| AbstractState & | operator[] (const ICFGNode *node) |
Protected Member Functions | |
| AbstractState | getFullCycleHeadState (const ICFGCycleWTO *cycle) override |
| bool | widenCycleState (const AbstractState &prev, const AbstractState &cur, const ICFGCycleWTO *cycle) override |
| bool | narrowCycleState (const AbstractState &prev, const AbstractState &cur, const ICFGCycleWTO *cycle) override |
| const AbstractValue & | getAbsValue (const ValVar *var, const ICFGNode *node) override |
| bool | hasAbsValue (const ValVar *var, const ICFGNode *node) const override |
| Side-effect-free existence check. | |
| void | updateAbsValue (const ValVar *var, const AbstractValue &val, const ICFGNode *node) override |
| void | updateAbsState (const ICFGNode *node, const AbstractState &state) override |
| void | joinStates (AbstractState &dst, const AbstractState &src) override |
| const ICFGNode * | getICFGNode (const ValVar *var) const |
| virtual const AbstractValue & | getAbsValue (const ObjVar *var, const ICFGNode *node) |
| virtual const AbstractValue & | getAbsValue (const SVFVar *var, const ICFGNode *node) |
| virtual bool | hasAbsValue (const ObjVar *var, const ICFGNode *node) const |
| virtual bool | hasAbsValue (const SVFVar *var, const ICFGNode *node) const |
| virtual void | updateAbsValue (const ObjVar *var, const AbstractValue &val, const ICFGNode *node) |
| virtual void | updateAbsValue (const SVFVar *var, const AbstractValue &val, const ICFGNode *node) |
| Protected Member Functions inherited from SVF::AbstractInterpretation | |
| AbstractInterpretation () | |
| bool | isStrongUpdate (const AddressValue &targets, const AbstractState &state) const |
| virtual bool | mergeStatesFromPredecessors (const ICFGNode *node) |
| bool | isBranchEdgeFeasible (const IntraCFGEdge *edge, AbstractState &as) |
| bool | applyBranchRefinement (const IntraCFGEdge *edge, AbstractState &as) |
| bool | shouldApplyNarrowing (const FunObjVar *fun) |
| Check if narrowing should be applied: always for regular loops, mode-dependent for recursion. | |
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::SemiSparse.
ValVars live at their SVFG-style def-sites: reads pull from there, writes go there, state merges replace only the ObjVar map and skip the ValVar map, and the cycle helpers gather/scatter cycle ValVars around each widening iteration.
Definition at line 41 of file SparseAbstractInterpretation.h.
|
inline |
Definition at line 44 of file SparseAbstractInterpretation.h.
|
overridedefault |
|
protectedvirtual |
Reimplemented from SVF::AbstractInterpretation.
Definition at line 143 of file AbstractStateManager.cpp.
|
protectedvirtual |
Reimplemented from SVF::AbstractInterpretation.
Definition at line 144 of file AbstractStateManager.cpp.
|
overrideprotectedvirtual |
Read a top-level variable's abstract value. Dense base does a direct trace lookup; sparse subclasses override with their own resolution chain (def-site walk, call-result fallback, etc.). All three overloads are virtual so full-sparse can route ObjVar reads through the SVFG.
Dense base: direct trace lookup, with a type-directed top value for genuinely missing entries (e.g. function parameters never written before first read). Sparse subclasses override with a def-site resolution chain.
The "in map" check is a raw map.count — NOT inVarToValTable / inVarToAddrsTable, which gate on isInterval / isAddr. SVF canonically represents uninit and null-pointer shapes as (interval=bottom ∧ addrs=∅); those predicates would falsely report such an entry as "not present", and the top fallback below would then clobber the very signal NullptrDerefDetector::isUninit keys off.
Reimplemented from SVF::AbstractInterpretation.
Definition at line 253 of file SparseAbstractInterpretation.cpp.
|
overrideprotectedvirtual |
Build a full cycle-head AbstractState. Dense default: trace[cycle_head] as-is. Semi-sparse subclass: also pull cycle ValVars from def-sites.
Reimplemented from SVF::AbstractInterpretation.
Definition at line 125 of file SparseAbstractInterpretation.cpp.
|
protected |
Definition at line 221 of file SparseAbstractInterpretation.cpp.
|
protectedvirtual |
Reimplemented from SVF::AbstractInterpretation.
Definition at line 148 of file AbstractStateManager.cpp.
|
protectedvirtual |
Reimplemented from SVF::AbstractInterpretation.
Definition at line 149 of file AbstractStateManager.cpp.
|
overrideprotectedvirtual |
Side-effect-free existence check.
Dense base: direct existence check at node. Mirrors the simplified getAbsValue lookup — uses raw map.contains rather than inVar*Table predicates, which would falsely report neutral (interval=bottom ∧ addrs=∅) entries as "not present".
Reimplemented from SVF::AbstractInterpretation.
Definition at line 260 of file SparseAbstractInterpretation.cpp.
|
overrideprotectedvirtual |
Join src into dst with sparsity-aware semantics. Dense merges everything; semi-sparse skips ValVars.
Reimplemented from SVF::AbstractInterpretation.
Definition at line 201 of file SparseAbstractInterpretation.cpp.
|
overrideprotectedvirtual |
Narrow prev with cur; write the narrowed state back. Returns true when narrowing is disabled or the narrowed state equals prev. Semi-sparse subclass scatters the narrowed ValVars on non-fixpoint.
Reimplemented from SVF::AbstractInterpretation.
Definition at line 169 of file SparseAbstractInterpretation.cpp.
|
overrideprotectedvirtual |
Replace the state at node. Sparse subclasses replace only the ObjVar map (ValVars live at def-sites).
Reimplemented from SVF::AbstractInterpretation.
Definition at line 193 of file SparseAbstractInterpretation.cpp.
|
protectedvirtual |
Reimplemented from SVF::AbstractInterpretation.
Definition at line 154 of file AbstractStateManager.cpp.
|
protectedvirtual |
Reimplemented from SVF::AbstractInterpretation.
Definition at line 155 of file AbstractStateManager.cpp.
|
overrideprotectedvirtual |
Write a variable's abstract value. Sparse subclasses re-route ValVar writes to the def-site.
Reimplemented from SVF::AbstractInterpretation.
Definition at line 244 of file SparseAbstractInterpretation.cpp.
|
overrideprotectedvirtual |
Widen prev with cur; write the widened state to trace[cycle_head]. Returns true when next == prev (fixpoint). Semi-sparse subclass additionally scatters ValVars to their def-sites.
Reimplemented from SVF::AbstractInterpretation.
Definition at line 151 of file SparseAbstractInterpretation.cpp.