Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet > Class Template Reference

#include <MutablePointsToDS.h>

Inheritance diagram for SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >:
SVF::VersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet > SVF::PTData< Key, KeySet, Data, DataSet >

Public Types

typedef PTData< Key, KeySet, Data, DataSet > BasePTData
 
typedef VersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySetBaseVersionedPTData
 
typedef BasePTData::PTDataTy PTDataTy
 
- Public Types inherited from SVF::VersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >
typedef PTData< Key, KeySet, Data, DataSet > BasePTData
 
typedef BasePTData::PTDataTy PTDataTy
 
- 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

 MutableVersionedPTData (bool reversePT=true, PTDataTy ty=PTDataTy::MutVersioned)
 
virtual ~MutableVersionedPTData ()
 
virtual void clear () override
 Clears all points-to sets as if nothing is stored.
 
virtual const DataSet & getPts (const Key &vk) override
 Get points-to set of var.
 
virtual const DataSet & getPts (const VersionedKey &vk) override
 
virtual const KeySetgetRevPts (const Data &datum) override
 Get reverse points-to set of a datum.
 
virtual const VersionedKeySetgetVersionedKeyRevPts (const Data &datum) override
 
virtual bool addPts (const Key &k, const Data &element) override
 Adds element to the points-to set associated with var.
 
virtual bool addPts (const VersionedKey &vk, const Data &element) override
 
virtual bool unionPts (const Key &dstVar, const Key &srcVar) override
 Performs pts(dstVar) = pts(dstVar) U pts(srcVar).
 
virtual bool unionPts (const VersionedKey &dstVar, const VersionedKey &srcVar) override
 
virtual bool unionPts (const VersionedKey &dstVar, const Key &srcVar) override
 
virtual bool unionPts (const Key &dstVar, const VersionedKey &srcVar) override
 
virtual bool unionPts (const Key &dstVar, const DataSet &srcDataSet) override
 Performs pts(dstVar) = pts(dstVar) U srcDataSet.
 
virtual bool unionPts (const VersionedKey &dstVar, const DataSet &srcDataSet) override
 
virtual void clearPts (const Key &k, const Data &element) override
 Clears element from the points-to set of var.
 
virtual void clearPts (const VersionedKey &vk, const Data &element) override
 
virtual void clearFullPts (const Key &k) override
 Fully clears the points-to set of var.
 
virtual void clearFullPts (const VersionedKey &vk) override
 
virtual void remapAllPts (void) override
 Remaps all points-to sets to use the current mapping.
 
virtual Map< DataSet, unsignedgetAllPts (bool liveOnly) const override
 
virtual void dumpPTData () override
 Dump stored keys and points-to sets.
 
- Public Member Functions inherited from SVF::VersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >
 VersionedPTData (bool reversePT=true, PTDataTy ty=PTDataTy::Versioned)
 
virtual ~VersionedPTData ()
 
- 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.
 

Static Public Member Functions

static bool classof (const MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet > *)
 
static bool classof (const PTData< Key, KeySet, Data, DataSet > *ptd)
 
- Static Public Member Functions inherited from SVF::VersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >
static bool classof (const VersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet > *)
 
static bool classof (const PTData< Key, KeySet, Data, DataSet > *ptd)
 

Private Attributes

MutablePTData< Key, KeySet, Data, DataSet > tlPTData
 PTData for Keys (top-level pointers, generally).
 
MutablePTData< VersionedKey, VersionedKeySet, Data, DataSet > atPTData
 PTData for VersionedKeys (address-taken objects, generally).
 

Additional Inherited Members

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

Detailed Description

template<typename Key, typename KeySet, typename Data, typename DataSet, typename VersionedKey, typename VersionedKeySet>
class SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >

VersionedPTData implemented with mutable points-to set (DataSet). Implemented as a wrapper around two MutablePTDatas: one for Keys, one for VersionedKeys.

Definition at line 892 of file MutablePointsToDS.h.

Member Typedef Documentation

◆ BasePTData

Definition at line 895 of file MutablePointsToDS.h.

◆ BaseVersionedPTData

Definition at line 896 of file MutablePointsToDS.h.

◆ PTDataTy

Definition at line 897 of file MutablePointsToDS.h.

Constructor & Destructor Documentation

◆ MutableVersionedPTData()

SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >::MutableVersionedPTData ( bool  reversePT = true,
PTDataTy  ty = PTDataTy::MutVersioned 
)
inline

Definition at line 899 of file MutablePointsToDS.h.

MutablePTData< Key, KeySet, Data, DataSet > tlPTData
PTData for Keys (top-level pointers, generally).
MutablePTData< VersionedKey, VersionedKeySet, Data, DataSet > atPTData
PTData for VersionedKeys (address-taken objects, generally).
VersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet > BaseVersionedPTData
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ ~MutableVersionedPTData()

Definition at line 902 of file MutablePointsToDS.h.

902{ }

Member Function Documentation

◆ addPts() [1/2]

virtual bool SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >::addPts ( const Key var,
const Data element 
)
inlineoverridevirtual

Adds element to the points-to set associated with var.

Implements SVF::PTData< Key, KeySet, Data, DataSet >.

Definition at line 930 of file MutablePointsToDS.h.

931 {
932 return tlPTData.addPts(k, element);
933 }

◆ addPts() [2/2]

Implements SVF::VersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >.

Definition at line 934 of file MutablePointsToDS.h.

935 {
936 return atPTData.addPts(vk, element);
937 }
virtual bool addPts(const Key &dstKey, const Data &element) override
Adds element to the points-to set associated with var.

◆ classof() [1/2]

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

Definition at line 1005 of file MutablePointsToDS.h.

1006 {
1007 return true;
1008 }

◆ classof() [2/2]

Definition at line 1010 of file MutablePointsToDS.h.

1011 {
1012 return ptd->getPTDTY() == PTDataTy::MutVersioned;
1013 }

◆ clear()

Clears all points-to sets as if nothing is stored.

Implements SVF::PTData< Key, KeySet, Data, DataSet >.

Definition at line 904 of file MutablePointsToDS.h.

905 {
906 tlPTData.clear();
907 atPTData.clear();
908 }
virtual void clear() override
Clears all points-to sets as if nothing is stored.

◆ clearFullPts() [1/2]

virtual void SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >::clearFullPts ( const Key var)
inlineoverridevirtual

Fully clears the points-to set of var.

Implements SVF::PTData< Key, KeySet, Data, DataSet >.

Definition at line 973 of file MutablePointsToDS.h.

974 {
975 tlPTData.clearFullPts(k);
976 }

◆ clearFullPts() [2/2]

Implements SVF::VersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >.

Definition at line 977 of file MutablePointsToDS.h.

978 {
980 }
virtual void clearFullPts(const Key &var) override
Fully clears the points-to set of var.

◆ clearPts() [1/2]

virtual void SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >::clearPts ( const Key var,
const Data element 
)
inlineoverridevirtual

Clears element from the points-to set of var.

Implements SVF::PTData< Key, KeySet, Data, DataSet >.

Definition at line 964 of file MutablePointsToDS.h.

965 {
966 tlPTData.clearPts(k, element);
967 }

◆ clearPts() [2/2]

virtual void SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >::clearPts ( const VersionedKey vk,
const Data element 
)
inlineoverridevirtual

Implements SVF::VersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >.

Definition at line 968 of file MutablePointsToDS.h.

969 {
971 }
virtual void clearPts(const Key &var, const Data &element) override
Clears element from the points-to set of var.

◆ dumpPTData()

Dump stored keys and points-to sets.

Implements SVF::PTData< Key, KeySet, Data, DataSet >.

Definition at line 995 of file MutablePointsToDS.h.

996 {
997 SVFUtil::outs() << "== Top-level points-to information\n";
998 tlPTData.dumpPTData();
999 SVFUtil::outs() << "== Address-taken points-to information\n";
1001 }
virtual void dumpPTData() override
Dump stored keys and points-to sets.
std::ostream & outs()
Overwrite llvm::outs()
Definition SVFUtil.h:50

◆ getAllPts()

virtual Map< DataSet, unsigned > SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >::getAllPts ( bool  liveOnly) const
inlineoverridevirtual

Returns a mapping of points-to sets to the number of times they are stored. liveOnly indicates whether to include only points-to sets which correspond to a variable (matters when dealing with non-GC persistent PT).

Implements SVF::PTData< Key, KeySet, Data, DataSet >.

Definition at line 988 of file MutablePointsToDS.h.

