annotate clang-tools-extra/clang-tidy/boost/BoostTidyModule.cpp @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children 1f2b6ac9f198
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 //===------- BoostTidyModule.cpp - clang-tidy -----------------------------===//
anatofuz
parents:
diff changeset
2 //
anatofuz
parents:
diff changeset
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
anatofuz
parents:
diff changeset
4 // See https://llvm.org/LICENSE.txt for license information.
anatofuz
parents:
diff changeset
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
anatofuz
parents:
diff changeset
6 //
anatofuz
parents:
diff changeset
7 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 #include "../ClangTidy.h"
anatofuz
parents:
diff changeset
10 #include "../ClangTidyModule.h"
anatofuz
parents:
diff changeset
11 #include "../ClangTidyModuleRegistry.h"
anatofuz
parents:
diff changeset
12 #include "UseToStringCheck.h"
anatofuz
parents:
diff changeset
13 using namespace clang::ast_matchers;
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 namespace clang {
anatofuz
parents:
diff changeset
16 namespace tidy {
anatofuz
parents:
diff changeset
17 namespace boost {
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 class BoostModule : public ClangTidyModule {
anatofuz
parents:
diff changeset
20 public:
anatofuz
parents:
diff changeset
21 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
anatofuz
parents:
diff changeset
22 CheckFactories.registerCheck<UseToStringCheck>("boost-use-to-string");
anatofuz
parents:
diff changeset
23 }
anatofuz
parents:
diff changeset
24 };
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 // Register the BoostModule using this statically initialized variable.
anatofuz
parents:
diff changeset
27 static ClangTidyModuleRegistry::Add<BoostModule> X("boost-module",
anatofuz
parents:
diff changeset
28 "Add boost checks.");
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 } // namespace boost
anatofuz
parents:
diff changeset
31
anatofuz
parents:
diff changeset
32 // This anchor is used to force the linker to link in the generated object file
anatofuz
parents:
diff changeset
33 // and thus register the BoostModule.
anatofuz
parents:
diff changeset
34 volatile int BoostModuleAnchorSource = 0;
anatofuz
parents:
diff changeset
35
anatofuz
parents:
diff changeset
36 } // namespace tidy
anatofuz
parents:
diff changeset
37 } // namespace clang