svf-lib 1.0.1482 → 1.0.1484
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/svf/libSvfCore.a +0 -0
- package/SVF-linux/Release-build/svf-llvm/libSvfLLVM.a +0 -0
- package/SVF-linux/svf/include/WPA/Steensgaard.h +30 -15
- package/SVF-osx/Release-build/svf/libSvfCore.a +0 -0
- package/SVF-osx/Release-build/svf-llvm/libSvfLLVM.a +0 -0
- package/SVF-osx/svf/include/WPA/Steensgaard.h +30 -15
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
@@ -17,24 +17,21 @@ namespace SVF
|
|
|
17
17
|
*/
|
|
18
18
|
typedef WPASolver<ConstraintGraph*> WPAConstraintSolver;
|
|
19
19
|
|
|
20
|
-
class Steensgaard:
|
|
20
|
+
class Steensgaard : public AndersenBase
|
|
21
21
|
{
|
|
22
22
|
|
|
23
23
|
public:
|
|
24
|
-
|
|
25
24
|
typedef Map<NodeID, NodeID> NodeToEquivClassMap;
|
|
26
25
|
typedef Map<NodeID, Set<NodeID>> NodeToSubsMap;
|
|
26
|
+
typedef OrderedMap<CallSite, NodeID> CallSite2DummyValPN;
|
|
27
27
|
|
|
28
28
|
/// Constructor
|
|
29
|
-
Steensgaard(SVFIR* _pag)
|
|
30
|
-
: AndersenBase(_pag, Steensgaard_WPA, true)
|
|
31
|
-
{
|
|
32
|
-
}
|
|
29
|
+
Steensgaard(SVFIR* _pag) : AndersenBase(_pag, Steensgaard_WPA, true) {}
|
|
33
30
|
|
|
34
31
|
/// Create an singleton instance
|
|
35
32
|
static Steensgaard* createSteensgaard(SVFIR* _pag)
|
|
36
33
|
{
|
|
37
|
-
if(steens==nullptr)
|
|
34
|
+
if (steens == nullptr)
|
|
38
35
|
{
|
|
39
36
|
steens = new Steensgaard(_pag);
|
|
40
37
|
steens->analyze();
|
|
@@ -57,15 +54,15 @@ public:
|
|
|
57
54
|
|
|
58
55
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
59
56
|
//@{
|
|
60
|
-
static inline bool classof(const Steensgaard
|
|
57
|
+
static inline bool classof(const Steensgaard*)
|
|
61
58
|
{
|
|
62
59
|
return true;
|
|
63
60
|
}
|
|
64
|
-
static inline bool classof(const AndersenBase
|
|
61
|
+
static inline bool classof(const AndersenBase* pta)
|
|
65
62
|
{
|
|
66
63
|
return (pta->getAnalysisTy() == Steensgaard_WPA);
|
|
67
64
|
}
|
|
68
|
-
static inline bool classof(const PointerAnalysis
|
|
65
|
+
static inline bool classof(const PointerAnalysis* pta)
|
|
69
66
|
{
|
|
70
67
|
return (pta->getAnalysisTy() == Steensgaard_WPA);
|
|
71
68
|
}
|
|
@@ -87,7 +84,7 @@ public:
|
|
|
87
84
|
{
|
|
88
85
|
id = getEC(id);
|
|
89
86
|
ptd = getEC(ptd);
|
|
90
|
-
return getPTDataTy()->unionPts(id,ptd);
|
|
87
|
+
return getPTDataTy()->unionPts(id, ptd);
|
|
91
88
|
}
|
|
92
89
|
|
|
93
90
|
/// API for equivalence class operations
|
|
@@ -96,7 +93,7 @@ public:
|
|
|
96
93
|
inline NodeID getEC(NodeID id) const
|
|
97
94
|
{
|
|
98
95
|
NodeToEquivClassMap::const_iterator it = nodeToECMap.find(id);
|
|
99
|
-
if(it==nodeToECMap.end())
|
|
96
|
+
if (it == nodeToECMap.end())
|
|
100
97
|
return id;
|
|
101
98
|
else
|
|
102
99
|
return it->second;
|
|
@@ -113,14 +110,32 @@ public:
|
|
|
113
110
|
nodeToSubsMap[node].insert(sub);
|
|
114
111
|
}
|
|
115
112
|
|
|
116
|
-
|
|
113
|
+
/// Add copy edge on constraint graph
|
|
114
|
+
virtual inline bool addCopyEdge(NodeID src, NodeID dst)
|
|
115
|
+
{
|
|
116
|
+
return consCG->addCopyCGEdge(src, dst);
|
|
117
|
+
}
|
|
117
118
|
|
|
119
|
+
protected:
|
|
120
|
+
CallSite2DummyValPN
|
|
121
|
+
callsite2DummyValPN; ///< Map an instruction to a dummy obj which
|
|
122
|
+
///< created at an indirect callsite, which invokes
|
|
123
|
+
///< a heap allocator
|
|
124
|
+
void heapAllocatorViaIndCall(CallSite cs, NodePairSet& cpySrcNodes);
|
|
125
|
+
|
|
126
|
+
/// Update call graph for the input indirect callsites
|
|
127
|
+
virtual bool updateCallGraph(const CallSiteToFunPtrMap& callsites);
|
|
128
|
+
|
|
129
|
+
/// Connect formal and actual parameters for indirect callsites
|
|
130
|
+
void connectCaller2CalleeParams(CallSite cs, const SVFFunction* F,
|
|
131
|
+
NodePairSet& cpySrcNodes);
|
|
132
|
+
|
|
133
|
+
private:
|
|
118
134
|
static Steensgaard* steens; // static instance
|
|
119
135
|
NodeToEquivClassMap nodeToECMap;
|
|
120
136
|
NodeToSubsMap nodeToSubsMap;
|
|
121
137
|
};
|
|
122
138
|
|
|
123
|
-
}
|
|
124
|
-
|
|
139
|
+
} // namespace SVF
|
|
125
140
|
|
|
126
141
|
#endif /* INCLUDE_WPA_STEENSGAARD_H_ */
|
|
Binary file
|
|
Binary file
|
|
@@ -17,24 +17,21 @@ namespace SVF
|
|
|
17
17
|
*/
|
|
18
18
|
typedef WPASolver<ConstraintGraph*> WPAConstraintSolver;
|
|
19
19
|
|
|
20
|
-
class Steensgaard:
|
|
20
|
+
class Steensgaard : public AndersenBase
|
|
21
21
|
{
|
|
22
22
|
|
|
23
23
|
public:
|
|
24
|
-
|
|
25
24
|
typedef Map<NodeID, NodeID> NodeToEquivClassMap;
|
|
26
25
|
typedef Map<NodeID, Set<NodeID>> NodeToSubsMap;
|
|
26
|
+
typedef OrderedMap<CallSite, NodeID> CallSite2DummyValPN;
|
|
27
27
|
|
|
28
28
|
/// Constructor
|
|
29
|
-
Steensgaard(SVFIR* _pag)
|
|
30
|
-
: AndersenBase(_pag, Steensgaard_WPA, true)
|
|
31
|
-
{
|
|
32
|
-
}
|
|
29
|
+
Steensgaard(SVFIR* _pag) : AndersenBase(_pag, Steensgaard_WPA, true) {}
|
|
33
30
|
|
|
34
31
|
/// Create an singleton instance
|
|
35
32
|
static Steensgaard* createSteensgaard(SVFIR* _pag)
|
|
36
33
|
{
|
|
37
|
-
if(steens==nullptr)
|
|
34
|
+
if (steens == nullptr)
|
|
38
35
|
{
|
|
39
36
|
steens = new Steensgaard(_pag);
|
|
40
37
|
steens->analyze();
|
|
@@ -57,15 +54,15 @@ public:
|
|
|
57
54
|
|
|
58
55
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
59
56
|
//@{
|
|
60
|
-
static inline bool classof(const Steensgaard
|
|
57
|
+
static inline bool classof(const Steensgaard*)
|
|
61
58
|
{
|
|
62
59
|
return true;
|
|
63
60
|
}
|
|
64
|
-
static inline bool classof(const AndersenBase
|
|
61
|
+
static inline bool classof(const AndersenBase* pta)
|
|
65
62
|
{
|
|
66
63
|
return (pta->getAnalysisTy() == Steensgaard_WPA);
|
|
67
64
|
}
|
|
68
|
-
static inline bool classof(const PointerAnalysis
|
|
65
|
+
static inline bool classof(const PointerAnalysis* pta)
|
|
69
66
|
{
|
|
70
67
|
return (pta->getAnalysisTy() == Steensgaard_WPA);
|
|
71
68
|
}
|
|
@@ -87,7 +84,7 @@ public:
|
|
|
87
84
|
{
|
|
88
85
|
id = getEC(id);
|
|
89
86
|
ptd = getEC(ptd);
|
|
90
|
-
return getPTDataTy()->unionPts(id,ptd);
|
|
87
|
+
return getPTDataTy()->unionPts(id, ptd);
|
|
91
88
|
}
|
|
92
89
|
|
|
93
90
|
/// API for equivalence class operations
|
|
@@ -96,7 +93,7 @@ public:
|
|
|
96
93
|
inline NodeID getEC(NodeID id) const
|
|
97
94
|
{
|
|
98
95
|
NodeToEquivClassMap::const_iterator it = nodeToECMap.find(id);
|
|
99
|
-
if(it==nodeToECMap.end())
|
|
96
|
+
if (it == nodeToECMap.end())
|
|
100
97
|
return id;
|
|
101
98
|
else
|
|
102
99
|
return it->second;
|
|
@@ -113,14 +110,32 @@ public:
|
|
|
113
110
|
nodeToSubsMap[node].insert(sub);
|
|
114
111
|
}
|
|
115
112
|
|
|
116
|
-
|
|
113
|
+
/// Add copy edge on constraint graph
|
|
114
|
+
virtual inline bool addCopyEdge(NodeID src, NodeID dst)
|
|
115
|
+
{
|
|
116
|
+
return consCG->addCopyCGEdge(src, dst);
|
|
117
|
+
}
|
|
117
118
|
|
|
119
|
+
protected:
|
|
120
|
+
CallSite2DummyValPN
|
|
121
|
+
callsite2DummyValPN; ///< Map an instruction to a dummy obj which
|
|
122
|
+
///< created at an indirect callsite, which invokes
|
|
123
|
+
///< a heap allocator
|
|
124
|
+
void heapAllocatorViaIndCall(CallSite cs, NodePairSet& cpySrcNodes);
|
|
125
|
+
|
|
126
|
+
/// Update call graph for the input indirect callsites
|
|
127
|
+
virtual bool updateCallGraph(const CallSiteToFunPtrMap& callsites);
|
|
128
|
+
|
|
129
|
+
/// Connect formal and actual parameters for indirect callsites
|
|
130
|
+
void connectCaller2CalleeParams(CallSite cs, const SVFFunction* F,
|
|
131
|
+
NodePairSet& cpySrcNodes);
|
|
132
|
+
|
|
133
|
+
private:
|
|
118
134
|
static Steensgaard* steens; // static instance
|
|
119
135
|
NodeToEquivClassMap nodeToECMap;
|
|
120
136
|
NodeToSubsMap nodeToSubsMap;
|
|
121
137
|
};
|
|
122
138
|
|
|
123
|
-
}
|
|
124
|
-
|
|
139
|
+
} // namespace SVF
|
|
125
140
|
|
|
126
141
|
#endif /* INCLUDE_WPA_STEENSGAARD_H_ */
|