blob: 31a114eeebddab374f59acaf3b663bbb52d1cce2 [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"
Daniel Jasperd07c8402013-07-29 08:19:24 +000015
16namespace clang {
17namespace tidy {
18
Daniel Jasperd07c8402013-07-29 08:19:24 +000019class LLVMModule : public ClangTidyModule {
20public:
Alexander Kornienko21f3b772014-03-05 13:01:24 +000021 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
Daniel Jasperd07c8402013-07-29 08:19:24 +000022 CheckFactories.addCheckFactory(
23 "llvm-include-order", new ClangTidyCheckFactory<IncludeOrderCheck>());
24 CheckFactories.addCheckFactory(
25 "llvm-namespace-comment",
26 new ClangTidyCheckFactory<NamespaceCommentCheck>());
27 }
28};
29
30// Register the LLVMTidyModule using this statically initialized variable.
31static ClangTidyModuleRegistry::Add<LLVMModule> X("llvm-module",
32 "Adds LLVM lint checks.");
33
34// This anchor is used to force the linker to link in the generated object file
35// and thus register the LLVMModule.
36volatile int LLVMModuleAnchorSource = 0;
37
38} // namespace tidy
39} // namespace clang