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"
|
2015-02-08 03:54:19 +08:00
|
|
|
#include "InefficientAlgorithmCheck.h"
|
2014-07-14 22:24:30 +08:00
|
|
|
#include "SwappedArgumentsCheck.h"
|
2014-07-31 17:58:52 +08:00
|
|
|
#include "UndelegatedConstructor.h"
|
2014-12-05 19:59:05 +08:00
|
|
|
#include "UniqueptrResetRelease.h"
|
2015-01-14 19:24:38 +08:00
|
|
|
#include "UnusedRAII.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-09-10 19:06:43 +08:00
|
|
|
CheckFactories.registerCheck<ArgumentCommentCheck>("misc-argument-comment");
|
|
|
|
CheckFactories.registerCheck<BoolPointerImplicitConversion>(
|
|
|
|
"misc-bool-pointer-implicit-conversion");
|
2015-02-08 03:54:19 +08:00
|
|
|
CheckFactories.registerCheck<InefficientAlgorithmCheck>(
|
|
|
|
"misc-inefficient-algorithm");
|
2014-09-10 19:06:43 +08:00
|
|
|
CheckFactories.registerCheck<SwappedArgumentsCheck>(
|
|
|
|
"misc-swapped-arguments");
|
|
|
|
CheckFactories.registerCheck<UndelegatedConstructorCheck>(
|
|
|
|
"misc-undelegated-constructor");
|
2014-12-05 19:59:05 +08:00
|
|
|
CheckFactories.registerCheck<UniqueptrResetRelease>(
|
|
|
|
"misc-uniqueptr-reset-release");
|
2014-09-10 19:06:43 +08:00
|
|
|
CheckFactories.registerCheck<UnusedRAIICheck>("misc-unused-raii");
|
|
|
|
CheckFactories.registerCheck<UseOverride>("misc-use-override");
|
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
|