svf-tools 1.0.600 → 1.0.602

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/.gitignore CHANGED
@@ -1,7 +1,6 @@
1
1
  Release*/
2
2
  Debug*/
3
3
  build/
4
- include/Util/config.h
5
4
  html/
6
5
  Test-Suite/
7
6
  Release+Asserts/
package/CMakeLists.txt CHANGED
@@ -2,17 +2,12 @@ cmake_minimum_required(VERSION 3.13.4)
2
2
 
3
3
  project("SVF")
4
4
 
5
-
6
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/.config.in ${CMAKE_CURRENT_SOURCE_DIR}/include/Util/config.h @ONLY)
5
+ configure_file(${CMAKE_SOURCE_DIR}/.config.in ${CMAKE_BINARY_DIR}/include/Util/config.h)
7
6
 
8
7
  # To support both in- and out-of-source builds,
9
8
  # we check for the presence of the add_llvm_loadable_module command.
10
9
  # - if this command is not present, we are building out-of-source
11
10
  if(NOT COMMAND add_llvm_library)
12
- if (DEFINED LLVM_DIR)
13
- set(ENV{LLVM_DIR} "${LLVM_DIR}")
14
- endif()
15
- if (DEFINED ENV{LLVM_DIR})
16
11
  # We need to match the build environment for LLVM:
17
12
  # In particular, we need C++14 and the -fno-rtti flag
18
13
  set(CMAKE_CXX_STANDARD 14)
@@ -20,18 +15,34 @@ if(NOT COMMAND add_llvm_library)
20
15
  # add -std=gnu++14
21
16
  set(CMAKE_CXX_EXTENSIONS ON)
22
17
 
23
- set(COMMON_FLAGS "-fPIC -Werror -Wall")
24
-
25
18
  if(CMAKE_BUILD_TYPE MATCHES "Debug")
26
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} -O0 -fno-rtti")
27
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS} -O0")
19
+ add_compile_options("-fPIC" "-Werror" "-Wall" "-O0" "-fno-rtti")
28
20
  else()
29
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} -O3 -fno-rtti")
30
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS} -O3")
21
+ add_compile_options("-fPIC" "-Werror" "-Wall" "-O3" "-fno-rtti")
22
+ endif()
23
+
24
+ find_package(LLVM REQUIRED CONFIG
25
+ HINTS "${LLVM_DIR}")
26
+
27
+ message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
28
+ message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
29
+
30
+ if (NOT LLVM_ENABLE_RTTI)
31
+ add_compile_options("-fno-rtti")
32
+ message(STATUS "Disable RTTI")
33
+ endif()
34
+
35
+ if (NOT LLVM_ENABLE_EH)
36
+ add_compile_options("-fno-exceptions")
37
+ message(STATUS "Disable exceptions")
38
+ endif()
39
+
40
+ if (SVF_COVERAGE OR DEFINED ENV{SVF_COVERAGE})
41
+ add_compile_options("-fprofile-arcs" "-ftest-coverage")
42
+ add_link_options("-fprofile-arcs" "-ftest-coverage")
43
+ message(STATUS "Enable coverage")
31
44
  endif()
32
45
 
33
- find_package(LLVM REQUIRED CONFIG)
34
-
35
46
  list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
36
47
  include(AddLLVM)
37
48
 
@@ -43,25 +54,15 @@ if(NOT COMMAND add_llvm_library)
43
54
  else()
44
55
  llvm_map_components_to_libnames(llvm_libs bitwriter core ipo irreader instcombine instrumentation target linker analysis scalaropts support transformutils)
45
56
  endif()
46
-
47
- else()
48
- message(FATAL_ERROR "\
49
- WARNING: The LLVM_DIR var was not set (required for an out-of-source build)!\n\
50
- Please set this to environment variable to point to the LLVM build directory\
51
- (e.g. on linux: export LLVM_DIR=/path/to/llvm/build/dir)")
52
- endif()
53
57
  else()
54
58
  set(IN_SOURCE_BUILD 1)
55
59
  endif()
56
60
 
57
- if (DEFINED Z3_DIR)
58
- set(ENV{Z3_DIR} "${Z3_DIR}")
59
- endif()
60
- find_library(Z3_LIBRARIES NAMES libz3.a libz3.so
61
- HINTS $ENV{Z3_DIR}
62
- PATH_SUFFIXES lib bin)
61
+ find_library(Z3_LIBRARIES NAMES z3
62
+ HINTS ${Z3_DIR} ENV Z3_DIR
63
+ PATH_SUFFIXES bin lib)
63
64
  find_path(Z3_INCLUDES NAMES z3++.h
64
- HINTS $ENV{Z3_DIR}
65
+ HINTS ${Z3_DIR} ENV Z3_DIR
65
66
  PATH_SUFFIXES include z3)
66
67
  if(NOT Z3_LIBRARIES OR NOT Z3_INCLUDES)
67
68
  message(FATAL_ERROR "Z3 not found!")
@@ -70,6 +71,7 @@ message(STATUS "Found Z3: ${Z3_LIBRARIES}")
70
71
  message(STATUS "Z3 include dir: ${Z3_INCLUDES}")
71
72
 
72
73
  include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include
74
+ ${CMAKE_BINARY_DIR}/include
73
75
  ${Z3_INCLUDES})
74
76
 
75
77
  # checks if the test-suite is present, if it is then build bc files and add testing to cmake build