https://github.com/neomutt/iwyu
Include What You Use -- Optimise `#include`s
https://github.com/neomutt/iwyu
Last synced: about 1 year ago
JSON representation
Include What You Use -- Optimise `#include`s
- Host: GitHub
- URL: https://github.com/neomutt/iwyu
- Owner: neomutt
- Created: 2022-05-09T13:09:37.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-27T19:22:28.000Z (over 1 year ago)
- Last Synced: 2025-03-12T16:15:04.473Z (over 1 year ago)
- Language: Shell
- Size: 98.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Include What You Use
- [https://include-what-you-use.org/](https://include-what-you-use.org/)
**iwyu** is a tool for deciding which `#include`s are needed, or not.
Including the right files, and no more, can speed up builds.
It also helps to show the dependencies of a file.
**iwyu** uses [clang](https://clang.llvm.org/) to create an
[AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) for the code.
## Usage
Configure + build NeoMutt with a compilation database.
```sh
./configure --compile-commands && make
```
Then run the main script with the source you wish to check:
```sh
iwyu.sh mutt/*.[ch]
```
Or with all files in the compilation database:
```sh
tac compile_commands.json | sed '2 s/.$//' | tac | jq -r '.[] | .file' | xargs ../iwyu/bin/iwyu.sh
```
## Known Limitations
Out of nearly 300 header files, most are correctly handled.
The exceptions are the curses and ssl headers.