svf-lib 1.0.2195 → 1.0.2196
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/bin/ae +0 -0
- package/SVF-linux/Release-build/bin/cfl +0 -0
- package/SVF-linux/Release-build/bin/dvf +0 -0
- package/SVF-linux/Release-build/bin/llvm2svf +0 -0
- package/SVF-linux/Release-build/bin/mta +0 -0
- package/SVF-linux/Release-build/bin/saber +0 -0
- package/SVF-linux/Release-build/bin/svf-ex +0 -0
- package/SVF-linux/Release-build/bin/wpa +0 -0
- package/SVF-linux/Release-build/include/AE/Svfexe/AbsExtAPI.h +0 -7
- package/SVF-linux/Release-build/include/CFL/CFLAlias.h +0 -8
- package/SVF-linux/Release-build/include/DDA/DDAPass.h +4 -1
- package/SVF-linux/Release-build/include/Graphs/ConsG.h +0 -5
- package/SVF-linux/Release-build/include/Graphs/IRGraph.h +0 -24
- package/SVF-linux/Release-build/include/MSSA/MemRegion.h +1 -1
- package/SVF-linux/Release-build/include/MemoryModel/PointerAnalysis.h +2 -2
- package/SVF-linux/Release-build/include/MemoryModel/PointerAnalysisImpl.h +7 -4
- package/SVF-linux/Release-build/include/SVFIR/SVFIR.h +3 -3
- package/SVF-linux/Release-build/include/SVFIR/SVFVariables.h +3 -3
- package/SVF-linux/Release-build/include/Util/SVFUtil.h +0 -16
- package/SVF-linux/Release-build/include/WPA/WPAPass.h +0 -7
- package/SVF-linux/Release-build/lib/libSvfCore.a +0 -0
- package/SVF-linux/Release-build/lib/libSvfLLVM.a +0 -0
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -130,13 +130,6 @@ public:
|
|
|
130
130
|
*/
|
|
131
131
|
AbstractState& getAbsStateFromTrace(const ICFGNode* node);
|
|
132
132
|
|
|
133
|
-
/**
|
|
134
|
-
* @brief Retrieves the SVF variable from a given SVF value.
|
|
135
|
-
* @param val Pointer to the SVF value.
|
|
136
|
-
* @return Pointer to the corresponding SVF variable.
|
|
137
|
-
*/
|
|
138
|
-
const SVFVar* getSVFVar(const SVFValue* val);
|
|
139
|
-
|
|
140
133
|
protected:
|
|
141
134
|
SVFIR* svfir; ///< Pointer to the SVF intermediate representation.
|
|
142
135
|
ICFG* icfg; ///< Pointer to the interprocedural control flow graph.
|
|
@@ -61,14 +61,6 @@ public:
|
|
|
61
61
|
/// Solving CFL Reachability
|
|
62
62
|
virtual void solve();
|
|
63
63
|
|
|
64
|
-
/// Interface exposed to users of our Alias analysis, given Value infos
|
|
65
|
-
virtual AliasResult alias(const SVFValue* v1, const SVFValue* v2)
|
|
66
|
-
{
|
|
67
|
-
NodeID n1 = svfir->getValueNode(v1);
|
|
68
|
-
NodeID n2 = svfir->getValueNode(v2);
|
|
69
|
-
return alias(n1,n2);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
64
|
/// Interface exposed to users of our Alias analysis, given PAGNodeID
|
|
73
65
|
virtual AliasResult alias(NodeID node1, NodeID node2)
|
|
74
66
|
{
|
|
@@ -57,7 +57,10 @@ public:
|
|
|
57
57
|
~DDAPass();
|
|
58
58
|
|
|
59
59
|
/// Interface expose to users of our pointer analysis, given Value infos
|
|
60
|
-
virtual AliasResult alias(const
|
|
60
|
+
virtual AliasResult alias(const SVFVar* V1, const SVFVar* V2)
|
|
61
|
+
{
|
|
62
|
+
return alias(V1->getId(), V2->getId());
|
|
63
|
+
}
|
|
61
64
|
|
|
62
65
|
/// Interface expose to users of our pointer analysis, given PAGNodes
|
|
63
66
|
virtual AliasResult alias(NodeID V1, NodeID V2);
|
|
@@ -76,11 +76,6 @@ protected:
|
|
|
76
76
|
|
|
77
77
|
/// Wrappers used internally, not expose to Andersen Pass
|
|
78
78
|
//@{
|
|
79
|
-
inline NodeID getValueNode(const SVFValue* value) const
|
|
80
|
-
{
|
|
81
|
-
return sccRepNode(pag->getValueNode(value));
|
|
82
|
-
}
|
|
83
|
-
|
|
84
79
|
inline NodeID getReturnNode(const SVFFunction* value) const
|
|
85
80
|
{
|
|
86
81
|
return pag->getReturnNode(value);
|
|
@@ -53,7 +53,6 @@ class IRGraph : public GenericGraph<SVFVar, SVFStmt>
|
|
|
53
53
|
|
|
54
54
|
public:
|
|
55
55
|
typedef Set<const SVFStmt*> SVFStmtSet;
|
|
56
|
-
typedef Map<const SVFValue*,SVFStmtSet> ValueToEdgeMap;
|
|
57
56
|
|
|
58
57
|
protected:
|
|
59
58
|
SVFStmt::KindToSVFStmtMapTy KindToSVFStmtSetMap; ///< SVFIR edge map containing all PAGEdges
|
|
@@ -61,7 +60,6 @@ protected:
|
|
|
61
60
|
bool fromFile; ///< Whether the SVFIR is built according to user specified data from a txt file
|
|
62
61
|
NodeID nodeNumAfterPAGBuild; ///< initial node number after building SVFIR, excluding later added nodes, e.g., gepobj nodes
|
|
63
62
|
u32_t totalPTAPAGEdge;
|
|
64
|
-
ValueToEdgeMap valueToEdgeMap; ///< Map SVFValues (e.g., ICFGNodes) to all corresponding PAGEdges
|
|
65
63
|
SymbolTableInfo* symInfo;
|
|
66
64
|
|
|
67
65
|
/// Add a node into the graph
|
|
@@ -86,22 +84,11 @@ protected:
|
|
|
86
84
|
SVFStmt* hasLabeledEdge(SVFVar* src, SVFVar* op1, SVFStmt::PEDGEK kind,
|
|
87
85
|
const SVFVar* op2);
|
|
88
86
|
|
|
89
|
-
/// Map a value to a set of edges
|
|
90
|
-
inline void mapValueToEdge(const SVFValue* V, SVFStmt *edge)
|
|
91
|
-
{
|
|
92
|
-
auto inserted = valueToEdgeMap.emplace(V, SVFStmtSet{edge});
|
|
93
|
-
if (!inserted.second)
|
|
94
|
-
{
|
|
95
|
-
inserted.first->second.emplace(edge);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
87
|
public:
|
|
99
88
|
IRGraph(bool buildFromFile)
|
|
100
89
|
: fromFile(buildFromFile), nodeNumAfterPAGBuild(0), totalPTAPAGEdge(0)
|
|
101
90
|
{
|
|
102
91
|
symInfo = SymbolTableInfo::SymbolInfo();
|
|
103
|
-
// insert dummy value if a correct value cannot be found
|
|
104
|
-
valueToEdgeMap[nullptr] = SVFStmtSet();
|
|
105
92
|
}
|
|
106
93
|
|
|
107
94
|
virtual ~IRGraph();
|
|
@@ -115,17 +102,6 @@ public:
|
|
|
115
102
|
{
|
|
116
103
|
return fromFile;
|
|
117
104
|
}
|
|
118
|
-
/// Get all SVFIR Edges that corresponds to an LLVM value
|
|
119
|
-
inline const SVFStmtSet& getValueEdges(const SVFValue* V)
|
|
120
|
-
{
|
|
121
|
-
auto it = valueToEdgeMap.find(V);
|
|
122
|
-
if (it == valueToEdgeMap.end())
|
|
123
|
-
{
|
|
124
|
-
//special empty set
|
|
125
|
-
return valueToEdgeMap.at(nullptr);
|
|
126
|
-
}
|
|
127
|
-
return it->second;
|
|
128
|
-
}
|
|
129
105
|
|
|
130
106
|
/// Get SVFIR Node according to LLVM value
|
|
131
107
|
///getNode - Return the node corresponding to the specified pointer.
|
|
@@ -480,7 +480,7 @@ public:
|
|
|
480
480
|
NodeBS getModInfoForCall(const CallICFGNode* cs);
|
|
481
481
|
NodeBS getRefInfoForCall(const CallICFGNode* cs);
|
|
482
482
|
ModRefInfo getModRefInfo(const CallICFGNode* cs);
|
|
483
|
-
ModRefInfo getModRefInfo(const CallICFGNode* cs, const
|
|
483
|
+
ModRefInfo getModRefInfo(const CallICFGNode* cs, const SVFVar* V);
|
|
484
484
|
ModRefInfo getModRefInfo(const CallICFGNode* cs1, const CallICFGNode* cs2);
|
|
485
485
|
//@}
|
|
486
486
|
|
|
@@ -233,8 +233,8 @@ public:
|
|
|
233
233
|
virtual void computeDDAPts(NodeID) {}
|
|
234
234
|
|
|
235
235
|
/// Interface exposed to users of our pointer analysis, given Value infos
|
|
236
|
-
virtual AliasResult alias(const
|
|
237
|
-
const
|
|
236
|
+
virtual AliasResult alias(const SVFVar* V1,
|
|
237
|
+
const SVFVar* V2) = 0;
|
|
238
238
|
|
|
239
239
|
/// Interface exposed to users of our pointer analysis, given PAGNodeID
|
|
240
240
|
virtual AliasResult alias(NodeID node1, NodeID node2) = 0;
|
|
@@ -215,8 +215,11 @@ private:
|
|
|
215
215
|
|
|
216
216
|
public:
|
|
217
217
|
/// Interface expose to users of our pointer analysis, given Value infos
|
|
218
|
-
AliasResult alias(const
|
|
219
|
-
const
|
|
218
|
+
AliasResult alias(const SVFVar* V1,
|
|
219
|
+
const SVFVar* V2) override
|
|
220
|
+
{
|
|
221
|
+
return alias(V1->getId(), V2->getId());
|
|
222
|
+
}
|
|
220
223
|
|
|
221
224
|
/// Interface expose to users of our pointer analysis, given PAGNodeID
|
|
222
225
|
AliasResult alias(NodeID node1, NodeID node2) override;
|
|
@@ -501,9 +504,9 @@ public:
|
|
|
501
504
|
}
|
|
502
505
|
|
|
503
506
|
/// Interface expose to users of our pointer analysis, given Value infos
|
|
504
|
-
virtual inline AliasResult alias(const
|
|
507
|
+
virtual inline AliasResult alias(const SVFVar* V1, const SVFVar* V2)
|
|
505
508
|
{
|
|
506
|
-
return alias(
|
|
509
|
+
return alias(V1->getId(), V2->getId());
|
|
507
510
|
}
|
|
508
511
|
/// Interface expose to users of our pointer analysis, given two pointers
|
|
509
512
|
virtual inline AliasResult alias(NodeID node1, NodeID node2)
|
|
@@ -70,7 +70,7 @@ public:
|
|
|
70
70
|
typedef std::pair<NodeID, AccessPath> NodeAccessPath;
|
|
71
71
|
typedef Map<NodeOffset,NodeID> NodeOffsetMap;
|
|
72
72
|
typedef Map<NodeAccessPath,NodeID> NodeAccessPathMap;
|
|
73
|
-
typedef Map<
|
|
73
|
+
typedef Map<NodeID, NodeAccessPathMap> GepValueVarMap;
|
|
74
74
|
typedef std::pair<const SVFType*, std::vector<AccessPath>> SVFTypeLocSetsPair;
|
|
75
75
|
typedef Map<NodeID, SVFTypeLocSetsPair> TypeLocSetsMap;
|
|
76
76
|
typedef Map<NodePair,NodeID> NodePairSetMap;
|
|
@@ -343,7 +343,7 @@ public:
|
|
|
343
343
|
//@}
|
|
344
344
|
|
|
345
345
|
/// Due to constraint expression, curInst is used to distinguish different instructions (e.g., memorycpy) when creating GepValVar.
|
|
346
|
-
NodeID getGepValVar(
|
|
346
|
+
NodeID getGepValVar(NodeID curInst, NodeID base,
|
|
347
347
|
const AccessPath& ap) const;
|
|
348
348
|
|
|
349
349
|
/// Add/get indirect callsites
|
|
@@ -693,7 +693,7 @@ private:
|
|
|
693
693
|
}
|
|
694
694
|
|
|
695
695
|
/// Add a temp field value node, this method can only invoked by getGepValVar
|
|
696
|
-
NodeID addGepValNode(
|
|
696
|
+
NodeID addGepValNode(NodeID curInst, const ValVar* base, const AccessPath& ap, NodeID i, const SVFType* type, const ICFGNode* node);
|
|
697
697
|
/// Add a field obj node, this method can only invoked by getGepObjVar
|
|
698
698
|
NodeID addGepObjNode(const BaseObjVar* baseObj, const APOffset& apOffset, const NodeID gepId);
|
|
699
699
|
/// Add a field-insensitive node, this method can only invoked by getFIGepObjNode
|
|
@@ -443,7 +443,7 @@ class GepValVar: public ValVar
|
|
|
443
443
|
|
|
444
444
|
private:
|
|
445
445
|
AccessPath ap; // AccessPath
|
|
446
|
-
ValVar* base; // base node
|
|
446
|
+
const ValVar* base; // base node
|
|
447
447
|
const SVFType* gepValType;
|
|
448
448
|
|
|
449
449
|
/// Constructor to create empty GeValVar (for SVFIRReader/deserialization)
|
|
@@ -475,7 +475,7 @@ public:
|
|
|
475
475
|
//@}
|
|
476
476
|
|
|
477
477
|
/// Constructor
|
|
478
|
-
GepValVar(ValVar* baseNode, NodeID i, const AccessPath& ap,
|
|
478
|
+
GepValVar(const ValVar* baseNode, NodeID i, const AccessPath& ap,
|
|
479
479
|
const SVFType* ty, const ICFGNode* node);
|
|
480
480
|
|
|
481
481
|
/// offset of the base value variable
|
|
@@ -485,7 +485,7 @@ public:
|
|
|
485
485
|
}
|
|
486
486
|
|
|
487
487
|
/// Return the base object from which this GEP node came from.
|
|
488
|
-
inline ValVar* getBaseNode(void) const
|
|
488
|
+
inline const ValVar* getBaseNode(void) const
|
|
489
489
|
{
|
|
490
490
|
return base;
|
|
491
491
|
}
|
|
@@ -171,14 +171,6 @@ bool isIntrinsicInst(const SVFInstruction* inst);
|
|
|
171
171
|
bool isIntrinsicInst(const ICFGNode* inst);
|
|
172
172
|
//@}
|
|
173
173
|
|
|
174
|
-
/// Whether an instruction is a call or invoke instruction
|
|
175
|
-
inline bool isCallSite(const SVFValue* val)
|
|
176
|
-
{
|
|
177
|
-
if(SVFUtil::isa<SVFCallInst>(val))
|
|
178
|
-
return true;
|
|
179
|
-
else
|
|
180
|
-
return false;
|
|
181
|
-
}
|
|
182
174
|
|
|
183
175
|
bool isCallSite(const ICFGNode* inst);
|
|
184
176
|
|
|
@@ -342,14 +334,6 @@ inline bool isProgExitFunction (const SVFFunction * fun)
|
|
|
342
334
|
fun->getName() == "__assert_fail" );
|
|
343
335
|
}
|
|
344
336
|
|
|
345
|
-
/// Return true if this argument belongs to an uncalled function
|
|
346
|
-
inline bool isArgOfUncalledFunction(const SVFValue* svfval)
|
|
347
|
-
{
|
|
348
|
-
if(const SVFArgument* arg = SVFUtil::dyn_cast<SVFArgument>(svfval))
|
|
349
|
-
return arg->isArgOfUncalledFunction();
|
|
350
|
-
else
|
|
351
|
-
return false;
|
|
352
|
-
}
|
|
353
337
|
|
|
354
338
|
bool isArgOfUncalledFunction(const SVFVar* svfvar);
|
|
355
339
|
|
|
@@ -75,11 +75,7 @@ public:
|
|
|
75
75
|
/// Destructor
|
|
76
76
|
virtual ~WPAPass();
|
|
77
77
|
|
|
78
|
-
/// Interface expose to users of our pointer analysis, given Value infos
|
|
79
|
-
virtual AliasResult alias(const SVFValue* V1, const SVFValue* V2);
|
|
80
|
-
|
|
81
78
|
/// Retrieve points-to set information
|
|
82
|
-
virtual const PointsTo& getPts(const SVFValue* value);
|
|
83
79
|
virtual const PointsTo& getPts(NodeID var);
|
|
84
80
|
|
|
85
81
|
/// Print all alias pairs
|
|
@@ -94,9 +90,6 @@ public:
|
|
|
94
90
|
// return getModRefInfo(callInst, Loc.Ptr);
|
|
95
91
|
// }
|
|
96
92
|
|
|
97
|
-
/// Interface of mod-ref analysis to determine whether a CallSite instruction can mod or ref a specific memory location, given Value infos
|
|
98
|
-
virtual ModRefInfo getModRefInfo(const CallICFGNode* callInst, const SVFValue* V);
|
|
99
|
-
|
|
100
93
|
/// Interface of mod-ref analysis between two CallSite instructions
|
|
101
94
|
virtual ModRefInfo getModRefInfo(const CallICFGNode* callInst1, const CallICFGNode* callInst2);
|
|
102
95
|
|
|
Binary file
|
|
Binary file
|