svf-tools 1.0.640 → 1.0.642
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/CMakeLists.txt +37 -82
- package/SVF-doxygen/html/html/menudata.js +1 -62
- package/SVF-doxygen/html/html/search/searchdata.js +0 -21
- package/package.json +1 -1
- package/svf/CMakeLists.txt +14 -14
- package/svf/include/AbstractExecution/IntervalExeState.h +13 -4
- package/svf/include/AbstractExecution/IntervalValue.h +3 -3
- package/svf/lib/AbstractExecution/IntervalExeState.cpp +41 -16
- package/svf-llvm/CMakeLists.txt +50 -1
- package/svf-llvm/tools/CFL/CMakeLists.txt +10 -0
- package/{tools → svf-llvm/tools}/CFL/cfl.cpp +0 -0
- package/svf-llvm/tools/CMakeLists.txt +22 -0
- package/svf-llvm/tools/DDA/CMakeLists.txt +10 -0
- package/{tools → svf-llvm/tools}/DDA/dda.cpp +0 -0
- package/svf-llvm/tools/Example/CMakeLists.txt +10 -0
- package/{tools → svf-llvm/tools}/Example/svf-ex.cpp +0 -0
- package/svf-llvm/tools/MTA/CMakeLists.txt +12 -0
- package/{tools → svf-llvm/tools}/MTA/LockResultValidator.cpp +0 -0
- package/{tools → svf-llvm/tools}/MTA/LockResultValidator.h +0 -0
- package/{tools → svf-llvm/tools}/MTA/MTAAnnotator.cpp +0 -0
- package/{tools → svf-llvm/tools}/MTA/MTAAnnotator.h +0 -0
- package/{tools → svf-llvm/tools}/MTA/MTAResultValidator.cpp +0 -0
- package/{tools → svf-llvm/tools}/MTA/MTAResultValidator.h +0 -0
- package/{tools → svf-llvm/tools}/MTA/mta.cpp +0 -0
- package/svf-llvm/tools/SABER/CMakeLists.txt +10 -0
- package/{tools → svf-llvm/tools}/SABER/saber.cpp +0 -0
- package/svf-llvm/tools/WPA/CMakeLists.txt +13 -0
- package/{tools → svf-llvm/tools}/WPA/wpa.cpp +0 -0
- package/tools/CFL/CMakeLists.txt +0 -23
- package/tools/CMakeLists.txt +0 -7
- package/tools/DDA/CMakeLists.txt +0 -23
- package/tools/Example/CMakeLists.txt +0 -23
- package/tools/MTA/CMakeLists.txt +0 -25
- package/tools/SABER/CMakeLists.txt +0 -23
- package/tools/WPA/CMakeLists.txt +0 -26
package/CMakeLists.txt
CHANGED
|
@@ -5,89 +5,45 @@ project("SVF")
|
|
|
5
5
|
configure_file(${CMAKE_SOURCE_DIR}/.config.in
|
|
6
6
|
${CMAKE_BINARY_DIR}/include/Util/config.h)
|
|
7
7
|
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
endif()
|
|
27
|
-
|
|
28
|
-
find_package(LLVM REQUIRED CONFIG HINTS "${LLVM_DIR}")
|
|
29
|
-
|
|
30
|
-
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
|
|
31
|
-
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
|
|
32
|
-
|
|
33
|
-
if(NOT LLVM_ENABLE_RTTI)
|
|
34
|
-
add_compile_options("-fno-rtti")
|
|
35
|
-
message(STATUS "Disable RTTI")
|
|
36
|
-
endif()
|
|
37
|
-
|
|
38
|
-
if(NOT LLVM_ENABLE_EH)
|
|
39
|
-
add_compile_options("-fno-exceptions")
|
|
40
|
-
message(STATUS "Disable exceptions")
|
|
41
|
-
endif()
|
|
42
|
-
|
|
43
|
-
option(SVF_COVERAGE "Create coverage build")
|
|
44
|
-
if(SVF_COVERAGE OR DEFINED ENV{SVF_COVERAGE})
|
|
45
|
-
add_compile_options("-fprofile-arcs" "-ftest-coverage")
|
|
46
|
-
add_link_options("-fprofile-arcs" "-ftest-coverage")
|
|
47
|
-
message(STATUS "Enable coverage")
|
|
48
|
-
endif()
|
|
49
|
-
|
|
50
|
-
set(SVF_SANITIZE
|
|
51
|
-
""
|
|
52
|
-
CACHE STRING "Create sanitizer build (address)")
|
|
53
|
-
if(SVF_SANITIZE STREQUAL "address")
|
|
54
|
-
add_compile_options("-fno-omit-frame-pointer" "-fsanitize=address")
|
|
55
|
-
add_link_options("-fsanitize=address")
|
|
56
|
-
message(STATUS "Sanitizer build: ${SVF_SANITIZE}")
|
|
57
|
-
elseif(SVF_SANITIZE STREQUAL "thread")
|
|
58
|
-
add_compile_options("-fsanitize=thread")
|
|
59
|
-
add_link_options("-fsanitize=thread")
|
|
60
|
-
message(STATUS "Sanitizer build: ${SVF_SANITIZE}")
|
|
61
|
-
elseif(NOT SVF_SANITIZE STREQUAL "")
|
|
62
|
-
message(ERROR "Unknown sanitizer type: ${SVF_SANITIZE}")
|
|
63
|
-
endif()
|
|
64
|
-
|
|
65
|
-
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
|
|
66
|
-
include(AddLLVM)
|
|
8
|
+
# We need to match the build environment for LLVM: In particular, we need C++14
|
|
9
|
+
# and the -fno-rtti flag
|
|
10
|
+
set(CMAKE_CXX_STANDARD 14)
|
|
11
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
12
|
+
# add -std=gnu++14
|
|
13
|
+
set(CMAKE_CXX_EXTENSIONS ON)
|
|
14
|
+
|
|
15
|
+
add_compile_options("-fno-rtti")
|
|
16
|
+
add_compile_options("-fno-exceptions")
|
|
17
|
+
|
|
18
|
+
# Treat compiler warnings as errors
|
|
19
|
+
add_compile_options("-Werror" "-Wall")
|
|
20
|
+
|
|
21
|
+
# Keep assertions enabled if requested
|
|
22
|
+
option(SVF_ENABLE_ASSERTIONS "Always enable assertions")
|
|
23
|
+
if(SVF_ENABLE_ASSERTIONS)
|
|
24
|
+
add_compile_options("-UNDEBUG")
|
|
25
|
+
endif()
|
|
67
26
|
|
|
68
|
-
|
|
69
|
-
|
|
27
|
+
option(SVF_COVERAGE "Create coverage build")
|
|
28
|
+
if(SVF_COVERAGE OR DEFINED ENV{SVF_COVERAGE})
|
|
29
|
+
add_compile_options("-fprofile-arcs" "-ftest-coverage")
|
|
30
|
+
add_link_options("-fprofile-arcs" "-ftest-coverage")
|
|
31
|
+
message(STATUS "Enable coverage")
|
|
32
|
+
endif()
|
|
70
33
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
scalaropts
|
|
85
|
-
support
|
|
86
|
-
target
|
|
87
|
-
transformutils)
|
|
88
|
-
endif()
|
|
89
|
-
else()
|
|
90
|
-
set(IN_SOURCE_BUILD 1)
|
|
34
|
+
set(SVF_SANITIZE
|
|
35
|
+
""
|
|
36
|
+
CACHE STRING "Create sanitizer build (address)")
|
|
37
|
+
if(SVF_SANITIZE STREQUAL "address")
|
|
38
|
+
add_compile_options("-fno-omit-frame-pointer" "-fsanitize=address")
|
|
39
|
+
add_link_options("-fsanitize=address")
|
|
40
|
+
message(STATUS "Sanitizer build: ${SVF_SANITIZE}")
|
|
41
|
+
elseif(SVF_SANITIZE STREQUAL "thread")
|
|
42
|
+
add_compile_options("-fsanitize=thread")
|
|
43
|
+
add_link_options("-fsanitize=thread")
|
|
44
|
+
message(STATUS "Sanitizer build: ${SVF_SANITIZE}")
|
|
45
|
+
elseif(NOT SVF_SANITIZE STREQUAL "")
|
|
46
|
+
message(ERROR "Unknown sanitizer type: ${SVF_SANITIZE}")
|
|
91
47
|
endif()
|
|
92
48
|
|
|
93
49
|
find_library(
|
|
@@ -120,7 +76,6 @@ endif()
|
|
|
120
76
|
|
|
121
77
|
add_subdirectory(svf)
|
|
122
78
|
add_subdirectory(svf-llvm)
|
|
123
|
-
add_subdirectory(tools)
|
|
124
79
|
|
|
125
80
|
install(
|
|
126
81
|
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/svf/include/
|
|
@@ -1,63 +1,2 @@
|
|
|
1
1
|
var menudata={children:[
|
|
2
|
-
{text:"Main Page",url:"index.html"}
|
|
3
|
-
{text:"Namespaces",url:"namespaces.html",children:[
|
|
4
|
-
{text:"Namespace List",url:"namespaces.html"},
|
|
5
|
-
{text:"Namespace Members",url:"namespacemembers.html",children:[
|
|
6
|
-
{text:"All",url:"namespacemembers.html"},
|
|
7
|
-
{text:"Typedefs",url:"namespacemembers_type.html"}]}]},
|
|
8
|
-
{text:"Classes",url:"annotated.html",children:[
|
|
9
|
-
{text:"Class List",url:"annotated.html"},
|
|
10
|
-
{text:"Class Index",url:"classes.html"},
|
|
11
|
-
{text:"Class Hierarchy",url:"hierarchy.html"},
|
|
12
|
-
{text:"Class Members",url:"functions.html",children:[
|
|
13
|
-
{text:"All",url:"functions.html",children:[
|
|
14
|
-
{text:"_",url:"functions.html#index__"},
|
|
15
|
-
{text:"a",url:"functions.html#index_a"},
|
|
16
|
-
{text:"c",url:"functions.html#index_c"},
|
|
17
|
-
{text:"d",url:"functions.html#index_d"},
|
|
18
|
-
{text:"f",url:"functions.html#index_f"},
|
|
19
|
-
{text:"g",url:"functions.html#index_g"},
|
|
20
|
-
{text:"h",url:"functions.html#index_h"},
|
|
21
|
-
{text:"i",url:"functions.html#index_i"},
|
|
22
|
-
{text:"l",url:"functions.html#index_l"},
|
|
23
|
-
{text:"m",url:"functions.html#index_m"},
|
|
24
|
-
{text:"n",url:"functions.html#index_n"},
|
|
25
|
-
{text:"p",url:"functions.html#index_p"},
|
|
26
|
-
{text:"r",url:"functions.html#index_r"},
|
|
27
|
-
{text:"s",url:"functions.html#index_s"},
|
|
28
|
-
{text:"t",url:"functions.html#index_t"},
|
|
29
|
-
{text:"v",url:"functions.html#index_v"},
|
|
30
|
-
{text:"~",url:"functions.html#index_0x7e"}]},
|
|
31
|
-
{text:"Functions",url:"functions_func.html",children:[
|
|
32
|
-
{text:"a",url:"functions_func.html#index_a"},
|
|
33
|
-
{text:"c",url:"functions_func.html#index_c"},
|
|
34
|
-
{text:"d",url:"functions_func.html#index_d"},
|
|
35
|
-
{text:"g",url:"functions_func.html#index_g"},
|
|
36
|
-
{text:"h",url:"functions_func.html#index_h"},
|
|
37
|
-
{text:"i",url:"functions_func.html#index_i"},
|
|
38
|
-
{text:"l",url:"functions_func.html#index_l"},
|
|
39
|
-
{text:"m",url:"functions_func.html#index_m"},
|
|
40
|
-
{text:"p",url:"functions_func.html#index_p"},
|
|
41
|
-
{text:"r",url:"functions_func.html#index_r"},
|
|
42
|
-
{text:"s",url:"functions_func.html#index_s"},
|
|
43
|
-
{text:"v",url:"functions_func.html#index_v"},
|
|
44
|
-
{text:"~",url:"functions_func.html#index_0x7e"}]},
|
|
45
|
-
{text:"Variables",url:"functions_vars.html",children:[
|
|
46
|
-
{text:"_",url:"functions_vars.html#index__"},
|
|
47
|
-
{text:"a",url:"functions_vars.html#index_a"},
|
|
48
|
-
{text:"c",url:"functions_vars.html#index_c"},
|
|
49
|
-
{text:"f",url:"functions_vars.html#index_f"},
|
|
50
|
-
{text:"i",url:"functions_vars.html#index_i"},
|
|
51
|
-
{text:"l",url:"functions_vars.html#index_l"},
|
|
52
|
-
{text:"m",url:"functions_vars.html#index_m"},
|
|
53
|
-
{text:"n",url:"functions_vars.html#index_n"},
|
|
54
|
-
{text:"r",url:"functions_vars.html#index_r"},
|
|
55
|
-
{text:"s",url:"functions_vars.html#index_s"},
|
|
56
|
-
{text:"t",url:"functions_vars.html#index_t"},
|
|
57
|
-
{text:"v",url:"functions_vars.html#index_v"}]},
|
|
58
|
-
{text:"Typedefs",url:"functions_type.html"}]}]},
|
|
59
|
-
{text:"Files",url:"files.html",children:[
|
|
60
|
-
{text:"File List",url:"files.html"},
|
|
61
|
-
{text:"File Members",url:"globals.html",children:[
|
|
62
|
-
{text:"All",url:"globals.html"},
|
|
63
|
-
{text:"Functions",url:"globals_func.html"}]}]}]}
|
|
2
|
+
{text:"Main Page",url:"index.html"}]}
|
|
@@ -1,33 +1,12 @@
|
|
|
1
1
|
var indexSectionsWithContent =
|
|
2
2
|
{
|
|
3
|
-
0: "_acdefghilmnprstvw~",
|
|
4
|
-
1: "almr",
|
|
5
|
-
2: "s",
|
|
6
|
-
3: "cdlmsw",
|
|
7
|
-
4: "acdefghilmprstv~",
|
|
8
|
-
5: "_acfilmnrstv",
|
|
9
|
-
6: "cilnrv"
|
|
10
3
|
};
|
|
11
4
|
|
|
12
5
|
var indexSectionNames =
|
|
13
6
|
{
|
|
14
|
-
0: "all",
|
|
15
|
-
1: "classes",
|
|
16
|
-
2: "namespaces",
|
|
17
|
-
3: "files",
|
|
18
|
-
4: "functions",
|
|
19
|
-
5: "variables",
|
|
20
|
-
6: "typedefs"
|
|
21
7
|
};
|
|
22
8
|
|
|
23
9
|
var indexSectionLabels =
|
|
24
10
|
{
|
|
25
|
-
0: "All",
|
|
26
|
-
1: "Classes",
|
|
27
|
-
2: "Namespaces",
|
|
28
|
-
3: "Files",
|
|
29
|
-
4: "Functions",
|
|
30
|
-
5: "Variables",
|
|
31
|
-
6: "Typedefs"
|
|
32
11
|
};
|
|
33
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.642",
|
|
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": {
|
package/svf/CMakeLists.txt
CHANGED
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
# individual sub projects here, rather than the combined project.
|
|
5
5
|
|
|
6
6
|
file(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
GLOB
|
|
8
|
+
SVF_CORE_SOURCES
|
|
9
|
+
lib/AbstractExecution/*.cpp
|
|
10
|
+
lib/CFL/*.cpp
|
|
11
|
+
lib/DDA/*.cpp
|
|
12
|
+
lib/FastCluster/*.cpp
|
|
13
|
+
lib/Graphs/*.cpp
|
|
14
|
+
lib/MemoryModel/*.cpp
|
|
15
|
+
lib/MSSA/*.cpp
|
|
16
|
+
lib/MTA/*.cpp
|
|
17
|
+
lib/SABER/*.cpp
|
|
18
|
+
lib/SVFIR/*.cpp
|
|
19
|
+
lib/Util/*.cpp
|
|
20
|
+
lib/WPA/*.cpp)
|
|
21
21
|
|
|
22
22
|
# Refer to this link for detail:
|
|
23
23
|
# https://stackoverflow.com/questions/68864536/cmake-linking-static-libraries-in-different-subdirectories-into-one-single-stati
|
|
@@ -212,6 +212,12 @@ public:
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
+
/// domain widen with other, and return the widened domain
|
|
216
|
+
IntervalExeState widening(const IntervalExeState &other);
|
|
217
|
+
|
|
218
|
+
/// domain narrow with other, and return the narrowed domain
|
|
219
|
+
IntervalExeState narrowing(const IntervalExeState &other);
|
|
220
|
+
|
|
215
221
|
/// domain widen with other, important! other widen this.
|
|
216
222
|
void widenWith(const IntervalExeState &other);
|
|
217
223
|
|
|
@@ -252,6 +258,13 @@ public:
|
|
|
252
258
|
return true;
|
|
253
259
|
}
|
|
254
260
|
}
|
|
261
|
+
for (auto it = _locToItvVal.begin(); it != _locToItvVal.end(); ++it)
|
|
262
|
+
{
|
|
263
|
+
if (it->second.isBottom())
|
|
264
|
+
{
|
|
265
|
+
return true;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
255
268
|
return false;
|
|
256
269
|
}
|
|
257
270
|
|
|
@@ -357,13 +370,9 @@ public:
|
|
|
357
370
|
|
|
358
371
|
static bool lessThanVarToValMap(const VarToValMap &lhs, const VarToValMap &rhs)
|
|
359
372
|
{
|
|
360
|
-
if (lhs.size() != rhs.size()) return lhs.size() < rhs.size();
|
|
361
373
|
for (const auto &item: lhs)
|
|
362
374
|
{
|
|
363
375
|
auto it = rhs.find(item.first);
|
|
364
|
-
// lhs > rhs if SVFVar not exists in rhs
|
|
365
|
-
if (it == rhs.end())
|
|
366
|
-
return false;
|
|
367
376
|
// judge from expr id
|
|
368
377
|
if (!item.second.equals(it->second))
|
|
369
378
|
{
|
|
@@ -377,7 +377,7 @@ public:
|
|
|
377
377
|
}
|
|
378
378
|
else
|
|
379
379
|
{
|
|
380
|
-
this->_lb = !lb().
|
|
380
|
+
this->_lb = !lb().geq(other.lb()) ? minus_infinity() : this->lb();
|
|
381
381
|
this->_ub = !ub().geq(other.ub()) ? plus_infinity() : this->ub();
|
|
382
382
|
}
|
|
383
383
|
}
|
|
@@ -395,8 +395,8 @@ public:
|
|
|
395
395
|
}
|
|
396
396
|
else
|
|
397
397
|
{
|
|
398
|
-
this->_lb = is_infinite(this->
|
|
399
|
-
this->_ub = is_infinite(this->
|
|
398
|
+
this->_lb = is_infinite(this->lb()) ? other._lb : this->_lb;
|
|
399
|
+
this->_ub = is_infinite(this->ub()) ? other._ub : this->_ub;
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
402
|
|
|
@@ -56,6 +56,43 @@ u32_t IntervalExeState::hash() const
|
|
|
56
56
|
return pairH(std::make_pair(std::make_pair(h, h2), (u32_t) ExeState::hash()));
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
IntervalExeState IntervalExeState::widening(const IntervalExeState& other)
|
|
60
|
+
{
|
|
61
|
+
IntervalExeState es = *this;
|
|
62
|
+
for (auto it = es._varToItvVal.begin(); it != es._varToItvVal.end(); ++it)
|
|
63
|
+
{
|
|
64
|
+
auto key = it->first;
|
|
65
|
+
if (other._varToItvVal.find(key) != other._varToItvVal.end())
|
|
66
|
+
it->second.widen_with(other._varToItvVal.at(key));
|
|
67
|
+
}
|
|
68
|
+
for (auto it = es._locToItvVal.begin(); it != es._locToItvVal.end(); ++it)
|
|
69
|
+
{
|
|
70
|
+
auto key = it->first;
|
|
71
|
+
if (other._locToItvVal.find(key) != other._locToItvVal.end())
|
|
72
|
+
it->second.widen_with(other._locToItvVal.at(key));
|
|
73
|
+
}
|
|
74
|
+
return es;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
IntervalExeState IntervalExeState::narrowing(const IntervalExeState& other)
|
|
78
|
+
{
|
|
79
|
+
IntervalExeState es = *this;
|
|
80
|
+
for (auto it = es._varToItvVal.begin(); it != es._varToItvVal.end(); ++it)
|
|
81
|
+
{
|
|
82
|
+
auto key = it->first;
|
|
83
|
+
if (other._varToItvVal.find(key) != other._varToItvVal.end())
|
|
84
|
+
it->second.narrow_with(other._varToItvVal.at(key));
|
|
85
|
+
}
|
|
86
|
+
for (auto it = es._locToItvVal.begin(); it != es._locToItvVal.end(); ++it)
|
|
87
|
+
{
|
|
88
|
+
auto key = it->first;
|
|
89
|
+
if (other._locToItvVal.find(key) != other._locToItvVal.end())
|
|
90
|
+
it->second.narrow_with(other._locToItvVal.at(key));
|
|
91
|
+
}
|
|
92
|
+
return es;
|
|
93
|
+
|
|
94
|
+
}
|
|
95
|
+
|
|
59
96
|
/// domain widen with other, important! other widen this.
|
|
60
97
|
void IntervalExeState::widenWith(const IntervalExeState& other)
|
|
61
98
|
{
|
|
@@ -63,21 +100,13 @@ void IntervalExeState::widenWith(const IntervalExeState& other)
|
|
|
63
100
|
{
|
|
64
101
|
auto key = it->first;
|
|
65
102
|
if (other.getVarToVal().find(key) != other.getVarToVal().end())
|
|
66
|
-
|
|
67
|
-
auto lhs = other.getVarToVal().at(key);
|
|
68
|
-
lhs.widen_with(it->second);
|
|
69
|
-
it->second = lhs;
|
|
70
|
-
}
|
|
103
|
+
it->second.widen_with(other._varToItvVal.at(key));
|
|
71
104
|
}
|
|
72
105
|
for (auto it = _locToItvVal.begin(); it != _locToItvVal.end(); ++it)
|
|
73
106
|
{
|
|
74
107
|
auto key = it->first;
|
|
75
108
|
if (other._locToItvVal.find(key) != other._locToItvVal.end())
|
|
76
|
-
|
|
77
|
-
auto lhs = other._locToItvVal.at(key);
|
|
78
|
-
lhs.widen_with(it->second);
|
|
79
|
-
it->second = lhs;
|
|
80
|
-
}
|
|
109
|
+
it->second.widen_with(other._locToItvVal.at(key));
|
|
81
110
|
}
|
|
82
111
|
}
|
|
83
112
|
|
|
@@ -89,7 +118,7 @@ void IntervalExeState::joinWith(const IntervalExeState& other)
|
|
|
89
118
|
{
|
|
90
119
|
auto key = it->first;
|
|
91
120
|
auto oit = _varToItvVal.find(key);
|
|
92
|
-
if (oit !=
|
|
121
|
+
if (oit != _varToItvVal.end())
|
|
93
122
|
{
|
|
94
123
|
oit->second.join_with(it->second);
|
|
95
124
|
}
|
|
@@ -102,7 +131,7 @@ void IntervalExeState::joinWith(const IntervalExeState& other)
|
|
|
102
131
|
{
|
|
103
132
|
auto key = it->first;
|
|
104
133
|
auto oit = _locToItvVal.find(key);
|
|
105
|
-
if (oit !=
|
|
134
|
+
if (oit != _locToItvVal.end())
|
|
106
135
|
{
|
|
107
136
|
oit->second.join_with(it->second);
|
|
108
137
|
}
|
|
@@ -121,18 +150,14 @@ void IntervalExeState::narrowWith(const IntervalExeState& other)
|
|
|
121
150
|
auto key = it->first;
|
|
122
151
|
auto oit = other.getVarToVal().find(key);
|
|
123
152
|
if (oit != other.getVarToVal().end())
|
|
124
|
-
{
|
|
125
153
|
it->second.narrow_with(oit->second);
|
|
126
|
-
}
|
|
127
154
|
}
|
|
128
155
|
for (auto it = _locToItvVal.begin(); it != _locToItvVal.end(); ++it)
|
|
129
156
|
{
|
|
130
157
|
auto key = it->first;
|
|
131
158
|
auto oit = other._locToItvVal.find(key);
|
|
132
159
|
if (oit != other._locToItvVal.end())
|
|
133
|
-
{
|
|
134
160
|
it->second.narrow_with(oit->second);
|
|
135
|
-
}
|
|
136
161
|
}
|
|
137
162
|
}
|
|
138
163
|
|
package/svf-llvm/CMakeLists.txt
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
|
+
# To support both in- and out-of-source builds, we check for the presence of the
|
|
2
|
+
# add_llvm_loadable_module command. - if this command is not present, we are
|
|
3
|
+
# building out-of-source
|
|
4
|
+
if(NOT COMMAND add_llvm_library)
|
|
5
|
+
find_package(LLVM REQUIRED CONFIG HINTS "${LLVM_DIR}")
|
|
6
|
+
|
|
7
|
+
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
|
|
8
|
+
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
|
|
9
|
+
|
|
10
|
+
if(NOT LLVM_ENABLE_RTTI)
|
|
11
|
+
add_compile_options("-fno-rtti")
|
|
12
|
+
message(STATUS "Disable RTTI")
|
|
13
|
+
endif()
|
|
14
|
+
|
|
15
|
+
if(NOT LLVM_ENABLE_EH)
|
|
16
|
+
add_compile_options("-fno-exceptions")
|
|
17
|
+
message(STATUS "Disable exceptions")
|
|
18
|
+
endif()
|
|
19
|
+
|
|
20
|
+
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
|
|
21
|
+
include(AddLLVM)
|
|
22
|
+
|
|
23
|
+
add_definitions(${LLVM_DEFINITIONS})
|
|
24
|
+
# include_directories(SYSTEM ${LLVM_INCLUDE_DIRS})
|
|
25
|
+
|
|
26
|
+
if(LLVM_LINK_LLVM_DYLIB)
|
|
27
|
+
set(llvm_libs LLVM)
|
|
28
|
+
else()
|
|
29
|
+
llvm_map_components_to_libnames(
|
|
30
|
+
llvm_libs
|
|
31
|
+
analysis
|
|
32
|
+
bitwriter
|
|
33
|
+
core
|
|
34
|
+
instcombine
|
|
35
|
+
instrumentation
|
|
36
|
+
ipo
|
|
37
|
+
irreader
|
|
38
|
+
linker
|
|
39
|
+
scalaropts
|
|
40
|
+
support
|
|
41
|
+
target
|
|
42
|
+
transformutils)
|
|
43
|
+
endif()
|
|
44
|
+
else()
|
|
45
|
+
set(IN_SOURCE_BUILD 1)
|
|
46
|
+
endif()
|
|
47
|
+
|
|
1
48
|
# SVF-LLVM containes LLVM Libs
|
|
2
49
|
file(GLOB SVFLLVM_SOURCES lib/*.cpp)
|
|
3
50
|
|
|
@@ -7,5 +54,7 @@ target_include_directories(SvfLLVM PUBLIC include)
|
|
|
7
54
|
target_link_libraries(SvfLLVM PUBLIC ${Z3_LIBRARIES} SvfCoreObj)
|
|
8
55
|
|
|
9
56
|
if(DEFINED IN_SOURCE_BUILD)
|
|
10
|
-
|
|
57
|
+
add_dependencies(SvfLLVM intrinsics_gen)
|
|
11
58
|
endif()
|
|
59
|
+
|
|
60
|
+
add_subdirectory(tools)
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
if(DEFINED IN_SOURCE_BUILD)
|
|
2
|
+
set(LLVM_LINK_COMPONENTS
|
|
3
|
+
BitWriter
|
|
4
|
+
Core
|
|
5
|
+
IPO
|
|
6
|
+
IrReader
|
|
7
|
+
InstCombine
|
|
8
|
+
Instrumentation
|
|
9
|
+
Target
|
|
10
|
+
Linker
|
|
11
|
+
Analysis
|
|
12
|
+
ScalarOpts
|
|
13
|
+
Support
|
|
14
|
+
SvfLLVM)
|
|
15
|
+
endif()
|
|
16
|
+
|
|
17
|
+
add_subdirectory(SABER)
|
|
18
|
+
add_subdirectory(WPA)
|
|
19
|
+
add_subdirectory(Example)
|
|
20
|
+
add_subdirectory(DDA)
|
|
21
|
+
add_subdirectory(MTA)
|
|
22
|
+
add_subdirectory(CFL)
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
if(DEFINED IN_SOURCE_BUILD)
|
|
2
|
+
add_llvm_tool(svf-ex svf-ex.cpp)
|
|
3
|
+
else()
|
|
4
|
+
add_executable(svf-ex svf-ex.cpp)
|
|
5
|
+
|
|
6
|
+
target_link_libraries(svf-ex SvfLLVM ${llvm_libs})
|
|
7
|
+
|
|
8
|
+
set_target_properties(svf-ex PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
9
|
+
${CMAKE_BINARY_DIR}/bin)
|
|
10
|
+
endif()
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
if(DEFINED IN_SOURCE_BUILD)
|
|
2
|
+
add_llvm_tool(mta mta.cpp LockResultValidator.cpp MTAResultValidator.cpp
|
|
3
|
+
MTAAnnotator.cpp)
|
|
4
|
+
else()
|
|
5
|
+
add_executable(mta mta.cpp LockResultValidator.cpp MTAResultValidator.cpp
|
|
6
|
+
MTAAnnotator.cpp)
|
|
7
|
+
|
|
8
|
+
target_link_libraries(mta SvfLLVM ${llvm_libs})
|
|
9
|
+
|
|
10
|
+
set_target_properties(mta PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
11
|
+
${CMAKE_BINARY_DIR}/bin)
|
|
12
|
+
endif()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
if(DEFINED IN_SOURCE_BUILD)
|
|
2
|
+
add_llvm_tool(saber saber.cpp)
|
|
3
|
+
else()
|
|
4
|
+
add_executable(saber saber.cpp)
|
|
5
|
+
|
|
6
|
+
target_link_libraries(saber SvfLLVM ${llvm_libs})
|
|
7
|
+
|
|
8
|
+
set_target_properties(saber PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
9
|
+
${CMAKE_BINARY_DIR}/bin)
|
|
10
|
+
endif()
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
2
|
+
find_package(Threads REQUIRED)
|
|
3
|
+
|
|
4
|
+
if(DEFINED IN_SOURCE_BUILD)
|
|
5
|
+
add_llvm_tool(wpa wpa.cpp)
|
|
6
|
+
else()
|
|
7
|
+
add_executable(wpa wpa.cpp)
|
|
8
|
+
|
|
9
|
+
target_link_libraries(wpa SvfLLVM ${llvm_libs} Threads::Threads)
|
|
10
|
+
|
|
11
|
+
set_target_properties(wpa PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
12
|
+
${CMAKE_BINARY_DIR}/bin)
|
|
13
|
+
endif()
|
|
File without changes
|
package/tools/CFL/CMakeLists.txt
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
if(DEFINED IN_SOURCE_BUILD)
|
|
2
|
-
set(LLVM_LINK_COMPONENTS
|
|
3
|
-
BitWriter
|
|
4
|
-
Core
|
|
5
|
-
IPO
|
|
6
|
-
IrReader
|
|
7
|
-
InstCombine
|
|
8
|
-
Instrumentation
|
|
9
|
-
Target
|
|
10
|
-
Linker
|
|
11
|
-
Analysis
|
|
12
|
-
ScalarOpts
|
|
13
|
-
Support
|
|
14
|
-
SvfLLVM)
|
|
15
|
-
add_llvm_tool(cfl cfl.cpp)
|
|
16
|
-
else()
|
|
17
|
-
add_executable(cfl cfl.cpp)
|
|
18
|
-
|
|
19
|
-
target_link_libraries(cfl SvfLLVM ${llvm_libs})
|
|
20
|
-
|
|
21
|
-
set_target_properties(cfl PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
22
|
-
${CMAKE_BINARY_DIR}/bin)
|
|
23
|
-
endif()
|
package/tools/CMakeLists.txt
DELETED
package/tools/DDA/CMakeLists.txt
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
if(DEFINED IN_SOURCE_BUILD)
|
|
2
|
-
set(LLVM_LINK_COMPONENTS
|
|
3
|
-
BitWriter
|
|
4
|
-
Core
|
|
5
|
-
IPO
|
|
6
|
-
IrReader
|
|
7
|
-
InstCombine
|
|
8
|
-
Instrumentation
|
|
9
|
-
Target
|
|
10
|
-
Linker
|
|
11
|
-
Analysis
|
|
12
|
-
ScalarOpts
|
|
13
|
-
Support
|
|
14
|
-
SvfLLVM)
|
|
15
|
-
add_llvm_tool(dvf dda.cpp)
|
|
16
|
-
else()
|
|
17
|
-
add_executable(dvf dda.cpp)
|
|
18
|
-
|
|
19
|
-
target_link_libraries(dvf SvfLLVM ${llvm_libs})
|
|
20
|
-
|
|
21
|
-
set_target_properties(dvf PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
22
|
-
${CMAKE_BINARY_DIR}/bin)
|
|
23
|
-
endif()
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
if(DEFINED IN_SOURCE_BUILD)
|
|
2
|
-
set(LLVM_LINK_COMPONENTS
|
|
3
|
-
BitWriter
|
|
4
|
-
Core
|
|
5
|
-
IPO
|
|
6
|
-
IrReader
|
|
7
|
-
InstCombine
|
|
8
|
-
Instrumentation
|
|
9
|
-
Target
|
|
10
|
-
Linker
|
|
11
|
-
Analysis
|
|
12
|
-
ScalarOpts
|
|
13
|
-
Support
|
|
14
|
-
SvfLLVM)
|
|
15
|
-
add_llvm_tool(svf-ex svf-ex.cpp)
|
|
16
|
-
else()
|
|
17
|
-
add_executable(svf-ex svf-ex.cpp)
|
|
18
|
-
|
|
19
|
-
target_link_libraries(svf-ex SvfLLVM ${llvm_libs})
|
|
20
|
-
|
|
21
|
-
set_target_properties(svf-ex PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
22
|
-
${CMAKE_BINARY_DIR}/bin)
|
|
23
|
-
endif()
|
package/tools/MTA/CMakeLists.txt
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
if(DEFINED IN_SOURCE_BUILD)
|
|
2
|
-
set(LLVM_LINK_COMPONENTS
|
|
3
|
-
BitWriter
|
|
4
|
-
Core
|
|
5
|
-
IPO
|
|
6
|
-
IrReader
|
|
7
|
-
InstCombine
|
|
8
|
-
Instrumentation
|
|
9
|
-
Target
|
|
10
|
-
Linker
|
|
11
|
-
Analysis
|
|
12
|
-
ScalarOpts
|
|
13
|
-
Support
|
|
14
|
-
SvfLLVM
|
|
15
|
-
Cudd)
|
|
16
|
-
add_llvm_tool(mta mta.cpp)
|
|
17
|
-
else()
|
|
18
|
-
add_executable(mta mta.cpp LockResultValidator.cpp MTAResultValidator.cpp
|
|
19
|
-
MTAAnnotator.cpp)
|
|
20
|
-
|
|
21
|
-
target_link_libraries(mta SvfLLVM ${llvm_libs})
|
|
22
|
-
|
|
23
|
-
set_target_properties(mta PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
24
|
-
${CMAKE_BINARY_DIR}/bin)
|
|
25
|
-
endif()
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
if(DEFINED IN_SOURCE_BUILD)
|
|
2
|
-
set(LLVM_LINK_COMPONENTS
|
|
3
|
-
BitWriter
|
|
4
|
-
Core
|
|
5
|
-
IPO
|
|
6
|
-
IrReader
|
|
7
|
-
InstCombine
|
|
8
|
-
Instrumentation
|
|
9
|
-
Target
|
|
10
|
-
Linker
|
|
11
|
-
Analysis
|
|
12
|
-
ScalarOpts
|
|
13
|
-
Support
|
|
14
|
-
SvfLLVM)
|
|
15
|
-
add_llvm_tool(saber saber.cpp)
|
|
16
|
-
else()
|
|
17
|
-
add_executable(saber saber.cpp)
|
|
18
|
-
|
|
19
|
-
target_link_libraries(saber SvfLLVM ${llvm_libs})
|
|
20
|
-
|
|
21
|
-
set_target_properties(saber PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
22
|
-
${CMAKE_BINARY_DIR}/bin)
|
|
23
|
-
endif()
|
package/tools/WPA/CMakeLists.txt
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
2
|
-
find_package(Threads REQUIRED)
|
|
3
|
-
|
|
4
|
-
if(DEFINED IN_SOURCE_BUILD)
|
|
5
|
-
set(LLVM_LINK_COMPONENTS
|
|
6
|
-
BitWriter
|
|
7
|
-
Core
|
|
8
|
-
IPO
|
|
9
|
-
IrReader
|
|
10
|
-
InstCombine
|
|
11
|
-
Instrumentation
|
|
12
|
-
Target
|
|
13
|
-
Linker
|
|
14
|
-
Analysis
|
|
15
|
-
ScalarOpts
|
|
16
|
-
Support
|
|
17
|
-
SvfLLVM)
|
|
18
|
-
add_llvm_tool(wpa wpa.cpp)
|
|
19
|
-
else()
|
|
20
|
-
add_executable(wpa wpa.cpp)
|
|
21
|
-
|
|
22
|
-
target_link_libraries(wpa SvfLLVM ${llvm_libs} Threads::Threads)
|
|
23
|
-
|
|
24
|
-
set_target_properties(wpa PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
25
|
-
${CMAKE_BINARY_DIR}/bin)
|
|
26
|
-
endif()
|