989 {
991 SVFUtil::mergePtsOccMaps<DataSet>(allPts, atPTData.getAllPts(liveOnly));
992 return allPts;
993 }
virtual Map< DataSet, unsigned > getAllPts(bool liveOnly) const override

◆ getPts() [1/2]

virtual const DataSet & SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >::getPts ( const Key var)
inlineoverridevirtual

Get points-to set of var.

Implements SVF::PTData< Key, KeySet, Data, DataSet >.

Definition at line 910 of file MutablePointsToDS.h.

911 {
912 return tlPTData.getPts(vk);
913 }

◆ getPts() [2/2]

Implements SVF::VersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >.

Definition at line 914 of file MutablePointsToDS.h.

915 {
916 return atPTData.getPts(vk);
917 }
virtual const DataSet & getPts(const Key &var) override
Get points-to set of var.

◆ getRevPts()

Get reverse points-to set of a datum.

Implements SVF::PTData< Key, KeySet, Data, DataSet >.

Definition at line 919 of file MutablePointsToDS.h.

920 {
921 assert(this->rev && "MutableVersionedPTData::getRevPts: constructed without reverse PT support!");
922 return tlPTData.getRevPts(datum);
923 }
bool rev
Whether we maintain reverse points-to sets or not.

◆ getVersionedKeyRevPts()

virtual const VersionedKeySet & SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >::getVersionedKeyRevPts ( const Data datum)
inlineoverridevirtual

Implements SVF::VersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >.

Definition at line 924 of file MutablePointsToDS.h.

925 {
926 assert(this->rev && "MutableVersionedPTData::getVersionedKeyRevPts: constructed without reverse PT support!");
927 return atPTData.getRevPts(datum);
928 }
virtual const KeySet & getRevPts(const Data &datum) override
Get reverse points-to set of a datum.

◆ remapAllPts()

virtual void SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >::remapAllPts ( void  )
inlineoverridevirtual

Remaps all points-to sets to use the current mapping.

Implements SVF::PTData< Key, KeySet, Data, DataSet >.

Definition at line 982 of file MutablePointsToDS.h.

983 {
984 tlPTData.remapAllPts();
986 }
virtual void remapAllPts(void) override
Remaps all points-to sets to use the current mapping.

◆ unionPts() [1/6]

virtual bool SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >::unionPts ( const Key dstVar,
const DataSet &  srcDataSet 
)
inlineoverridevirtual

Performs pts(dstVar) = pts(dstVar) U srcDataSet.

Implements SVF::PTData< Key, KeySet, Data, DataSet >.

Definition at line 955 of file MutablePointsToDS.h.

956 {
957 return tlPTData.unionPts(dstVar, srcDataSet);
958 }

◆ unionPts() [2/6]

virtual bool SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >::unionPts ( const Key dstVar,
const Key srcVar 
)
inlineoverridevirtual

Performs pts(dstVar) = pts(dstVar) U pts(srcVar).

Implements SVF::PTData< Key, KeySet, Data, DataSet >.

Definition at line 939 of file MutablePointsToDS.h.

940 {
941 return tlPTData.unionPts(dstVar, srcVar);
942 }

◆ unionPts() [3/6]

virtual bool SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >::unionPts ( const Key dstVar,
const VersionedKey srcVar 
)
inlineoverridevirtual

◆ unionPts() [4/6]

virtual bool SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >::unionPts ( const VersionedKey dstVar,
const DataSet &  srcDataSet 
)
inlineoverridevirtual

Implements SVF::VersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >.

Definition at line 959 of file MutablePointsToDS.h.

960 {
962 }
virtual bool unionPts(const Key &dstKey, const Key &srcKey) override
Performs pts(dstVar) = pts(dstVar) U pts(srcVar).

◆ unionPts() [5/6]

virtual bool SVF::MutableVersionedPTData< Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet >::unionPts ( const VersionedKey dstVar,
const Key srcVar 
)
inlineoverridevirtual

◆ unionPts() [6/6]

Member Data Documentation

◆ atPTData

PTData for VersionedKeys (address-taken objects, generally).

Definition at line 1020 of file MutablePointsToDS.h.

◆ tlPTData

PTData for Keys (top-level pointers, generally).

Definition at line 1018 of file MutablePointsToDS.h.


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