Skip to content
Open
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: 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 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
11 changes: 4 additions & 7 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 @@ -42,12 +42,9 @@ Currently, PhASAR is maintained by

## 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
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 @@ -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