This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Include Cleaner: suppress unused warnings for IWYU pragma: export
ClosedPublic

Authored by kbobyrev on Apr 21 2022, 6:53 AM.

Details

Summary

Add limited support for "IWYU pragma: export" - for now it just supresses the
warning similar to "IWYU pragma: keep".

Diff Detail

Event Timeline

kbobyrev created this revision.Apr 21 2022, 6:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2022, 6:53 AM
kbobyrev requested review of this revision.Apr 21 2022, 6:53 AM
kbobyrev updated this revision to Diff 424189.Apr 21 2022, 6:57 AM

Use strlen for performance.

sammccall accepted this revision.Apr 21 2022, 7:16 AM
sammccall added inline comments.
clang-tools-extra/clangd/Headers.cpp
26

or just drop to IWYUPragma and hardcode "keep" and "export" at the sites? up to you

151

why not just if (!Text.consume_front(IWYUPragmaKeep) && !Text.consume_front(IWYUPragmaExport))?

strlen makes me wary and also seems more verbose

This revision is now accepted and ready to land.Apr 21 2022, 7:16 AM
kbobyrev updated this revision to Diff 424205.Apr 21 2022, 7:59 AM
kbobyrev marked an inline comment as done.

Resolve comment.

This revision was landed with ongoing or failed builds.Apr 21 2022, 8:00 AM
This revision was automatically updated to reflect the committed changes.