diff mbox series

[C] /[C++] Remove DECL_FROM_INLINE use

Message ID alpine.LSU.2.20.1810011514090.16707@zhemvz.fhfr.qr
State New
Headers show
Series [C] /[C++] Remove DECL_FROM_INLINE use | expand

Commit Message

Richard Biener Oct. 1, 2018, 1:15 p.m. UTC
This patch removes checks of DECL_FROM_INLINE from the respective
-Wshadow code of the C/C++ FE.  I noticed those when looking after
DECL_ABSTRACT_ORIGIN uses.  Those checks may be from times where
we did inlining very early?

Bootstrapped and tested on x86_64-unknown-linux-gnu with no regression.

OK for trunk?

Thanks,
Richard.

2018-10-01  Richard Biener  <rguenther@suse.de>

	c/
	* c-decl.c (warn_if_shadowing): Do not test DECL_FROM_INLINE.

	cp/
	* name-lookup.c (check_local_shadow): Do not test DECL_FROM_INLINE.

Comments

Joseph Myers Oct. 1, 2018, 5:14 p.m. UTC | #1
On Mon, 1 Oct 2018, Richard Biener wrote:

> This patch removes checks of DECL_FROM_INLINE from the respective
> -Wshadow code of the C/C++ FE.  I noticed those when looking after
> DECL_ABSTRACT_ORIGIN uses.  Those checks may be from times where
> we did inlining very early?
> 
> Bootstrapped and tested on x86_64-unknown-linux-gnu with no regression.
> 
> OK for trunk?

The C change is OK.
Jason Merrill Oct. 1, 2018, 7:02 p.m. UTC | #2
OK.
On Mon, Oct 1, 2018 at 1:14 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Mon, 1 Oct 2018, Richard Biener wrote:
>
> > This patch removes checks of DECL_FROM_INLINE from the respective
> > -Wshadow code of the C/C++ FE.  I noticed those when looking after
> > DECL_ABSTRACT_ORIGIN uses.  Those checks may be from times where
> > we did inlining very early?
> >
> > Bootstrapped and tested on x86_64-unknown-linux-gnu with no regression.
> >
> > OK for trunk?
>
> The C change is OK.
>
> --
> Joseph S. Myers
> joseph@codesourcery.com
diff mbox series

Patch

Index: gcc/c/c-decl.c
===================================================================
--- gcc/c/c-decl.c	(revision 264757)
+++ gcc/c/c-decl.c	(working copy)
@@ -2784,9 +2784,7 @@  warn_if_shadowing (tree new_decl)
         || warn_shadow_local
         || warn_shadow_compatible_local)
       /* No shadow warnings for internally generated vars.  */
-      || DECL_IS_BUILTIN (new_decl)
-      /* No shadow warnings for vars made for inlining.  */
-      || DECL_FROM_INLINE (new_decl))
+      || DECL_IS_BUILTIN (new_decl))
     return;
 
   /* Is anything being shadowed?  Invisible decls do not count.  */
Index: gcc/cp/name-lookup.c
===================================================================
--- gcc/cp/name-lookup.c	(revision 264757)
+++ gcc/cp/name-lookup.c	(working copy)
@@ -2628,10 +2628,6 @@  check_local_shadow (tree decl)
   if (TREE_CODE (decl) == PARM_DECL && !DECL_CONTEXT (decl))
     return;
 
-  /* Inline decls shadow nothing.  */
-  if (DECL_FROM_INLINE (decl))
-    return;
-
   /* External decls are something else.  */
   if (DECL_EXTERNAL (decl))
     return;