Static Value-Flow Analysis
Public Types | Public Member Functions | List of all members
SVF::DFPTData< Key, KeySet, Data, DataSet > Class Template Referenceabstract

#include <AbstractPointsToDS.h>

Inheritance diagram for SVF::DFPTData< Key, KeySet, Data, DataSet >:
SVF::PTData< Key, KeySet, Data, DataSet > SVF::MutableDFPTData< Key, KeySet, Data, DataSet > SVF::PersistentDFPTData< Key, KeySet, Data, DataSet > SVF::MutableIncDFPTData< Key, KeySet, Data, DataSet > SVF::PersistentIncDFPTData< Key, KeySet, Data, DataSet >

Public Types

typedef PTData< Key, KeySet, Data, DataSet > BasePTData
 
typedef BasePTData::PTDataTy PTDataTy
 
typedef NodeID LocID
 
- Public Types inherited from SVF::PTData< Key, KeySet, Data, DataSet >
enum  PTDataTy {
  Base , MutBase , Diff , MutDiff ,
  DataFlow , MutDataFlow , MutIncDataFlow , Versioned ,
  MutVersioned , PersBase , PersDiff , PersDataFlow ,
  PersIncDataFlow , PersVersioned
}
 Types of a points-to data structures. More...
 

Public Member Functions

 DFPTData (bool reversePT=true, PTDataTy ty=BasePTData::DataFlow)
 Constructor. More...
 
virtual ~DFPTData ()
 
virtual bool hasDFInSet (LocID loc) const =0
 
virtual bool hasDFOutSet (LocID loc) const =0
 
virtual bool hasDFOutSet (LocID loc, const Key &var) const =0
 
virtual bool hasDFInSet (LocID loc, const Key &var) const =0
 
virtual const DataSet & getDFInPtsSet (LocID loc, const Key &var)=0
 
virtual const DataSet & getDFOutPtsSet (LocID loc, const Key &var)=0
 
virtual bool updateDFInFromIn (LocID srcLoc, const Key &srcVar, LocID dstLoc, const Key &dstVar)=0
 
