diff options
author | thegeorg <thegeorg@yandex-team.com> | 2024-03-13 13:58:24 +0300 |
---|---|---|
committer | thegeorg <thegeorg@yandex-team.com> | 2024-03-13 14:11:53 +0300 |
commit | 11a895b7e15d1c5a1f52706396b82e3f9db953cb (patch) | |
tree | fabc6d883b0f946151f61ae7865cee9f529a1fdd /contrib/libs/clang16/tools/extra/clang-tidy/performance/PerformanceTidyModule.cpp | |
parent | 9685917341315774aad5733b1793b1e533a88bbb (diff) | |
download | ydb-11a895b7e15d1c5a1f52706396b82e3f9db953cb.tar.gz |
Export clang-format16 via ydblib project
6e6be3a95868fde888d801b7590af4044049563f
Diffstat (limited to 'contrib/libs/clang16/tools/extra/clang-tidy/performance/PerformanceTidyModule.cpp')
-rw-r--r-- | contrib/libs/clang16/tools/extra/clang-tidy/performance/PerformanceTidyModule.cpp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/contrib/libs/clang16/tools/extra/clang-tidy/performance/PerformanceTidyModule.cpp b/contrib/libs/clang16/tools/extra/clang-tidy/performance/PerformanceTidyModule.cpp new file mode 100644 index 0000000000..30a195f76b --- /dev/null +++ b/contrib/libs/clang16/tools/extra/clang-tidy/performance/PerformanceTidyModule.cpp @@ -0,0 +1,76 @@ +//===-- PerformanceTidyModule.cpp - clang-tidy ----------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "../ClangTidy.h" +#include "../ClangTidyModule.h" +#include "../ClangTidyModuleRegistry.h" +#include "FasterStringFindCheck.h" +#include "ForRangeCopyCheck.h" +#include "ImplicitConversionInLoopCheck.h" +#include "InefficientAlgorithmCheck.h" +#include "InefficientStringConcatenationCheck.h" +#include "InefficientVectorOperationCheck.h" +#include "MoveConstArgCheck.h" +#include "MoveConstructorInitCheck.h" +#include "NoAutomaticMoveCheck.h" +#include "NoIntToPtrCheck.h" +#include "NoexceptMoveConstructorCheck.h" +#include "TriviallyDestructibleCheck.h" +#include "TypePromotionInMathFnCheck.h" +#include "UnnecessaryCopyInitialization.h" +#include "UnnecessaryValueParamCheck.h" + +namespace clang::tidy { +namespace performance { + +class PerformanceModule : public ClangTidyModule { +public: + void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { + CheckFactories.registerCheck<FasterStringFindCheck>( + "performance-faster-string-find"); + CheckFactories.registerCheck<ForRangeCopyCheck>( + "performance-for-range-copy"); + CheckFactories.registerCheck<ImplicitConversionInLoopCheck>( + "performance-implicit-conversion-in-loop"); + CheckFactories.registerCheck<InefficientAlgorithmCheck>( + "performance-inefficient-algorithm"); + CheckFactories.registerCheck<InefficientStringConcatenationCheck>( + "performance-inefficient-string-concatenation"); + CheckFactories.registerCheck<InefficientVectorOperationCheck>( + "performance-inefficient-vector-operation"); + CheckFactories.registerCheck<MoveConstArgCheck>( + "performance-move-const-arg"); + CheckFactories.registerCheck<MoveConstructorInitCheck>( + "performance-move-constructor-init"); + CheckFactories.registerCheck<NoAutomaticMoveCheck>( + "performance-no-automatic-move"); + CheckFactories.registerCheck<NoIntToPtrCheck>("performance-no-int-to-ptr"); + CheckFactories.registerCheck<NoexceptMoveConstructorCheck>( + "performance-noexcept-move-constructor"); + CheckFactories.registerCheck<TriviallyDestructibleCheck>( + "performance-trivially-destructible"); + CheckFactories.registerCheck<TypePromotionInMathFnCheck>( + "performance-type-promotion-in-math-fn"); + CheckFactories.registerCheck<UnnecessaryCopyInitialization>( + "performance-unnecessary-copy-initialization"); + CheckFactories.registerCheck<UnnecessaryValueParamCheck>( + "performance-unnecessary-value-param"); + } +}; + +// Register the PerformanceModule using this statically initialized variable. +static ClangTidyModuleRegistry::Add<PerformanceModule> + X("performance-module", "Adds performance checks."); + +} // namespace performance + +// This anchor is used to force the linker to link in the generated object file +// and thus register the PerformanceModule. +volatile int PerformanceModuleAnchorSource = 0; + +} // namespace clang::tidy |