Commit cb89646a authored by Kadir Cetinkaya's avatar Kadir Cetinkaya Committed by Sam McCall
Browse files

[clangd] Filter pch related flags coming from the user

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

Reviewers: sammccall

Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D79669

(cherry picked from commit 35d867a7)

Dropped the test as it depends on nontrivial changes from master.
The code is very simple and identical to that tested on master.

Fixes https://github.com/clangd/clangd/issues/419
parent 357e79c2
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment