Oranize the PPH tree switch into tcc_* chunks, in each of four sections:
[official-gcc.git] / gcc / cp / ChangeLog.pph
blob52d4cd13f0982da83bd3e4161000288b96e1ba01
1 2011-05-26  Lawrence Crowl  <crowl@google.com>
3         * cp-objcp-common.c (cp_tree_size): Add case TREE_BINFO.
4         * pph.c (pph_read_file): Also log closing of PPH files.
5         * pph-streamer-in.c (pph_stream_read_tree):
6         Organize the switch into tcc_* chunks.
7         Move tcc_statement case STATEMENT_LIST down.
8         Implement tcc_type cases for BOUND_TEMPLATE_TEMPLATE_PARM,
9         DECLTYPE_TYPE, TEMPLATE_TEMPLATE_PARM, TEMPLATE_TYPE_PARM,
10         TYPENAME_TYPE, and TYPEOF_TYPE.
11         Implement tcc_exceptional case TEMPLATE_PARM_INDEX.
12         Add tcc_declaration case TRANSLATION_UNIT_DECL to already handled list.
13         Create a section for unimplemented cases as opposed to unrecognized
14         cases.
15         * pph-streamer-out.c (pph_stream_write_tree):
16         Organize the switch into tcc_* chunks.
17         Move tcc_statement case STATEMENT_LIST down.
18         Implement tcc_type cases for BOUND_TEMPLATE_TEMPLATE_PARM,
19         DECLTYPE_TYPE, TEMPLATE_TEMPLATE_PARM, TEMPLATE_TYPE_PARM,
20         TYPENAME_TYPE, and TYPEOF_TYPE.
21         Move tcc_statement case STATEMENT_LIST down.
22         Implement tcc_exceptional case TEMPLATE_PARM_INDEX.
23         Add tcc_declaration case TRANSLATION_UNIT_DECL to already handled list.
24         Create a section for unimplemented cases as opposed to unrecognized
25         cases.
27 2011-05-26  Lawrence Crowl  <crowl@google.com>
29         * pph-streamer-in.c (pph_stream_read_tree): Move TEMPLATE_DECL case
30         next to other DECLs.
31         * pph-streamer-out.c (pph_stream_write_tree): Move TEMPLATE_DECL case
32         next to other DECLs.
33         (pph_output_chain_filtered):  Move to just before its use.
35 2011-05-25  Lawrence Crowl  <crowl@google.com>
37         * pph-streamer-in.c (pph_stream_read_tree): Reformat for style.
38         * pph-streamer-out.c (pph_stream_write_tree): Reformat for style.
40 2011-05-25  Diego Novillo  <dnovillo@google.com>
42         * pph-streamer-out.c (pph_stream_write_tree) <TEMPLATE_DECL>:
43         Do not write DECL_MEMBER_TEMPLATE_P.
45 2011-05-24  Lawrence Crowl  <crowl@google.com>
47         * pph-streamer-in.c (pph_stream_read_tree): Refactor
48         from nested if statements to a switch statement.
49         For TEMPLATE_DECL, also input DECL_MEMBER_TEMPLATE_P.
50         Report unhandled trees when -fpph-untree.
51         Add already completely handled trees as separate cases.
52         (pph_stream_read_tree_vec_none): Remove.
53         * pph-streamer-out.c (pph_stream_write_tree): Refactor
54         from nested if statements to a switch statement.
55         For TEMPLATE_DECL, also output DECL_MEMBER_TEMPLATE_P.
56         Report unhandled trees when -fpph-untree.
57         Add already completely handled trees as separate cases.
58         (pph_stream_write_tree_vec_none): Remove.
60 2011-05-24  Diego Novillo  <dnovillo@google.com>
62         * pph-streamer-in.c (pph_stream_read_tree): For IDENTIFIER_NODE,
63         only read fields in struct lang_identifier.
64         Remove FIXME pph markers.
65         * pph-streamer-out.c (pph_stream_write_tree): For IDENTIFIER_NODE,
66         only write fields in struct lang_identifier.
67         Remove FIXME pph markers.
69 2011-05-20  Lawrence Crowl <crowl@google.com>
71         * pph-streamer-in.c (pph_stream_read_qual_use_vec): Add.
72         (pph_stream_read_tree_vec_none): Add.
73         (pph_stream_read_tree): Add read of various C++ fields.
74         * pph-streamer-out.c (pph_stream_write_qual_use_vec): Add.
75         (pph_stream_write_tree_vec_none): Add.
76         (pph_stream_write_tree): Add write of various C++ fields.
78 2011-05-06  Diego Novillo  <dnovillo@google.com>
80         * pph-streamer.c (pph_stream_hooks_init): Set
81         has_unique_integer_csts_p field to true.
83 2011-05-05  Lawrence Crowl <crowl@google.com>
85         * pph.c (pph_write_file_contents): Save keyed_classes and
86         unemitted_tinfo_decls.
87         (pph_read_file_contents): Restore keyed_classes and
88         unemitted_tinfo_decls.
89         * pph-streamer.h (pph_stream_write_tree_vec): Make extern.
90         (pph_stream_read_tree_vec): Make extern.
91         (pph_output_tree_array): Archive for future need.
92         (pph_output_tree_VEC): Archive for future need.
93         (pph_input_tree_array): Archive for future need.
94         (pph_input_tree_VEC): Archive for future need.
95         * pph-streamer-in.c (pph_stream_read_tree): Make extern.
96         (pph_stream_read_tree): Restore TYPE_BINFO.
97         * pph-streamer-out.c (pph_stream_write_tree_vec): Make extern.
98         (pph_stream_write_tree): Save TYPE_BINFO.
99         * name-lookup.c (pushdecl_into_namespace): Add leading comment.
101 2011-05-04  Diego Novillo  <dnovillo@google.com>
103         * pph-streamer.c (pph_get_common_nodes): New.
104         (pph_stream_hooks_init): Set it in h->get_common_nodes.
106 2011-04-29  Lawrence Crowl <crowl@google.com>
108         * pph-streamer-out.c (pph_stream_write_tree): Write DECL_INITIAL
109         instead of PARM_DECL DECL_ARG_TYPE.
110         * pph-streamer-in.c (pph_stream_read_tree): Read DECL_INITIAL
111         instead of PARM_DECL DECL_ARG_TYPE.
113 2011-04-28  Lawrence Crowl <crowl@google.com>
115         * pph-streamer-out.c (pph_stream_write_tree): Write PARM_DECL
116         DECL_ARG_TYPE.
117         * pph-streamer-in.c (pph_stream_read_tree): Read PARM_DECL
118         DECL_ARG_TYPE.
120 2011-04-26  Lawrence Crowl <crowl@google.com>
122         * cp-tree.h (pushdecl_into_namespace): Add.
123         * name-lookup.c (pushdecl_into_namespace): Add.
124         * pph.c: Add include of tree-dump.h.
125         (pph_dump_tree_name): Add.
126         (pph_dump_namespace): Add.
127         (pph_write_file_contents): Call pph_dump_namespace when appropriate.
128         (pph_read_file_contents): Call pph_dump_namespace when appropriate.
129         (pph_add_names_to_namespace): Use pushdecl_into_namespace rather than
130         pushdecl_with_scope.  Make associated changes.  Enable recursive call
131         for nested namespace.
132         * pph-streamer.c (pph_stream_trace): Reformat conditionals.
134 2011-04-26  Diego Novillo  <dnovillo@google.com>
136         * pph-streamer.h (pph_output_tree_or_ref_1): New.
137         (pph_output_tree_lst): Remove.  Change all
138         callers to call pph_output_tree_1 with a tracing level of 2.
139         (pph_output_tree_aux): Remove.  Change all callers to call
140         pph_output_tree_1 with a tracing level of 3.
141         (pph_output_tree_or_ref): Call pph_output_tree_or_ref_1 with
142         a tracing level of 2.
144 2011-04-26  Diego Novillo  <dnovillo@google.com>
146         * pph-streamer-in.c (pph_stream_unpack_value_fields): Read
147         TREE_LANG_FLAG_? fields.
148         * pph-streamer-out.c (pph_stream_pack_value_fields): Write
149         TREE_LANG_FLAG_? fields.
151 2011-04-26  Diego Novillo  <dnovillo@google.com>
153         * cp-objcp-common.c (cp_common_init_ts): Call
154         mark_ts_structures_for and tree_node_structure_for_code.
155         Change calls to MARK_TS_* into assertions instead.
157 2011-04-18  Lawrence Crowl <crowl@google.com>
159         * pph.c (pth_save_identifiers): Fix FIXME comment.
160         (pph_add_names_to_namespace): Add contained namespaces to scope as
161         well as regular symbols.
162         * pph-streamer.c (enum pph_trace_type): Add a trace for refs.
163         (pph_stream_trace): Add the ref printing.  Reduce bulk of trace
164         messages.  Filter off uninteresting traces, primarily traces of null
165         pointers.
166         (pph_stream_trace_tree): Convert ref_p to trace value.
167         * pph-streamer.h: Adjust flag_pph_tracer comparisons for better traces.
168         (pph_stream_trace_tree): Add ref_p parameter.  Propogate such
169         parameters at all call sites.
170         (pph_output_tree_lst): New.  Like pph_output_tree, but for list and
171         chain contexts.
172         (pph_stream_write_tree): The callback is auxillary.
173         (pph_output_chain_filtered): Call pph_output_tree_lst.
175 2011-04-14  Diego Novillo  <dnovillo@google.com>
177         * pph.c (pph_read_file_contents): Re-instate call to
178         pph_add_names_to_namespace.
179         (pph_include_handler): Return false if the file has been
180         read from an image.
182 2011-04-14  Diego Novillo  <dnovillo@google.com>
184         * Make-lang.in (cp/name-lookup.o): Add dependency on
185         CXX_PPH_STREAMER_H.
186         * name-lookup.c: Include pph-streamer.h.
187         (pph_stream_write_binding_table): New.
188         * pph-streamer-out.c (pph_stream_write_lang_type_header): New.
189         (pph_stream_write_tree_pair_vec): New.
190         (pph_stream_write_sorted_fields_type): New.
191         (pph_stream_write_lang_type_class): New.
192         (pph_stream_write_lang_type_ptrmem): New.
193         (pph_stream_write_lang_type): New.
194         (pph_stream_write_tree): Call it for TYPE_P nodes.
195         * pph-streamer.h (pph_stream_write_binding_table): Declare.
197 2011-04-14  Diego Novillo  <dnovillo@google.com>
199         * pph-streamer-in.c (pph_stream_read_tree): Fix handling of
200         TYPE_DECLs.
201         * pph-streamer-out.c (pph_stream_write_tree): Likewise.
203 2011-04-13  Diego Novillo  <dnovillo@google.com>
205         * name-lookup.c (pph_stream_write_binding_table): Handle
206         NULL BT->CHAIN entries.
207         (pph_stream_read_binding_table): New.
208         * pph-streamer-in.c (pph_stream_read_lang_specific): Rename
209         from pph_stream_read_lang_specific_data.  Update all users.
210         (pph_stream_read_lang_type_header): New.
211         (pph_stream_read_tree_pair_vec): New.
212         (pph_stream_read_sorted_fields_type): New.
213         (pph_stream_read_lang_type_class): New.
214         (pph_stream_read_lang_type_ptrmem): New.
215         (pph_stream_read_lang_type): New.
216         (pph_stream_read_tree): Call it.
217         * pph-streamer-out.c (pph_stream_write_lang_specific): Rename
218         from pph_stream_write_lang_specific_data.  Update all users.
219         Remove duplicate assertion for DECL_P.
220         (pph_stream_write_lang_type_header): Call pph_start_record.
221         Call pph_output_bitpack instead of lto_output_bitpack.
222         (pph_stream_write_sorted_fields_type): Call pph_start_record.
223         (pph_stream_write_lang_type_class): Call pph_output_bitpack 
224         instead of lto_output_bitpack.
225         Guard call to pph_stream_write_binding_table with a call to
226         pph_start_record.
227         (pph_stream_write_lang_type_ptrmem): Call pph_start_record.
228         (pph_stream_write_lang_type): Call pph_start_record.
229         * pph-streamer.h (pph_stream_read_binding_table): Declare.
231 2011-04-13  Diego Novillo  <dnovillo@google.com>
233         * cp-tree.h (sorted_fields_type_new): Declare.
235 2011-04-13  Diego Novillo  <dnovillo@google.com>
237         * class.c (sorted_fields_type_new): Factor out of ...
238         (finish_struct_1): ... here.
240 2011-04-12  Diego Novillo  <dnovillo@google.com>
242         * pph.c (pph_read_file_contents): Do not try to re-instantiate
243         the PPH image.
244         (pph_include_handler): Do not skip header file after reading
245         the PPH image.
247 2011-04-12  Diego Novillo  <dnovillo@google.com>
249         * parser.c (cp_debug_print_flag): Remove superfluous test.
251 2011-04-12  Diego Novillo  <dnovillo@google.com>
253         * pph.c (pph_add_names_to_namespace): New.
254         (pph_read_file_contents): Call it.
255         Call cpp_lt_replay.
257 2011-04-12  Diego Novillo  <dnovillo@google.com>
259         * pph-streamer-in.c (pph_stream_unpack_value_fields): Unpack
260         TYPE_LANG_FLAGS and DECL_LANG_FLAGS.
261         (pph_stream_read_tree): Handle TYPE_DECL.
262         * pph-streamer-out.c (pph_stream_pack_value_fields): Pack
263         TYPE_LANG_FLAGS and DECL_LANG_FLAGS.
264         (pph_stream_write_binding_level): Call pph_output_chain_filtered
265         with a NO_BUILTINS filter for fields that have DECLs in them.
266         (pph_stream_write_tree): Handle TYPE_DECL.
267         (pph_output_chain_filtered): New.
268         * pph-streamer.c (pph_stream_trace): Show the code of the tree
269         if it is not NULL_TREE.
270         * pph-streamer.h (enum chain_filter): Declare.
271         (pph_output_chain_filtered): Declare.
273 2011-04-12  Diego Novillo  <dnovillo@google.com>
275         * pph.c (pth_include_handler): Return true.
276         (pph_include_handler): If the header file exists as a PPH
277         image, return false.
279 2011-04-12  Diego Novillo  <dnovillo@google.com>
281         * cp-tree.h (print_namespace): Declare.
282         * name-lookup.c (print_namespace): New.
283         * parser.c (cp_debug_print_context_stack): Increment loop counter.
285 2011-04-11  Diego Novillo  <dnovillo@google.com>
287         * parser.c (cp_lexer_dump_tokens): Add arguments START_TOKEN and
288         CURR_TOKEN.
289         Update all callers.
290         Print tokens starting with START_TOKEN.
291         Highlight CURR_TOKEN by enclosing it in [[ ]].
292         (cp_debug_print_tree_if_set): New.
293         (cp_debug_print_context): New.
294         (cp_debug_print_context_stack): New.
295         (cp_debug_print_flag): New.
296         (cp_debug_print_unparsed_function): New.
297         (cp_debug_print_unparsed_queues): New.
298         (cp_debug_parser): New.
299         * cp/parser.h (cp_debug_parser): Declare.
301 2011-04-08  Lawrence Crowl  <crowl@google.com>
303         * pph.c (pth_finish): Simplify inconsistency reporting.
304         * pph-streamer.h (pph_output_tree_aux): New.
305         (pph_output_string): Ensure trace happens before write.
306         (pph_output_chain): Likewise.
307         (pph_output_string_with_length): Likewise.  Add trace for null case.
308         * pph-streamer-out.c (pph_stream_write_tree): Call pph_output_tree_aux
309         instead of pph_output_tree.
311 2011-04-06  Lawrence Crowl  <crowl@google.com>
313         * pph.c (pth_dump_identifiers):  Split cpp_idents_used::max_length
314         into max_ident_length and max_value_length.  Print used_by_directive
315         and expanded_to_text attributes of macros.
316         (pth_save_identifiers): Split cpp_idents_used::max_length into
317         max_ident_length and max_value_length.  Filter out macro that are
318         neither used_by_directive nor expanded_to_text, which requires
319         precounting the number of entries remaining.  Save used_by_directive
320         and expanded_to_text attributes of the macros.
321         (pth_load_identifiers): Split cpp_idents_used::max_length into
322         max_ident_length and max_value_length.  Restore used_by_directive and
323         expanded_to_text attributes of the macros.
324         (pph_read_file): Make failure to read a pph file a non-fatal error.
326 2011-04-05  Lawrence Crowl <crowl@google.com>
328         * parser.c (cp_lexer_dump_tokens): Remove #ifdef ENABLE_CHECKING.
329         (cp_lexer_debug_tokens): Likewise.
331 2011-04-04  Diego Novillo  <dnovillo@google.com>
333         * cp-tree.h (cxx_binding_make): Declare.
334         * name-lookup.c (cxx_binding_make): Make extern.
335         * parser.c (cp_token_cache): Make extern.
336         * parser.h (cp_token_cache): Declare.
337         * pph-streamer-in.c (pph_stream_unpack_value_fields): Move
338         earlier in the file.
339         (pph_stream_init_read): Call lto_reader_init.
340         Associate STREAM with STREAM->DATA_IN.
341         (pph_start_record): New.
342         (pph_stream_read_ld_base): New.
343         (pph_stream_read_ld_min): New.
344         (pph_stream_read_tree_vec): New.
345         (pph_stream_read_cxx_binding_1): New.
346         (pph_stream_read_cxx_binding): New.
347         (pph_stream_read_class_binding): New.
348         (pph_stream_read_label_binding): New.
349         (pph_stream_read_binding_level): New.
350         (pph_stream_read_c_language_function): New.
351         (pph_stream_read_language_function): New.
352         (pph_stream_read_ld_fn): New.
353         (pph_stream_read_ld_ns): New.
354         (pph_stream_read_ld_parm): New.
355         (pph_stream_read_lang_specific_data): New.
356         (pph_stream_read_tree): Retrieve pph_stream instance from
357         DATA_IN->SDATA.
358         Mark IB argument as unused.
359         Call pph_stream_read_lang_specific_data for DECLs that have
360         lang_specific data.
361         Replace calls to lto_input_sleb128 with pph_input_uint.
362         (pph_stream_alloc_tree): New.
363         * pph-streamer-out.c (pph_stream_init_write): Call
364         lto_writer_init.
365         Associate STREAM with OB.
366         (pph_start_record): New.
367         (pph_stream_write_ld_base): Change first argument to be a
368         pph_stream.  Change all users.
369         Call pph_start_record.
370         Call pph_output_bitpack.
371         (pph_stream_write_ld_min): Likewise.
372         (pph_stream_write_tree_vec): Likewise.
373         (pph_stream_write_cxx_binding_1): Likewise.
374         (pph_stream_write_cxx_binding): Likewise.
375         (pph_stream_write_class_binding): Likewise.
376         (pph_stream_write_label_binding): Likewise.
377         (pph_stream_write_binding_level): Likewise.
378         (pph_stream_write_c_language_function): Likewise.
379         (pph_stream_write_language_function): Likewise.
380         (pph_stream_write_ld_fn): Likewise.
381         (pph_stream_write_ld_ns): Likewise.
382         (pph_stream_write_ld_parm): Likewise.
383         (pph_stream_write_lang_specific_data): Likewise.
384         (pph_stream_write_tree): Only call
385         pph_stream_write_lang_specific_data for tree nodes that have
386         DECL_LANG_SPECIFIC set.
387         * pph-streamer.c (enum pph_trace_type): Add PPH_TRACE_CHAIN
388         and PPH_TRACE_BITPACK.
389         (pph_stream_trace): Add "chain" and "bitpack" to TYPE_S.
390         Handle PPH_TRACE_CHAIN And PPH_TRACE_BITPACK.
391         (pph_stream_trace_tree): Do not compute tree code size on
392         NULL_TREE.
393         (pph_stream_trace_chain): New.
394         (pph_stream_trace_bitpack): New.
395         (pph_stream_output_tree_header): New.
396         (pph_stream_hooks_init): Add hooks for alloc_tree and
397         output_tree_header.
398         * pph-streamer.h (PPH_RECORD_START): Declare.
399         (PPH_RECORD_END): Declare.
400         (pph_stream_trace_chain): Declare.
401         (pph_stream_trace_bitpack): Declare.
402         (pth_load_token_cache): Declare.
403         (pph_output_tree_or_ref): New.
404         (pph_output_uchar): New.
405         (pph_output_string_with_length): Do not trace the string
406         twice.
407         (pph_output_chain): New.
408         (pph_output_bitpack): New.
409         (pph_input_uchar): New.
410         (pph_input_chain): New.
411         (pph_input_bitpack): New.
412         (pph_get_pph_stream): Remove.  Update all users.
413         (pph_set_pph_stream): Remove.  Update all users.
414         (pph_stream_output_tree_header): Declare.
415         (pph_stream_alloc_tree): Declare.
416         * pph.c (pth_load_token): Factor out of pth_load_hunk.
417         (pth_load_token_cache): New.
418         (pph_read_file_contents): Read global_namespace.
420 2011-03-30  Diego Novillo  <dnovillo@google.com>
422         * pph-streamer.h (pph_get_pph_stream): Rename from
423         pph_get_ob_stream.  Update all users.
424         (pph_set_pph_stream): Rename from pph_set_pph_stream.  Update
425         all users.
426         (pph_output_tree): Remove ATTRIBUTE_UNUSED.
427         (pph_input_tree): Remove ATTRIBUTE_UNUSED.
429 2011-03-30  Diego Novillo  <dnovillo@google.com>
431         * cp-tree.h (struct language_function): Add prefix 'x_' to
432         fields returns_value, returns_null, returns_abnormally,
433         in_function_try_handler, in_base_initializer.  Update all
434         users.
435         * pph-streamer.c (pph_stream_write_ld_base): New.
436         (pph_stream_write_ld_min): New.
437         (pph_stream_write_tree_vec): New.
438         (pph_stream_write_cxx_binding_1): New.
439         (pph_stream_write_cxx_binding): New.
440         (pph_stream_write_class_binding): New.
441         (pph_stream_write_label_binding): New.
442         (pph_stream_write_binding_level): New.
443         (pph_stream_write_c_language_function): New.
444         (pph_stream_write_language_function): New.
445         (pph_stream_write_ld_fn): New.
446         (pph_stream_write_ld_ns): New.
447         (pph_stream_write_ld_parm): New.
448         (pph_stream_write_lang_specific_data): New.
449         (pph_indexable_with_decls_p): New.
450         (pph_stream_hooks_init): Initialize h->indexable_with_decls_p
451         with pph_indexable_with_decls_p.
452         (pph_stream_begin_section): Do not free BLOCK.
453         * pph-streamer.h (pth_save_token_cache): Declare.
454         (pph_get_ob_stream): New.
455         (pph_set_ob_stream): New.
456         * pph.c (pth_save_token_cache): New.
457         (pph_print_macro_defs_before): Remove.
458         (pph_print_macro_defs_after): Remove.
459         (pph_write_namespace): Remove.
460         (pph_write_format): Remove.
461         (pph_write_print): Remove.
462         (pph_write_dump): Remove.
463         (pph_write_symbol): Remove.
464         (declvisitor): Remove.
465         (pph_write_namespace_1): Remove.
466         (pph_write_namespace): Remove.
467         (pph_write_file_contents): Rename from pph_write_file_object.
468         Output global_namespace.
469         (pph_write_file): Call it.
470         (pph_write_file_summary): Remove.
471         (pph_read_file_contents): Rename from pph_file_read_object.
472         (pph_read_file): Rename from pph_file_read.
474 2011-03-28  Diego Novillo  <dnovillo@google.com>
476         * pph.c (pph_write_format): Rename from write_pph_format.
477         (pph_write_namespace): Rename from write_pph_namespace.
478         (pph_write_print): Rename from write_pph_print.
479         (pph_write_dump): Rename from write_pph_dump.
480         (pph_write_symbol): Rename from write_pph_symbol.
481         (pph_write_namespace): Rename from write_pph_namespace.
482         (pph_write_namespace_1): Rename from write_pph_namespace_1.
483         (pph_write_file_object): Rename from write_pph_file_object.
484         (pph_write_file_summary): Rename from write_pph_file_summary.
485         (pph_write_file_dump): Rename from write_pph_file_dump.
486         (pph_write_file): Rename from write_pph_file.
487         (pph_file_read_object): Rename from read_pph_file_object.
488         (pph_file_read): Rename from read_pph_file.
490 2011-03-25  Diego Novillo  <dnovillo@google.com>
492         * Make-lang.in (cp/pph-streamer.o): Add dependency on
493         tree-iterator.h.
494         * pph-streamer.c: Include tree-iterator.h
495         (pph_stream_write_tree): Handle STATEMENT_LIST.
496         (pph_stream_read_tree): Likewise.
497         (pph_is_streamable): New.
498         (pph_stream_pack_value_fields): New.
499         (pph_stream_unpack_valude_fields): New.
500         (pph_stream_hooks_init): Rename from pph_streamer_hooks_init.
501         Fill in callbacks for name, is_streamable, pack_value_fields
502         and unpack_value_fields;
503         (pph_stream_open):
505 2011-03-25  Diego Novillo  <dnovillo@google.com>
507         * cp/pph-streamer.c (pph_stream_init_write):
509 2011-03-25  Diego Novillo  <dnovillo@google.com>
511         * pph-streamer.c (pph_stream_hooks_init): New.
512         (pph_stream_open): Call it.
514 2011-03-23  Diego Novillo  <dnovillo@google.com>
516         * Make-lang.in (cp/pph-streamer.o): Add dependencies on
517         tree-pretty-print.h, CXX_PPH_H, TREE_PASS_H, version.h and
518         cppbuiltin.h
519         * pph-streamer.c: Include tree-pretty-print.h, pph.h,
520         tree-pass.h, version.h and cppbuiltin.h.
521         (pph_get_section_data): New.
522         (pph_free_section_data): New.
523         (pph_stream_init_read): Rename from pph_file_read.
524         Initialize LTO streaming data structures.
525         Read pph file in memory.
526         (pph_stream_init_write): Factor out of ...
527         (pph_stream_open): ... here.
528         (pph_stream_write_header): New.
529         (pph_stream_write_body): Factor out of ...
530         (pph_stream_close): ... here.
531         Call pph_stream_write_header.
532         (enum pph_trace_type): Declare.
533         (pph_stream_trace): New.
534         (pph_stream_trace_tree): New.
535         (pph_stream_trace_uint): New.
536         (pph_stream_trace_bytes): New.
537         (pph_stream_trace_string): New.
538         (pph_stream_trace_string_with_length): New.
539         * pph-streamer.h (PPH_NUM_SECTIONS): Define.
540         (PPH_USE_FILE_IO): Remove.  Update all users.
541         (pph_id_str): Define.
542         (pph_file_header): Declare.
543         (pph_stream): Add fields pph_sections, file_data and file_size.
544         (pph_stream_open): Change second argument to const char *.
545         Update all users.
546         (pph_stream_trace_tree): Declare.
547         (pph_stream_trace_uint): Declare.
548         (pph_stream_trace_bytes): Declare.
549         (pph_stream_trace_string): Declare.
550         (pph_stream_trace_string_with_length): Declare.
551         (pph_output_tree): Call pph_stream_trace_tree if flag_pph_tracer
552         is enabled.
553         (pph_input_tree): Likewise.
554         (pph_output_uint): Call pph_stream_trace_uint if flag_pph_tracer
555         is enabled.
556         (pph_input_uint): Likewise.
557         (pph_output_bytes): Call pph_stream_trace_bytes if flag_pph_tracer
558         is enabled.
559         (pph_input_bytes): Likewise.
560         (pph_output_string): Call pph_stream_trace_string if flag_pph_tracer
561         is enabled.
562         (pph_input_string): Likewise.
563         (pph_output_string_with_length): Call
564         pph_stream_trace_string_with_length if flag_pph_tracer is
565         enabled.
566         * pph.c (pph_print_macro_defs_before): Call pph_output_string.
567         (pph_print_macro_defs_after): Likewise.
568         (pth_load_token_value): Do not free the read string.
569         (pth_load_identifiers): Likewise.
570         (pth_load_include): Likewise.
571         (pth_load_image): Call pph_input_bytes to read the header.
572         (write_pph_print): Call pph_output_tree.
573         (write_pph_file_object): Remove fprintf() call.
574         (pth_include_handler): Remove FIXME marker.
575         (pph_include_handler): Tidy.
577 2011-03-09  Diego Novillo  <dnovillo@google.com>
579         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/pph-streamer.o
580         (CXX_PPH_STREAMER_H): New.
581         (cp/pph.o): Add dependency on CXX_PPH_STREAMER_H.
582         (cp/pph-streamer.o): New.
583         * pph-streamer.c: New file.
584         * pph-streamer.h: New file.
585         * pph.c: Update Copyright line.
586         Include pph-streamer.h
587         (pth_file_for): Change FILE * argument with pph_streamer *.
588         Update all callers.
589         (pth_write_uint): Remove.
590         (pth_write_bytes): Remove.
591         (pth_write_string): Remove.
592         (pth_write_number): Re-implement using pph_streamer and 
593         pph_output_* calls.
594         (pth_save_token_value): Likewise.
595         (pth_save_token): Likewise.
596         (pth_write_header): Likewise.
597         (pph_print_macro_defs_before): Likewise.
598         (pph_print_macro_defs_after): Likewise.
599         (pth_save_identifiers): Likewise.
600         (pth_save_hunk): Likewise.
601         (pth_save_include): Likewise.
602         (pth_save_image): Likewise.
603         (pth_read_uint): Remove.
604         (pth_read_bytes): Remove.
605         (pth_read_string): Remove.
606         (pth_read_string_alloc): Remove.
607         (pth_load_number): Re-implement using pph_streamer and
608         pph_input_* calls.
609         (pth_load_token_value): Likewise.
610         (pth_load_identifiers): Likewise.
611         (pth_load_hunk): Likewise.
612         (pth_load_include): Likewise.
613         (pth_load_include): Likewise.
614         (pth_load_image): Likewise.
615         (pth_have_valid_image_for): Likewise.
616         (write_pph_format): Likewise.
617         (write_pph_namespace): Likewise.
618         (write_pph_print): Likewise.
619         (write_pph_dump): Likewise.
620         (write_pph_symbol): Likewise.
621         (declvisitor): Likewise.
622         (write_pph_namespace_1): Likewise.
623         (write_pph_file_object): Likewise.
624         (write_pph_file_summary): Likewise.
625         (write_pph_file_dump): Likewise.
626         (read_pph_file_object): Likewise.
627         * pph.h: Update file comment.
629 2011-03-04  Lawrence Crowl <crowl@google.com>
631         * cp/pph.c (pph_print_macro_defs_before): New.
632         * (pph_print_macro_defs_after): New.
633         * (write_pph_format): New.
634         * (write_pph_namespace): New.
635         * (write_pph_print): New.
636         * (write_pph_dump): New.
637         * (write_pph_symbol): New.
638         * (write_pph_namespace_1): New.
639         * (write_pph_namespace): New.
640         * (write_pph_file_object): New.
641         * (write_pph_file_summary): New.
642         * (write_pph_file_dump): New.
643         * (write_pph_file): Write used macros instead of dummy contents.
644         Renamed from write_pph_output.
645         * (wrap_macro_def): New.
646         * (report_validation_error): New.
647         * (read_pph_file_object): New.
648         * (read_pph_file): Read used macros instead of dummy contents.
649         Verify the macro values.
650         * (pph_include_handler): Do not read a PPH file a second time.
651         * (PPH_ARTIFICIAL): Remove redundant condition.
652         * (pph_init): Set up the preprocessor lookaside table.
654 2011-02-24  Lawrence Crowl <crowl@google.com>
656         * cp/pph.c (pph_finish): Check for missing preprocessor guard
657         for pre-parsed headers.
659 2011-02-15  Lawrence Crowl <crowl@google.com>
661         * cp/pph.c (write_pph_output, read_pph_file,
662         pph_include_handler): Add.
663         (pph_start_exposed, pph_stop_exposed): Change debug level.
664         (pph_init): Set callback for pph_include_handler.
665         (pph_finish): Write PPH file.
666         * cp/parser.c (cp_lexer_new_main): Duplicate PTH and PCH
667         incompatibility for PPH.  Add call to pph_init only when PPH
668         is being used.
669         * (c_parse_file): Remove call to pph_init.
671 2011-01-27  Diego Novillo  <dnovillo@google.com>
673         * Make-lang.in (cp/parser.o): Fix dependencies.
674         * pph.c (pth_process_text_file): Do not try to start reading the file
675         at an arbitrary offset.
676         Remove OFFSET argument.  Update all users.
677         (pth_image_to_lexer): Emit a fatal error if a hunk fails
678         validation.
679         (pth_lexer_to_image):
680         (pth_enter_file):
681         * pph.h (struct cp_token_hunk): Remove fields text_offset and
682         text_length.
683         Update all users.
684         (struct pth_image): Remove field hunk_text_offset.
685         Update all users.
687 2011-01-24  Lawrence Crowl <crowl@google.com>
689         Merge timevar patch.
691         * decl.c: (push_local_name): Change TV_NAME_LOOKUP to start/stop.
692         * (poplevel): Refactor POP_TIMEVAR_AND_RETURN to plain code.
693         Change TV_NAME_LOOKUP to start/stop.
694         * (define_label): Refactor timevar calls out to a wrapper function.
695         Change TV_NAME_LOOKUP to start/stop.
696         * (xref_tag): Likewise.
697         * (lookup_label): Refactor timevar calls out to a wrapper function.
698         Change TV_NAME_LOOKUP to start_cond/stop_cond.
700         * pt.c: (instantiate_class_template): Refactor timevar calls out to a
701         wrapper function.  Add push/pop of new TV_INSTANTIATE_TEMPLATE.
702         * (instantiate_template): Refactor timevar calls out to a wrapper
703         function.  Add push/pop of new TV_INSTANTIATE_TEMPLATE.
704         * (lookup_template_class): Refactor timevar calls out to a wrapper
705         function.  Change TV_NAME_LOOKUP to start_cond/stop_cond.
706         * (instantiate_decl): Change TV_PARSE to TV_PARSE_GLOBAL.
708         * name-lookup.c: (store_bindings): Change TV_NAME_LOOKUP to start/stop.
709         * (poplevel_class): Change TV_NAME_LOOKUP to start_cond/stop_cond.
710         * (push_namespace): Likewise.
711         * (pop_nested_namespace): Likewise.
712         * (pushdecl_namespace_level): Likewise.
713         * (store_class_bindings): Likewise.
714         * (push_to_top_level): Likewise.
715         * (identifier_type_value): Refactor timevar calls out to a wrapper
716         function.  Change TV_NAME_LOOKUP to start/stop.
717         * (find_binding): Likewise.
718         * (push_using_decl): Likewise.
719         * (lookup_arg_dependent): Likewise.
720         * (push_using_directive): Likewise.
721         * (qualified_lookup_using_namespace): Refactor POP_TIMEVAR_AND_RETURN
722         to plain code.  Change TV_NAME_LOOKUP to start/stop.
723         * (lookup_type_current_level): Likewise.  Refactor inner return to
724         break.
725         * (pushdecl_class_level): Refactor POP_TIMEVAR_AND_RETURN to plain
726         code.  Change TV_NAME_LOOKUP to start_cond/stop_cond.
727         * (pushdecl_top_level_1): Likewise.
728         * (lookup_using_namespace): Likewise.
729         * (pushdecl_with_scope): Refactor timevar calls out to a wrapper
730         function.  Change TV_NAME_LOOKUP to start_cond/stop_cond.
731         * (push_overloaded_decl): Likewise.
732         * (push_class_level_binding): Likewise.
733         * (namespace_binding): Likewise.
734         * (set_namespace_binding): Likewise.
735         * (supplement_binding): Likewise.
736         * (unqualified_namespace_lookup): Likewise.
737         * (lookup_name_real): Likewise.
738         * (lookup_type_scope): Likewise.
739         * (namespace_ancestor): Likewise.
740         * (lookup_name_innermost_nonclass_level_1): Likewise.
741         * (pushtag): Likewise.
742         * (pop_from_top_level): Likewise.
743         * (pushdecl_maybe_friend): Refactor timevar calls out to a wrapper
744         function.  Change TV_NAME_LOOKUP to start_cond/stop_cond.  Wrap long
745         lines.
746         * (add_using_namespace): Refactor timevar calls out to a wrapper
747         function.  Change TV_NAME_LOOKUP to start_cond/stop_cond.  Bypass
748         wrapper on call to self.
750         * decl2.c: (cp_write_global_declarations):  Add start/stop of
751         new TV_PHASE_CP_DEFERRED, TV_PHASE_CGRAPH, TV_PHASE_CHECK_DBGINFO.
752         Remove push/pop calls to TV_VARCONST.
754         * parser.c: Add include of "timevar.h".
755         * (cp_parser_explicit_instantiation): Add push/pop calls to new
756         TV_INSTANTIATE_TEMPLATE.
757         * (cp_parser_enum_specifier): Add push/pop calls to new TV_PARSE_ENUM.
758         * (cp_parser_class_specifier): Add push/pop calls to new
759         TV_PARSE_STRUCT.
760         * (cp_parser_function_definition_from_specifiers_and_declarator): Add
761         push/pop calls to new TV_PARSE_FUNC.
762         * (cp_parser_late_parsing_for_member):  Add push/pop calls to
763         new TV_PARSE_INMETH.
765         * call.c: Add include of "timevar.h".
766         * (perform_overload_resolution): Add push/pop calls to new
767         TV_RESOLVE_OVERLOAD.
769         * Make-lang.in: Add dependence of call.o and parser.o on $(TIMEVAR_H).
771 2010-12-16  Diego Novillo  <dnovillo@google.com>
773         * pph.c (pph_find_exposed_for, pph_get_decl_exposure):
774         Replace uses of DECL_INTEGRAL_CONSTANT_VAR_P with
775         decl_constant_var_p.
777 2010-12-09  Lawrence Crowl  <crowl@google.com>
779         * pph.c (pth_lexer_to_image): Remove call to cpp_lt_statistics.
780         This call is now handled in libcpp.
781         (cpp_lt_order): New constant for lookaside table size.
782         Table reduced from 32768 slots to 512 slots.
783         (pth_init): Use above constant in call to cpp_lt_create.
785 2010-12-02  Diego Novillo  <dnovillo@google.com>
787         * pph.c: New file.
788         * pph.h: New file.
789         * parser.h: New file.
790         * decl.c: Include pph.h.
791         * cp/Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/pph.o.
792         (CXX_PARSER_H): Define.
793         (CXX_PPH_H): Define.
794         (cp/cp-lang.o): Add dependency on CXX_PARSER_H and
795         CXX_PPH_H.
796         (cp/parser.o): Likewise.
797         (cp/decl.o): Add dependency on CXX_PPH_H.
798         (cp/call.o): Likewise.
799         (cp/pt.o): Likewise.
800         (cp/name-lookup.o): Likewise.
801         (cp/pph.o): New.
802         * cp/cp-lang.c: Include parser.h and pph.h.
803         * cp/pt.c: Include pph.h.
804         * cp/parser.c: Remove inclusion of timevar.h,
805         pointer-set.h, fixed-value.h, cpplib.h, line-map.h,
806         md5.h, hashtab.h, tree-pass.h and tree-inline.h.
807         Include parser.h and pph.h
808         (struct tree_check): Move to parser.h.
809         (struct cp_token): Likewise.
810         (struct cp_lexer): Likewise.
811         (struct cp_token_cache): Likewise.
812         (struct cp_token_ident_d): Likewise.
813         (CPP_KEYWORD): Likewise.
814         (CPP_TEMPLATE_ID): Likewise.
815         (CPP_NESTED_NAME_SPECIFIER): Likewise.
816         (N_CP_TTYPES): Likewise.
817         (enum cp_parser_status_kind): Likewise.
818         (struct cp_parser_context): Likewise.
819         (struct cp_default_arg_entry_d): Likewise.
820         (struct cp_unparsed_functions_entry_d): Likewise.
821         (struct cp_parser): Likewise.
822         (struct cp_token_hunk): Move to pph.h.
823         (DIGEST_LEN): Likewise.
824         (struct pth_image): Likewise.
825         (pth_image_ptr): Likewise.
826         (struct pth_include): Likewise.
827         (pth_include_ptr): Likewise.
828         (struct pth_state): Likewise.
829         (struct pth_stats_d): Likewise.
830         (PTH_STATS_INCR): Likewise.
831         (struct pph_stats_d): Likewise.
832         (PPH_STATS_INCR): Likewise.
833         (pth_stats): Make extern.
834         (pph_stats): Likewise.
835         (cp_lexer_dump_tokens): Likewise.
836         (cp_lexer_debug_tokens): Likewise.
837         (cp_lexer_token_position): Likewise.
838         (cp_lexer_get_tokens): Likewise.
839         (the_parser): Likewise.
840         (pph_decl_head_token_cache): Move to pph.c
841         (pph_decl_body_token_cache): Likewise.
842         (struct pph_decl_deps_d): Likewise.
843         (pph_decl_deps): Likewise.
844         (pph_tree_catcher): Likewise.
845         (pph_name_lookups): Likewise.
846         (pph_name_lookups_set): Likewise.
847         (pph_nl_token_map): Likewise.
848         (pph_logfile): Likewise.
849         (pph_print_tokens): Likewise.
850         (pathnames_equal_p): Likewise.
851         (pph_debug_location): Likewise.
852         (pph_debug_loc_of_tree): Likewise.
853         (pth_image_dir_hash): Likewise.
854         (pth_image_dir_eq): Likewise.
855         (pth_global_state): Likewise.
856         (pth_get_state): Likewise.
857         (pth_id_str): Likewise.
858         (pth_header_len): Likewise.
859         (PTH_EXTENSION): Likewise.
860         (pth_name_for): Likewise.
861         (pth_file_for): Likewise.
862         (pth_get_md5_digest): Likewise.
863         (pth_get_index_from_type): Likewise.
864         (pth_write_uint): Likewise.
865         (pth_write_sizet): Likewise.
866         (pth_write_bytes): Likewise.
867         (pth_write_string): Likewise.
868         (pth_write_number): Likewise.
869         (pth_save_token_value): Likewise.
870         (pth_save_token): Likewise.
871         (pth_write_header): Likewise.
872         (pth_dump_identifiers): Likewise.
873         (pth_debug_identifiers): Likewise.
874         (pth_dump_hunk): Likewise.
875         (pth_debug_hunk): Likewise.
876         (pth_dump_include): Likewise.
877         (pth_debug_include): Likewise.
878         (pth_dump_token_hunks_1): Likewise.
879         (pth_dump_token_hunks): Likewise.
880         (pth_debug_token_hunks): Likewise.
881         (pth_dump_image): Likewise.
882         (pth_debug_image): Likewise.
883         (pth_show_image_stats): Likewise.
884         (pth_dump_state): Likewise.
885         (pth_debug_state): Likewise.
886         (pth_save_identifiers): Likewise.
887         (pth_save_hunk): Likewise.
888         (pth_save_include): Likewise.
889         (pth_save_image): Likewise.
890         (pth_get_type_from_index): Likewise.
891         (pth_read_uint): Likewise.
892         (pth_read_sizet): Likewise.
893         (pth_read_bytes): Likewise.
894         (pth_read_string): Likewise.
895         (pth_read_string_alloc): Likewise.
896         (pth_load_number): Likewise.
897         (pth_load_token_value): Likewise.
898         (pth_load_identifiers): Likewise.
899         (pth_load_hunk): Likewise.
900         (pth_create_include): Likewise.
901         (pth_load_include): Likewise.
902         (pth_load_image): Likewise.
903         (pth_have_valid_image_for): Likewise.
904         (pth_new_image): Likewise.
905         (pth_image_lookup): Likewise.
906         (pth_append_hunk): Likewise.
907         (pth_hunk_is_valid_p): Likewise.
908         (pth_image_can_be_used): Likewise.
909         (pth_get_dir_and_name): Likewise.
910         (pth_process_text_file): Likewise.
911         (pth_image_to_lexer): Likewise.
912         (pth_lexer_to_image): Likewise.
913         (pth_get_file_transition): Likewise.
914         (pth_leave_file): Likewise.
915         (pth_enter_file): Likewise.
916         (pth_file_change): Likewise.
917         (pth_include_handler): Likewise.
918         (pth_init): Likewise.
919         (pth_print_stats): Likewise.
920         (pth_finish): Likewise.
921         (pph_log_exposed): Likewise.
922         (pph_allocate_catcher_memory): Likewise.
923         (pph_free_catcher_memory): Likewise.
924         (pph_start_exposed): Likewise.
925         (pph_lookup_head_token_cache_for): Likewise.
926         (pph_lookup_body_token_cache_for): Likewise.
927         (pph_set_head_token_cache_for): Likewise.
928         (pph_set_body_token_cache_for): Likewise.
929         (pph_copy_decls_into_cache): Likewise.
930         (pph_copy_decls_outof_cache): Likewise.
931         (pph_stop_exposed): Likewise.
932         (pph_debug_tree): Likewise.
933         (pph_debug_type): Likewise.
934         (pph_tree_caught_p): Likewise.
935         (pph_catch_head_tokens_for): Likewise.
936         (pph_catch_body_tokens_for): Likewise.
937         (pph_lookup_dependencies_for): Likewise.
938         (pph_set_dependencies_for): Likewise.
939         (is_namespace): Likewise.
940         (PPH_ARTIFICIAL): Likewise.
941         (pph_null_exposed): Likewise.
942         (pph_live_exposed): Likewise.
943         (pph_find_exposed_for): Likewise.
944         (pph_catch_dependencies_for): Likewise.
945         (pph_catch_tree): Likewise.
946         (pph_uncatch_tree): Likewise.
947         (pph_locate_name_lookups_in): Likewise.
948         (pph_print_copy_tokens): Likewise.
949         (pph_print_token_range): Likewise.
950         (pph_print_dependence): Likewise.
951         (pph_print_depend_template): Likewise.
952         (pph_print_depend_decl): Likewise.
953         (pph_print_depend_type): Likewise.
954         (pph_print_depend_type_type): Likewise.
955         (pph_print_depend_func_type): Likewise.
956         (pph_print_depend_var_type): Likewise.
957         (pph_get_decl_exposure): Likewise.
958         (pph_print_dependences): Likewise.
959         (pph_print_declaration_head): Likewise.
960         (pph_print_declaration_body): Likewise.
961         (pph_find_special_methods): Likewise.
962         (pph_implicit_class_cost): Likewise.
963         (pph_print_declaration): Likewise.
964         (pph_print_declarations): Likewise.
965         (pph_print_trees_tokens): Likewise.
966         (pph_catch_name_lookup): Likewise.
967         (pph_print_stats): Likewise.
968         (pph_init): Likewise.
969         (pph_finish): Likewise.
970         * config-lang.in (gtfiles): Add cp/parser.h, cp/pph.h
971         and cp/pph.c.
972         * call.c: Include pph.h
973         * cp-tree.h (PPH_POP_TIMEVAR_AND_RETURN): Move to
974         pph.h
975         (pph_catch_tree): Likewise.
976         (pph_uncatch_tree): Likewise.
977         (pph_catch_name_lookup): Likewise.
978         * name-lookup.c: Include pph.h.
980 2010-11-02  Lawrence Crowl  <crowl@google.com>
981             Diego Novillo  <dnovillo@google.com>
983         * decl.c: Include langhooks.h
984         (duplicate_decls_internal): Rename from duplicate_decls
985         (duplicate_decls): New wrapper around
986         duplicate_decls_internal.
987         * Make-lang.in (cp/decl.o): Add dependency on langhooks.h
988         (cp/parser.o): Add dependency on pointer-set.h,
989         fixed-value.h, MD5_H, HASTHTAB_H, tree-pass.h,
990         TREE_INLINE_H and tree-pretty-print.h.
991         (cp/name-lookup.o): Add dependency on tree-pretty-print.h
992         * rtti.c (create_pseudo_type_info): Mark TYPE_NAME of
993         PSEUDO_TYPE as artificial.
994         * cp-gimplify.c (cp_genericize): Add FIXME note.
995         * parser.c: Include timevar.h, pointer-set.h,
996         fixed-value.h, cpplib.h, line-map.h, md5.h, hashtab.h,
997         tree-pass.h, tree-inline.h and tree-pretty-print.h.
998         (struct cp_token): Add field purged_p.
999         Adjust all users of CPP_PURGED.
1000         (eof_token): Adjust.
1001         (struct cp_lexer): Convert buffer into a VEC.
1002         Remove field buffer_length.
1003         Adjust all users.
1004         (cp_token_cache_ptr): New typedef.
1005         (struct cp_token_ident_d): Declare.
1006         (cp_token_ident): New typedef.
1007         (struct cp_token_hunk): Declare.
1008         (cp_token_hunk_ptr): New typedef.
1009         (DIGEST_LEN): Define.
1010         (struct pth_image): Define.
1011         (pth_image_ptr): New typedef.
1012         (struct pth_include): Define.
1013         (pth_include_ptr): New typedef.
1014         (struct pth_state): Declare.
1015         (struct pth_stats_d): Declare.
1016         (pth_stats): Declare.
1017         (PTH_STATS_INCR): Define.
1018         (struct pph_stats_d): Declare.
1019         (pph_stats): Declare.
1020         (PPH_STATS_INCR): Define.
1021         (pph_decl_head_token_cache): Declare.
1022         (pph_decl_body_token_cache): Declare.
1023         (struct pph_decl_deps_d): Declare.
1024         (pph_decl_deps): Declare.
1025         (pph_tree_catcher): Declare.
1026         (pph_name_lookups): Declare.
1027         (pph_name_lookups_set): Declare.
1028         (pph_nl_token_map): Declare.
1029         (pph_logfile): Declare.
1030         (pph_print_trees_tokens): Declare.
1031         (cp_lexer_print_token): Always declare.
1032         (CPP_PURGED): Remove.  Replace all uses with
1033         token->purged_p.
1034         (N_CP_TTYPES): Adjust.
1035         (cp_lexer_dump_tokens): Move earlier in the file.
1036         (cp_lexer_debug_tokens): New.
1037         (pathnames_equal_p): New.
1038         (pph_debug_location): New.
1039         (pph_debug_loc_of_tree): New.
1040         (pth_image_dir_hash): New.
1041         (pth_image_dir_eq): New.
1042         (pth_get_state): New.
1043         (pth_id_str): New.
1044         (pth_header_len): New.
1045         (PTH_EXTENSION): Define.
1046         (pth_name_for): New.
1047         (pth_file_for): New.
1048         (pth_get_md5_digest): New.
1049         (pth_get_index_from_type): New.
1050         (pth_write_uint): New.
1051         (pth_write_sizet): New.
1052         (pth_write_bytes): New.
1053         (pth_write_string): New.
1054         (pth_write_number): New.
1055         (pth_save_token_value): New.
1056         (pth_save_token): New.
1057         (pth_write_header): New.
1058         (pth_dump_identifiers): New.
1059         (pth_debug_identifiers): New.
1060         (pth_dump_hunk): New.
1061         (pth_debug_hunk): New.
1062         (pth_dump_include): New.
1063         (pth_debug_include): New.
1064         (pth_dump_token_hunks_1): New.
1065         (pth_dump_token_hunks): New.
1066         (pth_debug_token_hunks): New.
1067         (pth_dump_image): New.
1068         (pth_debug_image): New.
1069         (pth_show_image_stats): New.
1070         (pth_dump_state): New.
1071         (pth_debug_state): New.
1072         (pth_save_identifiers): New.
1073         (pth_save_hunk): New.
1074         (pth_save_include): New.
1075         (pth_save_image): New.
1076         (pth_get_type_from_index): New.
1077         (pth_read_uint): New.
1078         (pth_read_sizet): New.
1079         (pth_read_bytes): New.
1080         (pth_read_string): New.
1081         (pth_read_string_alloc): New.
1082         (pth_load_number): New.
1083         (pth_load_token_value): New.
1084         (pth_load_identifiers): New.
1085         (pth_load_hunk): New.
1086         (pth_create_include): New.
1087         (pth_load_include): New.
1088         (pth_load_image): New.
1089         (pth_have_valid_image_for): New.
1090         (pth_new_image): New.
1091         (pth_image_lookup): New.
1092         (pth_append_hunk): New.
1093         (pth_hunk_is_valid_p): New.
1094         (pth_image_can_be_used): New.
1095         (cp_lexer_finished_p): New.
1096         (cp_lexer_get_tokens): New.
1097         (pth_get_dir_and_name): New.
1098         (pth_process_text_file): New.
1099         (pth_image_to_lexer): New.
1100         (pth_lexer_to_image): New.
1101         (pth_get_file_transition): New.
1102         (pth_leave_file): New.
1103         (pth_enter_file): New.
1104         (pth_file_change): New.
1105         (pth_include_handler): New.
1106         (pth_init): New.
1107         (pth_print_stats): New.
1108         (pth_finish): New.
1109         (cp_lexer_alloc): New.
1110         (cp_lexer_new_main): Rewrite to support -fpth.
1111         (cp_lexer_get_preprocessor_token): Flag error if -fpth
1112         is used together with PCH.
1113         (cp_lexer_consume_token): Call PPH_STATS_INCR.
1114         (cp_lexer_print_token): Remove "PURGED" string.
1115         Show CPP_NUMBER tokens.
1116         Do not abort if token->type is outside of TOKEN_NAMES.
1117         (pph_log_exposed): New.
1118         (pph_allocate_catcher_memory): New.
1119         (pph_free_catcher_memory): New.
1120         (pph_start_exposed): New.
1121         (pph_lookup_head_token_cache_for): New.
1122         (pph_lookup_body_token_cache_for): New.
1123         (pph_set_head_token_cache_for): New.
1124         (pph_set_body_token_cache_for): New.
1125         (pph_copy_decls_into_cache): New.
1126         (pph_copy_decls_outof_cache): New.
1127         (pph_stop_exposed): New.
1128         (cp_parser_declaration): Call pph_start_exposed and
1129         pph_stop_exposed for several cases.
1130         (cp_parser_elaborated_type_specifier): Add tracing code
1131         for -fpph-debug.
1132         (cp_parser_class_specifier): Add FIXME notes.
1133         (cp_parser_lookup_name_1): Rename from cp_parser_lookup_name.
1134         (cp_parser_lookup_name): Call it.
1135         Call pph_catch_name_lookup with the result.
1136         (pph_debug_tree): New.
1137         (pph_debug_type): New.
1138         (pph_tree_caught_p): New.
1139         (pph_catch_head_tokens_for): New.
1140         (pph_catch_body_tokens_for): New.
1141         (pph_lookup_dependencies_for): New.
1142         (pph_set_dependencies_for): New.
1143         (is_namespace): New.
1144         (pph_null_exposed): New.
1145         (pph_live_exposed): New.
1146         (pph_find_exposed_for): New.
1147         (pph_catch_dependencies_for): New.
1148         (pph_catch_tree): New.
1149         (pph_uncatch_tree): New.
1150         (pph_locate_name_lookups_in): New.
1151         (pph_print_copy_tokens): New.
1152         (pph_print_token_range): New.
1153         (pph_print_dependence): New.
1154         (pph_print_depend_template): New.
1155         (pph_print_depend_decl): New.
1156         (pph_print_depend_type): New.
1157         (pph_print_depend_type_type): New.
1158         (pph_print_depend_func_type): New.
1159         (pph_print_depend_var_type): New.
1160         (pph_get_decl_exposure): New.
1161         (pph_print_dependences): New.
1162         (pph_print_declaration_head): New.
1163         (pph_print_declaration_body): New.
1164         (pph_find_special_methods): New.
1165         (pph_implicit_class_cost): New.
1166         (pph_print_declaration): New.
1167         (pph_print_declarations): New.
1168         (pph_print_trees_tokens): New.
1169         (pph_catch_name_lookup): New.
1170         (pph_print_stats): New.
1171         (pph_init): New.
1172         (pph_finish): New.
1173         (c_parse_file): Call pph_init and pph_finish.
1174         * call.c (implicit_conversion): Call pph_catch_name_lookup.
1175         (build_new_op): Call pph_catch_name_lookup.
1176         (convert_like_real): Call pph_catch_name_lookup.
1177         (build_new_method_call): Call pph_catch_name_lookup.
1178         * cp-objcp-common.h (LANG_HOOKS_PPH_CATCH_TREE): Define.
1179         (LANG_HOOKS_PPH_UNCATCH_TREE): Define.
1180         * cp-tree.h (PPH_POP_TIMEVAR_AND_RETURN): Define.
1181         Replace every call to POP_TIMEVAR_AND_RETURN with
1182         PPH_POP_TIMEVAR_AND_RETURN.
1183         (pph_catch_tree): Declare.
1184         (pph_uncatch_tree): Declare.
1185         (pph_catch_name_lookup): Declare.
1186         * name-lookup.c: Include tree-pretty-print.h
1187         (add_decl_to_level): Add tracing for -fpph-debug.