Rename the CERT namespace to cert, and update some checkers to use this namespace consistently.
Patch thanks to Haojian Wu!
llvm-svn: 256756
diff --git a/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp b/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
index 05d6480..4e0a6ed 100644
--- a/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
@@ -23,7 +23,7 @@
namespace clang {
namespace tidy {
-namespace CERT {
+namespace cert {
class CERTModule : public ClangTidyModule {
public:
@@ -60,10 +60,10 @@
}
};
-} // namespace misc
+} // namespace cert
// Register the MiscTidyModule using this statically initialized variable.
-static ClangTidyModuleRegistry::Add<CERT::CERTModule>
+static ClangTidyModuleRegistry::Add<cert::CERTModule>
X("cert-module",
"Adds lint checks corresponding to CERT secure coding guidelines.");
diff --git a/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp b/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp
index bc5b353..89ba5e7 100644
--- a/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp
@@ -18,6 +18,7 @@
namespace clang {
namespace tidy {
+namespace cert {
const char SetLongJmpCheck::DiagWording[] =
"do not call %0; consider using exception handling instead";
@@ -73,5 +74,6 @@
diag(E->getExprLoc(), DiagWording) << cast<NamedDecl>(E->getCalleeDecl());
}
+} // namespace cert
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.h b/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.h
index 17fa110..1d6c098 100644
--- a/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.h
+++ b/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace cert {
/// Guards against use of setjmp/longjmp in C++ code
///
@@ -30,8 +31,8 @@
static const char DiagWording[];
};
+} // namespace cert
} // namespace tidy
} // namespace clang
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_SETLONGJMPCHECK_H
-
diff --git a/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.cpp b/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.cpp
index 4954fe3..53597fa 100644
--- a/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.cpp
@@ -16,6 +16,7 @@
namespace clang {
namespace tidy {
+namespace cert {
void StaticObjectExceptionCheck::registerMatchers(MatchFinder *Finder) {
if (!getLangOpts().CPlusPlus)
@@ -44,6 +45,6 @@
DiagnosticIDs::Note);
}
+} // namespace cert
} // namespace tidy
} // namespace clang
-
diff --git a/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.h b/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.h
index 14dfb08..463f433 100644
--- a/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.h
+++ b/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace cert {
/// Checks whether the constructor for a static or thread_local object will
/// throw.
@@ -28,8 +29,8 @@
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace cert
} // namespace tidy
} // namespace clang
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_ERR58_CPP_H
-
diff --git a/clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.cpp b/clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.cpp
index f569789..c9c5f3e 100644
--- a/clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.cpp
@@ -16,6 +16,8 @@
namespace clang {
namespace tidy {
+namespace cert {
+
void ThrownExceptionTypeCheck::registerMatchers(MatchFinder *Finder) {
if (!getLangOpts().CPlusPlus)
return;
@@ -34,6 +36,6 @@
"thrown exception type is not nothrow copy constructible");
}
+} // namespace cert
} // namespace tidy
} // namespace clang
-
diff --git a/clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.h b/clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.h
index 0b1d5f3..e05539e 100644
--- a/clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.h
+++ b/clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace cert {
/// Checks whether a thrown object is nothrow copy constructible.
///
@@ -27,8 +28,8 @@
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace cert
} // namespace tidy
} // namespace clang
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_THROWNEXCEPTIONTYPECHECK_H
-
diff --git a/clang-tools-extra/clang-tidy/cert/VariadicFunctionDefCheck.cpp b/clang-tools-extra/clang-tidy/cert/VariadicFunctionDefCheck.cpp
index a5f8fa7..ea6112a 100644
--- a/clang-tools-extra/clang-tidy/cert/VariadicFunctionDefCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cert/VariadicFunctionDefCheck.cpp
@@ -15,6 +15,7 @@
namespace clang {
namespace tidy {
+namespace cert {
void VariadicFunctionDefCheck::registerMatchers(MatchFinder *Finder) {
if (!getLangOpts().CPlusPlus)
@@ -36,6 +37,6 @@
"parameter pack or currying instead");
}
+} // namespace cert
} // namespace tidy
} // namespace clang
-
diff --git a/clang-tools-extra/clang-tidy/cert/VariadicFunctionDefCheck.h b/clang-tools-extra/clang-tidy/cert/VariadicFunctionDefCheck.h
index 7463063..e215e8d 100644
--- a/clang-tools-extra/clang-tidy/cert/VariadicFunctionDefCheck.h
+++ b/clang-tools-extra/clang-tidy/cert/VariadicFunctionDefCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace cert {
/// Guards against any C-style variadic function definitions (not declarations).
///
@@ -27,8 +28,8 @@
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace cert
} // namespace tidy
} // namespace clang
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_VARIADICFUNCTIONDEF_H
-