Static Value-Flow Analysis
Loading...
Searching...
No Matches
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.
 
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.
 
virtual ~MutableDFPTData ()
 
virtual const PtsMapgetPtsMap () const
 
virtual void clear () override
 Clears all points-to sets as if nothing is stored.
 
virtual const DataSet & getPts (const Key &var) override
 Get points-to set of var.
 
virtual const KeySetgetRevPts (const Data &datum) override
 Get reverse points-to set of a datum.
 
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]).
 
virtual bool updateDFOutFromIn (LocID srcLoc, const Key &srcVar, LocID dstLoc, const Key &dstVar) override
 Union (OUT[dstLoc:dstVar], IN[srcLoc:srcVar]).
 
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.
 
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.
 
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).
 
virtual bool updateTLVPts (LocID srcLoc, const Key &srcVar, const Key &dstVar) override
 Update points-to set of top-level pointers with IN[srcLoc:srcVar].
 
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.
 
virtual void clearAllDFOutUpdatedVar (LocID) override
 
virtual Map< DataSet, unsignedgetAllPts (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).
 
virtual bool unionPts (const Key &dstKey, const DataSet &srcDataSet) override
 Performs pts(dstVar) = pts(dstVar) U srcDataSet.
 
virtual void clearPts (const Key &var, const Data &element) override
 Clears element from the points-to set of var.
 
virtual void clearFullPts (const Key &var) override
 Fully clears the points-to set of var.
 
virtual void remapAllPts (void) override
 Remaps all points-to sets to use the current mapping.
 
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.
 
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.
 
virtual bool addPts (const Key &var, const Data &element)=0
 Adds element to the points-to set associated with var.
 

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.
 
DFPtsMap dfOutPtsMap
 Data-flow OUT set.
 
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.
 
PTDataTy ptdTy
 

Detailed Description

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

Definition at line 362 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 367 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 366 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 365 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 373 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 375 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 374 of file MutablePointsToDS.h.

◆ LocID

Definition at line 370 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 368 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 371 of file MutablePointsToDS.h.

◆ PtsMapConstIter

Definition at line 372 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 378 of file MutablePointsToDS.h.

DFPTData< Key, KeySet, Data, DataSet > BaseDFPTData
MutablePTData< Key, KeySet, Data, DataSet > mutPTData
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76

◆ ~MutableDFPTData()

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

Definition at line 380 of file MutablePointsToDS.h.

380{ }

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 525 of file MutablePointsToDS.h.

526 {
527 return addPts(mutPTData.ptsMap[dstKey], srcKey);
528 }
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 602 of file MutablePointsToDS.h.

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

◆ 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 584 of file MutablePointsToDS.h.

585 {
586 return true;
587 }

◆ 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 588 of file MutablePointsToDS.h.

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

◆ 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 387 of file MutablePointsToDS.h.

388 {
389 mutPTData.clear();
390 }

◆ clearAllDFOutUpdatedVar()

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

◆ 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 541 of file MutablePointsToDS.h.

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

◆ 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 537 of file MutablePointsToDS.h.

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

◆ 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 611 of file MutablePointsToDS.h.

