This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Always default to raw pch format
ClosedPublic

Authored by kadircet on May 13 2021, 9:57 AM.

Details

Summary

Clang would emit a fatal error when it encounters an unregistered PCH
format. This change ensures clangd will always use raw format no matter what
user specifies.

As side effects:

  • serializing an AST in an unknown format might throw off build

systems. I suppose this would only be an issue when build system and clangd are
racing for same PCM modules, hopefully this should be rare and both clangd or
the build system should recover on the next run.

  • whenever clang reads a serialized AST it seems to be checking for file

signature and emitting non-fatal errors. so this should be fine again.

The only other valid module format in clang is obj but it is part of codegen,
i don't think it is worth the dependency. Hence chosing to not register it, at
least yet.

Diff Detail

Event Timeline

kadircet created this revision.May 13 2021, 9:57 AM
kadircet requested review of this revision.May 13 2021, 9:57 AM
adamcz accepted this revision.May 14 2021, 7:31 AM
This revision is now accepted and ready to land.May 14 2021, 7:31 AM
This revision was automatically updated to reflect the committed changes.