Skip to content

Commit 153083a

Browse files
Remove Deprecated APIs (#798)
* Remove various deprecated APIs * Remove the dependency to SQLite3 + use BUILD_PHASAR_CLANG=OFF by default * Remove boost * build: fix nlohmann_json dep for conan --------- Co-authored-by: Lucas Briese <[email protected]>
1 parent a210610 commit 153083a

File tree

81 files changed

+62
-2590
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+62
-2590
lines changed

BreakingChanges.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,18 @@
22

33
## development HEAD
44

5-
*None*
5+
- Removed `SpecialSummaries`.
6+
- Removed `Hexastore` and the corresponding database queries.
7+
- Removed `LLVMTypeHierarchy` (and `LLVMTypeHierarchyData`), which is superceeded by `DIBasedTypeHierarchy`.
8+
- Removed `Resolver::preCall()`, `Resolver::postCall()`, and `Resolver::otherInst()`.
9+
- Removed `TypestateDescription::start()`. Instead apply `TypestateDescription::getNextState()` on `TypestateDescription::uninit()`.
10+
- Removed `LLVMProjectIRDB::getParsedIRModuleOrNull()`. Use `LLVMProjectIRDB::getParsedIRModuleOrErr()` instead.
11+
- Removed `DIBasedTypeHierarchy::isVTable()` and `DIBasedTypeHierarchy::removeVTablePrefix()`. Use the corresponding functions from `LLVMVFTableProvider` instead.
12+
- Removed the CMake variable `PHASAR_HAS_SQLITE` as we removed the dependency on sqlite3.
13+
- The CMake Option `BUILD_PHASAR_CLANG` is no longer `ON` by default.
14+
- Removed the dependency to boost:
15+
- Removed the boost-related command-line options in `bootstrap.sh`
16+
- `InstallAptDependencies.sh` no longer installs boost (so, boost is also no longer built into PhASAR's Docker containers)
617

718
## v2510
819

CMakeLists.txt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,6 @@ endif()
264264
# Threads
265265
find_package(Threads)
266266

267-
# Boost
268-
find_package(Boost 1.65.1 COMPONENTS graph REQUIRED CONFIG)
269-
270267
# Disable clang-tidy for the external projects
271268
set(CMAKE_CXX_CLANG_TIDY "")
272269

@@ -294,14 +291,6 @@ else()
294291
set(GTEST_INCLUDE_DIR "${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include")
295292
endif()
296293

297-
# SQL
298-
find_package(SQLite3)
299-
if(SQLite3_FOUND)
300-
set(PHASAR_HAS_SQLITE ON)
301-
else()
302-
set(PHASAR_HAS_SQLITE OFF)
303-
endif()
304-
305294
option(USE_LLVM_FAT_LIB "Link against libLLVM.so instead of the individual LLVM libraries if possible (default is OFF; always on if BUILD_SHARED_LIBS is ON)" OFF)
306295

307296
# LLVM
@@ -350,7 +339,7 @@ else()
350339
endif()
351340

352341
# Clang
353-
option(BUILD_PHASAR_CLANG "Build the phasar_clang library (default is ON)" ON)
342+
option(BUILD_PHASAR_CLANG "Build the phasar_clang library (default is OFF)" OFF)
354343
if(BUILD_PHASAR_CLANG)
355344
add_clang()
356345
endif()

Config.cmake.in

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,16 @@ include (CMakeFindDependencyMacro)
99
set(PHASAR_LLVM_VERSION @PHASAR_LLVM_VERSION@)
1010

1111
include("${CMAKE_CURRENT_LIST_DIR}/PhasarDepsExports.cmake")
12-
find_dependency(Boost 1.65.1 COMPONENTS graph REQUIRED CONFIG)
1312
find_dependency(LLVM ${PHASAR_LLVM_VERSION} REQUIRED CONFIG)
1413

1514
set(PHASAR_USE_LLVM_FAT_LIB @USE_LLVM_FAT_LIB@)
1615
set(PHASAR_BUILD_DYNLIB @PHASAR_BUILD_DYNLIB@)
1716
set(PHASAR_USE_Z3 @PHASAR_USE_Z3@)
18-
set(PHASAR_HAS_SQLITE @PHASAR_HAS_SQLITE@)
1917
set(PHASAR_BUILD_MODULES @PHASAR_BUILD_MODULES@)
2018

2119
if (PHASAR_USE_Z3)
2220
find_dependency(Z3 REQUIRED)
2321
endif()
24-
if(PHASAR_HAS_SQLITE)
25-
find_dependency(SQLite3 REQUIRED)
26-
endif()
2722

2823
set(PHASAR_COMPONENTS
2924
utils

bootstrap.sh

Lines changed: 1 addition & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ function usage {
2323
echo -e "\t--unittest\t-u\t\t- Build and run PhASARs unit-tests (default is true)"
2424
echo -e "\t--install\t\t\t- Install PhASAR system-wide after building (default is false)"
2525
echo -e "\t--help\t\t-h\t\t- Display this help message"
26-
echo -e "\t-DBOOST_DIR=<path>\t\t- The directory where boost should be installed (optional)"
27-
echo -e "\t-DBOOST_VERSION=<string>\t- The desired boost version to install (optional)"
2826
echo -e "\t-DCMAKE_BUILD_TYPE=<string>\t- The build mode for building PhASAR. One of {Debug, RelWithDebInfo, Release} (default is Release)"
2927
echo -e "\t-DPHASAR_INSTALL_DIR=<path>\t- The folder where to install PhASAR if --install is specified (default is ${PHASAR_INSTALL_DIR})"
3028
echo -e "\t-DLLVM_INSTALL_DIR=<path>\t- The folder where to install LLVM if --install is specified (default is ${LLVM_INSTALL_DIR})"
@@ -48,24 +46,6 @@ case $key in
4846
DO_UNIT_TEST=true
4947
shift # past argument
5048
;;
51-
-DBOOST_DIR)
52-
DESIRED_BOOST_DIR="$2"
53-
shift # past argument
54-
shift # past value
55-
;;
56-
-DBOOST_DIR=*)
57-
DESIRED_BOOST_DIR="${key#*=}"
58-
shift # past argument=value
59-
;;
60-
-DBOOST_VERSION)
61-
DESIRED_BOOST_VERSION="$2"
62-
shift # past argument
63-
shift # past value
64-
;;
65-
-DBOOST_VERSION=*)
66-
DESIRED_BOOST_VERSION="${key#*=}"
67-
shift # past argument=value
68-
;;
6949
-DCMAKE_BUILD_TYPE=*)
7050
BUILD_TYPE="${key#*=}"
7151
shift # past argument=value
@@ -113,54 +93,6 @@ else
11393
./utils/InstallAptDependencies.sh
11494
fi
11595

