From 0230c89710f748153fcab4fb80a7576942922c7d Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 11 Dec 2019 18:58:56 +0000 Subject: [PATCH] function-tests.c: expose selftest::make_fndecl for use elsewhere This is used by new selftests in the analyzer patch kit. gcc/ChangeLog: * function-tests.c (selftest::make_fndecl): Make non-static. * selftest.h (selftest::make_fndecl): New decl. From-SVN: r279242 --- gcc/ChangeLog | 5 +++++ gcc/function-tests.c | 4 ++-- gcc/selftest.h | 7 +++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7841619fa61..160358050bd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-12-11 David Malcolm + + * function-tests.c (selftest::make_fndecl): Make non-static. + * selftest.h (selftest::make_fndecl): New decl. + 2019-12-11 Lewis Hyatt PR 91853 diff --git a/gcc/function-tests.c b/gcc/function-tests.c index 2440dd6820b..f3406c43aee 100644 --- a/gcc/function-tests.c +++ b/gcc/function-tests.c @@ -82,11 +82,11 @@ namespace selftest { /* Helper function for selftests of function-creation. */ -static tree +tree make_fndecl (tree return_type, const char *name, vec ¶m_types, - bool is_variadic = false) + bool is_variadic) { tree fn_type; if (is_variadic) diff --git a/gcc/selftest.h b/gcc/selftest.h index 48d848067cf..11bd3b70172 100644 --- a/gcc/selftest.h +++ b/gcc/selftest.h @@ -171,6 +171,13 @@ class line_table_test ~line_table_test (); }; +/* Helper function for selftests that need a function decl. */ + +extern tree make_fndecl (tree return_type, + const char *name, + vec ¶m_types, + bool is_variadic = false); + /* Run TESTCASE multiple times, once for each case in our test matrix. */ extern void -- 2.30.2