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::FSMPTA< SVFGGraph > SVF::VersionedFlowSensitive SVF::AndersenSCD SVF::AndersenWaveDiff SVF::POCRAlias SVF::POCRHybrid SVF::AndersenSFR

Public Types

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
typedef Set< const CallICFGNode * > CallSiteSet
 Indirect call edges type, map a callsite to a set of callees.
 
typedef SVFIR::CallSiteToFunPtrMap CallSiteToFunPtrMap
 
typedef Set< const FunObjVar * > FunctionSet
 
typedef OrderedMap< const CallICFGNode *, FunctionSetCallEdgeMap
 
typedef SCCDetection< CallGraph * > CallGraphSCC
 
typedef Set< const GlobalObjVar * > VTableSet
 
typedef Set< const FunObjVar * > VFunSet
 

Public Member Functions

 BVDataPTAImpl (SVFIR *pag, 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.
 
CallGraphgetCallGraph () const
 Return call graph.
 
CallGraphSCCgetCallGraphSCC () const
 Return call graph SCC.
 
 PointerAnalysis (SVFIR *pag, PTATY ty=PTATY::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 FunObjVar *fun1, const FunObjVar *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 FunObjVar *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.
 
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.
 
bool mayAlias (const SVFVar *V1, const SVFVar *V2)
 Convenience bool wrappers: return true if the two operands may/must/partial alias.
 
bool mayAlias (NodeID node1, NodeID node2)
 
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 getBaseObjVarID (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 SVFVar *V1, const SVFVar *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.
 
bool mayAlias (const PointsTo &pts1, const PointsTo &pts2)
 Convenience bool wrappers: return true if the two operands may/must/partial alias.
 
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.
 
PTATY ptaTy
 Pointer analysis Type.
 
PTAImplTy ptaImplTy
 PTA implementation type.
 
PTAStatstat
 Statistics.
 
CallGraphcallgraph
 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 47 of file PointerAnalysisImpl.h.

Member Typedef Documentation

◆ DFPTDataTy

Definition at line 53 of file PointerAnalysisImpl.h.

◆ DiffPTDataTy

Definition at line 52 of file PointerAnalysisImpl.h.

◆ MutDFPTDataTy

Definition at line 58 of file PointerAnalysisImpl.h.

◆ MutDiffPTDataTy

Definition at line 57 of file PointerAnalysisImpl.h.

◆ MutIncDFPTDataTy

Definition at line 59 of file PointerAnalysisImpl.h.

◆ MutPTDataTy

Definition at line 56 of file PointerAnalysisImpl.h.

◆ MutVersionedPTDataTy

Definition at line 60 of file PointerAnalysisImpl.h.

◆ PersDFPTDataTy

Definition at line 64 of file PointerAnalysisImpl.h.

◆ PersDiffPTDataTy

Definition at line 63 of file PointerAnalysisImpl.h.

◆ PersIncDFPTDataTy

Definition at line 65 of file PointerAnalysisImpl.h.

◆ PersPTDataTy

Definition at line 62 of file PointerAnalysisImpl.h.

◆ PersVersionedPTDataTy

Definition at line 66 of file PointerAnalysisImpl.h.

◆ PTDataTy

Definition at line 51 of file PointerAnalysisImpl.h.

◆ VersionedPTDataTy

Definition at line 54 of file PointerAnalysisImpl.h.

Constructor & Destructor Documentation

◆ BVDataPTAImpl()

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

Constructor.

Constructor

Definition at line 48 of file PointerAnalysisImpl.cpp.

48 :
50{
54 {
55 // Only maintain reverse points-to when the analysis is field-sensitive, as objects turning
56 // field-insensitive is all it is used for.
58 if (Options::ptDataBacking() == PTBackingType::Mutable) ptD = std::make_unique<MutDiffPTDataTy>(maintainRevPts);
59 else if (Options::ptDataBacking() == PTBackingType::Persistent) ptD = std::make_unique<PersDiffPTDataTy>(getPtCache(), maintainRevPts);
60 else assert(false && "BVDataPTAImpl::BVDataPTAImpl: unexpected points-to backing type!");
61 }
62 else if (type == PTATY::Steensgaard_WPA)
63 {
64 // Steensgaard is only field-insensitive (for now?), so no reverse points-to.
65 if (Options::ptDataBacking() == PTBackingType::Mutable) ptD = std::make_unique<MutDiffPTDataTy>(false);
66 else if (Options::ptDataBacking() == PTBackingType::Persistent) ptD = std::make_unique<PersDiffPTDataTy>(getPtCache(), false);
67 else assert(false && "BVDataPTAImpl::BVDataPTAImpl: unexpected points-to backing type!");
68 }
69 else if (type == PTATY::FSSPARSE_WPA)
70 {
72 {
73 if (Options::ptDataBacking() == PTBackingType::Mutable) ptD = std::make_unique<MutIncDFPTDataTy>(false);
74 else if (Options::ptDataBacking() == PTBackingType::Persistent) ptD = std::make_unique<PersIncDFPTDataTy>(getPtCache(), false);
75 else assert(false && "BVDataPTAImpl::BVDataPTAImpl: unexpected points-to backing type!");
76 }
77 else
78 {
79 if (Options::ptDataBacking() == PTBackingType::Mutable) ptD = std::make_unique<MutDFPTDataTy>(false);
80 else if (Options::ptDataBacking() == PTBackingType::Persistent) ptD = std::make_unique<PersDFPTDataTy>(getPtCache(), false);
81 else assert(false && "BVDataPTAImpl::BVDataPTAImpl: unexpected points-to backing type!");
82 }
83 }
84 else if (type == PTATY::VFS_WPA)
85 {
86 if (Options::ptDataBacking() == PTBackingType::Mutable) ptD = std::make_unique<MutVersionedPTDataTy>(false);
87 else if (Options::ptDataBacking() == PTBackingType::Persistent) ptD = std::make_unique<PersVersionedPTDataTy>(getPtCache(), false);
88 else assert(false && "BVDataPTAImpl::BVDataPTAImpl: unexpected points-to backing type!");
89 }
90 else assert(false && "no points-to data available");
91
93}
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:132
static const OptionMap< PTBackingType > ptDataBacking
PTData type.
Definition Options.h:65
static const Option< u32_t > MaxFieldLimit
Maximum number of field derivations for an object.
Definition Options.h:34
PTAImplTy ptaImplTy
PTA implementation type.
@ BVDataImpl
Represents BVDataPTAImpl.
Definition PTATY.h:42
@ VFS_WPA
Versioned sparse flow-sensitive WPA.
Definition PTATY.h:21
@ Andersen_WPA
Andersen PTA.
Definition PTATY.h:12
@ FSSPARSE_WPA
Sparse flow sensitive WPA.
Definition PTATY.h:20
@ AndersenSFR_WPA
Stride-based field representation.
Definition PTATY.h:14
@ FlowS_DDA
Flow sensitive DDA.
Definition PTATY.h:30
@ AndersenWaveDiff_WPA
Diff wave propagation andersen-style WPA.
Definition PTATY.h:15
@ CFLFICI_WPA
Flow-, context-, insensitive CFL-reachability-based analysis.
Definition PTATY.h:23
@ TypeCPP_WPA
Type-based analysis for C++.
Definition PTATY.h:26
@ Steensgaard_WPA
Steensgaard PTA.
Definition PTATY.h:16
@ CFLFSCS_WPA
Flow-, context-, CFL-reachability-based analysis.
Definition PTATY.h:25
@ Andersen_BASE
Base Andersen PTA.
Definition PTATY.h:11
@ AndersenSCD_WPA
Selective cycle detection andersen-style WPA.
Definition PTATY.h:13
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76
@ Mutable
Definition PTATY.h:49
@ Persistent
Definition PTATY.h:50

◆ ~BVDataPTAImpl()

SVF::BVDataPTAImpl::~BVDataPTAImpl ( )
overridedefault

Destructor.

Member Function Documentation

◆ addPts()

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

Definition at line 119 of file PointerAnalysisImpl.h.

120 {
121 return ptD->addPts(id,ptd);
122 }

◆ 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 629 of file PointerAnalysisImpl.cpp.

630{
631
636
639 else
641}
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:621
@ NoAlias
Definition SVFType.h:620

◆ alias() [2/3]

AliasResult SVF::BVDataPTAImpl::alias ( const SVFVar V1,
const SVFVar V2 
)
inlineoverridevirtual

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

Implements SVF::PointerAnalysis.

Definition at line 216 of file PointerAnalysisImpl.h.

218 {
219 return alias(V1->getId(), V2->getId());
220 }
AliasResult alias(const SVFVar *V1, const SVFVar *V2) override
Interface expose to users of our pointer analysis, given Value infos.

◆ 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 621 of file PointerAnalysisImpl.cpp.

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

◆ classof()

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

Definition at line 79 of file PointerAnalysisImpl.h.

80 {
81 return pta->getImplTy() == PTAImplTy::BVDataImpl;
82 }

◆ clearAllPts()

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

Clear all data.

Definition at line 126 of file PointerAnalysisImpl.h.

127 {
128 ptD->clear();
129 }

◆ clearFullPts()

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

Clear points-to set of id.

Definition at line 103 of file PointerAnalysisImpl.h.

104 {
105 ptD->clearFullPts(id);
106 }

◆ clearPts()

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

Remove element from the points-to set of id.

Definition at line 97 of file PointerAnalysisImpl.h.

98 {
99 ptD->clearPts(id, element);
100 }

◆ 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 479 of file PointerAnalysisImpl.cpp.

480{
482 for(SVFIR::iterator it = pag->begin(), eit = pag->end(); it!=eit; it++)
483 {
484 pagNodes.insert(it->first);
485 }
486
487 for (NodeID n : pagNodes)
488 {
489 outs() << "----------------------------------------------\n";
490 dumpPts(n, this->getPts(n));
491 }
492
493 outs() << "----------------------------------------------\n";
494}
cJSON * n
Definition cJSON.cpp:2558
iterator begin()
Iterators.
IDToNodeMapTy::iterator iterator
Node Iterators.
virtual void dumpPts(NodeID ptr, const PointsTo &pts)
static SVFIR * pag
SVFIR.
std::ostream & outs()
Overwrite llvm::outs()
Definition SVFUtil.h:52
OrderedSet< NodeID > OrderedNodeSet
Definition GeneralType.h:86
u32_t NodeID
Definition GeneralType.h:76

◆ dumpCPts()

void SVF::BVDataPTAImpl::dumpCPts ( )
inlineoverridevirtual

dump and debug, print out conditional pts

Reimplemented from SVF::PointerAnalysis.

Definition at line 236 of file PointerAnalysisImpl.h.

237 {
238 ptD->dumpPTData();
239 }

◆ dumpTopLevelPtsTo()

void BVDataPTAImpl::dumpTopLevelPtsTo ( )
overridevirtual

Dump points-to of each pag node

Reimplemented from SVF::PointerAnalysis.

Definition at line 446 of file PointerAnalysisImpl.cpp.

447{
448 for (OrderedNodeSet::iterator nIter = this->getAllValidPtrs().begin();
449 nIter != this->getAllValidPtrs().end(); ++nIter)
450 {
451 const SVFVar* node = getPAG()->getSVFVar(*nIter);
452 if (getPAG()->isValidTopLevelPtr(node))
453 {
454 const PointsTo& pts = this->getPts(node->getId());
455 outs() << "\nNodeID " << node->getId() << " ";
456
457 if (pts.empty())
458 {
459 outs() << "\t\tPointsTo: {empty}\n\n";
460 }
461 else
462 {
463 outs() << "\t\tPointsTo: { ";
464 for (PointsTo::iterator it = pts.begin(), eit = pts.end();
465 it != eit; ++it)
466 outs() << *it << " ";
467 outs() << "}\n\n";
468 }
469 }
470 }
471
472 outs().flush();
473}
SVFIR * getPAG() const
OrderedNodeSet & getAllValidPtrs()
Get all Valid Pointers for resolution.
const SVFVar * getSVFVar(NodeID id) const
ObjVar/GepObjVar/BaseObjVar.
Definition SVFIR.h:135
NodeID getId() const
Get ID.
Definition SVFValue.h:158

◆ expandFIObjs() [1/2]

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

TODO: remove repetition.

Definition at line 147 of file PointerAnalysisImpl.cpp.

148{
150 for (const NodeID o : pts)
151 {
153 {
155 }
156 }
157}
bool isFieldInsensitive(NodeID id) const
NodeID getBaseObjVarID(NodeID id) const
Base and Offset methods for Value and Object node.
Definition SVFIR.h:554
NodeBS & getAllFieldsObjVars(const BaseObjVar *obj)
Get all fields of an object.
Definition SVFIR.cpp:573

◆ 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 135 of file PointerAnalysisImpl.cpp.

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

◆ 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 95 of file PointerAnalysisImpl.cpp.

96{
99
101 {
102 std::string moduleName(pag->getModuleIdentifier());
103 std::vector<std::string> names = SVFUtil::split(moduleName,'/');
104 if (names.size() > 1)
105 moduleName = names[names.size() - 1];
106
107 std::string subtitle;
108
110 subtitle = "Andersen's analysis bitvector";
112 subtitle = "flow-sensitive analysis bitvector";
114 subtitle = "CFL analysis bitvector";
115 else if(ptaTy == PTATY::TypeCPP_WPA)
116 subtitle = "Type analysis bitvector";
118 subtitle = "DDA bitvector";
119 else
120 subtitle = "bitvector";
121
122 SVFUtil::outs() << "\n****Persistent Points-To Cache Statistics: " << subtitle << "****\n";
123 SVFUtil::outs() << "################ (program : " << moduleName << ")###############\n";
124 SVFUtil::outs().flags(std::ios::left);
125 ptCache.printStats("bitvector");
126 SVFUtil::outs() << "#######################################################" << std::endl;
127 SVFUtil::outs().flush();
128 }
129
130}
virtual void normalizePointsTo()
virtual void finalize()
Finalization of a pointer analysis, including checking alias correctness.
bool print_stat
User input flags.
PTATY ptaTy
Pointer analysis Type.
const std::string & getModuleIdentifier() const
Definition SVFIR.h:261
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:196
@ Cxt_DDA
context sensitive DDA
Definition PTATY.h:32
@ FieldS_DDA
Field sensitive DDA.
Definition PTATY.h:29
@ FSDATAFLOW_WPA
Traditional Dataflow-based flow sensitive WPA.
Definition PTATY.h:19
@ FSCS_WPA
Flow-, context- sensitive WPA.
Definition PTATY.h:22

◆ getDFPTDataTy()

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

Definition at line 176 of file PointerAnalysisImpl.h.

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

◆ getDiffPTDataTy()

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

Definition at line 169 of file PointerAnalysisImpl.h.

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

◆ getMutDFPTDataTy()

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

Definition at line 183 of file PointerAnalysisImpl.h.

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

◆ getPtCache()

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

Definition at line 74 of file PointerAnalysisImpl.h.

75 {
76 return ptCache;
77 }

◆ getPTDataTy()

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

Get points-to data structure.

Definition at line 153 of file PointerAnalysisImpl.h.

154 {
155 return ptD.get();
156 }

◆ 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 86 of file PointerAnalysisImpl.h.

87 {
88 return ptD->getPts(id);
89 }

◆ 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 90 of file PointerAnalysisImpl.h.

91 {
92 return ptD->getRevPts(nodeId);
93 }

◆ getVersionedPTDataTy()

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

Definition at line 190 of file PointerAnalysisImpl.h.

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

◆ mayAlias()

bool SVF::BVDataPTAImpl::mayAlias ( const PointsTo pts1,
const PointsTo pts2 
)
inline

Convenience bool wrappers: return true if the two operands may/must/partial alias.

Definition at line 229 of file PointerAnalysisImpl.h.

230 {
232 }

◆ 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 560 of file PointerAnalysisImpl.cpp.

561{
564
565 // collect each gep node whose base node has been set as field-insensitive
567 for (auto t: memToFieldsMap)
568 {
569 NodeID base = t.first;
570 const BaseObjVar* obj = pag->getBaseObject(base);
571 assert(obj && "Invalid baseObj in memToFieldsMap");
572 assert(obj->isFieldInsensitive() == obj->isFieldInsensitive());
573 if (obj->isFieldInsensitive())
574 {
575 for (NodeID id : t.second)
576 {
577 if (SVFUtil::isa<GepObjVar>(pag->getSVFVar(id)))
578 {
579 dropNodes.set(id);
580 }
581 else
582 assert(id == base && "Not a GepObj Node or a baseObj Node?");
583 }
584 }
585 }
586
587 // remove the collected redundant gep nodes in each pointers's pts
588 for (SVFIR::iterator nIter = pag->begin(); nIter != pag->end(); ++nIter)
589 {
590 NodeID n = nIter->first;
591
592 const PointsTo &tmpPts = getPts(n);
593 for (NodeID obj : tmpPts)
594 {
595 if (!dropNodes.test(obj))
596 continue;
598 clearPts(n, obj);
599 addPts(n, baseObj);
600 }
601 }
602
603 // clear GepObjVarMap and memToFieldsMap for redundant gepnodes
604 // and remove those nodes from pag
605 for (NodeID n: dropNodes)
606 {
607 NodeID base = pag->getBaseObjVarID(n);
608 GepObjVar *gepNode = SVFUtil::dyn_cast<GepObjVar>(pag->getGNode(n));
609 const APOffset apOffset = gepNode->getConstantFieldIdx();
610 GepObjVarMap.erase(std::make_pair(base, apOffset));
611 memToFieldsMap[base].reset(n);
612
614 }
615}
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.
NodeType * getGNode(NodeID id) const
Get a node.
const BaseObjVar * getBaseObject(NodeID id) const
Definition SVFIR.h:498
OffsetToGepVarMap & getGepObjNodeMap()
Return GepObjVarMap.
Definition SVFIR.h:203
Map< NodeID, NodeBS > MemObjToFieldsMap
Definition SVFIR.h:58
Map< GepOffset, NodeID > OffsetToGepVarMap
Definition SVFIR.h:72
MemObjToFieldsMap & getMemToFieldsMap()
Return memToFieldsMap.
Definition SVFIR.h:198
s64_t APOffset
Definition GeneralType.h:80

◆ 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 502 of file PointerAnalysisImpl.cpp.

503{
504 for(CallSiteToFunPtrMap::const_iterator iter = callsites.begin(), eiter = callsites.end(); iter!=eiter; ++iter)
505 {
506 const CallICFGNode* cs = iter->first;
507
508 if (cs->isVirtualCall())
509 {
510 const SVFVar* vtbl = cs->getVtablePtr();
511 assert(vtbl != nullptr);
512 NodeID vtblId = vtbl->getId();
514 }
515 else
516 resolveIndCalls(iter->first,getPts(iter->second),newEdges);
517 }
518}
const SVFVar * getVtablePtr() const
Definition ICFGNode.h:520
bool isVirtualCall() const
Definition ICFGNode.h:510
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 525 of file PointerAnalysisImpl.cpp.

527{
528 // add indirect fork edges
529 if(ThreadCallGraph *tdCallGraph = SVFUtil::dyn_cast<ThreadCallGraph>(callgraph))
530 {
531 for(ThreadCallGraph::CallSiteSet::const_iterator it = tdCallGraph->forksitesBegin(),
532 eit = tdCallGraph->forksitesEnd(); it != eit; ++it)
533 {
534 const ValVar* pVar = tdCallGraph->getThreadAPI()->getForkedFun(*it);
535 if(SVFUtil::dyn_cast<FunValVar>(pVar) == nullptr)
536 {
537 SVFIR *pag = this->getPAG();
538 const NodeBS targets = this->getPts(pVar->getId()).toNodeBS();
539 for(NodeBS::iterator ii = targets.begin(), ie = targets.end(); ii != ie; ++ii)
540 {
541 if(const ObjVar *objPN = pag->getObjVar(*ii))
542 {
543 const BaseObjVar* obj = pag->getBaseObject(objPN->getId());
544 if(obj->isFunction())
545 {
546 const FunObjVar *svfForkedFun = SVFUtil::cast<FunObjVar>(obj)->getFunction();
547 if(tdCallGraph->addIndirectForkEdge(*it, svfForkedFun))
548 newForkEdges[*it].insert(svfForkedFun);
549 }
550 }
551 }
552 }
553 }
554 }
555}
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
CallGraph * callgraph
Call graph used for pointer analysis.
NodeBS toNodeBS() const
Returns this points-to set as a NodeBS.
Definition PointsTo.cpp:313
const ObjVar * getObjVar(NodeID id) const
Definition SVFIR.h:149

◆ readAndSetObjFieldSensitivity()

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

Definition at line 387 of file PointerAnalysisImpl.cpp.

388{
389 string line;
390 // //update ObjVar status
391 while (F.good())
392 {
393 getline(F, line);
394 if (line.empty() || line == delimiterStr)
395 break;
396 // Parse a single line in the form of "baseNodeID insensitive"
398 NodeID base;
399 bool insensitive;
400 ss >> base >> insensitive;
401
402 if (insensitive)
404 }
405
406}
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 413 of file PointerAnalysisImpl.cpp.

414{
415
416 outs() << "Loading pointer analysis results from '" << filename << "'...";
417
418 ifstream F(filename.c_str());
419 if (!F.is_open())
420 {
421 outs() << " error opening file for reading!\n";
422 return false;
423 }
424
426
428
430
432
433 // Update callgraph
435
436 F.close();
437 outs() << "\n";
438
439 return true;
440}
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:453

◆ readGepObjVarMapFromFile()

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

Definition at line 345 of file PointerAnalysisImpl.cpp.

346{
347 string line;
348 //read GepObjVarMap from file
350 while (F.good())
351 {
352 getline(F, line);
353 if (line == "------") break;
354 // Parse a single line in the form of "ID baseNodeID offset"
356 NodeID base;
357 size_t offset;
358 NodeID id;
359 ss >> base >> offset >>id;
360 SVFIR::OffsetToGepVarMap::const_iterator iter = gepObjVarMap.find(std::make_pair(base, offset));
361 if (iter == gepObjVarMap.end())
362 {
363 const SVFVar* node = pag->getSVFVar(base);
364 const BaseObjVar* obj = nullptr;
365 if (const GepObjVar* gepObjVar = SVFUtil::dyn_cast<GepObjVar>(node))
366 {
367 obj = gepObjVar->getBaseObj();
368 }
369 else if (const BaseObjVar* baseNode = SVFUtil::dyn_cast<BaseObjVar>(node))
370 {
371 obj = baseNode;
372 }
373 else if (const DummyObjVar* baseNode = SVFUtil::dyn_cast<DummyObjVar>(node))
374 {
375 obj = baseNode;
376 }
377 else
378 assert(false && "new gep obj node kind?");
379 pag->addGepObjNode( obj, offset, id);
381 }
382
383
384 }
385}
buffer offset
Definition cJSON.cpp:1113
static NodeIDAllocator * get(void)
Return (singleton) allocator.
NodeID addGepObjNode(GepObjVar *gepObj, NodeID base, const APOffset &apOffset)
Definition SVFIR.cpp:547

◆ readPtsResultFromFile()

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

Definition at line 291 of file PointerAnalysisImpl.cpp.

292{
293 string line;
294 // Read analysis results from file
296
297 // Read points-to sets
298 string delimiter1 = " -> { ";
299 string delimiter2 = " }";
302
303 while (F.good())
304 {
305 // Parse a single line in the form of "var -> { obj1 obj2 obj3 }"
306 getline(F, line);
307 if (line.at(0) == '[' || line == "---VERSIONED---") continue;
308 if (line == "------") break;
309 size_t pos = line.find(delimiter1);
310 if (pos == string::npos) break;
311 if (line.back() != '}') break;
312
313 // var
314 NodeID var = atoi(line.substr(0, pos).c_str());
315
316 // objs
317 pos = pos + delimiter1.length();
318 size_t len = line.length() - pos - delimiter2.length();
319 string objs = line.substr(pos, len);
321
322 if (!objs.empty())
323 {
324 // map the variable ID to its unique string pointer set
326 if (strPtsMap.count(objs)) continue;
327
329 NodeID obj;
330 while (ss.good())
331 {
332 ss >> obj;
333 dstPts.set(obj);
334 }
335 // map the string pointer set to the parsed PointsTo set
337 }
338 }
339
340 // map the variable ID to its pointer set
341 for (auto t: nodePtsMap)
343}
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 159 of file PointerAnalysisImpl.cpp.

160{
161 getPTDataTy()->remapAllPts();
162}

◆ 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 111 of file PointerAnalysisImpl.h.

112 {
113 return ptD->unionPts(id, target);
114 }

◆ unionPts() [2/2]

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

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

Definition at line 115 of file PointerAnalysisImpl.h.

116 {
117 return ptD->unionPts(id,ptd);
118 }

◆ 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 163 of file PointerAnalysisImpl.h.

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

◆ writeGepObjVarMapToFile()

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

Definition at line 226 of file PointerAnalysisImpl.cpp.

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

◆ writeObjVarToFile()

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

Definition at line 164 of file PointerAnalysisImpl.cpp.

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

◆ writePtsResultToFile()

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

Definition at line 200 of file PointerAnalysisImpl.cpp.

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

◆ 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 248 of file PointerAnalysisImpl.cpp.

249{
250
251 outs() << "Storing pointer analysis results to '" << filename << "'...";
252
254 std::fstream f(filename.c_str(), std::ios_base::app);
255 if (!f.good())
256 {
257 outs() << " error opening file for writing!\n";
258 return;
259 }
260
262
263 f << "------\n";
264
266
267 f << "------\n";
268
269 // Write BaseNodes insensitivity to file
271 for (auto it = pag->begin(), ie = pag->end(); it != ie; ++it)
272 {
273 PAGNode* pagNode = it->second;
274 if (!isa<ObjVar>(pagNode)) continue;
275 NodeID n = pag->getBaseObjVarID(it->first);
276 if (NodeIDs.test(n)) continue;
277 f << n << " ";
278 f << isFieldInsensitive(n) << "\n";
279 NodeIDs.set(n);
280 }
281
282 // Job finish and close file
283 f.close();
284 if (f.good())
285 {
286 outs() << "\n";
287 return;
288 }
289}
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 212 of file PointerAnalysisImpl.h.

◆ ptD

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

Points-to data.

Definition at line 210 of file PointerAnalysisImpl.h.


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