summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/ClangdUnit.h
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2019-01-22 09:39:05 +0000
committerHaojian Wu <hokein@google.com>2019-01-22 09:39:05 +0000
commit1ca0c58c8152ecfb2a47f91080b64eae7710dadb (patch)
treecf967fe3f5caa6c4745dbf4a404a55b015d85cc5 /clang-tools-extra/clangd/ClangdUnit.h
parentbd374b27cc33567b0a0522ee511fc1ea9f0bb1df (diff)
downloadbcm5719-llvm-1ca0c58c8152ecfb2a47f91080b64eae7710dadb.tar.gz
bcm5719-llvm-1ca0c58c8152ecfb2a47f91080b64eae7710dadb.zip
[clangd] Support clang-tidy configuration in clangd.
Summary: This patch adds some basic supports for clang-tidy configurations in clangd: - clangd will respect .clang-tidy configurations for each file - we don't aim to support all clang-tidy options in clangd, only a small subset of condfigurations (options related to which checks will be enabled) are supported. - add a `clang-tidy-checks` CLI option that can override options from .clang-tidy file Reviewers: ilya-biryukov, sammccall Reviewed By: sammccall Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55256 llvm-svn: 351792
Diffstat (limited to 'clang-tools-extra/clangd/ClangdUnit.h')
-rw-r--r--clang-tools-extra/clangd/ClangdUnit.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang-tools-extra/clangd/ClangdUnit.h b/clang-tools-extra/clangd/ClangdUnit.h
index abcefdb6bf6..3a4841d7080 100644
--- a/clang-tools-extra/clangd/ClangdUnit.h
+++ b/clang-tools-extra/clangd/ClangdUnit.h
@@ -9,6 +9,7 @@
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDUNIT_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDUNIT_H
+#include "../clang-tidy/ClangTidyOptions.h"
#include "Diagnostics.h"
#include "FS.h"
#include "Function.h"
@@ -64,6 +65,7 @@ struct ParseInputs {
tooling::CompileCommand CompileCommand;
IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS;
std::string Contents;
+ tidy::ClangTidyOptions ClangTidyOpts;
};
/// Stores and provides access to parsed AST.
@@ -76,7 +78,8 @@ public:
std::shared_ptr<const PreambleData> Preamble,
std::unique_ptr<llvm::MemoryBuffer> Buffer,
std::shared_ptr<PCHContainerOperations> PCHs,
- IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS);
+ IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
+ const tidy::ClangTidyOptions &ClangTidyOpts);
ParsedAST(ParsedAST &&Other);
ParsedAST &operator=(ParsedAST &&Other);
OpenPOWER on IntegriCloud