Skip to content

Commit

Permalink
Merge pull request #704 from secure-software-engineering/development
Browse files Browse the repository at this point in the history
PhASAR Release 2403
  • Loading branch information
MMory authored Mar 2, 2024
2 parents 956972a + 49ad944 commit bbf6229
Show file tree
Hide file tree
Showing 436 changed files with 22,304 additions and 7,317 deletions.
6 changes: 4 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Checks: '-*,
misc-*,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
-misc-use-anonymous-namespace,
readability-*,
-readability-function-cognitive-complexity,
-readability-else-after*,
Expand All @@ -25,12 +26,13 @@ Checks: '-*,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-avoid-do-while,
bugprone-*,
-bugprone-easily-swappable-parameters,
modernize-*,
-modernize-use-trailing-return-type,
performance-*,
clang-analyzer-*,
clang-analyzer-*
'

FormatStyle: LLVM
Expand All @@ -55,7 +57,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)
value: (try_emplace|from_json|to_json|equal_to|to_string|DToString|NToString|FToString|LToString)
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
value: 1
- key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions
Expand Down
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ Dockerfile @janniclas
/.docker/ @janniclas

/include/phasar/Utils/Logger.h @MMory
/include/phasar/Utils/AnalysisPrinterBase.h @sritejakv
/include/phasar/Utils/DefaultAnalysisPrinter.h @sritejakv
/include/phasar/Utils/NullAnalysisPrinter.h @sritejakv
/include/phasar/Utils/OnTheFlyAnalysisPrinter.h @sritejakv
/include/phasar/PhasarLLVM/Utils/SourceMgrPrinter.h @sritejakv
/lib/PhasarLLVM/Utils/SourceMgrPrinter.cpp @sritejakv
11 changes: 6 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ assignees: ''
Replace the empty checkboxes [ ] below with checked ones [x] accordingly. -->

- [ ] I have searched open and closed issues for duplicates
- [ ] I made sure that I am not using an old project version (DO: pull Phasar, update git submodules, rebuild the project and check if the bug is still there)
- [ ] I made sure that I am not using an old project version (DO: pull PhASAR, update git submodules, rebuild the project and check if the bug is still there)

----------------------------------------

Expand All @@ -24,9 +24,9 @@ Describe here the issue that you are experiencing.
- that reproduce the bug
- e.g. cli arguments and flags

**Actual result:** Describe here what happens after you run the steps above (i.e. the buggy behaviour)
**Actual result:** Describe here what happens after you run the steps above (i.e. the buggy behavior)

**Expected result:** Describe here what should happen after you run the steps above (i.e. what would be the correct behaviour)
**Expected result:** Describe here what should happen after you run the steps above (i.e. what would be the correct behavior)

### Context (Environment)

Expand All @@ -35,7 +35,7 @@ Describe here the issue that you are experiencing.
- **phasar:** \[commit-id]
- **googletest:** \[commit-id]
- **json:** \[commit-id]
- **WALi-OpenNWA:** \[commit-id]
- **json-schema-validator** \[commit-id]

<!-- Which operating system are you using? -->

Expand All @@ -48,11 +48,12 @@ Describe here the issue that you are experiencing.

**Build Type:**
- [ ] cmake
- [ ] bootstrap.sh
- [ ] custom build

### Possible solution

We are happy to discuss possible solutions to this problem, especially if it origniates from a design flaw.
We are happy to discuss possible solutions to this problem, especially if it originates from a design flaw.

### Example files

Expand Down
28 changes: 13 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,25 @@ jobs:
matrix:
compiler: [ [clang++-14, clang-14] ]
build: [ Debug, Release ]
include:
- build: Debug
flags: -DPHASAR_BUILD_DYNLIB=ON -DPHASAR_ENABLE_SANITIZERS=ON
- build: Release
flags: -DPHASAR_ENABLE_DYNAMIC_LOG=OFF -DPHASAR_DEBUG_LIBDEPS=ON -DBUILD_SHARED_LIBS=ON

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

- name: Install Basic Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get -y install --no-install-recommends \
cmake \
ninja-build \
libstdc++6 \
libboost-all-dev
- name: Install Phasar Dependencies
shell: bash
run: |
./utils/InstallAptDependencies.sh
sudo apt-get -y install --no-install-recommends libboost-graph-dev
- name: Install Strategy Dependencies
shell: bash
Expand All @@ -55,19 +51,21 @@ jobs:
libclang-rt-14-dev
- uses: swift-actions/setup-swift@v1
with:
swift-version: "5.8.1"
- name: Building Phasar in ${{ matrix.build }} with ${{ matrix.compiler[0] }}
env:
BUILD_TYPE: ${{ matrix.build }}
CXX: ${{ matrix.compiler[0] }}
CC: ${{ matrix.compiler[1] }}
shell: bash
run: |
mkdir build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_CXX_COMPILER=$CXX \
-DBUILD_SWIFT_TESTS=1 \
-DCMAKE_BUILD_TYPE=${{ matrix.build }} \
-DBUILD_SWIFT_TESTS=ON \
-DPHASAR_USE_Z3=ON \
${{ matrix.flags }} \
-G Ninja
cmake --build .
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ bin/*
# build directories for cmake
build/
build_*/
build-*/

