diff mbox

[C] delete unused function

Message ID 131af549-b870-3931-82e1-8d084faa15c5@acm.org
State New
Headers show

Commit Message

Nathan Sidwell May 18, 2017, 10:57 a.m. UTC
In searching around for but 80803 I discovered that pushdecl_top_level 
appears unused in the C FE.  grepping under the gcc directory I find 
definitions and uses in the c++ FE and separate def/use in the fortran 
FE.  In the C FE I only find a definition.

AFAICT this is a stale function and comment about objective C, which 
presumably uses the pushdecl hook these days?

bootstrapping shows no regression. (I don't think this explains the 
80803 problem)

ok?

nathan

Comments

Marek Polacek May 18, 2017, 11:16 a.m. UTC | #1
On Thu, May 18, 2017 at 06:57:36AM -0400, Nathan Sidwell wrote:
> In searching around for but 80803 I discovered that pushdecl_top_level
> appears unused in the C FE.  grepping under the gcc directory I find
> definitions and uses in the c++ FE and separate def/use in the fortran FE.
> In the C FE I only find a definition.

I couldn't find anything, either.

> AFAICT this is a stale function and comment about objective C, which
> presumably uses the pushdecl hook these days?
> 
> bootstrapping shows no regression. (I don't think this explains the 80803
> problem)
> 
> ok?

Ok.

	Marek
diff mbox

Patch

2017-05-18  Nathan Sidwell  <nathan@acm.org>

	* c-decl.c (pushdecl_top_level): Delete unused function.

Index: c/c-decl.c
===================================================================
--- c/c-decl.c	(revision 248144)
+++ c/c-decl.c	(working copy)
@@ -3088,34 +3088,6 @@  pushdecl (tree x)
     }
   return x;
 }
-
-/* Record X as belonging to file scope.
-   This is used only internally by the Objective-C front end,
-   and is limited to its needs.  duplicate_decls is not called;
-   if there is any preexisting decl for this identifier, it is an ICE.  */
-
-tree
-pushdecl_top_level (tree x)
-{
-  tree name;
-  bool nested = false;
-  gcc_assert (VAR_P (x) || TREE_CODE (x) == CONST_DECL);
-
-  name = DECL_NAME (x);
-
- gcc_assert (TREE_CODE (x) == CONST_DECL || !I_SYMBOL_BINDING (name));
-
-  if (TREE_PUBLIC (x))
-    {
-      bind (name, x, external_scope, /*invisible=*/true, /*nested=*/false,
-	    UNKNOWN_LOCATION);
-      nested = true;
-    }
-  if (file_scope)
-    bind (name, x, file_scope, /*invisible=*/false, nested, UNKNOWN_LOCATION);
-
-  return x;
-}
 
 
 /* Issue a warning about implicit function declaration.  ID is the function