This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Respect IWYU keep pragma for standard headers.
ClosedPublic

Authored by hokein on Jul 31 2023, 12:24 AM.

Diff Detail

Event Timeline

hokein created this revision.Jul 31 2023, 12:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 31 2023, 12:24 AM
Herald added a subscriber: arphaman. · View Herald Transcript
hokein requested review of this revision.Jul 31 2023, 12:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 31 2023, 12:24 AM
kadircet accepted this revision.Jul 31 2023, 1:50 AM

thanks!

clang-tools-extra/clangd/IncludeCleaner.cpp
86–87

can you unify this and the previous check and just have a single:

if (PI && PI->shouldKeep(Inc.HashLine + 1))
  return false;

at the top of the function?

This revision is now accepted and ready to land.Jul 31 2023, 1:50 AM

also we should get this cherry-picked too. keep pragmas on includes are not common, but people do have export pragmas often enough to cause some annoyance here.

hokein updated this revision to Diff 545589.Jul 31 2023, 4:23 AM
hokein marked an inline comment as done.

address review comment

This revision was landed with ongoing or failed builds.Jul 31 2023, 4:24 AM
This revision was automatically updated to reflect the committed changes.

also we should get this cherry-picked too. keep pragmas on includes are not common, but people do have export pragmas often enough to cause some annoyance here.

Filed https://github.com/llvm/llvm-project/issues/64260.