116-
if [ ! -z "${DESIRED_BOOST_DIR}" ]; then
117-
BOOST_PARAMS="-DBOOST_ROOT=${DESIRED_BOOST_DIR}"
118-
else
119-
# New way of installing boost:
120-
# Check whether we have the required boost packages installed
121-
{ BOOST_VERSION=$(echo -e '#include <boost/version.hpp>\nBOOST_LIB_VERSION' | gcc -s -x c++ -E - 2>/dev/null| grep "^[^#;]" | tr -d '\"'); } || true
122-
123-
if [ -z "$BOOST_VERSION" ] ;then
124-
if [ -x "$(command -v pacman)" ]; then
125-
yes | sudo pacman -Syu --needed boost-libs boost
126-
else
127-
if [ -z "$DESIRED_BOOST_VERSION" ] ;then
128-
sudo apt-get install libboost-graph-dev -y
129-
else
130-
# DESIRED_BOOST_VERSION in form d.d, i.e. 1.65 (this is the latest version I found in the apt repo)
131-
sudo apt-get install "libboost${DESIRED_BOOST_VERSION}-graph-dev" -y
132-
fi
133-
#verify installation
134-
BOOST_VERSION=$(echo -e '#include <boost/version.hpp>\nBOOST_LIB_VERSION' | gcc -s -x c++ -E - 2>/dev/null| grep "^[^#;]" | tr -d '\"')
135-
if [ -z "$BOOST_VERSION" ] ;then
136-
echo "Failed installing boost $DESIRED_BOOST_VERSION"
137-
exit 1
138-
else
139-
echo "Successfully installed boost v${BOOST_VERSION//_/.}"
140-
fi
141-
fi
142-
else
143-
echo "Already installed boost version ${BOOST_VERSION//_/.}"
144-
if [ -x "$(command -v apt)" ]; then
145-
DESIRED_BOOST_VERSION=${BOOST_VERSION//_/.}
146-
# install missing packages if necessary
147-
boostlibnames=("libboost-graph")
148-
additional_boost_libs=()
149-
for boost_lib in "${boostlibnames[@]}"; do
150-
dpkg -s "$boost_lib${DESIRED_BOOST_VERSION}" >/dev/null 2>&1 ||
151-
dpkg -s "$boost_lib${DESIRED_BOOST_VERSION}.0" >/dev/null 2>&1 ||
152-
additional_boost_libs+=("$boost_lib${DESIRED_BOOST_VERSION}") ||
153-
additional_boost_libs+=("$boost_lib${DESIRED_BOOST_VERSION}.0")
154-
dpkg -s "${boost_lib}-dev" >/dev/null 2>&1 || additional_boost_libs+=("${boost_lib}-dev")
155-
done
156-
if [ ${#additional_boost_libs[@]} -gt 0 ] ;then
157-
echo "Installing additional ${#additional_boost_libs[@]} boost packages: ${additional_boost_libs[*]}"
158-
sudo apt-get install "${additional_boost_libs[@]}" -y || true
159-
fi
160-
fi
161-
fi
162-
fi
163-
16496
# installing LLVM
16597
tmp_dir=$(mktemp -d "llvm-build.XXXXXXXX" --tmpdir)
16698
./utils/install-llvm.sh "${NUM_THREADS}" "${tmp_dir}" "${LLVM_INSTALL_DIR}" ${LLVM_RELEASE}
@@ -182,7 +114,7 @@ export CXX=${LLVM_INSTALL_DIR}/bin/clang++
182114

183115
mkdir -p "${PHASAR_DIR}"/build
184116
safe_cd "${PHASAR_DIR}"/build
185-
cmake -G Ninja -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" "${BOOST_PARAMS}" -DPHASAR_BUILD_UNITTESTS="${DO_UNIT_TEST}" "${LLVM_PARAMS}" "${PHASAR_DIR}"
117+
cmake -G Ninja -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" -DPHASAR_BUILD_UNITTESTS="${DO_UNIT_TEST}" "${LLVM_PARAMS}" "${PHASAR_DIR}"
186118
cmake --build . -j "${NUM_THREADS}"
187119

188120
echo "phasar successfully built"

cmake/add_llvm.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ macro(add_clang)
6262
if (USE_LLVM_FAT_LIB)
6363
find_library(CLANG_LIBRARY NAMES clang-cpp libclang-cpp HINTS ${LLVM_LIBRARY_DIRS})
6464
else()
65-
find_library(CLANG_LIBRARY NAMES clangCodeGen clangTooling HINTS ${LLVM_LIBRARY_DIRS})
65+
find_library(CLANG_LIBRARY NAMES clangTooling clangCodeGen HINTS ${LLVM_LIBRARY_DIRS})
6666
endif()
6767
if(${CLANG_LIBRARY} STREQUAL "CLANG_LIBRARY-NOTFOUND")
6868
set(NEED_LIBCLANG_COMPONENT_LIBS ON)

conanfile.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ def node_labels(dot):
3030
"nlohmann_json_schema_validator": "json-schema-validator::json-schema-validator",
3131
"clangCodeGen": "clang::clangCodeGen",
3232
"clangTooling": "clang::clangTooling",
33-
"SQLite::SQLite3": "sqlite3::sqlite3",
3433
}
3534
for row in dot:
3635
# e.g. "node0" [ label = "phasar\n(phasar::phasar)", shape = octagon ];
@@ -41,8 +40,6 @@ def node_labels(dot):
4140
if label.startswith("LLVM"):
4241
yield node, f"llvm-core::{label}"
4342
# XXX find_library adds direct filepath -> imho a flaw in current cmake files
44-
elif label.endswith("libsqlite3.a"):
45-
yield node, "sqlite3::sqlite3"
4643
elif label.endswith("libclang-cpp.so"):
4744
yield node, "clang::clang"
4845
elif label.endswith("libclangCodeGen.a"):
@@ -167,7 +164,9 @@ def export_sources(self):
167164
"utils",
168165
"img",
169166
"githooks",
170-
"external"
167+
"external",
168+
"build",
169+
"cmake-build"
171170
])
172171

173172
for tlf in os.listdir("."):
@@ -228,8 +227,6 @@ def config_options(self):
228227
self.options.rm_safe("fPIC")
229228

230229
def requirements(self):
231-
self.requires("boost/[>1.72.0 <=1.86.0]")
232-
self.requires("sqlite3/[>=3 <4]")
233230
self.requires(f"clang/{self.options.llvm_version}@secure-software-engineering", transitive_libs=True, transitive_headers=True)
234231
self.requires("nlohmann_json/3.11.3", transitive_headers=True)
235232
self.requires("json-schema-validator/2.3.0", transitive_libs=True, transitive_headers=True)

include/phasar/DB.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,4 @@
1313
#include "phasar/Config/phasar-config.h"
1414
#include "phasar/DB/ProjectIRDBBase.h"
1515

16-
#ifdef PHASAR_HAS_SQLITE
17-
#include "phasar/DB/Hexastore.h"
18-
#include "phasar/DB/Queries.h"
19-
#endif
20-
2116
#endif // PHASAR_DB_H

include/phasar/DB/Hexastore.h

Lines changed: 0 additions & 136 deletions
This file was deleted.

0 commit comments

Comments
 (0)