[Fortran,3/7] Fortran: make some constructor* functions static

Message ID 20211024223023.1410274-4-rep.dot.nop@gmail.com
State Committed
Commit e90e0301d575ee299dc823be8c489ee6248057ff
Headers
Series delete some unused decls, make static |

Commit Message

Bernhard Reutner-Fischer Oct. 24, 2021, 10:30 p.m. UTC
  From: Bernhard Reutner-Fischer <aldot@gcc.gnu.org>

gfc_constructor_expr_foreach and gfc_constructor_swap were just stubs.

gcc/fortran/ChangeLog:

	* constructor.c (gfc_constructor_get_base): Make static.
	(gfc_constructor_expr_foreach, (gfc_constructor_swap): Delete.
	* constructor.h (gfc_constructor_get_base): Remove declaration.
	(gfc_constructor_expr_foreach, (gfc_constructor_swap): Delete.
---
 gcc/fortran/constructor.c | 20 ++------------------
 gcc/fortran/constructor.h | 10 ----------
 2 files changed, 2 insertions(+), 28 deletions(-)
  

Comments

Tobias Burnus Oct. 26, 2021, 9:30 a.m. UTC | #1
On 25.10.21 00:30, Bernhard Reutner-Fischer via Fortran wrote:
> From: Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
> gfc_constructor_expr_foreach and gfc_constructor_swap were just stubs.
> gcc/fortran/ChangeLog:
>
>       * constructor.c (gfc_constructor_get_base): Make static.
>       (gfc_constructor_expr_foreach, (gfc_constructor_swap): Delete.
>       * constructor.h (gfc_constructor_get_base): Remove declaration.
>       (gfc_constructor_expr_foreach, (gfc_constructor_swap): Delete.

OK. Thanks for the cleanup.

Tobias

> ---
>   gcc/fortran/constructor.c | 20 ++------------------
>   gcc/fortran/constructor.h | 10 ----------
>   2 files changed, 2 insertions(+), 28 deletions(-)
>
> diff --git a/gcc/fortran/constructor.c b/gcc/fortran/constructor.c
> index 3e4377a5ad3..4b5a748271b 100644
> --- a/gcc/fortran/constructor.c
> +++ b/gcc/fortran/constructor.c
> @@ -85,7 +85,8 @@ gfc_constructor_get (void)
>     return c;
>   }
>
> -gfc_constructor_base gfc_constructor_get_base (void)
> +static gfc_constructor_base
> +gfc_constructor_get_base (void)
>   {
>     return splay_tree_new (splay_tree_compare_ints, NULL, node_free);
>   }
> @@ -209,23 +210,6 @@ gfc_constructor_lookup_expr (gfc_constructor_base base, int offset)
>   }
>
>
> -int
> -gfc_constructor_expr_foreach (gfc_constructor *ctor ATTRIBUTE_UNUSED,
> -                           int(*f)(gfc_expr *) ATTRIBUTE_UNUSED)
> -{
> -  gcc_assert (0);
> -  return 0;
> -}
> -
> -void
> -gfc_constructor_swap (gfc_constructor *ctor ATTRIBUTE_UNUSED,
> -                      int n ATTRIBUTE_UNUSED, int m ATTRIBUTE_UNUSED)
> -{
> -  gcc_assert (0);
> -}
> -
> -
> -
>   gfc_constructor *
>   gfc_constructor_first (gfc_constructor_base base)
>   {
> diff --git a/gcc/fortran/constructor.h b/gcc/fortran/constructor.h
> index 85a72dcfc0e..25cd6a8f192 100644
> --- a/gcc/fortran/constructor.h
> +++ b/gcc/fortran/constructor.h
> @@ -23,8 +23,6 @@ along with GCC; see the file COPYING3.  If not see
>   /* Get a new constructor structure.  */
>   gfc_constructor *gfc_constructor_get (void);
>
> -gfc_constructor_base gfc_constructor_get_base (void);
> -
>   /* Copy a constructor structure.  */
>   gfc_constructor_base gfc_constructor_copy (gfc_constructor_base base);
>
> @@ -64,14 +62,6 @@ gfc_constructor *gfc_constructor_lookup (gfc_constructor_base base, int n);
>   */
>   gfc_expr *gfc_constructor_lookup_expr (gfc_constructor_base base, int n);
>
> -
> -int gfc_constructor_expr_foreach (gfc_constructor *ctor, int(*)(gfc_expr *));
> -
> -
> -void gfc_constructor_swap (gfc_constructor *ctor, int n, int m);
> -
> -
> -
>   /* Get the first constructor node in the constructure structure.
>      Returns NULL if there is no such expression.  */
>   gfc_constructor *gfc_constructor_first (gfc_constructor_base base);
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
  

Patch

diff --git a/gcc/fortran/constructor.c b/gcc/fortran/constructor.c
index 3e4377a5ad3..4b5a748271b 100644
--- a/gcc/fortran/constructor.c
+++ b/gcc/fortran/constructor.c
@@ -85,7 +85,8 @@  gfc_constructor_get (void)
   return c;
 }
 
-gfc_constructor_base gfc_constructor_get_base (void)
+static gfc_constructor_base
+gfc_constructor_get_base (void)
 {
   return splay_tree_new (splay_tree_compare_ints, NULL, node_free);
 }
@@ -209,23 +210,6 @@  gfc_constructor_lookup_expr (gfc_constructor_base base, int offset)
 }
 
 
-int
-gfc_constructor_expr_foreach (gfc_constructor *ctor ATTRIBUTE_UNUSED,
-			      int(*f)(gfc_expr *) ATTRIBUTE_UNUSED)
-{
-  gcc_assert (0);
-  return 0;
-}
-
-void
-gfc_constructor_swap (gfc_constructor *ctor ATTRIBUTE_UNUSED,
-                      int n ATTRIBUTE_UNUSED, int m ATTRIBUTE_UNUSED)
-{
-  gcc_assert (0);
-}
-
-
-
 gfc_constructor *
 gfc_constructor_first (gfc_constructor_base base)
 {
diff --git a/gcc/fortran/constructor.h b/gcc/fortran/constructor.h
index 85a72dcfc0e..25cd6a8f192 100644
--- a/gcc/fortran/constructor.h
+++ b/gcc/fortran/constructor.h
@@ -23,8 +23,6 @@  along with GCC; see the file COPYING3.  If not see
 /* Get a new constructor structure.  */
 gfc_constructor *gfc_constructor_get (void);
 
-gfc_constructor_base gfc_constructor_get_base (void);
-
 /* Copy a constructor structure.  */
 gfc_constructor_base gfc_constructor_copy (gfc_constructor_base base);
 
@@ -64,14 +62,6 @@  gfc_constructor *gfc_constructor_lookup (gfc_constructor_base base, int n);
 */
 gfc_expr *gfc_constructor_lookup_expr (gfc_constructor_base base, int n);
 
-
-int gfc_constructor_expr_foreach (gfc_constructor *ctor, int(*)(gfc_expr *));
-
-
-void gfc_constructor_swap (gfc_constructor *ctor, int n, int m);
-
-
-
 /* Get the first constructor node in the constructure structure.
    Returns NULL if there is no such expression.  */
 gfc_constructor *gfc_constructor_first (gfc_constructor_base base);