612 {
614 mutPTData.dumpPTData();
616 std::error_code ErrInfo;
617 std::fstream f("svfg_pts.data", std::ios_base::out);
618 if (f.good())
619 {
620 NodeBS locs;
621 for(DFPtsMapconstIter it = dfInPtsMap.begin(), eit = dfInPtsMap.end(); it!=eit; ++it)
622 locs.set(it->first);
623
624 for(DFPtsMapconstIter it = dfOutPtsMap.begin(), eit = dfOutPtsMap.end(); it!=eit; ++it)
625 locs.set(it->first);
626
627 for (NodeBS::iterator it = locs.begin(), eit = locs.end(); it != eit; it++)
628 {
629 LocID loc = *it;
630 if (this->hasDFInSet(loc))
631 {
632 f << "Loc:" << loc << " IN:{";
633 this->dumpPts(this->getDFInPtsMap(loc), f);
634 f << "}\n";
635 }
636
637 if (this->hasDFOutSet(loc))
638 {
639 f << "Loc:" << loc << " OUT:{";
640 this->dumpPts(this->getDFOutPtsMap(loc), f);
641 f << "}\n";
642 }
643 }
644 f.close();
645 if (f.good())
646 {
647 SVFUtil::outs() << "\n";
648 return;
649 }
650 }
651 SVFUtil::outs() << " error opening file for writing!\n";
652 }
const PtsMap & getDFInPtsMap(LocID loc)
const PtsMap & getDFOutPtsMap(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:52
SparseBitVector NodeBS
Definition GeneralType.h:82

◆ 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 654 of file MutablePointsToDS.h.

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

◆ 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 560 of file MutablePointsToDS.h.

561 {
563 for (typename DFPtsMap::value_type lptsmap : dfInPtsMap)
564 {
565 for (typename PtsMap::value_type vpt : lptsmap.second)
566 {
567 ++allPts[vpt.second];
568 }
569 }
570
571 for (typename DFPtsMap::value_type lptm : dfOutPtsMap)
572 {
573 for (typename PtsMap::value_type vpt : lptm.second)
574 {
575 ++allPts[vpt.second];
576 }
577 }
578
579 return allPts;
580 }

◆ getDFIn()

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

Definition at line 453 of file MutablePointsToDS.h.

454 {
455 return dfInPtsMap;
456 }

◆ 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 445 of file MutablePointsToDS.h.

446 {
447 return dfInPtsMap[loc];
448 }

◆ 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 431 of file MutablePointsToDS.h.

432 {
434 return inSet[var];
435 }
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 457 of file MutablePointsToDS.h.

458 {
459 return dfOutPtsMap;
460 }

◆ 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 449 of file MutablePointsToDS.h.

450 {
451 return dfOutPtsMap[loc];
452 }

◆ 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 437 of file MutablePointsToDS.h.

438 {
440 return outSet[var];
441 }

◆ 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 392 of file MutablePointsToDS.h.

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

◆ 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 382 of file MutablePointsToDS.h.

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

◆ 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 397 of file MutablePointsToDS.h.

398 {
399 assert(this->rev && "MutableDFPTData::getRevPts: constructed without reverse PT support!");
400 return mutPTData.getRevPts(datum);
401 }
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 403 of file MutablePointsToDS.h.

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

◆ 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 413 of file MutablePointsToDS.h.

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

◆ 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 408 of file MutablePointsToDS.h.

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

◆ 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 422 of file MutablePointsToDS.h.

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

◆ 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 545 of file MutablePointsToDS.h.

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

◆ 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 533 of file MutablePointsToDS.h.

534 {
535 return unionPts(mutPTData.ptsMap[dstKey], srcDataSet);
536 }
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 529 of file MutablePointsToDS.h.

530 {
531 return unionPts(mutPTData.ptsMap[dstKey], getPts(srcKey));
532 }
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 598 of file MutablePointsToDS.h.

599 {
600 return dstDataSet |= srcDataSet;
601 }

◆ 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 483 of file MutablePointsToDS.h.

484 {
486 }
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 478 of file MutablePointsToDS.h.

479 {
481 }
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 488 of file MutablePointsToDS.h.

489 {
490 bool changed = false;
491 if (this->hasDFInSet(loc))
492 {
494 const PtsMap & ptsMap = getDFInPtsMap(loc);
495 for (typename PtsMap::const_iterator ptsIt = ptsMap.begin(), ptsEit = ptsMap.end(); ptsIt != ptsEit; ++ptsIt)
496 {
497 const Key var = ptsIt->first;
499 if (strongUpdates && var == singleton)
500 continue;
502 changed = true;
503 }
504 }
505 return changed;
506 }
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 513 of file MutablePointsToDS.h.

514 {
515 return (this->unionPts(this->getDFOutPtsSet(dstLoc, dstVar), this->getPts(srcVar)));
516 }
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 463 of file MutablePointsToDS.h.

464 {
466 }
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 468 of file MutablePointsToDS.h.

469 {
471 }

◆ 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 473 of file MutablePointsToDS.h.

474 {
476 }

◆ 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 508 of file MutablePointsToDS.h.

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

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 671 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 673 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 676 of file MutablePointsToDS.h.


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