From a075603c78f6520dcd415bf785bc952da5e25cb0 Mon Sep 17 00:00:00 2001 From: bstarynk Date: Sun, 7 Mar 2010 21:01:46 +0000 Subject: 2010-03-07 Basile Starynkevitch MELT branch merged with trunk rev 157264 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@157266 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/lto-streamer-out.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gcc/lto-streamer-out.c') diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index b5fc3e26c20..f375282beac 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -1978,6 +1978,8 @@ output_unreferenced_globals (cgraph_node_set set) if (TREE_CODE (var) == VAR_DECL) { + struct varpool_node *alias; + /* Output the object in order to output references used in the initialization. */ lto_output_tree (ob, var, true); @@ -1985,6 +1987,17 @@ output_unreferenced_globals (cgraph_node_set set) /* If it is public we also need a reference to the object itself. */ if (TREE_PUBLIC (var)) lto_output_tree_ref (ob, var); + + /* Also output any extra_name aliases for this variable. */ + for (alias = vnode->extra_name; alias; alias = alias->next) + { + lto_output_tree (ob, alias->decl, true); + output_record_start (ob, LTO_var_decl_alias); + lto_output_var_decl_index (ob->decl_state, ob->main_stream, + alias->decl); + lto_output_var_decl_index (ob->decl_state, ob->main_stream, + var); + } } } -- cgit v1.2.1