Rename some read/write functions to match current in/out conventions. Specifically, pph_write_any_tree, pph_write_mergeable_links, pph_write_tree_body, pph_write_tree_header, pph_read_any_tree, pph_read_tree_body, and pph_read_tree_header change to their out/in names.
Index: gcc/cp/ChangeLog.pph 2011-10-12 Lawrence Crowl <cr...@google.com> * pph-streamer-out.c (pph_write_any_tree): Rename to pph_out_any_tree. (pph_write_mergeable_links): Rename to pph_out_mergeable_links. (pph_write_tree_body): Rename to pph_out_tree_body. (pph_write_tree_header): Rename to pph_out_tree_header. * pph-streamer-in.c (pph_read_any_tree): Rename to pph_in_any_tree. (pph_read_tree_body): Rename to pph_in_tree_body. (pph_read_tree_header): Rename to pph_in_tree_header. Index: gcc/cp/pph-streamer-in.c =================================================================== --- gcc/cp/pph-streamer-in.c (revision 179886) +++ gcc/cp/pph-streamer-in.c (working copy) @@ -513,14 +513,14 @@ pph_in_start_record (pph_stream *stream, /* The core tree reader is defined much later. */ -static tree pph_read_any_tree (pph_stream *stream, tree *chain); +static tree pph_in_any_tree (pph_stream *stream, tree *chain); /* Load an AST from STREAM. Return the corresponding tree. */ tree pph_in_tree (pph_stream *stream) { - tree t = pph_read_any_tree (stream, NULL); + tree t = pph_in_any_tree (stream, NULL); return t; } @@ -530,7 +530,7 @@ pph_in_tree (pph_stream *stream) static void pph_in_mergeable_tree (pph_stream *stream, tree *chain) { - pph_read_any_tree (stream, chain); + pph_in_any_tree (stream, chain); } @@ -543,7 +543,7 @@ pph_read_tree (struct lto_input_block *i { /* Find data. */ pph_stream *stream = (pph_stream *) root_data_in->sdata; - return pph_read_any_tree (stream, NULL); + return pph_in_any_tree (stream, NULL); } @@ -1710,7 +1710,7 @@ pph_in_tcc_declaration (pph_stream *stre /* Read the body fields of EXPR from STREAM. */ static void -pph_read_tree_body (pph_stream *stream, tree expr) +pph_in_tree_body (pph_stream *stream, tree expr) { struct lto_input_block *ib = stream->encoder.r.ib; struct data_in *data_in = stream->encoder.r.data_in; @@ -1926,7 +1926,7 @@ pph_unpack_value_fields (struct bitpack_ Return the new tree. */ static tree -pph_read_tree_header (pph_stream *stream, enum LTO_tags tag) +pph_in_tree_header (pph_stream *stream, enum LTO_tags tag) { struct lto_input_block *ib = stream->encoder.r.ib; struct data_in *data_in = stream->encoder.r.data_in; @@ -1958,7 +1958,7 @@ pph_read_tree_header (pph_stream *stream the tree may be unified with an existing tree in that namespace. */ static tree -pph_read_any_tree (pph_stream *stream, tree *chain) +pph_in_any_tree (pph_stream *stream, tree *chain) { struct lto_input_block *ib = stream->encoder.r.ib; struct data_in *data_in = stream->encoder.r.data_in; @@ -1999,7 +1999,7 @@ pph_read_any_tree (pph_stream *stream, t /* Materialize a new node from IB. This will also read all the language-independent bitfields for the new tree. */ - expr = read = pph_read_tree_header (stream, tag); + expr = read = pph_in_tree_header (stream, tag); gcc_assert (read != NULL); if (chain) expr = pph_merge_into_chain (stream, expr, chain); @@ -2026,7 +2026,7 @@ pph_read_any_tree (pph_stream *stream, t circular references and references from children nodes. */ /* FIXME pph: We should not insert when read == expr, but it fails. */ pph_cache_insert_at (&stream->cache, expr, ix, pph_tree_code_to_tag (expr)); - pph_read_tree_body (stream, expr); + pph_in_tree_body (stream, expr); pph_new_trace_tree (stream, expr, chain != NULL); Index: gcc/cp/pph-streamer-out.c =================================================================== --- gcc/cp/pph-streamer-out.c (revision 179886) +++ gcc/cp/pph-streamer-out.c (working copy) @@ -620,7 +620,7 @@ pph_out_start_tree_record (pph_stream *s /* The core tree writer is defined much later. */ -static void pph_write_any_tree (pph_stream *stream, tree t, bool mergeable); +static void pph_out_any_tree (pph_stream *stream, tree t, bool mergeable); /* Output non-mergeable AST T to STREAM */ @@ -628,7 +628,7 @@ static void pph_write_any_tree (pph_stre void pph_out_tree (pph_stream *stream, tree t) { - pph_write_any_tree (stream, t, false); + pph_out_any_tree (stream, t, false); } @@ -637,7 +637,7 @@ pph_out_tree (pph_stream *stream, tree t static void pph_out_mergeable_tree (pph_stream *stream, tree t) { - pph_write_any_tree (stream, t, true); + pph_out_any_tree (stream, t, true); } @@ -648,7 +648,7 @@ void pph_write_tree (struct output_block *ob, tree expr, bool ref_p ATTRIBUTE_UNUSED) { pph_stream *stream = (pph_stream *) ob->sdata; - pph_write_any_tree (stream, expr, false); + pph_out_any_tree (stream, expr, false); } @@ -926,14 +926,14 @@ pph_out_chain (pph_stream *stream, tree from the ENCLOSING_NAMESPACE starting at T. */ static void -pph_write_mergeable_links (pph_stream *stream, tree t) +pph_out_mergeable_links (pph_stream *stream, tree t) { tree next_link; if (!t) return; next_link = TREE_CHAIN (t); - pph_write_mergeable_links (stream, next_link); + pph_out_mergeable_links (stream, next_link); /*FIXME pph: Is this circumlocution still needed? */ TREE_CHAIN (t) = NULL_TREE; @@ -952,7 +952,7 @@ pph_out_mergeable_chain (pph_stream *str { int count = list_length (t); streamer_write_hwi (stream->encoder.w.ob, count); - pph_write_mergeable_links (stream, t); + pph_out_mergeable_links (stream, t); } @@ -1660,7 +1660,7 @@ pph_out_tcc_declaration (pph_stream *str written by the generic tree streaming routines. */ static void -pph_write_tree_body (pph_stream *stream, tree expr) +pph_out_tree_body (pph_stream *stream, tree expr) { bool handled_p; @@ -1884,7 +1884,7 @@ pph_pack_value_fields (struct bitpack_d a bitpack with all the bitfield values in EXPR. */ static void -pph_write_tree_header (pph_stream *stream, tree expr) +pph_out_tree_header (pph_stream *stream, tree expr) { struct bitpack_d bp; struct output_block *ob = stream->encoder.w.ob; @@ -1923,7 +1923,7 @@ pph_out_merge_name (pph_stream *stream, /* Write a tree EXPR (MERGEABLE or not) to STREAM. */ static void -pph_write_any_tree (pph_stream *stream, tree expr, bool mergeable) +pph_out_any_tree (pph_stream *stream, tree expr, bool mergeable) { enum pph_record_marker marker; @@ -1963,7 +1963,7 @@ pph_write_any_tree (pph_stream *stream, re-allocated when reading. If we are writing the mutated state of an existing tree, then we only need to write its body. */ - pph_write_tree_header (stream, expr); + pph_out_tree_header (stream, expr); if (mergeable && DECL_P (expr)) { /* We may need to unify two declarations. */ @@ -1972,7 +1972,7 @@ pph_write_any_tree (pph_stream *stream, } } - pph_write_tree_body (stream, expr); + pph_out_tree_body (stream, expr); } else gcc_unreachable (); -- This patch is available for review at http://codereview.appspot.com/5269041