Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm]
compiler: [ [clang++-19, clang-19, "clang-19 libclang-rt-19-dev"] ]
compiler: [ [clang++-19, clang-19, "clang-19 libclang-rt-19-dev clang-tools-19"] ]
build: [ Debug, Release, DebugLibdeps, DebugCov ]
include:
- build: Debug
Expand Down
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ When using CMake to compile PhASAR the following optional parameters can be used
| **PHASAR_ENABLE_PAMM** : STRING | Enable the performance measurement mechanism ('Off', 'Core' or 'Full', default is Off) |
| **PHASAR_ENABLE_PIC** : BOOL | Build Position-Independed Code (default is ON) |
| **PHASAR_ENABLE_WARNINGS** : BOOL | Enable compiler warnings (default is ON) |
| **CMAKE_CXX_STANDARD** : INT|Build phasar in C++17 or C++20 mode (default is 17)|
| **CMAKE_CXX_STANDARD** : INT|Adapt the used C++ standard (minimum required is 20)|

You can use these parameters either directly or modify the installer-script `bootstrap.sh`

Expand Down
2 changes: 2 additions & 0 deletions BreakingChanges.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## development HEAD

- Requiring C++20 instead of C++17
- Type-traits and other templates that are specialized now use `requires` instead of `enable_if`, wherever possible. This may reduce the number of (defaulted) template parameters in some cases.
- The `AdjacencyList` struct now now has one more template argument to denote the intege-like `vertex_t` type. It is the second template argument (which previously was the EdgeType). The edge-type is now denoted by the *third* template argument.
- The `AdjacencyList` switches from using `llvm::NoneType` as empty-node marker to `psr::EmptyType` for forward-compatibility with LLVM-16 that removes `llvm::NoneType`.

Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ if (DEFINED LLVM_MAIN_SRC_DIR)
set(PHASAR_IN_TREE 1)
endif()

set(PHASAR_VERSION 2510)
if (NOT PHASAR_IN_TREE)
project (phasar
LANGUAGES C CXX
DESCRIPTION "A LLVM-based static analysis framework."
VERSION 2510
VERSION ${PHASAR_VERSION}
)
endif ()
set(PHASAR_VERSION ${PROJECT_VERSION})

# NOTE: When we require cmake >= 3.21, we can use PROJECT_IS_TOP_LEVEL instead
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG baseimage="ubuntu:24.04"
FROM "$baseimage" as build
FROM "$baseimage" AS build

RUN --mount=type=bind,source=./utils/InstallAptDependencies.sh,target=/InstallAptDependencies.sh \
set -eux; \
./InstallAptDependencies.sh --noninteractive tzdata clang-19 libclang-rt-19-dev
./InstallAptDependencies.sh --noninteractive tzdata clang-19 libclang-rt-19-dev clang-tools-19

ENV CC=/usr/bin/clang-19 \
CXX=/usr/bin/clang++-19
Expand Down
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# PhASAR: A LLVM-based Static Analysis Framework

