diff mbox

[v2,3/6] Split symtab_node declarations onto multiple lines

Message ID 1378755140-5555-4-git-send-email-dmalcolm@redhat.com
State New
Headers show

Commit Message

David Malcolm Sept. 9, 2013, 7:32 p.m. UTC
Amongst other things, the rename_symtab.py script converts
"symtab_node" to "symtab_node *".

This will lead to broken code on declarations that declare
more than one variable (only the first would get a "*"), so split
up such declarations.

gcc/
	* cgraphunit.c (analyze_functions): Split symtab_node
	declarations onto multiple lines to make things easier
	for rename_symtab.py.

	* symtab.c (symtab_dissolve_same_comdat_group_list): Likewise.
	(symtab_semantically_equivalent_p): Likewise.

gcc/lto
	* lto-symtab.c (lto_symtab_merge_decls_2): Split symtab_node
	declarations onto multiple lines to make things easier for
	rename_symtab.py.
	(lto_symtab_merge_decls_1): Likewise.
	(lto_symtab_merge_symbols_1): Likewise.
---
 gcc/cgraphunit.c     | 3 ++-
 gcc/lto/lto-symtab.c | 9 ++++++---
 gcc/symtab.c         | 6 ++++--
 3 files changed, 12 insertions(+), 6 deletions(-)

Comments

Jan Hubicka Sept. 10, 2013, 1:36 p.m. UTC | #1
> Amongst other things, the rename_symtab.py script converts
> "symtab_node" to "symtab_node *".
> 
> This will lead to broken code on declarations that declare
> more than one variable (only the first would get a "*"), so split
> up such declarations.
> 
> gcc/
> 	* cgraphunit.c (analyze_functions): Split symtab_node
> 	declarations onto multiple lines to make things easier
> 	for rename_symtab.py.
> 
> 	* symtab.c (symtab_dissolve_same_comdat_group_list): Likewise.
> 	(symtab_semantically_equivalent_p): Likewise.
> 
> gcc/lto
> 	* lto-symtab.c (lto_symtab_merge_decls_2): Split symtab_node
> 	declarations onto multiple lines to make things easier for
> 	rename_symtab.py.
> 	(lto_symtab_merge_decls_1): Likewise.
> 	(lto_symtab_merge_symbols_1): Likewise.

OK
Honza
David Malcolm Oct. 30, 2013, 3:59 p.m. UTC | #2
On Tue, 2013-09-10 at 15:36 +0200, Jan Hubicka wrote:
> > Amongst other things, the rename_symtab.py script converts
> > "symtab_node" to "symtab_node *".
> > 
> > This will lead to broken code on declarations that declare
> > more than one variable (only the first would get a "*"), so split
> > up such declarations.
> > 
> > gcc/
> > 	* cgraphunit.c (analyze_functions): Split symtab_node
> > 	declarations onto multiple lines to make things easier
> > 	for rename_symtab.py.
> > 
> > 	* symtab.c (symtab_dissolve_same_comdat_group_list): Likewise.
> > 	(symtab_semantically_equivalent_p): Likewise.
> > 
> > gcc/lto
> > 	* lto-symtab.c (lto_symtab_merge_decls_2): Split symtab_node
> > 	declarations onto multiple lines to make things easier for
> > 	rename_symtab.py.
> > 	(lto_symtab_merge_decls_1): Likewise.
> > 	(lto_symtab_merge_symbols_1): Likewise.
> 
> OK
Thanks; committed to trunk as r204216.
diff mbox

Patch

diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 5a8909f..351291b 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -906,7 +906,8 @@  analyze_functions (void)
   struct varpool_node *first_handled_var = first_analyzed_var;
   struct pointer_set_t *reachable_call_targets = pointer_set_create ();
 
-  symtab_node node, next;
+  symtab_node node;
+  symtab_node next;
   int i;
   struct ipa_ref *ref;
   bool changed = true;
diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c
index 13646bb..ec42a93 100644
--- a/gcc/lto/lto-symtab.c
+++ b/gcc/lto/lto-symtab.c
@@ -361,7 +361,8 @@  lto_symtab_resolve_symbols (symtab_node first)
 static void
 lto_symtab_merge_decls_2 (symtab_node first, bool diagnosed_p)
 {
-  symtab_node prevailing, e;
+  symtab_node prevailing;
+  symtab_node e;
   vec<tree> mismatches = vNULL;
   unsigned i;
   tree decl;
@@ -413,7 +414,8 @@  lto_symtab_merge_decls_2 (symtab_node first, bool diagnosed_p)
 static void
 lto_symtab_merge_decls_1 (symtab_node first)
 {
-  symtab_node e, prevailing;
+  symtab_node e;
+  symtab_node prevailing;
   bool diagnosed_p = false;
 
   if (cgraph_dump_file)
@@ -536,7 +538,8 @@  lto_symtab_merge_decls (void)
 static void
 lto_symtab_merge_symbols_1 (symtab_node prevailing)
 {
-  symtab_node e, next;
+  symtab_node e;
+  symtab_node next;
 
   /* Replace the cgraph node of each entry with the prevailing one.  */
   for (e = prevailing->next_sharing_asm_name; e;
diff --git a/gcc/symtab.c b/gcc/symtab.c
index 8079854..2b612b3 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -441,7 +441,8 @@  symtab_add_to_same_comdat_group (symtab_node new_node,
 void
 symtab_dissolve_same_comdat_group_list (symtab_node node)
 {
-  symtab_node n = node, next;
+  symtab_node n = node;
+  symtab_node next;
 
   if (!node->same_comdat_group)
     return;
@@ -1124,7 +1125,8 @@  symtab_semantically_equivalent_p (symtab_node a,
 				  symtab_node b)
 {
   enum availability avail;
-  symtab_node ba, bb;
+  symtab_node ba;
+  symtab_node bb;
 
   /* Equivalent functions are equivalent.  */
   if (a->decl == b->decl)