Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
SVF::InterDisjointMRG Class Reference

#include <MemPartition.h>

Inheritance diagram for SVF::InterDisjointMRG:
SVF::IntraDisjointMRG SVF::MRGenerator

Public Member Functions

 InterDisjointMRG (BVDataPTAImpl *p, bool ptrOnly)
 
 ~InterDisjointMRG ()
 
- Public Member Functions inherited from SVF::IntraDisjointMRG
 IntraDisjointMRG (BVDataPTAImpl *p, bool ptrOnly)
 
 ~IntraDisjointMRG ()
 
- Public Member Functions inherited from SVF::MRGenerator
MRSetgetMRSet ()
 
const NodeBSgetRepPointsTo (const NodeBS &cpts) const
 Get superset cpts set.
 
const MemRegiongetMR (const NodeBS &cpts) const
 Get a memory region according to cpts.
 
u32_t getMRNum () const
 
virtual ~MRGenerator ()
 Destructor.
 
virtual void generateMRs ()
 Start generating memory regions.
 
const SVFFunctiongetFunction (const PAGEdge *pagEdge) const
 Get the function which SVFIR Edge located.
 
MRSetgetFunMRSet (const SVFFunction *fun)
 Get Memory Region set.
 
MRSetgetLoadMRSet (const LoadStmt *load)
 
MRSetgetStoreMRSet (const StoreStmt *store)
 
bool hasRefMRSet (const CallICFGNode *cs)
 
bool hasModMRSet (const CallICFGNode *cs)
 
MRSetgetCallSiteRefMRSet (const CallICFGNode *cs)
 
MRSetgetCallSiteModMRSet (const CallICFGNode *cs)
 
bool hasSVFStmtList (const ICFGNode *icfgNode)
 Whether this instruction has SVFIR Edge.
 
SVFStmtListgetPAGEdgesFromInst (const ICFGNode *node)
 Given an instruction, get all its the PAGEdge (statement) in sequence.
 
NodeBS getModInfoForCall (const CallICFGNode *cs)
 getModRefInfo APIs
 
NodeBS getRefInfoForCall (const CallICFGNode *cs)
 
ModRefInfo getModRefInfo (const CallICFGNode *cs)
 
ModRefInfo getModRefInfo (const CallICFGNode *cs, const SVFValue *V)
 
ModRefInfo getModRefInfo (const CallICFGNode *cs1, const CallICFGNode *cs2)
 

Protected Member Functions

virtual void partitionMRs ()
 Partition regions.
 
virtual void getMRsForLoad (MRSet &aliasMRs, const NodeBS &cpts, const SVFFunction *)
 
- Protected Member Functions inherited from SVF::IntraDisjointMRG
void getMRsForLoadFromInterList (MRSet &mrs, const NodeBS &cpts, const PointsToList &inters)
 
virtual void getMRsForCallSiteRef (MRSet &aliasMRs, const NodeBS &cpts, const SVFFunction *fun)
 Get memory regions to be inserted at a load statement.
 
void createDisjointMR (const SVFFunction *func, const NodeBS &cpts)
 Create disjoint memory region.
 
void computeIntersections (const NodeBS &cpts, PointsToList &inters)
 Compute intersections between cpts and computed cpts intersections before.
 
- Protected Member Functions inherited from SVF::MRGenerator
 MRGenerator (BVDataPTAImpl *p, bool ptrOnly)
 
void createMR (const SVFFunction *fun, const NodeBS &cpts)
 Generate a memory region and put in into functions which use it.
 
void collectGlobals ()
 Collect all global variables for later escape analysis.
 
virtual void collectModRefForLoadStore ()
 Generate regions for loads/stores.
 
virtual void collectModRefForCall ()
 Generate regions for calls/rets.
 
virtual void updateAliasMRs ()
 Update aliased regions for loads/stores/callsites.
 
virtual void sortPointsTo (const NodeBS &cpts)
 Given a condition pts, insert into cptsToRepCPtsMap for region generation.
 
virtual bool isAliasedMR (const NodeBS &cpts, const MemRegion *mr)
 Whether a region is aliased with a conditional points-to.
 
