Patchwork [v2,4/6] Remove symtab_node and const_symtab_node typedefs.

login
register
mail settings
Submitter David Malcolm
Date Sept. 9, 2013, 7:32 p.m.
Message ID <1378755140-5555-5-git-send-email-dmalcolm@redhat.com>
Download mbox | patch
Permalink /patch/273658/
State New
Headers show

Comments

David Malcolm - Sept. 9, 2013, 7:32 p.m.
gcc/

	* ipa-ref.h (symtab_node): Remove typedef to pointer type, as it
	clashes with the preferred name for the base class.
	(const_symtab_node): Remove redundant typedef.
---
 gcc/ipa-ref.h | 2 --
 1 file changed, 2 deletions(-)
Jan Hubicka - Sept. 10, 2013, 1:37 p.m.
> gcc/
> 
> 	* ipa-ref.h (symtab_node): Remove typedef to pointer type, as it
> 	clashes with the preferred name for the base class.
> 	(const_symtab_node): Remove redundant typedef.

This is OK, too.
Actually it is not only clash - it was really inconsistent to write
symtab_node node;
struct cgraph_node *cnode;

It is good this inconsistency is gone.
Honza
David Malcolm - Oct. 31, 2013, 9:31 p.m.
On Tue, 2013-09-10 at 15:37 +0200, Jan Hubicka wrote:
> > gcc/
> > 
> > 	* ipa-ref.h (symtab_node): Remove typedef to pointer type, as it
> > 	clashes with the preferred name for the base class.
> > 	(const_symtab_node): Remove redundant typedef.
> 
> This is OK, too.
> Actually it is not only clash - it was really inconsistent to write
> symtab_node node;
> struct cgraph_node *cnode;
> 
> It is good this inconsistency is gone.

I've (finally) committed this to trunk (as r204278), followed by the
automated renaming patch (as r204279), having rechecked the bootstrap
and regrtest on x86_64-unknown-linux-gnu (RHEL 6.4, in fact).

So (at long last), the base class is symtab_node, with cgraph_node and
varpool_node as C++ subclasses, and the "pointerness" of these types is
consistent (i.e. none of them are pointers).

Dave

Patch

diff --git a/gcc/ipa-ref.h b/gcc/ipa-ref.h
index dc6e238..d5ea7ee 100644
--- a/gcc/ipa-ref.h
+++ b/gcc/ipa-ref.h
@@ -21,8 +21,6 @@  along with GCC; see the file COPYING3.  If not see
 struct cgraph_node;
 struct varpool_node;
 class symtab_node_base;
-typedef symtab_node_base *symtab_node;
-typedef const symtab_node_base *const_symtab_node;
 
 
 /* How the reference is done.  */