Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
SVF::BVDataPTAImpl Class Reference

#include <PointerAnalysisImpl.h>

Inheritance diagram for SVF::BVDataPTAImpl:
SVF::PointerAnalysis SVF::AndersenBase SVF::CFLBase SVF::FlowDDA SVF::FlowSensitive SVF::Andersen SVF::Steensgaard SVF::TypeAnalysis SVF::CFLAlias SVF::CFLVF SVF::VersionedFlowSensitive SVF::AndersenSCD SVF::AndersenWaveDiff SVF::POCRAlias SVF::POCRHybrid SVF::AndersenSFR

Public Types

enum  PTBackingType { Mutable , Persistent }
 How the PTData used is implemented. More...
 
typedef PTData< NodeID, NodeSet, NodeID, PointsToPTDataTy
 
typedef DiffPTData< NodeID, NodeSet, NodeID, PointsToDiffPTDataTy
 
typedef DFPTData< NodeID, NodeSet, NodeID, PointsToDFPTDataTy
 
typedef VersionedPTData< NodeID, NodeSet, NodeID, PointsTo, VersionedVar, Set< VersionedVar > > VersionedPTDataTy
 
typedef MutablePTData< NodeID, NodeSet, NodeID, PointsToMutPTDataTy
 
typedef MutableDiffPTData< NodeID, NodeSet, NodeID, PointsToMutDiffPTDataTy
 
typedef MutableDFPTData< NodeID, NodeSet, NodeID, PointsToMutDFPTDataTy
 
typedef MutableIncDFPTData< NodeID, NodeSet, NodeID, PointsToMutIncDFPTDataTy
 
typedef MutableVersionedPTData< NodeID, NodeSet, NodeID, PointsTo, VersionedVar, Set< VersionedVar > > MutVersionedPTDataTy
 
typedef PersistentPTData< NodeID, NodeSet, NodeID, PointsToPersPTDataTy
 
typedef PersistentDiffPTData< NodeID, NodeSet, NodeID, PointsToPersDiffPTDataTy
 
typedef PersistentDFPTData< NodeID, NodeSet, NodeID, PointsToPersDFPTDataTy
 
typedef PersistentIncDFPTData< NodeID, NodeSet, NodeID, PointsToPersIncDFPTDataTy
 
typedef PersistentVersionedPTData< NodeID, NodeSet, NodeID, PointsTo, VersionedVar, Set< VersionedVar > > PersVersionedPTDataTy
 
- Public Types inherited from SVF::PointerAnalysis
enum  PTATY {
  Andersen_BASE , Andersen_WPA , AndersenSCD_WPA , AndersenSFR_WPA ,
  AndersenWaveDiff_WPA , Steensgaard_WPA , CSCallString_WPA , CSSummary_WPA ,
  FSDATAFLOW_WPA , FSSPARSE_WPA , VFS_WPA , FSCS_WPA ,
  CFLFICI_WPA , CFLFSCI_WPA , CFLFSCS_WPA , TypeCPP_WPA ,
  FieldS_DDA , FlowS_DDA , PathS_DDA , Cxt_DDA ,
  Default_PTA
}
 Pointer analysis type list. More...
 
enum  PTAImplTy { BaseImpl , BVDataImpl , CondImpl }
 Implementation type: BVDataPTAImpl or CondPTAImpl. More...
 
typedef Set< const CallICFGNode * > CallSiteSet
 Indirect call edges type, map a callsite to a set of callees.
 
typedef SVFIR::CallSiteToFunPtrMap CallSiteToFunPtrMap
 
typedef Set< const SVFFunction * > FunctionSet
 
typedef OrderedMap< const CallICFGNode *, FunctionSetCallEdgeMap
 
typedef SCCDetection< PTACallGraph * > CallGraphSCC
 
typedef Set< const SVFGlobalValue * > VTableSet
 
typedef Set< const SVFFunction * > VFunSet
 

Public Member Functions

 BVDataPTAImpl (SVFIR *pag, PointerAnalysis::PTATY type, bool alias_check=true)
 Constructor.
 
 ~BVDataPTAImpl () override=default
 Destructor.
 
PersistentPointsToCache< PointsTo > & getPtCache ()
 
- Public Member Functions inherited from SVF::PointerAnalysis
ICFGgetICFG () const
 Get ICFG.
 
u32_t getNumOfResolvedIndCallEdge () const
 Return number of resolved indirect call edges.
 
PTACallGraphgetCallGraph () const
 Return call graph.
 
CallGraphSCCgetCallGraphSCC () const
 Return call graph SCC.
 
 PointerAnalysis (SVFIR *pag, PTATY ty=Default_PTA, bool alias_check=true)
 Constructor.
 
PTATY getAnalysisTy () const
 Type of pointer analysis.
 
PTAImplTy getImplTy () const
 Return implementation type of the pointer analysis.
 
bool printStat ()
 Whether print statistics.
 
void disablePrintStat ()
 Whether print statistics.
 
CallEdgeMapgetIndCallMap ()
 Get callees from an indirect callsite.
 
bool hasIndCSCallees (const CallICFGNode *cs) const
 
const FunctionSetgetIndCSCallees (const CallICFGNode *cs) const
 
virtual void resolveIndCalls (const CallICFGNode *cs, const PointsTo &target, CallEdgeMap &newEdges)
 Resolve indirect call edges.
 
void callGraphSCCDetection ()
 PTACallGraph SCC related methods.
 
NodeID getCallGraphSCCRepNode (NodeID id) const
 Get SCC rep node of a SVFG node.
 
bool inSameCallGraphSCC (const SVFFunction *fun1, const SVFFunction *fun2)
 Return TRUE if this edge is inside a PTACallGraph SCC, i.e., src node and dst node are in the same SCC on the SVFG.
 
bool isInRecursion (const SVFFunction *fun) const
 
bool isLocalVarInRecursiveFun (NodeID id) const
 Whether a local variable is in function recursions.
 
virtual const std::string PTAName () const
 Return PTA name.
 
CommonCHGraphgetCHGraph () const
 get CHGraph
 
void getVFnsFromCHA (const CallICFGNode *cs, VFunSet &vfns)
 
void getVFnsFromPts (const CallICFGNode *cs, const PointsTo &target, VFunSet &vfns)
 
void connectVCallToVFns (const CallICFGNode *cs, const VFunSet &vfns, CallEdgeMap &newEdges)
 
virtual void resolveCPPIndCalls (const CallICFGNode *cs, const PointsTo &target, CallEdgeMap &newEdges)
 Resolve cpp indirect call edges.
 
