[PATCH] D75286: [clangd] Handle clang-tidy suppression comments for diagnostics inside macro expansions

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 5 13:44:43 PST 2020


nridge marked an inline comment as done.
nridge added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h:215
 /// to this function.
-/// The `CheckMacroExpansion` parameter determines whether the function should
-/// handle the case where the diagnostic is inside a macro expansion. A degree
-/// of control over this is needed because handling this case can require
-/// examining source files other than the one in which the diagnostic is
-/// located, and in some use cases we cannot rely on such other files being
-/// mapped in the SourceMapper.
+/// If a valid FileID is passed as `FileFilter`, the function does not attempt
+/// to read source files other than the one identified by the filter. A degree
----------------
sammccall wrote:
> I do wonder a how hard it would be to approach this more directly: (conditionally )use some API for pulling code out of the SourceManager that *won't* silently do IO.
> ContentCache::getRawBuffer() or something?
> 
> Up to you whether to look at this at all of course, this approach is better than what we have now.
I gave this a try in the updated patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75286





More information about the cfe-commits mailing list