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