[randstruct] NFC change to use static
authorBill Wendling <isanbard@gmail.com>
Sat, 9 Apr 2022 20:24:59 +0000 (13:24 -0700)
committerBill Wendling <isanbard@gmail.com>
Sat, 9 Apr 2022 20:25:25 +0000 (13:25 -0700)
clang/unittests/AST/RandstructTest.cpp

index b64d9fd..9e03bea 100644 (file)
@@ -36,9 +36,7 @@ using namespace clang::randstruct;
 
 using field_names = std::vector<std::string>;
 
-namespace {
-
-std::unique_ptr<ASTUnit> makeAST(const std::string &SourceCode) {
+static std::unique_ptr<ASTUnit> makeAST(const std::string &SourceCode) {
   std::vector<std::string> Args = getCommandLineArgsForTesting(Lang_C99);
   Args.push_back("-frandomize-layout-seed=1234567890abcdef");
 
@@ -51,13 +49,14 @@ std::unique_ptr<ASTUnit> makeAST(const std::string &SourceCode) {
       tooling::FileContentMappings(), &IgnoringConsumer);
 }
 
-RecordDecl *getRecordDeclFromAST(const ASTContext &C, const std::string &Name) {
+static RecordDecl *getRecordDeclFromAST(const ASTContext &C,
+                                        const std::string &Name) {
   RecordDecl *RD = FirstDeclMatcher<RecordDecl>().match(
       C.getTranslationUnitDecl(), recordDecl(hasName(Name)));
   return RD;
 }
 
-std::vector<std::string> getFieldNamesFromRecord(const RecordDecl *RD) {
+static std::vector<std::string> getFieldNamesFromRecord(const RecordDecl *RD) {
   std::vector<std::string> Fields;
 
   Fields.reserve(8);
@@ -67,7 +66,7 @@ std::vector<std::string> getFieldNamesFromRecord(const RecordDecl *RD) {
   return Fields;
 }
 
-bool isSubsequence(const field_names &Seq, const field_names &Subseq) {
+static bool isSubsequence(const field_names &Seq, const field_names &Subseq) {
   unsigned SeqLen = Seq.size();
   unsigned SubLen = Subseq.size();
 
@@ -86,8 +85,6 @@ bool isSubsequence(const field_names &Seq, const field_names &Subseq) {
   return IsSubseq;
 }
 
-} // end anonymous namespace
-
 namespace clang {
 namespace ast_matchers {