[PATCH] D54204: [clangd] Initial clang-tidy diagnostics support.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 7 06:02:11 PST 2018


sammccall created this revision.
sammccall added a reviewer: hokein.
Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov, mgorny, srhines.

This runs checks over a restricted subset of the TU:

- preprocessor callbacks just receive the truncated PP events that occur when a preamble is used.
- ASTMatchers run only over the top-level decls in the main-file

This patch just turns on one simple check (bugprone-sizeof-expression)
with no configuration.

- configuration is complex enough to warrant a separate patch
- arbitrary checks don't work well yet - there are various ways that checks can access the whole AST (and thus be incredibly slow). Most notably: the hasAncestor matcher, and using the ASTContext from check().

This depends on a small patch to ASTMatchers to run a MatchFinder on a
certain set of top-level declarations.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D54204

Files:
  clangd/CMakeLists.txt
  clangd/ClangdUnit.cpp
  unittests/clangd/ClangdUnitTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54204.172937.patch
Type: text/x-patch
Size: 6302 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181107/f6a11d7c/attachment-0001.bin>


More information about the cfe-commits mailing list