blob: 0586525228b7c43ce846a72874e23fe9b959f744 [file] [log] [blame]
Daniel Jasperd07c8402013-07-29 08:19:24 +00001//===--- LLVMTidyModule.cpp - clang-tidy ----------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
Daniel Jasperd07c8402013-07-29 08:19:24 +000010#include "../ClangTidy.h"
11#include "../ClangTidyModule.h"
12#include "../ClangTidyModuleRegistry.h"
Alexander Kornienkobef51cd2014-05-19 16:39:08 +000013#include "IncludeOrderCheck.h"
14#include "NamespaceCommentCheck.h"
Benjamin Kramer190e2cf2014-07-08 14:32:17 +000015#include "TwineLocalCheck.h"
Daniel Jasperd07c8402013-07-29 08:19:24 +000016
17namespace clang {
18namespace tidy {
19
Daniel Jasperd07c8402013-07-29 08:19:24 +000020class LLVMModule : public ClangTidyModule {
21public:
Alexander Kornienko21f3b772014-03-05 13:01:24 +000022 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
Daniel Jasperd07c8402013-07-29 08:19:24 +000023 CheckFactories.addCheckFactory(
24 "llvm-include-order", new ClangTidyCheckFactory<IncludeOrderCheck>());
25 CheckFactories.addCheckFactory(
26 "llvm-namespace-comment",
27 new ClangTidyCheckFactory<NamespaceCommentCheck>());
Benjamin Kramer190e2cf2014-07-08 14:32:17 +000028 CheckFactories.addCheckFactory(
29 "llvm-twine-local",
30 new ClangTidyCheckFactory<TwineLocalCheck>());
Daniel Jasperd07c8402013-07-29 08:19:24 +000031 }
32};
33
34// Register the LLVMTidyModule using this statically initialized variable.
35static ClangTidyModuleRegistry::Add<LLVMModule> X("llvm-module",
36 "Adds LLVM lint checks.");
37
38// This anchor is used to force the linker to link in the generated object file
39// and thus register the LLVMModule.
40volatile int LLVMModuleAnchorSource = 0;
41
42} // namespace tidy
43} // namespace clang