This is an archive of the discontinued LLVM Phabricator instance.

[PCH] Add an option to not write comments into PCH
ClosedPublic

Authored by ilya-biryukov on Jul 4 2018, 8:26 AM.

Details

Summary

Will be used in clangd, see the follow-up change.
Clangd does not use comments read from PCH to avoid crashes due to
changed contents of the file. However, reading them considerably slows
down code completion on files with large preambles.

Diff Detail

Repository
rC Clang

Event Timeline

ilya-biryukov created this revision.Jul 4 2018, 8:26 AM

Not sure about two things:

  • Using PreprocessorOptions for plumbing this setting. I'd rather put it into FrontendOptions, but there seems to be no way to get those in the ASTWriter... Happy to search for the alternatives
  • Lack of tests. I'm not sure how to properly test it in clang. I've added asserts in clangd, see the follow-up D48943. But happy to look into writing actual tests if that looks important.

Also not sure if someone else should look at this change, suggestions for reviewers are very welcome!

sammccall accepted this revision.Jul 5 2018, 12:59 AM
This revision is now accepted and ready to land.Jul 5 2018, 12:59 AM
This revision was automatically updated to reflect the committed changes.