[![C++ Standard](https://img.shields.io/badge/C++_Standard-C%2B%2B17-blue.svg?style=flat&logo=c%2B%2B)](https://isocpp.org/)
[![C++ Standard](https://img.shields.io/badge/C++_Standard-C%2B%2B20-blue.svg?style=flat&logo=c%2B%2B)](https://isocpp.org/)
[![GitHub license](https://img.shields.io/badge/license-MIT-blueviolet.svg)](https://raw.githubusercontent.com/secure-software-engineering/phasar/master/LICENSE.txt)
[![GitHub Release](https://img.shields.io/github/v/release/secure-software-engineering/phasar?label=version)](https://github.com/secure-software-engineering/phasar/releases)

Expand All @@ -24,7 +24,7 @@ this README first.
as well. -->
Please also have a look on PhASAR's project directory and notice the project directory [examples](./examples/) as well as the custom tool `tools/example-tool/myphasartool.cpp`.

**NEW:** You can find PhASAR's API reference [here](https://secure-software-engineering.github.io/phasar/).
You can find PhASAR's API reference [here](https://secure-software-engineering.github.io/phasar/).


## Secure Software Engineering Group
Expand All @@ -34,20 +34,17 @@ PhASAR is primarily developed and maintained by the Secure Software Engineering
PhASAR was initially developed by Philipp Dominik Schubert (@pdschubert)(<philipp.schubert@upb.de>).

Currently, PhASAR is maintained by
- Fabian Schiebel (@fabianbs96)(<fabian.schiebel@iem.fraunhofer.de>)
- Fabian Schiebel (@fabianbs96)(<fabian.schiebel@uni-paderborn.de>)
- Sriteja Kummita (@sritejakv)
- Lucas Briese (@jusito)
- Martin Mory (@MMory)(<martin.mory@upb.de>)
- *others*

## Required Version of the C++ Standard

PhASAR requires at least C++-17.
**NEW**: PhASAR requires at least C++-20.

However, building in C++20 mode is supported. You may enable this setting the cmake variable `CMAKE_CXX_STANDARD` to `20`.
Although phasar currently does not make use of C++-20 features (except for some `concept`s behind an #ifdef border), your client application that just *uses* phasar as a library may want to use C++20 earlier.

**NEW**: PhASAR supports C++20 modules as an experimental feature.
PhASAR supports C++20 modules as an experimental feature.

## Currently Supported Version of LLVM

Expand Down
2 changes: 1 addition & 1 deletion cmake/phasar_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ function(add_phasar_library name)
EXPORT_NAME ${component_name}
)

target_compile_features(${name} PUBLIC cxx_std_17)
target_compile_features(${name} PUBLIC cxx_std_20)

set(install_module)
if(PHASAR_LIB_MODULE_FILES)
Expand Down
3 changes: 1 addition & 2 deletions examples/use-phasar-as-library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ cmake_minimum_required(VERSION 3.12)

project(PhasarExttoolTest)

set(CMAKE_EXPORT_COMPILE_COMMANDS YES)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

Expand Down
3 changes: 1 addition & 2 deletions examples/use-phasar-with-fetch-content/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ cmake_minimum_required(VERSION 3.12)

project(PhasarExttoolTest)

set(CMAKE_EXPORT_COMPILE_COMMANDS YES)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

Expand Down
7 changes: 3 additions & 4 deletions include/phasar/ControlFlow/CFGBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,9 @@ template <typename Derived> class CFGBase : public CRTPBase<Derived> {

template <typename ICF, typename Domain>
// NOLINTNEXTLINE(readability-identifier-naming)
PSR_CONCEPT is_cfg_v =
is_crtp_base_of_v<CFGBase, ICF> &&
std::is_same_v<typename ICF::n_t, typename Domain::n_t> &&
std::is_same_v<typename ICF::f_t, typename Domain::f_t>;
concept is_cfg_v = is_crtp_base_of_v<CFGBase, ICF> &&
std::is_same_v<typename ICF::n_t, typename Domain::n_t> &&
std::is_same_v<typename ICF::f_t, typename Domain::f_t>;

} // namespace psr

Expand Down
7 changes: 3 additions & 4 deletions include/phasar/ControlFlow/ICFGBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,9 @@ template <typename Derived> class ICFGBase : public CRTPBase<Derived> {
/// from the given analysis-Domain
template <typename ICF, typename Domain>
// NOLINTNEXTLINE(readability-identifier-naming)
PSR_CONCEPT is_icfg_v =
is_crtp_base_of_v<ICFGBase, ICF> &&
std::is_same_v<typename ICF::n_t, typename Domain::n_t> &&
std::is_same_v<typename ICF::f_t, typename Domain::f_t>;
concept is_icfg_v = is_crtp_base_of_v<ICFGBase, ICF> &&
std::is_same_v<typename ICF::n_t, typename Domain::n_t> &&
std::is_same_v<typename ICF::f_t, typename Domain::f_t>;

} // namespace psr

Expand Down
14 changes: 4 additions & 10 deletions include/phasar/ControlFlow/SparseCFGProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,12 @@ template <typename Derived, typename F, typename V> class SparseCFGProvider {
}
};

template <typename T, typename D, typename = void>
struct has_getSparseCFG : std::false_type {}; // NOLINT
template <typename T, typename D>
struct has_getSparseCFG<
T, D,
std::void_t<decltype(std::declval<const T>().getSparseCFG(
std::declval<typename T::f_t>(), std::declval<D>()))>>
: std::true_type {};

template <typename T, typename D>
// NOLINTNEXTLINE
constexpr bool has_getSparseCFG_v = has_getSparseCFG<T, D>::value;
constexpr bool has_getSparseCFG_v =
requires(const T &ICF, typename T::f_t Fun, D Fact) { //
ICF.getSparseCFG(Fun, Fact);
};
} // namespace psr

#endif // PHASAR_CONTROLFLOW_SPARSECFGPROVIDER_H
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class DefaultEdgeFunctionSingletonCacheImpl
llvm::DenseMap<const EdgeFunctionTy *, const void *, DSI> Cache;
};

template <typename EdgeFunctionTy, typename = void>
template <typename EdgeFunctionTy>
class DefaultEdgeFunctionSingletonCache
: public DefaultEdgeFunctionSingletonCacheImpl<
EdgeFunctionTy, typename EdgeFunctionTy::l_t> {
Expand All @@ -100,9 +100,8 @@ class DefaultEdgeFunctionSingletonCache
};

template <typename EdgeFunctionTy>
class DefaultEdgeFunctionSingletonCache<
EdgeFunctionTy,
std::enable_if_t<EdgeFunctionBase::IsSOOCandidate<EdgeFunctionTy>>> {
requires EdgeFunctionBase::IsSOOCandidate<EdgeFunctionTy>
class DefaultEdgeFunctionSingletonCache<EdgeFunctionTy> {
public:
[[nodiscard]] const void *
lookup(const EdgeFunctionTy & /*EF*/) const noexcept override {
Expand Down
Loading
Loading