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