virtual bool updateAllDFInFromIn (LocID srcLoc, const Key &srcVar, LocID dstLoc, const Key &dstVar)=0
 Union (IN[dstLoc::dstVar], IN[srcLoc:srcVar]. There is no flag check, unlike the above. More...
 
virtual bool updateDFInFromOut (LocID srcLoc, const Key &srcVar, LocID dstLoc, const Key &dstVar)=0
 Union (IN[dstLoc:dstVar], OUT[srcLoc:srcVar]). More...
 
virtual bool updateAllDFInFromOut (LocID srcLoc, const Key &srcVar, LocID dstLoc, const Key &dstVar)=0
 Union (IN[dstLoc::dstVar], OUT[srcLoc:srcVar]. There is no flag check, unlike the above. More...
 
virtual bool updateDFOutFromIn (LocID srcLoc, const Key &srcVar, LocID dstLoc, const Key &dstVar)=0
 Union (OUT[dstLoc:dstVar], IN[srcLoc:srcVar]). More...
 
virtual bool updateAllDFOutFromIn (LocID loc, const Key &singleton, bool strongUpdates)=0
 For each variable var in IN at loc, do updateDFOutFromIn(loc, var, loc, var). More...
 
virtual void clearAllDFOutUpdatedVar (LocID)=0
 
virtual bool updateTLVPts (LocID srcLoc, const Key &srcVar, const Key &dstVar)=0
 Update points-to set of top-level pointers with IN[srcLoc:srcVar]. More...
 
virtual bool updateATVPts (const Key &srcVar, LocID dstLoc, const Key &dstVar)=0
 Update address-taken variables OUT[dstLoc:dstVar] with points-to of top-level pointers. More...
 
- Public Member Functions inherited from SVF::PTData< Key, KeySet, Data, DataSet >
 PTData (bool reversePT=true, PTDataTy ty=PTDataTy::Base)
 
virtual ~PTData ()
 
PTDataTy getPTDTY () const
 Get the type of points-to data structure that this is. More...
 
virtual void clear ()=0
 Clears all points-to sets as if nothing is stored. More...
 
virtual const DataSet & getPts (const Key &var)=0
 Get points-to set of var. More...
 
virtual const KeySet & getRevPts (const Data &datum)=0
 Get reverse points-to set of a datum. More...
 
virtual bool addPts (const Key &var, const Data &element)=0
 Adds element to the points-to set associated with var. More...
 
virtual bool unionPts (const Key &dstVar, const Key &srcVar)=0
 Performs pts(dstVar) = pts(dstVar) U pts(srcVar). More...
 
virtual bool unionPts (const Key &dstVar, const DataSet &srcDataSet)=0
 Performs pts(dstVar) = pts(dstVar) U srcDataSet. More...
 
virtual void clearPts (const Key &var, const Data &element)=0
 Clears element from the points-to set of var. More...
 
virtual void clearFullPts (const Key &var)=0
 Fully clears the points-to set of var. More...
 
virtual void remapAllPts (void)=0
 Remaps all points-to sets to use the current mapping. More...
 
virtual void dumpPTData ()=0
 Dump stored keys and points-to sets. More...
 
virtual Map< DataSet, unsigned > getAllPts (bool liveOnly) const =0
 

Static Public Member Functions

static bool classof (const DFPTData< Key, KeySet, Data, DataSet > *)
 
static bool classof (const PTData< Key, KeySet, Data, DataSet > *ptd)
 

Additional Inherited Members

- Protected Attributes inherited from SVF::PTData< Key, KeySet, Data, DataSet >
bool rev
 Whether we maintain reverse points-to sets or not. More...
 
PTDataTy ptdTy
 

Detailed Description

template<typename Key, typename KeySet, typename Data, typename DataSet>
class SVF::DFPTData< Key, KeySet, Data, DataSet >

Data-flow points-to data structure for flow-sensitive analysis as defined by Hardekopf and Lin (CGO 11). Points-to information is maintained at each program point (statement). For address-taken variables, every program point has two sets: IN and OUT points-to sets. For top-level variables, points-to sets are maintained flow-insensitively via getPts(var).

Definition at line 194 of file AbstractPointsToDS.h.

Member Typedef Documentation

◆ BasePTData

template<typename Key , typename KeySet , typename Data , typename DataSet >
typedef PTData<Key, KeySet, Data, DataSet> SVF::DFPTData< Key, KeySet, Data, DataSet >::BasePTData

Definition at line 197 of file AbstractPointsToDS.h.

◆ LocID

template<typename Key , typename KeySet , typename Data , typename DataSet >
typedef NodeID SVF::DFPTData< Key, KeySet, Data, DataSet >::LocID

Definition at line 200 of file AbstractPointsToDS.h.

◆ PTDataTy

template<typename Key , typename KeySet , typename Data , typename DataSet >
typedef BasePTData::PTDataTy SVF::DFPTData< Key, KeySet, Data, DataSet >::PTDataTy

Definition at line 198 of file AbstractPointsToDS.h.

Constructor & Destructor Documentation

◆ DFPTData()

template<typename Key , typename KeySet , typename Data , typename DataSet >
SVF::DFPTData< Key, KeySet, Data, DataSet >::DFPTData ( bool  reversePT = true,
PTDataTy  ty = BasePTData::DataFlow 
)
inline

Constructor.

Definition at line 203 of file AbstractPointsToDS.h.

203 : BasePTData(reversePT, ty) { }
PTData< Key, KeySet, Data, DataSet > BasePTData

◆ ~DFPTData()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual SVF::DFPTData< Key, KeySet, Data, DataSet >::~DFPTData ( )
inlinevirtual

Definition at line 205 of file AbstractPointsToDS.h.

205 { }

Member Function Documentation

◆ classof() [1/2]

template<typename Key , typename KeySet , typename Data , typename DataSet >
static bool SVF::DFPTData< Key, KeySet, Data, DataSet >::classof ( const DFPTData< Key, KeySet, Data, DataSet > *  )
inlinestatic

Methods to support type inquiry through isa, cast, and dyn_cast:

Definition at line 249 of file AbstractPointsToDS.h.

250  {
251  return true;
252  }

◆ classof() [2/2]

template<typename Key , typename KeySet , typename Data , typename DataSet >
static bool SVF::DFPTData< Key, KeySet, Data, DataSet >::classof ( const PTData< Key, KeySet, Data, DataSet > *  ptd)
inlinestatic

Definition at line 254 of file AbstractPointsToDS.h.

255  {
256  return ptd->getPTDTY() == BasePTData::DataFlow
257  || ptd->getPTDTY() == BasePTData::MutDataFlow
258  || ptd->getPTDTY() == BasePTData::MutIncDataFlow
259  || ptd->getPTDTY() == BasePTData::PersDataFlow
260  || ptd->getPTDTY() == BasePTData::PersIncDataFlow;
261  }

◆ clearAllDFOutUpdatedVar()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual void SVF::DFPTData< Key, KeySet, Data, DataSet >::clearAllDFOutUpdatedVar ( LocID  )
pure virtual

◆ getDFInPtsSet()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual const DataSet& SVF::DFPTData< Key, KeySet, Data, DataSet >::getDFInPtsSet ( LocID  loc,
const Key &  var 
)
pure virtual

◆ getDFOutPtsSet()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual const DataSet& SVF::DFPTData< Key, KeySet, Data, DataSet >::getDFOutPtsSet ( LocID  loc,
const Key &  var 
)
pure virtual

◆ hasDFInSet() [1/2]

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual bool SVF::DFPTData< Key, KeySet, Data, DataSet >::hasDFInSet ( LocID  loc) const
pure virtual

Determine whether the DF IN/OUT sets have points-to sets.

Implemented in SVF::PersistentDFPTData< Key, KeySet, Data, DataSet >, and SVF::MutableDFPTData< Key, KeySet, Data, DataSet >.

◆ hasDFInSet() [2/2]

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual bool SVF::DFPTData< Key, KeySet, Data, DataSet >::hasDFInSet ( LocID  loc,
const Key &  var 
) const
pure virtual

◆ hasDFOutSet() [1/2]

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual bool SVF::DFPTData< Key, KeySet, Data, DataSet >::hasDFOutSet ( LocID  loc) const
pure virtual

◆ hasDFOutSet() [2/2]

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual bool SVF::DFPTData< Key, KeySet, Data, DataSet >::hasDFOutSet ( LocID  loc,
const Key &  var 
) const
pure virtual

Access points-to set from data-flow IN/OUT set.

Implemented in SVF::PersistentDFPTData< Key, KeySet, Data, DataSet >, and SVF::MutableDFPTData< Key, KeySet, Data, DataSet >.

◆ updateAllDFInFromIn()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual bool SVF::DFPTData< Key, KeySet, Data, DataSet >::updateAllDFInFromIn ( LocID  srcLoc,
const Key &  srcVar,
LocID  dstLoc,
const Key &  dstVar 
)
pure virtual

◆ updateAllDFInFromOut()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual bool SVF::DFPTData< Key, KeySet, Data, DataSet >::updateAllDFInFromOut ( LocID  srcLoc,
const Key &  srcVar,
LocID  dstLoc,
const Key &  dstVar 
)
pure virtual

◆ updateAllDFOutFromIn()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual bool SVF::DFPTData< Key, KeySet, Data, DataSet >::updateAllDFOutFromIn ( LocID  loc,
const Key &  singleton,
bool  strongUpdates 
)
pure virtual

◆ updateATVPts()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual bool SVF::DFPTData< Key, KeySet, Data, DataSet >::updateATVPts ( const Key &  srcVar,
LocID  dstLoc,
const Key &  dstVar 
)
pure virtual

◆ updateDFInFromIn()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual bool SVF::DFPTData< Key, KeySet, Data, DataSet >::updateDFInFromIn ( LocID  srcLoc,
const Key &  srcVar,
LocID  dstLoc,
const Key &  dstVar 
)
pure virtual

Update points-to for IN/OUT set IN[loc:var] represents the points-to of variable var in the IN set of location loc. union(ptsDst, ptsSrc) represents ptsDst = ptsDst U ptsSrc.

Union (IN[dstLoc:dstVar], IN[srcLoc:srcVar]).

Implemented in SVF::PersistentIncDFPTData< Key, KeySet, Data, DataSet >, SVF::PersistentDFPTData< Key, KeySet, Data, DataSet >, SVF::MutableIncDFPTData< Key, KeySet, Data, DataSet >, and SVF::MutableDFPTData< Key, KeySet, Data, DataSet >.

◆ updateDFInFromOut()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual bool SVF::DFPTData< Key, KeySet, Data, DataSet >::updateDFInFromOut ( LocID  srcLoc,
const Key &  srcVar,
LocID  dstLoc,
const Key &  dstVar 
)
pure virtual

◆ updateDFOutFromIn()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual bool SVF::DFPTData< Key, KeySet, Data, DataSet >::updateDFOutFromIn ( LocID  srcLoc,
const Key &  srcVar,
LocID  dstLoc,
const Key &  dstVar 
)
pure virtual

◆ updateTLVPts()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual bool SVF::DFPTData< Key, KeySet, Data, DataSet >::updateTLVPts ( LocID  srcLoc,
const Key &  srcVar,
const Key &  dstVar 
)
pure virtual

The documentation for this class was generated from the following file: