Include What You Use Versions Save

A tool for use with clang to analyze #includes in C and C++ source files

0.22

1 month ago

Compatible with Clang 18.

Major changes:

  • [iwyu] Improve type analysis for typedefs, aliases and templates
  • [iwyu] Improve analysis of macros expanding macros
  • [iwyu] Improve IWYU driver for better validation and job handling
  • [iwyu] Reject IWYU invocations with precompiled headers (see FAQ)
  • [iwyu_tool] Better preserve failure exit codes
  • [mappings] Add mappings for libstdc++ <debug/...> headers
  • [mappings] Make mappings for POSIX and standard C headers stricter (more portable)
  • [doc] Add separate FAQ page for longer descriptions
  • [ci] IWYU now runs on itself in CI (finally!)

... and many smaller improvements

0.21

5 months ago

Compatible with Clang 17.

Major changes:

  • [iwyu] Improve analysis of type aliases (typedef and using)
  • [iwyu] Improve analysis of namespace aliases (namespace xyz = foobar)
  • [iwyu] Improve support for elaborated forward declarations (typedef struct Foo Bar;)
  • [iwyu] Improve handling of "autocast" and function return types, particularly with complex template types.
  • [iwyu] Add new IWYU pragma: always_keep, which lets a header announce that it should always be kept wherever included
  • [iwyu] Automatically use builtin libc++ mappings if libc++ is the active standard library
  • [mappings] Improve mappings for libc++ and posix headers

... and many smaller improvements

0.20

1 year ago
  • [iwyu] Support IWYU pragma: export for forward-declarations
  • [iwyu] Silently break cycles in mappings instead of crashing
  • [iwyu] Require full type inside typeid()
  • [iwyu] Improve template reporting and resugaring
  • [iwyu] Improve reporting of explicit template instantiations
  • [iwyu] Fix a few crashers
  • [iwyu] Improve logging (many small fixes)
  • Abandon python2 for scripts in favor of python3

0.19

1 year ago

Compatible with Clang 15.

  • [iwyu] New --comment_style option to control verbosity of 'why' comments
  • [iwyu] New --regex option to select regex dialect
  • [iwyu] Add support for regex replacement in mappings
  • [iwyu] Add begin_keep/end_keep pragmas for protecting ranges of includes or forward-declares
  • [iwyu] Fix several crasher bugs for unusual inputs
  • [iwyu] More exhaustive handling of type aliases and enums
  • [iwyu] Recognize IWYU pragmas in CRLF source files
  • [iwyu] Respect configured toolchain on macOS (and overrides via -nostdinc++ + -isystem)
  • [fix_includes] Recognize namespace alias declarations
  • [mappings] Improve mappings for POSIX and libc headers
  • [cmake] Build now requires a C++17 compiler (as does LLVM)
  • [cmake] Support LLVM external project build (see README)

... and many other changes

0.18

2 years ago
  • [iwyu] Fix crash on C++20 consteval expressions
  • [iwyu] Use more conventional exit codes (breaking change!)
  • [iwyu_tool] Fix deprecation warning for python3
  • [iwyu] Fix crash on va_list on AArch64
  • [iwyu] Improved support for using declarations based on new Clang design

Note the breaking change for exit codes; IWYU now always returns zero by default. See the README or help text for more information about compatibility overrides.

0.17

2 years ago
  • [iwyu] Improve support for various C++ features (builtins, CTAD, specializations, type aliases)
  • [iwyu] Fix crash on invalid code
  • [iwyu] Remove hard dependency on x86 LLVM target
  • [mappings] Improve mappings for GNU libc
  • [iwyu_tool] More concise output for clang output format

0.16

2 years ago
  • [iwyu_tool] Accept --load/-l argument for load limiting
  • [iwyu_tool] Signal success/failure with exit code
  • [mappings] Harmonize mapping generators
  • [mappings] Add mapping generator for CPython
  • [mappings] Improve mappings for libstdc++ and Boost
  • [cmake] Add explicit C++14 compiler flag
  • ... and many internal improvements

0.15

3 years ago
  • [iwyu] Fix crash due to undefined behavior in AST traversal
  • [iwyu] Improve handling of operator new including C++17 features
  • [iwyu] Improve handling of templates
  • [iwyu_tool] Remove known compiler wrappers from the command list
  • [mappings] Improve Qt mapping generator
  • [mappings] Improve boost mappings
  • [mappings] Improve built-in mappings for <time.h>
  • [mappings] Add built-in mappings for max_align_t, ptrdiff_t, and wchar_t
  • [cmake] Support shared LLVM/Clang libraries and other improvements

0.14

3 years ago
  • [iwyu] Report non-builtin enum base types
  • [iwyu] Disable forward-declares for decls in inline namespaces
  • [iwyu] Make C structs forward-declarable again
  • [iwyu] Always keep Qt .moc includes
  • [iwyu] Include binary type traits in analysis (e.g. __is_convertible_to)
  • [iwyu_tool] Fail fast if include-what-you-use is not found
  • [iwyu_tool] Print all diagnostic ouptut to stderr
  • [fix_includes] Improve file extension detection
  • Add man page for include-what-you-use

0.13

3 years ago
  • [iwyu] Improved handling of relative includes in mappings and pragmas
  • [iwyu] Path normalization now collapses ..
  • [iwyu] Improve --no_fwd_decls not to remove required forward declarations
  • [iwyu] Improved handling of builtin templates
  • [iwyu] Don't mark forward declarations final
  • [iwyu] Tolerate using declarations in precompiled header
  • [mappings] Add script to generate Qt mappings, and new mappings for Qt 5.11
  • [iwyu_tool] Use directory from compilation database if available
  • Numerous documentation and build improvements