SVFIRgetPAG () const
 
PTAStatgetStat () const
 Get PTA stat.
 
SVFModulegetModule () const
 Module.
 
OrderedNodeSetgetAllValidPtrs ()
 Get all Valid Pointers for resolution.
 
virtual void initialize ()
 Initialization of a pointer analysis, including building symbol table and SVFIR etc.
 
virtual void analyze ()=0
 Start Analysis here (main part of pointer analysis). It needs to be implemented in child class.
 
virtual void computeDDAPts (NodeID)
 Compute points-to results on-demand, overridden by derived classes.
 
void printIndCSTargets (const CallICFGNode *cs, const FunctionSet &targets)
 Print targets of a function pointer.
 
virtual void dumpPts (NodeID ptr, const PointsTo &pts)
 
void printIndCSTargets ()
 
void dumpAllTypes ()
 
void dumpStat ()
 Dump the statistics.
 
bool containBlackHoleNode (const PointsTo &pts)
 Determine whether a points-to contains a black hole or constant node.
 
bool containConstantNode (const PointsTo &pts)
 
virtual bool isBlkObjOrConstantObj (NodeID ptd) const
 
bool isHeapMemObj (NodeID id) const
 Whether this object is heap or array.
 
bool isArrayMemObj (NodeID id) const
 
bool isFIObjNode (NodeID id) const
 
NodeID getBaseObjVar (NodeID id)
 
NodeID getFIObjVar (NodeID id)
 
NodeID getGepObjVar (NodeID id, const APOffset &ap)
 
virtual const NodeBSgetAllFieldsObjVars (NodeID id)
 
void setObjFieldInsensitive (NodeID id)
 
bool isFieldInsensitive (NodeID id) const
 

Static Public Member Functions

static bool classof (const PointerAnalysis *pta)
 
std::unique_ptr< PTDataTyptD
 Points-to data.
 
PersistentPointsToCache< PointsToptCache
 
const PointsTogetPts (NodeID id) override
 
const NodeSetgetRevPts (NodeID nodeId) override
 
virtual void clearPts (NodeID id, NodeID element)
 Remove element from the points-to set of id.
 
virtual void clearFullPts (NodeID id)
 Clear points-to set of id.
 
virtual bool unionPts (NodeID id, const PointsTo &target)
 
virtual bool unionPts (NodeID id, NodeID ptd)
 
virtual bool addPts (NodeID id, NodeID ptd)
 
virtual void clearAllPts ()
 Clear all data.
 
virtual void expandFIObjs (const PointsTo &pts, PointsTo &expandedPts)
 Expand FI objects.
 
virtual void expandFIObjs (const NodeBS &pts, NodeBS &expandedPts)
 TODO: remove repetition.
 
void remapPointsToSets (void)
 Remap all points-to sets to use the current mapping.
 
virtual void writeToFile (const std::string &filename)
 Interface for analysis result storage on filesystem.
 
virtual void writeObjVarToFile (const std::string &filename)
 
virtual void writePtsResultToFile (std::fstream &f)
 
virtual void writeGepObjVarMapToFile (std::fstream &f)
 
virtual bool readFromFile (const std::string &filename)
 
virtual void readPtsResultFromFile (std::ifstream &f)
 
virtual void readGepObjVarMapFromFile (std::ifstream &f)
 
virtual void readAndSetObjFieldSensitivity (std::ifstream &f, const std::string &delimiterStr)
 
AliasResult alias (const SVFValue *V1, const SVFValue *V2) override
 Interface expose to users of our pointer analysis, given Value infos.
 
AliasResult alias (NodeID node1, NodeID node2) override
 Interface expose to users of our pointer analysis, given PAGNodeID.
 
virtual AliasResult alias (const PointsTo &pts1, const PointsTo &pts2)
 Interface expose to users of our pointer analysis, given two pts.
 
void dumpCPts () override
 dump and debug, print out conditional pts
 
void dumpTopLevelPtsTo () override
 
void dumpAllPts () override
 
PTDataTygetPTDataTy () const
 Get points-to data structure.
 
void finalize () override
 Finalization of pointer analysis, and normalize points-to information to Bit Vector representation.
 
virtual bool updateCallGraph (const CallSiteToFunPtrMap &)
 Update callgraph. This should be implemented by its subclass.
 
DiffPTDataTygetDiffPTDataTy () const
 
DFPTDataTygetDFPTDataTy () const
 
MutDFPTDataTygetMutDFPTDataTy () const
 
VersionedPTDataTygetVersionedPTDataTy () const
 
virtual void onTheFlyCallGraphSolve (const CallSiteToFunPtrMap &callsites, CallEdgeMap &newEdges)
 On the fly call graph construction.
 
virtual void onTheFlyThreadCallGraphSolve (const CallSiteToFunPtrMap &callsites, CallEdgeMap &newForkEdges)
 On the fly thread call graph construction respecting forksite.
 
virtual void normalizePointsTo ()
 

Additional Inherited Members

- Static Public Attributes inherited from SVF::PointerAnalysis
static const std::string aliasTestMayAlias = "MAYALIAS"
 
static const std::string aliasTestMayAliasMangled = "_Z8MAYALIASPvS_"
 
static const std::string aliasTestNoAlias = "NOALIAS"
 
static const std::string aliasTestNoAliasMangled = "_Z7NOALIASPvS_"
 
static const std::string aliasTestPartialAlias = "PARTIALALIAS"
 
static const std::string aliasTestPartialAliasMangled = "_Z12PARTIALALIASPvS_"
 
static const std::string aliasTestMustAlias = "MUSTALIAS"
 
static const std::string aliasTestMustAliasMangled = "_Z9MUSTALIASPvS_"
 
static const std::string aliasTestFailMayAlias = "EXPECTEDFAIL_MAYALIAS"
 
static const std::string aliasTestFailMayAliasMangled = "_Z21EXPECTEDFAIL_MAYALIASPvS_"
 
static const std::string aliasTestFailNoAlias = "EXPECTEDFAIL_NOALIAS"
 
static const std::string aliasTestFailNoAliasMangled = "_Z20EXPECTEDFAIL_NOALIASPvS_"
 
- Protected Member Functions inherited from SVF::PointerAnalysis
const CallSiteToFunPtrMapgetIndirectCallsites () const
 Return all indirect callsites.
 
NodeID getFunPtr (const CallICFGNode *cs) const
 Return function pointer PAGNode at a callsite cs.
 
