Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelsamenezes committed Jul 1, 2024
1 parent a4b7b4f commit 005dda7
Showing 1 changed file with 55 additions and 21 deletions.
76 changes: 55 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
# C-instrumentator
A C instrumentation library

# Building

## Ubuntu
# Loop Unroller

- Install dependencies: `sudo apt-get install clang llvm clang-tidy git linux-libc-dev libclang-dev libclang-cpp-dev cmake build-essential`
- Configure: `mkdir build && cd build && cmake .. -DBUILD_TESTING=1 -DClang_DIR=/usr/lib/cmake/clang-14 -DLLVM_DIR=/usr/lib/llvm-14/lib/cmake/llvm`
- Build: `make -j4`
Applies a unrolling of loops of static bounds in-source. Currently it only supports: for-loops, </<=/>/>= operators, ++/-- increments.

## macOS

- Install dependencies: `brew install llvm@16`
- Configure: `mkdir build && cd build && cmake .. -DBUILD_TESTING=1 -DLLVM_DIR=/opt/homebrew/opt/llvm@14 -DClang_DIR=/opt/homebrew/opt/llvm@14`
- Build: `make -j4`

# Project Structure
```c
int main() { int a; for (int i = 3; i > 1; i--) a++; return 0; }
```
The project is structured as follows:
is transformed into
- `.github`: Actions scripts
- `include`: Header files
- `src`: Library files
- `unit`: Unit tests
```c
int main() {
int a;
int i = 3;
{
a++;
# Dependencies
i--;
}
{
a++;
I want to keep the dependencies at a minimum. So far, the required dependencies are:
i--;
}
- LLVM/Clang > 11
- fmt
return 0;
}
```

Please, avoid adding dependencies. The idea is for this to be used as a library.
To run, just invoke `./loop-unroller input.c output.c`. This requires `clang-format` to be on path.

# Goal Injector

Expand All @@ -58,3 +59,36 @@ int main() {__ESBMC_assert(0, "0");
return 0;
})";
```

# Building

## Ubuntu

- Install dependencies: `sudo apt-get install clang llvm clang-tidy git linux-libc-dev libclang-dev libclang-cpp-dev cmake build-essential`
- Configure: `mkdir build && cd build && cmake .. -DBUILD_TESTING=1 -DClang_DIR=/usr/lib/cmake/clang-14 -DLLVM_DIR=/usr/lib/llvm-14/lib/cmake/llvm`
- Build: `make -j4`

## macOS

- Install dependencies: `brew install llvm@16`
- Configure: `mkdir build && cd build && cmake .. -DBUILD_TESTING=1 -DLLVM_DIR=/opt/homebrew/opt/llvm@14 -DClang_DIR=/opt/homebrew/opt/llvm@14`
- Build: `make -j4`

# Project Structure

The project is structured as follows:

- `.github`: Actions scripts
- `include`: Header files
- `src`: Library files
- `unit`: Unit tests

# Dependencies

I want to keep the dependencies at a minimum. So far, the required dependencies are:

- LLVM/Clang > 11
- fmt
- clang-format

Please, avoid adding dependencies. The idea is for this to be used as a library.

0 comments on commit 005dda7

Please sign in to comment.