-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
532 changed files
with
12,996 additions
and
10,696 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
BasedOnStyle: LLVM | ||
SortIncludes: true | ||
IncludeBlocks: Regroup | ||
BreakStringLiterals: true | ||
IncludeCategories: | ||
- Regex: '^"phasar/' | ||
Priority: 1 | ||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/' | ||
Priority: 2 | ||
- Regex: '".*"' | ||
Priority: 3 | ||
- Regex: '<[[:alnum:]_]+>' | ||
Priority: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Breaking Changes | ||
|
||
## 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)`. | ||
- `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` | ||
- ... | ||
- 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` | ||
- 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. | ||
- The `PointsToInfo` interface has been replaced by the CRTP interface `AliasInfoBase`. Introduced two type-erased implementations of that interface: `AliasInfo` and `AliasInfoRef`. In most cases you should replace `PointsToInfo *` and `LLVMPointsToInfo *` by `AliasInfoRef`, bzw. `LLVMAliasInfoRef`. | ||
- Introduced a new interface `PointsToInfoBase` and type-erased implementations `PointstoInfo` and `PointsToInfoRef`. Don't confuse them with the old `PointsToInfo`!!! (However, they have different APIs, so you should encounter compilation errors then) | ||
|
||
## v1222 | ||
|
||
- Removed virtual interfaces `CFG<N,F>` and `ICFG<N,F>` and replaced by CRTP interfaces `CFGBase` and `ICFGBase`. Use the concrete types `LLVMBasedICFG` and `LLVMBasedCFG` instead. In template code you can use the type traits `is_crtp_base_of_v` and `is_icfg_v` to check for conformance to the interfaces. | ||
- The `LLVMBasedICFG` now takes the IRDB as pointer instead of a reference to better document that it may capture the IRDB by reference. | ||
- Renamed `ProjectIRDB` to `LLVMProjectIRDB` and added a generic CRTP interface `ProjectIRDBBase` that does not depend on LLVM | ||
- Changed the API of `LLVMProjectIRDB`: The IRDB does no longer link multiple LLVM modules together, i.e. the ctor that reads a module from a file now takes a single filename instead of a vector. If you still want to link multiple LLVM modules together, use LLVM's Linker functionality instead. `ProjecIRDB::getAllModules()` has been removed and `ProjectIRDB::getWPAModule()` has been renamed to `LLVMProjectIRDB::getModule()`. | ||
- The `LLVMProjectIRDB` ctor that takes a raw-pointer to `llvm::Module` does no longer preprocess the module (i.e. attaching metadata IDs to it). You can still explicitly use the `ValueAnnotationPass` to do so manually. | ||
- The type `WholeProgramAnalysis` has been removed. Use `AnalysisController` instead. | ||
- The IFDS and IDE TabulationProblems no longer take all of `LLVMProjectIRDB*`, `LLVMTypeHierarchy*`, `LLVMPointsToInfo*` and `LLVMBasedICFG*` as an argument. Instead, they only get what they need. | ||
- The `IFDSSolver` and `IDESolver` now take an instance of the `ICFGBase` interface as additional argument to their ctor (because the analysis problems now not necessarily store a reference to it anymore). | ||
- The `IDETabulationProblem` is now a base class of `IFDSTabulationProblem` (and not vice versa as it was previously). In their ctors they only take the bare minimum of arguments: The IRDB, the entrypoints and optionally the special zero-value. If the zero-value is not passed in the ctor (as it was previously), it has to be set from within the client analysis' ctor. You may use the new function `initializeZeroValue(d_t)` for this. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,12 @@ 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/) | ||
[![GitHub license](https://img.shields.io/badge/license-MIT-blueviolet.svg)](https://raw.githubusercontent.com/secure-software-engineering/phasar/master/LICENSE.txt) | ||
|
||
Version 1222 | ||
Version 0323 | ||
|
||
Secure Software Engineering Group | ||
--------------------------------- | ||
|
||
+ Philipp Dominik Schubert ([email protected]) and others | ||
+ Fabian Schiebel ([email protected]), Martin Mory ([email protected]), Philipp Dominik Schubert ([email protected]) and others | ||
+ Please also refer to https://phasar.org/ | ||
|
||
Required version of the C++ standard | ||
|
@@ -30,9 +30,13 @@ fully-automated manner on the specified LLVM IR target code. Computing points-to | |
information, call-graph(s), etc. is done by the framework, thus you can focus on | ||
what matters. | ||
|
||
Breaking Changes | ||
---------------- | ||
To keep PhASAR in a state that it is well suited for state-of-the-art research in static analysis, as well as for productive use, we have to make breaking changes. Please refer to [Breaking Changes](./BreakingChanges.md) for detailed information on what was broken recently and how to migrate. | ||
|
||
How do I get started with PhASAR? | ||
--------------------------------- | ||
We have some documentation on PhASAR in our [_**wiki**_](https://github.com/secure-software-engineering/phasar/wiki). You probably would like to read | ||
We have some documentation on PhASAR in our [_**Wiki**_](https://github.com/secure-software-engineering/phasar/wiki). You probably would like to read | ||
this README first and then have a look on the material provided on https://phasar.org/ | ||
as well. Please also have a look on PhASAR's project directory and notice the project directory | ||
examples/ as well as the custom tool tools/myphasartool.cpp. | ||
|
@@ -45,6 +49,21 @@ prerequisites and compilation. It is recommended to compile PhASAR yourself in | |
order to get the full C++ experience and to have full control over the build | ||
mode. | ||
|
||
As a shortcut for the very first PhASAR build on your system, you can use our [bootstrap](./bootstrap.sh) script: | ||
|
||
```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). | ||
|
||
Please help us to improve PhASAR | ||
-------------------------------- | ||
You are using PhASAR and would like to help us in the future? Then please | ||
|
@@ -65,10 +84,12 @@ 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: | ||
``` | ||
$ sudo ./bootstrap.sh | ||
```bash | ||
$ ./bootstrap.sh --install | ||
``` | ||
|
||
The bootstrap script may ask for superuser permissions. | ||
|
||
Done! | ||
|
||
|
||
|
@@ -86,8 +107,7 @@ $ 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: | ||
|
||
``` | ||
$ git submodule init | ||
$ git submodule update | ||
$ 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: | ||
|
@@ -101,27 +121,25 @@ Navigate into the PhASAR directory. The following commands will do the job and c | |
``` | ||
$ mkdir build | ||
$ cd build/ | ||
$ cmake -DCMAKE_BUILD_TYPE=Release .. | ||
$ make -j $(nproc) # or use a different number of cores to compile it | ||
$ sudo make install # if you wish to install PhASAR system wide | ||
$ 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/ directory: | ||
|
||
+ phasar-llvm - the actual PhASAR command-line tool | ||
+ phasar-cli - the actual PhASAR command-line tool (previously called `phasar-llvm`) | ||
+ myphasartool - an example tool that shows how tools can be build on top of PhASAR | ||
|
||
Use the command: | ||
|
||
`$ ./phasar-llvm --help` | ||
`$ ./phasar-cli --help` | ||
|
||
in order to display the manual and help message. | ||
|
||
`$ sudo make install` | ||
|
||
Please be careful and check if errors occur during the compilation. | ||
|
||
When using CMake to compile PhASAR the following optional parameters can be used: | ||
|
@@ -130,7 +148,8 @@ When using CMake to compile PhASAR the following optional parameters can be used | |
|-----------|--------| | ||
| <b>BUILD_SHARED_LIBS</b> : BOOL | Build shared libraries (default is ON) | | ||
| <b>CMAKE_BUILD_TYPE</b> : STRING | Build PhASAR in 'Debug' or 'Release' mode <br> (default is 'Debug') | | ||
| <b>CMAKE_INSTALL_PREFIX</b> : PATH | Path where PhASAR will be installed if <br> “make install” is invoked or the “install” <br> target is built (default is /usr/local/phasar) | | ||
| <b>CMAKE_INSTALL_PREFIX</b> : PATH | Path where PhASAR will be installed if <br> "ninja install” is invoked or the “install” <br> target is built (default is /usr/local/phasar) | | ||
| <b>PHASAR_CONFIG_INSTALL_PREFIX</b> : PATH | Path where PhASAR's configuration files will be installed if <br> ninja install” is invoked or the “install” <br> target is built. Expression will be evaluated within CMAKE_INSTALL_PREFIX, so prefer absolute paths (default is $(HOME)/.config/) | | ||
| <b>PHASAR_BUILD_DOC</b> : BOOL | Build PhASAR documentation (default is OFF) | | ||
| <b>PHASAR_BUILD_UNITTESTS</b> : BOOL | Build PhASAR unit tests (default is ON) | | ||
| <b>PHASAR_BUILD_IR</b> : BOOL | Build PhASAR IR (required for running the unit tests) (default is ON) | | ||
|
@@ -148,7 +167,7 @@ C++'s long compile times are always a pain. As shown in the above, when using cm | |
### Running a test solver | ||
To test if everything works as expected please run the following command: | ||
|
||
`$ phasar-llvm --module test/build_systems_tests/installation_tests/module.ll -D ifds-solvertest` | ||
`$ phasar-cli -m test/build_systems_tests/installation_tests/module.ll -D ifds-solvertest` | ||
|
||
If you obtain output other than a segmentation fault or an exception terminating the program abnormally everything works as expected. | ||
|
||
|
Oops, something went wrong.