include-what-you-use

Analyze #includes in C and C++ source files to find unnecessary dependencies

brewmacoslinux
Try with needOr install directly
Source

About

Tool to analyze #includes in C and C++ source files

Commands

include-what-you-use

Examples

Analyze a single C++ source file$ include-what-you-use myfile.cpp
Analyze with specific C++ standard and include paths$ include-what-you-use -std=c++17 -I/usr/include myfile.cpp
Analyze multiple files and show mapping suggestions$ include-what-you-use -Xiwyu --mapping_file=map.imp file1.cpp file2.cpp