[clang-tools-extra] [clang-tools-extra] Add include mappings for getopt.h (PR #140726)
Daan De Meyer via cfe-commits
cfe-commits at lists.llvm.org
Wed May 21 01:53:37 PDT 2025
DaanDeMeyer wrote:
> unfortunately neither is used by include-cleaner. we only support mappings for c++ STL, through https://github.com/llvm/llvm-project/blob/main/clang/lib/Tooling/Inclusions/Stdlib/StdSymbolMap.inc and friends.
>
> we didn't want to add any system specific libraries, especially based on file path mappings, because some of these are platform-specific and dependent on the version of the library. Hence we were worried about accuracy.
>
> you can use `-ignore-headers` to prevent analysis for such headers (e.g. `-ignore-headers=/usr/lib/.*`), or we might actually be more clever in include-cleaner and try to disable these based on system-headerness of a header, but that's also a losing battle since people can have various include search paths in their command line.
>
> (still happy to land this once you ack the message though, as it should be an improvement for other tools)
Sure, makes sense to me, but yeah, this will still be useful for other tools, so feel free to land.
https://github.com/llvm/llvm-project/pull/140726
More information about the cfe-commits
mailing list