An open API service indexing awesome lists of open source software.

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

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.