4 Commits

Author SHA1 Message Date
kadir çetinkaya
7e3fb372b0
[include-cleaner] Check emptiness instead of occurences (#79154)
Our internal integration relies on injecting some default values to
ignore/keep lists.
That means we can have filters, despite of not having occurences
for the flag.
2024-01-24 07:26:00 +01:00
Sam McCall
3de5d8e125
[include-cleaner] Add --only-headers flag, opposite of --ignore-headers (#78714) 2024-01-22 16:03:37 +01:00
Haojian Wu
507d766d76 [include-cleaner] Add an IgnoreHeaders flag to the command-line tool.
Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D153340
2023-07-06 11:18:44 +02:00
Sam McCall
1a8dd74258 [include-cleaner] clang-include-cleaner can print/apply edits
This adds command-line flags to the tool:
+ -print: prints changed source code
+ -print=changes: prints headers added/removed
+ -edit: rewrites code in place
+ -insert=0/-remove=0: disables additions/deletions for the above

These are supported by a couple of new functions dumped into Analysis:
analyze() sits on top of walkUsed and makes used/unused decisions for
Includes. fixIncludes() applies those results to source code.

Differential Revision: https://reviews.llvm.org/D139013
2022-12-02 13:16:58 +01:00