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/. */
7 #include "../ClangTidy.h"
8 #include "../ClangTidyModule.h"
9 #include "../ClangTidyModuleRegistry.h"
10 #include "ChecksIncludes.inc"
11 #include "external/ExternalIncludes.inc"
12 #ifdef MOZ_CLANG_PLUGIN_ALPHA
13 #include "alpha/AlphaIncludes.inc"
16 using namespace clang::ast_matchers
;
21 class MozillaModule
: public ClangTidyModule
{
23 void addCheckFactories(ClangTidyCheckFactories
&CheckFactories
) override
{
24 #define CHECK(cls, name) CheckFactories.registerCheck<cls>("mozilla-" name);
26 #include "external/ExternalChecks.inc"
27 #ifdef MOZ_CLANG_PLUGIN_ALPHA
28 #include "alpha/AlphaChecks.inc"
34 // Register the MozillaTidyModule using this statically initialized variable.
35 static ClangTidyModuleRegistry::Add
<MozillaModule
>
36 X("mozilla-module", "Adds Mozilla lint checks.");
41 // This anchor is used to force the linker to link in the generated object file
42 // and thus register the MozillaModule.
43 volatile int MozillaModuleAnchorSource
= 0;