Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
392579d
Fix v2503 bugs (#763)
fabianbs96 Mar 24, 2025
9915cae
Mark Hexastore as deprecated (#764)
fabianbs96 Mar 24, 2025
d294b68
Fix init-submodules-release.sh (#765)
fabianbs96 Mar 24, 2025
9e0f2ca
Remove deprecated APIs and mark some others as deprecated (#766)
fabianbs96 Apr 2, 2025
6e25891
Default Flow Functions (#768)
mxHuber Apr 3, 2025
28a25b7
ci/update runner (#769)
jusito Apr 4, 2025
64412c5
SVF Pointer Analyses (#767)
fabianbs96 May 19, 2025
b56205d
More Heap-Allocating Functions (#772)
fabianbs96 May 26, 2025
ed7995a
Improved Code Documentation (#771)
fabianbs96 May 28, 2025
64e8241
Added default reachable allocation sites functions (#781)
mxHuber Jun 18, 2025
f5a9b43
Added c++ 20 modules support (#775)
mxHuber Jun 21, 2025
e3908bd
Example Programs (#774)
fabianbs96 Jun 30, 2025
6352566
Misc Changes (#773)
fabianbs96 Jul 25, 2025
e5e20ba
Fix Type-based Call-Graphs with Multiple Inheritance (#776)
fabianbs96 Jul 27, 2025
501c7e3
Refactor AnalysisPrinter (#790)
fabianbs96 Sep 5, 2025
0024a53
SourceCode-based IFDS/IDE UnitTests (#789)
mxHuber Sep 5, 2025
1e857b1
Call-Graph Improvements (#785)
fabianbs96 Sep 8, 2025
814ae82
Dbg-Info based Type Matching (#791)
mxHuber Sep 8, 2025
776600f
Some fixes in the IterativeIDESolver (#782)
fabianbs96 Sep 8, 2025
010d706
Bump dependencies (#784)
fabianbs96 Sep 8, 2025
10483a3
Remove boost from BitVectorSet (#788)
fabianbs96 Sep 11, 2025
a5c611a
GCC Compatibility (#787)
fabianbs96 Oct 12, 2025
17491f6
Alias Iterator (#783)
fabianbs96 Oct 23, 2025
8faccfd
Bump version number + update BreakingChanges (#796)
fabianbs96 Oct 24, 2025
a210610
Merge branch 'master' into development
fabianbs96 Oct 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ Checks: '-*,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-avoid-do-while,
-cppcoreguidelines-avoid-c-arrays,
bugprone-*,
-bugprone-easily-swappable-parameters,
modernize-*,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
performance-*,
clang-analyzer-*
'
Expand All @@ -59,7 +61,7 @@ CheckOptions:
- key: readability-identifier-naming.ParameterIgnoredRegexp
value: (d|d1|d2|d3|d4|d5|eP|f|n)
- key: readability-identifier-naming.FunctionIgnoredRegexp
value: (try_emplace|from_json|to_json|equal_to|to_string|DToString|NToString|FToString|LToString|hash_value)
value: (try_emplace|from_json|to_json|equal_to|to_string|DToString|NToString|FToString|LToString|hash_value|dyn_cast)
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
value: 1
- key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions
Expand Down
37 changes: 14 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04, ubuntu-24.04-arm]
os: [ubuntu-24.04, ubuntu-24.04-arm]
compiler: [ [clang++-19, clang-19, "clang-19 libclang-rt-19-dev"] ]
build: [ Debug, Release, DebugLibdeps ]
include:
Expand Down Expand Up @@ -46,12 +46,7 @@ jobs:
run: |
./utils/InstallAptDependencies.sh --noninteractive tzdata ${{ matrix.compiler[2] }}

- uses: swift-actions/setup-swift@v2
if: matrix.os == 'ubuntu-20.04'
with:
swift-version: "5.8.1"
- name: Building Phasar in ${{ matrix.build }} with ${{ matrix.compiler[0] }} including swift
if: matrix.os == 'ubuntu-20.04'
- name: Building Phasar in ${{ matrix.build }} with ${{ matrix.compiler[0] }}
env:
CXX: ${{ matrix.compiler[0] }}
CC: ${{ matrix.compiler[1] }}
Expand All @@ -60,29 +55,25 @@ jobs:
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-DBUILD_PHASAR_CLANG=OFF \
-DBUILD_SWIFT_TESTS=ON \
-DPHASAR_USE_Z3=ON \
${{ matrix.flags }} \
-G Ninja
ninja -C build

- name: Building Phasar in ${{ matrix.build }} with ${{ matrix.compiler[0] }}
if: matrix.os != 'ubuntu-20.04'
env:
CXX: ${{ matrix.compiler[0] }}
CC: ${{ matrix.compiler[1] }}
- name: Run Unittests
shell: bash
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-DBUILD_PHASAR_CLANG=OFF \
-DPHASAR_USE_Z3=ON \
${{ matrix.flags }} \
-G Ninja
ninja -C build
cmake --build ./build --target check-phasar-unittests

- name: Run Unittests
- name: Install PhASAR and Build Examples
if: matrix.build == 'DebugLibdeps' # Circumvent conflicting ASAn flags
env:
CXX: ${{ matrix.compiler[0] }}
CC: ${{ matrix.compiler[1] }}
shell: bash
run: |
cd build
cmake --build . --target check-phasar-unittests
cmake -DCMAKE_INSTALL_PREFIX=./INSTALL -P ./build/cmake_install.cmake
PHASAR_ROOT_DIR=$(pwd)
cd ./examples/how-to
cmake -S . -B build -Dphasar_ROOT="$PHASAR_ROOT_DIR/INSTALL"
cmake --build ./build --target run_sample_programs
41 changes: 41 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Deploy Doxygen Docs
on:
push:
branches: [ development ]
# pull_request: # For testing only. Remove before merge!
# branches: [ development ]
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-24.04
strategy:
fail-fast: true
continue-on-error: false

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- name: Install Phasar Dependencies
shell: bash
run: |
./utils/InstallAptDependencies.sh --noninteractive tzdata doxygen graphviz

- name: Build Doxygen Docs
shell: bash
env:
CXX: clang++-15
CC: clang-15
run: |
cmake -S . -B build -DPHASAR_BUILD_DOC=ON
cmake --build ./build --target doc_doxygen

- name: Deploy Doxygen Docs on GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build/docs/html
token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:

jobs:
pre-commit:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v2
- uses: actions/setup-python@v5

- uses: pre-commit/action@v2.0.0
- uses: pre-commit/action@v3.0.1
with:
extra_args: --from-ref origin/development --to-ref HEAD
10 changes: 4 additions & 6 deletions .github/workflows/reviewdog-clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,23 @@ on:

jobs:
format:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
tool: [ clang-format ]
include:
- tool: clang-format
install: |
sudo apt-key adv --fetch-keys https://apt.llvm.org/llvm-snapshot.gpg.key
sudo add-apt-repository -y 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main'
sudo apt-get update
sudo apt-get -y install --no-install-recommends clang-format-14
sudo apt-get -y install --no-install-recommends clang-format-19
regex: \.(h|c|hpp|cpp)$
command: clang-format-14 --style=file -i
command: clang-format-19 --style=file -i

continue-on-error: false
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ doc/*
log/*
**/*/logs/

# CMake build dir
build/*

# MS VS Code
.vscode/*
.vscode/

# Eclipse
.cproject
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
path = external/json
url = https://github.com/nlohmann/json.git
ignore = dirty
[submodule "lib/googletest"]
path = external/googletest
url = https://github.com/google/googletest.git
branch = master
[submodule "external/json-schema-validator"]
path = external/json-schema-validator
url = https://github.com/pboettch/json-schema-validator.git
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ repos:
- id: check-added-large-files
- id: requirements-txt-fixer
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v14.0.6'
rev: 'v19.1.7'
hooks:
- id: clang-format
130 changes: 130 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Building PhASAR


It is recommended to compile PhASAR yourself in order to get the full C++ experience and to have full control over the build mode.
However, you may also want to try out one of the pre-built versions of PhASAR or the Docker container.

As a shortcut for the very first PhASAR build on your system, you can use our [bootstrap](./bootstrap.sh) script.
Please note that you must have python installed for the script to work properly.

```bash
./bootstrap.sh
```

Note: If you want to do changes within PhASAR, it is recommended to build it in Debug mode:

```bash
./bootstrap.sh -DCMAKE_BUILD_TYPE=Debug
```

The bootstrap script may ask for superuser permissions (to install the dependencies); however it is not recommended to start the whole script with `sudo`.

For subsequent builds, see [Compiling PhASAR](#compiling-phasar-if-not-already-done-using-the-installation-scripts).

### Compiling PhASAR (if not already done using the bootstrap script)

Set the system's variables for the C and C++ compiler to clang:

```bash
export CC=/usr/local/bin/clang
export CXX=/usr/local/bin/clang++
```

You may need to adjust the paths according to your system. When you cloned PhASAR from Github you need to initialize PhASAR's submodules before building it:

```bash
git submodule update --init
```

If you downloaded PhASAR as a compressed release (e.g. .zip or .tar.gz) you can use the `init-submodules-release.sh` script that manually clones the required submodules:

```bash
utils/init-submodules-release.sh
```

Navigate into the PhASAR directory. The following commands will do the job and compile the PhASAR framework:

```bash
mkdir build
cd build/
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
ninja -j $(nproc) # or use a different number of cores to compile it
sudo ninja install # only if you wish to install PhASAR system wide
```

When you have used the `bootstrap.sh` script to install PhASAR, the above steps are already done.
Use them as a reference if you wish to modify PhASAR and recompile it.

After compilation using cmake the following two binaries can be found in the build/tools directory:

+ `phasar-cli` - the PhASAR command-line tool (previously called `phasar-llvm`) that provides access to analyses that are already implemented within PhASAR. Use this if you don't want to build an own tool on top of PhASAR.
+ `myphasartool` - an example tool that shows how tools can be build on top of PhASAR

Please be careful and check if errors occur during the compilation.

When using CMake to compile PhASAR the following optional parameters can be used:

| Parameter : Type| Effect |
|-----------|--------|
| **BUILD_SHARED_LIBS** : BOOL | Build shared libraries -- Not recommended anymore. You may want to use PHASAR_BUILD_DYNLIB instead (default is OFF) |
| **PHASAR_BUILD_DYNLIB** : BOOL | Build one fat shared library (default is OFF) |
| **CMAKE_BUILD_TYPE** : STRING | Build PhASAR in 'Debug', 'RelWithDebInfo' or 'Release' mode (default is 'Debug') |
| **CMAKE_INSTALL_PREFIX** : PATH | Path where PhASAR will be installed if "ninja install” is invoked or the “install” target is built (default is /usr/local/phasar) |
| **PHASAR_CUSTOM_CONFIG_INSTALL_DIR** : PATH | If set, customizes the directory, where configuration files for PhASAR are installed (default is /usr/local/.phasar-config)|
| **PHASAR_ENABLE_DYNAMIC_LOG** : BOOL|Makes it possible to switch the logger on and off at runtime (default is ON)|
| **PHASAR_BUILD_DOC** : BOOL | Build PhASAR documentation (default is OFF) |
| **PHASAR_BUILD_UNITTESTS** : BOOL | Build PhASAR unit tests (default is ON) |
| **PHASAR_BUILD_IR** : BOOL | Build PhASAR IR (required for running the unit tests) (default is ON) |
| **PHASAR_BUILD_OPENSSL_TS_UNITTESTS** : BOOL | Build PhASAR unit tests that require OpenSSL (default is OFF) |
| **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)|

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

#### A Remark on Compile Time

C++'s long compile times are always a pain. As shown in the above, when using cmake the compilation can easily be run in parallel, resulting in shorter compilation times. Make use of it!

### Running a Test Solver

To test if everything works as expected please run the following command:

`$ phasar-cli -m test/llvm_test_code/basic/module_cpp.ll -D ifds-solvertest`

You can find the `phasar-cli` tool in the build-tree under `tools/phasar-cli`.

If you obtain output other than a segmentation fault or an exception terminating the program abnormally everything works as expected.

### Building PhASAR on a MacOS System

Due to unfortunate updates to MacOS and the handling of C++, especially on the newer M1 processors, we can't support native development on Mac.
The easiest solution to develop PhASAR on a Mac right now is to use [dockers development environments](https://docs.docker.com/desktop/dev-environments/). Clone this repository as described in their documentation. Afterwards, you have to login once manually, as a root user by running `docker exec -it -u root <container name> /bin/bash` to complete the rest of the build process as described in this readme (install submodules, run bootstrap.sh, ...).
Now you can just attach your docker container to VS Code or any other IDE, which supports remote development.

## Installation

PhASAR can be installed using the installer scripts as explained in the following.
However, you do not need to install PhASAR in order to use it.

### Installing PhASAR on an Ubuntu System

In the following, we would like to give an complete example of how to install
PhASAR using an Ubuntu or Unix-like system.

Therefore, we provide an installation script. To install PhASAR, just navigate to the top-level
directory of PhASAR and use the following command:

```bash
./bootstrap.sh --install
```

The bootstrap script may ask for superuser permissions.

Done!

If You have already built phasar, you can just invoke
```bash
sudo ninja install
```
14 changes: 14 additions & 0 deletions BreakingChanges.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@

*None*

## v2510

- Removed some old APIs from `PhasarConfig`
- Removed the header `phasar/Config/Version.h`. Use the generated header `phasar/Config/phasar-config.h` instead.
- Removed `getAsJson()` from various classes. Use `printAsJson(llvm::raw_ostream &)` instead.
- Removed `CallGraphAnalysisType::DTA` and the `DTAResolver` (see below)
- Removed the legacy flow functions `Identity`, `LambdaFlow`, etc. Use the static functions from `FlowFunctionTemplates` instead.
- Removed getter-functions from `GeneralStatistics`. Use the corresponding public fields instead.
- Removed `LLVMAliasGraph`. Use `LLVMAliasSet` instead.
- Removed `TypeGraphs/*` as they are not used.
- Removed the namespace-scoped function `initializeLogger()`. Use the static functions in the `Logger` class instead.
- Removed `legacy::stripPointer(const llvm::Type *)` as it does not work anymore with opaque pointers.


## v2503

- The `DTAResolver` and the cli option `--call-graph-analysis=dta` do not work anymore (due to opaque pointers) and will be removed for the next release. Please use the `OTF` or `RTA` resolver instead.
Expand Down
Loading
Loading