OSDN Git Service

2009-12-14 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
[pf3gnuchains/gcc-fork.git] / gcc / lto / ChangeLog
1 2009-12-14  Dmitry Gorbachev  <d.g.gorbachev@gmail.com>
2
3         * Make-lang.in ($(LTO_EXE)): Use $(LINKER).
4
5 2009-12-11  Richard Guenther  <rguenther@suse.de>
6
7         PR lto/42037
8         * lto.c (lto_resolution_read): Properly grow the vector.
9
10 2009-12-11  Richard Guenther  <rguenther@suse.de>
11
12         PR lto/41915
13         * lto-lang.c (lto_init_options): Initialize flag_complex_method
14         to the C99 default.  Do not set flag_unit_at_a_time.
15
16 2009-11-28  Jakub Jelinek  <jakub@redhat.com>
17
18         * lto-lang.c (handle_nonnull_attribute): Remove unused attr_arg_num
19         variable.
20
21 2009-11-19  Rafael Avila de Espindola  <espindola@google.com>
22
23         PR bootstrap/42096
24         * lto-elf.c (lto_elf_file_open): Use lto_parse_hex.
25         * lto.c (lto_parse_hex): New.
26         (lto_resolution_read): Use lto_parse_hex.
27         * lto.h (lto_parse_hex): New.
28
29 2009-11-17  Rafael Avila de Espindola  <espindola@google.com>
30
31         * lto-elf.c (lto_file_init): Add offset argument.
32         (lto_elf_file_open): Record the offset.
33         * lto.c (lto_resolution_read): Change file_name into a lto_file
34         argument. Check offsets.
35         (lto_file_read): Update call to lto_resolution_read.
36         * lto.h (lto_file_struct): Add the offset field.
37
38 2009-11-16  Rafael Avila de Espindola  <espindola@google.com>
39
40         * lto-elf.c (lto_elf_file_open): Use strtoll to parse the offset.
41
42 2009-11-14  Jan Hubicka  <jh@suse.cz>
43
44         * lto.c (read_cgraph_and_symbols): Set also ipa_transforms_to_apply.
45
46 2009-11-12  Rafael Avila de Espindola  <espindola@google.com>
47
48         * lang.opt (fresolution): Renamed from resolution.
49         * lto-lang.c (lto_handle_option): Handle new option name.
50         * lto.c (lto_resolution_read): Add more checks. Discard rest of line.
51
52 2009-11-04  Richard Guenther  <rguenther@suse.de>
53             Rafael Avila de Espindola  <espindola@google.com>
54
55         * lto-elf.c (lto_elf_build_section_table): Add the base offset.
56         (lto_elf_file_open): Handle offsets in arguments name@offest.
57
58 2009-10-30  Richard Guenther  <rguenther@suse.de>
59
60         PR lto/41858
61         * lto.c (lto_file_read): Do not set file_data->fd.
62         (lto_read_section_data): Use a single-entry file-descriptor cache.
63         Do not check the result of xmalloc.
64         (free_section_data): Do not use file_data->fd.
65         (lto_read_all_file_options): Likewise.
66
67 2009-10-22  Richard Guenther  <rguenther@suse.de>
68
69         * lto.c (lto_fixup_jump_functions): Remove.
70         (lto_fixup_decls): Do not fixup jump functions.
71         (read_cgraph_and_symbols): Schedule cgraph merging after
72         summary reading.  Schedule type and decl fixup before
73         summary reading.
74
75 2009-10-22  Richard Guenther  <rguenther@suse.de>
76
77         * lto.c (lto_fixup_data_t): Remove free_list member.
78         (lto_fixup_tree): Do not insert into free_list.
79         (free_decl): Remove.
80         (lto_fixup_decls): Remove free-list handling.
81
82 2009-10-22  Jan Hubicka  <jh@suse.cz>
83
84         * lto.c (lto_fixup_jump_functions): New function.
85         (lto_fixup_decls): Use it.
86
87 2009-10-16  Richard Guenther  <rguenther@suse.de>
88
89         PR lto/41715
90         * lto.c (lto_fixup_tree): Revert last change.
91
92 2009-10-14  Richard Guenther  <rguenther@suse.de>
93
94         * lto.c (lto_fixup_tree): In case the prevailing decl is not
95         compatible with the one we replace wrap it around a
96         VIEW_CONVERT_EXPR.
97
98 2009-10-09  Richard Guenther  <rguenther@suse.de>
99
100         PR lto/41635
101         PR lto/41636
102         * lto.c (read_cgraph_and_symbols): Do not assert we can open
103         a file.
104         * lto-elf.c (init_shdr##BITS): Fix i18n problems.
105         (init_ehdr##BITS): Likewise.
106
107 2009-10-08  Joseph Myers  <joseph@codesourcery.com>
108
109         * lto-elf.c (init_shdr##BITS, lto_elf_begin_section_with_type,
110         init_ehdr##BITS, lto_elf_file_close): Remove trailing "." from
111         diagnostics.
112         * lto-lang.c (lto_post_options): Remove trailing "." from
113         diagnostics.
114
115 2009-10-08  Richard Guenther  <rguenther@suse.de>
116
117         * lto.c (read_cgraph_and_symbols): Free the gimple type merging
118         hash tables.
119
120 2009-10-07  Joseph Myers  <joseph@codesourcery.com>
121
122         * lto.c: Only include <sys/mman.h> if HAVE_MMAP_FILE.
123
124 2009-10-07  Jan Hubicka  <jh@suse.cz>
125
126         * lto.c (read_cgraph_and_symbols): Mark functions neccesary only at
127         ltrans stage; explain why this is needed and should not.
128
129 2009-10-05  Richard Guenther  <rguenther@suse.de>
130
131         PR lto/41552
132         PR lto/41487
133         * lto.c (lto_read_decls): Do not register deferred decls.
134         (read_cgraph_and_symbols): Delay symbol and cgraph merging
135         until after reading the IPA summaries.
136
137 2009-10-02  Rafael Avila de Espindola  <espindola@google.com>
138
139         * Make-lang.in (lto/lto-lang.o): Don't depend on lto/common.h.
140         (lto-lang.c): Don't include lto/common.h.
141
142 2009-10-02  Rafael Avila de Espindola  <espindola@google.com>
143
144         * Make-lang.in (LTO_OBJS): Remove lto/common.o.
145         (lto/common.o): Remove.
146         * common.c: Remove.
147         * common.h (lto_kind_str): Remove.
148         (lto_visibility_str): Remove.
149         (lto_resolution_str): Make it static.
150
151 2009-10-01  Diego Novillo  <dnovillo@google.com>
152
153         * lto.c (lto_read_decls): Add comment.
154         Call internal_error instead of gcc_assert.
155         (lto_resolution_read): Likewise.
156         (lto_add_all_inlinees): Tidy.
157         * Make-lang.in: Fix copyright boilerplate.
158         (lto.pdf): New.
159         (lto.install-pdf): New.
160         * lto-tree.h: Fix copyright boilerplate.
161         * lang-specs.h: Likewise.
162         Remove ".lto" entry from compilers fragment.
163         * lto-elf.c: Move inclusion of gelf.h after config.h.
164         Tidy formatting everywhere.
165         * lto.h: Fix copyright boilerplate.
166         Tidy formatting everywhere.
167         * common.c: Likewise.
168         * config-lang.in: Likewise.
169         * common.h: Likewise.
170         * lto-lang.c: Likewise.
171
172 2009-10-01  Richard Guenther  <rguenther@suse.de>
173
174         * lto.c (lto_read_section_data): Use plain lseek/read.
175
176 2009-10-01  Richard Guenther  <rguenther@suse.de>
177
178         * lto.c (LTO_MMAP_IO): Define if we can mmap files and
179         use sysconf to query the system page size.
180         (lto_file_read): Implement fallback using stdio.
181         (free_section_data): Likewise.
182
183 2009-09-29  Diego Novillo  <dnovillo@google.com>
184
185         * lto-lang.c (lto_init): Really fix call to
186         build_common_builtin_nodes.
187
188 2009-09-29  Diego Novillo  <dnovillo@google.com>
189
190         * lto-lang.c (lto_init): Fix call to
191         build_common_builtin_nodes.
192
193 2009-09-29  Richard Guenther  <rguenther@suse.de>
194
195         PR lto/40754
196         * lto-elf.c (init_shdr##BITS): Properly specify alignment
197         in bytes.
198         (first_data_block): New static variable.
199         (lto_elf_append_data): Align the first data block in each
200         section.
201
202 2009-09-28  Diego Novillo  <dnovillo@google.com>
203
204         * lto-lang.c: Tidy.  Remove stale FIXME lto markers.
205         * lto.c (strip_extension): New.
206         (get_filename_for_set): Call it.  Do not call make_cwd_temp_file.
207         (lto_execute_ltrans): Tidy.
208         Do not pass -fwpa nor -fltrans-* to LTRANS.
209         * opts.c: Tidy formatting and remove stale FIXME lto markers.
210         * tree.c (need_assembler_name_p): Call
211         lang_hooks.decls.may_need_assembler_name_p if set.
212         * varasm.c (default_binds_local_p_1): Remove check for
213         flag_ltrans.
214         * varpool.c (decide_is_variable_needed): Do not test for
215         in_lto_p.
216
217 2009-09-22  Richard Guenther  <rguenther@suse.de>
218
219         PR lto/39276
220         * lto.c (lto_execute_ltrans): Perform ltrans phase manually.
221         * Make-lang.in: Remove ltrans-driver stuff.
222         * config-lang.in: Likewise.
223         * lang.opt (fltrans-driver): Remove.
224         * lto-lang.c (lto_init_options): Remove code initializing
225         ltrans_driver.
226         * ltrans-driver: Remove.
227
228 2009-09-21  Diego Novillo  <dnovillo@google.com>
229
230         * lto-lang.c (lto_define_builtins): Remove superfluous
231         calls to targetm.init_builtins and build_common_builtin_nodes.
232         (lto_init): Add targetm.arm_eabi_unwinder as parameter to
233         build_common_builtin_nodes.
234         * lto.c (lto_materialize_function): Do nothing if NODE is a
235         clone.
236
237 2009-09-03  Diego Novillo  <dnovillo@google.com>
238
239         * lto-elf.c (validate_file): Replace call to
240         elf_getshstrndx with call to elf_getshdrstrndx.
241
242 2009-08-19  Richard Guenther  <rguenther@suse.de>
243
244         * lto-lang.c (lto_init): Merge char_type_node with the
245         appropriately signed variant.
246
247 2009-08-19  Richard Guenther  <rguenther@suse.de>
248
249         PR lto/41071
250         * lto.c (lto_fixup_common): Re-build the pointer-to chain part one.
251         (lto_fixup_type): Re-build the pointer-to chain part two.
252
253 2009-08-19  Richard Guenther  <rguenther@suse.de>
254
255         PR lto/41071
256         * lto.c (lto_fixup_type): Re-build the type variant chain.
257
258 2009-08-19  Richard Guenther  <rguenther@suse.de>
259
260         PR lto/41071
261         * lto.c (lto_fixup_constructor): New function.
262         (lto_fixup_tree): Replace all types.  Properly fixup
263         constructors and constants.
264
265 2009-08-14  Richard Guenther  <rguenther@suse.de>
266
267         * lto.c (read_cgraph_and_symbols): Exchange TREE_CHAIN use
268         for DECL_LANG_SPECIFIC.
269
270 2009-08-13  Richard Guenther  <rguenther@suse.de>
271
272         PR lto/41032
273         * lto-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Define to NULL.
274
275 2009-07-30  Richard Guenther  <rguenther@suse.de>
276
277         PR lto/40903
278         * lto.c (read_cgraph_and_symbols): After fixing up decls choose
279         the largest decl for output and free TREE_CHAIN for further
280         use.
281
282 2009-07-24  Diego Novillo  <dnovillo@google.com>
283
284         * Make-lang.in: Add empty lto.install-plugin target.
285
286 2009-07-13  Diego Novillo  <dnovillo@google.com>
287
288         * lto.c (lto_fixup_tree): Handle IMPORTED_DECL.
289
290 2009-07-11  Richard Guenther  <rguenther@suse.de>
291
292         * lto-lang.c (lto_write_globals): Wrapup global decls.
293
294 2009-07-10  Richard Guenther  <rguenther@suse.de>
295
296         * lto-lang.c (lto_init): Allocate one more location to make
297         BUILTINS_LOCATION correct.
298
299 2009-07-09  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
300
301         * lto.c (free_section_data): Cast computed_offset to caddr_t.
302
303 2009-07-06  Diego Novillo  <dnovillo@google.com>
304
305         * lto.c (lto_fixup_type): Fixup TYPE_SIZE and
306         TYPE_SIZE_UNIT.
307
308 2009-07-06  Diego Novillo  <dnovillo@google.com>
309
310         * lto.c (preload_common_nodes): Remove.
311         (lto_read_in_decl_state): Call lto_streamer_cache_get.
312         (lto_read_decls): Call lto_data_in_create and
313         lto_data_in_delete.
314         (free_decl): Do not call ggc_free.
315         (lto_main): Call lto_init_reader.
316         * lto-lang.c (lto_type_for_size): Handle intTI_type_node.
317         (lto_init): Initialize main_identifier_node if needed.
318         Make ptrdiff_type_node be integer_type_node.
319
320 2009-06-19  Diego Novillo  <dnovillo@google.com>
321
322         * lto.c: Remove code guarded by #ifdef LTO_STREAM_DEBUGGING.
323         Remove code guarded by #ifdef GLOBAL_STREAMER_TRACE.
324         Remove code guarded by #ifdef LOCAL_TRACE.
325
326 2009-06-18  Diego Novillo  <dnovillo@google.com>
327
328         * lto.c: Update license to GPLv3.
329         * lto-elf.c: Likewise.
330         * common.c: Likewise.
331         * lto-lang.c: Likewise.
332         * lto.h: Remove superfluous include files.  Update all
333         users.
334
335 2009-06-17  Diego Novillo  <dnovillo@google.com>
336
337         * lto.c (read_cgraph_and_symbols): Call input_cgraph.
338
339 2009-06-02  Diego Novillo  <dnovillo@google.com>
340
341         * lto.c (lto_1_to_1_map): Ignore nodes that have not been
342         read in.
343         (materialize_cgraph): Only materialize nodes that have a
344         representation on file.
345
346 2009-06-01  Diego Novillo  <dnovillo@google.com>
347
348         * lto-lang.c (lto_handle_option): Hanlde OPT_Wabi.
349
350 2009-05-31  Diego Novillo  <dnovillo@google.com>
351
352         * lto-lang.c (lto_type_for_mode): Handle all the modes
353         handled in c_common_type_for_mode.
354
355 2009-05-21  Diego Novillo  <dnovillo@google.com>
356
357         * lto-elf.c: Always include <gelf.h>.
358         * config-lang.in (target_libs): Remove.
359         (build_by_default): Set to no.
360
361 2009-05-15  Diego Novillo  <dnovillo@google.com>
362
363         * lto.c (lto_materialize_function): Assert that DECL is
364         not a builtin.
365         (materialize_cgraph): Don't try to materialize builtin
366         functions.
367         * lto-section-out.c (write_symbol_vec): Do not write
368         builtin functions.
369
370 2009-05-13  Diego Novillo  <dnovillo@google.com>
371
372         * lto-lang.c (LANG_HOOKS_GET_ALIAS_SET): Define.
373
374 2009-05-07  Diego Novillo  <dnovillo@google.com>
375
376         * lto.c (lto_resolution_read): Add type casts for C++ warnings.
377         (LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE): Define.
378         (lto_fixup_type): Call it for TYPE_POINTER_TO,
379         TYPE_REFERENCE_TO, TYPE_CONTEXT and TYPE_CANONICAL.
380         (lto_fixup_tree): Call gimple_register_type when *TP is a
381         type.
382         (lto_main): Call bitmap_obstack_initialize.
383
384 2009-04-22  Diego Novillo  <dnovillo@google.com>
385
386         * lto.c (free_section_data): Tidy.
387         (lto_1_to_1_map): Tidy.
388         (lto_add_all_inlinees): Tidy.
389         (prefix_name_with_star): New.
390         (get_filename_for_set): New.
391         (lto_wpa_write_files): Call cgraph_node_set_needs_ltrans_p
392         to determine what cgraph node sets to write.
393         Call get_filename_for_set to compute temporary file
394         names.
395         (lto_execute_ltrans): Do not execute LTRANS on files with
396         names that start with '*'.
397         Move logic to execute LTRANS together so that LTRANS is
398         invoked only if there are any files to compile.
399         (do_whole_program_analysis): Only remove output files
400         that do not start with '*'.
401
402 2009-04-06  Diego Novillo  <dnovillo@google.com>
403
404         * lto-lang.c (lto_post_options): Set flag_excess_precision_cmdline.
405         * lto.c (read_cgraph_and_symbols): Set cgraph_function_flags_ready.
406         (lto_add_all_inlinees): Tidy.
407
408 2009-03-26  Diego Novillo  <dnovillo@google.com>
409
410         * lto.c: Include gimple.h.
411         (lto_read_in_decl_state): Call gimple_register_type for
412         every type in every stream.
413         (lto_fixup_common): Call gimple_register_type if T has a
414         type.
415         (do_whole_program_analysis): Call print_lto_report.
416         (lto_main): Call print_lto_report after cgraph_optimize.
417         * Make-lang.in (lto.o): Add dependency on GIMPLE_H.
418
419 2009-03-24  Diego Novillo  <dnovillo@google.com>
420
421         * Make-lang.in (lto-lang.o): Add dependency on TARGET_H and EXPR_H.
422         (lto.o): Add dependency on GIMPLE_H.
423
424 2009-03-10  Simon Baldwin  <simonb@google.com>
425
426         * lto.c (lto_read_all_file_options): Close any open file descriptor
427         contained in file_data before freeing.
428
429 2009-02-24  Rafael Avila de Espindola  <espindola@google.com>
430
431         * lto.c (lto_add_inline_clones): Don't add the master clone. Check
432         for a decl in the original bitmap, not a node.
433         (lto_add_all_inlinees): Remove original nodes that are not needed.
434         (lto_scan_statics_in_cgraph_node): Don't care if the node is the master.
435
436 2009-02-24  Diego Novillo  <dnovillo@google.com>
437
438         * lto.c (lto_materialize_function): Update
439         lto_stats.num_function_bodies.
440         (get_section_data): Initialize *LEN to 0.
441         (lto_1_to_1_map): Update lto_stats.num_cgraph_partitions.
442         (lto_wpa_write_files): Update lto_stats.num_cgraph_nodes.
443         Update lto_stats.num_output_files.
444         (read_cgraph_and_symbols): Update lto_stats.num_input_files.
445         (materialize_cgraph): Update lto_stats.num_input_cgraph_nodes.
446         (lto_main): Initialize lto_stats.
447         If flag_lto_report is set, call print_lto_report.
448
449 2009-02-19  Diego Novillo  <dnovillo@google.com>
450
451         Revert
452
453         2009-02-19  Rafael Avila de Espindola  <espindola@google.com>
454
455                 * lto.c (lto_add_inline_clones): Don't add the
456                 master clone. Check for a decl in the original
457                 bitmap, not a node.
458                 (lto_add_all_inlinees): Remove original nodes
459                 that are not needed.
460                 (lto_scan_statics_in_cgraph_node): Don't care if
461                 the node is the master.
462                 (lto_promote_cross_file_statics): Use a new
463                 context.seen_node_decls for each set
464
465 2009-02-19  Rafael Avila de Espindola  <espindola@google.com>
466
467         * lto.c (lto_add_inline_clones): Don't add the master clone. Check
468         for a decl in the original bitmap, not a node.
469         (lto_add_all_inlinees): Remove original nodes that are not needed.
470         (lto_scan_statics_in_cgraph_node): Don't care if the node is the master.
471         (lto_promote_cross_file_statics): Use a new context.seen_node_decls
472         for each set
473
474 2009-02-18  Diego Novillo  <dnovillo@google.com>
475
476         * lto.c (lto_wpa_write_files): Use timers TV_WHOPR_WPA
477         and TV_WHOPR_WPA_IO.
478         (lto_execute_ltrans): Use timer TV_WHOPR_WPA_LTRANS_EXEC.
479         (read_cgraph_and_symbols): Use timer TV_IPA_LTO_DECL_IO.
480         (materialize_cgraph): Use timer TV_IPA_LTO_GIMPLE_IO.
481         Use timer TV_WHOPR_WPA or TV_WHOPR_LTRANS or TV_LTO
482         depending on command line flags.
483         (do_whole_program_analysis): Use timer TV_WHOPR_WPA.
484         (lto_main): Remove timer uses.
485
486 2009-02-18  Rafael Avila de Espindola  <espindola@google.com>
487
488         * lto.c (lto_materialize_function): Don't set DECL_EXTERN to 0.
489         (lto_wpa_write_files): Update calls to renamed functions.
490
491 2009-02-17  Diego Novillo  <dnovillo@google.com>
492
493         PR 39203
494         * lto-lang.c (lto_post_options): Disable -fwhole-program
495         when running LTRANS.
496
497 2009-02-10  Diego Novillo  <dnovillo@google.com>
498
499         * lto.c (read_cgraph_and_symbols): Fix comment.
500
501 2009-02-10  Diego Novillo  <dnovillo@google.com>
502
503         * lto.c (read_cgraph_and_symbols): Read options from all
504         IL files.
505
506 2009-02-10  Diego Novillo  <dnovillo@google.com>
507
508         * lto.c (read_cgraph_and_symbols): Factor out of lto_main.
509         (materialize_cgraph): Likewise.
510         (do_whole_program_analysis): Likewise.
511         (lto_main): Call read_cgraph_and_symbols,
512         materialize_cgraph and do_whole_program_analysis.
513
514 2009-02-10  Simon Baldwin  <simonb@google.com>
515
516         * lto.c: Include lto-opts.h.
517         * (lto_main): Clear file options at loop start, read any saved
518         options from the first file handled, and re-issue options.
519         * Makefile.in (lto.o): Add dependency on lto-opts.h.
520
521 2009-02-02  Diego Novillo  <dnovillo@google.com>
522
523         * lto.c (lto_main): Stop LTO_TIMER and use
524         TV_WHOPR_WPA_LTRANS_EXEC when launching LTRANS.
525
526 2009-01-30  H.J. Lu  <hongjiu.lu@intel.com>
527
528         PR lto/38995
529         * lto-elf.c (init_shdr##BITS): Set the sh_addralign field
530         to POINTER_SIZE.
531
532 2009-01-29  Ramana Radhakrishnan  <ramana.r@gmail.com>
533
534         * Make-lang.in (LTO_EXE): Link with all 
535         BACKENDLIBS and not only GMPLIBS
536
537 2009-01-28  H.J. Lu  <hongjiu.lu@intel.com>
538
539         PR bootstrap/38992
540         * lto-elf.c: Include gelf.h instead of libelf.h.
541         (lto_elf_file_close): Replace elfx_update_shstrndx with
542         gelf_getehdr, elf_getscn, gelf_getshdr, gelf_update_shdr and
543         gelf_update_ehdr.
544
545 2009-01-28  H.J. Lu  <hongjiu.lu@intel.com>
546
547         PR middle-end/38996
548         * lto-elf.c (DEFINE_INIT_EHDR): Initialize e_version.
549
550 2009-01-26  Diego Novillo  <dnovillo@google.com>
551
552         * lto-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Update.
553
554 2009-01-26  Diego Novillo  <dnovillo@google.com>
555
556         * lto-lang.c (lto_types_compatible_p): Move to gimple.c
557         and rename into gimple_types_compatible_p.
558
559 2009-01-12  Rafael Avila de Espindola  <espindola@google.com>
560
561         * lto-lang.c (lang_hooks): Remove the const qualifier.
562
563 2009-01-06  Diego Novillo  <dnovillo@google.com>
564
565         * ltrans-driver: Mark 'all' target as phony.
566
567 2008-12-31  Diego Novillo  <dnovillo@google.com>
568
569         * ltrans-driver: Execute a NOP action for target 'all'.
570
571 2008-12-19  Diego Novillo  <dnovillo@google.com>
572
573         * lto.c (lto_1_to_1_map): Tidy.
574
575 2008-12-19  Diego Novillo  <dnovillo@google.com>
576
577         * lto-elf.c (lto_elf_file_open): When FILENAME cannot
578         be opened, show its name.
579         * ltrans-driver: If $verbose is set, do not use parallelism.
580
581 2008-12-17  Rafael Avila de Espindola  <espindola@google.com>
582
583         * lto.c (lto_fixup_function): New.
584         (lto_fixup_tree): Call lto_fixup_function.
585
586 2008-12-14  Doug Kwan  <dougkwan@google.com>
587
588         * lto.c (lto_1_to_1_map): Create a cgraph node set for any global
589         variables if there is no function.
590
591 2008-12-10  Simon Baldwin  <simonb@google.com>
592
593         * ltrans-driver: Always run make in silent mode, to avoid make's
594         trace on stdout interfering with lto-wrapper output.
595
596 2008-12-10  Doug Kwan  <dougkwan@google.com>
597
598         * lto.c (lto_add_inline_clones): Do not force master clones of
599         inlined functions already in SET to be static inline.
600
601 2008-12-04  Doug Kwan  <dougkwan@google.com>
602
603         * lto.c (globalize_context_t): New type to store states in
604         globalization of cross-file statics.
605         (globalize_cross_file_statics): New.
606         (lto_scan_statics_in_ref_table): Walk tree to look for reachable
607         static decls that need to be fixed up.
608         (lto_scan_statics_in_cgraph_node): Change call interface to use
609         a globalize_context_t CONTEXT for all states used.
610         (lto_scan_statics_in_remaining_global_vars): New.
611         (lto_promote_cross_file_statics): Use new call interface of
612         LTO_SCAN_STATICS_IN_CGRAPH_NODE.  Handle remaining externally
613         visible vars in the last set.
614
615 2008-12-03  Diego Novillo  <dnovillo@google.com>
616
617         * lto.c (lto_fixup_tree): Do not emit an error when
618         PREVAILING throw but T doesn't.
619
620 2008-12-02  Doug Kwan  <dougkwan@google.com>
621
622         * lto.c (lto_scan_statics_in_ref_table): New function factored out
623         from code in ...
624         (lto_scan_statics_in_cgraph_node): Handle both file-scope static
625         variables and functions.
626         (lto_promote_cross_file_statics): Rename bitmaps to SEEN_DECLS
627         and GLOBAL_DECLS from SEEN_VARS and GLOBAL_VARS.
628
629 2008-11-29  Diego Novillo  <dnovillo@google.com>
630
631         * lto.c: Include timevar.h.
632         (lto_materialize_function): Tidy.  Add comments.
633         (lto_wpa_write_files): Tidy.
634         (lto_execute_ltrans): Tidy.
635         (lto_main): Add local variable LTO_TIMER.  Initialize it
636         to one of TV_WHOPR_WPA, TV_WHOPR_LTRANS or TV_LTO.
637         Start and stop the timer.
638         Tidy comments.
639         * Make-lang.in (lto.o): Add dependency on timevar.h.
640         * ltrans-driver: React to -v and -save-temps.
641         Use simple heuristic to determine how much parallelism to
642         use when executing make.
643
644 2008-11-12  Doug Kwan  <dougkwan@google.com>
645
646         * lto.c (lto_bitmap_obstack): Remove var.
647         (lto_materialize_function): Do nothing instead of marking function
648         body in file if flag_wpa is true.
649         (lto_add_all_inlinees): Use bitmap functions in lto-utils.c.
650         (lto_scan_statics_in_cgraph_node): New function.
651         (lto_promote_cross_file_statics): Same.
652         (lto_wpa_write_files): Call lto_promote_cross_file_statics.
653         Use bitmap functions in lto-utils.c.  Remove unsued label OUT.
654         * Make-lang.in (lto/lto.o): Add lto-utils.h to dependency list.
655
656 2008-11-09  Diego Novillo  <dnovillo@google.com>
657
658         * lto/lto.c (lto_fixup_tree): Change error message locus
659         information to include location of mismatching
660         declaration.
661         Use TREE_NO_WARNING to avoid repeated messages.
662         (lto_main): If lto_fixup_decls emitted any errors, exit.
663         * lto/lto-lang.c: Don't include libfuncs.h and except.h
664         (lto_init_options): Don't enable exceptions by default.
665         (lto_eh_runtime_type): Move to lto-function-in.c
666         (lto_init_eh): Likewise.
667         (lto_init): Don't call lto_init_eh.
668         * lto/Make-lang.in (lto-lang.o): Remove dependency on
669         libfuncs.h and except.h.
670
671 2008-10-30  Diego Novillo  <dnovillo@google.com>
672
673         * lto.c (lto_read_decls): Declare debug_main only if
674         LTO_STREAM_DEBUGGING is enabled.
675
676 2008-10-30  Simon Baldwin  <simonb@google.com>
677
678         * lto.c (lto_wpa_write_files): Create intermediate files with
679         make_cwd_temp_file().
680         (lto_maybe_unlink): New.  Delete intermediate WPA files unless
681         WPA_SAVE_LTRANS is set.
682         (lto_main): Call lto_maybe_unlink() for intermediate WPA files.
683         * ltrans-driver: Do not strip directory from output files.
684
685 2008-10-29  Doug Kwan  <dougkwan@google.com>
686
687         * lto.c (free_decl): Call lto_symtab_clear_resolution when freeing
688         DECL.
689         * Make-lang.in (LTO_OBJS): Remove lto/lto-symtab.o
690         (lto/lto-symtab.o): Remove rule.
691         * lto-tree.h (struct lang_identifier): Remove LTO specific fields.
692         (struct lang_decl): Remove RESOLUTION and add DUMMY in struct.
693         (LANG_IDENTIFIER_CAST, LTO_IDENTIFIER_DECL, LTO_DECL_RESOLUTION):
694         Remove macros.
695         lto-symtab.c (File): Move up one level.
696         lto-lang.c (cgraph.h): Remove include.
697         (input_overwrite_node, input_node, input_edge, input_cgraph_1,
698         input_cgraph): Move to lto-cgraph.c in gcc directory above.
699         (LANG_HOOKS_INPUT_CGRAPH): Remove use of macro.
700
701 2008-10-24 Rafael Espindola  <espindola@google.com>
702
703         * lto-function-in.c (get_resolution): Return LDPR_PREEMPTED_IR for
704         non prevailing weak symbols.
705
706 2008-10-24 Rafael Espindola  <espindola@google.com>
707
708         * lto-lang.c (input_cgraph_1): Iterate over nodes, not cgraph_nodes.
709
710 2008-10-24 Rafael Espindola  <espindola@google.com>
711
712         * lto-lang.c (input_node): Avoid casts from pointers to ints of
713         different types.
714
715 2008-10-23  Simon Baldwin  <simonb@google.com>
716
717         * lto-lang.c (input_node): Save the node reference, rather than the
718         node pointer, in node->inlined_to.
719         (input_cgraph_1): Convert node references into node pointers.
720
721 2008-10-22  Diego Novillo  <dnovillo@google.com>
722             Rafael Espindola  <espindola@google.com>
723
724         * lto.c (lto_resolution_read): Tidy.
725         * lto-symtab.c (lto_symtab_prevailing_decl): Do not
726         abort if RET is NULL.
727
728 2008-10-22  Doug Kwan  <dougkwan@google.com>
729
730         * lto.c (lto_fixup_tree): Check for NOTHROW conflict only if
731         exceptions flag is given.
732         * lto-lang.c: (lto_init_options) Set default exceptions flag.
733         (lto_init_eh): Remove exceptions flag initialization.
734         (lto_init): Only call lto_init_eh if exceptions flag is set. 
735
736 2008-10-21  Diego Novillo  <dnovillo@google.com>
737
738         * lto.c: Tidy some formatting.
739         * lto.h: Likewise.
740
741 2008-10-21  Simon Baldwin  <simonb@google.com>
742
743         * lto-symtab.c: (lto_same_type_p): Types cannot be equal if one of
744         them is NULL (but not the other).
745
746 2008-10-17  Diego Novillo  <dnovillo@google.com>
747
748         * ltrans-driver: Divert output from make to a temporary file.
749         Show it if the call to make failed.
750
751 2008-10-15  Diego Novillo  <dnovillo@google.com>
752
753         * lto.c (lto_wpa_write_files): Reformat do-while loop.
754         Do not print TEMP_FILENAME
755         * ltrans-driver: Call make with -s.
756
757 2008-10-15  Diego Novillo  <dnovillo@google.com>
758
759         * lto-symtab.c (lto_symtab_merge_decl): Do not force
760         TREE_STATIC on global symbols.
761
762 2008-10-14  Ollie Wild  <aaw@google.com>
763
764         * Make-lang.in (LTRANS_DRIVER_INSTALL_NAME): Remove.
765         (LTRANS_DRIVER_EXE): Add.
766         (lto.all.cross): Add LTRANS_DRIVER_EXE.
767         (lto.all.encap): Add LTRANS_DRIVER_EXE.
768         (lto.install.common): Remove ltrans-driver.
769         (lto.mostlyclean): Add LTRANS_DRIVER_EXE.
770         (LTRANS_DRIVER_EXE): New build rule.
771         * config-lang.in (compilers): Add ltrans-driver.
772
773 2008-10-14  Diego Novillo  <dnovillo@google.com>
774
775         * Make-lang.in (LTRANS_DRIVER_INSTALL_NAME): Disable transformation
776         of program name.
777
778 2008-10-13  Ollie Wild  <aaw@google.com>
779
780         * lang-spec.h (@lto): Replace lto1_options with cc1_options.
781         * lto.c (lto_execute_ltrans): Add "-fno-wpa -fltrans -xlto" to CFLAGS.
782         * ltrans-driver (LTRANS_FLAGS): Remove.
783
784 2008-10-08  Doug Kwan  <dougkwan@google.com>
785
786         * lto.c (lto_fixup_tree): Remove ATTRIBUTE_UNUSED from DATA.
787         Handle new tree codes RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE
788         and TREE_BINFO.  Also move code handling FUNCTION_DECL and VAR_DECL
789         from lto_fixup_state to here.
790         (lto_fixup_state): Take an lto_fixup_data_t object DATA instead of
791         just a free-list.  Fix up types also.  Move decl merging code to
792         lto_fixup_tree.
793         (lto_fixup_state_aux): Change AUX to point to an lto_fixup_data_t
794         object.
795         (lto_fixup_decls): Use another pointer set to avoid multiple
796         walking of nodes except for DECLs to be replaced.  Pass an
797         lto_fixup_data_t object to tree-walker.
798
799 2008-10-08 Rafael Espindola  <espindola@google.com>
800
801         * lto-symtab.c (lto_symtab_set_resolution): New.
802         (lto_symtab_merge_decl): Use lto_symtab_set_resolution and
803         lto_symtab_get_resolution.
804         (lto_symtab_prevailing_decl): Return decl for non public decls.
805         (lto_symtab_get_resolution): New.
806         * lto.c (lto_fixup_tree, lto_fixup_state): Remove unecessary checks.
807
808 2008-10-06 Rafael Espindola  <espindola@google.com>
809
810         * lto-lang.c: Include cgraph.h.
811         (input_overwrite_node, input_node, input_edge, input_cgraph_1,
812         input_cgraph): Moved from lto-cgraph.c.
813         (LANG_HOOKS_INPUT_CGRAPH): New.
814
815 2008-10-03 Rafael Espindola  <espindola@google.com>
816
817         * lto.c (lto_fixup_tree, lto_fixup_state): Fix the FIXME.
818
819 2008-10-03 Rafael Espindola  <espindola@google.com>
820
821         * lto-symtab.c (lto_symtab_overwrite_decl): Remove. Remove all calls.
822         (lto_symtab_merge_decl): Update  LTO_IDENTIFIER_DECL the reflect the
823         prevailing definition. Don't mark TREE_NOTHROW differences.
824         * lto.c (lto_fixup_tree): New.
825         (lto_fixup_state): New.
826         (lto_fixup_state_aux): New.
827         (free_decl): New.
828         (lto_fixup_decls): New.
829         (lto_main): Call lto_fixup_decls.
830
831 2008-10-02  Ollie Wild  <aaw@google.com>
832
833         * lang.opt (fltrans): Moved from common.opt.  Remove RejectNegative
834         and Init.
835         (fwpa): Moved from common.opt.  Remove RejectNegative and Init.
836         * lto-lang.c (lto_post_options): Add validation and fixups for
837         -fltrans and -fwpa.
838
839 2008-10-02 Rafael Espindola  <espindola@google.com>
840
841         * lto-symtab.c (lto_symtab_merge_var, lto_symtab_merge_fn,
842         lto_symtab_merge_decl): Return void.
843         (lto_symtab_prevailing_decl): New.
844
845 2008-09-30 Rafael Espindola  <espindola@google.com>
846
847         * lto-symtab.c (lto_symtab_compatible): Remove the check for already
848         defined symbols.
849         (lto_symtab_overwrite_decl): Copy LTO_DECL_RESOLUTION.
850         (lto_symtab_merge_decl): Store symbol resolution in LTO_DECL_RESOLUTION.
851         Check for already defined symbols.
852         * lto-tree.h (lang_decl): Remove dummy and add resolution fields.
853         (LTO_IDENTIFIER_RESOLUTION): Remove.
854         (LTO_DECL_RESOLUTION): New.
855
856 2008-09-30 Rafael Espindola  <espindola@google.com>
857
858         * lto.c (lto_read_decls): Use new input_tree signature.
859
860 2008-09-26  Doug Kwan  <dougkwan@google.com>
861
862         * lto.c (lto_main): Call lto_fixup_nothrow_decls to fix up function
863         bodies affected by exception attribute merging of DECLs.
864         * lto-symtab.c (lto_symtab_merge_decl): Handle exception attribute
865         merging. 
866
867 2008-09-25  Rafael Espindola  <espindola@google.com>
868
869         * Make-lang.in (PLUGIN_API_H, LTO_TREE_H): New.
870         (lto/lto-lang.o, lto/lto.o, lto/lto-symtab.o) Use LTO_TREE_H.
871         * lto-symtab.c (lto_symtab_compatible): New.
872         (lto_symtab_overwrite_decl): New.
873         (lto_symtab_merge_decl): Refactor to use the above functions
874         and the resolution from lang_identifier.
875         * lto-tree.h: Include plugin-api.h.
876         (lang_identifier): Add resolution.
877         (LTO_IDENTIFIER_RESOLUTION): New.
878
879 2008-09-25  Ollie Wild  <aaw@google.com>
880
881         * lang.opt (fltrans-output-list=): New option.
882         * lto.c (lto_execute_ltrans): Output file names to ltrans_output_list.
883
884 2008-09-25 Rafael Espindola  <espindola@google.com>
885
886         * lto.c (lto_resolution_read): Initialize ret;
887
888 2008-09-24  Ollie Wild  <aaw@google.com>
889
890         * lto.c (sys/mman.h): Move include.
891         (lto_wpa_write_files): Return a list of written files.
892         (lto_execute_ltrans): New function.
893         (lto_main): Call lto_execute_ltrans.
894         (ltrans-driver): New file.
895         * lto-lang.c (DEFAULT_LTRANS_DRIVER): New macro.
896         (DEAULT_LTRANS_DRIVER_LEN): New macro.
897         (lto_init_options): Initialize ltrans_driver.
898         (lto_handle_option): Fix incorrect default output value.
899         * lang.opt (fltrans-driver=): New option.
900         * Make-lang.in (LTRANS_DRIVER_INSTALL_NAME): New variable.
901         (lto.install-common): Add lto/ltrans-driver.
902
903 2008-09-24 Rafael Espindola  <espindola@google.com>
904
905         * Make-lang.in (LTO_OBJS): Add lto/common.o.
906         (lto/lto.o): Depend on lto/common.h.
907         (lto/common.o): New.
908         * lang.opt (resolution): New.
909         * lto-lang.c (resolution_file_name): New.
910         (lto_handle_option): Handle OPT_resolution.
911         * lto-symtab.c (lto_symtab_merge_decl): Add a resolution argument.
912         (lto_symtab_merge_var,lto_symtab_merge_fn): Add a resolution argument.
913         pass it to lto_symtab_merge_decl.
914         * lto.c: Include common.h.
915         (lto_read_decls): Add resolutions and resolutions_size arguments.
916         Initialize data_in.globals_resolution and
917         data_in.globals_resolution_size.
918         (index_and_symbol_resolution): New.
919         (lto_resolution_read): New.
920         (lto_file_read): Add argument resolution_file.
921         Read resolution.
922         * lto.h (resolution_file_name): New.
923
924 2008-09-23 Rafael Espindola  <espindola@google.com>
925
926         * common.c: Update description.
927         * common.h: Update description.
928
929 2008-09-23 Rafael Espindola  <espindola@google.com>
930
931         * common.c: Moved from lto-plugin.
932         * common.h: Moved from lto-plugin.
933
934 2008-09-22  Doug Kwan  <dougkwan@google.com>
935
936         * lto.c (VEC(bitmap,heap)): Declare.
937         (lto_materialize_function): Handle WAP mode specially.
938         (lto_add_inline_clones): New.
939         (lto_add_all_inlinees): Changle algorithm and to use bitmaps.  Also
940         return a bitmap of inlined decls.
941         (lto_wpa_write_files): Handle all DECLs brought in by inlining.
942         (lto_main): Call reset_inline_failed to reset inlining states.
943         Check call-graph after WPA inlining.
944         * lto-lang.c (lto_init): Do not clear flag_generate_lto
945         unconditionally.
946
947 2008-09-19  Doug Kwan  <dougkwan@google.com>
948
949         lto.c (lto_main): Remove unsued wrapper code.
950         lang-specs.h (@lto): Use lto1_options instead of cc1_options.
951
952 2008-09-19  Rafael Espindola  <espindola@google.com>
953
954         * lto-symtab.c: Include lto-tree-in.h.
955         * lto-tree.h (lto_symtab_merge_var, lto_symtab_merge_fn): Remove.
956         * lto.h (lto_symtab_merge_var, lto_symtab_merge_fn): Remove
957         * Make-lang.in (lto/lto-symtab.o): Add lto-tree-in.h.
958
959 2008-09-17  Paolo Bonzini  <bonzini@gnu.org>
960             Rafael Avila de Espindola  <espindola@google.com>
961
962         * lto-lang.c (COMPOUND_LITERAL_EXPR_DECL_STMT,
963         COMPOUND_LITERAL_EXPR_DECL): Remove.
964         (emit_local_var): Remove.
965         (lto_expand_expr): Remove.
966         (lto_staticp): Remove.
967         (LANG_HOOKS_EXPAND_EXPR): Remove.
968         (LANG_HOOKS_STATICP): Remove.
969
970 2008-09-11  Diego Novillo  <dnovillo@google.com>
971
972         * lto-lang.c: Include except.h and libfuncs.h.
973         (lto_init_eh): New.
974         (lto_init): Call it.
975         Set flag_generate_lto to 0.
976         * Make-lang.in (lto-lang.o): Add dependency on except.h
977         and libfuncs.h.
978
979 2008-09-09  Bill Maddox  <maddox@google.com>
980
981         * lto-lang.c: Include header file expr.h.
982         (COMPOUND_LITERAL_EXPR_DECL_STMT,
983         COMPOUND_LITERAL_EXPR_DECL): Copied from c-common.h.
984         (emit_local_var):  Copied from c-semantics.c.
985         (lto_expand_expr, lto_staticp): Copied from c_expand_expr
986         and c_staticp in c-common.c.
987         (LANG_HOOKS_EXPAND_EXPR,LANG_HOOKS_STATICP):  Redefined.
988
989 2008-09-08  Diego Novillo  <dnovillo@google.com>
990
991         * lto-lang.c (lto_global_bindings_p): Return 1 during
992         IPA passes.
993
994 2008-09-07  Diego Novillo  <dnovillo@google.com>
995
996         * lto.c: Tidy formatting.
997
998 2008-08-04  Bill Maddox  <maddox@google.com>
999
1000         * lto-symtab.c (lto_symtab_merge_decl): Add comment.
1001         
1002 2008-09-03  Doug Kwan  <dougkwan@google.com>
1003
1004         lto.c (lto_add_all_inlinees): Reset FAILED_REASON of edges to
1005         CIF_OK instead of NULL.
1006
1007 2008-09-02  Diego Novillo  <dnovillo@google.com>
1008             Simon Baldwin  <simonb@google.com>
1009
1010         * lto-lang.c (lto_type_for_size): Rewrite.  Adapt from
1011         c_common_type_for_size.
1012         (lto_type_for_mode): Remove ATTRIBUTE_UNUSED markers.
1013         (lto_init): Call linemap_add.
1014         (signed_and_unsigned_types): Remove.
1015
1016 2008-08-29  Diego Novillo  <dnovillo@google.com>
1017
1018         * lto-lang.c (handle_noreturn_attribute): New local function.
1019         (handle_const_attribute): New local function.
1020         (handle_malloc_attribute): New local function.
1021         (handle_pure_attribute): New local function.
1022         (handle_novops_attribute): New local function.
1023         (handle_nonnull_attribute): New local function.
1024         (handle_nothrow_attribute): New local function.
1025         (handle_sentinel_attribute): New local function.
1026         (handle_type_generic_attribute): New local function.
1027         (handle_format_attribute): New local function.
1028         (handle_format_arg_attribute): New local function.
1029         (lto_attribute_table): Declare.
1030         (lto_format_attribute_table): Declare.
1031         (lto_init_attributes): New local function.
1032         (lto_define_builtins): Call it.
1033         Call targetm.init_builtins and build_common_builtin_nodes.
1034         (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Define.
1035         (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Define.
1036
1037 2008-08-28  Diego Novillo  <dnovillo@google.com>
1038
1039         * Make-lang.in (lto-lang.o): Replace tree-gimple.h with
1040         $(GIMPLE_H).
1041         (lto-symtab.o): Add dependency on $(GIMPLE_H).
1042         * lto-lang.c: Include gimple.h instead of tree-gimple.h.
1043         * lto-symtab.c: Include gimple.h.
1044         * lto-tree.h (chain_next): Replace GENERIC_NEXT with
1045         TREE_CHAIN.
1046
1047 2008-08-27  Doug Kwan  <dougkwan@google.com>
1048
1049         * lto.c (vec.h, bitmap.h, pointer-set.h, ipa-prop.h, ggc.h,
1050         gt-lto-lto.h): New includes.
1051         (lto_materialize_function): Do not read in function body in WPA mode.
1052         Format a line to fit in 80 columns.
1053         (lto_cgraph_node_sets): New garbage collected variable.
1054         (lto_1_to_1_map, lto_add_all_inlinees, lto_wpa_write_files):
1055         New functions.
1056         (lto_main): Initialize bitmap obstack.  Add code to handle WPA mode.
1057         * Make-lang.in (LTO_H): Replace filename lto-section-in.h with 
1058         variable LTO_SECTION_IN_H.
1059         (lto/lto.o): Include gt-lto-lto-c.h ggc.h ,VEC_H, BITMAP_H,
1060         pointer-set.h and IPA_PROP_H. Also replace filename lto-section-in.h
1061         with variable LTO_SECTION_IN_H.
1062         * config-lang.in (gtfiles): Add lto/lto.c.
1063         * lto-symtab.c (lto_symtab_merge_decl): Set DECL_CONTEXT of
1064         merged DECL_RESULT correctly.
1065
1066 2008-08-26  Bill Maddox  <maddox@google.com>
1067
1068         * lto-lang.c  Include tree-gimple.h.
1069         (lto_mark_addressable): Call mark_addressable rather than
1070         asserting.
1071         (lto_post_options): Suppress debug info generation.
1072         * Make-lang.in: Add dependency of lto-lang.o on tree-gimple.h.
1073         
1074 2008-08-25  Bill Maddox <maddox@google.com>
1075
1076         * lto-symtab.c (lto_symtab_merge_decl): Remove a suspect
1077         assertion and leave an explanatory comment in its place.
1078         
1079 2008-08-21  Doug Kwan  <dougkwan@google.com>
1080
1081         * lto.c (preload_common_nodes): Call lto_get_common_nodes to get a list
1082         of common nodes instead of computing locallly.
1083         (lto_read_in_decl_state): New.
1084         (lto_read_decls): Change code for udpate in struct lto_decl_header.
1085         Read global and per-function in-decl states.
1086         * Make-lang.in (LTO_H): Update dependency.
1087         (lto/lto.o): Same.
1088         (lto-symtab.c): Merge   (revision 139039)
1089         * lto-symtab.c (lto_symtab_merge_decl): Merge DECL_RESULT.
1090
1091 2008-08-21  Rafael Espindola  <espindola@google.com>
1092
1093         * config-lang.in (target_libs): New.
1094
1095 2008-08-20  Bill Maddox  <maddox@google.com>
1096
1097         * lto.c (current_lto_file): Remove GTY marker from static
1098         variable.  Remove include of file gt-lto-lto.h.
1099         * Make-lang.in: Remove dependency of lto/lto.o on
1100         gt-lto-lto.h.
1101         * lto-elf.c (lto_file_close): Removed.
1102         (lto_elf_file_open): Use XCNEW instead of GGC_CNEW to
1103         allocate lto_elf_file object.
1104         (lto_elf_file_close): Free lto_elf_file object after close.
1105         * lto.h (struct lto_file_struct): Remove GTY marker.
1106         * config-lang.in: Remove lto/lto.h and lto/lto.c from
1107         gtfiles.
1108         
1109 2008-08-20  Bill Maddox  <maddox@google.com>
1110
1111         * lto.c (lto_read_decls): Provide dummy argument to input_tree
1112         to conform to its new signature.
1113         * lto-symtab.c (lto_symtab_merge_decl): Do not invoke ggc_free
1114         on discarded node here, now called in global_vector_fixup.
1115         
1116 2008-08-09  Bill Maddox  <maddox@google.com>
1117
1118         * lto.c (preload_common_nodes): Verify that fileptr_type_node
1119         has not been set to a front-end-specific value.
1120         
1121 2008-08-05  Doug Kwan  <dougkwan@google.com>
1122         
1123         * Make-lang.in (lto-symtab.o): Add missing dependencies to fix
1124         build breakage.
1125
1126 2008-07-30  Bill Maddox  <maddox@google.com>
1127
1128         * lto.c (lto_materialize_function): Call lto_original_decl_name.
1129         Remove obsolete comments.
1130         (lto_read_decls): Remove initialization of deleted field data_in.global.
1131         Tidy up comments.
1132         (lto_main): Remove redundant initialization of section_hash_table.
1133         * lto-elf.c: Removed obsolete comments.
1134         * lto.h: Tidy up comments.
1135         * lto-symtab.c (lto_least_common_multiple): New function.
1136         (lto_symtab_merge_decl): Merge variable alignments in some cases.
1137         Tidy up comments.
1138
1139 2008-07-25  Diego Novillo  <dnovillo@google.com>
1140             Bill Maddox  <maddox@google.com>
1141
1142         * lto.c: Re-order include files.
1143         Include lto-section-out.h.
1144         (preload_common_nodes): Add debugging output.
1145         Add new local INDEX_TABLE.
1146         Call preload_common_node.
1147         * Make-lang.in (lto.o): Add dependency on lto-section-out.h
1148
1149 2008-07-13  Bill Maddox  <maddox@google.com>
1150
1151         * lto.c (lto_read_decls): Cast pointer to const char * to avoid
1152         unwanted scaling during pointer addition.
1153
1154 2008-07-11  Bill Maddox  <maddox@google.com>
1155             Diego Novillo  <dnovillo@google.com>
1156
1157         * lto.c (lto_read_decls): Fix C++ compatibility warnings.
1158         Make code const-correct.
1159         (lto_file_read): Fix C++ compatibility warnings.
1160         (lto_read_section_data):  Fix C++ compatibility warnings.
1161         (lto_get_section_data): Use CONST_CAST to avoid warning when
1162         const pointer passed to free.
1163         * lto-elf.c (lto_elf_build_section_table): Fix C++
1164         compatibility warnings.
1165         (lto_elf_append_data):  Fix C++ compatibility warnings.  Use CONST_CAST
1166         to avoid warning assigning const pointer to d_buf field of Elf_Data.
1167         (lto_get_current_out_file):  Fix C++ compatibility warnings.
1168
1169 2008-07-11  Diego Novillo  <dnovillo@google.com>
1170
1171         * Make-lang.in (lto-warn): Define.
1172
1173 2008-07-03  Simon Baldwin  <simonb@google.com>
1174
1175         * lto.c (lto_read_decls): Wrapped debug-only data items within #ifdef
1176         LTO_STREAM_DEBUGGING.
1177
1178 2008-06-27  Ollie Wild  <aaw@google.com>
1179
1180         * lto-elf.c (lto-section-out.h): New include.
1181         (struct lto_elf_file): Remove bits member.  Add scn, shstrtab_stream,
1182         and data members.
1183         (cached_file_attrs): New static variable.
1184         (lto_elf_get_shdr, lto_elf_free_shdr): Remove elf_file parameter.
1185         Use cached_file_attrs for checking bits.
1186         (lto_elf_build_section_table): Remove elf_file argument from
1187         lto_elf_get_shdr and lto_elf_free_shdr calls.
1188         (DEFINE_INIT_SHDR): New macro.
1189         (init_shdr32, init_shdr64): New functions defined via the
1190         DEFINE_INIT_SHDR macro.
1191         (lto_elf_begin_section_with_type): New function.
1192         (lto_elf_begin_section): New function.
1193         (lto_elf_append_data): New function.
1194         (lto_elf_end_section): New function.
1195         (DEFINE_VALIDATE_EHDR): New macro.
1196         (validate_ehdr32, validate_ehdr64): New functions defined via the
1197         DEFINE_VALIDATE_EHDR macro.
1198         (validate_file): New function.
1199         (DEFINE_INIT_EHDR): New macro.
1200         (init_ehdr32, init_ehdr64): New functions defined via the
1201         DEFINE_INIT_EHDR macro.
1202         (init_ehdr): New function.
1203         (lto_elf_file_open): Add support for writable files.  Move some
1204         validation logic to validate_file.
1205         (lto_elf_file_close): Add support for writable files.  Write file data
1206         and free data blocks.
1207         (current_out_file): New static variable.
1208         (lto_set_current_out_file): New function.
1209         (lto_get_current_out_file): New function.
1210         * lto.c (lto_main): Add writable argument to lto_elf_file_open calls.
1211         Add temporary initialization for testing ELF serialization.
1212         * lto.h (lto-section-out.h): New include.
1213         (struct lto_file_struct): Slight modification to comment.
1214         (lto_elf_file_open): Add writable parameter.
1215         (lto_elf_begin_section): New function declaration.
1216         (lto_elf_append_data): New function declaration.
1217         (lto_elf_end_section): New function declaration.
1218         (lto_set_current_out_file, lto_get_current_out_file): New function
1219         declarations.
1220         * lto-lang.c (LANG_HOOKS_BEGIN_SECTION): Set as lto_elf_begin_section.
1221         (LANG_HOOKS_APPEND_DATA): Set as lto_elf_append_data.
1222         (LANG_HOOKS_END_SECTION): Set as lto_elf_end_section.
1223         * Make-lang.in (LTO_H): Add lto-section-out.h.
1224
1225 2008-06-12  Ollie Wild  <aaw@google.com>
1226
1227         * lto.h (struct lto_file_vtable_struct): Remove.
1228         (struct lto_file_struct): Remove vtable member.
1229         * lto-elf.c (lto_file_init): Remove vtable argument.
1230         (lto_elf_map_optional_lto_section): Remove.
1231         (lto_elf_unmap_section): Remove.
1232         (lto_elf_file_vtable): Remove.
1233         (lto_elf_file_open): Remove lto_elf_file_vtable argument from
1234         lto_file_init call.
1235         (lto_elf_find_section_data): Remove.
1236
1237 2008-06-11  Ollie Wild  <aaw@google.com>
1238
1239         * lto.c (lto_file_read): Add const qualifier to data variable.
1240
1241 2008-06-11  Diego Novillo  <dnovillo@google.com>
1242
1243         Merge from lto-streamber sub-branch.
1244
1245         2008-06-04  Ollie Wild  <aaw@google.com>
1246
1247                 * lto.c: Remove inclusion of dwarf2.h and dwarf2out.h.
1248                 * Make-lang.in (lto.o): Remove dependency on dwarf2.h.
1249
1250         2008-05-28  Bill Maddox  <maddox@google.com>
1251
1252                 Replace the DWARF reader in the LTO front-end.
1253
1254                 * lto.c: Include lto-tree-in.h, lto-tags.h.
1255                 (enum DWARF2_class, DW_cl_constant, struct
1256                 DWARF2_form_data, struct lto_context,
1257                 lto_fd_init, lto_info_fd_init,
1258                 lto_abbrev_fd_init, lto_info_fd_close,
1259                 lto_file_init, lto_file_close,
1260                 lto_file_corrupt_error, lto_abi_mismatch_error,
1261                 LTO_CHECK_INT_VAL, LTO_READ_TYPE,
1262                 lto_read_uleb128, lto_read_sleb128,
1263                 lto_read_initial_length, lto_abbrev_read_attrs,
1264                 lto_abbrev_read, lto_abbrev_read_lookup,
1265                 lto_read_section_offset,
1266                 lto_read_comp_unit_header, find_cu_for_offset,
1267                 lto_get_file_name,
1268                 lto_resolve_reference,lto_read_form,
1269                 attribute_value_as_int,
1270                 make_signed_host_wide_int,
1271                 attribute_value_as_constant, lto_cache_hash,
1272                 lto_cache_eq, lto_cache_store_DIE,
1273                 lto_cache_lookup_DIE, lto_find_integral_type,
1274                 lto_find_integral_type_1,
1275                 LTO_BEGIN_READ_ATTRS_UNCHECKED,
1276                 LTO_BEGIN_READ_ATTRS, LTO_END_READ_ATTRS,
1277                 lto_unsupported_attr_error, lto_get_identifier,
1278                 lto_read_referenced_type_DIE,
1279                 lto_read_compile_unit_DIE,
1280                 lto_read_array_type_DIE,
1281                 lto_read_structure_union_class_type_DIE,
1282                 lto_read_enumerator_DIE,
1283                 lto_read_enumeration_type_DIE,
1284                 lto_read_only_for_child_DIEs,
1285                 lto_read_only_for_child_DIEs,
1286                 lto_read_member_DIE, lto_read_abbrev,
1287                 lto_read_variable_formal_parameter_constant_DIE,
1288                 lto_get_body): Removed.
1289                 (preload_common_nodes): New function.
1290                 (lto_read_decls): Convert for new global streamer.
1291                 (lto_materialze_file_data,
1292                 lto_read_subroutine_type_subprogram_die,
1293                 lto_read_unspecified_parameters_DIE,
1294                 lto_read_typedef_DIE,
1295                 lto_read_pointer_reference_type_DIE,
1296                 lto_read_subrange_type_DIE,
1297                 lto_read_base_type_DIE,
1298                 lto_read_const_volatile_restrict_type_DIE,
1299                 lto_read_namespace_DIE,
1300                 lto_read_unspecified_type_DIE, lto_read_DIE,
1301                 lto_read_child_DIEs, lto_collect_child_DIEs):
1302                 Removed.
1303                 (lto_info_read, lto_set_cu_context): Removed.
1304                 (lto_file_read): Convert for new global streamer.
1305                 (lto_resolve_type_ref, lto_read_DIE_at_ptr,
1306                 lto_resolve_var_ref, lto_resolve_fn_ref,
1307                 lto_resolve_field_ref, lto_resolve_typedecl_ref,
1308                 lto_resolve_namespacedecl_ref): Removed.
1309                 (lto_file_init, lto_file_close): Moved to lto-elf.c.
1310                 * lto-tree.h (lto_symtab_merge_var,
1311                 lto_symtab_mergee_fun): Declare here.
1312                 * lto-elf.c (lto_file_init, lto_file_close): Moved from lto.c.
1313                 (lto_elf_file_open): Removed code to read DWARF debug sections.
1314                 * lto.h (lto_context, DWARF2_attr, DWARF2_abbrev,
1315                 DWARF2_CompUnit, lto_die_ptr,
1316                 lto_die_cache_entry, lto_fd, lto_info_fd,
1317                 lto_abbrev_fd): Removed.
1318                 (lto_file): Removed debug_info and debug_abbrev fields.
1319                 (lto_ref): Removed.
1320                 (lto_file_init, lto_file_close,
1321                 lto_resolve_type_ref, lto_resolve_var_ref,
1322                 lto_resolve_fn_ref, lto_resolve_field_ref,
1323                 lto_resolve_typedecl_ref,
1324                 lto_resolve_namespacedecl_ref,
1325                 lto_get_file_name): Removed declarations.
1326                 (lto_symtab_merge_var, lto_symtab_merge_fn):
1327                 Declarations moved to lto-tree.h.
1328                 * lto-symtab.c (lto_compatible_attributes_p):
1329                 Lobotomize this, as it barfs on "Hello, world!".
1330                 * lto-section-out.c: Include lto-tree-out.h.
1331                 (lto_hash_global_slot_node,
1332                 lto_eq_global_slot_node, preload_common_nodes,
1333                 write_global_stream, write_global_references):
1334                 New functions.
1335                 (produce_asm_for_decls): Convert for new global streamer.
1336                 * lto-section-out.h (lto_hash_global_slot_node,
1337                 lto_eq_global_slot_node): Declare.
1338
1339 2008-06-07  Kenneth Zadeck <zadeck@naturalbridge.com>
1340             Jan Hubicka  <jh@suse.cz>
1341         
1342         * lto.c (sys/mman.h, tree-pass.h): New includes.
1343         (lto_materialize_constructors_and_inits,
1344         lto_materialize_function): Keeps length of section.
1345         (lto_materialize_cgraph): Removed.
1346         (lto_read_decls): Initialize fd field.
1347         (lto_file_read): Different return type and removed much code to
1348         lto_main.
1349         (page_mask): New variable.
1350         (lto_read_section_data, get_section_data, free_section_data): New
1351         functions.
1352         (lto_main): Now calls pass manager, sets the hooks so that the ipa
1353         passes can get the section data. 
1354         
1355 2008-05-27  Kenneth Zadeck <zadeck@naturalbridge.com>
1356
1357         * lto.h (lto_read_decls): Made local.
1358         (lto_input_function_body, lto_input_constructors_and_inits, 
1359         lto_input_cgraph): Declarations moved to lto-section-in.h.
1360         * lto-section-in.c: Moved to .. .
1361         * lto-cgraph-in.c: Ditto.
1362         * lto-section-in.h: Ditto.
1363         * lto-function-in.c: Ditto.
1364         * lto-lang.c (lto_handle_option): Added ATTRIBUTE_UNUSED to parms.
1365         (lto_insert_block): Removed.
1366         (LANG_HOOKS_INSERT_BLOCK): Removed.
1367         * Make-lang.in (lto-cgraph-in.o, lto-function-in.o,
1368         lto-section-in.o): Rules moved to lto/Makefile.in.
1369         
1370
1371 2008-05-16  Ollie Wild  <aaw@google.com>
1372
1373         * lto-lang.c (tree-inline.h): Include.
1374         (lto_post_options): New function.
1375         (LANG_HOOKS_POST_OPTIONS): Define.
1376         * lto-cgraph-in.c (overwrite_node): Set node->global.insns.
1377         * lto-function-in.c (input_bb): Set TREE_BLOCK (stmt).
1378
1379 2008-05-13  Diego Novillo  <dnovillo@google.com>
1380
1381         * lto-function-in.c (input_ssa_names): Call
1382         make_ssa_name_fn instead of make_ssa_name.
1383
1384 2008-05-12  Diego Novillo  <dnovillo@google.com>
1385
1386         * lto-cgraph-in.c (overwrite_node): Update references to
1387         inline summary fields.
1388         * lto-function-in.c (input_expr_operand): Do not handle
1389         STRUCT_FIELD_TAG.
1390
1391 2008-05-09  Ollie Wild  <aaw@google.com>
1392
1393         * lang.opt: New file.
1394         * lto-lang.c (lto_init_options): New function.
1395         (lto_handle_option): New function.
1396         (lto_init): Move initialization of flag_unit_at_a_time to
1397         lto_init_options.
1398         (LANG_HOOKS_INIT_OPTIONS): Define.
1399         (LANG_HOOKS_HANDLE_OPTION): Define.
1400
1401 2008-04-29  Ollie Wild  <aaw@google.com>
1402
1403         * lto.c (lto_read_namespace_DIE): New function.
1404         (lto_read_DIE): Add lto_read_namespace_DIE callback.  Cache
1405         NAMESPACE_DECL DIE's.
1406         (lto_resolve_namespacedecl_ref): New function.
1407         * lto.h (lto_resolve_namespacedecl_ref): New function.
1408         * lto-section-in.c (lto_read_decls): Read namespace declarations.
1409         * lto-section-in.h (struct lto_file_decl_data): Add namespace_decls
1410         and num_namespace_decls.
1411         * lto-function-in.c (input_expr_operand): Add NAMESPACE_DECL case.
1412         * lto-lang.c (lto_init_ts): New function.
1413         (LANG_HOOKS_INIT_TS): Set as lto_init_ts.
1414
1415 2008-04-16  Ollie Wild  <aaw@google.com>
1416
1417         * lto-function-in.c (input_type_ref): Updated function description.
1418
1419 2008-04-16  Ollie Wild  <aaw@google.com>
1420
1421         * lto-function-in.c (input_type_ref_1): New function.
1422         (input_type_ref): Split into two functions.
1423         (input_function): Add support for type contexts.
1424
1425 2008-04-16  Ollie Wild  <aaw@google.com>
1426
1427         * lto.c (lto_materialize_function): Use DECL_ASSEMBLER_NAME to compute
1428         section name
1429
1430 2008-04-16  Ollie Wild  <aaw@google.com>
1431
1432         * lto.c (lto_read_compile_unit_DIE): Add DW_LANG_C_plus_plus to the
1433         list of supported languages.
1434
1435 2008-03-25  Kenneth Zadeck <zadeck@naturalbridge.com>
1436
1437         Merge with mainline @133491.
1438
1439 2008-03-05  Kenneth Zadeck <zadeck@naturalbridge.com>
1440             Jan Hubicka  <jh@suse.cz>
1441
1442         * lto.c (lto_info_fd_init, lto_info_fd_close): Get rid of
1443         fd->unmaterialized_fndecls.
1444         (lto_get_file_name, lto_materialize_cgraph): New function.
1445         (lto_materialize_constructors_and_inits,
1446         lto_materialize_function): Read info directly from elf file.
1447         (lto_file_read): Made local and initialize dictionary so that
1448         other lto sections can be read without reprocessing the elf file.
1449         (lto_main): Read all functions after all files have been processed
1450         for their types, globals and cgraph.  
1451         * Make-lang.in (lto.o, lto-cgraph-in.c, lto-section-in): Changed
1452         dependencies.
1453         * lto-elf.c (lto_elf_file): Removed strtab, symtab fields.
1454         (hash_name, eq_name, lto_elf_build_section_table): New functions.
1455         (lto_elf_read_symtab): Removed function.
1456         (lto_elf_file_open): Removed call to lto_elf_read_symtab.
1457         * lto.h (lto_info_fd_struct): Removed unmaterialized_fndecls.
1458         (lto_file_read): Made local.
1459         (lto_get_file_name, lto_elf_build_section_table,
1460         lto_input_cgraph): 
1461         New function.
1462         * lto-section-in.c (lto_read_section_data, lto_get_section_data):
1463         New functions.
1464         (lto_read_decls): Get the file name.
1465         * lto-cgraph-in.c: New file.
1466         * lto-function-in.c (tag_to_expr): Stops at LTO_tree_last_tag.
1467         (input_expr_operand, lto_read_body): Set lto_debug_context.tag_names.
1468         (input_labels): Fixed latent sizeof issue.
1469         (input_function): Build stmt array to set call sites into cgraph
1470         edges.
1471         (lto_read_body): Reset cfun->curr_properties.
1472         * lto_section_in.h (lto_section_slot): New structure.
1473         (section_hash_table.lto_file_decl_data): New field.
1474
1475         
1476 2008-02-09  Kenneth Zadeck <zadeck@naturalbridge.com>
1477
1478         * lto.c (lto_read_variable_formal_parameter_const): Remove code to
1479         reconstruct static initializers.
1480         (lto_get_body, lto_materialize_function): Add lto_section_type as
1481         a parameter.
1482         (lto_materialize_constructors_and_inits,
1483         lto_materialize_file_data): New function.
1484         (lto_materialize_function,
1485         lto_read_subroutine_type_subprogram_DIE): Renamed unmap_fn_body to
1486         unmap_section and map_fn_body to map_section.
1487         (lto_set_cu_context): Process functions and static inits
1488         differently.
1489         * Make-lang.in (LTO_H, lto/lto-function-in.o,
1490         lto/lto-section-in.o): Update dependencies.
1491         * lto/lto-elf.c (lto_elf_map_optional_lto_section): Add
1492         lto_section_type parameter.
1493         (lto_elf_unmap_fn_body): Renamed to lto_elf_unmap_section.
1494         * lto.h (lto_file_vtable_struct): Removed two of the fields and 
1495         renamed the other two so that there is only one map function and
1496         one unmap function and each takes a section type parameter.
1497         (lto_read_function_body): Renamed to lto_input_function_body and
1498         added file_data parameter.
1499         (lto_read_var_init): Removed.
1500         (lto_input_constructors_and_inits): New function.
1501         * lto-section-in.c (lto_read_decls): New function.
1502         * lto-function-in.c (data_in): Moved fields field_decls, fn_decls,
1503         var_decls, type_decls, types to lto_file_decl_data.
1504         (input_type_ref, input_expr_operand, lto_read_body): Get
1505         field_decls, fn_decls, var_decls, type_decls, types from different
1506         structure.
1507         (input_globals, input_constructor, lto_read_var_init): Removed.
1508         (input_constructors_or_inits): New function.
1509         (lto_read_function_body, lto_input_constructors_and_inits):
1510         Renamed to lto_input_function_body and takes file_data parameter.
1511         * lto-section-in.h (lto_file_decl_data): New structure.
1512         
1513 2008-01-28  Kenneth Zadeck <zadeck@naturalbridge.com>
1514
1515         * lto-function-in.c (input_globals.c): Changed input type to
1516         lto_function_header.
1517         (input_bb): Removed code to deserialize the stmt number.
1518         (input_function): Renumber all stmts after they are input.
1519         (lto_read_body, lto_read_function_body, lto_read_var_init):
1520         Changed to used new header format and enum section_type.
1521         *lto-lang.c (success): Removed. 
1522         
1523 2008-01-28  Nathan Froyd  <froydnj@codesourcery.com>
1524
1525         * lto-elf.c (lto_elf_lookup_sym): Remove unused function.
1526         (lto_elf_free_sym): Likewise.
1527
1528         * lto-elf.c (lto_elf_read_var_init): Remove unused function.
1529         (lto_elf_build_init): Likewise.
1530
1531 2008-01-14  Kenneth Zadeck <zadeck@naturalbridge.com>
1532
1533         * lto-read.c: Renamed to lto-function-in.c.
1534         (input_1_unsigned): Moved to lto-section-in.c and renamed
1535         lto_input_1_unsigned.
1536         (input_uleb128): Moved to lto-section-in.c and renamed
1537         lto_input_uleb128.
1538         (input_widest_uint_uleb128): Moved to lto-section-in.c and renamed
1539         lto_input_widest_uint_uleb128.
1540         (input_sleb128): Moved to lto-section-in.c and renamed
1541         lto_input_sleb128.
1542         (input_integer): Moved to lto-section-in.c and renamed
1543         lto_input_integer.
1544         (debug_in_fun): Moved to lto-section-in.c and renamed
1545         lto_debug_in_fun.
1546         (input_block): Moved to lto-section-in.h and renamed
1547         lto_input_block.
1548         (input_expr_operand): Fixed to allow lists with more than one
1549         element.
1550         * lto-section-in.h: New file.
1551         * lto-section-in.c: New file with changes from above.
1552         * Make-lang.in (lto-read.o): Renamed lto-function-in.c.
1553         (lto-section-in.o): New rule.
1554         
1555 2007-12-29  Nathan Froyd  <froydnj@codesourcery.com>
1556
1557         * lto-read.c (input_expr_operand): Mark static and external
1558         VAR_DECLs as needed.
1559
1560 2007-12-29  Nathan Froyd  <froydnj@codesourcery.com>
1561
1562         * lto-read.c (input_integer): Use the correct shift amount.
1563
1564 2007-12-29  Nathan Froyd  <froydnj@codesourcery.com>
1565
1566         * lto-lang.c (lto_pushdecl): Do nothing instead of aborting.
1567         (LANG_HOOKS_NAME): Define.
1568
1569 2007-12-27  Nathan Froyd  <froydnj@codesourcery.com>
1570
1571         * lto.c (lto_find_integral_type): Define as a macro.  Rename the
1572         original function to...
1573         (lto_find_integral_type_1): ...this.  Consult UNSIGNEDP if we
1574         don't have a base type.
1575         (lto_read_enumeration_type_DIE): Examine the values of the
1576         enumeration to determine whether we can use an unsigned type for
1577         the base type of the enumeration.
1578
1579 2007-12-24  Nathan Froyd  <froydnj@codesourcery.com>
1580
1581         * lto.c (lto_read_structure_union_class_type_DIE): Set TYPE_MODE
1582         and TYPE_ALIGN on UNION_TYPEs as soon as possible.
1583
1584 2007-12-22  Nathan Froyd  <froydnj@codesourcery.com>
1585
1586         * lto-lang.c (lto_types_compatible_p): New function.
1587         (LANG_HOOKS_TYPES_COMPATIBLE_P): Define.
1588
1589 2007-12-22  Nathan Froyd  <froydnj@codesourcery.com>
1590             Kenneth Zadeck <zadeck@naturalbridge.com>
1591
1592         * lto-read.c (input_expr_operand): Fixed uninitialize var warning.
1593         (input_local_vars): Read in DECL_INITIAL and context for local
1594         statics that need to be put in unexpanded_vars_list.
1595
1596 2007-12-21  Nathan Froyd  <froydnj@codesourcery.com>
1597
1598         * lto-read.c (input_real): Use a separate null-terminated buffer
1599         for calling real_from_string.
1600         (input_expr_operand): If we take the address of a FUNCTION_DECL,
1601         tell cgraph that it's needed.
1602
1603 2007-12-19  Doug Kwan  <dougkwan@google.com>
1604
1605         * lto.c (lto_read_base_type_DIE): Handle complex integer types.
1606
1607 2007-12-18  Nathan Froyd  <froydnj@codesourcery.com>
1608
1609         * lto.c (lto_read_DIE): Call lto_read_only_for_child_DIEs instead.
1610         (lto_file_read): Reset the members of 'context' every time we read
1611         a toplevel DIE, with special attention to last_param_type.
1612
1613 2007-12-18  Nathan Froyd  <froydnj@codesourcery.com>
1614
1615         * lto.c (lto_read_subroutine_type_subprogram_DIE): Initialize
1616         'declaration'.  Set the assembler name for non-public functions.
1617
1618 2007-12-17  Kenneth Zadeck <zadeck@naturalbridge.com>
1619
1620         * lto_read.c (data_in.unexpanded_indexes): New array.
1621         (input_local_var): Added code to read in unexpanded_var_list
1622         indexes for variables.  Only read in DECL_CHAIN field for
1623         parameters.
1624         (input_local_vars): Added code to rebuild unexpanded_var_list in
1625         order using unexpanded_indexes.
1626         (input_function): Added code to set DECL_CONTEXT for functions.
1627
1628 2007-12-13  Doug Kwan  <dougkwan@google.com>
1629
1630         * lto.c (lto_read_pointer_reference_type_DIE): Handle optional name
1631         in pointer and reference types.
1632
1633 2007-12-13  Nathan Froyd  <froydnj@codesourcery.com>
1634
1635         * lto-read.c (input_expr_operand): Use DECL_RESULT when reading a
1636         RESULT_DECL.
1637
1638 2007-12-13  Nathan Froyd  <froydnj@codesourcery.com>
1639
1640         * lto.c (lto_read_array_type_DIE): Return the cached DIE if we've
1641         already read the DIE.
1642         (lto_get_body): New function, split out from...
1643         (lto_materialize_function): ...here.  Call it.
1644         (lto_read_subroutine_type_subprogram_DIE): Call lto_get_body to
1645         determine DECL_EXTERNAL.
1646         * lto-symtab.c (lto_symtab_merge_decl): Merge the DECL_RESULTs of
1647         FUNCTION_DECLs when necessary.  Use the type of the actual
1648         function definition if we are unable to easily merge types.  Ignore
1649         spurious DECL_MODE mismatches on VAR_DECLs.  Merge DECL_MODEs when
1650         necessary.
1651
1652 2007-12-13  Nathan Froyd  <froydnj@codesourcery.com>
1653
1654         * lto-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define.
1655
1656 2007-12-12  Bill Maddox  <maddox@google.com>
1657
1658         Revert
1659         2007-12-07  Bill Maddox  <maddox@google.com>
1660
1661         * lto.c (lto_str_fd_init): New function.
1662         (lto_str_fd_close): New function.
1663         (lto_file_init): Call lto_str_fd_init.
1664         (lto_file_close): Call lto_str_fd_close.
1665         (lto_str_read): New function. Read debug string table.
1666         (lto_str_lookup): New function. Get string for debug
1667         string table offset.
1668         (lto_read_form): Recognize DW_FORM_strp.
1669         (lto_file_read): Invoke lto_str_read.
1670
1671         * lto-elf.c (lto_elf_file_open): Read raw section data
1672         for the .debug_str section, if present.
1673
1674         * lto.h (struct lto_str_fd_struct): New struct.
1675         (struct lto_file_struct): Added new field DEBUG_STR
1676         to hold the file descriptor for the debug string table.
1677         
1678 2007-12-07  Bill Maddox  <maddox@google.com>
1679
1680         * lto.c (lto_str_fd_init): New function.
1681         (lto_str_fd_close): New function.
1682         (lto_file_init): Call lto_str_fd_init.
1683         (lto_file_close): Call lto_str_fd_close.
1684         (lto_str_read): New function. Read debug string table.
1685         (lto_str_lookup): New function. Get string for debug
1686         string table offset.
1687         (lto_read_form): Recognize DW_FORM_strp.
1688         (lto_file_read): Invoke lto_str_read.
1689
1690         * lto-elf.c (lto_elf_file_open): Read raw section data
1691         for the .debug_str section, if present.
1692
1693         * lto.h (struct lto_str_fd_struct): New struct.
1694         (struct lto_file_struct): Added new field DEBUG_STR
1695         to hold the file descriptor for the debug string table.
1696
1697 2007-12-07  Nathan Froyd  <froydnj@codesourcery.com>
1698
1699         * lto-read.c (input_cfg): Call init_empty_tree_cfg_for_function.
1700         Grow the basic_block_info and label_to_block_map vectors if
1701         necessary.  Read in the block chain.
1702
1703 2007-12-06  Nathan Froyd  <froydnj@codesourcery.com>
1704
1705         * lto.c (lto_read_DIE): Set TYPE_ALIAS_SET where necessary.
1706
1707 2007-12-06  Nathan Froyd  <froydnj@codesourcery.com>
1708
1709         * lto.c (lto_read_form): Add DW_cl_address for DW_AT_const_value.
1710
1711 2007-12-06  Nathan Froyd  <froydnj@codesourcery.com>
1712
1713         * lto-read.c (input_expr_operand): Don't check for MTAGs.
1714         (lto_read_body): Don't declare PROP_alias.
1715
1716 2007-12-06  Nathan Froyd  <froydnj@codesourcery.com>
1717
1718         * lto-symtab.c (lto_symtab_merge_decl): Handle FUNCTION_DECLs without
1719         argument type information.
1720
1721 2007-12-03  Nathan Froyd  <froydnj@codesourcery.com>
1722
1723         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Set
1724         TREE_THIS_VOLATILE if the associated type is a volatile type.
1725         (lto_materialize_function): Remove call to init_ssa_operands.
1726         * lto-read.c (input_expr_operand): Add SSA_NAME_VAR as a referenced
1727         variable when reading an SSA_NAME.  Do the same when reading a
1728         RESULT_DECL, a RETURN_EXPR, or an MTAG.
1729         (input_cfg): Call init_ssa_operands.
1730         (input_ssa_names): Set the default def of an SSA_NAME if necessary.
1731         Move call to init_tree_ssa...
1732         (lto_read_body): ...here.  Use push_cfun and pop_cfun.  Call
1733         add_referenced_var on any variables referenced from the body of the
1734         function.  Inform the rest of the compiler we are in SSA form and
1735         inform later passes about the current properties.
1736
1737 2007-11-30  Nathan Froyd  <froydnj@codesourcery.com>
1738
1739         * lto.c (lto_materialize_function): Add FIXME.
1740
1741 2007-11-29  Nathan Froyd  <froydnj@codesourcery.com>
1742
1743         * lto-lang.c (enum built_in_attribute): New enum.
1744         (flag_no_builtin, flag_no_nonansi_builtin, flag_isoc94, flag_isoc99,
1745         built_in_attributes): New variables.
1746         (def_builtin_1): New function.
1747         (lto_define_builtins): #define DEF_BUILTIN and include builtins.def.
1748
1749 2007-11-28  Nathan Froyd  <froydnj@codesourcery.com>
1750
1751         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Set
1752         DECL_SOURCE_LOCATION for debugging purposes.
1753         (lto_read_member_DIE): Set DECL_SOURCE_LOCATION.  If we have read a
1754         bitfield, use the type specified by the DIE for TREE_TYPE and defer
1755         laying out the decl until later.
1756         (lto_read_subroutine_type_subprogram_DIE): Compare the function's
1757         name with DECL_ASSEMBLER_NAME.  Set DECL_SOURCE_LOCATION and
1758         TREE_ADDRESSABLE.
1759         * lto-read.c (input_expr_operand): Set TREE_ADDRESSABLE on the
1760         operand of an ADDR_EXPR.
1761         * lto-lang.c (enum lto_builtin_type): New enum.
1762         (builtin_type): New typedef.
1763         (builtin_types, string_type_node, const_string_type_node,
1764         wint_type_node, intmax_type_node, uintmax_type_node,
1765         signed_size_type_node): New variables.
1766         (def_fn_type, builtin_type_for_size, lto_define_builtins,
1767         lto_build_c_type_nodes): New functions.
1768         (lto_init): Initialize builtin types.
1769         (lto_set_decl_assembler_name): Let the target machine mangle the
1770         name if the decl is TREE_PUBLIC, otherwise uniquify it.
1771
1772 2007-11-21  Nathan Froyd  <froydnj@codesourcery.com>
1773
1774         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Don't
1775         set TREE_ADDRESSABLE.  Do set DECL_COMDAT.  Set TREE_READONLY if
1776         the type is a constant type.  Set the assembler name and inform
1777         the rest of the compiler about the new decl if the decl is not
1778         public.
1779         (lto_read_subroutine_type_subprogram_DIE): Don't check for equivalency
1780         of DECL_ASSEMBLER_NAME when determining if we have a builtin.  Don't
1781         try to read in function bodies for functions that already have bodies.
1782         * lto-symtab.c (lto_same_type_p): Check for unbounded array
1783         equivalency.
1784         (lto_symtab_merge_decl): Don't merge decls that aren't TREE_PUBLIC.
1785         Check for whether we matched a builtin function type before calling
1786         lto_same_type_p on the generated type.  Permit cases where the
1787         declaration of an array is unbounded, but the definition is bounded.
1788         Don't combine TREE_PUBLIC flags.  Copy over DECL_SIZE and
1789         DECL_SIZE_UNIT if necessary.
1790
1791 2007-11-16  Kenneth Zadeck <zadeck@naturalbridge.com>
1792
1793         * lto-read.c (input_expr_operand): Get types right 
1794         for COMPLEX_CST.
1795
1796 2007-11-16  Kenneth Zadeck <zadeck@naturalbridge.com>
1797
1798         * lto-read.c (make_new_block, input_cfg): Properly set
1799         n_basic_blocks.
1800         
1801 2007-11-16  Nathan Froyd  <froydnj@codesourcery.com>
1802
1803         * lto.c (lto_read_array_type_DIE): Handle DIEs with DW_AT_GNU_vector
1804         set properly by building a VECTOR_TYPE instead of an ARRAY_TYPE.
1805
1806 2007-11-16  Nathan Froyd  <froydnj@codesourcery.com>
1807
1808         * lto.c (lto_read_base_type_DIE): Use make_bitfield_integer_type to
1809         construct the integer type for bitfields.
1810
1811 2007-11-16  Kenneth Zadeck <zadeck@naturalbridge.com>
1812
1813         * lto-read.c (data_in.current_node_has_loc): Removed.
1814         (input_line_info): Returns true if node needs line set.
1815         (set_line_info): Always sets line if called.
1816         (clear_line_info): Removed reference to current_node_needs_loc.
1817         (input_expr_operand): Keeps track locally if current node needs a loc.
1818         (input_local_var): Added code to handle DECL_INITIAL for
1819         static local vars. Only set loc if necessary.
1820         
1821 2007-11-15  Nathan Froyd  <froydnj@codesourcery.com>
1822
1823         * lto.c (lto_read_subroutine_type_subprogram_DIE): Fix thinko'd
1824         DECL_CONTEXT.
1825
1826 2007-11-15  Nathan Froyd  <froydnj@codesourcery.com>
1827
1828         * lto.c: Include langhooks.h.
1829         (lto_find_integral_type): Rework logic to handle the case where
1830         got_byte_size is true, but the bitsize requested and that of the
1831         base_type doesn't match.
1832         (lto_read_variable_formal_parameter_constant_DIE): Only check for
1833         asm_name if we are creating a VAR_DECL.
1834         (lto_materialize_function): Set DECL_EXTERNAL if we can't find a
1835         definition.
1836         (lto_read_subroutine_type_subprogram_DIE): Check for a builtin
1837         function reference and use the builtin's decl if so.  Set the
1838         DECL_CONTEXT of the RESULT_DECL for the function.
1839         * lto-lang.c (registered_builtin_fndecls): New variable.
1840         (lto_getdecls): Return it.
1841         (lto_builtin_function): Chain the new decl onto
1842         registered_builtin_fndecls.
1843
1844 2007-11-15  Kenneth Zadeck <zadeck@naturalbridge.com>
1845             
1846         * lto-read.c (process_tree_flags, lto_static_init_local):
1847         Renamed to ADD_CLASS_EXPR_FLAG. ADD_CLASS_DECL_FLAG New Macro.
1848         (input_line_info, clear_line_info): Fixed new line number code.
1849         (input_expr_operand): Added type to SWITCH_EXPR.
1850         (lto_read_body): Properly initialized data_in.
1851         Clear line info when leaving.
1852         
1853 2007-11-13  Diego Novillo  <dnovillo@google.com>
1854
1855         * lto.c (lto_read_variable_formal_parameter_constant_DIE):
1856         Initialize ARTIFICIAL.
1857         (lto_read_subroutine_type_subprogram_DIE): Initialize
1858         SAVED_SCOPE.
1859         * lto-read.c (set_line_info): Remove ; from calls to
1860         LINEMAP_POSITION_FOR_COLUMN.
1861
1862 2007-11-13  Kenneth Zadeck <zadeck@naturalbridge.com>
1863
1864         * lto-read.c (input_type_ref): Renamed from get_type_ref.
1865         (input_expr_operand, input_local_var): Renamed get_type_ref to 
1866         input_type_ref.
1867         (input_expr_operand): Get the types correct for 
1868         vector-cst.  Get SSA_NAME_DEF_STMT correct for return_exprs.
1869         
1870 2007-11-13  Doug Kwan  <dougkwan@google.com>
1871
1872         * lto-read.c (input_widest_uint_uleb128): New function.
1873         (input_tree_flags, process_tree_flags, input_line_info,
1874         input_expr_operand, input_local_var, input_phi, input_ssa_names):
1875         Change to use lto_flags_type and BITS_PER_LTO_FLAGS_TYPES instead of
1876         unsigned HOST_WIDE_INT and HOST_BITS_PER_WIDE_INT.
1877         (lto_static_init_local): Add code to assert that lto_flags_type is
1878         wide enough.
1879
1880 2007-11-13  Nathan Froyd  <froydnj@codesourcery.com>
1881
1882         * lto.c (lto_read_array_type_DIE): Handle DW_AT_GNU_vector.
1883         (lto_read_subroutine_type_subprogram_DIE): Handle
1884         DW_AT_static_link and DW_AT_specification.  Return the
1885         specification if present.
1886         (lto_read_base_type_DIE): Handle DW_ATE_complex_float.
1887         
1888 2007-11-13  Nathan Froyd  <froydnj@codesourcery.com>
1889
1890         * lto-lang.c: Include target.h.
1891         (registered_builtin_types): New variable.
1892         (lto_type_for_mode): Increase number of modes handled.
1893         (lto_builtin_function): Fix argument list and return the decl.
1894         (lto_register_builtin_type): New function.
1895         (lto_init): Initialize target builtins and language-independent
1896         nodes.
1897         (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define.
1898
1899 2007-11-13  Kenneth Zadeck <zadeck@naturalbridge.com>
1900
1901         * lto-read.c (input_expr_operand): Added code to properly handle
1902         index filed. Added new RANGE_EXPR case.
1903         
1904 2007-11-11  Kenneth Zadeck <zadeck@naturalbridge.com>
1905
1906         * lto-read.c (ADD_FUNC_FLAG): Deleted macro.
1907         (data_in): Added current_node_has_loc field.
1908         (input_line_info, set_line_info, clear_line_info): Added a support
1909         for USE_MAPPED_LOCATION and not adding line numbers to nodes that
1910         did not have on on the source side.
1911         (input_expr_operand): Make sure that GIMPLE_MODIFY_STMTS get line
1912         numbers too.
1913
1914 2007-11-09  Doug Kwan  <dougkwan@google.com>
1915
1916         * lto-read.c (input_expr_operand): Change type of operand 2 of
1917         BIT_FIELD_REF expression to be bitsizetype instead of sizetype.
1918
1919 2007-11-09  Nathan Froyd  <froydnj@codesourcery.com>
1920
1921         * lto.c: Include lto-tree.h.  Effect small spaces->tabs cleanup.
1922         (lto_read_variable_formal_parameter_constant_DIE): Transfer bits
1923         from a DW_AT_specification or DW_AT_abstract_origin attribute to
1924         the new decl we are creating.  Move informing the middle end about
1925         the new decl to...
1926         (lto_main): ...here.  Inform the middle end about global variables
1927         after we have read in all the input files.
1928         * lto-symtab.c (lto_symtab_merge_decl): We really do need to merge
1929         variables with internal linkage, so delete the check for internal
1930         linkage.  Combine TREE_PUBLIC flags.
1931
1932 2007-11-08  Nathan Froyd  <froydnj@codesourcery.com>
1933
1934         * lto.c (lto_read_subroutine_type_subprogram_DIE): Handle
1935         DW_AT_decl_line.
1936         * lto-symtab.c (lto_symtab_merge_decl): Handle redefinition of a
1937         builtin specially.  Move check for attribute compatibility
1938         earlier.
1939
1940 2007-11-07  Nathan Froyd  <froydnj@codesourcery.com>
1941
1942         * Make-lang.in (lto/lto.o): Depend on gt-lto-lto.h.
1943         * config-lang.in (gtfiles): Add lto.h and lto.c.
1944         * lto-elf.c: Include ggc.h.
1945         (lto_elf_file_open): Allocate elf_file from GC memory.
1946         * lto.c: Include tree-ssa-operands.h and gt-lto-lto.h
1947         (lto_info_fd_init): Allocate the die_cache and unmaterialized_fndecls
1948         in GC memory.
1949         (lto_info_fd_close): Free unmaterialized_fndecls from GC memory.
1950         (lto_file_close): Free file from GC memory.
1951         (lto_cache_store_DIE): Allocate the new entry in GC memory.
1952         (lto_read_member_DIE): Fix declaration.
1953         (lto_read_subroutine_type_subprogram_DIE): unmaterialized_fndecls lives
1954         in GC memory.
1955         (current_lto_file): New variable.
1956         (lto_main): Use it.
1957         (DWARF2_attr, DWARF2_abbrev, lto_die_ptr, DWARF2_CompUnit,
1958         lto_die_cache_entry): Move to...
1959         * lto.h: ...here and add GTY markers as appropriate.  Delete forward
1960         declarations accordingly.
1961         (struct lto_file_struct): Declare.
1962         (lto_file_vtable): Use it instead of lto_file.
1963
1964 2007-11-06 Alon Dayan  <alond@il.ibm.com>
1965            Kenneth Zadeck <zadeck@naturalbridge.com>
1966
1967          * lto-read.c (process_flags, lto_static_init_local):
1968          read flags of VAR_DECL and FUNCTION_DECL of size>1.
1969          change global array num_flags_for_code to flags_length_for_code.
1970          (set_line_info): Make decls work in USE_MAPPED_LOCATION mode.
1971         
1972 2007-11-05  Nathan Froyd  <froydnj@codesourcery.com>
1973
1974         * lto.c (lto_read_structure_union_class_type_DIE): Use proper record
1975         layout functions to compute information about the newly constructed
1976         type.
1977
1978 2007-11-02  Nathan Froyd  <froydnj@codesourcery.com>
1979
1980         * lto-read.c (input_expr_operand): Change the LTO_return_expr1
1981         case to use DECL_RESULT if necessary.
1982
1983 2007-11-01  Kenneth Zadeck <zadeck@naturalbridge.com>
1984
1985         * lto-read.c (input_tree_list): Removed.
1986         (input_tree_flags): Added parameter to force flags no matter what
1987         tree code.
1988         (input_expr_operand): Added parameter to input_tree_flags.
1989         Added case for IDENTIFIER_NODE and TREE_LIST.  Changed ASM to call
1990         input_expr_operand rather than input_tree_lists.
1991         (input_local_var): Use input_expr_operand to read attributes
1992         rather then input_tree_list.
1993         (input_phi, input_ssa_names): Added parameter to input_tree_flags.
1994
1995 2007-10-31  Nathan Froyd  <froydnj@codesourcery.com>
1996
1997         * lto.c (lto_read_typedef_DIE): Fix comment typo.
1998         (lto_resolve_typedecl_ref): Fetch the referred-to type and build a fake
1999         TYPE_DECL for it.
2000         * lto-read.c (lto_read_body): Use correct sizes for calculating
2001         type_decls_offset and types_offset.
2002
2003 2007-10-30  Nathan Froyd  <froydnj@codesourcery.com>
2004
2005         * lto-tree.h (union lang_tree_node): Change GTY description to chain
2006         with GENERIC_NEXT.
2007         * config-lang.in (gtfiles): Add lto-lang.c.
2008         * lto-lang.c: Include gt-lto-lto-lang.h.
2009         * Make-lang.in (lto/lto-lang.o): Add dependency on gt-lto-lto-lang.h
2010         (lto/lto-symtab.o): Depend on LTO_H instead of TREE_H.
2011         (lto/lto-read.o): Likewise.
2012
2013 2007-10-29  Kenneth Zadeck <zadeck@naturalbridge.com>
2014
2015         * lto-read.c (data_in): Added type_decls and current_col fields.
2016         (string_slot): New type to hold canonized file name.
2017         (hash_string_slot_node, eq_string_slot_node, canon_file_name, 
2018         input_line_info, set_line_info, clear_line_info): New functions.
2019         (file_name_hash_table): New hash table.
2020         (input_local_var, input_labels, input_local_vars_index, 
2021         input_local_var, input_local_vars, input_ssa_names): Reorganized parameters.
2022         (input_uleb128): Changed type of byte var.
2023         (input_expr_operand): Large number of changes to get line numbers
2024         correct.  Added TYPE_DECL case.
2025         (input_globals): Added code to get TYPE_DECLs processed.
2026         (input_local_var): Added code to process line numbers and
2027         TREE_CHAIN and DECL_CONTEXT.
2028         (input_function, input_constructor): Added call to
2029         clear_line_number.
2030         (lto_static_init_local): Added code to get line numbers correct.
2031         (lto_read_body): Added code to get TYPE_DECLS read and to change
2032         parameters to the calls above that had their parms reorganized.
2033
2034         
2035 2007-10-29  Nathan Froyd  <froydnj@codesourcery.com>
2036
2037         * lto.h (lto_resolve_typedecl_ref): Declare.
2038         * lto.c (lto_resolve_typedecl_ref): New function.
2039
2040 2007-10-29  Mark Mitchell  <mark@codesourcery.com>
2041             Nathan Froyd  <froydnj@codesourcery.com>
2042
2043         * lto.c (lto_read_subroutine_type_subprogram_DIE): Read the child
2044         DIEs even if we find an abstract origin for this DIE.
2045
2046 2007-10-29  Nathan Froyd  <froydnj@codesourcery.com>
2047
2048         * lto.c (lto_read_subroutine_type_subprogram_DIE): Build the
2049         RESULT_DECL slightly earlier.  Only remember the decl for later
2050         if we successfully merge declarations.
2051
2052 2007-10-24  Kenneth Zadeck <zadeck@naturalbridge.com>
2053
2054         * lto-read.c (input_expr_operand): Give label_values the proper
2055         context and provide switch statements with a default type.
2056         
2057 2007-10-23  Nathan Froyd  <froydnj@codesourcery.com>
2058
2059         * lto-read.c (lto_read_body): Move call to init_ssa_operands...
2060         * lto.c (lto_materialize_function): ...to here.
2061
2062 2007-10-22  Nathan Froyd  <froydnj@codesourcery.com>
2063
2064         * lto.h (struct lto_info_fd): Add field unmaterialized_fndecls.
2065         * lto.c (lto_info_fd_init): Initialize it.
2066         (lto_info_fd_close): Free it.
2067         (lto_materialize_function): New function.
2068         (lto_read_subroutine_type_subprogram_DIE): Save the result decl on
2069         unmaterialized_fndecls.
2070         (lto_file_read): Read in all the function bodies after we have read
2071         all of the DWARF info.
2072         * lto-read.c (lto_read_body): Call init_ssa_operands if we are
2073         reading a function body.
2074
2075 2007-10-20  Kenneth Zadeck <zadeck@naturalbridge.com>
2076
2077         * lto-read.c (input_tree_flags): Renamed from input_flags to be
2078         semetric with output_tree_flags.  Added call to log flags.
2079         (process_tree_flags): Renamed from process_flags.  Fixed a lot of
2080         type issues to make everything consistent with flags being
2081         unsigned HOST_WIDE_INTS.
2082         (input_expr_operand): Added call to
2083         recompute_tree_invariant_for_addr_expr.
2084         (input_local_var): Added debugging for tree_chains.  Now calls
2085         input_tree_flags.
2086         (input_phi): Made flags unsigned HOST_WIDE_INT.
2087         (input_ssa_names): Now calls input_tree_flags.
2088         (lto_read_body): Now sets cfun.
2089         (lto_read_function_body): Now sets current_function_pointer.
2090         
2091 2007-10-19  Nathan Froyd  <froydnj@codesourcery.com>
2092
2093         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Check
2094         definitively whether SPECIFICATION or ABSTRACT_ORIGIN exist before
2095         inspecting fields within.
2096         (lto_read_DIE_at_ptr): Delete check for null result; let callers
2097         handle this appropriately.
2098
2099 2007-10-19  Nathan Froyd  <froydnj@codesourcery.com>
2100
2101         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Handle
2102         DW_AT_abstract_origin properly.  Ensure that we're not dealing with
2103         both DW_AT_abstract_origin and DW_AT_specification.
2104         (lto_read_subroutine_type_subprogram_DIE): Handle
2105         DW_AT_abstract_origin.
2106         (lto_read_DIE): Use lto_read_only_for_child_DIEs for labels.
2107         (lto_read_DIE_at_ptr): Define as static to match declaration.
2108         Lookup the PTR in the cache before reading it from the file.
2109         (lto_resolve_var_ref): Adjust accordingly.
2110         (lto_resolve_fn_ref): Adjust accordingly.  Tweak comment.
2111         (lto_resolve_field_ref): Adjust accordingly.  Tweak comment.
2112
2113 2007-10-19  Nathan Froyd  <froydnj@codesourcery.com>
2114
2115         * lto.c (lto_read_DIE_at_ptr): New function.
2116         (lto_resolve_var_ref): Use it.
2117         (lto_resolve_fn_ref): Use it.
2118         (lto_resolve_field_ref): Use it.
2119         (lto_read_variable_formal_parameter_constant_DIE): Follow
2120         DW_AT_specification and return the associated decl when appropriate.
2121
2122 2007-10-18  Nathan Froyd  <froydnj@codesourcery.com>
2123
2124         * lto-lang.c (lto_type_for_mode): Move after lto_type_for_size.
2125         Implement for scalar integer modes.
2126         (lto_init): Initialize size_type_node.
2127
2128 2007-10-18  Kenneth Zadeck <zadeck@naturalbridge.com>
2129
2130         * lto-read.c (input_expr_operand): Remove ssa name asserts.
2131         (input_local_var): Add chaining for params.
2132         (input_ssa_names): Add cfun parameter.
2133         (input_function): Remove unnecessary else.
2134
2135 2007-10-17  Nathan Froyd  <froydnj@codesourcery.com>
2136
2137         * lto.c (lto_read_only_for_child_DIEs): Mark die parameter as unused.
2138         (lto_resolve_var_ref): Use proper types.
2139         (lto_resolve_fn_ref): Likewise.
2140         (lto_resolve_field_ref): Likewise.
2141
2142 2007-10-17  Nathan Froyd  <froydnj@codesourcery.com>
2143
2144         * lto-read.c (input_expr_operand): Remove case.
2145
2146 2007-10-17  Nathan Froyd  <froydnj@codesourcery.com>
2147
2148         * lto.c (lto_read_only_for_child_DIEs): New function.
2149         (lto_read_DIE): Use it for lexical_block and inlined_subroutine DIEs.
2150         * lto-elf.c (lto_elf_map_lto_section): Remove.
2151         (lto_elf_file_vtable): Use lto_elf_map_optional_lto_section instead.
2152         * lto-read.c (input_expr_operand): Assert that we never read a NULL
2153         SSA_NAME.  Add missing case for mechanical codes.
2154         (input_cfg): Use basic_block_info_for_function instead of
2155         basic_block_info.
2156
2157 2007-10-16  Kenneth Zadeck <zadeck@naturalbridge.com>
2158
2159         * lto-read.c (input_sleb128, input_integer): Use proper casts.
2160         (input_list): Renamed input_tree_list and modified to follow same
2161         protocol as lto-function-out.c:output_tree_list.
2162         (input_expr_operand): Make asm operands use input_tree_list.
2163         (input_local_var): Now uses input_tree_list.
2164         (lto_read_body): Change placement for setting context of debug_labels.
2165         
2166         
2167 2007-10-16  Kenneth Zadeck <zadeck@naturalbridge.com>
2168
2169         * lto-read.c (input_real): Output debugging in proper order.
2170         (input_integer): Compute bit lengths properly.
2171         (input_list): Clean up declaration.
2172         (input_expr_operand): Change calls to input_real to match fix.
2173         Make reading of LTO_bit_field_ref1 match output.
2174         (input_local_var): Make reading of attributes match what is being
2175         written.
2176         (dump_debug_stream): Also print char in hex.
2177         (debug_out_fun): Fix signed unsigned mismatch.
2178         
2179 2007-10-10  Nathan Froyd  <froydnj@codesourcery.com>
2180
2181         * lto.c (lto_read_form): Handle DW_AT_MIPS_linkage_name and
2182         DW_AT_GNU_vector specially, as they are not contiguous with the
2183         specified set of attribute names.  Use class_mask to check for
2184         errors at the end of the function
2185         (lto_resolve_var_ref): Read the DIE if it is not cached.
2186         (lto_resolve_fn_ref): Likewise.
2187         (lto_resolve_field_ref): Likewise.
2188
2189 2007-10-05  Nathan Froyd  <froydnj@codesourcery.com>
2190
2191         * lto.c: Include dwarf2out.h.
2192         (lto_cache_store_DIE): Assert that we never change the value.
2193         (LTO_BEGIN_READ_ATTRS): Print an informative error message.
2194         (lto_read_compile_unit_DIE): Handle DW_AT_entry_pc.
2195         (lto_read_array_type_DIE): Don't error on ndims == 0; build a
2196         sensible type instead.
2197         (lto_read_structure_union_class_type_DIE): Store the newly
2198         created type prior to reading the members of the structure to
2199         avoid infinite recursion.  Avoid computing types and alignments
2200         for structures whose sizes are unknown.
2201         (lto_read_variable_formal_parameter_const): Handle DW_AT_artificial
2202         and set DECL_ARTIFICIAL accordingly.  Ignore DW_AT_abstract_origin,
2203         DW_AT_const_value, and DW_AT_specification.
2204         (lto_read_subroutine_type_subprogram_DIE): Handle DW_AT_declaration.
2205         Return early if we have already constructed the function type.
2206         (lto_read_typedef_DIE): Check to see if the type has been cached
2207         already.  Cache the type before reading any children.
2208         (lto_read_const_volatile_restrict_type_DIE): Handle DW_AT_name.
2209         (lto_read_DIE): Unset context->skip_non_parameters around reading
2210         the DIE.
2211         (lto_resolve_fn_ref): Delete trailing whitespace.
2212
2213 2007-09-11  Kenneth Zadeck <zadeck@naturalbridge.com>
2214
2215         * lto-read.c (input_expr_operand): Added type for STRING_CST.
2216         
2217 2007-09-10  Nathan Froyd  <froydnj@codesourcery.com>
2218
2219         * lto-read.c (lto_read): Set the type of the newly created CALL_EXPR.
2220
2221 2007-09-07  Nathan Froyd  <froydnj@codesourcery.com>
2222
2223         * lto-lang.c (signed_and_unsigned_types): New variable.
2224         (lto_type_for_size): Consult signed_and_unsigned_types to find
2225         an approprite type, creating it if necessary.
2226         (lto_set_decl_assembler_name): Add actual method body.
2227
2228 2007-09-06  Jim Blandy  <jimb@codesourcery.com>
2229
2230         * lto.c (lto_read_variable_formal_parameter_constant_DIE): If we
2231         can't find a var init for this variable, leave its DECL_INITIAL.
2232         * lto-elf.c (lto_elf_map_optional_lto_section): Renamed from
2233         lto_elf_map_fn_body.
2234         (lto_map_lto_section): New function.
2235         (lto_elf_file_vtable): Use lto_elf_map_lto_section for function
2236         bodies, and lto_elf_map_optional_lto_section for variable
2237         initializers.
2238         (lto_elf_find_section_data): Quietly return NULL if the section is
2239         missing.
2240         (lto_elf_file_open): Check for a NULL from lto_elf_find_section_data.
2241
2242         * lto-elf.c (lto_elf_find_section_data): Remove dead code.
2243
2244         * lto-read.c (lto_read_body): Doc fix.
2245
2246 2007-08-29  Kenneth Zadeck <zadeck@naturalbridge.com>
2247
2248         * lto-read.c (fun_in): Renamed to data_in.
2249         (input_expr_operand, input_local_var, input_string_internal,
2250         input_string, input_real, input_list, get_label_decl, 
2251         get_type_ref, input_expr_operand, input_globals, input_labels,
2252         input_local_vars_index, input_local_var, input_local_vars, 
2253         input_cfg, input_phi, input_ssa_names, input_bb, ): Renamed fun_in to data_in.
2254         (input_constructor): New function.
2255         (lto_read_function_body): Renamed to lto_read_body and generalized
2256         to handle both functions and constructors.
2257         (lto_read_function_body, lto_read_var_init): New function.
2258         
2259         
2260 2007-08-28  Kenneth Zadeck <zadeck@naturalbridge.com>
2261
2262         * lto-read.c (input_expr_operand): Assert that there really is a
2263         FUNCTION_DECL.
2264         (input_globals): Removed checks on 0 section.
2265         
2266 2007-08-28  Kenneth Zadeck <zadeck@naturalbridge.com>
2267
2268         * lto-read.c (fun_in): Added local_decls_index and
2269         local_decls_index_d.  
2270         (input_expr_operand): Changed inputting of PARM_DECLs and VAR_DECLs.
2271         (input_globals): Enabled code to handle FIELD_DECLs.
2272         (input_local_vars_index, input_local_vars): New function.
2273         (input_local_var): Changed to allow locals to be input randomly.
2274         (lto_read_function_body): Added code to input the
2275         local_decls_index and to free various structures.
2276         
2277 2007-08-17  Jim Blandy  <jimb@codesourcery.com>
2278
2279         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Remove
2280         ATTRIBUTE_UNUSED from 'die' formal.
2281
2282         Use enum LTO_tags where appropriate, instead of 'unsigned int'.
2283         * lto-read.c (input_record_start): Fix return type, type of 'tag'.
2284         (input_list): Fix type of 'tag'.
2285         (input_expr_operand): Fix type of 'tag' argument.  Update
2286         declaration.  Fix type of 'ctag'.  Add default case to switch,
2287         since the type of the switched value is now an enum.
2288         (input_local_vars): Fix type of 'tag'.
2289         (input_bb): Fix type of 'tag' argument.
2290         (input_function): Fix type of 'tag' argument.
2291
2292 2007-08-16  Jim Blandy  <jimb@codesourcery.com>
2293
2294         * lto.c (lto_read_member_DIE): Record the tree we create in
2295         fd->die_cache.  (Our 'die' argument is no longer unused.)
2296         (lto_resolve_field_ref): New function.
2297         * lto.h (lto_resolve_field_ref): New declaration.
2298
2299 2007-08-15  Jim Blandy  <jimb@codesourcery.com>
2300
2301         * lto-read.c (lto_read_var_init): Mark arguments as unused.
2302
2303 2007-08-07  Jim Blandy  <jimb@codesourcery.com>
2304
2305         * lto.c (lto_read_form): Complete attr_classes table.
2306         (DWARF2_form_data): Doc fix.
2307         
2308 2007-08-05  Mark Mitchell  <mark@codesourcery.com>
2309
2310         * lto.h (lto_file_vtable): Remove read_var_init.  Add map_var_init
2311         and unmap_var_init.
2312         (lto_read_var_init): Declare.
2313         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Use new
2314         interface for reading variable initializers.
2315         * lto-elf.c (lto_elf_read_var_init): Remove.
2316         (lto_elf_file_vtable): Update initializer.
2317         (lto_elf_read_var_init): Add comment about unused-ness.
2318         * lto-read.c (lto_read_var_init): New.
2319
2320         * lto.c (lto_read_form): Add entry for DW_AT_inline.
2321
2322 2007-08-02  Kenneth Zadeck <zadeck@naturalbridge.com>
2323
2324         * lto-read.c (lto_read_function_body): Moved declaration of fn
2325         outside of ifdef.
2326         
2327 2007-08-01  Kenneth Zadeck <zadeck@naturalbridge.com>
2328
2329         * lto-read.c (input_uleb128, input_string_internal, input_real,
2330         input_integer, input_record_start, input_list, get_type_ref,
2331         input_flags, input_expr_operand, input_expr_operand,
2332         input_expr_operand, input_local_vars, input_cfg, input_phi,
2333         input_ssa_names, input_bb, input_function): Added semicolons.
2334
2335         
2336 2007-07-31  Kenneth Zadeck <zadeck@naturalbridge.com>
2337
2338         * lto-read.c (input_globals): Remove debugging.
2339         (input_function): Set DECL_ARGUMENTS.
2340
2341         
2342 2007-07-31  Kenneth Zadeck <zadeck@naturalbridge.com>
2343
2344         * lto-read.c (input_expr_operand): Fixed code for COND_EXEC,
2345         RETURN_EXPR, MODIFY_EXPR and processing of flags.
2346         (input_phi): Made work with operands other than SSA_NAMES and
2347         fixed processing of flags.
2348         (input_ssa_names): Initialize SSA_NAME_DEF_STMT to empty stmt.
2349         (input_flags): New function.
2350         * lto-lang.c (lto_init): Changed state of in_lto_p.
2351         
2352         
2353 2007-07-24  Mark Mitchell  <mark@codesourcery.com>
2354
2355         * lto-tree.h (lto_varargs_cookie): Remove.
2356         * lto.c (lto_context): Add last_parm_type, varargs_p, skip_all,
2357         skip_non_parameters, skip_parameters.
2358         (lto_varargs_cookie): Remove.
2359         (lto_read_variable_formal_parameter_constant_DIE): Keep track of
2360         parameter types.
2361         (lto_read_abbrev): New function.
2362         (lto_read_subroutine_type_subprogram_DIE): Make two passes over
2363         child DIEs.
2364         (lto_read_unspecified_parameters_DIE): Set context->varargs_p.
2365         (lto_read_DIE): Use lto_read_abbrev.  Honor skip_* flags.
2366         (lto_file_read): Initialize new context fields.
2367         * lto-lang.c (lto_type_for_mode): Return NULL_TREE.
2368         (lto_unsigned_type): Remove.
2369         (lto_signed_type): Likewise.
2370         (lto_signed_or_unsigned_type): Likewise.
2371         (lto_init): Do not create lto_varargs_cookie.
2372         (LANG_HOOKS_UNSIGNED_TYPE): Do not define.
2373         (LANG_HOOKS_SIGNED_TYPE): Likewise.
2374         (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Likewise.
2375
2376 2007-07-19  Jan Hubicka  <jh@suse.cz>
2377
2378         * lto-read.c (lto_read_function_body): Produce empty scope block
2379         to avoid crash.
2380
2381 2007-07-18  Mark Mitchell  <mark@codesourcery.com>
2382
2383         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Do not
2384         process local variables.
2385         (lto_read_subroutine_type_subprogram_DIE): Read child DIEs.
2386
2387 2007-07-13  Kenneth Zadeck <zadeck@naturalbridge.com>
2388
2389         * lto-read.c (input_list, input_expr_operand): Added struct
2390         function parameter.
2391         (init_cfg, finalize_cfg): Removed function.
2392         (input_expr_operand): Added SSA_NAME and GIMPLE_MODIFY_STMT cases.
2393         (input_labels, input_local_vars): Now takes input_block parameter rather than
2394         synthsyzing it.
2395         (input_cfg, input_phi, input_ssa_names): New functions.
2396         (input_bb): Now passes in input_blocks.  Does not construct cfg
2397         and processes the list of phi functions.
2398         (input_function): Now builds both the cfg and ssa_names table.
2399         (lto_read_function_body): Processes new header fields to construct
2400         streams for the ssa_names and cfg and their debugging.
2401         * lto/lto-lang.c (lto_init): Set in_lto_p.
2402         
2403         
2404 2007-06-28  Mark Mitchell  <mark@codesourcery.com>
2405
2406         * lto.h (lto_file_vtable): Add read_var_init.
2407         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Read
2408         initializers.
2409         (lto_main): Remove bogus asserts.
2410         * lto-elf.c (tm.h): Include it.
2411         (libiberty.y): Likewise.
2412         (lto_elf_file): Add strtab and symtab.  Rename
2413         string_table_section_index to sec_strtab.
2414         (lto_elf_file_vtable): Add lto_elf_read_var_init.
2415         (lto_elf_get_shdr): New function.
2416         (lto_elf_free_shdr): Likewise.
2417         (lto_elf_find_section_data): Use them.
2418         (lto_elf_read_symtab): New function.
2419         (lto_elf_lookup_sym): Likewise.
2420         (lto_elf_free_sym): Likewise.
2421         (lto_elf_file_open): Tidy.  Call lto_elf_read_symtab.
2422         (lto_elf_built_init): New function.
2423         (lto_elf_read_var_init): Likewise.
2424         * Make-lang.in (lto/lto-elf.o): Depend on $(TM_H).
2425
2426 2007-06-26  Kenneth Zadeck <zadeck@naturalbridge.com>
2427
2428         * lto-read (make_new_block): Initialize the stmt_list.
2429         (lto_static_init_local): Add debugging for missing codes.
2430         
2431 2007-06-26  Mark Mitchell  <mark@codesourcery.com>
2432
2433         * lto.c (lto_read_subroutine_type_subprogram_DIE): Handle
2434         unprototyped functions. 
2435
2436 2007-06-23  Mark Mitchell  <mark@codesourcery.com>
2437
2438         * lto.c (lto_read_variable_formal_parameter_constant_DIE):
2439         Handle DW_AT_MIPS_linkage_name.
2440         (lto_read_subroutine_type_subprogram): Likewise.  Correct
2441         compilation errors.
2442         (lto_main): Remove incorrect assertions.
2443         * lto-symbtab.c: Build function types out of TREE_LISTs.
2444
2445         * lto-elf.c (<libelf>): Check for HAVE_LIBELF_H.
2446         
2447         * Make-lang.in (LTO_OBJS): Depend on attribs.o.
2448         
2449 2007-06-21  Kenneth Zadeck <zadeck@naturalbridge.com>
2450
2451         * lto/lto-tree.h (lang_decl, lang_type, language_function): Added
2452         dummy since ggc does not like empty structs.
2453         * lto/lto-elf.c (libelf.h): Changed to libelf/libelf.h.
2454         * lto/lto-read.c (ADD_CLASS_FLAG, ADD_EXPR_FLAG): Changed
2455         expr->common to expr->base.
2456         (make_new_block): Moved stmt_list to proper place.
2457
2458
2459 2007-03-14 Robert Kennedy  <jimbob@google.com>
2460
2461         Eliminate use of lang_hooks.set_decl_assembler_name from LTO
2462         * lto.c (lto_read_subroutine_type_subprogram_DIE) Get DECL
2463         assembler name from DWARF.
2464         * lto-lang.c (lto_set_decl_assembler_name) New function.
2465
2466 2006-09-10  Mark Mitchell  <mark@codesourcery.com>
2467
2468         * lto.h (lto_file_vtable): New structure.
2469         (lto_file): Add vtable pointer.
2470         (lto_file_init): Add vtable paramter.
2471         (lto_read_function_body): New function.
2472         (lto_symtab_merge_fn): New function.
2473         * lto.c (lto_file_init): Add vtable parameter.
2474         (lto_read_form): Fill in entries for DW_AT_prototyped,
2475         DW_AT_frame_base.
2476         (lto_read_subroutine_type_subprogram_DIE): New function.
2477         (lto_read_DIE): Fill in entries for DW_TAG_subroutine_type and
2478         DW_TAG_subprogram.
2479         * lto-elf.c (lto_elf_vile_vtable): New variable.
2480         (lto_elf_file_open): Pass it to lto_file_init.
2481         (lto_elf_map_fn_body): New function.
2482         (lto_elf_unmap_fn_body): Likewise.
2483         * lto-read.c: New file.
2484         * lto-symtab.c (lto_symtab_merge_fn): New function.
2485         * lto-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Define to
2486         tree_rest_of_compilation.
2487         * Make-lang.in (LTO_OBJS): Add lto-read.o
2488         (lto-read.o): New target.
2489
2490 2006-09-03  Mark Mitchell  <mark@codesourcery.com>
2491
2492         * lto.c (<inttypes.h>): Don't include it.
2493         (lto_context): Don't typedef it.
2494         (lto_resolve_reference): New function.
2495         (lto_read_form): Use it.
2496         (lto_resolve_type_ref): New function.
2497         (lto_resolve_var_ref): Likewise.
2498         (lto_resolve_fn_ref): Likewise.
2499         * lto.h (<inttypes.h>): Include it.
2500         (lto_context): New type.
2501         (lto_ref): New structure.
2502         (lto_resolve_type_ref): Declare.
2503         (lto_resolve_var_ref): Likewise.
2504         (lto_resolve_fn_ref): Likewise.
2505
2506 2006-08-18  Mark Mitchell  <mark@codesourcery.com>
2507
2508         * lang-specs.h: New file.
2509
2510 2006-08-14  Mark Mitchell  <mark@codesourcery.com>
2511
2512         * lto.c (lto_info_fd_init): Allocate the DIE cache.
2513         (lto_info_fd_close): Deallocate it.
2514         (lto_die_cache_entry): New structure.
2515         (lto_cache_hash): New function.
2516         (lto_cache_eq): Likewise.
2517         (lto_cache_store_DIE): Likewise.
2518         (lto_cache_lookup_DIE): Likewise.
2519         (lto_read_referenced_type_DIE): Use the cache.
2520         (lto_read_pointer_type_DIE): Robustify.
2521         (lto_read_DIE): Use the cache.
2522         * lto.h (hashtab.h): Include.
2523         (lto_info_fd): Add DIE cache.
2524         * Make-lang.in (LTO_H): New variable.
2525         (lto/lto-lang.o): Use LTO_H.
2526         (lto/lto-elf.o): Likewise.
2527         (lto/lto-symtab.o): Likewise.
2528
2529 2006-07-09  Mark Mitchell  <mark@codesourcery.com>
2530
2531         * lto.c (lto_abi_mismatch_error): New function.
2532         (lto_abbrev_read): Initialize num_abbrevs.
2533         (lto_read_form): Specify allowed form classes for
2534         DW_AT_declaration.  Adjust for change to lto_set_cu_context.
2535         (lto_read_variable_formal_parameter_constant_DIE): Handle
2536         DW_AT_declaration.  Call lto_symtab_merge_var.
2537         (lto_read_pointer_type_DIE): New function.
2538         (lto_read_base_type_DIE): Use build_nonstandard_integer_type.  Do
2539         not creat TYPE_DECLs for types that already have them.
2540         (lto_read_DIE): Add lto_read_pointer_type_DIE.
2541         (lto_set_cu_context): Make cu_start point to the header, not the
2542         first DIE.
2543         (lto_file_read): Adjust for change to lto_set_cu_context.
2544         * Make-lang.in (LTO_OBJS): Add lto-symtab.o.
2545         (lto/lto-symtab.o): New rule.
2546         * lto-tree.h (lang_identifier): Add decl field.
2547         (LANG_IDENTIFIER_CAST): New macro.
2548         (LTO_IDENTIFIER_DECL): Likewise.
2549         (lto_symtab_merge_var): Declare.
2550         * lto-symtab.c: New file.
2551
2552 2006-07-02  Daniel Berlin  <dberlin@dberlin.org>
2553
2554         * lto.c (lto_context): Add current_cu and info_fd members.
2555         (DWARF2_CompUnit): New structure.
2556         (lto_read_DIE): Take lto_info_fd *.
2557         (lto_read_child_DIEs): Ditto.
2558         (lto_file_corrupt_error): Constify argument.
2559         (lto_set_cu_context): New function
2560         (lto_info_fd_init): Ditto.
2561         (lto_info_fd_close): Ditto.
2562         (lto_file_init): Use lto_info_fd_init.
2563         (lto_file_close): Use lto_info_fd_close.
2564         (lto_read_initial_length): Pass in pointer to header size.
2565         (lto_read_comp_unit_header): Correct cu_length to
2566         real length from beginning of header.  Take lto_info_fd * as
2567         argument.
2568         (find_cu_for_offset): New function.
2569         (lto_read_form): Change first argument to lto_info_fd *.
2570         Add FORM_CONTEXT argument.
2571         Handle DW_FORM_ref_addr.
2572         (lto_read_tag_DIE): Change first argument to lto_info_fd *.     
2573         (LTO_BEGIN_READ_ATTRS_UNCHECKED): Save old context.
2574         Swap contexts if necessary for form.
2575         (LTO_BEGIN_READ_ATTRS): Cast fd to right type for
2576         lto_file_corrupt_error.
2577         (LTO_END_READ_ATTRS): Swap contexts back if it had changed.
2578         (lto_read_referenced_type_DIE): Change first argument to
2579         lto_info_fd *.  Access lto_fd fields through base pointer.
2580         (lto_read_compile_unit_DIE): Change first argument to an
2581         lto_info_fd *.
2582         (lto_read_variable_formal_parameter_constant_DIE): Ditto.
2583         (lto_read_base_type_DIE): Ditto.
2584         (lto_read_child_DIEs): Ditto.
2585         (lto_read_DIE): Ditto.  Change type of function pointer.
2586         (lto_info_read): New function.
2587         (lto_set_cu_context): Ditto.
2588         (lto_file_read): Use lto_info_read, walk resulting CU's
2589         (lto_main): Update for lto_info_fd change.
2590         * lto-elf.c (lto_elf_file_open): Cast lto_info_fd to lto_fd where
2591         necessary.
2592         * lto.h (DWARF2_CompUnit): New structure.
2593         (lto_info_fd): Ditto.
2594         (lto_file): Change debug_info to be an lto_info_fd.
2595         
2596 2006-06-25  Mark Mitchell  <mark@codesourcery.com>
2597
2598         * lto.c (toplev.h): Include it.
2599         (dwarf2.h): Likewise.
2600         (tree.h): Likewise.
2601         (tm.h): Likewise.
2602         (cgraph.h): Likewise.
2603         (ggc.h): Likewise.
2604         (inttypes.h): Likewise.
2605         (DWARF2_attr): New type.
2606         (DWARF2_abbrev): Likewise.
2607         (DWARF2_class): Likewise.
2608         (DWARF2_form_data): Likewise.
2609         (lto_context): Likewise.
2610         (lto_fd_init): New function.
2611         (lto_abbrev_fd_init): Likewise.
2612         (lto_abbrev_fd_close): Likewise.
2613         (lto_file_init): Use them.
2614         (lto_file_close): New function.
2615         (lto_file_corrupt_error): Likewise.
2616         (LTO_CHECK_INT_VAL): New macro.
2617         (lto_check_size_t_val): New function.
2618         (lto_check_int_val): Likewise.
2619         (LTO_READ_TYPE): New macro.
2620         (lto_read_ubyte): New function.
2621         (lto_read_uhalf): Likewise.
2622         (lto_read_uword): Likewise.
2623         (lto_read_uleb128): Likewise.
2624         (lto_read_initial_length): Likewise.
2625         (lto_abbrev_read_attrs): Likewise.
2626         (lto_abbrev_read): Likewise.
2627         (lto_abbrev_lookup): Likewise.
2628         (lto_read_section_offset): Likewise.
2629         (lto_read_comp_unit_header): Likewise.
2630         (lto_read_form): Likewise.
2631         (LTO_BEGIN_READ_ATTRS_UNCHECKED): New macro.
2632         (LTO_BEGIN_READ_ATTRS): Likewise.
2633         (LTO_END_READ_ATTRS): Likewise.
2634         (lto_unsupported_attr_error): New function.
2635         (lto_get_identifier): Likewise.
2636         (lto_read_referenced_type_DIE): Likewise.
2637         (lto_read_compile_unit_DIE): Likewise.
2638         (lto_read_variable_formal_parameter_constant_DIE): Likewise.
2639         (lto_read_base_type_DIE): Likewise.
2640         (lto_read_DIE): Likewise.
2641         (lto_read_child_DIEs): Likewise.
2642         (lto_file_read): Read DIEs.
2643         (lto_main): Ask middle end to emit entities.
2644         * lto-tree.h (lang_identifier): Inherit from tree_identifier.
2645         * lto-elf.c (lto_elf_file_open): Adjust for interface changes.
2646         (lto_elf_file_close): Likewise.
2647         * lto.h (lto_file): Declare.
2648         (DWARF2_abbrev): Likewise.
2649         (lto_fd): New type.
2650         (lto_abbrev_fd): Likewise.
2651         (lto_file): Use new types.
2652         (lto_file_close): Declare.
2653         * lto-lang.c (lto_init): Always use unit-at-a-time mode.
2654         
2655 2006-06-18  Mark Mitchell  <mark@codesourcery.com>
2656
2657         * lto.h: New file.
2658         * lto.c: New file.
2659         * lto-elf.c: New file.
2660         * lto-lang.c (flags.h): Include it.
2661         (lto.h): Likewise.
2662         (lto_init): New function.
2663         (lto_write_globals): Remove.
2664         (LANG_HOOKS_WRITE_GLOBALS): Define to lhd_do_nothing. 
2665         (LANG_HOOKS_INIT): Define.
2666         (LANG_HOOKS_PARSE_FILE): Likewise.
2667         * Make-lang.in (LTO_OBJS): Add lto.o and lto-elf.o.
2668         (LTO_EXE): Link with libelf.
2669         (lto/lto-lang.o): Update dependencies.
2670         (lto/lto.o): New target.
2671         (lto/lto-elf.o): Likewise.
2672
2673 2006-06-12  Mark Mitchell  <mark@codesourcery.com>
2674
2675         * config-lang.in: New file.
2676         * Make-lang.in: Likewise.
2677         * lto-tree.h: Likewise.
2678         * lto-lang.c: Likewise.
2679