@@ -1,3 +1,8 @@
+2012-01-17 Diego Novillo <dnovillo@google.com>
+
+ * pph-in.c (pph_read_file_1): Move in-memory marking for STREAM...
+ * pph-core.c (pph_stream_register): ... here.
+
2012-01-16 Diego Novillo <dnovillo@google.com>
* name-lookup.c (pph_set_global_identifier_bindings): Make
@@ -953,6 +953,10 @@ pph_stream_register (pph_stream *stream)
/* Add a mapping between STREAM's PPH file name and STREAM. */
pph_stream_registry_add_name (stream, stream->name);
+
+ /* Mark this file as being in memory. This prevents opening the
+ same file more than twice. */
+ stream->in_memory_p = true;
}
@@ -2839,8 +2839,8 @@ pph_read_file_1 (pph_stream *stream)
VEC(tree,gc) *file_unemitted_tinfo_decls;
source_location cpp_token_replay_loc;
- /* If we have read STREAM before, we do not need to re-read the rest
- of its body. We only needed to read its line table. */
+ /* If we have opened STREAM before, we do not need to re-read the rest
+ of its body. */
if (stream->in_memory_p)
return;
@@ -2890,10 +2890,6 @@ pph_read_file_1 (pph_stream *stream)
/* Read and process the symbol table. */
pph_in_symtab (stream);
- /* Mark this file as read. If other images need to access its contents,
- we will not need to actually read it again. */
- stream->in_memory_p = true;
-
if (flag_pph_dump_tree)
pph_dump_namespace (pph_logfile, global_namespace);
}