[PATCH] D64863: [clangd] Ignore diags from builtin files

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 18 01:32:09 PDT 2019


ilya-biryukov added inline comments.


================
Comment at: clang-tools-extra/clangd/Diagnostics.cpp:473
+  SourceManager &SM = Info.getSourceManager();
+  if (!InsideMainFile && SM.isWrittenInBuiltinFile(Info.getLocation())) {
+    IgnoreDiagnostics::log(DiagLevel, Info);
----------------
hokein wrote:
> ilya-biryukov wrote:
> > There is also at least `isWrittenInCommandLineFile` and `isWrittenInScratchSpace`.
> > We should probably handle both of them here too.
> > 
> > What are we actually checking here? That we can later create a URI for this file? Is there a good way to check exactly that without breaking layering?
> shall we put this into the `isInsideMainFile`? I think the location written in CommandLineFile/ScratchSpace is not inside main file logically.
> 
Very good point.
@kadircet does `isInsideMainFile` returns true for locations from command line or scratch-pad?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64863





More information about the cfe-commits mailing list