Source code

Revision control

Other Tools

1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
* License, v. 2.0. If a copy of the MPL was not distributed with this
3
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5
#ifdef CLANG_TIDY
6
7
#include "../ClangTidy.h"
8
#include "../ClangTidyModule.h"
9
#include "../ClangTidyModuleRegistry.h"
10
#include "ChecksIncludes.inc"
11
12
using namespace clang::ast_matchers;
13
14
namespace clang {
15
namespace tidy {
16
17
class MozillaModule : public ClangTidyModule {
18
public:
19
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
20
#define CHECK(cls, name) CheckFactories.registerCheck<cls>("mozilla-" name);
21
#include "Checks.inc"
22
#undef CHECK
23
}
24
};
25
26
// Register the MozillaTidyModule using this statically initialized variable.
27
static ClangTidyModuleRegistry::Add<MozillaModule>
28
X("mozilla-module", "Adds Mozilla lint checks.");
29
30
} // namespace tidy
31
} // namespace clang
32
33
// This anchor is used to force the linker to link in the generated object file
34
// and thus register the MozillaModule.
35
volatile int MozillaModuleAnchorSource = 0;
36
37
#endif