virtual void validateTests ()
 Alias check functions to verify correctness of pointer analysis.
 
virtual void validateSuccessTests (std::string fun)
 
virtual void validateExpectedFailureTests (std::string fun)
 
void resetObjFieldSensitive ()
 Reset all object node as field-sensitive.
 
- Protected Attributes inherited from SVF::PointerAnalysis
bool print_stat
 User input flags.
 
bool alias_validation
 Flag for validating points-to/alias results.
 
u32_t OnTheFlyIterBudgetForStat
 Flag for iteration budget for on-the-fly statistics.
 
SVFModulesvfMod
 Module.
 
PTATY ptaTy
 Pointer analysis Type.
 
PTAImplTy ptaImplTy
 PTA implementation type.
 
PTAStatstat
 Statistics.
 
PTACallGraphcallgraph
 Call graph used for pointer analysis.
 
CallGraphSCCcallGraphSCC
 SCC for PTACallGraph.
 
ICFGicfg
 Interprocedural control-flow graph.
 
CommonCHGraphchgraph
 CHGraph.
 
- Static Protected Attributes inherited from SVF::PointerAnalysis
static SVFIRpag = nullptr
 SVFIR.
 

Detailed Description

Pointer analysis implementation which uses bit vector based points-to data structure

Definition at line 42 of file PointerAnalysisImpl.h.

Member Typedef Documentation

◆ DFPTDataTy

Definition at line 48 of file PointerAnalysisImpl.h.

◆ DiffPTDataTy

Definition at line 47 of file PointerAnalysisImpl.h.

◆ MutDFPTDataTy

Definition at line 53 of file PointerAnalysisImpl.h.

◆ MutDiffPTDataTy

Definition at line 52 of file PointerAnalysisImpl.h.

◆ MutIncDFPTDataTy

Definition at line 54 of file PointerAnalysisImpl.h.

◆ MutPTDataTy

Definition at line 51 of file PointerAnalysisImpl.h.

◆ MutVersionedPTDataTy

Definition at line 55 of file PointerAnalysisImpl.h.

◆ PersDFPTDataTy

Definition at line 59 of file PointerAnalysisImpl.h.

◆ PersDiffPTDataTy

Definition at line 58 of file PointerAnalysisImpl.h.

◆ PersIncDFPTDataTy

Definition at line 60 of file PointerAnalysisImpl.h.

◆ PersPTDataTy

Definition at line 57 of file PointerAnalysisImpl.h.

◆ PersVersionedPTDataTy

Definition at line 61 of file PointerAnalysisImpl.h.

◆ PTDataTy

Definition at line 46 of file PointerAnalysisImpl.h.

◆ VersionedPTDataTy

Definition at line 49 of file PointerAnalysisImpl.h.

Member Enumeration Documentation

◆ PTBackingType

How the PTData used is implemented.

Enumerator
Mutable 
Persistent 

Definition at line 64 of file PointerAnalysisImpl.h.

Constructor & Destructor Documentation

◆ BVDataPTAImpl()

BVDataPTAImpl::BVDataPTAImpl ( SVFIR p,
PointerAnalysis::PTATY  type,
bool  alias_check = true 
)

Constructor.

Constructor

Definition at line 46 of file PointerAnalysisImpl.cpp.

46 :
48{
50 || type == TypeCPP_WPA || type == FlowS_DDA
52 {
53 // Only maintain reverse points-to when the analysis is field-sensitive, as objects turning
54 // field-insensitive is all it is used for.
56 if (Options::ptDataBacking() == PTBackingType::Mutable) ptD = std::make_unique<MutDiffPTDataTy>(maintainRevPts);
57 else if (Options::ptDataBacking() == PTBackingType::Persistent) ptD = std::make_unique<PersDiffPTDataTy>(getPtCache(), maintainRevPts);
58 else assert(false && "BVDataPTAImpl::BVDataPTAImpl: unexpected points-to backing type!");
59 }
60 else if (type == Steensgaard_WPA)
61 {
62 // Steensgaard is only field-insensitive (for now?), so no reverse points-to.
63 if (Options::ptDataBacking() == PTBackingType::Mutable) ptD = std::make_unique<MutDiffPTDataTy>(false);
64 else if (Options::ptDataBacking() == PTBackingType::Persistent) ptD = std::make_unique<PersDiffPTDataTy>(getPtCache(), false);
65 else assert(false && "BVDataPTAImpl::BVDataPTAImpl: unexpected points-to backing type!");
66 }
67 else if (type == FSSPARSE_WPA)
68 {
70 {
71 if (Options::ptDataBacking() == PTBackingType::Mutable) ptD = std::make_unique<MutIncDFPTDataTy>(false);
72 else if (Options::ptDataBacking() == PTBackingType::Persistent) ptD = std::make_unique<PersIncDFPTDataTy>(getPtCache(), false);
73 else assert(false && "BVDataPTAImpl::BVDataPTAImpl: unexpected points-to backing type!");
74 }
75 else
76 {
77 if (Options::ptDataBacking() == PTBackingType::Mutable) ptD = std::make_unique<MutDFPTDataTy>(false);
78 else if (Options::ptDataBacking() == PTBackingType::Persistent) ptD = std::make_unique<PersDFPTDataTy>(getPtCache(), false);
79 else assert(false && "BVDataPTAImpl::BVDataPTAImpl: unexpected points-to backing type!");
80 }
81 }
82 else if (type == VFS_WPA)
83 {
84 if (Options::ptDataBacking() == PTBackingType::Mutable) ptD = std::make_unique<MutVersionedPTDataTy>(false);
85 else if (Options::ptDataBacking() == PTBackingType::Persistent) ptD = std::make_unique<PersVersionedPTDataTy>(getPtCache(), false);
86 else assert(false && "BVDataPTAImpl::BVDataPTAImpl: unexpected points-to backing type!");
87 }
88 else assert(false && "no points-to data available");
89
91}
cJSON * p
Definition cJSON.cpp:2559
newitem type
Definition cJSON.cpp:2739
PersistentPointsToCache< PointsTo > ptCache
std::unique_ptr< PTDataTy > ptD
Points-to data.
PersistentPointsToCache< PointsTo > & getPtCache()
static const Option< bool > INCDFPTData
Definition Options.h:136
static const Option< u32_t > MaxFieldLimit
Maximum number of field derivations for an object.
Definition Options.h:38
static const OptionMap< BVDataPTAImpl::PTBackingType > ptDataBacking
PTData type.
Definition Options.h:69
@ CFLFICI_WPA
Flow-, context-, insensitive CFL-reachability-based analysis.
@ VFS_WPA
Versioned sparse flow-sensitive WPA.
@ AndersenSCD_WPA
Selective cycle detection andersen-style WPA.
@ Andersen_BASE
Base Andersen PTA.
@ FlowS_DDA
Flow sensitive DDA.
@ Andersen_WPA
Andersen PTA.
@ CFLFSCS_WPA
Flow-, context-, CFL-reachability-based analysis.
@ AndersenWaveDiff_WPA
Diff wave propagation andersen-style WPA.
@ TypeCPP_WPA
Type-based analysis for C++.
@ AndersenSFR_WPA
Stride-based field representation.
@ Steensgaard_WPA
Steensgaard PTA.
@ FSSPARSE_WPA
Sparse flow sensitive WPA.
PTAImplTy ptaImplTy
PTA implementation type.
@ BVDataImpl
Represents BVDataPTAImpl.
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ ~BVDataPTAImpl()

