svf-tools 1.0.667 → 1.0.668
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/package.json +1 -1
- package/svf/include/SVFIR/SVFModule.h +5 -6
- package/svf/include/SVFIR/SVFModuleRW.h +22 -0
- package/svf/include/SVFIR/SVFType.h +6 -3
- package/svf/include/Util/SVFUtil.h +10 -9
- package/svf/lib/Util/SVFUtil.cpp +10 -9
- package/svf-llvm/lib/SVFIRBuilder.cpp +1 -1
- package/svf-llvm/tools/MTA/LockResultValidator.h +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.668",
|
|
4
4
|
"description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//===- SVFModule.h -- SVFModule* class
|
|
1
|
+
//===- SVFModule.h -- SVFModule* class----------------------------------------//
|
|
2
2
|
//
|
|
3
3
|
// SVF: Static Value-Flow Analysis
|
|
4
4
|
//
|
|
@@ -42,6 +42,7 @@ class SVFModule
|
|
|
42
42
|
{
|
|
43
43
|
friend class SVFModuleWrite;
|
|
44
44
|
friend class SVFModuleRead;
|
|
45
|
+
|
|
45
46
|
public:
|
|
46
47
|
typedef std::vector<const SVFFunction*> FunctionSetType;
|
|
47
48
|
typedef std::vector<SVFGlobalValue*> GlobalSetType;
|
|
@@ -67,14 +68,12 @@ private:
|
|
|
67
68
|
FunctionSetType FunctionSet; ///< The Functions in the module
|
|
68
69
|
GlobalSetType GlobalSet; ///< The Global Variables in the module
|
|
69
70
|
AliasSetType AliasSet; ///< The Aliases in the module
|
|
70
|
-
ConstantType ConstantSet;
|
|
71
|
-
OtherValueType
|
|
71
|
+
ConstantType ConstantSet; ///< The ConstantData in the module
|
|
72
|
+
OtherValueType OtherValueSet; ///< All other values in the module
|
|
72
73
|
|
|
73
74
|
public:
|
|
74
75
|
/// Constructors
|
|
75
|
-
SVFModule(std::string moduleName = "") : moduleIdentifier(moduleName)
|
|
76
|
-
{
|
|
77
|
-
}
|
|
76
|
+
SVFModule(std::string moduleName = "") : moduleIdentifier(moduleName) {}
|
|
78
77
|
|
|
79
78
|
~SVFModule();
|
|
80
79
|
|
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
//===- SVFModuleRW.h -- SVFModuleReader* class--------------------------------//
|
|
2
|
+
//
|
|
3
|
+
// SVF: Static Value-Flow Analysis
|
|
4
|
+
//
|
|
5
|
+
// Copyright (C) <2013-2017> <Yulei Sui>
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// This program is free software: you can redistribute it and/or modify
|
|
9
|
+
// it under the terms of the GNU Affero General Public License as published by
|
|
10
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
// (at your option) any later version.
|
|
12
|
+
|
|
13
|
+
// This program is distributed in the hope that it will be useful,
|
|
14
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
// GNU Affero General Public License for more details.
|
|
17
|
+
|
|
18
|
+
// You should have received a copy of the GNU Affero General Public License
|
|
19
|
+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
//
|
|
21
|
+
//===----------------------------------------------------------------------===//
|
|
22
|
+
|
|
1
23
|
/*
|
|
2
24
|
* SVFModuleRW.h
|
|
3
25
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//===- SVFBasicTypes.h -- Basic types used in SVF
|
|
1
|
+
//===- SVFBasicTypes.h -- Basic types used in SVF-----------------------------//
|
|
2
2
|
//
|
|
3
3
|
// SVF: Static Value-Flow Analysis
|
|
4
4
|
//
|
|
@@ -168,8 +168,11 @@ public:
|
|
|
168
168
|
/// Destructor
|
|
169
169
|
~StInfo() = default;
|
|
170
170
|
|
|
171
|
-
/// struct A { int id; int salary; };
|
|
172
|
-
|
|
171
|
+
/// struct A { int id; int salary; };
|
|
172
|
+
/// struct B { char name[20]; struct A a;}
|
|
173
|
+
/// B b;
|
|
174
|
+
///
|
|
175
|
+
/// OriginalFieldType of b with field_idx 1 : Struct A
|
|
173
176
|
/// FlatternedFieldType of b with field_idx 1 : int
|
|
174
177
|
//{@
|
|
175
178
|
const SVFType* getOriginalElemType(u32_t fldIdx) const;
|
|
@@ -70,27 +70,28 @@ void dumpSparseSet(const NodeBS& To);
|
|
|
70
70
|
void dumpAliasSet(unsigned node, NodeBS To) ;
|
|
71
71
|
|
|
72
72
|
/// Returns successful message by converting a string into green string output
|
|
73
|
-
std::string sucMsg(std::string msg);
|
|
73
|
+
std::string sucMsg(const std::string& msg);
|
|
74
74
|
|
|
75
75
|
/// Returns warning message by converting a string into yellow string output
|
|
76
|
-
std::string wrnMsg(std::string msg);
|
|
76
|
+
std::string wrnMsg(const std::string& msg);
|
|
77
77
|
|
|
78
78
|
/// Writes a message run through wrnMsg.
|
|
79
|
-
void writeWrnMsg(std::string msg);
|
|
79
|
+
void writeWrnMsg(const std::string& msg);
|
|
80
80
|
|
|
81
81
|
/// Print error message by converting a string into red string output
|
|
82
82
|
//@{
|
|
83
|
-
std::string errMsg(std::string msg);
|
|
84
|
-
std::string bugMsg1(std::string msg);
|
|
85
|
-
std::string bugMsg2(std::string msg);
|
|
86
|
-
std::string bugMsg3(std::string msg);
|
|
83
|
+
std::string errMsg(const std::string& msg);
|
|
84
|
+
std::string bugMsg1(const std::string& msg);
|
|
85
|
+
std::string bugMsg2(const std::string& msg);
|
|
86
|
+
std::string bugMsg3(const std::string& msg);
|
|
87
87
|
//@}
|
|
88
88
|
|
|
89
89
|
/// Print each pass/phase message by converting a string into blue string output
|
|
90
|
-
std::string pasMsg(std::string msg);
|
|
90
|
+
std::string pasMsg(const std::string& msg);
|
|
91
91
|
|
|
92
92
|
/// Print memory usage in KB.
|
|
93
|
-
void reportMemoryUsageKB(const std::string& infor,
|
|
93
|
+
void reportMemoryUsageKB(const std::string& infor,
|
|
94
|
+
OutStream& O = SVFUtil::outs());
|
|
94
95
|
|
|
95
96
|
/// Get memory usage from system file. Return TRUE if succeed.
|
|
96
97
|
bool getMemoryUsageKB(u32_t* vmrss_kb, u32_t* vmsize_kb);
|
package/svf/lib/Util/SVFUtil.cpp
CHANGED
|
@@ -50,7 +50,7 @@ using namespace SVF;
|
|
|
50
50
|
/*!
|
|
51
51
|
* print successful message by converting a string into green string output
|
|
52
52
|
*/
|
|
53
|
-
std::string SVFUtil::sucMsg(std::string msg)
|
|
53
|
+
std::string SVFUtil::sucMsg(const std::string& msg)
|
|
54
54
|
{
|
|
55
55
|
return KGRN + msg + KNRM;
|
|
56
56
|
}
|
|
@@ -58,36 +58,37 @@ std::string SVFUtil::sucMsg(std::string msg)
|
|
|
58
58
|
/*!
|
|
59
59
|
* print warning message by converting a string into yellow string output
|
|
60
60
|
*/
|
|
61
|
-
std::string SVFUtil::wrnMsg(std::string msg)
|
|
61
|
+
std::string SVFUtil::wrnMsg(const std::string& msg)
|
|
62
62
|
{
|
|
63
63
|
return KYEL + msg + KNRM;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
void SVFUtil::writeWrnMsg(std::string msg)
|
|
66
|
+
void SVFUtil::writeWrnMsg(const std::string& msg)
|
|
67
67
|
{
|
|
68
|
-
if(Options::DisableWarn())
|
|
68
|
+
if (Options::DisableWarn())
|
|
69
|
+
return;
|
|
69
70
|
outs() << wrnMsg(msg) << "\n";
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
/*!
|
|
73
74
|
* print error message by converting a string into red string output
|
|
74
75
|
*/
|
|
75
|
-
std::string SVFUtil::errMsg(std::string msg)
|
|
76
|
+
std::string SVFUtil::errMsg(const std::string& msg)
|
|
76
77
|
{
|
|
77
78
|
return KRED + msg + KNRM;
|
|
78
79
|
}
|
|
79
80
|
|
|
80
|
-
std::string SVFUtil::bugMsg1(std::string msg)
|
|
81
|
+
std::string SVFUtil::bugMsg1(const std::string& msg)
|
|
81
82
|
{
|
|
82
83
|
return KYEL + msg + KNRM;
|
|
83
84
|
}
|
|
84
85
|
|
|
85
|
-
std::string SVFUtil::bugMsg2(std::string msg)
|
|
86
|
+
std::string SVFUtil::bugMsg2(const std::string& msg)
|
|
86
87
|
{
|
|
87
88
|
return KPUR + msg + KNRM;
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
std::string SVFUtil::bugMsg3(std::string msg)
|
|
91
|
+
std::string SVFUtil::bugMsg3(const std::string& msg)
|
|
91
92
|
{
|
|
92
93
|
return KCYA + msg + KNRM;
|
|
93
94
|
}
|
|
@@ -95,7 +96,7 @@ std::string SVFUtil::bugMsg3(std::string msg)
|
|
|
95
96
|
/*!
|
|
96
97
|
* print each pass/phase message by converting a string into blue string output
|
|
97
98
|
*/
|
|
98
|
-
std::string SVFUtil::pasMsg(std::string msg)
|
|
99
|
+
std::string SVFUtil::pasMsg(const std::string& msg)
|
|
99
100
|
{
|
|
100
101
|
return KBLU + msg + KNRM;
|
|
101
102
|
}
|
|
@@ -1186,7 +1186,7 @@ void SVFIRBuilder::parseOperations(std::vector<ExtAPI::Operation> &operations,
|
|
|
1186
1186
|
std::vector<NodeID>& operands = operation.getOperands();
|
|
1187
1187
|
if (operation.getOperator() == "funptr_ops" || operation.getOperator() == "Rb_tree_ops")
|
|
1188
1188
|
continue;
|
|
1189
|
-
for (std::string s: operation.getOperandStr())
|
|
1189
|
+
for (const std::string& s : operation.getOperandStr())
|
|
1190
1190
|
{
|
|
1191
1191
|
// There is already a NodeID in nodeIDMap
|
|
1192
1192
|
if (nodeIDMap.find(s) != nodeIDMap.end())
|
|
@@ -80,12 +80,12 @@ private:
|
|
|
80
80
|
return nullptr;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
inline bool inFilter(std::string name)
|
|
83
|
+
inline bool inFilter(const std::string& name)
|
|
84
84
|
{
|
|
85
85
|
return filterFun.find(name) != filterFun.end();
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
inline bool match(std::string lockName, CxtLockSetStr LS)
|
|
88
|
+
inline bool match(const std::string& lockName, CxtLockSetStr LS)
|
|
89
89
|
{
|
|
90
90
|
return LS.find(lockName) != LS.end();
|
|
91
91
|
}
|