66//
77// ===----------------------------------------------------------------------===//
88
9- #include " ProperlySeededRandomGeneratorCheck .h"
9+ #include " RandomGeneratorSeedCheck .h"
1010#include " clang/AST/ASTContext.h"
1111#include " clang/ASTMatchers/ASTMatchFinder.h"
1212#include " llvm/ADT/STLExtras.h"
1313
1414using namespace clang ::ast_matchers;
1515
16- namespace clang ::tidy::cert {
16+ namespace clang ::tidy::bugprone {
1717
18- ProperlySeededRandomGeneratorCheck::ProperlySeededRandomGeneratorCheck (
18+ RandomGeneratorSeedCheck::RandomGeneratorSeedCheck (
1919 StringRef Name, ClangTidyContext *Context)
2020 : ClangTidyCheck(Name, Context),
2121 RawDisallowedSeedTypes (
2222 Options.get(" DisallowedSeedTypes" , " time_t,std::time_t" )) {
2323 RawDisallowedSeedTypes.split (DisallowedSeedTypes, ' ,' );
2424}
2525
26- void ProperlySeededRandomGeneratorCheck ::storeOptions (
26+ void RandomGeneratorSeedCheck ::storeOptions (
2727 ClangTidyOptions::OptionMap &Opts) {
2828 Options.store (Opts, " DisallowedSeedTypes" , RawDisallowedSeedTypes);
2929}
3030
31- void ProperlySeededRandomGeneratorCheck ::registerMatchers (MatchFinder *Finder) {
31+ void RandomGeneratorSeedCheck ::registerMatchers (MatchFinder *Finder) {
3232 auto RandomGeneratorEngineDecl = cxxRecordDecl (hasAnyName (
3333 " ::std::linear_congruential_engine" , " ::std::mersenne_twister_engine" ,
3434 " ::std::subtract_with_carry_engine" , " ::std::discard_block_engine" ,
@@ -75,7 +75,7 @@ void ProperlySeededRandomGeneratorCheck::registerMatchers(MatchFinder *Finder) {
7575 this );
7676}
7777
78- void ProperlySeededRandomGeneratorCheck ::check (
78+ void RandomGeneratorSeedCheck ::check (
7979 const MatchFinder::MatchResult &Result) {
8080 const auto *Ctor = Result.Nodes .getNodeAs <CXXConstructExpr>(" ctor" );
8181 if (Ctor)
@@ -91,7 +91,7 @@ void ProperlySeededRandomGeneratorCheck::check(
9191}
9292
9393template <class T >
94- void ProperlySeededRandomGeneratorCheck ::checkSeed (
94+ void RandomGeneratorSeedCheck ::checkSeed (
9595 const MatchFinder::MatchResult &Result, const T *Func) {
9696 if (Func->getNumArgs () == 0 || Func->getArg (0 )->isDefaultArgument ()) {
9797 diag (Func->getExprLoc (),
@@ -118,4 +118,4 @@ void ProperlySeededRandomGeneratorCheck::checkSeed(
118118 }
119119}
120120
121- } // namespace clang::tidy::cert
121+ } // namespace clang::tidy::bugprone
0 commit comments