SVF::BVDataPTAImpl::~BVDataPTAImpl ( )
overridedefault

Destructor.

Member Function Documentation

◆ addPts()

virtual bool SVF::BVDataPTAImpl::addPts ( NodeID  id,
NodeID  ptd 
)
inlinevirtual

Definition at line 121 of file PointerAnalysisImpl.h.

122 {
123 return ptD->addPts(id,ptd);
124 }

◆ alias() [1/3]

AliasResult BVDataPTAImpl::alias ( const PointsTo p1,
const PointsTo p2 
)
virtual

Interface expose to users of our pointer analysis, given two pts.

Return alias results based on our points-to/alias analysis

Definition at line 628 of file PointerAnalysisImpl.cpp.

629{
630
635
638 else
640}
virtual void expandFIObjs(const PointsTo &pts, PointsTo &expandedPts)
Expand FI objects.
bool containBlackHoleNode(const PointsTo &pts)
Determine whether a points-to contains a black hole or constant node.
@ MayAlias
Definition SVFType.h:529
@ NoAlias
Definition SVFType.h:528

◆ alias() [2/3]

AliasResult BVDataPTAImpl::alias ( const SVFValue V1,
const SVFValue V2 
)
overridevirtual

Interface expose to users of our pointer analysis, given Value infos.

Return alias results based on our points-to/alias analysis

Implements SVF::PointerAnalysis.

Reimplemented in SVF::CFLAlias.

Definition at line 611 of file PointerAnalysisImpl.cpp.

613{
615}
AliasResult alias(const SVFValue *V1, const SVFValue *V2) override
Interface expose to users of our pointer analysis, given Value infos.
NodeID getValueNode(const SVFValue *V)
Definition IRGraph.h:137
static SVFIR * pag
SVFIR.

◆ alias() [3/3]

AliasResult BVDataPTAImpl::alias ( NodeID  node1,
NodeID  node2 
)
overridevirtual

Interface expose to users of our pointer analysis, given PAGNodeID.

Return alias results based on our points-to/alias analysis

Implements SVF::PointerAnalysis.

Reimplemented in SVF::CFLAlias.

Definition at line 620 of file PointerAnalysisImpl.cpp.

621{
622 return alias(getPts(node1),getPts(node2));
623}
const PointsTo & getPts(NodeID id) override

◆ classof()

static bool SVF::BVDataPTAImpl::classof ( const PointerAnalysis pta)
inlinestatic

Definition at line 81 of file PointerAnalysisImpl.h.

82 {
83 return pta->getImplTy() == BVDataImpl;
84 }

◆ clearAllPts()

virtual void SVF::BVDataPTAImpl::clearAllPts ( )
inlinevirtual

Clear all data.

Definition at line 128 of file PointerAnalysisImpl.h.

129 {
130 ptD->clear();
131 }

◆ clearFullPts()

virtual void SVF::BVDataPTAImpl::clearFullPts ( NodeID  id)
inlinevirtual

Clear points-to set of id.

Definition at line 105 of file PointerAnalysisImpl.h.

106 {
107 ptD->clearFullPts(id);
108 }

◆ clearPts()

virtual void SVF::BVDataPTAImpl::clearPts ( NodeID  id,
NodeID  element 
)
inlinevirtual

Remove element from the points-to set of id.

Definition at line 99 of file PointerAnalysisImpl.h.

100 {
101 ptD->clearPts(id, element);
102 }

◆ dumpAllPts()

void BVDataPTAImpl::dumpAllPts ( )
overridevirtual

Dump all points-to including top-level (ValVar) and address-taken (ObjVar) variables

Reimplemented from SVF::PointerAnalysis.

Definition at line 471 of file PointerAnalysisImpl.cpp.

472{
474 for(SVFIR::iterator it = pag->begin(), eit = pag->end(); it!=eit; it++)
475 {
476 pagNodes.insert(it->first);
477 }
478
479 for (NodeID n : pagNodes)
480 {
481 outs() << "----------------------------------------------\n";
482 dumpPts(n, this->getPts(n));
483 }
484
485 outs() << "----------------------------------------------\n";
486}
cJSON * n
Definition cJSON.cpp:2558
iterator begin()
Iterators.
IDToNodeMapTy::iterator iterator
Node Iterators.
virtual void dumpPts(NodeID ptr, const PointsTo &pts)
std::ostream & outs()
Overwrite llvm::outs()
Definition SVFUtil.h:50
OrderedSet< NodeID > OrderedNodeSet
u32_t NodeID
Definition GeneralType.h:55

◆ dumpCPts()

void SVF::BVDataPTAImpl::dumpCPts ( )
inlineoverridevirtual

dump and debug, print out conditional pts

Reimplemented from SVF::PointerAnalysis.

Definition at line 229 of file PointerAnalysisImpl.h.

230 {
231 ptD->dumpPTData();
232 }

◆ dumpTopLevelPtsTo()

void BVDataPTAImpl::dumpTopLevelPtsTo ( )
overridevirtual

Dump points-to of each pag node

Reimplemented from SVF::PointerAnalysis.

Definition at line 438 of file PointerAnalysisImpl.cpp.

