svf-lib 1.0.733 → 1.0.737
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SVF-linux/Release-build/lib/libSvf.a +0 -0
- package/SVF-linux/include/DDA/ContextDDA.h +1 -1
- package/SVF-linux/include/DDA/DDAClient.h +8 -8
- package/SVF-linux/include/DDA/DDAVFSolver.h +5 -5
- package/SVF-linux/include/DDA/FlowDDA.h +1 -1
- package/SVF-linux/include/Graphs/CHG.h +351 -0
- package/SVF-linux/include/Graphs/ConsG.h +6 -6
- package/SVF-linux/include/Graphs/ConsGEdge.h +2 -2
- package/SVF-linux/include/Graphs/ConsGNode.h +1 -1
- package/SVF-linux/include/Graphs/ExternalPAG.h +14 -14
- package/SVF-linux/include/Graphs/GenericGraph.h +1 -1
- package/SVF-linux/include/Graphs/ICFGNode.h +14 -14
- package/SVF-linux/include/Graphs/IRGraph.h +236 -0
- package/SVF-linux/include/Graphs/OfflineConsG.h +1 -1
- package/SVF-linux/include/Graphs/SVFG.h +1 -1
- package/SVF-linux/include/Graphs/SVFGOPT.h +3 -3
- package/SVF-linux/include/Graphs/VFG.h +53 -52
- package/SVF-linux/include/Graphs/VFGNode.h +60 -8
- package/SVF-linux/include/MSSA/MemRegion.h +11 -11
- package/SVF-linux/include/MSSA/MemSSA.h +4 -4
- package/SVF-linux/include/MTA/FSMPTA.h +1 -1
- package/SVF-linux/include/MemoryModel/PAGBuilderFromFile.h +8 -8
- package/SVF-linux/include/MemoryModel/PTAStat.h +31 -31
- package/SVF-linux/include/MemoryModel/PointerAnalysis.h +9 -9
- package/SVF-linux/include/MemoryModel/PointerAnalysisImpl.h +3 -3
- package/SVF-linux/include/MemoryModel/SVFIR.h +525 -233
- package/SVF-linux/include/MemoryModel/SVFStatements.h +970 -0
- package/SVF-linux/include/MemoryModel/SVFVariables.h +842 -0
- package/SVF-linux/include/MemoryModel/SymbolTableInfo.h +346 -55
- package/SVF-linux/include/SABER/SaberSVFGBuilder.h +0 -2
- package/SVF-linux/include/SABER/SrcSnkDDA.h +3 -3
- package/SVF-linux/include/SVF-FE/CHGBuilder.h +69 -0
- package/SVF-linux/include/SVF-FE/DCHG.h +1 -1
- package/SVF-linux/include/SVF-FE/Graph2Json.h +1 -3
- package/SVF-linux/include/SVF-FE/SVFIRBuilder.h +405 -0
- package/SVF-linux/include/SVF-FE/SymbolTableBuilder.h +0 -1
- package/SVF-linux/include/Util/CFLSolver.h +1 -1
- package/SVF-linux/include/Util/ExtAPI.h +1 -1
- package/SVF-linux/include/Util/IRAnnotator.h +6 -6
- package/SVF-linux/include/Util/Options.h +1 -1
- package/SVF-linux/include/Util/TypeBasedHeapCloning.h +11 -11
- package/SVF-linux/include/WPA/Andersen.h +11 -11
- package/SVF-linux/include/WPA/AndersenSFR.h +4 -4
- package/SVF-linux/include/WPA/FlowSensitive.h +2 -2
- package/SVF-linux/include/WPA/FlowSensitiveTBHC.h +1 -1
- package/SVF-linux/include/WPA/Steensgaard.h +2 -2
- package/SVF-linux/include/WPA/TypeAnalysis.h +1 -1
- package/SVF-linux/include/WPA/VersionedFlowSensitive.h +2 -2
- package/SVF-linux/include/WPA/WPAStat.h +1 -2
- package/SVF-osx/Release-build/lib/CUDD/libCudd.a +0 -0
- package/SVF-osx/Release-build/lib/libSvf.a +0 -0
- package/SVF-osx/include/Graphs/GenericGraph.h +1 -1
- package/SVF-osx/include/Graphs/IRGraph.h +6 -15
- package/SVF-osx/include/Graphs/VFG.h +26 -41
- package/SVF-osx/include/Graphs/VFGNode.h +2 -2
- package/SVF-osx/include/MemoryModel/SVFIR.h +29 -96
- package/SVF-osx/include/MemoryModel/SVFStatements.h +156 -22
- package/SVF-osx/include/SVF-FE/SVFIRBuilder.h +12 -6
- package/package.json +1 -1
|
@@ -58,7 +58,7 @@ public:
|
|
|
58
58
|
typedef BVDataPTAImpl::MutDFPTDataTy::PtsMap PtsMap;
|
|
59
59
|
|
|
60
60
|
/// Constructor
|
|
61
|
-
FlowSensitive(
|
|
61
|
+
FlowSensitive(SVFIR* _pag, PTATY type = FSSPARSE_WPA) : WPASVFGFSSolver(), BVDataPTAImpl(_pag, type)
|
|
62
62
|
{
|
|
63
63
|
svfg = nullptr;
|
|
64
64
|
solveTime = sccTime = processTime = propagationTime = updateTime = 0;
|
|
@@ -81,7 +81,7 @@ public:
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
/// Create signle instance of flow-sensitive pointer analysis
|
|
84
|
-
static FlowSensitive* createFSWPA(
|
|
84
|
+
static FlowSensitive* createFSWPA(SVFIR* _pag)
|
|
85
85
|
{
|
|
86
86
|
if (fspta == nullptr)
|
|
87
87
|
{
|
|
@@ -33,7 +33,7 @@ public:
|
|
|
33
33
|
static const MDNode *getRawCTirMetadata(const SVFGNode *);
|
|
34
34
|
|
|
35
35
|
/// Constructor
|
|
36
|
-
FlowSensitiveTBHC(
|
|
36
|
+
FlowSensitiveTBHC(SVFIR* _pag, PTATY type = FSTBHC_WPA);
|
|
37
37
|
|
|
38
38
|
/// Destructor
|
|
39
39
|
virtual ~FlowSensitiveTBHC() { };
|
|
@@ -26,13 +26,13 @@ public:
|
|
|
26
26
|
typedef Map<NodeID, Set<NodeID>> NodeToSubsMap;
|
|
27
27
|
|
|
28
28
|
/// Constructor
|
|
29
|
-
Steensgaard(
|
|
29
|
+
Steensgaard(SVFIR* _pag)
|
|
30
30
|
: AndersenBase(_pag, Steensgaard_WPA, true)
|
|
31
31
|
{
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/// Create an singleton instance
|
|
35
|
-
static Steensgaard* createSteensgaard(
|
|
35
|
+
static Steensgaard* createSteensgaard(SVFIR* _pag)
|
|
36
36
|
{
|
|
37
37
|
if(steens==nullptr)
|
|
38
38
|
{
|
|
@@ -47,7 +47,7 @@ public:
|
|
|
47
47
|
static VersionedVar atKey(NodeID, Version);
|
|
48
48
|
|
|
49
49
|
/// Constructor
|
|
50
|
-
VersionedFlowSensitive(
|
|
50
|
+
VersionedFlowSensitive(SVFIR *_pag, PTATY type = VFS_WPA);
|
|
51
51
|
|
|
52
52
|
/// Initialize analysis
|
|
53
53
|
virtual void initialize() override;
|
|
@@ -74,7 +74,7 @@ public:
|
|
|
74
74
|
//@}
|
|
75
75
|
|
|
76
76
|
/// Create single instance of versioned flow-sensitive points-to analysis.
|
|
77
|
-
static VersionedFlowSensitive *createVFSWPA(
|
|
77
|
+
static VersionedFlowSensitive *createVFSWPA(SVFIR *_pag)
|
|
78
78
|
{
|
|
79
79
|
if (vfspta == nullptr)
|
|
80
80
|
{
|
|
Binary file
|
|
Binary file
|
|
@@ -108,7 +108,7 @@ public:
|
|
|
108
108
|
}
|
|
109
109
|
} equalGEdge;
|
|
110
110
|
|
|
111
|
-
inline bool operator==(const GenericEdge<NodeType>* rhs) const
|
|
111
|
+
virtual inline bool operator==(const GenericEdge<NodeType>* rhs) const
|
|
112
112
|
{
|
|
113
113
|
return (rhs->edgeFlag == this->edgeFlag && rhs->getSrcID() == this->getSrcID()
|
|
114
114
|
&& rhs->getDstID() == this->getDstID());
|
|
@@ -51,16 +51,15 @@ public:
|
|
|
51
51
|
typedef Set<const SVFStmt*> PAGEdgeSet;
|
|
52
52
|
typedef Map<const Value*,PAGEdgeSet> ValueToEdgeMap;
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
protected:
|
|
55
|
+
SVFStmt::PAGKindToEdgeSetMapTy PAGEdgeKindToSetMap; // < SVFIR edge map containing all PAGEdges
|
|
56
|
+
SVFStmt::PAGKindToEdgeSetMapTy PTAPAGEdgeKindToSetMap; // < SVFIR edge map containing only pointer-related edges, i.e, both RHS and RHS are of pointer type
|
|
55
57
|
bool fromFile; ///< Whether the SVFIR is built according to user specified data from a txt file
|
|
56
58
|
NodeID nodeNumAfterPAGBuild; // initial node number after building SVFIR, excluding later added nodes, e.g., gepobj nodes
|
|
57
59
|
u32_t totalPTAPAGEdge;
|
|
58
|
-
SVFStmt::PAGKindToEdgeSetMapTy PAGEdgeKindToSetMap; // < SVFIR edge map containing all PAGEdges
|
|
59
|
-
SVFStmt::PAGKindToEdgeSetMapTy PTAPAGEdgeKindToSetMap; // < SVFIR edge map containing only pointer-related edges, i.e, both RHS and RHS are of pointer type
|
|
60
60
|
ValueToEdgeMap valueToEdgeMap; ///< Map llvm::Values to all corresponding PAGEdges
|
|
61
61
|
SymbolTableInfo* symInfo;
|
|
62
62
|
|
|
63
|
-
protected:
|
|
64
63
|
/// Add a node into the graph
|
|
65
64
|
inline NodeID addNode(SVFVar* node, NodeID i)
|
|
66
65
|
{
|
|
@@ -75,6 +74,9 @@ protected:
|
|
|
75
74
|
/// Return true if this labeled edge exits, including store, call and load
|
|
76
75
|
/// two store edge can have same dst and src but located in different basic blocks, thus flags are needed to distinguish them
|
|
77
76
|
SVFStmt* hasLabeledEdge(SVFVar* src, SVFVar* dst, SVFStmt::PEDGEK kind, const ICFGNode* cs);
|
|
77
|
+
/// Return MultiOpndStmt since it has more than one operands (we use operand 2 here to make the flag)
|
|
78
|
+
SVFStmt* hasLabeledEdge(SVFVar* src, SVFVar* op1, SVFStmt::PEDGEK kind, const SVFVar* op2);
|
|
79
|
+
|
|
78
80
|
/// Map a value to a set of edges
|
|
79
81
|
inline void mapValueToEdge(const Value *V, SVFStmt *edge)
|
|
80
82
|
{
|
|
@@ -102,17 +104,6 @@ public:
|
|
|
102
104
|
{
|
|
103
105
|
return fromFile;
|
|
104
106
|
}
|
|
105
|
-
/// Get edges set according to its kind
|
|
106
|
-
inline SVFStmt::PAGEdgeSetTy& getEdgeSet(SVFStmt::PEDGEK kind)
|
|
107
|
-
{
|
|
108
|
-
return PAGEdgeKindToSetMap[kind];
|
|
109
|
-
}
|
|
110
|
-
/// Get PTA edges set according to its kind
|
|
111
|
-
inline SVFStmt::PAGEdgeSetTy& getPTAEdgeSet(SVFStmt::PEDGEK kind)
|
|
112
|
-
{
|
|
113
|
-
return PTAPAGEdgeKindToSetMap[kind];
|
|
114
|
-
}
|
|
115
|
-
|
|
116
107
|
/// Get all SVFIR Edges that corresponds to an LLVM value
|
|
117
108
|
inline const PAGEdgeSet& getValueEdges(const Value *V)
|
|
118
109
|
{
|
|
@@ -561,70 +561,55 @@ protected:
|
|
|
561
561
|
PAGNodeToActualRetMap[ret] = sNode;
|
|
562
562
|
}
|
|
563
563
|
/// Add an llvm PHI VFG node
|
|
564
|
-
inline void addIntraPHIVFGNode(const
|
|
564
|
+
inline void addIntraPHIVFGNode(const PhiPE* edge)
|
|
565
565
|
{
|
|
566
|
-
IntraPHIVFGNode* sNode = new IntraPHIVFGNode(totalVFGNode++,
|
|
566
|
+
IntraPHIVFGNode* sNode = new IntraPHIVFGNode(totalVFGNode++,edge->getRes());
|
|
567
567
|
u32_t pos = 0;
|
|
568
|
-
|
|
569
|
-
for(SVFIR::CopyPEList::const_iterator it = oplist.begin(), eit=oplist.end(); it!=eit; ++it,++pos)
|
|
568
|
+
for(auto var : edge->getOpndVars())
|
|
570
569
|
{
|
|
571
|
-
|
|
572
|
-
|
|
570
|
+
sNode->setOpVerAndBB(pos, var, edge->getICFGNode());
|
|
571
|
+
pos++;
|
|
573
572
|
}
|
|
574
|
-
assert(edge && "edge not found?");
|
|
575
573
|
addVFGNode(sNode,edge->getICFGNode());
|
|
576
|
-
setDef(
|
|
577
|
-
PAGNodeToIntraPHIVFGNodeMap[
|
|
574
|
+
setDef(edge->getRes(),sNode);
|
|
575
|
+
PAGNodeToIntraPHIVFGNodeMap[edge->getRes()] = sNode;
|
|
578
576
|
}
|
|
579
577
|
/// Add a Compare VFG node
|
|
580
|
-
inline void addCmpVFGNode(const
|
|
578
|
+
inline void addCmpVFGNode(const CmpPE* edge)
|
|
581
579
|
{
|
|
582
|
-
CmpVFGNode* sNode = new CmpVFGNode(totalVFGNode++,
|
|
580
|
+
CmpVFGNode* sNode = new CmpVFGNode(totalVFGNode++, edge->getRes());
|
|
583
581
|
u32_t pos = 0;
|
|
584
|
-
|
|
585
|
-
for(SVFIR::CmpPEList::const_iterator it = oplist.begin(), eit=oplist.end(); it!=eit; ++it,++pos)
|
|
582
|
+
for(auto var : edge->getOpndVars())
|
|
586
583
|
{
|
|
587
|
-
|
|
588
|
-
|
|
584
|
+
sNode->setOpVer(pos, var);
|
|
585
|
+
pos++;
|
|
589
586
|
}
|
|
590
|
-
assert(edge && "edge not found?");
|
|
591
587
|
addVFGNode(sNode,edge->getICFGNode());
|
|
592
|
-
setDef(
|
|
593
|
-
PAGNodeToCmpVFGNodeMap[
|
|
588
|
+
setDef(edge->getRes(),sNode);
|
|
589
|
+
PAGNodeToCmpVFGNodeMap[edge->getRes()] = sNode;
|
|
594
590
|
}
|
|
595
591
|
/// Add a BinaryOperator VFG node
|
|
596
|
-
inline void addBinaryOPVFGNode(const
|
|
592
|
+
inline void addBinaryOPVFGNode(const BinaryOPPE* edge)
|
|
597
593
|
{
|
|
598
|
-
BinaryOPVFGNode* sNode = new BinaryOPVFGNode(totalVFGNode++,
|
|
594
|
+
BinaryOPVFGNode* sNode = new BinaryOPVFGNode(totalVFGNode++, edge->getRes());
|
|
599
595
|
u32_t pos = 0;
|
|
600
|
-
|
|
601
|
-
for(SVFIR::BinaryOPList::const_iterator it = oplist.begin(), eit=oplist.end(); it!=eit; ++it,++pos)
|
|
596
|
+
for(auto var : edge->getOpndVars())
|
|
602
597
|
{
|
|
603
|
-
|
|
604
|
-
|
|
598
|
+
sNode->setOpVer(pos, var);
|
|
599
|
+
pos++;
|
|
605
600
|
}
|
|
606
|
-
|
|
607
|
-
assert(edge && "edge not found?");
|
|
608
601
|
addVFGNode(sNode,edge->getICFGNode());
|
|
609
|
-
setDef(
|
|
610
|
-
PAGNodeToBinaryOPVFGNodeMap[
|
|
602
|
+
setDef(edge->getRes(),sNode);
|
|
603
|
+
PAGNodeToBinaryOPVFGNodeMap[edge->getRes()] = sNode;
|
|
611
604
|
}
|
|
612
605
|
/// Add a UnaryOperator VFG node
|
|
613
|
-
inline void addUnaryOPVFGNode(const
|
|
606
|
+
inline void addUnaryOPVFGNode(const UnaryOPPE* edge)
|
|
614
607
|
{
|
|
615
|
-
UnaryOPVFGNode* sNode = new UnaryOPVFGNode(totalVFGNode++,
|
|
616
|
-
|
|
617
|
-
const PAGEdge* edge = nullptr;
|
|
618
|
-
for(SVFIR::UnaryOPList::const_iterator it = oplist.begin(), eit=oplist.end(); it!=eit; ++it,++pos)
|
|
619
|
-
{
|
|
620
|
-
edge = *it;
|
|
621
|
-
sNode->setOpVer(pos, (*it)->getSrcNode());
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
assert(edge && "edge not found?");
|
|
608
|
+
UnaryOPVFGNode* sNode = new UnaryOPVFGNode(totalVFGNode++, edge->getDstNode());
|
|
609
|
+
sNode->setOpVer(0, edge->getSrcNode());
|
|
625
610
|
addVFGNode(sNode,edge->getICFGNode());
|
|
626
|
-
setDef(
|
|
627
|
-
PAGNodeToUnaryOPVFGNodeMap[
|
|
611
|
+
setDef(edge->getDstNode(),sNode);
|
|
612
|
+
PAGNodeToUnaryOPVFGNodeMap[edge->getDstNode()] = sNode;
|
|
628
613
|
}
|
|
629
614
|
};
|
|
630
615
|
|
|
@@ -330,7 +330,7 @@ public:
|
|
|
330
330
|
CmpVFGNode(NodeID id,const PAGNode* r): VFGNode(id,Cmp), res(r)
|
|
331
331
|
{
|
|
332
332
|
const CmpInst* cmp = SVFUtil::dyn_cast<CmpInst>(r->getValue());
|
|
333
|
-
assert(cmp && "not a
|
|
333
|
+
assert(cmp && "not a compare operator?");
|
|
334
334
|
}
|
|
335
335
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
336
336
|
//@{
|
|
@@ -1091,7 +1091,7 @@ public:
|
|
|
1091
1091
|
return node->isPointer();
|
|
1092
1092
|
}
|
|
1093
1093
|
/// Return corresponding PAGNode
|
|
1094
|
-
const PAGNode*
|
|
1094
|
+
const PAGNode* getPAGNode() const
|
|
1095
1095
|
{
|
|
1096
1096
|
return node;
|
|
1097
1097
|
}
|
|
@@ -56,13 +56,7 @@ public:
|
|
|
56
56
|
typedef std::vector<const SVFStmt*> PAGEdgeList;
|
|
57
57
|
typedef std::vector<const SVFVar*> PAGNodeList;
|
|
58
58
|
typedef std::vector<const CopyPE*> CopyPEList;
|
|
59
|
-
typedef
|
|
60
|
-
typedef std::vector<const UnaryOPPE*> UnaryOPList;
|
|
61
|
-
typedef std::vector<const CmpPE*> CmpPEList;
|
|
62
|
-
typedef Map<const SVFVar*,CopyPEList> PHINodeMap;
|
|
63
|
-
typedef Map<const SVFVar*,BinaryOPList> BinaryNodeMap;
|
|
64
|
-
typedef Map<const SVFVar*,UnaryOPList> UnaryNodeMap;
|
|
65
|
-
typedef Map<const SVFVar*,CmpPEList> CmpNodeMap;
|
|
59
|
+
typedef Map<const SVFVar*,PhiPE*> PHINodeMap;
|
|
66
60
|
typedef Map<const SVFFunction*,PAGNodeList> FunToArgsListMap;
|
|
67
61
|
typedef Map<const CallBlockNode*,PAGNodeList> CSToArgsListMap;
|
|
68
62
|
typedef Map<const RetBlockNode*,const SVFVar*> CSToRetMap;
|
|
@@ -87,9 +81,6 @@ private:
|
|
|
87
81
|
MemObjToFieldsMap memToFieldsMap; ///< Map a mem object id to all its fields
|
|
88
82
|
PAGEdgeSet globPAGEdgesSet; ///< Global PAGEdges without control flow information
|
|
89
83
|
PHINodeMap phiNodeMap; ///< A set of phi copy edges
|
|
90
|
-
BinaryNodeMap binaryNodeMap; ///< A set of binary edges
|
|
91
|
-
UnaryNodeMap unaryNodeMap; ///< A set of unary edges
|
|
92
|
-
CmpNodeMap cmpNodeMap; ///< A set of comparision edges
|
|
93
84
|
FunToArgsListMap funArgsListMap; ///< Map a function to a list of all its formal parameters
|
|
94
85
|
CSToArgsListMap callSiteArgsListMap; ///< Map a callsite to a list of all its actual parameters
|
|
95
86
|
CSToRetMap callSiteRetMap; ///< Map a callsite to its callsite returns PAGNodes
|
|
@@ -166,16 +157,18 @@ public:
|
|
|
166
157
|
{
|
|
167
158
|
return SymbolTableInfo::SymbolInfo()->getModule();
|
|
168
159
|
}
|
|
169
|
-
|
|
160
|
+
/// Get/set methods to get SVFStmts based on their kinds and ICFGNodes
|
|
161
|
+
//@{
|
|
162
|
+
/// Get edges set according to its kind
|
|
163
|
+
inline SVFStmt::PAGEdgeSetTy& getEdgeSet(SVFStmt::PEDGEK kind)
|
|
170
164
|
{
|
|
171
|
-
|
|
165
|
+
return PAGEdgeKindToSetMap[kind];
|
|
172
166
|
}
|
|
173
|
-
|
|
167
|
+
/// Get PTA edges set according to its kind
|
|
168
|
+
inline SVFStmt::PAGEdgeSetTy& getPTAEdgeSet(SVFStmt::PEDGEK kind)
|
|
174
169
|
{
|
|
175
|
-
return
|
|
170
|
+
return PTAPAGEdgeKindToSetMap[kind];
|
|
176
171
|
}
|
|
177
|
-
/// Get/set methods to get control flow information of a SVFStmt
|
|
178
|
-
//@{
|
|
179
172
|
/// Whether this instruction has SVFIR Edge
|
|
180
173
|
inline bool hasPAGEdgeList(const ICFGNode* inst) const
|
|
181
174
|
{
|
|
@@ -213,93 +206,31 @@ public:
|
|
|
213
206
|
{
|
|
214
207
|
return globPAGEdgesSet;
|
|
215
208
|
}
|
|
216
|
-
|
|
217
|
-
inline void addPhiNode(const SVFVar* res, const CopyPE* edge)
|
|
218
|
-
{
|
|
219
|
-
phiNodeMap[res].push_back(edge);
|
|
220
|
-
}
|
|
221
|
-
/// Whether this SVFVar is a result operand a of phi node
|
|
222
|
-
inline bool isPhiNode(const SVFVar* node) const
|
|
223
|
-
{
|
|
224
|
-
return phiNodeMap.find(node) != phiNodeMap.end();
|
|
225
|
-
}
|
|
226
|
-
/// Get all phi copy edges
|
|
227
|
-
inline PHINodeMap& getPhiNodeMap()
|
|
228
|
-
{
|
|
229
|
-
return phiNodeMap;
|
|
230
|
-
}
|
|
231
|
-
/// Get the corresponding PhiCopyPEs
|
|
232
|
-
inline const CopyPEList& getPhiCopyPEs(const SVFVar* node) const{
|
|
233
|
-
PHINodeMap::const_iterator it = phiNodeMap.find(node);
|
|
234
|
-
assert(it != phiNodeMap.end() && "PhiCopyPEs not found!");
|
|
235
|
-
return it->second;
|
|
236
|
-
}
|
|
237
|
-
/// Add phi node information
|
|
238
|
-
inline void addBinaryNode(const SVFVar* res, const BinaryOPPE* edge)
|
|
239
|
-
{
|
|
240
|
-
binaryNodeMap[res].push_back(edge);
|
|
241
|
-
}
|
|
242
|
-
/// Whether this SVFVar is a result operand a of phi node
|
|
243
|
-
inline bool isBinaryNode(const SVFVar* node) const
|
|
244
|
-
{
|
|
245
|
-
return binaryNodeMap.find(node) != binaryNodeMap.end();
|
|
246
|
-
}
|
|
247
|
-
/// Get all phi copy edges
|
|
248
|
-
inline BinaryNodeMap& getBinaryNodeMap()
|
|
249
|
-
{
|
|
250
|
-
return binaryNodeMap;
|
|
251
|
-
}
|
|
252
|
-
/// Get the corresponding BinaryPEs
|
|
253
|
-
inline const BinaryOPList& getBinaryPEs(const SVFVar* node) const{
|
|
254
|
-
BinaryNodeMap::const_iterator it = binaryNodeMap.find(node);
|
|
255
|
-
assert(it != binaryNodeMap.end() && "BinaryPEs not found!");
|
|
256
|
-
return it->second;
|
|
257
|
-
}
|
|
258
|
-
/// Add unary node information
|
|
259
|
-
inline void addUnaryNode(const SVFVar* res, const UnaryOPPE* edge)
|
|
260
|
-
{
|
|
261
|
-
unaryNodeMap[res].push_back(edge);
|
|
262
|
-
}
|
|
263
|
-
/// Whether this SVFVar is an unary node
|
|
264
|
-
inline bool isUnaryNode(const SVFVar* node) const
|
|
265
|
-
{
|
|
266
|
-
return unaryNodeMap.find(node) != unaryNodeMap.end();
|
|
267
|
-
}
|
|
268
|
-
/// Get all unary edges
|
|
269
|
-
inline UnaryNodeMap& getUnaryNodeMap()
|
|
209
|
+
inline void addCallSite(const CallBlockNode* call)
|
|
270
210
|
{
|
|
271
|
-
|
|
272
|
-
}
|
|
273
|
-
/// Get the corresponding UnaryPEs
|
|
274
|
-
inline const UnaryOPList& getUnaryPEs(const SVFVar* node) const{
|
|
275
|
-
UnaryNodeMap::const_iterator it = unaryNodeMap.find(node);
|
|
276
|
-
assert(it != unaryNodeMap.end() && "UnaryPEs not found!");
|
|
277
|
-
return it->second;
|
|
211
|
+
callSiteSet.insert(call);
|
|
278
212
|
}
|
|
279
|
-
|
|
280
|
-
inline void addCmpNode(const SVFVar* res, const CmpPE* edge)
|
|
213
|
+
inline const CallSiteSet& getCallSiteSet() const
|
|
281
214
|
{
|
|
282
|
-
|
|
215
|
+
return callSiteSet;
|
|
283
216
|
}
|
|
284
217
|
/// Whether this SVFVar is a result operand a of phi node
|
|
285
|
-
inline bool
|
|
286
|
-
{
|
|
287
|
-
return cmpNodeMap.find(node) != cmpNodeMap.end();
|
|
288
|
-
}
|
|
289
|
-
/// Get all phi copy edges
|
|
290
|
-
inline CmpNodeMap& getCmpNodeMap()
|
|
218
|
+
inline bool isPhiNode(const SVFVar* node) const
|
|
291
219
|
{
|
|
292
|
-
return
|
|
293
|
-
}
|
|
294
|
-
/// Get the corresponding CmpPEs
|
|
295
|
-
inline const CmpPEList& getCmpPEs(const SVFVar* node) const{
|
|
296
|
-
CmpNodeMap::const_iterator it = cmpNodeMap.find(node);
|
|
297
|
-
assert(it != cmpNodeMap.end() && "CmpPEs not found!");
|
|
298
|
-
return it->second;
|
|
220
|
+
return phiNodeMap.find(node) != phiNodeMap.end();
|
|
299
221
|
}
|
|
300
|
-
//@}
|
|
301
222
|
|
|
302
223
|
private:
|
|
224
|
+
/// Map a SVFStatement type to a set of corresponding SVF statements
|
|
225
|
+
inline void addToStmt2TypeMap(SVFStmt* edge) {
|
|
226
|
+
bool added = PAGEdgeKindToSetMap[edge->getEdgeKind()].insert(edge).second;
|
|
227
|
+
assert(added && "duplicated edge, not added!!!");
|
|
228
|
+
if (edge->isPTAEdge())
|
|
229
|
+
{
|
|
230
|
+
totalPTAPAGEdge++;
|
|
231
|
+
PTAPAGEdgeKindToSetMap[edge->getEdgeKind()].insert(edge);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
303
234
|
/// Get/set method for function/callsite arguments and returns
|
|
304
235
|
//@{
|
|
305
236
|
/// Add function arguments
|
|
@@ -680,10 +611,12 @@ private:
|
|
|
680
611
|
AddrPE* addAddrPE(NodeID src, NodeID dst);
|
|
681
612
|
/// Add Copy edge
|
|
682
613
|
CopyPE* addCopyPE(NodeID src, NodeID dst);
|
|
614
|
+
/// Add phi node information
|
|
615
|
+
PhiPE* addPhiNode(NodeID res, NodeID opnd);
|
|
683
616
|
/// Add Copy edge
|
|
684
|
-
CmpPE* addCmpPE(NodeID
|
|
617
|
+
CmpPE* addCmpPE(NodeID op1, NodeID op2, NodeID dst);
|
|
685
618
|
/// Add Copy edge
|
|
686
|
-
BinaryOPPE* addBinaryOPPE(NodeID
|
|
619
|
+
BinaryOPPE* addBinaryOPPE(NodeID op1, NodeID op2, NodeID dst);
|
|
687
620
|
/// Add Unary edge
|
|
688
621
|
UnaryOPPE* addUnaryOPPE(NodeID src, NodeID dst);
|
|
689
622
|
/// Add Load edge
|