svf-lib 1.0.1621 → 1.0.1622
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/AbstractExecution/ConsExeState.h +1 -1
- package/SVF-linux/svf/include/AbstractExecution/IntervalExeState.h +1 -1
- package/SVF-linux/svf/include/AbstractExecution/IntervalValue.h +1 -1
- package/SVF-linux/svf/include/AbstractExecution/SymState.h +1 -1
- package/SVF-linux/svf/include/CFL/CFGrammar.h +1 -1
- package/SVF-linux/svf/include/CFL/GrammarBuilder.h +3 -3
- package/SVF-linux/svf/include/FastCluster/fastcluster.h +4 -4
- package/SVF-linux/svf/include/Graphs/CHG.h +1 -1
- package/SVF-linux/svf/include/Graphs/ConsG.h +3 -3
- package/SVF-linux/svf/include/Graphs/GenericGraph.h +2 -2
- package/SVF-linux/svf/include/Graphs/GraphTraits.h +1 -1
- package/SVF-linux/svf/include/Graphs/GraphWriter.h +1 -1
- package/SVF-linux/svf/include/Graphs/IRGraph.h +1 -1
- package/SVF-linux/svf/include/Graphs/PTACallGraph.h +1 -1
- package/SVF-linux/svf/include/Graphs/VFGNode.h +2 -2
- package/SVF-linux/svf/include/MSSA/MSSAMuChi.h +2 -2
- package/SVF-linux/svf/include/MSSA/MemRegion.h +1 -1
- package/SVF-linux/svf/include/MSSA/MemSSA.h +1 -1
- package/SVF-linux/svf/include/MTA/FSMPTA.h +1 -1
- package/SVF-linux/svf/include/MTA/MHP.h +1 -1
- package/SVF-linux/svf/include/MTA/TCT.h +1 -1
- package/SVF-linux/svf/include/MemoryModel/ConditionalPT.h +1 -1
- package/SVF-linux/svf/include/MemoryModel/MutablePointsToDS.h +2 -2
- package/SVF-linux/svf/include/MemoryModel/PersistentPointsToDS.h +1 -1
- package/SVF-linux/svf/include/MemoryModel/PointerAnalysis.h +1 -1
- package/SVF-linux/svf/include/MemoryModel/PointsTo.h +1 -1
- package/SVF-linux/svf/include/SABER/SaberCondAllocator.h +1 -1
- package/SVF-linux/svf/include/SABER/SrcSnkDDA.h +1 -1
- package/SVF-linux/svf/include/SVFIR/SVFFileSystem.h +3 -3
- package/SVF-linux/svf/include/SVFIR/SVFIR.h +1 -1
- package/SVF-linux/svf/include/SVFIR/SVFStatements.h +19 -19
- package/SVF-linux/svf/include/SVFIR/SVFType.h +5 -5
- package/SVF-linux/svf/include/SVFIR/SVFValue.h +1 -1
- package/SVF-linux/svf/include/SVFIR/SVFVariables.h +3 -3
- package/SVF-linux/svf/include/SVFIR/SymbolTableInfo.h +3 -3
- package/SVF-linux/svf/include/Util/Casting.h +1 -1
- package/SVF-linux/svf/include/Util/CoreBitVector.h +2 -2
- package/SVF-linux/svf/include/Util/DPItem.h +1 -1
- package/SVF-linux/svf/include/Util/NodeIDAllocator.h +1 -1
- package/SVF-linux/svf/include/Util/Options.h +1 -1
- package/SVF-linux/svf/include/Util/SVFBugReport.h +1 -1
- package/SVF-linux/svf/include/Util/SVFUtil.h +4 -4
- package/SVF-linux/svf/include/Util/WorkList.h +1 -1
- package/SVF-linux/svf/include/Util/cJSON.h +1 -1
- package/SVF-linux/svf/include/WPA/Andersen.h +1 -1
- package/SVF-linux/svf/include/WPA/FlowSensitive.h +1 -1
- package/SVF-linux/svf/include/WPA/WPASolver.h +1 -1
- package/SVF-linux/svf-llvm/include/SVF-LLVM/GEPTypeBridgeIterator.h +1 -1
- package/SVF-linux/svf-llvm/include/SVF-LLVM/SymbolTableBuilder.h +1 -1
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
@@ -264,7 +264,7 @@ public:
|
|
|
264
264
|
return (s32_t) e.lb().getNumeral();
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
///TODO: Create new
|
|
267
|
+
///TODO: Create new interval value
|
|
268
268
|
IntervalValue createIntervalValue(double lb, double ub, NodeID id)
|
|
269
269
|
{
|
|
270
270
|
_varToItvVal[id] = IntervalValue(lb, ub);
|
|
@@ -48,7 +48,7 @@ public:
|
|
|
48
48
|
/// Default Value for Symbol is 0.
|
|
49
49
|
Symbol() : kind(0), attribute(0), variableAttribute(0) {}
|
|
50
50
|
|
|
51
|
-
///
|
|
51
|
+
/// Construct from u32_t move the bit to right field
|
|
52
52
|
Symbol(const u32_t& num) : kind(num & 0xFF), attribute((num >> 8 ) & 0xFFFF), variableAttribute((num >> 24)) {}
|
|
53
53
|
|
|
54
54
|
/// Conversion of u32_t
|
|
@@ -49,7 +49,7 @@ namespace SVF
|
|
|
49
49
|
*
|
|
50
50
|
* Production Format:
|
|
51
51
|
* <symbol> -> <symbol> *;
|
|
52
|
-
* LHS and RHS,
|
|
52
|
+
* LHS and RHS, Separate by '->', symbol separate by ' ', end by ';'
|
|
53
53
|
* support '*', '?', '(', ')'
|
|
54
54
|
*
|
|
55
55
|
* Input Format:
|
|
@@ -57,10 +57,10 @@ namespace SVF
|
|
|
57
57
|
* M // Specify Start Symbol in Second Line
|
|
58
58
|
* Terminal:
|
|
59
59
|
* Addr Copy Store Load Gep Vgep // Specify the order of terminal Addr->0, Copy->1 ..
|
|
60
|
-
* Productions: // Each Symbol
|
|
60
|
+
* Productions: // Each Symbol separate by 'Space', production end with ';'
|
|
61
61
|
* M -> V d; // Terminal in NonCapital
|
|
62
62
|
* M -> dbar V d; // NonTerminal in Capital
|
|
63
|
-
* V -> M abar M a M; // LHS and RHS,
|
|
63
|
+
* V -> M abar M a M; // LHS and RHS, Separate by '->'
|
|
64
64
|
* V -> ( M ? abar ) * M ? ( a M ? ) *; // Support '(' ')' '?' '*' four regular expression sign
|
|
65
65
|
* Gep_j -> Gep_i F vgep; // Support variable attribute with variable attribute
|
|
66
66
|
* Gep_1 -> Gep_2; // Support fix number attribute
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//
|
|
2
|
-
// C++ standalone
|
|
2
|
+
// C++ standalone version of fastcluster by Daniel Muellner
|
|
3
3
|
//
|
|
4
4
|
// Copyright: Daniel Muellner, 2011
|
|
5
5
|
// Christoph Dalitz, 2020
|
|
@@ -25,7 +25,7 @@ void cutree_k(int n, const int* merge, int nclust, int* labels);
|
|
|
25
25
|
|
|
26
26
|
//
|
|
27
27
|
// Assigns cluster labels (0, ..., nclust-1) to the n points such
|
|
28
|
-
// that the hierarchical
|
|
28
|
+
// that the hierarchical clustering is stopped at cluster distance cdist
|
|
29
29
|
//
|
|
30
30
|
// Input arguments:
|
|
31
31
|
// n = number of observables
|
|
@@ -53,7 +53,7 @@ void cutree_cdist(int n, const int* merge, double* height, double cdist, int* la
|
|
|
53
53
|
// Output arguments:
|
|
54
54
|
// merge = allocated (n-1)x2 matrix (2*(n-1) array) for storing result.
|
|
55
55
|
// Result follows R hclust convention:
|
|
56
|
-
// -
|
|
56
|
+
// - observable indices start with one
|
|
57
57
|
// - merge[i][] contains the merged nodes in step i
|
|
58
58
|
// - merge[i][j] is negative when the node is an atom
|
|
59
59
|
// height = allocated (n-1) array with distances at each merge step
|
|
@@ -68,7 +68,7 @@ enum hclust_fast_methods
|
|
|
68
68
|
HCLUST_METHOD_SINGLE = 0,
|
|
69
69
|
// complete link with the nearest-neighbor-chain algorithm (Murtagh, 1984)
|
|
70
70
|
HCLUST_METHOD_COMPLETE = 1,
|
|
71
|
-
//
|
|
71
|
+
// complete link with the nearest-neighbor-chain algorithm (Murtagh, 1984)
|
|
72
72
|
HCLUST_METHOD_AVERAGE = 2,
|
|
73
73
|
// median link with the generic algorithm (Müllner, 2011)
|
|
74
74
|
HCLUST_METHOD_MEDIAN = 3,
|
|
@@ -72,7 +72,7 @@ protected:
|
|
|
72
72
|
return pag->getPTASVFStmtSet(kind);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
///
|
|
75
|
+
/// Wrappers used internally, not expose to Andersen Pass
|
|
76
76
|
//@{
|
|
77
77
|
inline NodeID getValueNode(const SVFValue* value) const
|
|
78
78
|
{
|
|
@@ -214,9 +214,9 @@ public:
|
|
|
214
214
|
|
|
215
215
|
/// Used for cycle elimination
|
|
216
216
|
//@{
|
|
217
|
-
/// Remove edge from old dst target, change edge dst id and add
|
|
217
|
+
/// Remove edge from old dst target, change edge dst id and add modified edge into new dst
|
|
218
218
|
void reTargetDstOfEdge(ConstraintEdge* edge, ConstraintNode* newDstNode);
|
|
219
|
-
/// Remove edge from old src target, change edge dst id and add
|
|
219
|
+
/// Remove edge from old src target, change edge dst id and add modified edge into new src
|
|
220
220
|
void reTargetSrcOfEdge(ConstraintEdge* edge, ConstraintNode* newSrcNode);
|
|
221
221
|
/// Remove addr edge from their src and dst edge sets
|
|
222
222
|
void removeAddrEdge(AddrCGEdge* edge);
|
|
@@ -248,7 +248,7 @@ public:
|
|
|
248
248
|
}
|
|
249
249
|
//@}
|
|
250
250
|
|
|
251
|
-
/// Iterators used for SCC detection, overwrite it in child class if
|
|
251
|
+
/// Iterators used for SCC detection, overwrite it in child class if necessary
|
|
252
252
|
//@{
|
|
253
253
|
virtual inline iterator directOutEdgeBegin()
|
|
254
254
|
{
|
|
@@ -460,7 +460,7 @@ public:
|
|
|
460
460
|
|
|
461
461
|
/* !
|
|
462
462
|
* GenericGraphTraits specializations for generic graph algorithms.
|
|
463
|
-
* Provide graph traits for
|
|
463
|
+
* Provide graph traits for traversing from a node using standard graph traversals.
|
|
464
464
|
*/
|
|
465
465
|
namespace SVF
|
|
466
466
|
{
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
//===----------------------------------------------------------------------===//
|
|
8
8
|
//
|
|
9
9
|
// This file defines the little GenericGraphTraits<X> template class that should be
|
|
10
|
-
// specialized by classes that want to be
|
|
10
|
+
// specialized by classes that want to be iterable by generic graph iterators.
|
|
11
11
|
//
|
|
12
12
|
// This file also defines the marker class Inverse that is used to iterate over
|
|
13
13
|
// graphs in a graph defined, inverse ordering...
|
|
@@ -301,7 +301,7 @@ public:
|
|
|
301
301
|
const void *DestNodeID, int DestNodePort,
|
|
302
302
|
const std::string &Attrs)
|
|
303
303
|
{
|
|
304
|
-
if (SrcNodePort > 64) return; //
|
|
304
|
+
if (SrcNodePort > 64) return; // Emanating from truncated part?
|
|
305
305
|
if (DestNodePort > 64) DestNodePort = 64; // Targeting the truncated part?
|
|
306
306
|
|
|
307
307
|
O << "\tNode" << SrcNodeID;
|
|
@@ -233,7 +233,7 @@ namespace SVF
|
|
|
233
233
|
|
|
234
234
|
/* !
|
|
235
235
|
* GenericGraphTraits specializations of SVFIR to be used for the generic graph algorithms.
|
|
236
|
-
* Provide graph traits for
|
|
236
|
+
* Provide graph traits for traversing from a SVFIR node using standard graph traversals.
|
|
237
237
|
*/
|
|
238
238
|
template<> struct GenericGraphTraits<SVF::SVFVar*> : public GenericGraphTraits<SVF::GenericNode<SVF::SVFVar,SVF::SVFStmt>* >
|
|
239
239
|
{
|
|
@@ -373,7 +373,7 @@ public:
|
|
|
373
373
|
return getCallSitePair(id).second;
|
|
374
374
|
}
|
|
375
375
|
//@}
|
|
376
|
-
/// Whether we have
|
|
376
|
+
/// Whether we have already created this call graph edge
|
|
377
377
|
PTACallGraphEdge* hasGraphEdge(PTACallGraphNode* src, PTACallGraphNode* dst,PTACallGraphEdge::CEDGEK kind, CallSiteID csId) const;
|
|
378
378
|
/// Get call graph edge via nodes
|
|
379
379
|
PTACallGraphEdge* getGraphEdge(PTACallGraphNode* src, PTACallGraphNode* dst,PTACallGraphEdge::CEDGEK kind, CallSiteID csId);
|
|
@@ -841,7 +841,7 @@ public:
|
|
|
841
841
|
};
|
|
842
842
|
|
|
843
843
|
/*
|
|
844
|
-
* ICFG Node stands for
|
|
844
|
+
* ICFG Node stands for actual parameter node (top level pointers)
|
|
845
845
|
*/
|
|
846
846
|
class ActualParmVFGNode : public ArgumentVFGNode
|
|
847
847
|
{
|
|
@@ -962,7 +962,7 @@ public:
|
|
|
962
962
|
};
|
|
963
963
|
|
|
964
964
|
/*!
|
|
965
|
-
* Callsite receive
|
|
965
|
+
* Callsite receive parameter
|
|
966
966
|
*/
|
|
967
967
|
class ActualRetVFGNode: public ArgumentVFGNode
|
|
968
968
|
{
|
|
@@ -341,7 +341,7 @@ protected:
|
|
|
341
341
|
MRVer* resVer;
|
|
342
342
|
|
|
343
343
|
public:
|
|
344
|
-
/// Constructor/
|
|
344
|
+
/// Constructor/Destructor for MSSADEF
|
|
345
345
|
//@{
|
|
346
346
|
MSSADEF(DEFTYPE t, const MemRegion* m): type(t), mr(m), resVer(nullptr)
|
|
347
347
|
{
|
|
@@ -401,7 +401,7 @@ private:
|
|
|
401
401
|
Cond cond;
|
|
402
402
|
public:
|
|
403
403
|
typedef typename MSSADEF::DEFTYPE CHITYPE;
|
|
404
|
-
/// Constructor/
|
|
404
|
+
/// Constructor/Destructor for MSSACHI
|
|
405
405
|
//@{
|
|
406
406
|
MSSACHI(CHITYPE t, const MemRegion* m, Cond c): MSSADEF(t,m), opVer(nullptr), cond(c)
|
|
407
407
|
{
|
|
@@ -107,7 +107,7 @@ public:
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/// add the hash function here to sort elements and remove
|
|
110
|
-
/// and remove duplicated element in the set (binary tree
|
|
110
|
+
/// and remove duplicated element in the set (binary tree comparison)
|
|
111
111
|
//@{
|
|
112
112
|
typedef struct equalMemRegion
|
|
113
113
|
{
|
|
@@ -124,7 +124,7 @@ protected:
|
|
|
124
124
|
|
|
125
125
|
/// Create mu chi for candidate regions in a function
|
|
126
126
|
virtual void createMUCHI(const SVFFunction& fun);
|
|
127
|
-
/// Insert phi for candidate regions in a
|
|
127
|
+
/// Insert phi for candidate regions in a function
|
|
128
128
|
virtual void insertPHI(const SVFFunction& fun);
|
|
129
129
|
/// SSA rename for a function
|
|
130
130
|
virtual void SSARename(const SVFFunction& fun);
|
|
@@ -223,7 +223,7 @@ public:
|
|
|
223
223
|
return mhp->getTCT()->getPTA()->getPAG();
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
/// Create
|
|
226
|
+
/// Create single instance of flow-sensitive pointer analysis
|
|
227
227
|
static FSMPTA* createFSMPTA(SVFModule* module, MHP* m, LockAnalysis* la)
|
|
228
228
|
{
|
|
229
229
|
if (mfspta == nullptr)
|
|
@@ -207,7 +207,7 @@ private:
|
|
|
207
207
|
void updateSiblingThreads(NodeID tid);
|
|
208
208
|
//@}
|
|
209
209
|
|
|
210
|
-
/// Thread curTid can be fully joined by parentTid
|
|
210
|
+
/// Thread curTid can be fully joined by parentTid recursively
|
|
211
211
|
bool isRecurFullJoin(NodeID parentTid, NodeID curTid);
|
|
212
212
|
|
|
213
213
|
/// Whether a join site must join a thread t
|
|
@@ -193,7 +193,7 @@ public:
|
|
|
193
193
|
{
|
|
194
194
|
return getGNode(id);
|
|
195
195
|
}
|
|
196
|
-
/// Whether we have
|
|
196
|
+
/// Whether we have already created this call graph edge
|
|
197
197
|
TCTEdge* hasGraphEdge(TCTNode* src, TCTNode* dst, TCTEdge::CEDGEK kind) const;
|
|
198
198
|
/// Get call graph edge via nodes
|
|
199
199
|
TCTEdge* getGraphEdge(TCTNode* src, TCTNode* dst, TCTEdge::CEDGEK kind);
|
|
@@ -848,7 +848,7 @@ private:
|
|
|
848
848
|
return it->second.test(var);
|
|
849
849
|
return false;
|
|
850
850
|
}
|
|
851
|
-
/// Get all var which have new pts
|
|
851
|
+
/// Get all var which have new pts information in loc's IN set
|
|
852
852
|
inline const DataSet& getDFInUpdatedVar(LocID loc)
|
|
853
853
|
{
|
|
854
854
|
return inUpdatedVarMap[loc];
|
|
@@ -877,7 +877,7 @@ private:
|
|
|
877
877
|
return it->second.test(var);
|
|
878
878
|
return false;
|
|
879
879
|
}
|
|
880
|
-
/// Get all var which have new pts
|
|
880
|
+
/// Get all var which have new pts information in loc's OUT set
|
|
881
881
|
inline const DataSet& getDFOutUpdatedVar(LocID loc)
|
|
882
882
|
{
|
|
883
883
|
return outUpdatedVarMap[loc];
|
|
@@ -754,7 +754,7 @@ private:
|
|
|
754
754
|
return false;
|
|
755
755
|
}
|
|
756
756
|
|
|
757
|
-
/// Get all variables which have new pts
|
|
757
|
+
/// Get all variables which have new pts information in loc's IN set
|
|
758
758
|
inline const KeySet& getDFInUpdatedVar(LocID loc)
|
|
759
759
|
{
|
|
760
760
|
return inUpdatedVarMap[loc];
|
|
@@ -76,7 +76,7 @@ public:
|
|
|
76
76
|
VFS_WPA, ///< Versioned sparse flow-sensitive WPA
|
|
77
77
|
FSCS_WPA, ///< Flow-, context- sensitive WPA
|
|
78
78
|
CFLFICI_WPA, ///< Flow-, context-, insensitive CFL-reachability-based analysis
|
|
79
|
-
CFLFSCI_WPA, ///< Flow-insensitive, context-sensitive
|
|
79
|
+
CFLFSCI_WPA, ///< Flow-insensitive, context-sensitive CFL-reachability-based analysis
|
|
80
80
|
CFLFSCS_WPA, ///< Flow-, context-, CFL-reachability-based analysis
|
|
81
81
|
TypeCPP_WPA, ///< Type-based analysis for C++
|
|
82
82
|
|
|
@@ -112,7 +112,7 @@ public:
|
|
|
112
112
|
/// Returns true if this set changed.
|
|
113
113
|
bool intersectWithComplement(const PointsTo &rhs);
|
|
114
114
|
|
|
115
|
-
/// Put intersection of lhs with
|
|
115
|
+
/// Put intersection of lhs with complement of rhs into this set (overwrites).
|
|
116
116
|
void intersectWithComplement(const PointsTo &lhs, const PointsTo &rhs);
|
|
117
117
|
|
|
118
118
|
/// Returns this points-to set as a NodeBS.
|
|
@@ -255,7 +255,7 @@ private:
|
|
|
255
255
|
//@}
|
|
256
256
|
/// Evaluate branch conditions
|
|
257
257
|
//@{
|
|
258
|
-
/// Evaluate the branch
|
|
258
|
+
/// Evaluate the branch condition
|
|
259
259
|
Condition evaluateBranchCond(const SVFBasicBlock* bb, const SVFBasicBlock* succ) ;
|
|
260
260
|
/// Evaluate loop exit branch
|
|
261
261
|
Condition evaluateLoopExitBranch(const SVFBasicBlock* bb, const SVFBasicBlock* succ);
|
|
@@ -586,7 +586,7 @@ private:
|
|
|
586
586
|
}
|
|
587
587
|
|
|
588
588
|
/** The following 2 functions are intended to convert SparseBitVectors
|
|
589
|
-
* to JSON. But they're buggy.
|
|
589
|
+
* to JSON. But they're buggy. Commenting them out would enable the
|
|
590
590
|
* toJson(T) where is_iterable_v<T> is true. But that implementation is less
|
|
591
591
|
* space-efficient if the bitvector contains many elements.
|
|
592
592
|
* It is observed that upon construction, SVF IR bitvectors contain at most
|
|
@@ -1147,7 +1147,7 @@ private:
|
|
|
1147
1147
|
if (!basePtr)
|
|
1148
1148
|
return; // ptr is nullptr when read
|
|
1149
1149
|
ptr = SVFUtil::dyn_cast<T>(basePtr);
|
|
1150
|
-
ABORT_IFNOT(ptr, "Cast: " << obj->string << "
|
|
1150
|
+
ABORT_IFNOT(ptr, "Cast: " << obj->string << " shouldn't have kind "
|
|
1151
1151
|
<< KindBaseHelper<T>::getKind(ptr));
|
|
1152
1152
|
}
|
|
1153
1153
|
|
|
@@ -1201,7 +1201,7 @@ private:
|
|
|
1201
1201
|
std::enable_if_t<SVFUtil::is_map_v<C>> readJson(const cJSON* obj, C& map)
|
|
1202
1202
|
{
|
|
1203
1203
|
assert(map.empty() && "map should be empty");
|
|
1204
|
-
ABORT_IFNOT(jsonIsMap(obj), "expects an map (
|
|
1204
|
+
ABORT_IFNOT(jsonIsMap(obj), "expects an map (represented by array)");
|
|
1205
1205
|
jsonForEach(elemJson, obj)
|
|
1206
1206
|
{
|
|
1207
1207
|
auto jpair = jsonUnpackPair(elemJson);
|
|
@@ -327,7 +327,7 @@ public:
|
|
|
327
327
|
}
|
|
328
328
|
//@}
|
|
329
329
|
|
|
330
|
-
/// Due to
|
|
330
|
+
/// Due to constraint expression, curInst is used to distinguish different instructions (e.g., memorycpy) when creating GepValVar.
|
|
331
331
|
NodeID getGepValVar(const SVFValue* curInst, NodeID base,
|
|
332
332
|
const AccessPath& ap) const;
|
|
333
333
|
|
|
@@ -232,7 +232,7 @@ private:
|
|
|
232
232
|
/*
|
|
233
233
|
Parent class of Addr, Copy, Store, Load, Call, Ret, NormalGep, VariantGep, ThreadFork, ThreadJoin
|
|
234
234
|
connecting RHS expression and LHS expression with an assignment (e.g., LHSExpr = RHSExpr)
|
|
235
|
-
Only one operand on the right
|
|
235
|
+
Only one operand on the right hand side of an assignment
|
|
236
236
|
*/
|
|
237
237
|
class AssignStmt : public SVFStmt
|
|
238
238
|
{
|
|
@@ -251,7 +251,7 @@ private:
|
|
|
251
251
|
protected:
|
|
252
252
|
/// constructor
|
|
253
253
|
AssignStmt(SVFVar* s, SVFVar* d, GEdgeFlag k) : SVFStmt(s, d, k) {}
|
|
254
|
-
/// Constructor to create empty AssignStmt (for SVFIRReader/
|
|
254
|
+
/// Constructor to create empty AssignStmt (for SVFIRReader/serialization)
|
|
255
255
|
AssignStmt(GEdgeFlag k) : SVFStmt(k) {}
|
|
256
256
|
|
|
257
257
|
public:
|
|
@@ -316,7 +316,7 @@ class AddrStmt: public AssignStmt
|
|
|
316
316
|
friend class SVFIRReader;
|
|
317
317
|
|
|
318
318
|
private:
|
|
319
|
-
/// Constructs empty AddrStmt (for SVFIRReader/
|
|
319
|
+
/// Constructs empty AddrStmt (for SVFIRReader/serialization)
|
|
320
320
|
AddrStmt() : AssignStmt(SVFStmt::Addr) {}
|
|
321
321
|
AddrStmt(const AddrStmt&); ///< place holder
|
|
322
322
|
void operator=(const AddrStmt&); ///< place holder
|
|
@@ -353,7 +353,7 @@ class CopyStmt: public AssignStmt
|
|
|
353
353
|
friend class SVFIRReader;
|
|
354
354
|
|
|
355
355
|
private:
|
|
356
|
-
/// Constructs empty CopyStmt (for SVFIRReader/
|
|
356
|
+
/// Constructs empty CopyStmt (for SVFIRReader/serialization)
|
|
357
357
|
CopyStmt() : AssignStmt(SVFStmt::Copy) {}
|
|
358
358
|
CopyStmt(const CopyStmt&); ///< place holder
|
|
359
359
|
void operator=(const CopyStmt&); ///< place holder
|
|
@@ -389,7 +389,7 @@ class StoreStmt: public AssignStmt
|
|
|
389
389
|
friend class SVFIRReader;
|
|
390
390
|
|
|
391
391
|
private:
|
|
392
|
-
/// Constructs empty StoreStmt (for SVFIRReader/
|
|
392
|
+
/// Constructs empty StoreStmt (for SVFIRReader/serialization)
|
|
393
393
|
StoreStmt() : AssignStmt(SVFStmt::Store) {}
|
|
394
394
|
StoreStmt(const StoreStmt&); ///< place holder
|
|
395
395
|
void operator=(const StoreStmt&); ///< place holder
|
|
@@ -426,7 +426,7 @@ class LoadStmt: public AssignStmt
|
|
|
426
426
|
friend class SVFIRReader;
|
|
427
427
|
|
|
428
428
|
private:
|
|
429
|
-
/// Constructs empty LoadStmt (for SVFIRReader/
|
|
429
|
+
/// Constructs empty LoadStmt (for SVFIRReader/serialization)
|
|
430
430
|
LoadStmt(): AssignStmt(SVFStmt::Load) {}
|
|
431
431
|
LoadStmt(const LoadStmt&); ///< place holder
|
|
432
432
|
void operator=(const LoadStmt&); ///< place holder
|
|
@@ -463,7 +463,7 @@ class GepStmt: public AssignStmt
|
|
|
463
463
|
friend class SVFIRReader;
|
|
464
464
|
|
|
465
465
|
private:
|
|
466
|
-
/// Constructs empty GepStmt (for SVFIRReader/
|
|
466
|
+
/// Constructs empty GepStmt (for SVFIRReader/serialization)
|
|
467
467
|
GepStmt() : AssignStmt(SVFStmt::Gep) {}
|
|
468
468
|
GepStmt(const GepStmt &); ///< place holder
|
|
469
469
|
void operator=(const GepStmt &); ///< place holder
|
|
@@ -543,7 +543,7 @@ private:
|
|
|
543
543
|
const CallICFGNode* call; /// the callsite statement calling from
|
|
544
544
|
const FunEntryICFGNode* entry; /// the function exit statement calling to
|
|
545
545
|
protected:
|
|
546
|
-
/// Constructs empty CallPE (for SVFIRReader/
|
|
546
|
+
/// Constructs empty CallPE (for SVFIRReader/serialization)
|
|
547
547
|
CallPE(GEdgeFlag k = SVFStmt::Call) : AssignStmt(k), call{}, entry{} {}
|
|
548
548
|
|
|
549
549
|
public:
|
|
@@ -604,7 +604,7 @@ private:
|
|
|
604
604
|
const FunExitICFGNode* exit; /// the function exit statement returned from
|
|
605
605
|
|
|
606
606
|
protected:
|
|
607
|
-
/// Constructs empty RetPE (for SVFIRReader/
|
|
607
|
+
/// Constructs empty RetPE (for SVFIRReader/serialization)
|
|
608
608
|
RetPE(GEdgeFlag k = SVFStmt::Ret) : AssignStmt(k), call{}, exit{} {}
|
|
609
609
|
|
|
610
610
|
public:
|
|
@@ -671,9 +671,9 @@ private:
|
|
|
671
671
|
|
|
672
672
|
protected:
|
|
673
673
|
OPVars opVars;
|
|
674
|
-
/// Constructor, only used by
|
|
674
|
+
/// Constructor, only used by subclasses but not external users
|
|
675
675
|
MultiOpndStmt(SVFVar* r, const OPVars& opnds, GEdgeFlag k);
|
|
676
|
-
/// Constructs empty MultiOpndStmt (for SVFIRReader/
|
|
676
|
+
/// Constructs empty MultiOpndStmt (for SVFIRReader/serialization)
|
|
677
677
|
MultiOpndStmt(GEdgeFlag k) : SVFStmt(k) {}
|
|
678
678
|
|
|
679
679
|
public:
|
|
@@ -743,7 +743,7 @@ public:
|
|
|
743
743
|
typedef std::vector<const ICFGNode*> OpICFGNodeVec;
|
|
744
744
|
|
|
745
745
|
private:
|
|
746
|
-
/// Constructs empty PhiStmt (for SVFIRReader/
|
|
746
|
+
/// Constructs empty PhiStmt (for SVFIRReader/serialization)
|
|
747
747
|
PhiStmt() : MultiOpndStmt(SVFStmt::Phi) {}
|
|
748
748
|
PhiStmt(const PhiStmt&); ///< place holder
|
|
749
749
|
void operator=(const PhiStmt&); ///< place holder
|
|
@@ -808,7 +808,7 @@ class SelectStmt: public MultiOpndStmt
|
|
|
808
808
|
friend class SVFIRReader;
|
|
809
809
|
|
|
810
810
|
private:
|
|
811
|
-
/// Constructs empty SelectStmt (for SVFIRReader/
|
|
811
|
+
/// Constructs empty SelectStmt (for SVFIRReader/serialization)
|
|
812
812
|
SelectStmt() : MultiOpndStmt(SVFStmt::Select), condition{} {}
|
|
813
813
|
SelectStmt(const SelectStmt&); ///< place holder
|
|
814
814
|
void operator=(const SelectStmt&); ///< place holder
|
|
@@ -863,7 +863,7 @@ class CmpStmt: public MultiOpndStmt
|
|
|
863
863
|
friend class SVFIRReader;
|
|
864
864
|
|
|
865
865
|
private:
|
|
866
|
-
/// Constructs empty CmpStmt (for SVFIRReader/
|
|
866
|
+
/// Constructs empty CmpStmt (for SVFIRReader/serialization)
|
|
867
867
|
CmpStmt() : MultiOpndStmt(SVFStmt::Cmp) {}
|
|
868
868
|
CmpStmt(const CmpStmt&); ///< place holder
|
|
869
869
|
void operator=(const CmpStmt&); ///< place holder
|
|
@@ -949,7 +949,7 @@ class BinaryOPStmt: public MultiOpndStmt
|
|
|
949
949
|
friend class SVFIRReader;
|
|
950
950
|
|
|
951
951
|
private:
|
|
952
|
-
/// Constructs empty BinaryOPStmt (for SVFIRReader/
|
|
952
|
+
/// Constructs empty BinaryOPStmt (for SVFIRReader/serialization)
|
|
953
953
|
BinaryOPStmt() : MultiOpndStmt(SVFStmt::BinaryOp) {}
|
|
954
954
|
BinaryOPStmt(const BinaryOPStmt&); ///< place holder
|
|
955
955
|
void operator=(const BinaryOPStmt&); ///< place holder
|
|
@@ -1019,7 +1019,7 @@ class UnaryOPStmt: public SVFStmt
|
|
|
1019
1019
|
friend class SVFIRReader;
|
|
1020
1020
|
|
|
1021
1021
|
private:
|
|
1022
|
-
/// Constructs empty UnaryOPStmt (for SVFIRReader/
|
|
1022
|
+
/// Constructs empty UnaryOPStmt (for SVFIRReader/serialization)
|
|
1023
1023
|
UnaryOPStmt() : SVFStmt(SVFStmt::UnaryOp) {}
|
|
1024
1024
|
UnaryOPStmt(const UnaryOPStmt&); ///< place holder
|
|
1025
1025
|
void operator=(const UnaryOPStmt&); ///< place holder
|
|
@@ -1089,7 +1089,7 @@ public:
|
|
|
1089
1089
|
typedef std::vector<std::pair<const ICFGNode*, s32_t>> SuccAndCondPairVec;
|
|
1090
1090
|
|
|
1091
1091
|
private:
|
|
1092
|
-
/// Constructs empty BranchStmt (for SVFIRReader/
|
|
1092
|
+
/// Constructs empty BranchStmt (for SVFIRReader/serialization)
|
|
1093
1093
|
BranchStmt() : SVFStmt(SVFStmt::Branch), cond{}, brInst{} {}
|
|
1094
1094
|
BranchStmt(const BranchStmt&); ///< place holder
|
|
1095
1095
|
void operator=(const BranchStmt&); ///< place holder
|
|
@@ -1176,7 +1176,7 @@ class TDForkPE: public CallPE
|
|
|
1176
1176
|
friend class SVFIRReader;
|
|
1177
1177
|
|
|
1178
1178
|
private:
|
|
1179
|
-
/// Constructs empty TDForkPE (for SVFIRReader/
|
|
1179
|
+
/// Constructs empty TDForkPE (for SVFIRReader/serialization)
|
|
1180
1180
|
TDForkPE() : CallPE(SVFStmt::ThreadFork) {}
|
|
1181
1181
|
TDForkPE(const TDForkPE&); ///< place holder
|
|
1182
1182
|
void operator=(const TDForkPE&); ///< place holder
|
|
@@ -1217,7 +1217,7 @@ class TDJoinPE: public RetPE
|
|
|
1217
1217
|
friend class SVFIRReader;
|
|
1218
1218
|
|
|
1219
1219
|
private:
|
|
1220
|
-
/// Constructs empty TDJoinPE (for SVFIRReader/
|
|
1220
|
+
/// Constructs empty TDJoinPE (for SVFIRReader/serialization)
|
|
1221
1221
|
TDJoinPE() : RetPE(SVFStmt::ThreadJoin) {}
|
|
1222
1222
|
TDJoinPE(const TDJoinPE&); ///< place holder
|
|
1223
1223
|
void operator=(const TDJoinPE&); ///< place holder
|
|
@@ -147,9 +147,9 @@ private:
|
|
|
147
147
|
/// stride represents the number of repetitive elements if this StInfo
|
|
148
148
|
/// represent an ArrayType. stride is 1 by default.
|
|
149
149
|
u32_t stride;
|
|
150
|
-
/// number of elements after
|
|
150
|
+
/// number of elements after flattening (including array elements)
|
|
151
151
|
u32_t numOfFlattenElements;
|
|
152
|
-
/// number of fields after
|
|
152
|
+
/// number of fields after flattening (ignoring array elements)
|
|
153
153
|
u32_t numOfFlattenFields;
|
|
154
154
|
/// Type vector of fields
|
|
155
155
|
std::vector<const SVFType*> flattenElementTypes;
|
|
@@ -214,20 +214,20 @@ public:
|
|
|
214
214
|
/// Add field index and element index and their corresponding type
|
|
215
215
|
void addFldWithType(u32_t fldIdx, const SVFType* type, u32_t elemIdx);
|
|
216
216
|
|
|
217
|
-
/// Set number of fields and elements of an
|
|
217
|
+
/// Set number of fields and elements of an aggregate
|
|
218
218
|
inline void setNumOfFieldsAndElems(u32_t nf, u32_t ne)
|
|
219
219
|
{
|
|
220
220
|
numOfFlattenFields = nf;
|
|
221
221
|
numOfFlattenElements = ne;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
/// Return number of elements after
|
|
224
|
+
/// Return number of elements after flattening (including array elements)
|
|
225
225
|
inline u32_t getNumOfFlattenElements() const
|
|
226
226
|
{
|
|
227
227
|
return numOfFlattenElements;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
/// Return the number of fields after
|
|
230
|
+
/// Return the number of fields after flattening (ignoring array elements)
|
|
231
231
|
inline u32_t getNumOfFlattenFields() const
|
|
232
232
|
{
|
|
233
233
|
return numOfFlattenFields;
|
|
@@ -946,7 +946,7 @@ public:
|
|
|
946
946
|
{
|
|
947
947
|
return zval;
|
|
948
948
|
}
|
|
949
|
-
// Return the constant as a 64-bit integer value after it has been sign extended as appropriate for the type of this
|
|
949
|
+
// Return the constant as a 64-bit integer value after it has been sign extended as appropriate for the type of this constant
|
|
950
950
|
inline s64_t getSExtValue () const
|
|
951
951
|
{
|
|
952
952
|
return sval;
|
|
@@ -56,8 +56,8 @@ public:
|
|
|
56
56
|
/// ObjNode: memory object
|
|
57
57
|
/// RetNode: unique return node
|
|
58
58
|
/// Vararg: unique node for vararg parameter
|
|
59
|
-
/// GepValNode:
|
|
60
|
-
/// GepValNode:
|
|
59
|
+
/// GepValNode: temporary gep value node for field sensitivity
|
|
60
|
+
/// GepValNode: temporary gep obj node for field sensitivity
|
|
61
61
|
/// FIObjNode: for field insensitive analysis
|
|
62
62
|
/// DummyValNode and DummyObjNode: for non-llvm-value node
|
|
63
63
|
enum PNODEK
|
|
@@ -122,7 +122,7 @@ public:
|
|
|
122
122
|
/// or llvm's metadata, i.e., metadata !4087
|
|
123
123
|
bool isConstDataOrAggDataButNotNullPtr() const;
|
|
124
124
|
|
|
125
|
-
/// Whether this is an
|
|
125
|
+
/// Whether this is an isolated node on the SVFIR graph
|
|
126
126
|
bool isIsolatedNode() const;
|
|
127
127
|
|
|
128
128
|
/// Get name of the LLVM value
|
|
@@ -200,7 +200,7 @@ public:
|
|
|
200
200
|
return BlackHole;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
/// Can only be invoked by SVFIR::addDummyNode() when
|
|
203
|
+
/// Can only be invoked by SVFIR::addDummyNode() when creating SVFIR from file.
|
|
204
204
|
const MemObj* createDummyObj(SymID symId, const SVFType* type);
|
|
205
205
|
// @}
|
|
206
206
|
|
|
@@ -312,9 +312,9 @@ public:
|
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
///Get a reference to the components of struct_info.
|
|
315
|
-
/// Number of
|
|
315
|
+
/// Number of flattened elements of an array or struct
|
|
316
316
|
u32_t getNumOfFlattenElements(const SVFType* T);
|
|
317
|
-
///
|
|
317
|
+
/// Flattened element idx of an array or struct by considering stride
|
|
318
318
|
u32_t getFlattenedElemIdx(const SVFType* T, u32_t origId);
|
|
319
319
|
/// Return the type of a flattened element given a flattened index
|
|
320
320
|
const SVFType* getFlatternedElemType(const SVFType* baseType, u32_t flatten_idx);
|
|
@@ -62,7 +62,7 @@ namespace SVF
|
|
|
62
62
|
namespace SVFUtil
|
|
63
63
|
{
|
|
64
64
|
|
|
65
|
-
//===- Part of llvm/Support/type_traits.h -
|
|
65
|
+
//===- Part of llvm/Support/type_traits.h - Simplified type traits -------*- C++ -*-===//
|
|
66
66
|
|
|
67
67
|
/// If T is a pointer to X, return a pointer to const X. If it is not,
|
|
68
68
|
/// return const T.
|
|
@@ -102,11 +102,11 @@ public:
|
|
|
102
102
|
/// Returns true if CBV changed.
|
|
103
103
|
bool operator-=(const CoreBitVector &rhs);
|
|
104
104
|
|
|
105
|
-
/// Put intersection of this CBV with
|
|
105
|
+
/// Put intersection of this CBV with complement of rhs into this CBV.
|
|
106
106
|
/// Returns true if this CBV changed.
|
|
107
107
|
bool intersectWithComplement(const CoreBitVector &rhs);
|
|
108
108
|
|
|
109
|
-
/// Put intersection of lhs with
|
|
109
|
+
/// Put intersection of lhs with complement of rhs into this CBV.
|
|
110
110
|
void intersectWithComplement(const CoreBitVector &lhs, const CoreBitVector &rhs);
|
|
111
111
|
|
|
112
112
|
/// Hash for this CBV.
|
|
@@ -37,7 +37,7 @@ namespace SVF
|
|
|
37
37
|
{
|
|
38
38
|
|
|
39
39
|
/*!
|
|
40
|
-
* Dynamic programming item for CFL
|
|
40
|
+
* Dynamic programming item for CFL reachability search
|
|
41
41
|
* This serves as a base class for CFL-reachability formulation by matching parentheses.
|
|
42
42
|
* Extend this class for further sophisticated CFL-reachability items (e.g. field, flow, path)
|
|
43
43
|
*/
|
|
@@ -184,7 +184,7 @@ public:
|
|
|
184
184
|
/// x in pt(p) and y in pt(p) -> x is reachable from y.
|
|
185
185
|
static inline std::vector<unsigned> regionObjects(const Map<NodeID, Set<NodeID>> &graph, size_t numObjects, size_t &numLabels);
|
|
186
186
|
|
|
187
|
-
// From all the candidates, returns the best mapping for pointsToSets (points-to set -> #
|
|
187
|
+
// From all the candidates, returns the best mapping for pointsToSets (points-to set -> # occurrences).
|
|
188
188
|
static inline std::pair<hclust_fast_methods, std::vector<NodeID>> determineBestMapping(
|
|
189
189
|
const std::vector<std::pair<hclust_fast_methods, std::vector<NodeID>>> &candidates,
|
|
190
190
|
Map<PointsTo, unsigned> pointsToSets, const std::string &evalSubtitle, double &evalTime);
|
|
@@ -61,7 +61,7 @@ public:
|
|
|
61
61
|
/// Align identifiers in each region to a word.
|
|
62
62
|
static const Option<bool> RegionAlign;
|
|
63
63
|
|
|
64
|
-
/// Predict
|
|
64
|
+
/// Predict occurrences of points-to sets in the staged points-to set to
|
|
65
65
|
/// weigh more common points-to sets as more important.
|
|
66
66
|
static const Option<bool> PredictPtOcc;
|
|
67
67
|
|
|
@@ -202,7 +202,7 @@ inline CallSite getSVFCallSite(const SVFInstruction* inst)
|
|
|
202
202
|
|
|
203
203
|
/// Match arguments for callsite at caller and callee
|
|
204
204
|
/// if the arg size does not match then we do not need to connect this parameter
|
|
205
|
-
/// unless the callee is a variadic function (the first parameter of variadic function is its
|
|
205
|
+
/// unless the callee is a variadic function (the first parameter of variadic function is its parameter number)
|
|
206
206
|
bool matchArgs(const SVFInstruction* cs, const SVFFunction* callee);
|
|
207
207
|
|
|
208
208
|
/// Return LLVM callsite given a value
|
|
@@ -304,7 +304,7 @@ bool startAnalysisLimitTimer(unsigned timeLimit);
|
|
|
304
304
|
void stopAnalysisLimitTimer(bool limitTimerSet);
|
|
305
305
|
|
|
306
306
|
/// Return true if the call is an external call (external library in function summary table)
|
|
307
|
-
/// If the
|
|
307
|
+
/// If the library function is redefined in the application code (e.g., memcpy), it will return false and will not be treated as an external call.
|
|
308
308
|
//@{
|
|
309
309
|
inline bool isExtCall(const SVFFunction* fun)
|
|
310
310
|
{
|
|
@@ -643,7 +643,7 @@ inline const SVFValue* getTaskFuncAtHareParForSite(const SVFInstruction *inst)
|
|
|
643
643
|
}
|
|
644
644
|
//@}
|
|
645
645
|
|
|
646
|
-
/// Return the task data argument of the parallel_for
|
|
646
|
+
/// Return the task data argument of the parallel_for routine
|
|
647
647
|
//@{
|
|
648
648
|
inline const SVFValue* getTaskDataAtHareParForSite(const CallSite cs)
|
|
649
649
|
{
|
|
@@ -672,7 +672,7 @@ move(T &&t) noexcept
|
|
|
672
672
|
return std::move(t);
|
|
673
673
|
}
|
|
674
674
|
|
|
675
|
-
/// void_t is not
|
|
675
|
+
/// void_t is not available until C++17. We define it here for C++11/14.
|
|
676
676
|
template <typename... Ts> struct make_void
|
|
677
677
|
{
|
|
678
678
|
typedef void type;
|
|
@@ -221,7 +221,7 @@ private:
|
|
|
221
221
|
};
|
|
222
222
|
|
|
223
223
|
/**
|
|
224
|
-
*
|
|
224
|
+
* Worklist with "first in last out" order.
|
|
225
225
|
* New nodes will be pushed at back and popped from back.
|
|
226
226
|
* Elements in the list are unique as they're recorded by Set.
|
|
227
227
|
*/
|
|
@@ -111,7 +111,7 @@ typedef struct cJSON
|
|
|
111
111
|
/* The type of the item, as above. */
|
|
112
112
|
int type;
|
|
113
113
|
|
|
114
|
-
/* The item's string, if type==cJSON_String
|
|
114
|
+
/* The item's string, if type==cJSON_String and type == cJSON_Raw */
|
|
115
115
|
char *valuestring;
|
|
116
116
|
/* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */
|
|
117
117
|
int valueint;
|
|
@@ -327,7 +327,7 @@ protected:
|
|
|
327
327
|
void mergeSccNodes(NodeID repNodeId, const NodeBS& subNodes);
|
|
328
328
|
void mergeSccCycle();
|
|
329
329
|
//@}
|
|
330
|
-
/// Collapse a field object into its base for field insensitive
|
|
330
|
+
/// Collapse a field object into its base for field insensitive analysis
|
|
331
331
|
//@{
|
|
332
332
|
virtual void collapsePWCNode(NodeID nodeId);
|
|
333
333
|
void collapseFields();
|
|
@@ -75,7 +75,7 @@ public:
|
|
|
75
75
|
/// Destructor
|
|
76
76
|
~FlowSensitive() override = default;
|
|
77
77
|
|
|
78
|
-
/// Create
|
|
78
|
+
/// Create single instance of flow-sensitive pointer analysis
|
|
79
79
|
static FlowSensitive* createFSWPA(SVFIR* _pag)
|
|
80
80
|
{
|
|
81
81
|
if (fspta == nullptr)
|
|
@@ -94,7 +94,7 @@ protected:
|
|
|
94
94
|
void analyzeStaticObjType(ObjTypeInfo* typeinfo, const Value* val);
|
|
95
95
|
|
|
96
96
|
///Get a reference to the components of struct_info.
|
|
97
|
-
/// Number of
|
|
97
|
+
/// Number of flattened elements of an array or struct
|
|
98
98
|
u32_t getNumOfFlattenElements(const Type* T);
|
|
99
99
|
|
|
100
100
|
///Get a reference to StructInfo.
|