439{
440 for (OrderedNodeSet::iterator nIter = this->getAllValidPtrs().begin();
441 nIter != this->getAllValidPtrs().end(); ++nIter)
442 {
443 const PAGNode* node = getPAG()->getGNode(*nIter);
444 if (getPAG()->isValidTopLevelPtr(node))
445 {
446 const PointsTo& pts = this->getPts(node->getId());
447 outs() << "\nNodeID " << node->getId() << " ";
448
449 if (pts.empty())
450 {
451 outs() << "\t\tPointsTo: {empty}\n\n";
452 }
453 else
454 {
455 outs() << "\t\tPointsTo: { ";
456 for (PointsTo::iterator it = pts.begin(), eit = pts.end();
457 it != eit; ++it)
458 outs() << *it << " ";
459 outs() << "}\n\n";
460 }
461 }
462 }
463
464 outs().flush();
465}
NodeType * getGNode(NodeID id) const
Get a node.
SVFIR * getPAG() const
OrderedNodeSet & getAllValidPtrs()
Get all Valid Pointers for resolution.
NodeID getId() const
Get ID.

◆ expandFIObjs() [1/2]

void BVDataPTAImpl::expandFIObjs ( const NodeBS pts,
NodeBS expandedPts 
)
virtual

TODO: remove repetition.

Definition at line 145 of file PointerAnalysisImpl.cpp.

146{
148 for (const NodeID o : pts)
149 {
151 {
153 }
154 }
155}
bool isFieldInsensitive(NodeID id) const
NodeBS & getAllFieldsObjVars(const MemObj *obj)
Get all fields of an object.
Definition SVFIR.cpp:489
NodeID getBaseObjVar(NodeID id) const
Base and Offset methods for Value and Object node.
Definition SVFIR.h:477

◆ expandFIObjs() [2/2]

void BVDataPTAImpl::expandFIObjs ( const PointsTo pts,
PointsTo expandedPts 
)
virtual

Expand FI objects.

Expand all fields of an aggregate in all points-to sets

Definition at line 133 of file PointerAnalysisImpl.cpp.

134{
135 expandedPts = pts;;
136 for(PointsTo::iterator pit = pts.begin(), epit = pts.end(); pit!=epit; ++pit)
137 {
139 {
141 }
142 }
143}

◆ finalize()

void BVDataPTAImpl::finalize ( )
overrideprotectedvirtual

Finalization of pointer analysis, and normalize points-to information to Bit Vector representation.

Reimplemented from SVF::PointerAnalysis.

Reimplemented in SVF::CFLAlias, SVF::CFLBase, SVF::CFLVF, SVF::FlowDDA, SVF::FlowSensitive, SVF::TypeAnalysis, and SVF::VersionedFlowSensitive.

Definition at line 93 of file PointerAnalysisImpl.cpp.

94{
97
99 {
100 std::string moduleName(pag->getModule()->getModuleIdentifier());
101 std::vector<std::string> names = SVFUtil::split(moduleName,'/');
102 if (names.size() > 1)
103 moduleName = names[names.size() - 1];
104
105 std::string subtitle;
106
108 subtitle = "Andersen's analysis bitvector";
109 else if(ptaTy >=FSDATAFLOW_WPA && ptaTy <=FSCS_WPA)
110 subtitle = "flow-sensitive analysis bitvector";
111 else if(ptaTy >=CFLFICI_WPA && ptaTy <=CFLFSCS_WPA)
112 subtitle = "CFL analysis bitvector";
113 else if(ptaTy == TypeCPP_WPA)
114 subtitle = "Type analysis bitvector";
115 else if(ptaTy >=FieldS_DDA && ptaTy <=Cxt_DDA)
116 subtitle = "DDA bitvector";
117 else
118 subtitle = "bitvector";
119
120 SVFUtil::outs() << "\n****Persistent Points-To Cache Statistics: " << subtitle << "****\n";
121 SVFUtil::outs() << "################ (program : " << moduleName << ")###############\n";
122 SVFUtil::outs().flags(std::ios::left);
123 ptCache.printStats("bitvector");
124 SVFUtil::outs() << "#######################################################" << std::endl;
125 SVFUtil::outs().flush();
126 }
127
128}
virtual void normalizePointsTo()
@ Cxt_DDA
context sensitive DDA
@ FSCS_WPA
Flow-, context- sensitive WPA.
@ FSDATAFLOW_WPA
Traditional Dataflow-based flow sensitive WPA.
@ FieldS_DDA
Field sensitive DDA.
virtual void finalize()
Finalization of a pointer analysis, including checking alias correctness.
bool print_stat
User input flags.
PTATY ptaTy
Pointer analysis Type.
SVFModule * getModule()
Definition SVFIR.h:162
const std::string & getModuleIdentifier() const
Definition SVFModule.h:185
std::vector< std::string > split(const std::string &s, char separator)
Split into two substrings around the first occurrence of a separator string.
Definition SVFUtil.h:203

◆ getDFPTDataTy()

DFPTDataTy * SVF::BVDataPTAImpl::getDFPTDataTy ( ) const
inlineprotected

Definition at line 178 of file PointerAnalysisImpl.h.

179 {
180 DFPTDataTy* df = SVFUtil::dyn_cast<DFPTDataTy>(ptD.get());
181 assert(df && "BVDataPTAImpl::getDFPTDataTy: not a DFPTDataTy!");
182 return df;
183 }
DFPTData< NodeID, NodeSet, NodeID, PointsTo > DFPTDataTy

◆ getDiffPTDataTy()

DiffPTDataTy * SVF::BVDataPTAImpl::getDiffPTDataTy ( ) const
inlineprotected

Definition at line 171 of file PointerAnalysisImpl.h.

172 {
173 DiffPTDataTy* diff = SVFUtil::dyn_cast<DiffPTDataTy>(ptD.get());
174 assert(diff && "BVDataPTAImpl::getDiffPTDataTy: not a DiffPTDataTy!");
175 return diff;
176 }
DiffPTData< NodeID, NodeSet, NodeID, PointsTo > DiffPTDataTy

◆ getMutDFPTDataTy()

MutDFPTDataTy * SVF::BVDataPTAImpl::getMutDFPTDataTy ( ) const
inlineprotected

Definition at line 185 of file PointerAnalysisImpl.h.

186 {
187 MutDFPTDataTy* mdf = SVFUtil::dyn_cast<MutDFPTDataTy>(ptD.get());
188 assert(mdf && "BVDataPTAImpl::getMutDFPTDataTy: not a MutDFPTDataTy!");
189 return mdf;
190 }
MutableDFPTData< NodeID, NodeSet, NodeID, PointsTo > MutDFPTDataTy

◆ getPtCache()

PersistentPointsToCache< PointsTo > & SVF::BVDataPTAImpl::getPtCache ( )
inline

Definition at line 76 of file PointerAnalysisImpl.h.

77 {
78 return ptCache;
79 }

◆ getPTDataTy()

PTDataTy * SVF::BVDataPTAImpl::getPTDataTy ( ) const
inlineprotected

Get points-to data structure.

Definition at line 155 of file PointerAnalysisImpl.h.

156 {
157 return ptD.get();
158 }

◆ getPts()

const PointsTo & SVF::BVDataPTAImpl::getPts ( NodeID  id)
inlineoverridevirtual

Get points-to and reverse points-to

Implements SVF::PointerAnalysis.

Reimplemented in SVF::Steensgaard.

Definition at line 88 of file PointerAnalysisImpl.h.

89 {
90 return ptD->getPts(id);
91 }

◆ getRevPts()

const NodeSet & SVF::BVDataPTAImpl::getRevPts ( NodeID  nodeId)
inlineoverridevirtual

Given an object, get all the nodes having whose pointsto contains the object. Similar to getPts, this also needs to be implemented in child classes.

Implements SVF::PointerAnalysis.

Reimplemented in SVF::CFLAlias.

Definition at line 92 of file PointerAnalysisImpl.h.

93 {
94 return ptD->getRevPts(nodeId);
95 }

◆ getVersionedPTDataTy()

VersionedPTDataTy * SVF::BVDataPTAImpl::getVersionedPTDataTy ( ) const
inlineprotected

Definition at line 192 of file PointerAnalysisImpl.h.

193 {
194 VersionedPTDataTy* v = SVFUtil::dyn_cast<VersionedPTDataTy>(ptD.get());
195 assert(v && "BVDataPTAImpl::getVersionedPTDataTy: not a VersionedPTDataTy!");
196 return v;
197 }
VersionedPTData< NodeID, NodeSet, NodeID, PointsTo, VersionedVar, Set< VersionedVar > > VersionedPTDataTy

◆ normalizePointsTo()

void BVDataPTAImpl::normalizePointsTo ( )
protectedvirtual

Normalize points-to information for field-sensitive analysis, i.e., replace fieldObj with baseObj if it is field-insensitive

Normalize points-to information for field-sensitive analysis

Reimplemented in SVF::AndersenBase.

Definition at line 552 of file PointerAnalysisImpl.cpp.

553{
555 SVFIR::NodeOffsetMap &GepObjVarMap = pag->getGepObjNodeMap();
556
557 // collect each gep node whose base node has been set as field-insensitive
559 for (auto t: memToFieldsMap)
560 {
561 NodeID base = t.first;
562 const MemObj* memObj = pag->getObject(base);
563 assert(memObj && "Invalid memobj in memToFieldsMap");
564 if (memObj->isFieldInsensitive())
565 {
566 for (NodeID id : t.second)
567 {
568 if (SVFUtil::isa<GepObjVar>(pag->getGNode(id)))
569 {
570 dropNodes.set(id);
571 }
572 else
573 assert(id == base && "Not a GepObj Node or a baseObj Node?");
574 }
575 }
576 }
577
578 // remove the collected redundant gep nodes in each pointers's pts
579 for (SVFIR::iterator nIter = pag->begin(); nIter != pag->end(); ++nIter)
580 {
581 NodeID n = nIter->first;
582
583 const PointsTo &tmpPts = getPts(n);
584 for (NodeID obj : tmpPts)
585 {
586 if (!dropNodes.test(obj))
587 continue;
589 clearPts(n, obj);
590 addPts(n, baseObj);
591 }
592 }
593
594 // clear GepObjVarMap and memToFieldsMap for redundant gepnodes
595 // and remove those nodes from pag
596 for (NodeID n: dropNodes)
597 {
598 NodeID base = pag->getBaseObjVar(n);
599 GepObjVar *gepNode = SVFUtil::dyn_cast<GepObjVar>(pag->getGNode(n));
600 const APOffset apOffset = gepNode->getConstantFieldIdx();
601 GepObjVarMap.erase(std::make_pair(base, apOffset));
602 memToFieldsMap[base].reset(n);
603
605 }
606}
virtual void clearPts(NodeID id, NodeID element)
Remove element from the points-to set of id.
virtual bool addPts(NodeID id, NodeID ptd)
void removeGNode(NodeType *node)
Delete a node.
NodeOffsetMap & getGepObjNodeMap()
Return GepObjVarMap.
Definition SVFIR.h:135
Map< NodeID, NodeBS > MemObjToFieldsMap
Definition SVFIR.h:58
const MemObj * getObject(NodeID id) const
Definition SVFIR.h:396
Map< NodeOffset, NodeID > NodeOffsetMap
Definition SVFIR.h:71
MemObjToFieldsMap & getMemToFieldsMap()
Return memToFieldsMap.
Definition SVFIR.h:130
s64_t APOffset
Definition GeneralType.h:60

◆ onTheFlyCallGraphSolve()

void BVDataPTAImpl::onTheFlyCallGraphSolve ( const CallSiteToFunPtrMap callsites,
CallEdgeMap newEdges 
)
protectedvirtual

On the fly call graph construction.

On the fly call graph construction callsites is candidate indirect callsites need to be analyzed based on points-to results newEdges is the new indirect call edges discovered

Reimplemented in SVF::CFLAlias.

Definition at line 494 of file PointerAnalysisImpl.cpp.

495{
496 for(CallSiteToFunPtrMap::const_iterator iter = callsites.begin(), eiter = callsites.end(); iter!=eiter; ++iter)
497 {
498 const CallICFGNode* cs = iter->first;
499
500 if (cs->isVirtualCall())
501 {
502 const SVFVar* vtbl = cs->getVtablePtr();
503 assert(vtbl != nullptr);
504 NodeID vtblId = vtbl->getId();
506 }
507 else
508 resolveIndCalls(iter->first,getPts(iter->second),newEdges);
509 }
510}
const SVFVar * getVtablePtr() const
Definition ICFGNode.h:537
bool isVirtualCall() const
Definition ICFGNode.h:527
virtual void resolveIndCalls(const CallICFGNode *cs, const PointsTo &target, CallEdgeMap &newEdges)
Resolve indirect call edges.
virtual void resolveCPPIndCalls(const CallICFGNode *cs, const PointsTo &target, CallEdgeMap &newEdges)
Resolve cpp indirect call edges.

◆ onTheFlyThreadCallGraphSolve()

void BVDataPTAImpl::onTheFlyThreadCallGraphSolve ( const CallSiteToFunPtrMap callsites,
CallEdgeMap newForkEdges 
)
protectedvirtual

On the fly thread call graph construction respecting forksite.

