https://github.com/sel4/pruner
Tool for trimming functions from a C source file
https://github.com/sel4/pruner
Last synced: over 1 year ago
JSON representation
Tool for trimming functions from a C source file
- Host: GitHub
- URL: https://github.com/sel4/pruner
- Owner: seL4
- License: other
- Created: 2014-12-03T23:16:03.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2025-03-17T00:39:56.000Z (over 1 year ago)
- Last Synced: 2025-04-05T03:22:23.739Z (over 1 year ago)
- Language: C
- Size: 35.2 KB
- Stars: 2
- Watchers: 21
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Prune
This is a tool for removing excess functions from C code. It is possible to
dramatically reduce the runtime of the C parser and friends (and your
resulting find_theorems search space) by removing functions you are not
calling before parsing.
## Usage
You will need the libclang and glib headers available to build this. I have not
located a packaged version of libclang and LLVM that work together, so I
recommend you build these from source as described on the
[Clang getting started page](http://clang.llvm.org/get_started.html). I have
successfully built this tool using r207601 of all the LLVM pieces.
Run `prune --help` for options. For anything more, read the source code.
## Caveats
No attempt is made to automatically prune anything other than functions. Other
entities don't cost us much in parsing. If you do want to explicitly prune
other things you can use the `--blacklist` option.
Some tricky C is clever enough to even baffle Clang (e.g. seL4_IPCBuffer
alignment). Report anything serious, but minor issues like this will have to be
worked around yourself.
## Issues
Email Matthew Fernandez with questions or problems.