# Thesis-Metadata-Evaluation

This repo contains all repos that I worked on during my master thesis.
With this repo it is possible to reproduce my results for the infinitime-project
in my master thesis.

## Setup

After cloning you can run the build script `./build.sh`.
This script will build all projects and runs the evaluation on the infinitime-project.

## Evaluation

To run the evaluation again go to the directory with the already build infinitime-project:
`cd master-thesis-evaluation/SVF-example-master/`

In this directory you can run the evaluation, which compares the results of the ARA-algorithm (baseline)
with the results of my implementation:
`./src/svf-example infinitime-app-0.15.0.ll`

This will generate a `.json` file, which contains for each function the amount of created edges.
You can execute the python script in the `master-thesis-evaluation/stats` directory to print out
a summary of the results:
`cd ../stats/
python3 stats.py`

## Repos

In the following is a list of all repos used in this repo.
Every repo except the LLVM repo also contains a `eval` branch which changes the path
variables to the correct llvm build directory and svf build directory for this repo.

### LLVM
https://github.com/DaveMichaelson/llvm-project

The branch `emit-stmt-attrs` contains my changes for `clang` for version 19.
The branch `release/16.x` contains my changes for `clang` for version 16.

### Plugin
https://github.com/DaveMichaelson/metadata-transfer-plugin

This repo contains my plugin which attributes AST nodes with information about
the inheritance hierarchy, macros and pointer types.

The `main` branch is for llvm-version 19.
The branch `16-llvm` is for llvm-version 16.

### SVF
https://github.com/DaveMichaelson/SVF

The branch `adjusted_master` is my adjusted version of the SVF-analysis.
It reads the metadata generated by my plugin and restores the inheritance hierarchy
and also restores the pointer type information for functions and function calls.

### Evaluation
https://gitlab.uni-hannover.de/davidseehaus/master-thesis-evaluation

This repo conatins the code for the evaluation. Its execute the ARA algorithm and compares it
to my algorithm. And its also provide a python script to summarize the results.
There is also a compile script (`SVF-example-master`) to compile `.cpp` with the plugin.