diff mbox

[pph] Do not clobber unemitted_tinfo_decls and keyed_classes (issue4636085)

Message ID 20110706040435.2F44C1DA1D1@topo.tor.corp.google.com
State New
Headers show

Commit Message

Diego Novillo July 6, 2011, 4:04 a.m. UTC
This patch removes a FIXME in pph_read_file_contents.  Instead of
clobbering unemitted_tinfo_decls and keyed_classes, we should add to
the existing ones.

No new fixes, but this helps with the next patch.

Tested on x86_64.  Committed to branch.


Diego.

	* pph-streamer-in.c (pph_read_file_contents): Do not clobber
 	unemitted_tinfo_decls and keyed_classes.  Append new elements
 	from STREAM.


--
This patch is available for review at http://codereview.appspot.com/4636085
diff mbox

Patch

diff --git a/gcc/cp/pph-streamer-in.c b/gcc/cp/pph-streamer-in.c
index 0ddcc75..72536a5 100644
--- a/gcc/cp/pph-streamer-in.c
+++ b/gcc/cp/pph-streamer-in.c
@@ -1314,8 +1314,9 @@  pph_read_file_contents (pph_stream *stream)
   cpp_ident_use *bad_use;
   const char *cur_def;
   cpp_idents_used idents_used;
-  tree fndecl;
+  tree fndecl, t, file_keyed_classes;
   unsigned i;
+  VEC(tree,gc) *file_unemitted_tinfo_decls;
 
   pph_in_identifiers (stream, &idents_used);
 
@@ -1334,10 +1335,12 @@  pph_read_file_contents (pph_stream *stream)
   if (flag_pph_dump_tree)
     pph_dump_namespace (pph_logfile, global_namespace);
 
-  keyed_classes = pph_in_tree (stream);
-  /* FIXME pph: This call replaces the tinfo, we should merge instead.
-     See pph_in_tree_vec.  */
-  unemitted_tinfo_decls = pph_in_tree_vec (stream);
+  file_keyed_classes = pph_in_tree (stream);
+  keyed_classes = chainon (file_keyed_classes, keyed_classes);
+
+  file_unemitted_tinfo_decls = pph_in_tree_vec (stream);
+  for (i = 0; VEC_iterate (tree, file_unemitted_tinfo_decls, i, t); i++)
+    VEC_safe_push (tree, gc, unemitted_tinfo_decls, t);
 
   /* Expand all the functions with bodies that we read from STREAM.  */
   for (i = 0; VEC_iterate (tree, stream->fns_to_expand, i, fndecl); i++)