From 77e71bcfde7264466849babaa0e9ccbec51a8a08 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Sat, 9 Apr 2022 13:24:59 -0700 Subject: [PATCH] [randstruct] NFC change to use static --- clang/unittests/AST/RandstructTest.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/clang/unittests/AST/RandstructTest.cpp b/clang/unittests/AST/RandstructTest.cpp index b64d9fd..9e03bea 100644 --- a/clang/unittests/AST/RandstructTest.cpp +++ b/clang/unittests/AST/RandstructTest.cpp @@ -36,9 +36,7 @@ using namespace clang::randstruct; using field_names = std::vector; -namespace { - -std::unique_ptr makeAST(const std::string &SourceCode) { +static std::unique_ptr makeAST(const std::string &SourceCode) { std::vector Args = getCommandLineArgsForTesting(Lang_C99); Args.push_back("-frandomize-layout-seed=1234567890abcdef"); @@ -51,13 +49,14 @@ std::unique_ptr 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().match( C.getTranslationUnitDecl(), recordDecl(hasName(Name))); return RD; } -std::vector getFieldNamesFromRecord(const RecordDecl *RD) { +static std::vector getFieldNamesFromRecord(const RecordDecl *RD) { std::vector Fields; Fields.reserve(8); @@ -67,7 +66,7 @@ std::vector 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 { -- 2.7.4