On the fly call graph construction respecting forksite callsites is candidate indirect callsites need to be analyzed based on points-to results newEdges is the new indirect call edges discovered

Definition at line 517 of file PointerAnalysisImpl.cpp.

519{
520 // add indirect fork edges
521 if(ThreadCallGraph *tdCallGraph = SVFUtil::dyn_cast<ThreadCallGraph>(callgraph))
522 {
523 for(CallSiteSet::const_iterator it = tdCallGraph->forksitesBegin(),
524 eit = tdCallGraph->forksitesEnd(); it != eit; ++it)
525 {
526 const ValVar* pVar = tdCallGraph->getThreadAPI()->getForkedFun(*it);
527 if(SVFUtil::dyn_cast<FunValVar>(pVar) == nullptr)
528 {
529 SVFIR *pag = this->getPAG();
530 const NodeBS targets = this->getPts(pVar->getId()).toNodeBS();
531 for(NodeBS::iterator ii = targets.begin(), ie = targets.end(); ii != ie; ++ii)
532 {
533 if(ObjVar *objPN = SVFUtil::dyn_cast<ObjVar>(pag->getGNode(*ii)))
534 {
535 const MemObj *obj = pag->getObject(objPN);
536 if(obj->isFunction())
537 {
538 const SVFFunction *svfForkedFun = SVFUtil::cast<CallGraphNode>(obj->getGNode())->getFunction();
539 if(tdCallGraph->addIndirectForkEdge(*it, svfForkedFun))
540 newForkEdges[*it].insert(svfForkedFun);
541 }
542 }
543 }
544 }
545 }
546 }
547}
PTACallGraph * callgraph
Call graph used for pointer analysis.
NodeBS toNodeBS() const
Returns this points-to set as a NodeBS.
Definition PointsTo.cpp:313

◆ readAndSetObjFieldSensitivity()

void BVDataPTAImpl::readAndSetObjFieldSensitivity ( std::ifstream &  f,
const std::string &  delimiterStr 
)
virtual

Definition at line 379 of file PointerAnalysisImpl.cpp.

380{
381 string line;
382 // //update ObjVar status
383 while (F.good())
384 {
385 getline(F, line);
386 if (line.empty() || line == delimiterStr)
387 break;
388 // Parse a single line in the form of "baseNodeID insensitive"
390 NodeID base;
391 bool insensitive;
392 ss >> base >> insensitive;
393
394 if (insensitive)
396 }
397
398}
#define F(f)
void setObjFieldInsensitive(NodeID id)

◆ readFromFile()

bool BVDataPTAImpl::readFromFile ( const std::string &  filename)
virtual

Load pointer analysis result form a file. It populates BVDataPTAImpl with the points-to data, and updates SVFIR with the SVFIR offset nodes created during Andersen's solving stage.

Definition at line 405 of file PointerAnalysisImpl.cpp.

406{
407
408 outs() << "Loading pointer analysis results from '" << filename << "'...";
409
410 ifstream F(filename.c_str());
411 if (!F.is_open())
412 {
413 outs() << " error opening file for reading!\n";
414 return false;
415 }
416
418
420
422
424
425 // Update callgraph
427
428 F.close();
429 outs() << "\n";
430
431 return true;
432}
virtual void readAndSetObjFieldSensitivity(std::ifstream &f, const std::string &delimiterStr)
virtual bool updateCallGraph(const CallSiteToFunPtrMap &)
Update callgraph. This should be implemented by its subclass.
virtual void readPtsResultFromFile(std::ifstream &f)
virtual void readGepObjVarMapFromFile(std::ifstream &f)
const CallSiteToFunPtrMap & getIndirectCallsites() const
Add/get indirect callsites.
Definition SVFIR.h:351

◆ readGepObjVarMapFromFile()

void BVDataPTAImpl::readGepObjVarMapFromFile ( std::ifstream &  f)
virtual

Definition at line 343 of file PointerAnalysisImpl.cpp.

344{
345 string line;
346 //read GepObjVarMap from file
348 while (F.good())
349 {
350 getline(F, line);
351 if (line == "------") break;
352 // Parse a single line in the form of "ID baseNodeID offset"
354 NodeID base;
355 size_t offset;
356 NodeID id;
357 ss >> base >> offset >>id;
358 SVFIR::NodeOffsetMap::const_iterator iter = gepObjVarMap.find(std::make_pair(base, offset));
359 if (iter == gepObjVarMap.end())
360 {
361 SVFVar* node = pag->getGNode(base);
362 const MemObj* obj = nullptr;
363 if (GepObjVar* gepObjVar = SVFUtil::dyn_cast<GepObjVar>(node))
364 obj = gepObjVar->getMemObj();
365 else if (BaseObjVar* baseNode = SVFUtil::dyn_cast<BaseObjVar>(node))
366 obj = baseNode->getMemObj();
367 else if (DummyObjVar* baseNode = SVFUtil::dyn_cast<DummyObjVar>(node))
368 obj = baseNode->getMemObj();
369 else
370 assert(false && "new gep obj node kind?");
373 }
374
375
376 }
377}
buffer offset
Definition cJSON.cpp:1113
static NodeIDAllocator * get(void)
Return (singleton) allocator.
NodeID addGepObjNode(const MemObj *obj, const APOffset &apOffset, const NodeID gepId)
Add a field obj node, this method can only invoked by getGepObjVar.
Definition SVFIR.cpp:450

◆ readPtsResultFromFile()

void BVDataPTAImpl::readPtsResultFromFile ( std::ifstream &  f)
virtual

Definition at line 289 of file PointerAnalysisImpl.cpp.

290{
291 string line;
292 // Read analysis results from file
294
295 // Read points-to sets
296 string delimiter1 = " -> { ";
297 string delimiter2 = " }";
300
301 while (F.good())
302 {
303 // Parse a single line in the form of "var -> { obj1 obj2 obj3 }"
304 getline(F, line);
305 if (line.at(0) == '[' || line == "---VERSIONED---") continue;
306 if (line == "------") break;
307 size_t pos = line.find(delimiter1);
308 if (pos == string::npos) break;
309 if (line.back() != '}') break;
310
311 // var
312 NodeID var = atoi(line.substr(0, pos).c_str());
313
314 // objs
315 pos = pos + delimiter1.length();
316 size_t len = line.length() - pos - delimiter2.length();
317 string objs = line.substr(pos, len);
319
320 if (!objs.empty())
321 {
322 // map the variable ID to its unique string pointer set
324 if (strPtsMap.count(objs)) continue;
325
327 NodeID obj;
328 while (ss.good())
329 {
330 ss >> obj;
331 dstPts.set(obj);
332 }
333 // map the string pointer set to the parsed PointsTo set
335 }
336 }
337
338 // map the variable ID to its pointer set
339 for (auto t: nodePtsMap)
341}
PTData< NodeID, NodeSet, NodeID, PointsTo > PTDataTy
virtual bool unionPts(NodeID id, const PointsTo &target)
PTDataTy * getPTDataTy() const
Get points-to data structure.

