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"
|
2015-03-02 18:46:43 +08:00
|
|
|
#include "AssertSideEffectCheck.h"
|
2015-02-10 01:50:40 +08:00
|
|
|
#include "AssignOperatorSignatureCheck.h"
|
2015-03-09 19:48:54 +08:00
|
|
|
#include "BoolPointerImplicitConversionCheck.h"
|
2015-02-10 17:14:26 +08:00
|
|
|
#include "InaccurateEraseCheck.h"
|
2015-02-08 03:54:19 +08:00
|
|
|
#include "InefficientAlgorithmCheck.h"
|
2015-06-16 22:27:31 +08:00
|
|
|
#include "MacroParenthesesCheck.h"
|
2015-06-17 22:19:35 +08:00
|
|
|
#include "MacroRepeatedSideEffectsCheck.h"
|
2015-08-20 23:52:52 +08:00
|
|
|
#include "MoveConstructorInitCheck.h"
|
2015-05-27 22:24:11 +08:00
|
|
|
#include "NoexceptMoveConstructorCheck.h"
|
2015-09-11 00:37:46 +08:00
|
|
|
#include "SizeofContainerCheck.h"
|
2015-03-02 18:46:43 +08:00
|
|
|
#include "StaticAssertCheck.h"
|
2014-07-14 22:24:30 +08:00
|
|
|
#include "SwappedArgumentsCheck.h"
|
2014-07-31 17:58:52 +08:00
|
|
|
#include "UndelegatedConstructor.h"
|
2015-03-09 19:48:54 +08:00
|
|
|
#include "UniqueptrResetReleaseCheck.h"
|
2015-08-01 00:08:10 +08:00
|
|
|
#include "UnusedAliasDeclsCheck.h"
|
2015-07-20 09:06:44 +08:00
|
|
|
#include "UnusedParametersCheck.h"
|
2015-03-09 19:48:54 +08:00
|
|
|
#include "UnusedRAIICheck.h"
|
2014-03-05 21:14:32 +08:00
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
namespace tidy {
|
2015-03-02 20:25:03 +08:00
|
|
|
namespace misc {
|
2014-03-05 21:14:32 +08:00
|
|
|
|
|
|
|
class MiscModule : public ClangTidyModule {
|
|
|
|
public:
|
|
|
|
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
|
2014-09-10 19:06:43 +08:00
|
|
|
CheckFactories.registerCheck<ArgumentCommentCheck>("misc-argument-comment");
|
2015-03-02 18:46:43 +08:00
|
|
|
CheckFactories.registerCheck<AssertSideEffectCheck>(
|
|
|
|
"misc-assert-side-effect");
|
2015-02-10 01:50:40 +08:00
|
|
|
CheckFactories.registerCheck<AssignOperatorSignatureCheck>(
|
|
|
|
"misc-assign-operator-signature");
|
2015-03-09 19:48:54 +08:00
|
|
|
CheckFactories.registerCheck<BoolPointerImplicitConversionCheck>(
|
2014-09-10 19:06:43 +08:00
|
|
|
"misc-bool-pointer-implicit-conversion");
|
2015-02-10 17:14:26 +08:00
|
|
|
CheckFactories.registerCheck<InaccurateEraseCheck>(
|
|
|
|
"misc-inaccurate-erase");
|
2015-02-08 03:54:19 +08:00
|
|
|
CheckFactories.registerCheck<InefficientAlgorithmCheck>(
|
|
|
|
"misc-inefficient-algorithm");
|
2015-06-16 22:27:31 +08:00
|
|
|
CheckFactories.registerCheck<MacroParenthesesCheck>(
|
|
|
|
"misc-macro-parentheses");
|
2015-06-17 22:19:35 +08:00
|
|
|
CheckFactories.registerCheck<MacroRepeatedSideEffectsCheck>(
|
|
|
|
"misc-macro-repeated-side-effects");
|
2015-08-20 23:52:52 +08:00
|
|
|
CheckFactories.registerCheck<MoveConstructorInitCheck>(
|
|
|
|
"misc-move-constructor-init");
|
2015-05-27 22:24:11 +08:00
|
|
|
CheckFactories.registerCheck<NoexceptMoveConstructorCheck>(
|
|
|
|
"misc-noexcept-move-constructor");
|
2015-09-11 00:37:46 +08:00
|
|
|
CheckFactories.registerCheck<SizeofContainerCheck>(
|
|
|
|
"misc-sizeof-container");
|
2015-03-02 18:46:43 +08:00
|
|
|
CheckFactories.registerCheck<StaticAssertCheck>(
|
|
|
|
"misc-static-assert");
|
2014-09-10 19:06:43 +08:00
|
|
|
CheckFactories.registerCheck<SwappedArgumentsCheck>(
|
|
|
|
"misc-swapped-arguments");
|
|
|
|
CheckFactories.registerCheck<UndelegatedConstructorCheck>(
|
|
|
|
"misc-undelegated-constructor");
|
2015-03-09 19:48:54 +08:00
|
|
|
CheckFactories.registerCheck<UniqueptrResetReleaseCheck>(
|
2014-12-05 19:59:05 +08:00
|
|
|
"misc-uniqueptr-reset-release");
|
2015-08-01 00:08:10 +08:00
|
|
|
CheckFactories.registerCheck<UnusedAliasDeclsCheck>(
|
|
|
|
"misc-unused-alias-decls");
|
2015-07-20 09:06:44 +08:00
|
|
|
CheckFactories.registerCheck<UnusedParametersCheck>(
|
|
|
|
"misc-unused-parameters");
|
2014-09-10 19:06:43 +08:00
|
|
|
CheckFactories.registerCheck<UnusedRAIICheck>("misc-unused-raii");
|
2014-03-05 21:14:32 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-03-02 20:25:03 +08:00
|
|
|
} // namespace misc
|
|
|
|
|
2014-03-05 21:14:32 +08:00
|
|
|
// Register the MiscTidyModule using this statically initialized variable.
|
2015-03-02 20:25:03 +08:00
|
|
|
static ClangTidyModuleRegistry::Add<misc::MiscModule>
|
2014-03-05 21:14:32 +08:00
|
|
|
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
|