virtual void getAliasMemRegions (MRSet &aliasMRs, const NodeBS &cpts, const SVFFunction *fun)
 Get all aliased mem regions from function fun according to cpts.
 
virtual void modRefAnalysis (PTACallGraphNode *callGraphNode, WorkList &worklist)
 Mod-Ref analysis for callsite invoking this callGraphNode.
 
virtual bool handleCallsiteModRef (NodeBS &mod, NodeBS &ref, const CallICFGNode *cs, const SVFFunction *fun)
 Get Mod-Ref of a callee function.
 
void addCPtsToStore (NodeBS &cpts, const StoreStmt *st, const SVFFunction *fun)
 Add cpts to store/load.
 
void addCPtsToLoad (NodeBS &cpts, const LoadStmt *ld, const SVFFunction *fun)
 
void addCPtsToCallSiteRefs (NodeBS &cpts, const CallICFGNode *cs)
 
void addCPtsToCallSiteMods (NodeBS &cpts, const CallICFGNode *cs)
 
bool hasCPtsList (const SVFFunction *fun) const
 
PointsToListgetPointsToList (const SVFFunction *fun)
 
FunToPointsTosMapgetFunToPointsToList ()
 
void addRefSideEffectOfFunction (const SVFFunction *fun, const NodeBS &refs)
 Add/Get methods for side-effect of functions and callsites.
 
void addModSideEffectOfFunction (const SVFFunction *fun, const NodeBS &mods)
 Add indirect def an memory object in the function.
 
bool addRefSideEffectOfCallSite (const CallICFGNode *cs, const NodeBS &refs)
 Add indirect uses an memory object in the function.
 
bool addModSideEffectOfCallSite (const CallICFGNode *cs, const NodeBS &mods)
 Add indirect def an memory object in the function.
 
const NodeBSgetRefSideEffectOfFunction (const SVFFunction *fun)
 Get indirect refs of a function.
 
const NodeBSgetModSideEffectOfFunction (const SVFFunction *fun)
 Get indirect mods of a function.
 
const NodeBSgetRefSideEffectOfCallSite (const CallICFGNode *cs)
 Get indirect refs of a callsite.
 
const NodeBSgetModSideEffectOfCallSite (const CallICFGNode *cs)
 Get indirect mods of a callsite.
 
bool hasRefSideEffectOfCallSite (const CallICFGNode *cs)
 Has indirect refs of a callsite.
 
bool hasModSideEffectOfCallSite (const CallICFGNode *cs)
 Has indirect mods of a callsite.
 

Private Attributes

PointsToList inters
 

Additional Inherited Members

- Public Types inherited from SVF::IntraDisjointMRG
typedef OrderedMap< NodeBS, PointsToListPtsToSubPtsMap
 
typedef Map< const SVFFunction *, PtsToSubPtsMapFunToPtsMap
 
typedef Map< const SVFFunction *, PointsToListFunToInterMap
 
- Public Types inherited from SVF::MRGenerator
typedef FIFOWorkList< NodeIDWorkList
 
typedef OrderedSet< const MemRegion *, MemRegion::equalMemRegionMRSet
 Get typedef from Pointer Analysis.
 
typedef Map< const PAGEdge *, const SVFFunction * > PAGEdgeToFunMap
 
typedef OrderedSet< NodeBS, SVFUtil::equalNodeBSPointsToList
 
typedef Map< const SVFFunction *, NodeBSFunToPointsToMap
 
typedef Map< const SVFFunction *, PointsToListFunToPointsTosMap
 
typedef OrderedMap< NodeBS, NodeBS, SVFUtil::equalNodeBSPtsToRepPtsSetMap
 
typedef Map< const SVFFunction *, MRSetFunToMRsMap
 Map a function to its region set.
 
typedef Map< const LoadStmt *, MRSetLoadsToMRsMap
 
typedef Map< const StoreStmt *, MRSetStoresToMRsMap
 
typedef Map< const CallICFGNode *, MRSetCallSiteToMRsMap
 
typedef Map< const LoadStmt *, NodeBSLoadsToPointsToMap
 Map loads/stores/callsites to their cpts set.
 