◆ remapPointsToSets()

void BVDataPTAImpl::remapPointsToSets ( void  )

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

Definition at line 157 of file PointerAnalysisImpl.cpp.

158{
159 getPTDataTy()->remapAllPts();
160}

◆ unionPts() [1/2]

virtual bool SVF::BVDataPTAImpl::unionPts ( NodeID  id,
const PointsTo target 
)
inlinevirtual

Union/add points-to. Add the reverse points-to for node collapse purpose To be noted that adding reverse pts might incur 10% total overhead during solving

Reimplemented in SVF::Andersen, and SVF::Steensgaard.

Definition at line 113 of file PointerAnalysisImpl.h.

114 {
115 return ptD->unionPts(id, target);
116 }

◆ unionPts() [2/2]

virtual bool SVF::BVDataPTAImpl::unionPts ( NodeID  id,
NodeID  ptd 
)
inlinevirtual

Reimplemented in SVF::Andersen, and SVF::Steensgaard.

Definition at line 117 of file PointerAnalysisImpl.h.

118 {
119 return ptD->unionPts(id,ptd);
120 }

◆ updateCallGraph()

virtual bool SVF::BVDataPTAImpl::updateCallGraph ( const CallSiteToFunPtrMap )
inlineprotectedvirtual

Update callgraph. This should be implemented by its subclass.

Reimplemented in SVF::AndersenBase, SVF::CFLAlias, SVF::AndersenSCD, and SVF::FlowSensitive.

Definition at line 165 of file PointerAnalysisImpl.h.

166 {
167 assert(false && "Virtual function not implemented!");
168 return false;
169 }

◆ writeGepObjVarMapToFile()

void BVDataPTAImpl::writeGepObjVarMapToFile ( std::fstream &  f)
virtual

Definition at line 224 of file PointerAnalysisImpl.cpp.

225{
226 //write gepObjVarMap to file(in form of: baseID offset gepObjNodeId)
228 for(SVFIR::NodeOffsetMap::const_iterator it = gepObjVarMap.begin(), eit = gepObjVarMap.end(); it != eit; it++)
229 {
231 //write the base id to file
232 f << offsetPair.first << " ";
233 //write the offset to file
234 f << offsetPair.second << " ";
235 //write the gepObjNodeId to file
236 f << it->second << "\n";
237 }
238
239}
std::pair< NodeID, APOffset > NodeOffset
Definition SVFIR.h:69

◆ writeObjVarToFile()

void BVDataPTAImpl::writeObjVarToFile ( const std::string &  filename)
virtual

Definition at line 162 of file PointerAnalysisImpl.cpp.

163{
164 outs() << "Storing ObjVar to '" << filename << "'...";
166 std::fstream f(filename.c_str(), std::ios_base::out);
167 if (!f.good())
168 {
169 outs() << " error opening file for writing!\n";
170 return;
171 }
172
173 // Write BaseNodes insensitivity to file
175 for (auto it = pag->begin(), ie = pag->end(); it != ie; ++it)
176 {
177 PAGNode* pagNode = it->second;
178 if (!isa<ObjVar>(pagNode)) continue;
179 NodeID n = pag->getBaseObjVar(it->first);
180 if (NodeIDs.test(n)) continue;
181 f << n << " ";
182 f << isFieldInsensitive(n) << "\n";
183 NodeIDs.set(n);
184 }
185
186 f << "------\n";
187
188 f.close();
189 if (f.good())
190 {
191 outs() << "\n";
192 return;
193 }
194
195
196}

◆ writePtsResultToFile()

void BVDataPTAImpl::writePtsResultToFile ( std::fstream &  f)
virtual

Definition at line 198 of file PointerAnalysisImpl.cpp.

199{
200 // Write analysis results to file
201 for (auto it = pag->begin(), ie = pag->end(); it != ie; ++it)
202 {
203 NodeID var = it->first;
204 const PointsTo &pts = getPts(var);
205
207 f << var << " -> { ";
208 if (pts.empty())
209 {
210 f << " ";
211 }
212 else
213 {
214 for (NodeID n: pts)
215 {
216 f << n << " ";
217 }
218 }
219 f << "}\n";
220 }
221
222}

◆ writeToFile()

void BVDataPTAImpl::writeToFile ( const std::string &  filename)
virtual

Interface for analysis result storage on filesystem.

Store pointer analysis result into a file. It includes the points-to relations, and all SVFIR nodes including those created when solving Andersen's constraints.

Definition at line 246 of file PointerAnalysisImpl.cpp.

247{
248
249 outs() << "Storing pointer analysis results to '" << filename << "'...";
250
252 std::fstream f(filename.c_str(), std::ios_base::app);
253 if (!f.good())
254 {
255 outs() << " error opening file for writing!\n";
256 return;
257 }
258
260
261 f << "------\n";
262
264
265 f << "------\n";
266
267 // Write BaseNodes insensitivity to file
269 for (auto it = pag->begin(), ie = pag->end(); it != ie; ++it)
270 {
271 PAGNode* pagNode = it->second;
272 if (!isa<ObjVar>(pagNode)) continue;
273 NodeID n = pag->getBaseObjVar(it->first);
274 if (NodeIDs.test(n)) continue;
275 f << n << " ";
276 f << isFieldInsensitive(n) << "\n";
277 NodeIDs.set(n);
278 }
279
280 // Job finish and close file
281 f.close();
282 if (f.good())
283 {
284 outs() << "\n";
285 return;
286 }
287}
virtual void writeGepObjVarMapToFile(std::fstream &f)
virtual void writePtsResultToFile(std::fstream &f)

Member Data Documentation

◆ ptCache

PersistentPointsToCache<PointsTo> SVF::BVDataPTAImpl::ptCache
private

Definition at line 214 of file PointerAnalysisImpl.h.

◆ ptD

std::unique_ptr<PTDataTy> SVF::BVDataPTAImpl::ptD
private

Points-to data.

Definition at line 212 of file PointerAnalysisImpl.h.


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