blob: 65353a23c7a419e1ebe86825889bb293ff87d600 [file] [log] [blame]
Gabor Horvath829e75a2017-07-14 12:15:55 +00001//===--- BugproneTidyModule.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
10#include "../ClangTidy.h"
11#include "../ClangTidyModule.h"
12#include "../ClangTidyModuleRegistry.h"
13#include "SuspiciousMemsetUsageCheck.h"
14
15namespace clang {
16namespace tidy {
17namespace bugprone {
18
19class BugproneModule : public ClangTidyModule {
20public:
21 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
22 CheckFactories.registerCheck<SuspiciousMemsetUsageCheck>(
23 "bugprone-suspicious-memset-usage");
24 }
25};
26
27} // namespace bugprone
28
29// Register the BugproneTidyModule using this statically initialized variable.
30static ClangTidyModuleRegistry::Add<bugprone::BugproneModule>
31 X("bugprone-module", "Adds checks for bugprone code constructs.");
32
33// This anchor is used to force the linker to link in the generated object file
34// and thus register the BugproneModule.
35volatile int BugproneModuleAnchorSource = 0;
36
37} // namespace tidy
38} // namespace clang