clang-tools  5.0.0
BugproneTidyModule.cpp
Go to the documentation of this file.
1 //===--- 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"
15 
16 namespace clang {
17 namespace tidy {
18 namespace bugprone {
19 
21 public:
22  void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
24  "bugprone-suspicious-memset-usage");
26  "bugprone-undefined-memory-manipulation");
27  }
28 };
29 
30 } // namespace bugprone
31 
32 // Register the BugproneTidyModule using this statically initialized variable.
33 static 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.
38 volatile int BugproneModuleAnchorSource = 0;
39 
40 } // namespace tidy
41 } // namespace clang
Finds memset calls with potential mistakes in their arguments.
void registerCheck(StringRef CheckName)
Registers the CheckType with the name Name.
A collection of ClangTidyCheckFactory instances.
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override
Implement this function in order to register all CheckFactories belonging to this module...
volatile int BugproneModuleAnchorSource
static ClangTidyModuleRegistry::Add< bugprone::BugproneModule > X("bugprone-module","Adds checks for bugprone code constructs.")
Finds calls of memory manipulation functions memset(), memcpy() and memmove() on not TriviallyCopyabl...