2017-03-20 01:23:23 +08:00
|
|
|
//===------- HICPPTidyModule.cpp - clang-tidy -----------------------------===//
|
[clang-tidy] safety-no-assembler
Summary:
Add a new clang-tidy module for safety-critical checks.
Include a check for inline assembler.
Reviewers: Prazek, dtarditi, malcolm.parsons, alexfh, aaron.ballman, idlecode
Reviewed By: idlecode
Subscribers: idlecode, JonasToth, Eugene.Zelenko, mgorny, JDevlieghere, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D29267
llvm-svn: 294255
2017-02-07 06:57:14 +08:00
|
|
|
//
|
|
|
|
// 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"
|
2017-09-11 17:20:07 +08:00
|
|
|
#include "../cppcoreguidelines/NoMallocCheck.h"
|
|
|
|
#include "../cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h"
|
2017-03-30 19:57:54 +08:00
|
|
|
#include "../cppcoreguidelines/ProTypeMemberInitCheck.h"
|
2017-09-11 17:20:07 +08:00
|
|
|
#include "../cppcoreguidelines/ProTypeVarargCheck.h"
|
2017-03-30 19:57:54 +08:00
|
|
|
#include "../cppcoreguidelines/SpecialMemberFunctionsCheck.h"
|
|
|
|
#include "../google/DefaultArgumentsCheck.h"
|
|
|
|
#include "../google/ExplicitConstructorCheck.h"
|
2017-09-11 17:20:07 +08:00
|
|
|
#include "../misc/MoveConstantArgumentCheck.h"
|
2017-03-30 19:57:54 +08:00
|
|
|
#include "../misc/NewDeleteOverloadsCheck.h"
|
|
|
|
#include "../misc/NoexceptMoveConstructorCheck.h"
|
2017-09-11 17:20:07 +08:00
|
|
|
#include "../misc/StaticAssertCheck.h"
|
2017-03-30 19:57:54 +08:00
|
|
|
#include "../misc/UndelegatedConstructor.h"
|
|
|
|
#include "../misc/UseAfterMoveCheck.h"
|
2017-09-11 17:20:07 +08:00
|
|
|
#include "../modernize/DeprecatedHeadersCheck.h"
|
|
|
|
#include "../modernize/UseAutoCheck.h"
|
|
|
|
#include "../modernize/UseEmplaceCheck.h"
|
2017-03-30 19:57:54 +08:00
|
|
|
#include "../modernize/UseEqualsDefaultCheck.h"
|
|
|
|
#include "../modernize/UseEqualsDeleteCheck.h"
|
2017-09-11 17:20:07 +08:00
|
|
|
#include "../modernize/UseNoexceptCheck.h"
|
|
|
|
#include "../modernize/UseNullptrCheck.h"
|
2017-03-30 19:57:54 +08:00
|
|
|
#include "../modernize/UseOverrideCheck.h"
|
2017-08-11 20:12:36 +08:00
|
|
|
#include "../readability/BracesAroundStatementsCheck.h"
|
2017-03-30 19:57:54 +08:00
|
|
|
#include "../readability/FunctionSizeCheck.h"
|
|
|
|
#include "../readability/IdentifierNamingCheck.h"
|
2017-08-12 00:31:51 +08:00
|
|
|
#include "ExceptionBaseclassCheck.h"
|
[clang-tidy] safety-no-assembler
Summary:
Add a new clang-tidy module for safety-critical checks.
Include a check for inline assembler.
Reviewers: Prazek, dtarditi, malcolm.parsons, alexfh, aaron.ballman, idlecode
Reviewed By: idlecode
Subscribers: idlecode, JonasToth, Eugene.Zelenko, mgorny, JDevlieghere, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D29267
llvm-svn: 294255
2017-02-07 06:57:14 +08:00
|
|
|
#include "NoAssemblerCheck.h"
|
2017-08-30 21:32:05 +08:00
|
|
|
#include "SignedBitwiseCheck.h"
|
[clang-tidy] safety-no-assembler
Summary:
Add a new clang-tidy module for safety-critical checks.
Include a check for inline assembler.
Reviewers: Prazek, dtarditi, malcolm.parsons, alexfh, aaron.ballman, idlecode
Reviewed By: idlecode
Subscribers: idlecode, JonasToth, Eugene.Zelenko, mgorny, JDevlieghere, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D29267
llvm-svn: 294255
2017-02-07 06:57:14 +08:00
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
namespace tidy {
|
2017-03-20 01:23:23 +08:00
|
|
|
namespace hicpp {
|
[clang-tidy] safety-no-assembler
Summary:
Add a new clang-tidy module for safety-critical checks.
Include a check for inline assembler.
Reviewers: Prazek, dtarditi, malcolm.parsons, alexfh, aaron.ballman, idlecode
Reviewed By: idlecode
Subscribers: idlecode, JonasToth, Eugene.Zelenko, mgorny, JDevlieghere, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D29267
llvm-svn: 294255
2017-02-07 06:57:14 +08:00
|
|
|
|
2017-03-20 01:23:23 +08:00
|
|
|
class HICPPModule : public ClangTidyModule {
|
[clang-tidy] safety-no-assembler
Summary:
Add a new clang-tidy module for safety-critical checks.
Include a check for inline assembler.
Reviewers: Prazek, dtarditi, malcolm.parsons, alexfh, aaron.ballman, idlecode
Reviewed By: idlecode
Subscribers: idlecode, JonasToth, Eugene.Zelenko, mgorny, JDevlieghere, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D29267
llvm-svn: 294255
2017-02-07 06:57:14 +08:00
|
|
|
public:
|
|
|
|
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
|
2017-08-11 20:12:36 +08:00
|
|
|
CheckFactories.registerCheck<readability::BracesAroundStatementsCheck>(
|
|
|
|
"hicpp-braces-around-statements");
|
2017-09-11 17:20:07 +08:00
|
|
|
CheckFactories.registerCheck<modernize::DeprecatedHeadersCheck>(
|
|
|
|
"hicpp-deprecated-headers");
|
2017-08-12 00:31:51 +08:00
|
|
|
CheckFactories.registerCheck<ExceptionBaseclassCheck>(
|
|
|
|
"hicpp-exception-baseclass");
|
2017-08-30 21:32:05 +08:00
|
|
|
CheckFactories.registerCheck<SignedBitwiseCheck>(
|
|
|
|
"hicpp-signed-bitwise");
|
2017-03-30 19:57:54 +08:00
|
|
|
CheckFactories.registerCheck<google::ExplicitConstructorCheck>(
|
|
|
|
"hicpp-explicit-conversions");
|
|
|
|
CheckFactories.registerCheck<readability::FunctionSizeCheck>(
|
|
|
|
"hicpp-function-size");
|
|
|
|
CheckFactories.registerCheck<readability::IdentifierNamingCheck>(
|
|
|
|
"hicpp-named-parameter");
|
|
|
|
CheckFactories.registerCheck<misc::UseAfterMoveCheck>(
|
|
|
|
"hicpp-invalid-access-moved");
|
|
|
|
CheckFactories.registerCheck<cppcoreguidelines::ProTypeMemberInitCheck>(
|
|
|
|
"hicpp-member-init");
|
2017-09-11 17:20:07 +08:00
|
|
|
CheckFactories.registerCheck<misc::MoveConstantArgumentCheck>(
|
|
|
|
"hicpp-move-const-arg");
|
2017-03-30 19:57:54 +08:00
|
|
|
CheckFactories.registerCheck<misc::NewDeleteOverloadsCheck>(
|
|
|
|
"hicpp-new-delete-operators");
|
|
|
|
CheckFactories.registerCheck<misc::NoexceptMoveConstructorCheck>(
|
|
|
|
"hicpp-noexcept-move");
|
2017-09-11 17:20:07 +08:00
|
|
|
CheckFactories
|
|
|
|
.registerCheck<cppcoreguidelines::ProBoundsArrayToPointerDecayCheck>(
|
|
|
|
"hicpp-no-array-decay");
|
2017-03-30 19:57:54 +08:00
|
|
|
CheckFactories.registerCheck<NoAssemblerCheck>("hicpp-no-assembler");
|
2017-09-11 17:20:07 +08:00
|
|
|
CheckFactories.registerCheck<cppcoreguidelines::NoMallocCheck>(
|
|
|
|
"hicpp-no-malloc");
|
2017-03-30 19:57:54 +08:00
|
|
|
CheckFactories
|
|
|
|
.registerCheck<cppcoreguidelines::SpecialMemberFunctionsCheck>(
|
|
|
|
"hicpp-special-member-functions");
|
2017-09-11 17:20:07 +08:00
|
|
|
CheckFactories.registerCheck<misc::StaticAssertCheck>(
|
|
|
|
"hicpp-static-assert");
|
|
|
|
CheckFactories.registerCheck<modernize::UseAutoCheck>("hicpp-use-auto");
|
2017-03-30 19:57:54 +08:00
|
|
|
CheckFactories.registerCheck<misc::UndelegatedConstructorCheck>(
|
|
|
|
"hicpp-undelegated-constructor");
|
2017-09-11 17:20:07 +08:00
|
|
|
CheckFactories.registerCheck<modernize::UseEmplaceCheck>(
|
|
|
|
"hicpp-use-emplace");
|
2017-03-30 19:57:54 +08:00
|
|
|
CheckFactories.registerCheck<modernize::UseEqualsDefaultCheck>(
|
|
|
|
"hicpp-use-equals-default");
|
|
|
|
CheckFactories.registerCheck<modernize::UseEqualsDeleteCheck>(
|
|
|
|
"hicpp-use-equals-delete");
|
2017-09-11 17:20:07 +08:00
|
|
|
CheckFactories.registerCheck<modernize::UseNoexceptCheck>(
|
|
|
|
"hicpp-use-noexcept");
|
|
|
|
CheckFactories.registerCheck<modernize::UseNullptrCheck>(
|
|
|
|
"hicpp-use-nullptr");
|
2017-03-30 19:57:54 +08:00
|
|
|
CheckFactories.registerCheck<modernize::UseOverrideCheck>(
|
|
|
|
"hicpp-use-override");
|
2017-09-11 17:20:07 +08:00
|
|
|
CheckFactories.registerCheck<cppcoreguidelines::ProTypeVarargCheck>(
|
|
|
|
"hicpp-vararg");
|
[clang-tidy] safety-no-assembler
Summary:
Add a new clang-tidy module for safety-critical checks.
Include a check for inline assembler.
Reviewers: Prazek, dtarditi, malcolm.parsons, alexfh, aaron.ballman, idlecode
Reviewed By: idlecode
Subscribers: idlecode, JonasToth, Eugene.Zelenko, mgorny, JDevlieghere, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D29267
llvm-svn: 294255
2017-02-07 06:57:14 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-03-20 01:23:23 +08:00
|
|
|
// Register the HICPPModule using this statically initialized variable.
|
|
|
|
static ClangTidyModuleRegistry::Add<HICPPModule>
|
|
|
|
X("hicpp-module", "Adds High-Integrity C++ checks.");
|
[clang-tidy] safety-no-assembler
Summary:
Add a new clang-tidy module for safety-critical checks.
Include a check for inline assembler.
Reviewers: Prazek, dtarditi, malcolm.parsons, alexfh, aaron.ballman, idlecode
Reviewed By: idlecode
Subscribers: idlecode, JonasToth, Eugene.Zelenko, mgorny, JDevlieghere, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D29267
llvm-svn: 294255
2017-02-07 06:57:14 +08:00
|
|
|
|
2017-03-20 01:23:23 +08:00
|
|
|
} // namespace hicpp
|
[clang-tidy] safety-no-assembler
Summary:
Add a new clang-tidy module for safety-critical checks.
Include a check for inline assembler.
Reviewers: Prazek, dtarditi, malcolm.parsons, alexfh, aaron.ballman, idlecode
Reviewed By: idlecode
Subscribers: idlecode, JonasToth, Eugene.Zelenko, mgorny, JDevlieghere, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D29267
llvm-svn: 294255
2017-02-07 06:57:14 +08:00
|
|
|
|
|
|
|
// This anchor is used to force the linker to link in the generated object file
|
2017-03-20 01:23:23 +08:00
|
|
|
// and thus register the HICPPModule.
|
|
|
|
volatile int HICPPModuleAnchorSource = 0;
|
[clang-tidy] safety-no-assembler
Summary:
Add a new clang-tidy module for safety-critical checks.
Include a check for inline assembler.
Reviewers: Prazek, dtarditi, malcolm.parsons, alexfh, aaron.ballman, idlecode
Reviewed By: idlecode
Subscribers: idlecode, JonasToth, Eugene.Zelenko, mgorny, JDevlieghere, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D29267
llvm-svn: 294255
2017-02-07 06:57:14 +08:00
|
|
|
|
|
|
|
} // namespace tidy
|
|
|
|
} // namespace clang
|