This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Filter pch related flags coming from the user
ClosedPublic

Authored by kadircet on May 9 2020, 3:37 AM.

Details

Summary

PCH format is unstable, hence using a preamble built with a different
version of clang (or even worse, a different compiler) might result in
unexpected behaviour.

PCH creation on the other hand is something clangd wouldn't want to perform, as
it doesn't generate any output files.

This patch makes sure clangd drops any PCH related compile commands after
parsing the command line args.

Fixes https://github.com/clangd/clangd/issues/248

Diff Detail

Event Timeline

kadircet created this revision.May 9 2020, 3:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2020, 3:37 AM
sammccall accepted this revision.May 9 2020, 4:46 AM

Thanks!

This revision is now accepted and ready to land.May 9 2020, 4:46 AM
This revision was automatically updated to reflect the committed changes.