1 2011-04-06 Lawrence Crowl <crowl@google.com>
3 * pph.c (pth_dump_identifiers): Split cpp_idents_used::max_length
4 into max_ident_length and max_value_length. Print used_by_directive
5 and expanded_to_text attributes of macros.
6 (pth_save_identifiers): Split cpp_idents_used::max_length into
7 max_ident_length and max_value_length. Filter out macro that are
8 neither used_by_directive nor expanded_to_text, which requires
9 precounting the number of entries remaining. Save used_by_directive
10 and expanded_to_text attributes of the macros.
11 (pth_load_identifiers): Split cpp_idents_used::max_length into
12 max_ident_length and max_value_length. Restore used_by_directive and
13 expanded_to_text attributes of the macros.
14 (pph_read_file): Make failure to read a pph file a non-fatal error.
16 2011-04-05 Lawrence Crowl <crowl@google.com>
18 * parser.c (cp_lexer_dump_tokens): Remove #ifdef ENABLE_CHECKING.
19 (cp_lexer_debug_tokens): Likewise.
21 2011-04-04 Diego Novillo <dnovillo@google.com>
23 * cp-tree.h (cxx_binding_make): Declare.
24 * name-lookup.c (cxx_binding_make): Make extern.
25 * parser.c (cp_token_cache): Make extern.
26 * parser.h (cp_token_cache): Declare.
27 * pph-streamer-in.c (pph_stream_unpack_value_fields): Move
29 (pph_stream_init_read): Call lto_reader_init.
30 Associate STREAM with STREAM->DATA_IN.
31 (pph_start_record): New.
32 (pph_stream_read_ld_base): New.
33 (pph_stream_read_ld_min): New.
34 (pph_stream_read_tree_vec): New.
35 (pph_stream_read_cxx_binding_1): New.
36 (pph_stream_read_cxx_binding): New.
37 (pph_stream_read_class_binding): New.
38 (pph_stream_read_label_binding): New.
39 (pph_stream_read_binding_level): New.
40 (pph_stream_read_c_language_function): New.
41 (pph_stream_read_language_function): New.
42 (pph_stream_read_ld_fn): New.
43 (pph_stream_read_ld_ns): New.
44 (pph_stream_read_ld_parm): New.
45 (pph_stream_read_lang_specific_data): New.
46 (pph_stream_read_tree): Retrieve pph_stream instance from
48 Mark IB argument as unused.
49 Call pph_stream_read_lang_specific_data for DECLs that have
51 Replace calls to lto_input_sleb128 with pph_input_uint.
52 (pph_stream_alloc_tree): New.
53 * pph-streamer-out.c (pph_stream_init_write): Call
55 Associate STREAM with OB.
56 (pph_start_record): New.
57 (pph_stream_write_ld_base): Change first argument to be a
58 pph_stream. Change all users.
59 Call pph_start_record.
60 Call pph_output_bitpack.
61 (pph_stream_write_ld_min): Likewise.
62 (pph_stream_write_tree_vec): Likewise.
63 (pph_stream_write_cxx_binding_1): Likewise.
64 (pph_stream_write_cxx_binding): Likewise.
65 (pph_stream_write_class_binding): Likewise.
66 (pph_stream_write_label_binding): Likewise.
67 (pph_stream_write_binding_level): Likewise.
68 (pph_stream_write_c_language_function): Likewise.
69 (pph_stream_write_language_function): Likewise.
70 (pph_stream_write_ld_fn): Likewise.
71 (pph_stream_write_ld_ns): Likewise.
72 (pph_stream_write_ld_parm): Likewise.
73 (pph_stream_write_lang_specific_data): Likewise.
74 (pph_stream_write_tree): Only call
75 pph_stream_write_lang_specific_data for tree nodes that have
76 DECL_LANG_SPECIFIC set.
77 * pph-streamer.c (enum pph_trace_type): Add PPH_TRACE_CHAIN
78 and PPH_TRACE_BITPACK.
79 (pph_stream_trace): Add "chain" and "bitpack" to TYPE_S.
80 Handle PPH_TRACE_CHAIN And PPH_TRACE_BITPACK.
81 (pph_stream_trace_tree): Do not compute tree code size on
83 (pph_stream_trace_chain): New.
84 (pph_stream_trace_bitpack): New.
85 (pph_stream_output_tree_header): New.
86 (pph_stream_hooks_init): Add hooks for alloc_tree and
88 * pph-streamer.h (PPH_RECORD_START): Declare.
89 (PPH_RECORD_END): Declare.
90 (pph_stream_trace_chain): Declare.
91 (pph_stream_trace_bitpack): Declare.
92 (pth_load_token_cache): Declare.
93 (pph_output_tree_or_ref): New.
94 (pph_output_uchar): New.
95 (pph_output_string_with_length): Do not trace the string
97 (pph_output_chain): New.
98 (pph_output_bitpack): New.
99 (pph_input_uchar): New.
100 (pph_input_chain): New.
101 (pph_input_bitpack): New.
102 (pph_get_pph_stream): Remove. Update all users.
103 (pph_set_pph_stream): Remove. Update all users.
104 (pph_stream_output_tree_header): Declare.
105 (pph_stream_alloc_tree): Declare.
106 * pph.c (pth_load_token): Factor out of pth_load_hunk.
107 (pth_load_token_cache): New.
108 (pph_read_file_contents): Read global_namespace.
110 2011-03-30 Diego Novillo <dnovillo@google.com>
112 * pph-streamer.h (pph_get_pph_stream): Rename from
113 pph_get_ob_stream. Update all users.
114 (pph_set_pph_stream): Rename from pph_set_pph_stream. Update
116 (pph_output_tree): Remove ATTRIBUTE_UNUSED.
117 (pph_input_tree): Remove ATTRIBUTE_UNUSED.
119 2011-03-30 Diego Novillo <dnovillo@google.com>
121 * cp-tree.h (struct language_function): Add prefix 'x_' to
122 fields returns_value, returns_null, returns_abnormally,
123 in_function_try_handler, in_base_initializer. Update all
125 * pph-streamer.c (pph_stream_write_ld_base): New.
126 (pph_stream_write_ld_min): New.
127 (pph_stream_write_tree_vec): New.
128 (pph_stream_write_cxx_binding_1): New.
129 (pph_stream_write_cxx_binding): New.
130 (pph_stream_write_class_binding): New.
131 (pph_stream_write_label_binding): New.
132 (pph_stream_write_binding_level): New.
133 (pph_stream_write_c_language_function): New.
134 (pph_stream_write_language_function): New.
135 (pph_stream_write_ld_fn): New.
136 (pph_stream_write_ld_ns): New.
137 (pph_stream_write_ld_parm): New.
138 (pph_stream_write_lang_specific_data): New.
139 (pph_indexable_with_decls_p): New.
140 (pph_stream_hooks_init): Initialize h->indexable_with_decls_p
141 with pph_indexable_with_decls_p.
142 (pph_stream_begin_section): Do not free BLOCK.
143 * pph-streamer.h (pth_save_token_cache): Declare.
144 (pph_get_ob_stream): New.
145 (pph_set_ob_stream): New.
146 * pph.c (pth_save_token_cache): New.
147 (pph_print_macro_defs_before): Remove.
148 (pph_print_macro_defs_after): Remove.
149 (pph_write_namespace): Remove.
150 (pph_write_format): Remove.
151 (pph_write_print): Remove.
152 (pph_write_dump): Remove.
153 (pph_write_symbol): Remove.
154 (declvisitor): Remove.
155 (pph_write_namespace_1): Remove.
156 (pph_write_namespace): Remove.
157 (pph_write_file_contents): Rename from pph_write_file_object.
158 Output global_namespace.
159 (pph_write_file): Call it.
160 (pph_write_file_summary): Remove.
161 (pph_read_file_contents): Rename from pph_file_read_object.
162 (pph_read_file): Rename from pph_file_read.
164 2011-03-28 Diego Novillo <dnovillo@google.com>
166 * pph.c (pph_write_format): Rename from write_pph_format.
167 (pph_write_namespace): Rename from write_pph_namespace.
168 (pph_write_print): Rename from write_pph_print.
169 (pph_write_dump): Rename from write_pph_dump.
170 (pph_write_symbol): Rename from write_pph_symbol.
171 (pph_write_namespace): Rename from write_pph_namespace.
172 (pph_write_namespace_1): Rename from write_pph_namespace_1.
173 (pph_write_file_object): Rename from write_pph_file_object.
174 (pph_write_file_summary): Rename from write_pph_file_summary.
175 (pph_write_file_dump): Rename from write_pph_file_dump.
176 (pph_write_file): Rename from write_pph_file.
177 (pph_file_read_object): Rename from read_pph_file_object.
178 (pph_file_read): Rename from read_pph_file.
180 2011-03-25 Diego Novillo <dnovillo@google.com>
182 * Make-lang.in (cp/pph-streamer.o): Add dependency on
184 * pph-streamer.c: Include tree-iterator.h
185 (pph_stream_write_tree): Handle STATEMENT_LIST.
186 (pph_stream_read_tree): Likewise.
187 (pph_is_streamable): New.
188 (pph_stream_pack_value_fields): New.
189 (pph_stream_unpack_valude_fields): New.
190 (pph_stream_hooks_init): Rename from pph_streamer_hooks_init.
191 Fill in callbacks for name, is_streamable, pack_value_fields
192 and unpack_value_fields;
195 2011-03-25 Diego Novillo <dnovillo@google.com>
197 * cp/pph-streamer.c (pph_stream_init_write):
199 2011-03-25 Diego Novillo <dnovillo@google.com>
201 * pph-streamer.c (pph_stream_hooks_init): New.
202 (pph_stream_open): Call it.
204 2011-03-23 Diego Novillo <dnovillo@google.com>
206 * Make-lang.in (cp/pph-streamer.o): Add dependencies on
207 tree-pretty-print.h, CXX_PPH_H, TREE_PASS_H, version.h and
209 * pph-streamer.c: Include tree-pretty-print.h, pph.h,
210 tree-pass.h, version.h and cppbuiltin.h.
211 (pph_get_section_data): New.
212 (pph_free_section_data): New.
213 (pph_stream_init_read): Rename from pph_file_read.
214 Initialize LTO streaming data structures.
215 Read pph file in memory.
216 (pph_stream_init_write): Factor out of ...
217 (pph_stream_open): ... here.
218 (pph_stream_write_header): New.
219 (pph_stream_write_body): Factor out of ...
220 (pph_stream_close): ... here.
221 Call pph_stream_write_header.
222 (enum pph_trace_type): Declare.
223 (pph_stream_trace): New.
224 (pph_stream_trace_tree): New.
225 (pph_stream_trace_uint): New.
226 (pph_stream_trace_bytes): New.
227 (pph_stream_trace_string): New.
228 (pph_stream_trace_string_with_length): New.
229 * pph-streamer.h (PPH_NUM_SECTIONS): Define.
230 (PPH_USE_FILE_IO): Remove. Update all users.
231 (pph_id_str): Define.
232 (pph_file_header): Declare.
233 (pph_stream): Add fields pph_sections, file_data and file_size.
234 (pph_stream_open): Change second argument to const char *.
236 (pph_stream_trace_tree): Declare.
237 (pph_stream_trace_uint): Declare.
238 (pph_stream_trace_bytes): Declare.
239 (pph_stream_trace_string): Declare.
240 (pph_stream_trace_string_with_length): Declare.
241 (pph_output_tree): Call pph_stream_trace_tree if flag_pph_tracer
243 (pph_input_tree): Likewise.
244 (pph_output_uint): Call pph_stream_trace_uint if flag_pph_tracer
246 (pph_input_uint): Likewise.
247 (pph_output_bytes): Call pph_stream_trace_bytes if flag_pph_tracer
249 (pph_input_bytes): Likewise.
250 (pph_output_string): Call pph_stream_trace_string if flag_pph_tracer
252 (pph_input_string): Likewise.
253 (pph_output_string_with_length): Call
254 pph_stream_trace_string_with_length if flag_pph_tracer is
256 * pph.c (pph_print_macro_defs_before): Call pph_output_string.
257 (pph_print_macro_defs_after): Likewise.
258 (pth_load_token_value): Do not free the read string.
259 (pth_load_identifiers): Likewise.
260 (pth_load_include): Likewise.
261 (pth_load_image): Call pph_input_bytes to read the header.
262 (write_pph_print): Call pph_output_tree.
263 (write_pph_file_object): Remove fprintf() call.
264 (pth_include_handler): Remove FIXME marker.
265 (pph_include_handler): Tidy.
267 2011-03-09 Diego Novillo <dnovillo@google.com>
269 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/pph-streamer.o
270 (CXX_PPH_STREAMER_H): New.
271 (cp/pph.o): Add dependency on CXX_PPH_STREAMER_H.
272 (cp/pph-streamer.o): New.
273 * pph-streamer.c: New file.
274 * pph-streamer.h: New file.
275 * pph.c: Update Copyright line.
276 Include pph-streamer.h
277 (pth_file_for): Change FILE * argument with pph_streamer *.
279 (pth_write_uint): Remove.
280 (pth_write_bytes): Remove.
281 (pth_write_string): Remove.
282 (pth_write_number): Re-implement using pph_streamer and
284 (pth_save_token_value): Likewise.
285 (pth_save_token): Likewise.
286 (pth_write_header): Likewise.
287 (pph_print_macro_defs_before): Likewise.
288 (pph_print_macro_defs_after): Likewise.
289 (pth_save_identifiers): Likewise.
290 (pth_save_hunk): Likewise.
291 (pth_save_include): Likewise.
292 (pth_save_image): Likewise.
293 (pth_read_uint): Remove.
294 (pth_read_bytes): Remove.
295 (pth_read_string): Remove.
296 (pth_read_string_alloc): Remove.
297 (pth_load_number): Re-implement using pph_streamer and
299 (pth_load_token_value): Likewise.
300 (pth_load_identifiers): Likewise.
301 (pth_load_hunk): Likewise.
302 (pth_load_include): Likewise.
303 (pth_load_include): Likewise.
304 (pth_load_image): Likewise.
305 (pth_have_valid_image_for): Likewise.
306 (write_pph_format): Likewise.
307 (write_pph_namespace): Likewise.
308 (write_pph_print): Likewise.
309 (write_pph_dump): Likewise.
310 (write_pph_symbol): Likewise.
311 (declvisitor): Likewise.
312 (write_pph_namespace_1): Likewise.
313 (write_pph_file_object): Likewise.
314 (write_pph_file_summary): Likewise.
315 (write_pph_file_dump): Likewise.
316 (read_pph_file_object): Likewise.
317 * pph.h: Update file comment.
319 2011-03-04 Lawrence Crowl <crowl@google.com>
321 * cp/pph.c (pph_print_macro_defs_before): New.
322 * (pph_print_macro_defs_after): New.
323 * (write_pph_format): New.
324 * (write_pph_namespace): New.
325 * (write_pph_print): New.
326 * (write_pph_dump): New.
327 * (write_pph_symbol): New.
328 * (write_pph_namespace_1): New.
329 * (write_pph_namespace): New.
330 * (write_pph_file_object): New.
331 * (write_pph_file_summary): New.
332 * (write_pph_file_dump): New.
333 * (write_pph_file): Write used macros instead of dummy contents.
334 Renamed from write_pph_output.
335 * (wrap_macro_def): New.
336 * (report_validation_error): New.
337 * (read_pph_file_object): New.
338 * (read_pph_file): Read used macros instead of dummy contents.
339 Verify the macro values.
340 * (pph_include_handler): Do not read a PPH file a second time.
341 * (PPH_ARTIFICIAL): Remove redundant condition.
342 * (pph_init): Set up the preprocessor lookaside table.
344 2011-02-24 Lawrence Crowl <crowl@google.com>
346 * cp/pph.c (pph_finish): Check for missing preprocessor guard
347 for pre-parsed headers.
349 2011-02-15 Lawrence Crowl <crowl@google.com>
351 * cp/pph.c (write_pph_output, read_pph_file,
352 pph_include_handler): Add.
353 (pph_start_exposed, pph_stop_exposed): Change debug level.
354 (pph_init): Set callback for pph_include_handler.
355 (pph_finish): Write PPH file.
356 * cp/parser.c (cp_lexer_new_main): Duplicate PTH and PCH
357 incompatibility for PPH. Add call to pph_init only when PPH
359 * (c_parse_file): Remove call to pph_init.
361 2011-01-27 Diego Novillo <dnovillo@google.com>
363 * Make-lang.in (cp/parser.o): Fix dependencies.
364 * pph.c (pth_process_text_file): Do not try to start reading the file
365 at an arbitrary offset.
366 Remove OFFSET argument. Update all users.
367 (pth_image_to_lexer): Emit a fatal error if a hunk fails
369 (pth_lexer_to_image):
371 * pph.h (struct cp_token_hunk): Remove fields text_offset and
374 (struct pth_image): Remove field hunk_text_offset.
377 2011-01-24 Lawrence Crowl <crowl@google.com>
381 * decl.c: (push_local_name): Change TV_NAME_LOOKUP to start/stop.
382 * (poplevel): Refactor POP_TIMEVAR_AND_RETURN to plain code.
383 Change TV_NAME_LOOKUP to start/stop.
384 * (define_label): Refactor timevar calls out to a wrapper function.
385 Change TV_NAME_LOOKUP to start/stop.
386 * (xref_tag): Likewise.
387 * (lookup_label): Refactor timevar calls out to a wrapper function.
388 Change TV_NAME_LOOKUP to start_cond/stop_cond.
390 * pt.c: (instantiate_class_template): Refactor timevar calls out to a
391 wrapper function. Add push/pop of new TV_INSTANTIATE_TEMPLATE.
392 * (instantiate_template): Refactor timevar calls out to a wrapper
393 function. Add push/pop of new TV_INSTANTIATE_TEMPLATE.
394 * (lookup_template_class): Refactor timevar calls out to a wrapper
395 function. Change TV_NAME_LOOKUP to start_cond/stop_cond.
396 * (instantiate_decl): Change TV_PARSE to TV_PARSE_GLOBAL.
398 * name-lookup.c: (store_bindings): Change TV_NAME_LOOKUP to start/stop.
399 * (poplevel_class): Change TV_NAME_LOOKUP to start_cond/stop_cond.
400 * (push_namespace): Likewise.
401 * (pop_nested_namespace): Likewise.
402 * (pushdecl_namespace_level): Likewise.
403 * (store_class_bindings): Likewise.
404 * (push_to_top_level): Likewise.
405 * (identifier_type_value): Refactor timevar calls out to a wrapper
406 function. Change TV_NAME_LOOKUP to start/stop.
407 * (find_binding): Likewise.
408 * (push_using_decl): Likewise.
409 * (lookup_arg_dependent): Likewise.
410 * (push_using_directive): Likewise.
411 * (qualified_lookup_using_namespace): Refactor POP_TIMEVAR_AND_RETURN
412 to plain code. Change TV_NAME_LOOKUP to start/stop.
413 * (lookup_type_current_level): Likewise. Refactor inner return to
415 * (pushdecl_class_level): Refactor POP_TIMEVAR_AND_RETURN to plain
416 code. Change TV_NAME_LOOKUP to start_cond/stop_cond.
417 * (pushdecl_top_level_1): Likewise.
418 * (lookup_using_namespace): Likewise.
419 * (pushdecl_with_scope): Refactor timevar calls out to a wrapper
420 function. Change TV_NAME_LOOKUP to start_cond/stop_cond.
421 * (push_overloaded_decl): Likewise.
422 * (push_class_level_binding): Likewise.
423 * (namespace_binding): Likewise.
424 * (set_namespace_binding): Likewise.
425 * (supplement_binding): Likewise.
426 * (unqualified_namespace_lookup): Likewise.
427 * (lookup_name_real): Likewise.
428 * (lookup_type_scope): Likewise.
429 * (namespace_ancestor): Likewise.
430 * (lookup_name_innermost_nonclass_level_1): Likewise.
431 * (pushtag): Likewise.
432 * (pop_from_top_level): Likewise.
433 * (pushdecl_maybe_friend): Refactor timevar calls out to a wrapper
434 function. Change TV_NAME_LOOKUP to start_cond/stop_cond. Wrap long
436 * (add_using_namespace): Refactor timevar calls out to a wrapper
437 function. Change TV_NAME_LOOKUP to start_cond/stop_cond. Bypass
438 wrapper on call to self.
440 * decl2.c: (cp_write_global_declarations): Add start/stop of
441 new TV_PHASE_CP_DEFERRED, TV_PHASE_CGRAPH, TV_PHASE_CHECK_DBGINFO.
442 Remove push/pop calls to TV_VARCONST.
444 * parser.c: Add include of "timevar.h".
445 * (cp_parser_explicit_instantiation): Add push/pop calls to new
446 TV_INSTANTIATE_TEMPLATE.
447 * (cp_parser_enum_specifier): Add push/pop calls to new TV_PARSE_ENUM.
448 * (cp_parser_class_specifier): Add push/pop calls to new
450 * (cp_parser_function_definition_from_specifiers_and_declarator): Add
451 push/pop calls to new TV_PARSE_FUNC.
452 * (cp_parser_late_parsing_for_member): Add push/pop calls to
455 * call.c: Add include of "timevar.h".
456 * (perform_overload_resolution): Add push/pop calls to new
459 * Make-lang.in: Add dependence of call.o and parser.o on $(TIMEVAR_H).
461 2010-12-16 Diego Novillo <dnovillo@google.com>
463 * pph.c (pph_find_exposed_for, pph_get_decl_exposure):
464 Replace uses of DECL_INTEGRAL_CONSTANT_VAR_P with
467 2010-12-09 Lawrence Crowl <crowl@google.com>
469 * pph.c (pth_lexer_to_image): Remove call to cpp_lt_statistics.
470 This call is now handled in libcpp.
471 (cpp_lt_order): New constant for lookaside table size.
472 Table reduced from 32768 slots to 512 slots.
473 (pth_init): Use above constant in call to cpp_lt_create.
475 2010-12-02 Diego Novillo <dnovillo@google.com>
479 * parser.h: New file.
480 * decl.c: Include pph.h.
481 * cp/Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/pph.o.
482 (CXX_PARSER_H): Define.
484 (cp/cp-lang.o): Add dependency on CXX_PARSER_H and
486 (cp/parser.o): Likewise.
487 (cp/decl.o): Add dependency on CXX_PPH_H.
488 (cp/call.o): Likewise.
490 (cp/name-lookup.o): Likewise.
492 * cp/cp-lang.c: Include parser.h and pph.h.
493 * cp/pt.c: Include pph.h.
494 * cp/parser.c: Remove inclusion of timevar.h,
495 pointer-set.h, fixed-value.h, cpplib.h, line-map.h,
496 md5.h, hashtab.h, tree-pass.h and tree-inline.h.
497 Include parser.h and pph.h
498 (struct tree_check): Move to parser.h.
499 (struct cp_token): Likewise.
500 (struct cp_lexer): Likewise.
501 (struct cp_token_cache): Likewise.
502 (struct cp_token_ident_d): Likewise.
503 (CPP_KEYWORD): Likewise.
504 (CPP_TEMPLATE_ID): Likewise.
505 (CPP_NESTED_NAME_SPECIFIER): Likewise.
506 (N_CP_TTYPES): Likewise.
507 (enum cp_parser_status_kind): Likewise.
508 (struct cp_parser_context): Likewise.
509 (struct cp_default_arg_entry_d): Likewise.
510 (struct cp_unparsed_functions_entry_d): Likewise.
511 (struct cp_parser): Likewise.
512 (struct cp_token_hunk): Move to pph.h.
513 (DIGEST_LEN): Likewise.
514 (struct pth_image): Likewise.
515 (pth_image_ptr): Likewise.
516 (struct pth_include): Likewise.
517 (pth_include_ptr): Likewise.
518 (struct pth_state): Likewise.
519 (struct pth_stats_d): Likewise.
520 (PTH_STATS_INCR): Likewise.
521 (struct pph_stats_d): Likewise.
522 (PPH_STATS_INCR): Likewise.
523 (pth_stats): Make extern.
524 (pph_stats): Likewise.
525 (cp_lexer_dump_tokens): Likewise.
526 (cp_lexer_debug_tokens): Likewise.
527 (cp_lexer_token_position): Likewise.
528 (cp_lexer_get_tokens): Likewise.
529 (the_parser): Likewise.
530 (pph_decl_head_token_cache): Move to pph.c
531 (pph_decl_body_token_cache): Likewise.
532 (struct pph_decl_deps_d): Likewise.
533 (pph_decl_deps): Likewise.
534 (pph_tree_catcher): Likewise.
535 (pph_name_lookups): Likewise.
536 (pph_name_lookups_set): Likewise.
537 (pph_nl_token_map): Likewise.
538 (pph_logfile): Likewise.
539 (pph_print_tokens): Likewise.
540 (pathnames_equal_p): Likewise.
541 (pph_debug_location): Likewise.
542 (pph_debug_loc_of_tree): Likewise.
543 (pth_image_dir_hash): Likewise.
544 (pth_image_dir_eq): Likewise.
545 (pth_global_state): Likewise.
546 (pth_get_state): Likewise.
547 (pth_id_str): Likewise.
548 (pth_header_len): Likewise.
549 (PTH_EXTENSION): Likewise.
550 (pth_name_for): Likewise.
551 (pth_file_for): Likewise.
552 (pth_get_md5_digest): Likewise.
553 (pth_get_index_from_type): Likewise.
554 (pth_write_uint): Likewise.
555 (pth_write_sizet): Likewise.
556 (pth_write_bytes): Likewise.
557 (pth_write_string): Likewise.
558 (pth_write_number): Likewise.
559 (pth_save_token_value): Likewise.
560 (pth_save_token): Likewise.
561 (pth_write_header): Likewise.
562 (pth_dump_identifiers): Likewise.
563 (pth_debug_identifiers): Likewise.
564 (pth_dump_hunk): Likewise.
565 (pth_debug_hunk): Likewise.
566 (pth_dump_include): Likewise.
567 (pth_debug_include): Likewise.
568 (pth_dump_token_hunks_1): Likewise.
569 (pth_dump_token_hunks): Likewise.
570 (pth_debug_token_hunks): Likewise.
571 (pth_dump_image): Likewise.
572 (pth_debug_image): Likewise.
573 (pth_show_image_stats): Likewise.
574 (pth_dump_state): Likewise.
575 (pth_debug_state): Likewise.
576 (pth_save_identifiers): Likewise.
577 (pth_save_hunk): Likewise.
578 (pth_save_include): Likewise.
579 (pth_save_image): Likewise.
580 (pth_get_type_from_index): Likewise.
581 (pth_read_uint): Likewise.
582 (pth_read_sizet): Likewise.
583 (pth_read_bytes): Likewise.
584 (pth_read_string): Likewise.
585 (pth_read_string_alloc): Likewise.
586 (pth_load_number): Likewise.
587 (pth_load_token_value): Likewise.
588 (pth_load_identifiers): Likewise.
589 (pth_load_hunk): Likewise.
590 (pth_create_include): Likewise.
591 (pth_load_include): Likewise.
592 (pth_load_image): Likewise.
593 (pth_have_valid_image_for): Likewise.
594 (pth_new_image): Likewise.
595 (pth_image_lookup): Likewise.
596 (pth_append_hunk): Likewise.
597 (pth_hunk_is_valid_p): Likewise.
598 (pth_image_can_be_used): Likewise.
599 (pth_get_dir_and_name): Likewise.
600 (pth_process_text_file): Likewise.
601 (pth_image_to_lexer): Likewise.
602 (pth_lexer_to_image): Likewise.
603 (pth_get_file_transition): Likewise.
604 (pth_leave_file): Likewise.
605 (pth_enter_file): Likewise.
606 (pth_file_change): Likewise.
607 (pth_include_handler): Likewise.
608 (pth_init): Likewise.
609 (pth_print_stats): Likewise.
610 (pth_finish): Likewise.
611 (pph_log_exposed): Likewise.
612 (pph_allocate_catcher_memory): Likewise.
613 (pph_free_catcher_memory): Likewise.
614 (pph_start_exposed): Likewise.
615 (pph_lookup_head_token_cache_for): Likewise.
616 (pph_lookup_body_token_cache_for): Likewise.
617 (pph_set_head_token_cache_for): Likewise.
618 (pph_set_body_token_cache_for): Likewise.
619 (pph_copy_decls_into_cache): Likewise.
620 (pph_copy_decls_outof_cache): Likewise.
621 (pph_stop_exposed): Likewise.
622 (pph_debug_tree): Likewise.
623 (pph_debug_type): Likewise.
624 (pph_tree_caught_p): Likewise.
625 (pph_catch_head_tokens_for): Likewise.
626 (pph_catch_body_tokens_for): Likewise.
627 (pph_lookup_dependencies_for): Likewise.
628 (pph_set_dependencies_for): Likewise.
629 (is_namespace): Likewise.
630 (PPH_ARTIFICIAL): Likewise.
631 (pph_null_exposed): Likewise.
632 (pph_live_exposed): Likewise.
633 (pph_find_exposed_for): Likewise.
634 (pph_catch_dependencies_for): Likewise.
635 (pph_catch_tree): Likewise.
636 (pph_uncatch_tree): Likewise.
637 (pph_locate_name_lookups_in): Likewise.
638 (pph_print_copy_tokens): Likewise.
639 (pph_print_token_range): Likewise.
640 (pph_print_dependence): Likewise.
641 (pph_print_depend_template): Likewise.
642 (pph_print_depend_decl): Likewise.
643 (pph_print_depend_type): Likewise.
644 (pph_print_depend_type_type): Likewise.
645 (pph_print_depend_func_type): Likewise.
646 (pph_print_depend_var_type): Likewise.
647 (pph_get_decl_exposure): Likewise.
648 (pph_print_dependences): Likewise.
649 (pph_print_declaration_head): Likewise.
650 (pph_print_declaration_body): Likewise.
651 (pph_find_special_methods): Likewise.
652 (pph_implicit_class_cost): Likewise.
653 (pph_print_declaration): Likewise.
654 (pph_print_declarations): Likewise.
655 (pph_print_trees_tokens): Likewise.
656 (pph_catch_name_lookup): Likewise.
657 (pph_print_stats): Likewise.
658 (pph_init): Likewise.
659 (pph_finish): Likewise.
660 * config-lang.in (gtfiles): Add cp/parser.h, cp/pph.h
662 * call.c: Include pph.h
663 * cp-tree.h (PPH_POP_TIMEVAR_AND_RETURN): Move to
665 (pph_catch_tree): Likewise.
666 (pph_uncatch_tree): Likewise.
667 (pph_catch_name_lookup): Likewise.
668 * name-lookup.c: Include pph.h.
670 2010-11-02 Lawrence Crowl <crowl@google.com>
671 Diego Novillo <dnovillo@google.com>
673 * decl.c: Include langhooks.h
674 (duplicate_decls_internal): Rename from duplicate_decls
675 (duplicate_decls): New wrapper around
676 duplicate_decls_internal.
677 * Make-lang.in (cp/decl.o): Add dependency on langhooks.h
678 (cp/parser.o): Add dependency on pointer-set.h,
679 fixed-value.h, MD5_H, HASTHTAB_H, tree-pass.h,
680 TREE_INLINE_H and tree-pretty-print.h.
681 (cp/name-lookup.o): Add dependency on tree-pretty-print.h
682 * rtti.c (create_pseudo_type_info): Mark TYPE_NAME of
683 PSEUDO_TYPE as artificial.
684 * cp-gimplify.c (cp_genericize): Add FIXME note.
685 * parser.c: Include timevar.h, pointer-set.h,
686 fixed-value.h, cpplib.h, line-map.h, md5.h, hashtab.h,
687 tree-pass.h, tree-inline.h and tree-pretty-print.h.
688 (struct cp_token): Add field purged_p.
689 Adjust all users of CPP_PURGED.
691 (struct cp_lexer): Convert buffer into a VEC.
692 Remove field buffer_length.
694 (cp_token_cache_ptr): New typedef.
695 (struct cp_token_ident_d): Declare.
696 (cp_token_ident): New typedef.
697 (struct cp_token_hunk): Declare.
698 (cp_token_hunk_ptr): New typedef.
699 (DIGEST_LEN): Define.
700 (struct pth_image): Define.
701 (pth_image_ptr): New typedef.
702 (struct pth_include): Define.
703 (pth_include_ptr): New typedef.
704 (struct pth_state): Declare.
705 (struct pth_stats_d): Declare.
706 (pth_stats): Declare.
707 (PTH_STATS_INCR): Define.
708 (struct pph_stats_d): Declare.
709 (pph_stats): Declare.
710 (PPH_STATS_INCR): Define.
711 (pph_decl_head_token_cache): Declare.
712 (pph_decl_body_token_cache): Declare.
713 (struct pph_decl_deps_d): Declare.
714 (pph_decl_deps): Declare.
715 (pph_tree_catcher): Declare.
716 (pph_name_lookups): Declare.
717 (pph_name_lookups_set): Declare.
718 (pph_nl_token_map): Declare.
719 (pph_logfile): Declare.
720 (pph_print_trees_tokens): Declare.
721 (cp_lexer_print_token): Always declare.
722 (CPP_PURGED): Remove. Replace all uses with
724 (N_CP_TTYPES): Adjust.
725 (cp_lexer_dump_tokens): Move earlier in the file.
726 (cp_lexer_debug_tokens): New.
727 (pathnames_equal_p): New.
728 (pph_debug_location): New.
729 (pph_debug_loc_of_tree): New.
730 (pth_image_dir_hash): New.
731 (pth_image_dir_eq): New.
732 (pth_get_state): New.
734 (pth_header_len): New.
735 (PTH_EXTENSION): Define.
738 (pth_get_md5_digest): New.
739 (pth_get_index_from_type): New.
740 (pth_write_uint): New.
741 (pth_write_sizet): New.
742 (pth_write_bytes): New.
743 (pth_write_string): New.
744 (pth_write_number): New.
745 (pth_save_token_value): New.
746 (pth_save_token): New.
747 (pth_write_header): New.
748 (pth_dump_identifiers): New.
749 (pth_debug_identifiers): New.
750 (pth_dump_hunk): New.
751 (pth_debug_hunk): New.
752 (pth_dump_include): New.
753 (pth_debug_include): New.
754 (pth_dump_token_hunks_1): New.
755 (pth_dump_token_hunks): New.
756 (pth_debug_token_hunks): New.
757 (pth_dump_image): New.
758 (pth_debug_image): New.
759 (pth_show_image_stats): New.
760 (pth_dump_state): New.
761 (pth_debug_state): New.
762 (pth_save_identifiers): New.
763 (pth_save_hunk): New.
764 (pth_save_include): New.
765 (pth_save_image): New.
766 (pth_get_type_from_index): New.
767 (pth_read_uint): New.
768 (pth_read_sizet): New.
769 (pth_read_bytes): New.
770 (pth_read_string): New.
771 (pth_read_string_alloc): New.
772 (pth_load_number): New.
773 (pth_load_token_value): New.
774 (pth_load_identifiers): New.
775 (pth_load_hunk): New.
776 (pth_create_include): New.
777 (pth_load_include): New.
778 (pth_load_image): New.
779 (pth_have_valid_image_for): New.
780 (pth_new_image): New.
781 (pth_image_lookup): New.
782 (pth_append_hunk): New.
783 (pth_hunk_is_valid_p): New.
784 (pth_image_can_be_used): New.
785 (cp_lexer_finished_p): New.
786 (cp_lexer_get_tokens): New.
787 (pth_get_dir_and_name): New.
788 (pth_process_text_file): New.
789 (pth_image_to_lexer): New.
790 (pth_lexer_to_image): New.
791 (pth_get_file_transition): New.
792 (pth_leave_file): New.
793 (pth_enter_file): New.
794 (pth_file_change): New.
795 (pth_include_handler): New.
797 (pth_print_stats): New.
799 (cp_lexer_alloc): New.
800 (cp_lexer_new_main): Rewrite to support -fpth.
801 (cp_lexer_get_preprocessor_token): Flag error if -fpth
802 is used together with PCH.
803 (cp_lexer_consume_token): Call PPH_STATS_INCR.
804 (cp_lexer_print_token): Remove "PURGED" string.
805 Show CPP_NUMBER tokens.
806 Do not abort if token->type is outside of TOKEN_NAMES.
807 (pph_log_exposed): New.
808 (pph_allocate_catcher_memory): New.
809 (pph_free_catcher_memory): New.
810 (pph_start_exposed): New.
811 (pph_lookup_head_token_cache_for): New.
812 (pph_lookup_body_token_cache_for): New.
813 (pph_set_head_token_cache_for): New.
814 (pph_set_body_token_cache_for): New.
815 (pph_copy_decls_into_cache): New.
816 (pph_copy_decls_outof_cache): New.
817 (pph_stop_exposed): New.
818 (cp_parser_declaration): Call pph_start_exposed and
819 pph_stop_exposed for several cases.
820 (cp_parser_elaborated_type_specifier): Add tracing code
822 (cp_parser_class_specifier): Add FIXME notes.
823 (cp_parser_lookup_name_1): Rename from cp_parser_lookup_name.
824 (cp_parser_lookup_name): Call it.
825 Call pph_catch_name_lookup with the result.
826 (pph_debug_tree): New.
827 (pph_debug_type): New.
828 (pph_tree_caught_p): New.
829 (pph_catch_head_tokens_for): New.
830 (pph_catch_body_tokens_for): New.
831 (pph_lookup_dependencies_for): New.
832 (pph_set_dependencies_for): New.
834 (pph_null_exposed): New.
835 (pph_live_exposed): New.
836 (pph_find_exposed_for): New.
837 (pph_catch_dependencies_for): New.
838 (pph_catch_tree): New.
839 (pph_uncatch_tree): New.
840 (pph_locate_name_lookups_in): New.
841 (pph_print_copy_tokens): New.
842 (pph_print_token_range): New.
843 (pph_print_dependence): New.
844 (pph_print_depend_template): New.
845 (pph_print_depend_decl): New.
846 (pph_print_depend_type): New.
847 (pph_print_depend_type_type): New.
848 (pph_print_depend_func_type): New.
849 (pph_print_depend_var_type): New.
850 (pph_get_decl_exposure): New.
851 (pph_print_dependences): New.
852 (pph_print_declaration_head): New.
853 (pph_print_declaration_body): New.
854 (pph_find_special_methods): New.
855 (pph_implicit_class_cost): New.
856 (pph_print_declaration): New.
857 (pph_print_declarations): New.
858 (pph_print_trees_tokens): New.
859 (pph_catch_name_lookup): New.
860 (pph_print_stats): New.
863 (c_parse_file): Call pph_init and pph_finish.
864 * call.c (implicit_conversion): Call pph_catch_name_lookup.
865 (build_new_op): Call pph_catch_name_lookup.
866 (convert_like_real): Call pph_catch_name_lookup.
867 (build_new_method_call): Call pph_catch_name_lookup.
868 * cp-objcp-common.h (LANG_HOOKS_PPH_CATCH_TREE): Define.
869 (LANG_HOOKS_PPH_UNCATCH_TREE): Define.
870 * cp-tree.h (PPH_POP_TIMEVAR_AND_RETURN): Define.
871 Replace every call to POP_TIMEVAR_AND_RETURN with
872 PPH_POP_TIMEVAR_AND_RETURN.
873 (pph_catch_tree): Declare.
874 (pph_uncatch_tree): Declare.
875 (pph_catch_name_lookup): Declare.
876 * name-lookup.c: Include tree-pretty-print.h
877 (add_decl_to_level): Add tracing for -fpph-debug.