Skip to content
/ iwyu Public

Include What You Use -- Optimise `#include`s

Notifications You must be signed in to change notification settings

neomutt/iwyu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Include What You Use

iwyu is a tool for deciding which #includes 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 to create an AST for the code.

Usage

Configure + build NeoMutt with a compilation database.

./configure --compile-commands && make

Then run the main script with the source you wish to check:

iwyu.sh mutt/*.[ch]

Or with all files in the compilation database:

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.