Author: aaronballman Date: Mon Jan 4 08:31:14 2016 New Revision: 256756 URL: http://llvm.org/viewvc/llvm-project?rev=256756&view=rev Log: Rename the CERT namespace to cert, and update some checkers to use this namespace consistently.
Patch thanks to Haojian Wu! Modified: clang-tools-extra/trunk/clang-tidy/cert/CERTTidyModule.cpp clang-tools-extra/trunk/clang-tidy/cert/SetLongJmpCheck.cpp clang-tools-extra/trunk/clang-tidy/cert/SetLongJmpCheck.h clang-tools-extra/trunk/clang-tidy/cert/StaticObjectExceptionCheck.cpp clang-tools-extra/trunk/clang-tidy/cert/StaticObjectExceptionCheck.h clang-tools-extra/trunk/clang-tidy/cert/ThrownExceptionTypeCheck.cpp clang-tools-extra/trunk/clang-tidy/cert/ThrownExceptionTypeCheck.h clang-tools-extra/trunk/clang-tidy/cert/VariadicFunctionDefCheck.cpp clang-tools-extra/trunk/clang-tidy/cert/VariadicFunctionDefCheck.h Modified: clang-tools-extra/trunk/clang-tidy/cert/CERTTidyModule.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cert/CERTTidyModule.cpp?rev=256756&r1=256755&r2=256756&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/cert/CERTTidyModule.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/cert/CERTTidyModule.cpp Mon Jan 4 08:31:14 2016 @@ -23,7 +23,7 @@ namespace clang { namespace tidy { -namespace CERT { +namespace cert { class CERTModule : public ClangTidyModule { public: @@ -60,10 +60,10 @@ public: } }; -} // 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."); Modified: clang-tools-extra/trunk/clang-tidy/cert/SetLongJmpCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cert/SetLongJmpCheck.cpp?rev=256756&r1=256755&r2=256756&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/cert/SetLongJmpCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/cert/SetLongJmpCheck.cpp Mon Jan 4 08:31:14 2016 @@ -18,6 +18,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace cert { const char SetLongJmpCheck::DiagWording[] = "do not call %0; consider using exception handling instead"; @@ -73,5 +74,6 @@ void SetLongJmpCheck::check(const MatchF diag(E->getExprLoc(), DiagWording) << cast<NamedDecl>(E->getCalleeDecl()); } +} // namespace cert } // namespace tidy } // namespace clang Modified: clang-tools-extra/trunk/clang-tidy/cert/SetLongJmpCheck.h URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cert/SetLongJmpCheck.h?rev=256756&r1=256755&r2=256756&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/cert/SetLongJmpCheck.h (original) +++ clang-tools-extra/trunk/clang-tidy/cert/SetLongJmpCheck.h Mon Jan 4 08:31:14 2016 @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace cert { /// Guards against use of setjmp/longjmp in C++ code /// @@ -30,8 +31,8 @@ public: static const char DiagWording[]; }; +} // namespace cert } // namespace tidy } // namespace clang #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_SETLONGJMPCHECK_H - Modified: clang-tools-extra/trunk/clang-tidy/cert/StaticObjectExceptionCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cert/StaticObjectExceptionCheck.cpp?rev=256756&r1=256755&r2=256756&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/cert/StaticObjectExceptionCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/cert/StaticObjectExceptionCheck.cpp Mon Jan 4 08:31:14 2016 @@ -16,6 +16,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace cert { void StaticObjectExceptionCheck::registerMatchers(MatchFinder *Finder) { if (!getLangOpts().CPlusPlus) @@ -44,6 +45,6 @@ void StaticObjectExceptionCheck::check(c DiagnosticIDs::Note); } +} // namespace cert } // namespace tidy } // namespace clang - Modified: clang-tools-extra/trunk/clang-tidy/cert/StaticObjectExceptionCheck.h URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cert/StaticObjectExceptionCheck.h?rev=256756&r1=256755&r2=256756&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/cert/StaticObjectExceptionCheck.h (original) +++ clang-tools-extra/trunk/clang-tidy/cert/StaticObjectExceptionCheck.h Mon Jan 4 08:31:14 2016 @@ -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 @@ public: 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 - Modified: clang-tools-extra/trunk/clang-tidy/cert/ThrownExceptionTypeCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cert/ThrownExceptionTypeCheck.cpp?rev=256756&r1=256755&r2=256756&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/cert/ThrownExceptionTypeCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/cert/ThrownExceptionTypeCheck.cpp Mon Jan 4 08:31:14 2016 @@ -16,6 +16,8 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace cert { + void ThrownExceptionTypeCheck::registerMatchers(MatchFinder *Finder) { if (!getLangOpts().CPlusPlus) return; @@ -34,6 +36,6 @@ void ThrownExceptionTypeCheck::check(con "thrown exception type is not nothrow copy constructible"); } +} // namespace cert } // namespace tidy } // namespace clang - Modified: clang-tools-extra/trunk/clang-tidy/cert/ThrownExceptionTypeCheck.h URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cert/ThrownExceptionTypeCheck.h?rev=256756&r1=256755&r2=256756&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/cert/ThrownExceptionTypeCheck.h (original) +++ clang-tools-extra/trunk/clang-tidy/cert/ThrownExceptionTypeCheck.h Mon Jan 4 08:31:14 2016 @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace cert { /// Checks whether a thrown object is nothrow copy constructible. /// @@ -27,8 +28,8 @@ public: 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 - Modified: clang-tools-extra/trunk/clang-tidy/cert/VariadicFunctionDefCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cert/VariadicFunctionDefCheck.cpp?rev=256756&r1=256755&r2=256756&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/cert/VariadicFunctionDefCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/cert/VariadicFunctionDefCheck.cpp Mon Jan 4 08:31:14 2016 @@ -15,6 +15,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace cert { void VariadicFunctionDefCheck::registerMatchers(MatchFinder *Finder) { if (!getLangOpts().CPlusPlus) @@ -36,6 +37,6 @@ void VariadicFunctionDefCheck::check(con "parameter pack or currying instead"); } +} // namespace cert } // namespace tidy } // namespace clang - Modified: clang-tools-extra/trunk/clang-tidy/cert/VariadicFunctionDefCheck.h URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cert/VariadicFunctionDefCheck.h?rev=256756&r1=256755&r2=256756&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/cert/VariadicFunctionDefCheck.h (original) +++ clang-tools-extra/trunk/clang-tidy/cert/VariadicFunctionDefCheck.h Mon Jan 4 08:31:14 2016 @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace cert { /// Guards against any C-style variadic function definitions (not declarations). /// @@ -27,8 +28,8 @@ public: 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 - _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits