//===------- AbseilTidyModule.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 "DurationAdditionCheck.h" #include "DurationComparisonCheck.h" #include "DurationConversionCastCheck.h" #include "DurationDivisionCheck.h" #include "DurationFactoryFloatCheck.h" #include "DurationFactoryScaleCheck.h" #include "DurationSubtractionCheck.h" #include "DurationUnnecessaryConversionCheck.h" #include "FasterStrsplitDelimiterCheck.h" #include "NoInternalDependenciesCheck.h" #include "NoNamespaceCheck.h" #include "RedundantStrcatCallsCheck.h" #include "StrCatAppendCheck.h" #include "StringFindStartswithCheck.h" #include "StringFindStrContainsCheck.h" #include "TimeComparisonCheck.h" #include "TimeSubtractionCheck.h" #include "UpgradeDurationConversionsCheck.h" namespace clang { namespace tidy { namespace abseil { class AbseilModule : public ClangTidyModule { public: void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { CheckFactories.registerCheck( "abseil-duration-addition"); CheckFactories.registerCheck( "abseil-duration-comparison"); CheckFactories.registerCheck( "abseil-duration-conversion-cast"); CheckFactories.registerCheck( "abseil-duration-division"); CheckFactories.registerCheck( "abseil-duration-factory-float"); CheckFactories.registerCheck( "abseil-duration-factory-scale"); CheckFactories.registerCheck( "abseil-duration-subtraction"); CheckFactories.registerCheck( "abseil-duration-unnecessary-conversion"); CheckFactories.registerCheck( "abseil-faster-strsplit-delimiter"); CheckFactories.registerCheck( "abseil-no-internal-dependencies"); CheckFactories.registerCheck("abseil-no-namespace"); CheckFactories.registerCheck( "abseil-redundant-strcat-calls"); CheckFactories.registerCheck( "abseil-str-cat-append"); CheckFactories.registerCheck( "abseil-string-find-startswith"); CheckFactories.registerCheck( "abseil-string-find-str-contains"); CheckFactories.registerCheck( "abseil-time-comparison"); CheckFactories.registerCheck( "abseil-time-subtraction"); CheckFactories.registerCheck( "abseil-upgrade-duration-conversions"); } }; // Register the AbseilModule using this statically initialized variable. static ClangTidyModuleRegistry::Add X("abseil-module", "Add Abseil checks."); } // namespace abseil // This anchor is used to force the linker to link in the generated object file // and thus register the AbseilModule. volatile int AbseilModuleAnchorSource = 0; } // namespace tidy } // namespace clang