diff mbox series

[13/49] function-tests.c: expose selftest::make_fndecl for use elsewhere

Message ID 1573867416-55618-14-git-send-email-dmalcolm@redhat.com
State New
Headers show
Series RFC: Add a static analysis framework to GCC | expand

Commit Message

David Malcolm Nov. 16, 2019, 1:23 a.m. UTC
This is used by new selftests later on in the patch kit.

gcc/ChangeLog:
	* function-tests.c (selftest::make_fndecl): Make non-static.
	* selftest.h (selftest::make_fndecl): New decl.
---
 gcc/function-tests.c | 4 ++--
 gcc/selftest.h       | 7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

Comments

Jeff Law Dec. 7, 2019, 2:37 p.m. UTC | #1
On Fri, 2019-11-15 at 20:23 -0500, David Malcolm wrote:
> This is used by new selftests later on in the patch kit.
> 
> gcc/ChangeLog:
> 	* function-tests.c (selftest::make_fndecl): Make non-static.
> 	* selftest.h (selftest::make_fndecl): New decl.
OK
jeff
diff mbox series

Patch

diff --git a/gcc/function-tests.c b/gcc/function-tests.c
index 2440dd6..f3406c4 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 <tree> &param_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 165dfff..c67b688 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 <tree> &param_types,
+			 bool is_variadic = false);
+
 /* Run TESTCASE multiple times, once for each case in our test matrix.  */
 
 extern void