This is an archive of the discontinued LLVM Phabricator instance.

[include-cleaner] Add a simple heuristic to handle token-pasting symbols.
Needs ReviewPublic

Authored by hokein on Aug 8 2023, 1:20 PM.

Details

Reviewers
kadircet
Summary

include-cleaner didn't report the usage of token-pasting symbols, as
these symbols are spelled in a "scratch space" file which is not a real
file, thus we have some false postives of unused includes for these
symbols (e.g. ABSL_FLAG).

This patch adds a simple heuristic to handle this case, we use the
expansion location as a "proxy" reference location, this should work
well on token-pasting formed from macro arguemtns.

Diff Detail

Event Timeline

hokein created this revision.Aug 8 2023, 1:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2023, 1:20 PM
hokein requested review of this revision.Aug 8 2023, 1:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2023, 1:20 PM