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

#include <MutablePointsToDS.h>

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

Public Types

typedef PTData< Key, KeySet, Data, DataSet > BasePTData
 
typedef MutablePTData< Key, KeySet, Data, DataSet > BaseMutPTData
 
typedef DFPTData< Key, KeySet, Data, DataSet > BaseDFPTData
 
typedef BasePTData::PTDataTy PTDataTy
 
typedef BaseDFPTData::LocID LocID
 
typedef BaseMutPTData::PtsMap PtsMap
 
typedef BaseMutPTData::PtsMapConstIter PtsMapConstIter
 
typedef Map< LocID, PtsMapDFPtsMap
 Data-flow point-to map. More...
 
typedef DFPtsMap::iterator DFPtsMapIter
 
typedef DFPtsMap::const_iterator DFPtsMapconstIter
 
- Public Types inherited from SVF::DFPTData< Key, KeySet, Data, DataSet >
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

 MutableDFPTData (bool reversePT=true, PTDataTy ty=BaseDFPTData::MutDataFlow)
 Constructor. More...
 
virtual ~MutableDFPTData ()
 
virtual const PtsMapgetPtsMap () const
 
virtual void clear () override
 Clears all points-to sets as if nothing is stored. More...
 
virtual const DataSet & getPts (const Key &var) override
 Get points-to set of var. More...
 
virtual const KeySet & getRevPts (const Data &datum) override
 Get reverse points-to set of a datum. More...
 
virtual bool hasDFInSet (LocID loc) const override
 
virtual bool hasDFOutSet (LocID loc) const override
 
virtual bool hasDFInSet (LocID loc, const Key &var) const override
 
virtual bool hasDFOutSet (LocID loc, const Key &var) const override
 
virtual DataSet & getDFInPtsSet (LocID loc, const Key &var) override
 
virtual DataSet & getDFOutPtsSet (LocID loc, const Key &var) override
 
virtual bool updateDFInFromIn (LocID srcLoc, const Key &srcVar, LocID dstLoc, const Key &dstVar) override
 
virtual bool updateDFInFromOut (LocID srcLoc, const Key &srcVar, LocID dstLoc, const Key &dstVar) override
 Union (IN[dstLoc:dstVar], OUT[srcLoc:srcVar]). More...
 
virtual bool updateDFOutFromIn (LocID srcLoc, const Key &srcVar, LocID dstLoc, const Key &dstVar) override
 Union (OUT[dstLoc:dstVar], IN[srcLoc:srcVar]). More...
 
