[clang-tidy] rename_check.py misc-string-constructor bugprone-string-constructor
Summary:
Rename misc-string-constructor to bugprone-string-constructor +
manually update the lenght of '==='s in the doc file.
Reviewers: hokein, xazax.hun
Reviewed By: hokein, xazax.hun
Subscribers: mgorny, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D40388
llvm-svn: 318916
diff --git a/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp b/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
index a5b3d64..1719500 100644
--- a/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
@@ -13,6 +13,7 @@
#include "CopyConstructorInitCheck.h"
#include "IntegerDivisionCheck.h"
#include "MisplacedOperatorInStrlenInAllocCheck.h"
+#include "StringConstructorCheck.h"
#include "SuspiciousMemsetUsageCheck.h"
#include "UndefinedMemoryManipulationCheck.h"
@@ -29,6 +30,8 @@
"bugprone-integer-division");
CheckFactories.registerCheck<MisplacedOperatorInStrlenInAllocCheck>(
"bugprone-misplaced-operator-in-strlen-in-alloc");
+ CheckFactories.registerCheck<StringConstructorCheck>(
+ "bugprone-string-constructor");
CheckFactories.registerCheck<SuspiciousMemsetUsageCheck>(
"bugprone-suspicious-memset-usage");
CheckFactories.registerCheck<UndefinedMemoryManipulationCheck>(
diff --git a/clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt b/clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
index 46101c6..db724ea 100644
--- a/clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
@@ -5,6 +5,7 @@
CopyConstructorInitCheck.cpp
IntegerDivisionCheck.cpp
MisplacedOperatorInStrlenInAllocCheck.cpp
+ StringConstructorCheck.cpp
SuspiciousMemsetUsageCheck.cpp
UndefinedMemoryManipulationCheck.cpp
diff --git a/clang-tools-extra/clang-tidy/misc/StringConstructorCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.cpp
similarity index 98%
rename from clang-tools-extra/clang-tidy/misc/StringConstructorCheck.cpp
rename to clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.cpp
index 7ff4881..5607ce6 100644
--- a/clang-tools-extra/clang-tidy/misc/StringConstructorCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.cpp
@@ -16,7 +16,7 @@
namespace clang {
namespace tidy {
-namespace misc {
+namespace bugprone {
AST_MATCHER_P(IntegerLiteral, isBiggerThan, unsigned, N) {
return Node.getValue().getZExtValue() > N;
@@ -129,6 +129,6 @@
}
}
-} // namespace misc
+} // namespace bugprone
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/StringConstructorCheck.h b/clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.h
similarity index 74%
rename from clang-tools-extra/clang-tidy/misc/StringConstructorCheck.h
rename to clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.h
index ca32fb6..52e9791 100644
--- a/clang-tools-extra/clang-tidy/misc/StringConstructorCheck.h
+++ b/clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.h
@@ -7,19 +7,19 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_STRING_CONSTRUCTOR_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_STRING_CONSTRUCTOR_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_STRING_CONSTRUCTOR_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_STRING_CONSTRUCTOR_H
#include "../ClangTidy.h"
namespace clang {
namespace tidy {
-namespace misc {
+namespace bugprone {
/// Finds suspicious string constructor and check their parameters.
///
/// For the user-facing documentation see:
-/// http://clang.llvm.org/extra/clang-tidy/checks/misc-string-constructor.html
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-string-constructor.html
class StringConstructorCheck : public ClangTidyCheck {
public:
StringConstructorCheck(StringRef Name, ClangTidyContext *Context);
@@ -32,8 +32,8 @@
const unsigned int LargeLengthThreshold;
};
-} // namespace misc
+} // namespace bugprone
} // namespace tidy
} // namespace clang
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_STRING_CONSTRUCTOR_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_STRING_CONSTRUCTOR_H
diff --git a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
index 9e74387..b67b4f7 100644
--- a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
@@ -31,7 +31,6 @@
SizeofExpressionCheck.cpp
StaticAssertCheck.cpp
StringCompareCheck.cpp
- StringConstructorCheck.cpp
StringIntegerAssignmentCheck.cpp
StringLiteralWithEmbeddedNulCheck.cpp
SuspiciousEnumUsageCheck.cpp
diff --git a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
index 5448c04..8dab93e 100644
--- a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
@@ -38,7 +38,6 @@
#include "SizeofExpressionCheck.h"
#include "StaticAssertCheck.h"
#include "StringCompareCheck.h"
-#include "StringConstructorCheck.h"
#include "StringIntegerAssignmentCheck.h"
#include "StringLiteralWithEmbeddedNulCheck.h"
#include "SuspiciousEnumUsageCheck.h"
@@ -114,8 +113,6 @@
"misc-sizeof-expression");
CheckFactories.registerCheck<StaticAssertCheck>("misc-static-assert");
CheckFactories.registerCheck<StringCompareCheck>("misc-string-compare");
- CheckFactories.registerCheck<StringConstructorCheck>(
- "misc-string-constructor");
CheckFactories.registerCheck<StringIntegerAssignmentCheck>(
"misc-string-integer-assignment");
CheckFactories.registerCheck<StringLiteralWithEmbeddedNulCheck>(