typedef Map< const StoreStmt *, NodeBSStoresToPointsToMap
 
typedef Map< const CallICFGNode *, NodeBSCallSiteToPointsToMap
 
typedef Map< const SVFFunction *, NodeBSFunToNodeBSMap
 Maps Mod-Ref analysis.
 
typedef Map< const CallICFGNode *, NodeBSCallSiteToNodeBSMap
 Map a callsite to its indirect refs/mods of memory objects.
 
typedef Map< NodeID, NodeBSNodeToPTSSMap
 
typedef SVFIR::SVFStmtList SVFStmtList
 SVFIR edge list.
 
typedef SCCDetection< PTACallGraph * > SCC
 Call Graph SCC.
 
- Protected Attributes inherited from SVF::MRGenerator
MRSet memRegSet
 A set of All memory regions.
 
PtsToRepPtsSetMap cptsToRepCPtsMap
 Map a condition pts to its rep conditional pts (super set points-to)
 

Detailed Description

Create memory regions which don't have intersections with each other in the whole program scope.

Definition at line 139 of file MemPartition.h.

Constructor & Destructor Documentation

◆ InterDisjointMRG()

SVF::InterDisjointMRG::InterDisjointMRG ( BVDataPTAImpl p,
bool  ptrOnly 
)
inline

Definition at line 142 of file MemPartition.h.

143 {}
cJSON * p
Definition cJSON.cpp:2559
IntraDisjointMRG(BVDataPTAImpl *p, bool ptrOnly)
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ ~InterDisjointMRG()

SVF::InterDisjointMRG::~InterDisjointMRG ( )
inline

Definition at line 145 of file MemPartition.h.

145{}

Member Function Documentation

◆ getMRsForLoad()

virtual void SVF::InterDisjointMRG::getMRsForLoad ( MRSet aliasMRs,
const NodeBS cpts,
const SVFFunction  
)
inlineprotectedvirtual

Get memory regions to be inserted at a load statement.

Parameters
cptsThe conditional points-to set of load statement.
funThe function being analyzed.
mrsMemory region set contains all possible target memory regions.

Reimplemented from SVF::IntraDisjointMRG.

Definition at line 157 of file MemPartition.h.

159 {
161 }
void getMRsForLoadFromInterList(MRSet &mrs, const NodeBS &cpts, const PointsToList &inters)

◆ partitionMRs()

void InterDisjointMRG::partitionMRs ( )
protectedvirtual

Partition regions.

Generate disjoint cpts.

Create memory regions.

Reimplemented from SVF::IntraDisjointMRG.

Definition at line 269 of file MemPartition.cpp.

270{
272 for(FunToPointsTosMap::iterator it = getFunToPointsToList().begin(),
273 eit = getFunToPointsToList().end(); it!=eit; ++it)
274 {
275 for(PointsToList::iterator cit = it->second.begin(), ecit = it->second.end();
276 cit!=ecit; ++cit)
277 {
278 const NodeBS& cpts = *cit;
279
281 }
282 }
283
285 for(FunToPointsTosMap::iterator it = getFunToPointsToList().begin(),
286 eit = getFunToPointsToList().end(); it!=eit; ++it)
287 {
288 const SVFFunction* fun = it->first;
289
290 for(PointsToList::iterator cit = it->second.begin(), ecit = it->second.end();
291 cit!=ecit; ++cit)
292 {
293 const NodeBS& cpts = *cit;
294
295 for (PointsToList::const_iterator interIt = inters.begin(), interEit = inters.end();
297 {
298 const NodeBS& inter = *interIt;
299 if (cpts.contains(inter))
301 }
302 }
303 }
304}
void createDisjointMR(const SVFFunction *func, const NodeBS &cpts)
Create disjoint memory region.
void computeIntersections(const NodeBS &cpts, PointsToList &inters)
Compute intersections between cpts and computed cpts intersections before.
FunToPointsTosMap & getFunToPointsToList()
Definition MemRegion.h:371
bool contains(const SparseBitVector< ElementSize > &RHS) const

Member Data Documentation

◆ inters

PointsToList SVF::InterDisjointMRG::inters
private

Definition at line 164 of file MemPartition.h.


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