virtual bool updateAllDFInFromOut (LocID srcLoc, const Key &srcVar, LocID dstLoc, const Key &dstVar) override
 Union (IN[dstLoc::dstVar], OUT[srcLoc:srcVar]. There is no flag check, unlike the above. More...
 
virtual bool updateAllDFInFromIn (LocID srcLoc, const Key &srcVar, LocID dstLoc, const Key &dstVar) override
 Union (IN[dstLoc::dstVar], IN[srcLoc:srcVar]. There is no flag check, unlike the above. More...
 
virtual bool updateAllDFOutFromIn (LocID loc, const Key &singleton, bool strongUpdates) override
 For each variable var in IN at loc, do updateDFOutFromIn(loc, var, loc, var). More...
 
virtual bool updateTLVPts (LocID srcLoc, const Key &srcVar, const Key &dstVar) override
 Update points-to set of top-level pointers with IN[srcLoc:srcVar]. More...
 
virtual bool updateATVPts (const Key &srcVar, LocID dstLoc, const Key &dstVar) override
 Update address-taken variables OUT[dstLoc:dstVar] with points-to of top-level pointers. More...
 
virtual void clearAllDFOutUpdatedVar (LocID) override
 
virtual Map< DataSet, unsigned > getAllPts (bool liveOnly) const override
 
const PtsMapgetDFInPtsMap (LocID loc)
 
const PtsMapgetDFOutPtsMap (LocID loc)
 
const DFPtsMapgetDFIn ()
 
const DFPtsMapgetDFOut ()
 
virtual bool addPts (const Key &dstKey, const Key &srcKey) override
 
virtual bool unionPts (const Key &dstKey, const Key &srcKey) override
 Performs pts(dstVar) = pts(dstVar) U pts(srcVar). More...
 
virtual bool unionPts (const Key &dstKey, const DataSet &srcDataSet) override
 Performs pts(dstVar) = pts(dstVar) U srcDataSet. More...
 
virtual void clearPts (const Key &var, const Data &element) override
 Clears element from the points-to set of var. More...
 
virtual void clearFullPts (const Key &var) override
 Fully clears the points-to set of var. More...
 
virtual void remapAllPts (void) override
 Remaps all points-to sets to use the current mapping. More...
 
virtual void dumpPTData () override
 
virtual void dumpPts (const PtsMap &ptsSet, OutStream &O=SVFUtil::outs()) const
 
- Public Member Functions inherited from SVF::DFPTData< Key, KeySet, Data, DataSet >
 DFPTData (bool reversePT=true, PTDataTy ty=BasePTData::DataFlow)
 Constructor. More...
 
virtual ~DFPTData ()
 
- 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 bool addPts (const Key &var, const Data &element)=0
 Adds element to the points-to set associated with var. More...
 

Static Public Member Functions

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

Protected Member Functions

bool unionPts (DataSet &dstDataSet, const DataSet &srcDataSet)
 
bool addPts (DataSet &d, const Data &e)
 

Protected Attributes

DFPtsMap dfInPtsMap
 Data-flow IN set. More...
 
DFPtsMap dfOutPtsMap
 Data-flow OUT set. More...
 
MutablePTData< Key, KeySet, Data, DataSet > mutPTData
 
- 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::MutableDFPTData< Key, KeySet, Data, DataSet >

Definition at line 363 of file MutablePointsToDS.h.

Member Typedef Documentation

◆ BaseDFPTData

template<typename Key , typename KeySet , typename Data , typename DataSet >
typedef DFPTData<Key, KeySet, Data, DataSet> SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::BaseDFPTData

Definition at line 368 of file MutablePointsToDS.h.

◆ BaseMutPTData

template<typename Key , typename KeySet , typename Data , typename DataSet >
typedef MutablePTData<Key, KeySet, Data, DataSet> SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::BaseMutPTData

Definition at line 367 of file MutablePointsToDS.h.

◆ BasePTData

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

Definition at line 366 of file MutablePointsToDS.h.

◆ DFPtsMap

template<typename Key , typename KeySet , typename Data , typename DataSet >
typedef Map<LocID, PtsMap> SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::DFPtsMap

Data-flow point-to map.

Definition at line 374 of file MutablePointsToDS.h.

◆ DFPtsMapconstIter

template<typename Key , typename KeySet , typename Data , typename DataSet >
typedef DFPtsMap::const_iterator SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::DFPtsMapconstIter

Definition at line 376 of file MutablePointsToDS.h.

◆ DFPtsMapIter

template<typename Key , typename KeySet , typename Data , typename DataSet >
typedef DFPtsMap::iterator SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::DFPtsMapIter

Definition at line 375 of file MutablePointsToDS.h.

◆ LocID

template<typename Key , typename KeySet , typename Data , typename DataSet >
typedef BaseDFPTData::LocID SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::LocID

Definition at line 371 of file MutablePointsToDS.h.

◆ PTDataTy

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

Definition at line 369 of file MutablePointsToDS.h.

◆ PtsMap

template<typename Key , typename KeySet , typename Data , typename DataSet >
typedef BaseMutPTData::PtsMap SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::PtsMap

Definition at line 372 of file MutablePointsToDS.h.

◆ PtsMapConstIter

template<typename Key , typename KeySet , typename Data , typename DataSet >
typedef BaseMutPTData::PtsMapConstIter SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::PtsMapConstIter

Definition at line 373 of file MutablePointsToDS.h.

Constructor & Destructor Documentation

◆ MutableDFPTData()

template<typename Key , typename KeySet , typename Data , typename DataSet >
SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::MutableDFPTData ( bool  reversePT = true,
PTDataTy  ty = BaseDFPTData::MutDataFlow 
)
inline

Constructor.

Definition at line 379 of file MutablePointsToDS.h.

379 : BaseDFPTData(reversePT, ty), mutPTData(reversePT) { }
DFPTData< Key, KeySet, Data, DataSet > BaseDFPTData
MutablePTData< Key, KeySet, Data, DataSet > mutPTData

◆ ~MutableDFPTData()

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

Definition at line 381 of file MutablePointsToDS.h.

381 { }

Member Function Documentation

◆ addPts() [1/2]

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual bool SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::addPts ( const Key &  dstKey,
const Key &  srcKey 
)
inlineoverridevirtual

Override the methods defined in PTData. Union/add points-to without adding reverse points-to, used internally

Definition at line 526 of file MutablePointsToDS.h.

527  {
528  return addPts(mutPTData.ptsMap[dstKey], srcKey);
529  }
virtual bool addPts(const Key &dstKey, const Key &srcKey) override

◆ addPts() [2/2]

template<typename Key , typename KeySet , typename Data , typename DataSet >
bool SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::addPts ( DataSet &  d,
const Data &  e 
)
inlineprotected

Definition at line 603 of file MutablePointsToDS.h.

604  {
605  return d.test_and_set(e);
606  }

◆ classof() [1/2]

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

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

Definition at line 585 of file MutablePointsToDS.h.

586  {
587  return true;
588  }

◆ classof() [2/2]

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

Definition at line 589 of file MutablePointsToDS.h.

590  {
591  return ptd->getPTDTY() == BaseDFPTData::MutDataFlow
592  || ptd->getPTDTY() == BaseDFPTData::MutIncDataFlow;
593  }

◆ clear()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual void SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::clear ( )
inlineoverridevirtual

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

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

Definition at line 388 of file MutablePointsToDS.h.

389  {
390  mutPTData.clear();
391  }

◆ clearAllDFOutUpdatedVar()

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

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

Reimplemented in SVF::MutableIncDFPTData< Key, KeySet, Data, DataSet >.

Definition at line 519 of file MutablePointsToDS.h.

520  {
521  }

◆ clearFullPts()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual void SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::clearFullPts ( const Key &  var)
inlineoverridevirtual

Fully clears the points-to set of var.

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

Definition at line 542 of file MutablePointsToDS.h.

543  {
544  mutPTData.clearFullPts(var);
545  }

◆ clearPts()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual void SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::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 538 of file MutablePointsToDS.h.

539  {
540  mutPTData.clearPts(var, element);
541  }

◆ dumpPTData()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual void SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::dumpPTData ( )
inlineoverridevirtual

Dump the DF IN/OUT set information for debugging purpose

dump points-to of top-level pointers

dump points-to of address-taken variables

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

Definition at line 612 of file MutablePointsToDS.h.

613  {
615  mutPTData.dumpPTData();
617  std::error_code ErrInfo;
618  std::fstream f("svfg_pts.data", std::ios_base::out);
619  if (f.good())
620  {
621  NodeBS locs;
622  for(DFPtsMapconstIter it = dfInPtsMap.begin(), eit = dfInPtsMap.end(); it!=eit; ++it)
623  locs.set(it->first);
624 
625  for(DFPtsMapconstIter it = dfOutPtsMap.begin(), eit = dfOutPtsMap.end(); it!=eit; ++it)
626  locs.set(it->first);
627 
628  for (NodeBS::iterator it = locs.begin(), eit = locs.end(); it != eit; it++)
629  {
630  LocID loc = *it;
631  if (this->hasDFInSet(loc))
632  {
633  f << "Loc:" << loc << " IN:{";
634  this->dumpPts(this->getDFInPtsMap(loc), f);
635  f << "}\n";
636  }
637 
638  if (this->hasDFOutSet(loc))
639  {
640  f << "Loc:" << loc << " OUT:{";
641  this->dumpPts(this->getDFOutPtsMap(loc), f);
642  f << "}\n";
643  }
644  }
645  f.close();
646  if (f.good())
647  {
648  SVFUtil::outs() << "\n";
649  return;
650  }
651  }
652  SVFUtil::outs() << " error opening file for writing!\n";
653  }
const PtsMap & getDFOutPtsMap(LocID loc)
const PtsMap & getDFInPtsMap(LocID loc)
virtual bool hasDFInSet(LocID loc) const override
DFPtsMap dfInPtsMap
Data-flow IN set.
virtual bool hasDFOutSet(LocID loc) const override
DFPtsMap dfOutPtsMap
Data-flow OUT set.
DFPtsMap::const_iterator DFPtsMapconstIter
BaseDFPTData::LocID LocID
virtual void dumpPts(const PtsMap &ptsSet, OutStream &O=SVFUtil::outs()) const
SparseBitVectorIterator iterator
void set(unsigned Idx)
std::ostream & outs()
Overwrite llvm::outs()
Definition: SVFUtil.h:50
SparseBitVector NodeBS
Definition: GeneralType.h:62

◆ dumpPts()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual void SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::dumpPts ( const PtsMap ptsSet,
OutStream O = SVFUtil::outs() 
) const
inlinevirtual

Definition at line 655 of file MutablePointsToDS.h.

656  {
657  for (PtsMapConstIter nodeIt = ptsSet.begin(); nodeIt != ptsSet.end(); nodeIt++)
658  {
659  const Key& var = nodeIt->first;
660  const DataSet & pts = nodeIt->second;
661  if (pts.empty())
662  continue;
663  O << "<" << var << ",{";
664  SVFUtil::dumpSet(pts,O);
665  O << "}> ";
666  }
667  }
BaseMutPTData::PtsMapConstIter PtsMapConstIter
void dumpSet(NodeBS To, OutStream &O=SVFUtil::outs())
Dump sparse bitvector set.
Definition: SVFUtil.cpp:147

◆ getAllPts()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual Map<DataSet, unsigned> SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::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 561 of file MutablePointsToDS.h.

562  {
563  Map<DataSet, unsigned> allPts = mutPTData.getAllPts(liveOnly);
564  for (typename DFPtsMap::value_type lptsmap : dfInPtsMap)
565  {
566  for (typename PtsMap::value_type vpt : lptsmap.second)
567  {
568  ++allPts[vpt.second];
569  }
570  }
571 
572  for (typename DFPtsMap::value_type lptm : dfOutPtsMap)
573  {
574  for (typename PtsMap::value_type vpt : lptm.second)
575  {
576  ++allPts[vpt.second];
577  }
578  }
579 
580  return allPts;
581  }

◆ getDFIn()

template<typename Key , typename KeySet , typename Data , typename DataSet >
const DFPtsMap& SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::getDFIn ( )
inline

Definition at line 454 of file MutablePointsToDS.h.

455  {
456  return dfInPtsMap;
457  }

◆ getDFInPtsMap()

template<typename Key , typename KeySet , typename Data , typename DataSet >
const PtsMap& SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::getDFInPtsMap ( LocID  loc)
inline

Get internal flow-sensitive data structures.

Definition at line 446 of file MutablePointsToDS.h.

447  {
448  return dfInPtsMap[loc];
449  }

◆ getDFInPtsSet()

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

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

Definition at line 432 of file MutablePointsToDS.h.

433  {
434  PtsMap& inSet = dfInPtsMap[loc];
435  return inSet[var];
436  }
BaseMutPTData::PtsMap PtsMap

◆ getDFOut()

template<typename Key , typename KeySet , typename Data , typename DataSet >
const DFPtsMap& SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::getDFOut ( )
inline

Definition at line 458 of file MutablePointsToDS.h.

459  {
460  return dfOutPtsMap;
461  }

◆ getDFOutPtsMap()

template<typename Key , typename KeySet , typename Data , typename DataSet >
const PtsMap& SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::getDFOutPtsMap ( LocID  loc)
inline

Definition at line 450 of file MutablePointsToDS.h.

451  {
452  return dfOutPtsMap[loc];
453  }

◆ getDFOutPtsSet()

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

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

Definition at line 438 of file MutablePointsToDS.h.

439  {
440  PtsMap& outSet = dfOutPtsMap[loc];
441  return outSet[var];
442  }

◆ getPts()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual const DataSet& SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::getPts ( const Key &  var)
inlineoverridevirtual

Get points-to set of var.

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

Definition at line 393 of file MutablePointsToDS.h.

394  {
395  return mutPTData.getPts(var);
396  }

◆ getPtsMap()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual const PtsMap& SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::getPtsMap ( ) const
inlinevirtual

Definition at line 383 of file MutablePointsToDS.h.

384  {
385  return mutPTData.getPtsMap();
386  }

◆ getRevPts()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual const KeySet& SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::getRevPts ( const Data &  datum)
inlineoverridevirtual

Get reverse points-to set of a datum.

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

Definition at line 398 of file MutablePointsToDS.h.

399  {
400  assert(this->rev && "MutableDFPTData::getRevPts: constructed without reverse PT support!");
401  return mutPTData.getRevPts(datum);
402  }
bool rev
Whether we maintain reverse points-to sets or not.

◆ hasDFInSet() [1/2]

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

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

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

Definition at line 404 of file MutablePointsToDS.h.

405  {
406  return (dfInPtsMap.find(loc) != dfInPtsMap.end());
407  }

◆ hasDFInSet() [2/2]

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

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

Definition at line 414 of file MutablePointsToDS.h.

415  {
416  DFPtsMapconstIter it = dfInPtsMap.find(loc);
417  if ( it == dfInPtsMap.end())
418  return false;
419  const PtsMap& ptsMap = it->second;
420  return (ptsMap.find(var) != ptsMap.end());
421  }

◆ hasDFOutSet() [1/2]

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

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

Definition at line 409 of file MutablePointsToDS.h.

410  {
411  return (dfOutPtsMap.find(loc) != dfOutPtsMap.end());
412  }

◆ hasDFOutSet() [2/2]

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

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

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

Definition at line 423 of file MutablePointsToDS.h.

424  {
425  DFPtsMapconstIter it = dfOutPtsMap.find(loc);
426  if ( it == dfOutPtsMap.end())
427  return false;
428  const PtsMap& ptsMap = it->second;
429  return (ptsMap.find(var) != ptsMap.end());
430  }

◆ remapAllPts()

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual void SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::remapAllPts ( void  )
inlineoverridevirtual

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

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

Definition at line 546 of file MutablePointsToDS.h.

547  {
548  mutPTData.remapAllPts();
549  for (typename DFPtsMap::value_type &lopt : dfInPtsMap)
550  {
551  for (typename PtsMap::value_type &opt : lopt.second) opt.second.checkAndRemap();
552  }
553 
554  for (typename DFPtsMap::value_type &lopt : dfOutPtsMap)
555  {
556  for (typename PtsMap::value_type &opt : lopt.second) opt.second.checkAndRemap();
557  }
558  }

◆ unionPts() [1/3]

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual bool SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::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 534 of file MutablePointsToDS.h.

535  {
536  return unionPts(mutPTData.ptsMap[dstKey], srcDataSet);
537  }
virtual bool unionPts(const Key &dstKey, const Key &srcKey) override
Performs pts(dstVar) = pts(dstVar) U pts(srcVar).

◆ unionPts() [2/3]

template<typename Key , typename KeySet , typename Data , typename DataSet >
virtual bool SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::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 530 of file MutablePointsToDS.h.

531  {
532  return unionPts(mutPTData.ptsMap[dstKey], getPts(srcKey));
533  }
virtual const DataSet & getPts(const Key &var) override
Get points-to set of var.

◆ unionPts() [3/3]

template<typename Key , typename KeySet , typename Data , typename DataSet >
bool SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::unionPts ( DataSet &  dstDataSet,
const DataSet &  srcDataSet 
)
inlineprotected

Internal union/add points-to helper methods.

Definition at line 599 of file MutablePointsToDS.h.

600  {
601  return dstDataSet |= srcDataSet;
602  }

◆ updateAllDFInFromIn()

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

Union (IN[dstLoc::dstVar], IN[srcLoc:srcVar]. There is no flag check, unlike the above.

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

Reimplemented in SVF::MutableIncDFPTData< Key, KeySet, Data, DataSet >.

Definition at line 484 of file MutablePointsToDS.h.

485  {
486  return this->updateDFInFromIn(srcLoc,srcVar,dstLoc,dstVar);
487  }
virtual bool updateDFInFromIn(LocID srcLoc, const Key &srcVar, LocID dstLoc, const Key &dstVar) override

◆ updateAllDFInFromOut()

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

Union (IN[dstLoc::dstVar], OUT[srcLoc:srcVar]. There is no flag check, unlike the above.

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

Reimplemented in SVF::MutableIncDFPTData< Key, KeySet, Data, DataSet >.

Definition at line 479 of file MutablePointsToDS.h.

480  {
481  return this->updateDFInFromOut(srcLoc,srcVar,dstLoc,dstVar);
482  }
virtual bool updateDFInFromOut(LocID srcLoc, const Key &srcVar, LocID dstLoc, const Key &dstVar) override
Union (IN[dstLoc:dstVar], OUT[srcLoc:srcVar]).

◆ updateAllDFOutFromIn()

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

For each variable var in IN at loc, do updateDFOutFromIn(loc, var, loc, var).

Only variables has new pts from IN set need to be updated.

Enable strong updates if it is required to do so

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

Reimplemented in SVF::MutableIncDFPTData< Key, KeySet, Data, DataSet >.

Definition at line 489 of file MutablePointsToDS.h.

490  {
491  bool changed = false;
492  if (this->hasDFInSet(loc))
493  {
495  const PtsMap & ptsMap = getDFInPtsMap(loc);
496  for (typename PtsMap::const_iterator ptsIt = ptsMap.begin(), ptsEit = ptsMap.end(); ptsIt != ptsEit; ++ptsIt)
497  {
498  const Key var = ptsIt->first;
500  if (strongUpdates && var == singleton)
501  continue;
502  if (updateDFOutFromIn(loc, var, loc, var))
503  changed = true;
504  }
505  }
506  return changed;
507  }
virtual bool updateDFOutFromIn(LocID srcLoc, const Key &srcVar, LocID dstLoc, const Key &dstVar) override
Union (OUT[dstLoc:dstVar], IN[srcLoc:srcVar]).

◆ updateATVPts()

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

Update address-taken variables OUT[dstLoc:dstVar] with points-to of top-level pointers.

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

Reimplemented in SVF::MutableIncDFPTData< Key, KeySet, Data, DataSet >.

Definition at line 514 of file MutablePointsToDS.h.

515  {
516  return (this->unionPts(this->getDFOutPtsSet(dstLoc, dstVar), this->getPts(srcVar)));
517  }
virtual DataSet & getDFOutPtsSet(LocID loc, const Key &var) override

◆ updateDFInFromIn()

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

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]).

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

Reimplemented in SVF::MutableIncDFPTData< Key, KeySet, Data, DataSet >.

Definition at line 464 of file MutablePointsToDS.h.

465  {
466  return this->unionPts(getDFInPtsSet(dstLoc,dstVar), getDFInPtsSet(srcLoc,srcVar));
467  }
virtual DataSet & getDFInPtsSet(LocID loc, const Key &var) override

◆ updateDFInFromOut()

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

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

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

Reimplemented in SVF::MutableIncDFPTData< Key, KeySet, Data, DataSet >.

Definition at line 469 of file MutablePointsToDS.h.

470  {
471  return this->unionPts(getDFInPtsSet(dstLoc,dstVar), getDFOutPtsSet(srcLoc,srcVar));
472  }

◆ updateDFOutFromIn()

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

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

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

Reimplemented in SVF::MutableIncDFPTData< Key, KeySet, Data, DataSet >.

Definition at line 474 of file MutablePointsToDS.h.

475  {
476  return this->unionPts(getDFOutPtsSet(dstLoc,dstVar), getDFInPtsSet(srcLoc,srcVar));
477  }

◆ updateTLVPts()

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

Update points-to set of top-level pointers with IN[srcLoc:srcVar].

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

Reimplemented in SVF::MutableIncDFPTData< Key, KeySet, Data, DataSet >.

Definition at line 509 of file MutablePointsToDS.h.

510  {
511  return this->unionPts(dstVar, this->getDFInPtsSet(srcLoc,srcVar));
512  }

Member Data Documentation

◆ dfInPtsMap

template<typename Key , typename KeySet , typename Data , typename DataSet >
DFPtsMap SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::dfInPtsMap
protected

Data-flow IN set.

Definition at line 672 of file MutablePointsToDS.h.

◆ dfOutPtsMap

template<typename Key , typename KeySet , typename Data , typename DataSet >
DFPtsMap SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::dfOutPtsMap
protected

Data-flow OUT set.

Definition at line 674 of file MutablePointsToDS.h.

◆ mutPTData

template<typename Key , typename KeySet , typename Data , typename DataSet >
MutablePTData<Key, KeySet, Data, DataSet> SVF::MutableDFPTData< Key, KeySet, Data, DataSet >::mutPTData
protected

Backing to implement the basic PTData methods which are not overridden. This allows us to avoid multiple-inheritance.

Definition at line 677 of file MutablePointsToDS.h.


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