aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-out.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-03-03 14:02:08 -0500
committerJason Merrill <jason@gcc.gnu.org>2010-03-03 14:02:08 -0500
commit1d5053d6b407b6fc493151a3581df7c628ffa72b (patch)
tree194d8b86327b39798460337e66b7e50860713988 /gcc/lto-streamer-out.c
parent2c71ac786646a4ed4d221a574b2797c66549e9d6 (diff)
downloadgcc-1d5053d6b407b6fc493151a3581df7c628ffa72b.zip
gcc-1d5053d6b407b6fc493151a3581df7c628ffa72b.tar.gz
gcc-1d5053d6b407b6fc493151a3581df7c628ffa72b.tar.bz2
re PR c++/12909 (ambiguity in mangling vector types)
PR c++/12909 * lto-streamer.h (LTO_tags): Add LTO_var_decl_alias. * lto-streamer-in.c (lto_input_tree): Read it. * lto-streamer-out.c (output_unreferenced_globals): Write it. From-SVN: r157204
Diffstat (limited to 'gcc/lto-streamer-out.c')
-rw-r--r--gcc/lto-streamer-out.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index b5fc3e2..f375282 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);
+ }
}
}