2014-03-05 21:14:32 +08:00
|
|
|
//===--- MiscTidyModule.cpp - clang-tidy ----------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "../ClangTidy.h"
|
|
|
|
#include "../ClangTidyModule.h"
|
|
|
|
#include "../ClangTidyModuleRegistry.h"
|
2014-03-18 12:46:45 +08:00
|
|
|
#include "ArgumentCommentCheck.h"
|
2014-07-11 16:08:47 +08:00
|
|
|
#include "BoolPointerImplicitConversion.h"
|
2014-03-28 01:42:26 +08:00
|
|
|
#include "RedundantSmartptrGet.h"
|
2014-07-14 22:24:30 +08:00
|
|
|
#include "SwappedArgumentsCheck.h"
|
2014-05-16 17:30:09 +08:00
|
|
|
#include "UseOverride.h"
|
2014-03-05 21:14:32 +08:00
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
namespace tidy {
|
|
|
|
|
|
|
|
class MiscModule : public ClangTidyModule {
|
|
|
|
public:
|
|
|
|
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
|
2014-03-28 01:42:26 +08:00
|
|
|
CheckFactories.addCheckFactory(
|
|
|
|
"misc-argument-comment",
|
|
|
|
new ClangTidyCheckFactory<ArgumentCommentCheck>());
|
2014-07-11 16:08:47 +08:00
|
|
|
CheckFactories.addCheckFactory(
|
|
|
|
"misc-bool-pointer-implicit-conversion",
|
|
|
|
new ClangTidyCheckFactory<BoolPointerImplicitConversion>());
|
2014-03-28 01:42:26 +08:00
|
|
|
CheckFactories.addCheckFactory(
|
|
|
|
"misc-redundant-smartptr-get",
|
|
|
|
new ClangTidyCheckFactory<RedundantSmartptrGet>());
|
2014-07-14 22:24:30 +08:00
|
|
|
CheckFactories.addCheckFactory(
|
|
|
|
"misc-swapped-arguments",
|
|
|
|
new ClangTidyCheckFactory<SwappedArgumentsCheck>());
|
2014-05-16 17:30:09 +08:00
|
|
|
CheckFactories.addCheckFactory(
|
|
|
|
"misc-use-override",
|
|
|
|
new ClangTidyCheckFactory<UseOverride>());
|
2014-03-05 21:14:32 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// Register the MiscTidyModule using this statically initialized variable.
|
|
|
|
static ClangTidyModuleRegistry::Add<MiscModule>
|
|
|
|
X("misc-module", "Adds miscellaneous lint checks.");
|
|
|
|
|
|
|
|
// This anchor is used to force the linker to link in the generated object file
|
|
|
|
// and thus register the MiscModule.
|
|
|
|
volatile int MiscModuleAnchorSource = 0;
|
|
|
|
|
|
|
|
} // namespace tidy
|
|
|
|
} // namespace clang
|