[clangd] Initial clang-tidy diagnostics support.
authorSam McCall <sam.mccall@gmail.com>
Fri, 16 Nov 2018 08:32:23 +0000 (08:32 +0000)
committerSam McCall <sam.mccall@gmail.com>
Fri, 16 Nov 2018 08:32:23 +0000 (08:32 +0000)
commit98ae975187c75ad17a1fdc3e82a844e9ae3f5c84
tree7dc086e5ff20ad98bdb706832aecbe576d256864
parent9982e3b944b26db1e43af1b0a25848c1a3f416df
[clangd] Initial clang-tidy diagnostics support.

Summary:
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

This depends on a patch allowing traversal to be restricted to a scope.

Reviewers: hokein

Subscribers: srhines, mgorny, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Differential Revision: https://reviews.llvm.org/D54204

llvm-svn: 347036
clang-tools-extra/clangd/CMakeLists.txt
clang-tools-extra/clangd/ClangdUnit.cpp
clang-tools-extra/clangd/XRefs.cpp
clang-tools-extra/unittests/clangd/ClangdUnitTests.cpp