[clang-tools-extra] 8d950d2 - [clang-tidy][NFC] Add missing "Check" suffix to filenames in clang-tidy checks (#166889)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Nov 8 02:02:29 PST 2025
Author: mitchell
Date: 2025-11-08T13:02:24+03:00
New Revision: 8d950d27d686543e877c5d64df8cec287381556c
URL: https://github.com/llvm/llvm-project/commit/8d950d27d686543e877c5d64df8cec287381556c
DIFF: https://github.com/llvm/llvm-project/commit/8d950d27d686543e877c5d64df8cec287381556c.diff
LOG: [clang-tidy][NFC] Add missing "Check" suffix to filenames in clang-tidy checks (#166889)
This is part of the codebase cleanup described in
[#166753](https://github.com/llvm/llvm-project/issues/166753).
Added:
clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccessCheck.cpp
clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccessCheck.h
clang-tools-extra/clang-tidy/misc/MisleadingBidirectionalCheck.cpp
clang-tools-extra/clang-tidy/misc/MisleadingBidirectionalCheck.h
clang-tools-extra/clang-tidy/misc/MisleadingIdentifierCheck.cpp
clang-tools-extra/clang-tidy/misc/MisleadingIdentifierCheck.h
clang-tools-extra/clang-tidy/misc/NonCopyableObjectsCheck.cpp
clang-tools-extra/clang-tidy/misc/NonCopyableObjectsCheck.h
clang-tools-extra/clang-tidy/objc/AssertEqualsCheck.cpp
clang-tools-extra/clang-tidy/objc/AssertEqualsCheck.h
clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitializationCheck.cpp
clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitializationCheck.h
clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDeclsCheck.cpp
clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDeclsCheck.h
clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStaticCheck.cpp
clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStaticCheck.h
Modified:
clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt
clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp
clang-tools-extra/clang-tidy/misc/CMakeLists.txt
clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
clang-tools-extra/clang-tidy/objc/CMakeLists.txt
clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp
clang-tools-extra/clang-tidy/performance/CMakeLists.txt
clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp
clang-tools-extra/clang-tidy/readability/CMakeLists.txt
clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp
clang-tools-extra/docs/clang-tidy/checks/cert/fio38-c.rst
clang-tools-extra/docs/clang-tidy/checks/misc/misleading-bidirectional.rst
clang-tools-extra/docs/clang-tidy/checks/misc/non-copyable-objects.rst
Removed:
clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccess.cpp
clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccess.h
clang-tools-extra/clang-tidy/misc/MisleadingBidirectional.cpp
clang-tools-extra/clang-tidy/misc/MisleadingBidirectional.h
clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.cpp
clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.h
clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp
clang-tools-extra/clang-tidy/misc/NonCopyableObjects.h
clang-tools-extra/clang-tidy/objc/AssertEquals.cpp
clang-tools-extra/clang-tidy/objc/AssertEquals.h
clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp
clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.h
clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDecls.cpp
clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDecls.h
clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStatic.cpp
clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStatic.h
################################################################################
diff --git a/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp b/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
index b0799da947613..2f6fc4db46545 100644
--- a/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
@@ -31,7 +31,7 @@
#include "../concurrency/ThreadCanceltypeAsynchronousCheck.h"
#include "../google/UnnamedNamespaceInHeaderCheck.h"
#include "../misc/NewDeleteOverloadsCheck.h"
-#include "../misc/NonCopyableObjects.h"
+#include "../misc/NonCopyableObjectsCheck.h"
#include "../misc/StaticAssertCheck.h"
#include "../misc/ThrowByValueCatchByReferenceCheck.h"
#include "../modernize/AvoidSetjmpLongjmpCheck.h"
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt b/clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt
index 0abb000991859..4b3330d7e14c1 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt
@@ -21,7 +21,7 @@ add_clang_library(clangTidyCppCoreGuidelinesModule STATIC
OwningMemoryCheck.cpp
PreferMemberInitializerCheck.cpp
ProBoundsArrayToPointerDecayCheck.cpp
- ProBoundsAvoidUncheckedContainerAccess.cpp
+ ProBoundsAvoidUncheckedContainerAccessCheck.cpp
ProBoundsConstantArrayIndexCheck.cpp
ProBoundsPointerArithmeticCheck.cpp
ProTypeConstCastCheck.cpp
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp
index 5f4c9b48e346a..66639552276a2 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp
@@ -36,7 +36,7 @@
#include "OwningMemoryCheck.h"
#include "PreferMemberInitializerCheck.h"
#include "ProBoundsArrayToPointerDecayCheck.h"
-#include "ProBoundsAvoidUncheckedContainerAccess.h"
+#include "ProBoundsAvoidUncheckedContainerAccessCheck.h"
#include "ProBoundsConstantArrayIndexCheck.h"
#include "ProBoundsPointerArithmeticCheck.h"
#include "ProTypeConstCastCheck.h"
@@ -108,7 +108,7 @@ class CppCoreGuidelinesModule : public ClangTidyModule {
"cppcoreguidelines-prefer-member-initializer");
CheckFactories.registerCheck<ProBoundsArrayToPointerDecayCheck>(
"cppcoreguidelines-pro-bounds-array-to-pointer-decay");
- CheckFactories.registerCheck<ProBoundsAvoidUncheckedContainerAccess>(
+ CheckFactories.registerCheck<ProBoundsAvoidUncheckedContainerAccessCheck>(
"cppcoreguidelines-pro-bounds-avoid-unchecked-container-access");
CheckFactories.registerCheck<ProBoundsConstantArrayIndexCheck>(
"cppcoreguidelines-pro-bounds-constant-array-index");
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccess.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccessCheck.cpp
similarity index 95%
rename from clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccess.cpp
rename to clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccessCheck.cpp
index dd7b2b553b7a1..83803a3e81937 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccess.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccessCheck.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "ProBoundsAvoidUncheckedContainerAccess.h"
+#include "ProBoundsAvoidUncheckedContainerAccessCheck.h"
#include "../utils/Matchers.h"
#include "../utils/OptionsUtils.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
@@ -19,8 +19,9 @@ namespace clang::tidy::cppcoreguidelines {
static constexpr llvm::StringRef DefaultExclusionStr =
"::std::map;::std::unordered_map;::std::flat_map";
-ProBoundsAvoidUncheckedContainerAccess::ProBoundsAvoidUncheckedContainerAccess(
- StringRef Name, ClangTidyContext *Context)
+ProBoundsAvoidUncheckedContainerAccessCheck::
+ ProBoundsAvoidUncheckedContainerAccessCheck(StringRef Name,
+ ClangTidyContext *Context)
: ClangTidyCheck(Name, Context),
ExcludedClasses(utils::options::parseStringList(
Options.get("ExcludeClasses", DefaultExclusionStr))),
@@ -28,7 +29,7 @@ ProBoundsAvoidUncheckedContainerAccess::ProBoundsAvoidUncheckedContainerAccess(
FixFunction(Options.get("FixFunction", "gsl::at")),
FixFunctionEmptyArgs(Options.get("FixFunctionEmptyArgs", FixFunction)) {}
-void ProBoundsAvoidUncheckedContainerAccess::storeOptions(
+void ProBoundsAvoidUncheckedContainerAccessCheck::storeOptions(
ClangTidyOptions::OptionMap &Opts) {
Options.store(Opts, "ExcludeClasses",
utils::options::serializeStringList(ExcludedClasses));
@@ -86,7 +87,7 @@ findAlternativeAt(const CXXMethodDecl *MatchedOperator) {
return nullptr;
}
-void ProBoundsAvoidUncheckedContainerAccess::registerMatchers(
+void ProBoundsAvoidUncheckedContainerAccessCheck::registerMatchers(
MatchFinder *Finder) {
Finder->addMatcher(
mapAnyOf(cxxOperatorCallExpr, cxxMemberCallExpr)
@@ -100,7 +101,7 @@ void ProBoundsAvoidUncheckedContainerAccess::registerMatchers(
this);
}
-void ProBoundsAvoidUncheckedContainerAccess::check(
+void ProBoundsAvoidUncheckedContainerAccessCheck::check(
const MatchFinder::MatchResult &Result) {
const auto *MatchedExpr = Result.Nodes.getNodeAs<CallExpr>("caller");
@@ -251,7 +252,7 @@ void ProBoundsAvoidUncheckedContainerAccess::check(
} // namespace clang::tidy::cppcoreguidelines
namespace clang::tidy {
-using P = cppcoreguidelines::ProBoundsAvoidUncheckedContainerAccess;
+using P = cppcoreguidelines::ProBoundsAvoidUncheckedContainerAccessCheck;
llvm::ArrayRef<std::pair<P::FixModes, StringRef>>
OptionEnumMapping<P::FixModes>::getEnumMapping() {
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccess.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccessCheck.h
similarity index 78%
rename from clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccess.h
rename to clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccessCheck.h
index 2462e7a42466f..85b5a93940562 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccess.h
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccessCheck.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PROBOUNDSAVOIDUNCHECKEDCONTAINERACCESS_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PROBOUNDSAVOIDUNCHECKEDCONTAINERACCESS_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PROBOUNDSAVOIDUNCHECKEDCONTAINERACCESSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PROBOUNDSAVOIDUNCHECKEDCONTAINERACCESSCHECK_H
#include "../ClangTidyCheck.h"
@@ -20,10 +20,10 @@ namespace clang::tidy::cppcoreguidelines {
/// https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#slcon3-avoid-bounds-errors
/// For the user-facing documentation see:
/// https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/pro-bounds-avoid-unchecked-container-access.html
-class ProBoundsAvoidUncheckedContainerAccess : public ClangTidyCheck {
+class ProBoundsAvoidUncheckedContainerAccessCheck : public ClangTidyCheck {
public:
- ProBoundsAvoidUncheckedContainerAccess(StringRef Name,
- ClangTidyContext *Context);
+ ProBoundsAvoidUncheckedContainerAccessCheck(StringRef Name,
+ ClangTidyContext *Context);
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
return LangOpts.CPlusPlus;
}
@@ -46,11 +46,11 @@ class ProBoundsAvoidUncheckedContainerAccess : public ClangTidyCheck {
namespace clang::tidy {
template <>
struct OptionEnumMapping<
- cppcoreguidelines::ProBoundsAvoidUncheckedContainerAccess::FixModes> {
+ cppcoreguidelines::ProBoundsAvoidUncheckedContainerAccessCheck::FixModes> {
static ArrayRef<std::pair<
- cppcoreguidelines::ProBoundsAvoidUncheckedContainerAccess::FixModes,
+ cppcoreguidelines::ProBoundsAvoidUncheckedContainerAccessCheck::FixModes,
StringRef>>
getEnumMapping();
};
} // namespace clang::tidy
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PROBOUNDSAVOIDUNCHECKEDCONTAINERACCESS_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PROBOUNDSAVOIDUNCHECKEDCONTAINERACCESSCHECK_H
diff --git a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
index 2cfee5fd10713..6214ee92927f2 100644
--- a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
@@ -25,12 +25,12 @@ add_clang_library(clangTidyMiscModule STATIC
HeaderIncludeCycleCheck.cpp
IncludeCleanerCheck.cpp
MiscTidyModule.cpp
- MisleadingBidirectional.cpp
- MisleadingIdentifier.cpp
+ MisleadingBidirectionalCheck.cpp
+ MisleadingIdentifierCheck.cpp
MisplacedConstCheck.cpp
NewDeleteOverloadsCheck.cpp
NoRecursionCheck.cpp
- NonCopyableObjects.cpp
+ NonCopyableObjectsCheck.cpp
NonPrivateMemberVariablesInClassesCheck.cpp
OverrideWithDifferentVisibilityCheck.cpp
RedundantExpressionCheck.cpp
diff --git a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
index 6f4af6c44dcb4..347fa2a82e43c 100644
--- a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
@@ -15,12 +15,12 @@
#include "DefinitionsInHeadersCheck.h"
#include "HeaderIncludeCycleCheck.h"
#include "IncludeCleanerCheck.h"
-#include "MisleadingBidirectional.h"
-#include "MisleadingIdentifier.h"
+#include "MisleadingBidirectionalCheck.h"
+#include "MisleadingIdentifierCheck.h"
#include "MisplacedConstCheck.h"
#include "NewDeleteOverloadsCheck.h"
#include "NoRecursionCheck.h"
-#include "NonCopyableObjects.h"
+#include "NonCopyableObjectsCheck.h"
#include "NonPrivateMemberVariablesInClassesCheck.h"
#include "OverrideWithDifferentVisibilityCheck.h"
#include "RedundantExpressionCheck.h"
diff --git a/clang-tools-extra/clang-tidy/misc/MisleadingBidirectional.cpp b/clang-tools-extra/clang-tidy/misc/MisleadingBidirectionalCheck.cpp
similarity index 99%
rename from clang-tools-extra/clang-tidy/misc/MisleadingBidirectional.cpp
rename to clang-tools-extra/clang-tidy/misc/MisleadingBidirectionalCheck.cpp
index db5bc61aed4e2..4807567710f2d 100644
--- a/clang-tools-extra/clang-tidy/misc/MisleadingBidirectional.cpp
+++ b/clang-tools-extra/clang-tidy/misc/MisleadingBidirectionalCheck.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "MisleadingBidirectional.h"
+#include "MisleadingBidirectionalCheck.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Lex/Preprocessor.h"
diff --git a/clang-tools-extra/clang-tidy/misc/MisleadingBidirectional.h b/clang-tools-extra/clang-tidy/misc/MisleadingBidirectionalCheck.h
similarity index 83%
rename from clang-tools-extra/clang-tidy/misc/MisleadingBidirectional.h
rename to clang-tools-extra/clang-tidy/misc/MisleadingBidirectionalCheck.h
index 50e70cb8b5b1a..7c7577f129f36 100644
--- a/clang-tools-extra/clang-tidy/misc/MisleadingBidirectional.h
+++ b/clang-tools-extra/clang-tidy/misc/MisleadingBidirectionalCheck.h
@@ -6,13 +6,17 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISLEADINGBIDIRECTIONAL_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISLEADINGBIDIRECTIONAL_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISLEADINGBIDIRECTIONALCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISLEADINGBIDIRECTIONALCHECK_H
#include "../ClangTidyCheck.h"
namespace clang::tidy::misc {
+/// Warns about unterminated bidirectional unicode sequence.
+///
+/// For the user-facing documentation see:
+/// https://clang.llvm.org/extra/clang-tidy/checks/misc/misleading-bidirectional.html
class MisleadingBidirectionalCheck : public ClangTidyCheck {
public:
MisleadingBidirectionalCheck(StringRef Name, ClangTidyContext *Context);
@@ -31,4 +35,4 @@ class MisleadingBidirectionalCheck : public ClangTidyCheck {
} // namespace clang::tidy::misc
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISLEADINGBIDIRECTIONAL_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISLEADINGBIDIRECTIONALCHECK_H
diff --git a/clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.cpp b/clang-tools-extra/clang-tidy/misc/MisleadingIdentifierCheck.cpp
similarity index 99%
rename from clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.cpp
rename to clang-tools-extra/clang-tidy/misc/MisleadingIdentifierCheck.cpp
index 3c8a03abc80cd..335fffc5d47af 100644
--- a/clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.cpp
+++ b/clang-tools-extra/clang-tidy/misc/MisleadingIdentifierCheck.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "MisleadingIdentifier.h"
+#include "MisleadingIdentifierCheck.h"
#include "llvm/Support/ConvertUTF.h"
diff --git a/clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.h b/clang-tools-extra/clang-tidy/misc/MisleadingIdentifierCheck.h
similarity index 74%
rename from clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.h
rename to clang-tools-extra/clang-tidy/misc/MisleadingIdentifierCheck.h
index 5c184f8868872..9f8eb4039fa44 100644
--- a/clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.h
+++ b/clang-tools-extra/clang-tidy/misc/MisleadingIdentifierCheck.h
@@ -6,13 +6,19 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISLEADINGIDENTIFIER_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISLEADINGIDENTIFIER_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISLEADINGIDENTIFIERCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISLEADINGIDENTIFIERCHECK_H
#include "../ClangTidyCheck.h"
namespace clang::tidy::misc {
+/// Finds identifiers that contain Unicode characters with right-to-left
+/// direction, which can be confusing as they may change the understanding of a
+/// whole statement line.
+///
+/// For the user-facing documentation see:
+/// https://clang.llvm.org/extra/clang-tidy/checks/misc/misleading-identifier.html
class MisleadingIdentifierCheck : public ClangTidyCheck {
public:
MisleadingIdentifierCheck(StringRef Name, ClangTidyContext *Context);
@@ -24,4 +30,4 @@ class MisleadingIdentifierCheck : public ClangTidyCheck {
} // namespace clang::tidy::misc
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISLEADINGIDENTIFIER_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISLEADINGIDENTIFIERCHECK_H
diff --git a/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp b/clang-tools-extra/clang-tidy/misc/NonCopyableObjectsCheck.cpp
similarity index 98%
rename from clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp
rename to clang-tools-extra/clang-tidy/misc/NonCopyableObjectsCheck.cpp
index b33e2667ef660..bfeb5fa855af6 100644
--- a/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp
+++ b/clang-tools-extra/clang-tidy/misc/NonCopyableObjectsCheck.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "NonCopyableObjects.h"
+#include "NonCopyableObjectsCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
diff --git a/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.h b/clang-tools-extra/clang-tidy/misc/NonCopyableObjectsCheck.h
similarity index 82%
rename from clang-tools-extra/clang-tidy/misc/NonCopyableObjects.h
rename to clang-tools-extra/clang-tidy/misc/NonCopyableObjectsCheck.h
index 2fcbf41dcf5e1..608e07833d000 100644
--- a/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.h
+++ b/clang-tools-extra/clang-tidy/misc/NonCopyableObjectsCheck.h
@@ -6,15 +6,18 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NONCOPYABLEOBJECTS_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NONCOPYABLEOBJECTS_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NONCOPYABLEOBJECTSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NONCOPYABLEOBJECTSCHECK_H
#include "../ClangTidyCheck.h"
namespace clang::tidy::misc {
-/// The check flags dereferences and non-pointer declarations of objects that
+/// Flags dereferences and non-pointer declarations of objects that
/// are not meant to be passed by value, such as C FILE objects.
+///
+/// For the user-facing documentation see:
+/// https://clang.llvm.org/extra/clang-tidy/checks/misc/non-copyable-objects.html
class NonCopyableObjectsCheck : public ClangTidyCheck {
public:
NonCopyableObjectsCheck(StringRef Name, ClangTidyContext *Context)
@@ -25,4 +28,4 @@ class NonCopyableObjectsCheck : public ClangTidyCheck {
} // namespace clang::tidy::misc
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NONCOPYABLEOBJECTS_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NONCOPYABLEOBJECTSCHECK_H
diff --git a/clang-tools-extra/clang-tidy/objc/AssertEquals.cpp b/clang-tools-extra/clang-tidy/objc/AssertEqualsCheck.cpp
similarity index 91%
rename from clang-tools-extra/clang-tidy/objc/AssertEquals.cpp
rename to clang-tools-extra/clang-tidy/objc/AssertEqualsCheck.cpp
index 9d274ee428692..a9e6a4b9ea9bb 100644
--- a/clang-tools-extra/clang-tidy/objc/AssertEquals.cpp
+++ b/clang-tools-extra/clang-tidy/objc/AssertEqualsCheck.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "AssertEquals.h"
+#include "AssertEqualsCheck.h"
#include "llvm/ADT/StringMap.h"
#include <string>
@@ -21,7 +21,7 @@ static const llvm::StringMap<StringRef> NameMap{
{"XCTAssertNotEqual", "XCTAssertNotEqualObjects"},
};
-void AssertEquals::registerMatchers(MatchFinder *Finder) {
+void AssertEqualsCheck::registerMatchers(MatchFinder *Finder) {
for (const auto &[CurrName, _] : NameMap) {
Finder->addMatcher(
binaryOperator(anyOf(hasOperatorName("!="), hasOperatorName("==")),
@@ -35,7 +35,8 @@ void AssertEquals::registerMatchers(MatchFinder *Finder) {
}
}
-void AssertEquals::check(const ast_matchers::MatchFinder::MatchResult &Result) {
+void AssertEqualsCheck::check(
+ const ast_matchers::MatchFinder::MatchResult &Result) {
for (const auto &[CurrName, TargetName] : NameMap) {
if (const auto *Root = Result.Nodes.getNodeAs<BinaryOperator>(CurrName)) {
const SourceManager *Sm = Result.SourceManager;
diff --git a/clang-tools-extra/clang-tidy/objc/AssertEquals.h b/clang-tools-extra/clang-tidy/objc/AssertEqualsCheck.h
similarity index 70%
rename from clang-tools-extra/clang-tidy/objc/AssertEquals.h
rename to clang-tools-extra/clang-tidy/objc/AssertEqualsCheck.h
index 140506560d9cc..237dabac7114c 100644
--- a/clang-tools-extra/clang-tidy/objc/AssertEquals.h
+++ b/clang-tools-extra/clang-tidy/objc/AssertEqualsCheck.h
@@ -6,22 +6,22 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_ASSERTEQUALS_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_ASSERTEQUALS_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_ASSERTEQUALSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_ASSERTEQUALSCHECK_H
#include "../ClangTidyCheck.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
namespace clang::tidy::objc {
-/// Warn if XCTAssertEqual() or XCTAssertNotEqual() is used with at least one
+/// Warns if XCTAssertEqual() or XCTAssertNotEqual() is used with at least one
/// operands of type NSString*.
///
/// For the user-facing documentation see:
/// https://clang.llvm.org/extra/clang-tidy/checks/objc/assert-equals.html
-class AssertEquals final : public ClangTidyCheck {
+class AssertEqualsCheck final : public ClangTidyCheck {
public:
- AssertEquals(StringRef Name, ClangTidyContext *Context)
+ AssertEqualsCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context) {}
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
return LangOpts.ObjC;
@@ -32,4 +32,4 @@ class AssertEquals final : public ClangTidyCheck {
} // namespace clang::tidy::objc
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_ASSERTEQUALS_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_ASSERTEQUALSCHECK_H
diff --git a/clang-tools-extra/clang-tidy/objc/CMakeLists.txt b/clang-tools-extra/clang-tidy/objc/CMakeLists.txt
index e28d25deee84c..2908d11e2a018 100644
--- a/clang-tools-extra/clang-tidy/objc/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/objc/CMakeLists.txt
@@ -4,7 +4,7 @@ set(LLVM_LINK_COMPONENTS
)
add_clang_library(clangTidyObjCModule STATIC
- AssertEquals.cpp
+ AssertEqualsCheck.cpp
AvoidNSErrorInitCheck.cpp
DeallocInCategoryCheck.cpp
ForbiddenSubclassingCheck.cpp
diff --git a/clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp b/clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp
index c21b459964692..411d252e3a4b7 100644
--- a/clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp
@@ -9,7 +9,7 @@
#include "../ClangTidy.h"
#include "../ClangTidyModule.h"
#include "../ClangTidyModuleRegistry.h"
-#include "AssertEquals.h"
+#include "AssertEqualsCheck.h"
#include "AvoidNSErrorInitCheck.h"
#include "DeallocInCategoryCheck.h"
#include "ForbiddenSubclassingCheck.h"
@@ -29,7 +29,7 @@ class ObjCModule : public ClangTidyModule {
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
CheckFactories.registerCheck<AvoidNSErrorInitCheck>(
"objc-avoid-nserror-init");
- CheckFactories.registerCheck<AssertEquals>("objc-assert-equals");
+ CheckFactories.registerCheck<AssertEqualsCheck>("objc-assert-equals");
CheckFactories.registerCheck<DeallocInCategoryCheck>(
"objc-dealloc-in-category");
diff --git a/clang-tools-extra/clang-tidy/performance/CMakeLists.txt b/clang-tools-extra/clang-tidy/performance/CMakeLists.txt
index c6e547c5089fb..9a2f90069edbf 100644
--- a/clang-tools-extra/clang-tidy/performance/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/performance/CMakeLists.txt
@@ -23,7 +23,7 @@ add_clang_library(clangTidyPerformanceModule STATIC
PerformanceTidyModule.cpp
TriviallyDestructibleCheck.cpp
TypePromotionInMathFnCheck.cpp
- UnnecessaryCopyInitialization.cpp
+ UnnecessaryCopyInitializationCheck.cpp
UnnecessaryValueParamCheck.cpp
LINK_LIBS
diff --git a/clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp b/clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp
index ae15208ae3dc5..3497ea7316c6b 100644
--- a/clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp
@@ -26,7 +26,7 @@
#include "NoexceptSwapCheck.h"
#include "TriviallyDestructibleCheck.h"
#include "TypePromotionInMathFnCheck.h"
-#include "UnnecessaryCopyInitialization.h"
+#include "UnnecessaryCopyInitializationCheck.h"
#include "UnnecessaryValueParamCheck.h"
namespace clang::tidy {
@@ -66,7 +66,7 @@ class PerformanceModule : public ClangTidyModule {
"performance-trivially-destructible");
CheckFactories.registerCheck<TypePromotionInMathFnCheck>(
"performance-type-promotion-in-math-fn");
- CheckFactories.registerCheck<UnnecessaryCopyInitialization>(
+ CheckFactories.registerCheck<UnnecessaryCopyInitializationCheck>(
"performance-unnecessary-copy-initialization");
CheckFactories.registerCheck<UnnecessaryValueParamCheck>(
"performance-unnecessary-value-param");
diff --git a/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp b/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitializationCheck.cpp
similarity index 96%
rename from clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp
rename to clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitializationCheck.cpp
index fec4c14577f8c..e6fe857779458 100644
--- a/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp
+++ b/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitializationCheck.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "UnnecessaryCopyInitialization.h"
+#include "UnnecessaryCopyInitializationCheck.h"
#include "../utils/DeclRefExprUtils.h"
#include "../utils/FixItHintUtils.h"
#include "../utils/LexerUtils.h"
@@ -227,7 +227,7 @@ static QualType constructorArgumentType(const VarDecl *OldVar,
return MethodDecl->getReturnType();
}
-UnnecessaryCopyInitialization::UnnecessaryCopyInitialization(
+UnnecessaryCopyInitializationCheck::UnnecessaryCopyInitializationCheck(
StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context),
AllowedTypes(
@@ -235,7 +235,7 @@ UnnecessaryCopyInitialization::UnnecessaryCopyInitialization(
ExcludedContainerTypes(utils::options::parseStringList(
Options.get("ExcludedContainerTypes", ""))) {}
-void UnnecessaryCopyInitialization::registerMatchers(MatchFinder *Finder) {
+void UnnecessaryCopyInitializationCheck::registerMatchers(MatchFinder *Finder) {
auto LocalVarCopiedFrom =
[this](const ast_matchers::internal::Matcher<Expr> &CopyCtorArg) {
return compoundStmt(
@@ -276,7 +276,7 @@ void UnnecessaryCopyInitialization::registerMatchers(MatchFinder *Finder) {
this);
}
-void UnnecessaryCopyInitialization::check(
+void UnnecessaryCopyInitializationCheck::check(
const MatchFinder::MatchResult &Result) {
const auto &NewVar = *Result.Nodes.getNodeAs<VarDecl>("newVarDecl");
const auto &BlockStmt = *Result.Nodes.getNodeAs<Stmt>("blockStmt");
@@ -325,7 +325,7 @@ void UnnecessaryCopyInitialization::check(
}
}
-void UnnecessaryCopyInitialization::handleCopyFromMethodReturn(
+void UnnecessaryCopyInitializationCheck::handleCopyFromMethodReturn(
const CheckContext &Ctx, const VarDecl *ObjectArg) {
const bool IsConstQualified = Ctx.Var.getType().isConstQualified();
if (!IsConstQualified && !Ctx.IsVarOnlyUsedAsConst)
@@ -337,7 +337,7 @@ void UnnecessaryCopyInitialization::handleCopyFromMethodReturn(
diagnoseCopyFromMethodReturn(Ctx);
}
-void UnnecessaryCopyInitialization::handleCopyFromLocalVar(
+void UnnecessaryCopyInitializationCheck::handleCopyFromLocalVar(
const CheckContext &Ctx, const VarDecl &OldVar) {
if (!Ctx.IsVarOnlyUsedAsConst ||
!isInitializingVariableImmutable(OldVar, Ctx.BlockStmt, Ctx.ASTCtx,
@@ -346,7 +346,7 @@ void UnnecessaryCopyInitialization::handleCopyFromLocalVar(
diagnoseCopyFromLocalVar(Ctx, OldVar);
}
-void UnnecessaryCopyInitialization::diagnoseCopyFromMethodReturn(
+void UnnecessaryCopyInitializationCheck::diagnoseCopyFromMethodReturn(
const CheckContext &Ctx) {
auto Diagnostic =
diag(Ctx.Var.getLocation(),
@@ -360,7 +360,7 @@ void UnnecessaryCopyInitialization::diagnoseCopyFromMethodReturn(
maybeIssueFixes(Ctx, Diagnostic);
}
-void UnnecessaryCopyInitialization::diagnoseCopyFromLocalVar(
+void UnnecessaryCopyInitializationCheck::diagnoseCopyFromLocalVar(
const CheckContext &Ctx, const VarDecl &OldVar) {
auto Diagnostic =
diag(Ctx.Var.getLocation(),
@@ -372,7 +372,7 @@ void UnnecessaryCopyInitialization::diagnoseCopyFromLocalVar(
maybeIssueFixes(Ctx, Diagnostic);
}
-void UnnecessaryCopyInitialization::maybeIssueFixes(
+void UnnecessaryCopyInitializationCheck::maybeIssueFixes(
const CheckContext &Ctx, DiagnosticBuilder &Diagnostic) {
if (Ctx.IssueFix) {
if (Ctx.IsVarUnused)
@@ -382,7 +382,7 @@ void UnnecessaryCopyInitialization::maybeIssueFixes(
}
}
-void UnnecessaryCopyInitialization::storeOptions(
+void UnnecessaryCopyInitializationCheck::storeOptions(
ClangTidyOptions::OptionMap &Opts) {
Options.store(Opts, "AllowedTypes",
utils::options::serializeStringList(AllowedTypes));
diff --git a/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.h b/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitializationCheck.h
similarity index 87%
rename from clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.h
rename to clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitializationCheck.h
index 5edc744003c36..89957a5ed09e7 100644
--- a/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.h
+++ b/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitializationCheck.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_UNNECESSARYCOPYINITIALIZATION_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_UNNECESSARYCOPYINITIALIZATION_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_UNNECESSARYCOPYINITIALIZATIONCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_UNNECESSARYCOPYINITIALIZATIONCHECK_H
#include "../ClangTidyCheck.h"
#include "clang/AST/Decl.h"
@@ -22,9 +22,12 @@ namespace clang::tidy::performance {
// The check currently only understands a subset of variables that are
// guaranteed to outlive the const reference returned, namely: const variables,
// const references, and const pointers to const.
-class UnnecessaryCopyInitialization : public ClangTidyCheck {
+//
+// For the user-facing documentation see:
+// https://clang.llvm.org/extra/clang-tidy/checks/performance/unnecessary-copy-initialization.html
+class UnnecessaryCopyInitializationCheck : public ClangTidyCheck {
public:
- UnnecessaryCopyInitialization(StringRef Name, ClangTidyContext *Context);
+ UnnecessaryCopyInitializationCheck(StringRef Name, ClangTidyContext *Context);
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
return LangOpts.CPlusPlus;
}
@@ -64,4 +67,4 @@ class UnnecessaryCopyInitialization : public ClangTidyCheck {
} // namespace clang::tidy::performance
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_UNNECESSARYCOPYINITIALIZATION_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_UNNECESSARYCOPYINITIALIZATIONCHECK_H
diff --git a/clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDecls.cpp b/clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDeclsCheck.cpp
similarity index 91%
rename from clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDecls.cpp
rename to clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDeclsCheck.cpp
index 02fe913ee7918..0e1c389d0d80a 100644
--- a/clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDecls.cpp
+++ b/clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDeclsCheck.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "AvoidConstParamsInDecls.h"
+#include "AvoidConstParamsInDeclsCheck.h"
#include "../utils/LexerUtils.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
@@ -38,11 +38,12 @@ findConstToRemove(const ParmVarDecl &Param,
tok::kw_const, FileRange, *Result.Context, *Result.SourceManager);
}
-void AvoidConstParamsInDecls::storeOptions(ClangTidyOptions::OptionMap &Opts) {
+void AvoidConstParamsInDeclsCheck::storeOptions(
+ ClangTidyOptions::OptionMap &Opts) {
Options.store(Opts, "IgnoreMacros", IgnoreMacros);
}
-void AvoidConstParamsInDecls::registerMatchers(MatchFinder *Finder) {
+void AvoidConstParamsInDeclsCheck::registerMatchers(MatchFinder *Finder) {
const auto ConstParamDecl =
parmVarDecl(hasType(qualType(isConstQualified()))).bind("param");
Finder->addMatcher(functionDecl(unless(isDefinition()),
@@ -51,7 +52,8 @@ void AvoidConstParamsInDecls::registerMatchers(MatchFinder *Finder) {
this);
}
-void AvoidConstParamsInDecls::check(const MatchFinder::MatchResult &Result) {
+void AvoidConstParamsInDeclsCheck::check(
+ const MatchFinder::MatchResult &Result) {
const auto *Func = Result.Nodes.getNodeAs<FunctionDecl>("func");
const auto *Param = Result.Nodes.getNodeAs<ParmVarDecl>("param");
diff --git a/clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDecls.h b/clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDeclsCheck.h
similarity index 78%
rename from clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDecls.h
rename to clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDeclsCheck.h
index 64905085d7de8..467a9a48ef0b7 100644
--- a/clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDecls.h
+++ b/clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDeclsCheck.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_AVOIDCONSTPARAMSINDECLS_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_AVOIDCONSTPARAMSINDECLS_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_AVOIDCONSTPARAMSINDECLSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_AVOIDCONSTPARAMSINDECLSCHECK_H
#include "../ClangTidyCheck.h"
@@ -15,9 +15,12 @@ namespace clang::tidy::readability {
// Detect function declarations that have const value parameters and discourage
// them.
-class AvoidConstParamsInDecls : public ClangTidyCheck {
+//
+// For the user-facing documentation see:
+// https://clang.llvm.org/extra/clang-tidy/checks/readability/avoid-const-params-in-decls.html
+class AvoidConstParamsInDeclsCheck : public ClangTidyCheck {
public:
- AvoidConstParamsInDecls(StringRef Name, ClangTidyContext *Context)
+ AvoidConstParamsInDeclsCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context),
IgnoreMacros(Options.get("IgnoreMacros", true)) {}
@@ -34,4 +37,4 @@ class AvoidConstParamsInDecls : public ClangTidyCheck {
} // namespace clang::tidy::readability
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_AVOIDCONSTPARAMSINDECLS_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_AVOIDCONSTPARAMSINDECLSCHECK_H
diff --git a/clang-tools-extra/clang-tidy/readability/CMakeLists.txt b/clang-tools-extra/clang-tidy/readability/CMakeLists.txt
index 91e9354d454d2..161a0d96caf41 100644
--- a/clang-tools-extra/clang-tidy/readability/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/readability/CMakeLists.txt
@@ -5,7 +5,7 @@ set(LLVM_LINK_COMPONENTS
add_clang_library(clangTidyReadabilityModule STATIC
AmbiguousSmartptrResetCallCheck.cpp
- AvoidConstParamsInDecls.cpp
+ AvoidConstParamsInDeclsCheck.cpp
AvoidNestedConditionalOperatorCheck.cpp
AvoidReturnWithVoidValueCheck.cpp
AvoidUnconditionalPreprocessorIfCheck.cpp
@@ -14,7 +14,7 @@ add_clang_library(clangTidyReadabilityModule STATIC
ContainerContainsCheck.cpp
ContainerDataPointerCheck.cpp
ContainerSizeEmptyCheck.cpp
- ConvertMemberFunctionsToStatic.cpp
+ ConvertMemberFunctionsToStaticCheck.cpp
DeleteNullPointerCheck.cpp
DuplicateIncludeCheck.cpp
ElseAfterReturnCheck.cpp
diff --git a/clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStatic.cpp b/clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStaticCheck.cpp
similarity index 97%
rename from clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStatic.cpp
rename to clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStaticCheck.cpp
index 6da4cf7c6bf94..1383e3b0b77f6 100644
--- a/clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStatic.cpp
+++ b/clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStaticCheck.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "ConvertMemberFunctionsToStatic.h"
+#include "ConvertMemberFunctionsToStaticCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/RecursiveASTVisitor.h"
@@ -78,7 +78,8 @@ AST_MATCHER(CXXMethodDecl, usesThis) {
} // namespace
-void ConvertMemberFunctionsToStatic::registerMatchers(MatchFinder *Finder) {
+void ConvertMemberFunctionsToStaticCheck::registerMatchers(
+ MatchFinder *Finder) {
Finder->addMatcher(
cxxMethodDecl(
isDefinition(), isUserProvided(),
@@ -131,7 +132,7 @@ static SourceRange getLocationOfConst(const TypeSourceInfo *TSI,
return {Start, Start.getLocWithOffset(strlen("const") - 1)};
}
-void ConvertMemberFunctionsToStatic::check(
+void ConvertMemberFunctionsToStaticCheck::check(
const MatchFinder::MatchResult &Result) {
const auto *Definition = Result.Nodes.getNodeAs<CXXMethodDecl>("x");
diff --git a/clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStatic.h b/clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStaticCheck.h
similarity index 80%
rename from clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStatic.h
rename to clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStaticCheck.h
index 20cb7f212d115..4f8a1a974bd50 100644
--- a/clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStatic.h
+++ b/clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStaticCheck.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONVERTMEMBERFUNCTIONSTOSTATIC_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONVERTMEMBERFUNCTIONSTOSTATIC_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONVERTMEMBERFUNCTIONSTOSTATICCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONVERTMEMBERFUNCTIONSTOSTATICCHECK_H
#include "../ClangTidyCheck.h"
@@ -18,10 +18,10 @@ namespace clang::tidy::readability {
///
/// For the user-facing documentation see:
/// https://clang.llvm.org/extra/clang-tidy/checks/
-/// readability-convert-member-functions-to-static.html
-class ConvertMemberFunctionsToStatic : public ClangTidyCheck {
+/// readability/convert-member-functions-to-static.html
+class ConvertMemberFunctionsToStaticCheck : public ClangTidyCheck {
public:
- ConvertMemberFunctionsToStatic(StringRef Name, ClangTidyContext *Context)
+ ConvertMemberFunctionsToStaticCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context) {}
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
return LangOpts.CPlusPlus;
@@ -32,4 +32,4 @@ class ConvertMemberFunctionsToStatic : public ClangTidyCheck {
} // namespace clang::tidy::readability
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONVERTMEMBERFUNCTIONSTOSTATIC_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONVERTMEMBERFUNCTIONSTOSTATICCHECK_H
diff --git a/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp b/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp
index 569302e6065f2..afb63571de583 100644
--- a/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp
@@ -10,7 +10,7 @@
#include "../ClangTidyModule.h"
#include "../ClangTidyModuleRegistry.h"
#include "AmbiguousSmartptrResetCallCheck.h"
-#include "AvoidConstParamsInDecls.h"
+#include "AvoidConstParamsInDeclsCheck.h"
#include "AvoidNestedConditionalOperatorCheck.h"
#include "AvoidReturnWithVoidValueCheck.h"
#include "AvoidUnconditionalPreprocessorIfCheck.h"
@@ -19,7 +19,7 @@
#include "ContainerContainsCheck.h"
#include "ContainerDataPointerCheck.h"
#include "ContainerSizeEmptyCheck.h"
-#include "ConvertMemberFunctionsToStatic.h"
+#include "ConvertMemberFunctionsToStaticCheck.h"
#include "DeleteNullPointerCheck.h"
#include "DuplicateIncludeCheck.h"
#include "ElseAfterReturnCheck.h"
@@ -74,7 +74,7 @@ class ReadabilityModule : public ClangTidyModule {
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
CheckFactories.registerCheck<AmbiguousSmartptrResetCallCheck>(
"readability-ambiguous-smartptr-reset-call");
- CheckFactories.registerCheck<AvoidConstParamsInDecls>(
+ CheckFactories.registerCheck<AvoidConstParamsInDeclsCheck>(
"readability-avoid-const-params-in-decls");
CheckFactories.registerCheck<AvoidNestedConditionalOperatorCheck>(
"readability-avoid-nested-conditional-operator");
@@ -92,7 +92,7 @@ class ReadabilityModule : public ClangTidyModule {
"readability-container-data-pointer");
CheckFactories.registerCheck<ContainerSizeEmptyCheck>(
"readability-container-size-empty");
- CheckFactories.registerCheck<ConvertMemberFunctionsToStatic>(
+ CheckFactories.registerCheck<ConvertMemberFunctionsToStaticCheck>(
"readability-convert-member-functions-to-static");
CheckFactories.registerCheck<DeleteNullPointerCheck>(
"readability-delete-null-pointer");
diff --git a/clang-tools-extra/docs/clang-tidy/checks/cert/fio38-c.rst b/clang-tools-extra/docs/clang-tidy/checks/cert/fio38-c.rst
index aeaaad793ca5c..9eaa12fc223aa 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/cert/fio38-c.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/cert/fio38-c.rst
@@ -8,3 +8,6 @@ cert-fio38-c
The `cert-fio38-c` check is an alias, please see
:doc:`misc-non-copyable-objects <../misc/non-copyable-objects>` for more
information.
+
+This check corresponds to CERT C++ Coding Standard rule `FIO38-C. Do not copy a FILE object
+<https://www.securecoding.cert.org/confluence/display/c/FIO38-C.+Do+not+copy+a+FILE+object>`_.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc/misleading-bidirectional.rst b/clang-tools-extra/docs/clang-tidy/checks/misc/misleading-bidirectional.rst
index 16ffc97d56ab4..e9bc19a4b10e1 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/misc/misleading-bidirectional.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/misc/misleading-bidirectional.rst
@@ -3,7 +3,7 @@
misc-misleading-bidirectional
=============================
-Warn about unterminated bidirectional unicode sequence, detecting potential attack
+Warns about unterminated bidirectional unicode sequence, detecting potential attack
as described in the `Trojan Source <https://www.trojansource.codes>`_ attack.
Example:
diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc/non-copyable-objects.rst b/clang-tools-extra/docs/clang-tidy/checks/misc/non-copyable-objects.rst
index d1f7bba39b37c..d3190e1155f08 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/misc/non-copyable-objects.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/misc/non-copyable-objects.rst
@@ -5,9 +5,12 @@ misc-non-copyable-objects
`cert-fio38-c` redirects here as an alias for this check.
-The check flags dereferences and non-pointer declarations of objects that are
+Flags dereferences and non-pointer declarations of objects that are
not meant to be passed by value, such as C FILE objects or POSIX
``pthread_mutex_t`` objects.
+References
+----------
+
This check corresponds to CERT C++ Coding Standard rule `FIO38-C. Do not copy a FILE object
<https://www.securecoding.cert.org/confluence/display/c/FIO38-C.+Do+not+copy+a+FILE+object>`_.
More information about the cfe-commits
mailing list