[clang-tools-extra] [clang-include-cleaner] Add --mapping-file support for IWYU .imp mapping files. (PR #195987)

Kim Gräsman via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 3 05:27:15 PDT 2026


kimgr wrote:

In general this looks very nice and clean!

I'm not sure how much stability we can promise from the IWYU project, we're trying to extend our mapping format with various features (mappings conditioned on environment features, differentiation between macros and functions, etc, etc). While we would like to avoid burning our own users by breaking the format, it's a case-by-case tradeoff.

One alternative approach might be for you to invent your own mapping format, and build a simple translator from the IWYU .imp to this more neutral and perhaps more well-engineered format. The .imp format mostly just fell out of the implementation of IWYU's internal mappings from way back when.

But if you're fine with playing catch-up with us, I think this should benefit users.

https://github.com/llvm/llvm-project/pull/195987


More information about the cfe-commits mailing list