Static Value-Flow Analysis
|
#include <FlowDDA.h>
Private Attributes | |
DDAClient * | _client |
DDA client. | |
Additional Inherited Members | |
Static Public Member Functions inherited from SVF::BVDataPTAImpl | |
static bool | classof (const PointerAnalysis *pta) |
Static Public Attributes inherited from SVF::PointerAnalysis | |
static const std::string | aliasTestMayAlias = "MAYALIAS" |
static const std::string | aliasTestMayAliasMangled = "_Z8MAYALIASPvS_" |
static const std::string | aliasTestNoAlias = "NOALIAS" |
static const std::string | aliasTestNoAliasMangled = "_Z7NOALIASPvS_" |
static const std::string | aliasTestPartialAlias = "PARTIALALIAS" |
static const std::string | aliasTestPartialAliasMangled = "_Z12PARTIALALIASPvS_" |
static const std::string | aliasTestMustAlias = "MUSTALIAS" |
static const std::string | aliasTestMustAliasMangled = "_Z9MUSTALIASPvS_" |
static const std::string | aliasTestFailMayAlias = "EXPECTEDFAIL_MAYALIAS" |
static const std::string | aliasTestFailMayAliasMangled = "_Z21EXPECTEDFAIL_MAYALIASPvS_" |
static const std::string | aliasTestFailNoAlias = "EXPECTEDFAIL_NOALIAS" |
static const std::string | aliasTestFailNoAliasMangled = "_Z20EXPECTEDFAIL_NOALIASPvS_" |
Protected Member Functions inherited from SVF::BVDataPTAImpl | |
PTDataTy * | getPTDataTy () const |
Get points-to data structure. | |
virtual bool | updateCallGraph (const CallSiteToFunPtrMap &) |
Update callgraph. This should be implemented by its subclass. | |
DiffPTDataTy * | getDiffPTDataTy () const |
DFPTDataTy * | getDFPTDataTy () const |
MutDFPTDataTy * | getMutDFPTDataTy () const |
VersionedPTDataTy * | getVersionedPTDataTy () const |
virtual void | onTheFlyCallGraphSolve (const CallSiteToFunPtrMap &callsites, CallEdgeMap &newEdges) |
On the fly call graph construction. | |
virtual void | onTheFlyThreadCallGraphSolve (const CallSiteToFunPtrMap &callsites, CallEdgeMap &newForkEdges) |
On the fly thread call graph construction respecting forksite. | |
virtual void | normalizePointsTo () |
Protected Member Functions inherited from SVF::PointerAnalysis | |
const CallSiteToFunPtrMap & | getIndirectCallsites () const |
Return all indirect callsites. | |
NodeID | getFunPtr (const CallICFGNode *cs) const |
Return function pointer PAGNode at a callsite cs. | |
virtual void | validateTests () |
Alias check functions to verify correctness of pointer analysis. | |
virtual void | validateSuccessTests (std::string fun) |
virtual void | validateExpectedFailureTests (std::string fun) |
void | resetObjFieldSensitive () |
Reset all object node as field-sensitive. | |
Protected Member Functions inherited from SVF::DDAVFSolver< NodeID, PointsTo, LocDPItem > | |
virtual void | handleSingleStatement (const LocDPItem &dpm, PointsTo &pts) |
Handle single statement. | |
void | reCompute (const LocDPItem &dpm) |
recompute points-to for value-flow cycles and indirect calls | |
void | reComputeForEdges (const LocDPItem &dpm, const SVFGEdgeSet &edgeSet, bool indirectCall=false) |
Traverse along out edges to find all nodes which may be affected by locDPM. | |
virtual void | buildSVFG (SVFIR *pag) |
Build SVFG. | |
virtual void | resetQuery () |
Reset visited map for next points-to query. | |
void | OOBResetVisited () |
Reset visited map if the current query is out-of-budget. | |
const SVFGNode * | getDefSVFGNode (const PAGNode *pagNode) const |
GetDefinition SVFG. | |
void | backtraceAlongIndirectVF (PointsTo &pts, const LocDPItem &oldDpm) |
Backward traverse along indirect value flows. | |
void | backtraceAlongDirectVF (PointsTo &pts, const LocDPItem &oldDpm) |
Backward traverse along direct value flows. | |
void | startNewPTCompFromLoadSrc (PointsTo &pts, const LocDPItem &oldDpm) |
void | startNewPTCompFromStoreDst (PointsTo &pts, const LocDPItem &oldDpm) |
void | backtraceToStoreSrc (PointsTo &pts, const LocDPItem &oldDpm) |
virtual void | backwardPropDpm (PointsTo &pts, NodeID ptr, const LocDPItem &oldDpm, const SVFGEdge *edge) |
dpm transit during backward tracing | |
virtual bool | isMustAlias (const LocDPItem &, const LocDPItem &) |
whether load and store are aliased | |
virtual bool | isStrongUpdate (const PointsTo &dstCPSet, const StoreSVFGNode *store) |
Return TRUE if this is a strong update STORE statement. | |
virtual bool | isLocalCVarInRecursion (const NodeID &var) const |
Whether a local variable is in function recursions. | |
virtual bool | propagateViaObj (const NodeID &storeObj, const NodeID &loadObj) |
If the points-to contain the object obj, we could move forward along indirect value-flow edge. | |
void | resolveFunPtr (const LocDPItem &dpm) |
resolve function pointer | |
void | markbkVisited (const LocDPItem &dpm) |
Visited flags to avoid cycles. | |
bool | isbkVisited (const LocDPItem &dpm) |
void | clearbkVisited (const LocDPItem &dpm) |
virtual const PointsTo & | getCachedPointsTo (const LocDPItem &dpm) |
Points-to Caching for top-level pointers and address-taken objects. | |
virtual void | updateCachedPointsTo (const LocDPItem &dpm, const PointsTo &pts) |
virtual const PointsTo & | getCachedADPointsTo (const LocDPItem &dpm) |
bool | isTopLevelPtrStmt (const SVFGNode *stmt) |
Whether this is a top-level pointer statement. | |
virtual LocDPItem | getDPImWithOldCond (const LocDPItem &oldDpm, const NodeID &var, const SVFGNode *loc) |
Return dpm with old context and path conditions. | |
void | SVFGSCCDetection () |
SVFG SCC detection. | |
NodeID | getSVFGSCCRepNode (NodeID id) |
Get SCC rep node of a SVFG node. | |
bool | isSVFGNodeInCycle (const SVFGNode *node) |
Return whether this SVFGNode is in cycle. | |
bool | edgeInSVFGSCC (const SVFGEdge *edge) |
Return TRUE if this edge is inside a SVFG SCC, i.e., src node and dst node are in the same SCC on the SVFG. | |
void | setCallGraph (PTACallGraph *cg) |
Set callgraph. | |
void | setCallGraphSCC (CallGraphSCC *scc) |
Set callgraphSCC. | |
bool | isArrayCondMemObj (const NodeID &var) const |
bool | isFieldInsenCondMemObj (const NodeID &var) const |
void | addLoadDpmAndCVar (const LocDPItem &dpm, const LocDPItem &loadDpm, const NodeID &loadVar) |
LoadDpm for must-alias analysis. | |
void | addLoadDpm (const LocDPItem &dpm, const LocDPItem &loadDpm) |
Note that simply use "dpmToloadDpmMap[dpm]=loadDpm", requires DPIm have a default constructor. | |
const LocDPItem & | getLoadDpm (const LocDPItem &dpm) const |
void | addLoadCVar (const LocDPItem &dpm, const NodeID &loadVar) |
const NodeID & | getLoadCVar (const LocDPItem &dpm) const |
AndersenWaveDiff * | getAndersenAnalysis () const |
Return Andersen's analysis. | |
void | handleOutOfBudgetDpm (const LocDPItem &dpm) |
handle out-of-budget queries | |
bool | testOutOfBudget (const LocDPItem &dpm) |
bool | isOutOfBudgetQuery () const |
void | addOutOfBudgetDpm (const LocDPItem &dpm) |
bool | isOutOfBudgetDpm (const LocDPItem &dpm) const |
DDAStat * | setDDAStat (DDAStat *s) |
Set DDAStat. | |
void | addSUStat (const LocDPItem &dpm, const SVFGNode *node) |
stat strong updates num | |
void | rmSUStat (const LocDPItem &dpm, const SVFGNode *node) |
remove strong updates num if the dpm goes to weak updates branch | |
Protected Attributes inherited from SVF::PointerAnalysis | |
bool | print_stat |
User input flags. | |
bool | alias_validation |
Flag for validating points-to/alias results. | |
u32_t | OnTheFlyIterBudgetForStat |
Flag for iteration budget for on-the-fly statistics. | |
SVFModule * | svfMod |
Module. | |
PTATY | ptaTy |
Pointer analysis Type. | |
PTAImplTy | ptaImplTy |
PTA implementation type. | |
PTAStat * | stat |
Statistics. | |
PTACallGraph * | callgraph |
Call graph used for pointer analysis. | |
CallGraphSCC * | callGraphSCC |
SCC for PTACallGraph. | |
ICFG * | icfg |
Interprocedural control-flow graph. | |
CommonCHGraph * | chgraph |
CHGraph. | |
Protected Attributes inherited from SVF::DDAVFSolver< NodeID, PointsTo, LocDPItem > | |
bool | outOfBudgetQuery |
Whether the current query is out of step limits. | |
SVFIR * | _pag |
SVFIR. | |
SVFG * | _svfg |
SVFG. | |
AndersenWaveDiff * | _ander |
Andersen's analysis. | |
NodeBS | candidateQueries |
candidate pointers; | |
PTACallGraph * | _callGraph |
PTACallGraph. | |
CallGraphSCC * | _callGraphSCC |
SCC for PTACallGraph. | |
SVFGSCC * | _svfgSCC |
SCC for SVFG. | |
DPTItemSet | backwardVisited |
visited map during backward traversing | |
DPImToCPtSetMap | dpmToTLCPtSetMap |
points-to caching map for top-level vars | |
DPImToCPtSetMap | dpmToADCPtSetMap |
points-to caching map for address-taken vars | |
LocToDPMVecMap | locToDpmSetMap |
map location to its dpms | |
DPMToDPMMap | dpmToloadDpmMap |
dpms at loads for may/must-alias analysis with stores | |
DPMToCVarMap | loadToPTCVarMap |
map a load dpm to its cvar pointed by its pointer operand | |
DPTItemSet | outOfBudgetDpms |
out of budget dpm set | |
StoreToPMSetMap | storeToDPMs |
map store to set of DPM which have been stong updated there | |
DDAStat * | ddaStat |
DDA stat. | |
SVFGBuilder | svfgBuilder |
SVFG Builder. | |
Static Protected Attributes inherited from SVF::PointerAnalysis | |
static SVFIR * | pag = nullptr |
SVFIR. | |
Constructor.
Definition at line 61 of file FlowDDA.h.
|
inlinevirtual |
|
inlineoverridevirtual |
|
overridevirtual |
Compute points-to set for all top variable.
Compute points-to set for queries
start DDA analysis
Reimplemented from SVF::PointerAnalysis.
Definition at line 43 of file FlowDDA.cpp.
|
inlineoverridevirtual |
Finalize analysis.
Reimplemented from SVF::BVDataPTAImpl.
Definition at line 96 of file FlowDDA.h.
|
inlineoverridevirtual |
Override parent class functions to get/add cached points-to directly via PAGNode ID.
Reimplemented from SVF::DDAVFSolver< NodeID, PointsTo, LocDPItem >.
Override parent method.
Implements SVF::DDAVFSolver< NodeID, PointsTo, LocDPItem >.
Definition at line 109 of file FlowDDA.h.
Override parent method.
Implements SVF::DDAVFSolver< NodeID, PointsTo, LocDPItem >.
|
inlineoverridevirtual |
Handle Address SVFGNode to add proper points-to.
whether this object is set field-insensitive during pre-analysis
Implements SVF::DDAVFSolver< NodeID, PointsTo, LocDPItem >.
Definition at line 119 of file FlowDDA.h.
Handle condition for flow analysis (backward analysis)
Reimplemented from SVF::DDAVFSolver< NodeID, PointsTo, LocDPItem >.
Definition at line 102 of file FlowDDA.cpp.
Handle out-of-budget dpm.
Handle out-of-budget dpm
Definition at line 72 of file FlowDDA.cpp.
|
inlineoverridevirtual |
Initialization of the analysis.
Reimplemented from SVF::PointerAnalysis.
Definition at line 86 of file FlowDDA.h.
|
overridevirtual |
we exclude concrete heap here following the conditions: (1) local allocated heap and (2) not escaped to the scope outside the current function (3) not inside loop (4) not involved in recursion
Reimplemented from SVF::DDAVFSolver< NodeID, PointsTo, LocDPItem >.
Definition at line 177 of file FlowDDA.cpp.
|
overridevirtual |
processGep node
Generate field objects for structs
Implements SVF::DDAVFSolver< NodeID, PointsTo, LocDPItem >.
Definition at line 141 of file FlowDDA.cpp.
Return PTA name.
Reimplemented from SVF::PointerAnalysis.
Definition at line 167 of file FlowDDA.h.
bool FlowDDA::testIndCallReachability | ( | LocDPItem & | dpm, |
const SVFFunction * | callee, | ||
CallSiteID | csId | ||
) |
refine indirect call edge
Definition at line 81 of file FlowDDA.cpp.
Union pts.
Reimplemented from SVF::DDAVFSolver< NodeID, PointsTo, LocDPItem >.
Definition at line 161 of file FlowDDA.h.
|
inlineoverridevirtual |
Update call graph.
Reimplemented from SVF::DDAVFSolver< NodeID, PointsTo, LocDPItem >.
Definition at line 135 of file FlowDDA.h.