Rename the CERT namespace to cert, and update some checkers to use this namespace consistently.
Patch thanks to Haojian Wu! llvm-svn: 256756
This commit is contained in:
parent
5f4f496fcf
commit
1284f04aed
|
@ -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.");
|
||||
|
||||
|
|
|
@ -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 MatchFinder::MatchResult &Result) {
|
|||
diag(E->getExprLoc(), DiagWording) << cast<NamedDecl>(E->getCalleeDecl());
|
||||
}
|
||||
|
||||
} // namespace cert
|
||||
} // namespace tidy
|
||||
} // namespace clang
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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(const MatchFinder::MatchResult &Result) {
|
|||
DiagnosticIDs::Note);
|
||||
}
|
||||
|
||||
} // namespace cert
|
||||
} // namespace tidy
|
||||
} // namespace clang
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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(const MatchFinder::MatchResult &Result) {
|
|||
"thrown exception type is not nothrow copy constructible");
|
||||
}
|
||||
|
||||
} // namespace cert
|
||||
} // namespace tidy
|
||||
} // namespace clang
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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(const MatchFinder::MatchResult &Result) {
|
|||
"parameter pack or currying instead");
|
||||
}
|
||||
|
||||
} // namespace cert
|
||||
} // namespace tidy
|
||||
} // namespace clang
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue