clang-tools  8.0.0
ZirconTidyModule.cpp
Go to the documentation of this file.
1 //===--- ZirconTidyModule.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 "TemporaryObjectsCheck.h"
14 
15 using namespace clang::ast_matchers;
16 
17 namespace clang {
18 namespace tidy {
19 namespace zircon {
20 
21 /// This module is for Zircon-specific checks.
22 class ZirconModule : public ClangTidyModule {
23 public:
24  void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
25  CheckFactories.registerCheck<TemporaryObjectsCheck>(
26  "zircon-temporary-objects");
27  }
28 };
29 
30 // Register the ZirconTidyModule using this statically initialized variable.
31 static ClangTidyModuleRegistry::Add<ZirconModule>
32  X("zircon-module", "Adds Zircon kernel checks.");
33 } // namespace zircon
34 
35 // This anchor is used to force the linker to link in the generated object file
36 // and thus register the ZirconModule.
37 volatile int ZirconModuleAnchorSource = 0;
38 
39 } // namespace tidy
40 } // namespace clang
void registerCheck(StringRef CheckName)
Registers the CheckType with the name Name.
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override
Implement this function in order to register all CheckFactories belonging to this module...
A collection of ClangTidyCheckFactory instances.
This module is for Zircon-specific checks.
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
volatile int ZirconModuleAnchorSource
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
static ClangTidyModuleRegistry::Add< ZirconModule > X("zircon-module", "Adds Zircon kernel checks.")
Construction of specific temporary objects in the Zircon kernel is discouraged.