[PATCH] D85753: [clangd] Discard diagnostics from another SourceManager.

Adam Czachorowski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 11 10:21:34 PDT 2020


adamcz added a reviewer: sammccall.
adamcz added a comment.

Hey Sam. What's your opinion on this?

The options we have are:

1. Drop the diagnostics, like this change is doing
2. Relocate the diagnostic to the beginning of the "real" main file, like we do with SourceManager-less diagnostics
3. Try to find the place where we import the module and relocate the diagnostic there

Right now this change is just an example of approach 1.  Not necessarily meant to be submitted as-is, since it silently drops possibly valuable diagnostics, although it does prevent a crash.

Option 3 sounds best, but it's very tricky. At the point HandleDiagnostic() is called, the module is not imported yet, so we would have to either delay the relocation until later or do some tricks with Preprocessor object (not sure how that would work).

Let me know what you think about this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85753/new/

https://reviews.llvm.org/D85753



More information about the cfe-commits mailing list