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

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

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(-)

Patch
diff mbox series

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