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

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 19 02:54:25 PDT 2019

kadircet marked 2 inline comments as done.
kadircet 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);
ilya-biryukov wrote:
> 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?
yes it does

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list