# LLVM project
llvm-project/*
Expand Down
34 changes: 20 additions & 14 deletions BreakingChanges.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
# Breaking Changes

## v2403

- Versioning scheme has been changed from `<month><year>` to `<year><month>`
- Default build mode is no longer `SHARED` but `STATIC`. To build in shared mode, use the cmake option `BUILD_SHARED_LIBS` which we don't recommend anymore. Consider using `PHASAR_BUILD_DYNLIB` instead to build one big libphasar.so.
- Build type `DebugSan` has been removed in favor of a new CMake option `PHASAR_ENABLE_SANITIZERS` that not only works in `Debug` mode.

## v0323

- `EdgeFunctionPtrType` is no longer a `std::shared_ptr`. Instead `EdgeFunction<l_t>` should be used directly. `EdgeFunction` is now a *value-type* that encapsulates its memory management by itself.
- Concrete `EdgeFunction` types no longer derive from any base-class. Instead they just need to implement the required API functions. `EdgeFunction` implementations should me move-constructible and can be implicitly cast to `EdgeFunction`. To verify that your type implements the edge function interface use the `IsEdgeFunction` type trait. The API functions have been changed as follows:
- All API functions of `EdgeFunction` must be `const` qualified.
- `EdgeFunctionPtrType composeWith(EdgeFunctionPtrType SecondFunction)` and `EdgeFunctionPtrType joinWith(EdgeFunctionPtrType OtherFunction)` have been changed to `static EdgeFunction<l_t> compose(EdgeFunctionRef<T> This, const EdgeFunction<l_t>& SecondFunction)` and `static EdgeFunction<l_t> join(EdgeFunctionRef<T> This, const EdgeFunction<l_t>& OtherFunction)` respectively. Here, the `This` parameter models the former `shared_from_this()`.
- `bool equal_to(EdgeFunctionPtrType Other)const` has been changed to `bool operator==(const T &Other)const noexcept`, where `T` is your concrete edge function type.
- `void print(llvm::raw_ostream &OS, bool IsForDebug)` has been changed to `friend llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const T& EF)`.
- All API functions of `EdgeFunction` must be `const` qualified.
- `EdgeFunctionPtrType composeWith(EdgeFunctionPtrType SecondFunction)` and `EdgeFunctionPtrType joinWith(EdgeFunctionPtrType OtherFunction)` have been changed to `static EdgeFunction<l_t> compose(EdgeFunctionRef<T> This, const EdgeFunction<l_t>& SecondFunction)` and `static EdgeFunction<l_t> join(EdgeFunctionRef<T> This, const EdgeFunction<l_t>& OtherFunction)` respectively. Here, the `This` parameter models the former `shared_from_this()`.
- `bool equal_to(EdgeFunctionPtrType Other)const` has been changed to `bool operator==(const T &Other)const noexcept`, where `T` is your concrete edge function type.
- `void print(llvm::raw_ostream &OS, bool IsForDebug)` has been changed to `friend llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const T& EF)`.
- `EdgeFunction` is tagged with `[[clang::trivial_abi]]`. Hence, you should not rely on any destruction order within a top-level statement that uses temporary `EdgeFunction` objects.
- `EdgeFunctionSingletonFactory` has been removed. Use `EdgeFunctionSingletonCache` instead.
- `TaintConfig` has been renamed to `LLVMTaintConfig`. For generic code you may want to use the LLVM-independent `TaintConfigBase` CRTP interface instead.
- Renamed `phasar/PhasarLLVM/DataFlowSolver/` to either `phasar/DataFlow/` or `phasar/PhasarLLVM/DataFlow/` depending on whether the components need LLVMCore. Analoguous changes in `lib/` and `unittests/`.
An incomplete list of moved/renamed files:
- `phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Solver/*` => `phasar/DataFlow/IfdsIde/Solver/*`
- `phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IDETabulationProblem.h` => `phasar/DataFlow/IfdsIde/IDETabulationProblem.h`
- `phasar/DB/LLVMProjectIRDB.h` => `phasar/PhasarLLVM/DB/LLVMProjectIRDB.h`
- ...
- `phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Solver/*` => `phasar/DataFlow/IfdsIde/Solver/*`
- `phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IDETabulationProblem.h` => `phasar/DataFlow/IfdsIde/IDETabulationProblem.h`
- `phasar/DB/LLVMProjectIRDB.h` => `phasar/PhasarLLVM/DB/LLVMProjectIRDB.h`
- ...
- Renamed and split up some libraries:
- `phasar_phasarllvm_utils` => `phasar_llvm_utils`
- `phasar_typehierarchy` => `phasar_llvm_typehierarchy`
- `phasar_ifdside` => `phasar_llvm_ifdside`
- `phasar_controlflow` has its LLVM dependent stuff moved to `phasar_llvm_controlflow`
- `phasar_db` has its LLVM dependent stuff moved to `phasar_llvm_db`
- `phasar_pointer` has its LLVM dependent stuff moved to `phasar_llvm_pointer`
- `phasar_phasarllvm_utils` => `phasar_llvm_utils`
- `phasar_typehierarchy` => `phasar_llvm_typehierarchy`
- `phasar_ifdside` => `phasar_llvm_ifdside`
- `phasar_controlflow` has its LLVM dependent stuff moved to `phasar_llvm_controlflow`
- `phasar_db` has its LLVM dependent stuff moved to `phasar_llvm_db`
- `phasar_pointer` has its LLVM dependent stuff moved to `phasar_llvm_pointer`
- Renamed the phasar tool `phasar-llvm` to `phasar-cli`
- `LLVMPointsTo[.*]` has been renamed to `LLVMAlias[.*]`
- The ctor of `LLVMAliasSet` now takes the `LLVMProjectIRDB` as pointer instead of a reference to better document that it may capture the IRDB by reference.
Expand Down
Loading

0 comments on commit bbf6229

Please sign in to comment.