]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/lto/ChangeLog
2011-06-11 Jonathan Wakely <jwakely.gcc@gmail.com>
[thirdparty/gcc.git] / gcc / lto / ChangeLog
CommitLineData
bbcef2a7 12011-06-07 Diego Novillo <dnovillo@google.com>
2
3 * lto.c (uniquify_nodes): Move code to register decls to
4 the loop that computes canonical types.
5
1af0124d 62011-06-07 Richard Guenther <rguenther@suse.de>
7
8 * lto-lang.c (lto_init): Do not set
9 size_type_node or call set_sizetype.
10
a0605d65 112011-06-04 Diego Novillo <dnovillo@google.com>
12
13 * lto.c (lto_init): New.
14 (lto_main): Call it.
15
f05c9dfb 162011-06-03 Diego Novillo <dnovillo@google.com>
17
18 * lto.c (get_resolution): Move from lto-streamer-in.c.
19 (lto_register_var_decl_in_symtab): Likewise.
20 (lto_register_function_decl_in_symtab): Likewise.
21 (uniquify_nodes): Call lto_register_var_decl and
22 lto_register_function_decl_in_symtab after reading a new
23 VAR_DECL or FUNCTION_DECL.
24
ed61b909 252011-06-01 Richard Guenther <rguenther@suse.de>
26
27 * lto-lang.c (lto_register_canonical_types): New function.
28 (lto_init): Register common nodes with the canonical type machinery.
29 Do not play tricks with char_type_node.
30
8f2b914f 312011-05-26 Richard Guenther <rguenther@suse.de>
32
33 * lto.c (uniquify_nodes): Fix bug in one of the previous changes.
34
1e184c62 352011-05-25 Nathan Froyd <froydnj@codesourcery.com>
36
37 * lto.c (lto_ft_typed): New function.
38 (lto_ft_common): Call it.
39 (lto_ft_constructor): Likewise.
40 (lto_ft_expr): Likewise.
41 (lto_fixup_prevailing_decls): Check for TS_COMMON before accessing
42 TREE_CHAIN.
43
4d83607a 442011-05-20 Richard Guenther <rguenther@suse.de>
45
46 * lto.c (lto_ft_common): Remove pointer-to chain teardown.
47 (lto_ft_type): Move main-variant and pointer-to chain building ...
48 (uniquify_nodes): ... here. Compute TYPE_CANONICAL also here,
49 in a separate final loop.
50
bddb3763 512011-05-19 Richard Guenther <rguenther@suse.de>
52
53 * lto.c (uniquify_nodes): First register all types before
54 fixing up the tree SCC.
55
c6641d23 562011-05-11 Jan Hubicka <jh@suse.cz>
57
58 PR lto/48952
59 * lto.c (do_whole_program_analysis): Do not register cgraph hooks.
60
8f2eb9e1 612011-05-11 Nathan Froyd <froydnj@codesourcery.com>
62
63 * lto.c (lto_ft_type): Use TYPE_MINVAL and TYPE_MAXVAL. Adjust
64 location of binfo field.
65 (lto_fixup_prevailing_decls): Likewise.
66
3a939d12 672011-05-10 Nathan Froyd <froydnj@codesourcery.com>
68
69 * lto-lang.c (def_fn_type): Don't call build_function_type, call
70 build_function_type_array or build_varargs_function_type_array
71 instead.
72
1d2bb655 732011-05-07 Eric Botcazou <ebotcazou@adacore.com>
74
75 * lto-lang.c (global_bindings_p): Return bool.
76
91bf9d9a 772011-05-07 Jan Hubicka <jh@suse.cz>
78
56bef313 79 * lto.c (lto_materialize_function): Use
80 cgraph_function_with_gimple_body_p.
81 (add_cgraph_node_to_partition): Do not re-add items to partition;
82 handle thunks.
91bf9d9a 83 (add_varpool_node_to_partition): Do not re-add items to partition.
84
423ba805 852011-05-03 Jan Hubicka <jh@suse.cz>
86
87 * lto.c (free_ltrans_partitions): Fix accidental commit.
88
19ad01f7 892011-05-03 Jan Hubicka <jh@suse.cz>
90
91 * lto.c (ltrans_partition_def): Remove GTY annotations.
92 (ltrans_partitions): Move to heap.
93 (new_partition): Update.
94 (free_ltrans_partitions): New function.
95 (lto_wpa_write_files): Use it.
96
7771d558 972011-04-29 Martin Jambor <mjambor@suse.cz>
98
99 * lto.c: Include ipa-utils.h.
100 (lto_balanced_map): Update call to ipa_reverse_postorder.
101 * Make-lang.in (lto/lto.o): Add IPA_UTILS_H to dependencies.
102
d534cab0 1032011-04-29 Michael Matz <matz@suse.de>
104
105 * lto.c (toplevel): Include tree-flow.h.
106 (lto_read_in_decl_state): Don't merge types here.
107 (tree_with_vars): New static hash table.
108 (remember_with_vars): New static functions.
109 (LTO_FIXUP_TYPE): New macro.
110 (lto_ft_common, lto_ft_decl_minimal, lto_ft_decl_common,
111 lto_ft_decl_with_vis, lto_ft_decl_non_common, lto_ft_function,
112 lto_ft_field_decl, lto_ft_type, lto_ft_binfo, lto_ft_constructor,
113 lto_ft_expr, lto_fixup_types, uniquify_nodes): New static functions.
114 (lto_read_decls): Uniquify while reading in trees.
115 (lto_fixup_data_t, LTO_FIXUP_SUBTREE,
116 LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE, no_fixup_p, lto_fixup_common,
117 lto_fixup_decl_minimal, lto_fixup_decl_common, lto_fixup_decl_with_vis,
118 lto_fixup_decl_non_common, lto_fixup_function, lto_fixup_field_decl,
119 lto_fixup_type, lto_fixup_binfo, lto_fixup_constructor,
120 lto_fixup_tree): Remove.
121 (lto_fixup_state): Remove data argument. Use
122 lto_symtab_prevailing_decl.
123 (LTO_SET_PREVAIL, LTO_NO_PREVAIL): New macros.
124 (lto_fixup_prevailing_decls): New function.
125 (lto_fixup_state_aux): Argument aux is unused.
126 (lto_fixup_decls): Don't allocate pointer sets, don't use
127 lto_fixup_tree, use lto_fixup_prevailing_decls.
128 (read_cgraph_and_symbols): Allocate and remove tree_with_vars.
129 * Make-lang.in (lto/lto.o): Depend on $(TREE_FLOW_H).
130
b630a10e 1312011-04-16 Eric Botcazou <ebotcazou@adacore.com>
132
133 * lto.c (lto_balanced_map): Fix typos in head comment.
134 (lto_promote_cross_file_statics): Fix long lines and remove redundant
135 test.
136
cbd7f5a0 1372011-04-16 Jan Hubicka <jh@suse.cz>
138
139 * lto.c (lto_balanced_map): Update.
140
c7b2cc59 1412011-04-14 Jan Hubicka <jh@suse.cz>
142
143 * lto.c: Include ipa-inline.h
b630a10e 144 (add_cgraph_node_to_partition, undo_partition): Use inline_summary
145 accessor.
c7b2cc59 146 (ipa_node_duplication_hook): Fix declaration.
147 * Make-lang.in (lto.o): Update dependencies.
148
9b88d08d 1492011-04-12 Nathan Froyd <froydnj@codesourcery.com>
150
151 * lto-tree.h (union lang_tree_node): Check for TS_COMMON before
152 calling TREE_CHAIN.
153 * lto.c (lto_fixup_common): Likewise.
154
c33080b9 1552011-04-08 Nathan Froyd <froydnj@codesourcery.com>
156
157 * lto-lang.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES.
158 (handle_type_generic_attribute): Likewise.
159
5cd33168 1602011-04-03 Michael Matz <matz@suse.de>
161
162 * lto.c (lto_materialize_function): Don't read and then discard
163 sections in WPA mode.
164 (lto_read_in_decl_state): Adjust call to lto_streamer_cache_get.
165
166 * lto-lang.c (registered_builtin_fndecls): Remove.
167 (lto_getdecls): Return NULL_TREE.
168 (lto_builtin_function): Don't remember in registered_builtin_fndecls.
169
d45127a1 1702011-03-31 Richard Guenther <rguenther@suse.de>
171
172 PR lto/48246
173 * lto.c (lto_wpa_write_files): Disable assert for non-empty
174 partitions when checking is not enabled.
175
82715bcd 1762011-03-25 Kai Tietz <ktietz@redhat.com>
177
178 * lto.c (lto_resolution_read): Use filename_cmp instead
179 of strcmp.
180 (lto_read_section_data): Likewise.
181
451c8e2f 1822011-03-25 Jeff Law <law@redhat.com>
183
184 * lto/lto-lang.c (def_fn_type): Add missing va_end.
185
ac86af5d 1862011-03-21 Kai Tietz <ktietz@redhat.com>
187
188 PR target/12171
189 * lto-lang.c (lto_attribute_table): Adjust table.
190
5a8834a5 1912011-02-18 Jakub Jelinek <jakub@redhat.com>
192
193 PR bootstrap/47807
194 * Make-lang.in (lto/lto-lang.o): Depend on $(LTO_STREAMER_H) instead
195 of lto-streamer.h.
196
30865946 1972011-02-18 Richard Guenther <rguenther@suse.de>
198
199 PR lto/47798
200 * lto-tree.h (lto_global_var_decls): Do not declare here.
201 * lto-lang.c: Include lto-streamer.h.
202 * Make-lang.in (lto-lang.o): Adjust dependencies.
203
fad71d4f 2042011-02-10 Kai Tietz <kai.tietz@onevision.com>
205
206 PR lto/47241
207 * lto.c (lto_read_section_data): Free
208 fd_name in failure case.
209 For mingw targets don't hash file-descriptor.
210 (read_cgraph_and_symbols): Close current_lto_file
211 in failure case.
212
232c9ac7 2132011-01-11 Jan Hubicka <jh@suse.cz>
214
215 PR lto/45721
216 PR lto/45375
b630a10e 217 * lto.c (partition_cgraph_node_p, partition_varpool_node_p): Weakrefs
218 are not partitioned.
232c9ac7 219
a36cf284 2202010-12-22 Nathan Froyd <froydnj@codesourcery.com>
221
222 * lto-lang.c (handle_nonnull_attribute, handle_sentinel_attribute):
223 Use prototype_p.
224
6abc14d6 2252010-12-06 Richard Guenther <rguenther@suse.de>
226
227 PR lto/46796
228 * lto-lang.c (lto_init): Give names to basic types.
229
b96c136c 2302010-11-30 Joseph Myers <joseph@codesourcery.com>
231
232 * lto-object.c: Don't include toplev.h.
233 * Make-lang.in (lto/lto-object.o): Don't depend on toplev.h.
234
92468061 2352010-11-30 Joseph Myers <joseph@codesourcery.com>
236
237 * Make-lang.in (lto/lto-object.o): Depend on toplev.h instead of
238 $(TOPLEV_H).
239
967958e4 2402010-11-29 Joseph Myers <joseph@codesourcery.com>
241
242 * lto-endian.h: Delete.
243 * lto-object.c: Don't include "libiberty.h".
244 (O_BINARY): Don't define.
245 * lto.c: Don't include "libiberty.h" or <sys/mman.h>.
246 (O_BINARY): Don't define.
247
baa6eec4 2482010-11-23 Richard Guenther <rguenther@suse.de>
249
250 * lto.c (read_cgraph_and_symbols): Remove newline from diagnostic.
251
4f3aea0d 2522010-11-23 Richard Guenther <rguenther@suse.de>
253
254 PR lto/46605
255 * lto.c (read_cgraph_and_symbols): Bail out after errors.
256
b8ba44e7 2572010-11-17 Joseph Myers <joseph@codesourcery.com>
258
259 * lto.c (lto_main): Take no arguments.
260 * lto.h (lto_main): Update prototype.
261
2e521e13 2622010-11-16 Ian Lance Taylor <iant@google.com>
263
264 * lto-object.c (lto_obj_file_open): Call
265 simple_object_attributes_merge rather than
266 simple_object_attributes_compare.
267
3c6c0e40 2682010-11-12 Joseph Myers <joseph@codesourcery.com>
269
270 * Make-lang.in (lto/lto.o): Use $(OPTS_H).
271 * lto-lang.c (lto_handle_option): Take location_t parameter.
272
bf776685 2732010-11-10 Joseph Myers <joseph@codesourcery.com>
274
275 * lto.c (lto_resolution_read): Start diagnostics with lowercase
276 letters and remove trailing '.'.
277 (lto_file_finalize): Start diagnostic with a lowercase letter.
278
e09108e1 2792010-11-02 Ian Lance Taylor <iant@google.com>
280
281 * lto-object.c: New file.
282 * lto-elf.c: Remove file.
283 * lto-macho.c: Remove file.
284 * lto-macho.h: Remove file.
285 * lto-coff.c: Remove file.
286 * lto-coff.h: Remove file.
287 * Make-lang.in (LTO_OBJS): Change lto/$(LTO_BINARY_READER).o to
288 lto/lto-object.o.
289 ($(LTO_EXE)): Remove $(LTO_USE_LIBELF)
290 (lto/lto-objfile.o): New target.
291 (lto/lto-elf.o, lto/lto-coff.o, lto/lto-macho.o): Remove targets.
292 (lto/lto.o): Remove $(LIBIBERTY_H).
293
4037a4c1 2942010-10-22 Jan Hubicka <jh@suse.cz>
295
296 * lto.c (add_cgraph_node_to_partition,
297 add_varpool_node_to_partition): Add debug info.
298 (lto_1_to_1_map, lto_balanced_map): Do not re-add already
299 partitioned nodes.
300 (do_whole_program_analysis): Set function flags before dumping.
301
7a3ccc3b 3022010-10-22 Richard Guenther <rguenther@suse.de>
303
304 * lto.c (lto_fixup_type): Fixup TYPE_CANONICAL again, via
305 the new gimple_register_canonical_type.
306
55e9d7d7 3072010-10-20 H.J. Lu <hongjiu.lu@intel.com>
308
309 PR bootstrap/45954
310 * config-lang.in (boot_language): Set to $enable_lto.
311
d63880ad 3122010-10-18 Jakub Jelinek <jakub@redhat.com>
313
314 PR lto/45638
315 * Make-lang.in (check-lto): New dummy target.
316
8e8e1ee7 3172010-10-14 Eric Botcazou <ebotcazou@adacore.com>
318
319 * lto-elf.c (SHN_XINDEX): Define if not already defined.
320
f3f006ad 3212010-10-08 Joseph Myers <joseph@codesourcery.com>
322
323 * lto-lang.c (lto_init_options): Change to
324 lto_init_options_struct. Update parameters.
325 (LANG_HOOKS_INIT_OPTIONS): Don't define.
326 (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
327
1e52cb3c 3282010-10-06 Jan Hubicka <jh@suse.cz>
329
330 * lto.c (lto_balanced_map): Fix accounting of program size.
331
11da9120 3322010-10-06 Jan Hubicka <jh@suse.cz>
333
334 * lto.c (lto_balanced_map): Do not produce empty partitions.
335
a3de1f55 3362010-10-06 Andi Kleen <ak@linux.intel.com>
337
338 * lto.c (lto_process_name): Add.
339 (lto_main): Call lto_process_name.
340
7ad28d2a 3412010-10-06 Jan Hubicka <jh@suse.cz>
342
343 * lto.c (partition_cgraph_node_p, partition_varpool_node_p): Handle
344 COMDATs required by the linker.
345
eaa13879 3462010-10-05 Ian Lance Taylor <iant@google.com>
347
348 * lto.c (lto_section_with_id): Make s a const pointer.
349
48e3ea52 3502010-10-05 Jan Hubicka <jh@suse.cz>
351
352 * lto.c: Include params.h.
353 (add_cgraph_node_to_partition, add_varpool_node_to_partition): Do
354 refcounting in aux field.
355 (undo_partition, partition_cgraph_node_p, partition_varpool_node_p):
356 New functions.
357 (lto_1_to_1_map): Simplify.
358 (lto_balanced_map): New function.
359 (do_whole_program_analysis): Chose proper partitioning alg.
360 * Make-lang.in (lto.o): Add dependency on params.h
361
70293f47 3622010-10-04 Andi Kleen <ak@linux.intel.com>
363
364 * Make-lang.in (lto1): Add + to build rule.
365
fd30d60a 3662010-10-03 Andi Kleen <ak@linux.intel.com>
367
368 * lto.c (lto_file_finalize): Replace gcc_assert for missing section
369 with fatal_error.
370
4a68fd3c 3712010-09-28 Jan Hubicka <jh@suse.cz>
372
373 * lto-lang.c (handle_leaf_attribute): New function.
374 (lto_attribute_tables): Add leaf.
375
2edfba82 3762010-09-25 Jie Zhang <jie@codesourcery.com>
377
378 * lto.c (lto_read_all_file_options): Start a new line after
379 printing out file names.
380
9ced88d0 3812010-09-24 Jan Hubicka <jh@suse.cz>
382
383 * lto.c (lto_promote_cross_file_statics): Use const_value_known_p.
384
7ae8b539 3852010-09-20 Jan Hubicka <jh@suse.cz>
386
387 PR tree-optimize/45605
388 * lto.c (lto_promote_cross_file_statics): Use const_value_known_p.
389
be1a554f 3902010-09-18 Gerald Pfeifer <gerald@pfeifer.com>
391
392 * lto-elf.c (lto_obj_file_open): Also provide filename when
393 elf_begin fails.
394
7de998de 3952010-09-17 Jan Hubicka <jh@suse.cz>
396
397 * lto.c (lto_promote_cross_file_statics): Use const_value_known.
398
78d063c8 3992010-09-17 Richard Guenther <rguenther@suse.de>
400
401 * lang.opt (flag_wpa): Also enable for the driver.
402
cdc58a66 4032010-09-16 Jan Hubicka <jh@suse.cz>
404
405 * lto.c (lto_materialize_function): Do not tamper with STATIC and
406 EXTERNAL flags.
407
7b80d28f 4082010-09-15 Laurynas Biveinis <laurynas.biveinis@gmail.com>
409
410 * lto-tree.h (struct lang_type): Add variable_size GTY option.
411
3210ebe5 4122010-09-08 Jan Hubicka <jh@suse.cz>
413
414 * lto.c (real_file_count, real_file_decl_data): New static vars.
415 (read_cgraph_and_symbols): Use it.
416
7a52b640 4172010-09-08 Richard Guenther <rguenther@suse.de>
418
419 * lto.c (read_cgraph_and_symbols): Collect again after each
420 file.
421
be147e7f 4222010-09-07 Jan Hubicka <jh@suse.cz>
423
424 * lto.c (promote_var, promote_fn): Set DECL_VISIBILITY_SPECIFIED.
425
56c34a25 4262010-09-03 Richard Guenther <rguenther@suse.de>
427
428 * lto-elf.c (validate_file): Always error if validation fails.
429
c5cc4842 4302010-08-20 Jan Hubicka <jh@suse.cz>
431
432 * lto.c (lto_1_to_1_map): Be prepared for node to have no file data.
433 (lto_wpa_write_files): Update comments.
434
9543655f 4352010-08-20 H.J. Lu <hongjiu.lu@intel.com>
436
437 PR bootstrap/45357
438 * lto.c (lto_materialize_function): Replace has_analyzed_clone
439 with has_analyzed_clone_p.
440
97b862d3 4412010-08-20 Jan Hubicka <jh@suse.cz>
442
443 * lto.c (has_analyzed_clone_p): New function
444 (lto_materialize_function): Use callgraph to determine if
445 body is needed.
446 (materialize_cgraph): Remove DECL_IS_BUILTIN check.
447
48148244 4482010-08-20 Nathan Froyd <froydnj@codesourcery.com>
449
450 * lto.c: Use FOR_EACH_VEC_ELT.
451
eb219e9c 4522010-07-27 Andi Kleen <ak@linux.intel.com>
453
454 * Make-lang.in (lto.o): Add dependency to splay-tree.h
455
b78351e5 4562010-07-27 Joseph Myers <joseph@codesourcery.com>
457
458 * lto-lang.c (lto_handle_option): Update prototype and return
459 value type. Remove duplicate assignment to result.
460
e88d34f6 4612010-07-27 Joseph Myers <joseph@codesourcery.com>
462
463 * lto-lang.c (lto_option_lang_mask, lto_complain_wrong_lang_p):
464 New.
465 (lto_init_options): Update prototype.
466 (LANG_HOOKS_OPTION_LANG_MASK, LANG_HOOKS_COMPLAIN_WRONG_LANG_P):
467 Define.
468
f18bad33 4692010-07-10 Andi Kleen <ak@linux.intel.com>
470
471 PR lto/44992
472 * lto.c: Include splay-tree.h
473 (lto_resolution_read): Change to walk file_ids tree and parse
474 extra file_id in resolution file.
475 (lto_section_with_id): Add.
476 (create_subid_section_table): Add.
477 (lwstate): Add.
478 (lto_create_files_from_ids): Add.
479 (lto_file_read): Change to handle sub file ids and create list
480 of file_datas. Add output argument for count.
481 (get_section_data): Pass file_data to lto_get_section_name.
482 (lto_flatten_file): Add.
483 (read_cgraph_and_symbols): Handle linked lists of file_datas.
484
58d9117a 4852010-07-10 Andi Kleen <ak@linux.intel.com>
486
487 * lto-coff.c (hash_name, eq_name): Move.
488 (lto_obj_build_section_table): Call lto_obj_create_section_hash_table.
489 * lto-elf.c: (hash_name, eq_name): Move.
490 (lto_obj_build_section_table): Call lto_obj_create_section_hash_table.
491 * lto-macho.c: (hash_name, eq_name): Move.
492 (lto_obj_build_section_table): Call lto_obj_create_section_hash_table.
493 * lto.c: (hash_name, eq_name): Move from lto-*.c
494 (lto_obj_create_section_hash_table): Add.
495 (free_with_string): Add.
496
0b205f4c 4972010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
498
499 * lto-coff.c: Include diagnostic-core.h in every file that
500 includes toplev.h.
501 * lto-elf.c: Likewise.
502 * lto-lang.c: Likewise.
503 * lto-macho.c: Likewise.
504
9dccd5de 5052010-07-07 Jakub Jelinek <jakub@redhat.com>
506
507 * lto-elf.c (ELFOSABI_NONE, ELFOSABI_LINUX): Define if not defined.
508 (validate_file): Allow merging of ELFOSABI_NONE with ELFOSABI_LINUX
509 objects.
510
7550e1d1 5112010-07-05 Jan Hubicka <jh@suse.cz>
512
513 * lto.c (add_cgraph_node_to_partition): Forward declare; walk also
514 nodes from same comdat group as well as all comdat functions referenced
515 here.
b630a10e 516 (add_varpool_node_to_partition, add_references_to_partition): New
517 function.
518 (lto_1_1_map): Skip COMDAT fnctions/variables; use
519 add_varpool_node_to_partition; clear aux flags when done.
520 (lto_promote_cross_file_statics): Do not promote stuff that gets
521 duplicated to each ltrans.
7550e1d1 522
01ec0a6c 5232010-07-04 Jan Hubicka <jh@suse.cz>
524
525 * lto.c (read_cgraph_and_symbols): Dump cgraph before merging.
526
09eb10ed 5272010-06-13 Richard Guenther <rguenther@suse.de>
528
529 * lto.c (lto_fixup_type): Do not register or fixup TYPE_CANONICAL.
530
6c8c5385 5312010-06-09 Kai Tietz <kai.tietz@onevision.com>
532
533 * lto.c (lto_resolution_read): Pre-initialize local variable r.
534 * lto-coff.c (coff_write_object_file): Add braces to if.
535
ba72912a 5362010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
537
538 * lto.c (lto_read_in_decl_state): Use typed GC allocation.
539 (lto_file_read): Likewise.
540 (new_partition): Likewise.
541 (read_cgraph_and_symbols): Likewise.
542
4aafe913 5432010-06-07 Joseph Myers <joseph@codesourcery.com>
544
545 * lto-lang.c (flag_no_builtin, flag_no_nonansi_builtin): Remove.
546 (lto_handle_option): Don't set flag_signed_char here.
547
fab8a209 5482010-06-04 Richard Guenther <rguenther@suse.de>
549
550 PR lto/41584
551 * lto.c (lto_1_to_1_map): Use the proper file_data for
552 varpool nodes.
553
ecb08119 5542010-05-30 Jan Hubicka <jh@suse.cz>
555
556 * lto.c (promote_var, promote_fn, lto_wpa_write_files): Dump
557 partitioning decisions.
558
68b8d829 5592010-05-29 Jan Hubicka <jh@suse.cz>
560
561 * lto.c (bitmap vector): Remove.
562 (lto_cgraph_node_sets, lto_varpool_node_sets): Remove.
563 (ltrans_partition_def): New structure.
564 (ltrans_partition): New type and VECtor.
565 (new_partition): New function.
566 (add_cgraph_node_to_partition): New function.
567 (lto_1_to_1_map): Reorganize for partitions.
568 (lto_add_inline_clones): Remove.
569 (lto_add_all_inlinees): Remove.
570 (lto_promote_cross_file_statics): Use partitions.
571 (cmp_partitions): New function.
572 (lto_wpa_write_files): Do not call lto_add_all_inlinees;
573 use partitions; output files sorted by size.
574
ea269688 5752010-05-29 Steven Bosscher <steven@gcc.gnu.org>
576
577 * Make-lang.in: Replace vec.h dependency with VEC_H.
578
8fb69344 5792010-05-28 Joseph Myers <joseph@codesourcery.com>
580
581 * lto-coff.c (coff_errmsg): Remove.
582 (lto_coff_begin_section_with_type, lto_obj_append_data): Use %m in
583 errors instead of coff_errmsg (-1).
584 * lto-macho.c (mach_o_errmsg): Remove.
585 (lto_obj_begin_section, lto_obj_append_data): Use %m in errors
586 instead of mach_o_errmsg (-1).
587 * lto.c (read_cgraph_and_symbols): Use %m in errors instead of
588 xstrerror (errno).
589
2024fa7d 5902010-05-28 Richard Guenther <rguenther@suse.de>
591
592 * lto.c (prefix_name_with_star): Removed.
593 (strip_extension): Likewise.
594 (get_filename_for_set): Likewise.
595 (lto_write_ltrans_list): Fold into ...
596 (lto_wpa_write_files): ... this. Name LTRANS units
597 by suffixing the ltrans output list filename.
598 (do_whole_program_analysis): Adjust.
599
852f689e 6002010-05-27 Joseph Myers <joseph@codesourcery.com>
601
602 * lto.c: Include diagnostic-core.h instead of diagnostic.h.
603 (read_cgraph_and_symbols, lto_main): Use seen_error.
604 * Make-lang.in (lto/lto.o): Update dependencies.
605
3c9e9cba 6062010-05-27 Eric Botcazou <ebotcazou@adacore.com>
607
608 PR lto/44230
609 * lto.h (lto_eh_personality): New prototype.
610 * lto.c: Include debug.h.
611 (first_personality_decl): New static variable.
612 (lto_materialize_function): Set it to DECL_FUNCTION_PERSONALITY of the
613 first function for which it is non-null.
614 (lto_eh_personality_decl): New static variable.
615 (lto_eh_personality): New function.
616 * lto-lang.c (LANG_HOOKS_EH_PERSONALITY): Redefine to above function.
617 * Make-lang.in (lto/lto.o): Add dependency on debug.h.
618
cdd0ea37 6192010-05-26 Steven Bosscher <steven@gcc.gnu.org>
620
621 * lto-lang.c: Do not include expr.h.
622
71eb351d 6232010-05-24 Richard Guenther <rguenther@suse.de>
624
625 * lto-elf.c (lto_obj_build_section_table): Work around
626 FreeBSD libelf issue.
627
ca3e35a1 6282010-05-22 Richard Guenther <rguenther@suse.de>
629
630 * lto.c (read_cgraph_and_symbols): Do not collect.
631
e5507c85 6322010-05-20 Jan Hubicka <jh@suse.cz>
633
634 * lto.c (promote_var, promote_fn): New functions.
635 (lto_promote_cross_file_statics): Compute correctly boundary including
636 static initializers of readonly vars.
637
a510bd8d 6382010-05-18 Jan Hubicka <jh@suse.cz>
639
e5507c85 640 * lto.c (lto_1_to_1_map): Partition non-inline clones.
a510bd8d 641 (lto_promote_cross_file_statics): Deal with non-inline clones.
642
1375c6f8 6432010-05-18 Jan Hubicka <jh@suse.cz>
644
645 * lto.c (lto_materialize_function): Announce function when
646 reading body; allocate_struct_function only when reading body;
647 do not finalize local statics; ggc_collect after reading;
648 do not mark reachable node.
649 (materialize_cgraph): Do not announce function.
650
757a3237 6512010-05-11 Jan Hubicka <jh@suse.cz>
652
653 * lto.c (materialize_cgraph): Revert my previous patch.
654
942dc465 6552010-05-11 Kai Tietz <kai.tietz@onevision.com>
656
657 * lto-coff.c (IMAGE_FILE_MACHINE_ADM64): Rename to
658 IMAGE_FILE_MACHINE_AMD64.
659 * lto-coff.c (IMAGE_FILE_MACHINE_ADM64): Likewise.
660
b4c8770a 6612010-05-11 Jan Hubicka <jh@suse.cz>
662
663 * lto.c (lto_fixup_decls): Remove global var decls freeing here.
664 (materialize_cgraph): Add it here.
665
25429dc2 6662010-05-11 Jan Hubicka <jh@suse.cz>
667
668 * lto.c (lto_fixup_decls): Free no longer needed lto_global_var_decls
669 vector.
670
6712010-05-11 Jan Hubicka <jh@suse.cz>
672
673 * lto.c (lto_1_to_1_map): Remove some no longer needed checks.
674 (lto_promote_cross_file_statics): Never promote DECL_EXTERNAL;
675 use reachable_from_other_partition_p and
676 referenced_from_other_partition_p test.
677
6dd40464 6782010-05-11 Kai Tietz <kai.tietz@onevision.com>
679
680 * lto-coff.c (validate_file): Add x64-coff support.
681 * lto-coff.h (IMAGE_FILE_MACHINE_ADM64): New.
682 (COFF_KNOWN_MACHINES): Add IMAGE_FILE_MACHINE_ADM64.
683 * lto-lang.c (lto_build_c_type_nodes): Add check for
684 'long long unsigned int' for x64-windows.
685 (lto_init): Likewise.
686
687
23433d72 6882010-05-07 Steven Bosscher <steven@gcc.gnu.org>
689
690 * lto.h (struct lto_file_struct): Document offset member.
691 * lto-endian.h: New file.
692 * lto-macho.h: New file.
693 * lto-macho.c: New file.
694 * Make-lang.in: Add rule for lto-macho.o.
695
eb4ef3d1 6962010-05-07 Richard Guenther <rguenther@suse.de>
697
698 PR lto/43857
699 PR lto/43371
700 * lang.opt (fresolution): Change to ...
701 (fresolution=): ... this.
702 * lto-lang.c (lto_handle_option): Adjust.
703
264cbb51 7042010-05-07 Richard Guenther <rguenther@suse.de>
705
706 * lto.c (DUMPBASE_SUFFIX): Remove.
707 (lto_execute_ltrans): Move functionality to lto-wrapper.c.
708 Rename to ...
709 (lto_write_ltrans_list): ... only output the list of ltrans files.
710 (lto_maybe_unlink): Remove.
711 (do_whole_program_analysis): Do not execute LTRANS phase
712 from here.
713
11dc3713 7142010-05-06 H.J. Lu <hongjiu.lu@intel.com>
715
716 * lto-lang.c (lto_handle_option): Add argument kind.
717
8d810329 7182010-05-05 Jan Hubicka <jh@suse.cz>
719
264cbb51 720 * lto.c (lto_promote_cross_file_statics): Compute boundary based on
721 refs.
8d810329 722
a238367f 7232010-05-05 Jan Hubicka <jh@suse.cz>
724
725 * lto.c (lto_1_to_1_map): Partition only needed nodes.
726
bf7d782b 7272010-04-30 Jan Hubicka <jh@suse.cz>
728
b630a10e 729 * lto.c (get_filename_for_set): Look for cgraph node and if none found,
730 use default name.
bf7d782b 731 (lto_wpa_write_files): Write any non-empty partition.
732
da67d826 7332010-04-30 Jan Hubicka <jh@suse.cz>
734
735 * lto.c: Do not attempt to make constant pool references global.
736
57305941 7372010-04-28 Jan Hubicka <jh@suse.cz>
738
739 * lto/lto.c (lto_read_in_decl_state): Use GGC.
740 (lto_wpa_write_files): Announce what we are writting.
741 (all_file_decl_data): New.
742 (read_cgraph_and_symbols): Use GGC; correct timevars.
743 (do_whole_program_analysis): Collect.
744 * lto/Make-lang.in (lto.o): Fix dependency.
745 * Makefile.in (GTFILES): Add lto-streamer.h.
746 * varpool.c (varpool_analyze_pending_decls): Use TV_VARPOOL.
747 (varpool_assemble_pending_decls): Use VAROUT.
748 * lto-streamer.h (lto_tree_ref_table): Annotate.
749 (lto_in_decl_state): Annotate.
750 (lto_file_decl_data): Annotate.
751
0cddb138 7522010-04-28 Jan Hubicka <jh@suse.cz>
753
754 * lto.c (lto_varpool_node_sets): New.
755 (lto_1_to_1_map): Partition varpool too.
756 (globalize_context_t, globalize_cross_file_statics,
757 lto_scan_statics_in_ref_table, lto_scan_statics_in_cgraph_node,
758 lto_scan_statics_in_remaining_global_vars): Remove.
759 (lto_promote_cross_file_statics): Rewrite.
760 (get_filename_for_set): Take vset argument.
761 (lto_wpa_write_files): Pass around vsets.
762
4d992eb6 7632010-04-27 Dave Korn <dave.korn.cygwin@gmail.com>
764
765 PR lto/42776
766 * Make-lang.in (LTO_OBJS): Use LTO_BINARY_READER instead of
767 hardcoding 'lto-elf.o'.
768 ($(LTO_EXE)): Use LTO_USE_LIBELF instead of hardcoding '-lelf'.
769
770 * lto-coff.h: New file.
771 * lto-coff.c: Likewise.
772
9c491711 7732010-04-26 Richard Guenther <rguenther@suse.de>
774
775 * lto.c (lto_fixup_type): Deal with non-type TYPE_CONTEXT.
776
3ba0ce47 7772010-04-26 Dave Korn <dave.korn.cygwin@gmail.com>
778
779 * lto.h (lto_elf_file_open): Rename prototype from this ...
780 (lto_obj_file_open): ... to this.
781 (lto_elf_file_close): Likewise ...
782 (lto_obj_file_close): ... and likewise.
783 (lto_elf_build_section_table): Likewise ...
784 (lto_obj_build_section_table): ... and likewise.
785 (lto_elf_begin_section): Likewise ...
786 (lto_obj_begin_section): ... and likewise.
787 (lto_elf_append_data): Likewise ...
788 (lto_obj_append_data): ... and likewise.
789 (lto_elf_end_section): Likewise ...
790 (lto_obj_end_section): ... and likewise.
791 * lto.c (lto_file_read): Update references to the above.
792 (lto_wpa_write_files): Likewise.
793 (lto_read_all_file_options): Likewise.
794 (read_cgraph_and_symbols): Likewise.
795 * lto-lang.c (LANG_HOOKS_BEGIN_SECTION): Likewise.
796 (LANG_HOOKS_APPEND_DATA): Likewise.
797 (LANG_HOOKS_END_SECTION): Likewise.
798 * lto-elf.c (lto_elf_file_open): Rename from this ...
799 (lto_obj_file_open): ... to this, updating any references.
800 (lto_elf_file_close): Likewise ...
801 (lto_obj_file_close): ... and likewise.
802 (lto_elf_build_section_table): Likewise ...
803 (lto_obj_build_section_table): ... and likewise.
804 (lto_elf_begin_section): Likewise ...
805 (lto_obj_begin_section): ... and likewise.
806 (lto_elf_append_data): Likewise ...
807 (lto_obj_append_data): ... and likewise.
808 (lto_elf_end_section): Likewise ...
809 (lto_obj_end_section): ... and likewise.
810
5a2aecd6 8112010-04-21 Jan Hubicka <jh@suse.cz>
812
813 * lto.c (lto_fixup_tree): Do not call wpa fixup.
814 (materialize_cgraph): Likewise.
815
ddc90d88 8162010-04-21 Jan Hubicka <jh@suse.cz>
817
818 * lto.c (lto_wpa_write_files): Update.
819 (read_cgraph_and_symbols): Be more verbose.
820 (materialize_cgraph): Likewise.
821 (do_whole_program_analysis): Likewise.
822
e288c7a9 8232010-04-21 Jan Hubicka <jh@suse.cz>
824
825 * lto.c (globalize_cross_file_statics): When function has address taken,
826 it needs to be public.
827
08843223 8282010-04-20 Jan Hubicka <jh@suse.cz>
829
830 * lto.c (lto_add_inline_clones): Do not track inlined_decls.
831 (lto_add_all_inlinees): Likewise.
832 (lto_wpa_write_files): Likewise.
833
ad086ed4 8342010-04-18 Eric Botcazou <ebotcazou@adacore.com>
835
836 * lto-lang.c (lto_init): Remove second argument in call to
837 build_common_tree_nodes.
838
d6845139 8392010-04-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
840
841 * lto-elf.c [!HAVE_ELF_GETSHDRSTRNDX] (elf_getshdrstrndx): New
842 function.
843
a5813485 8442010-03-09 Eric Botcazou <ebotcazou@adacore.com>
845
846 PR bootstrap/43276
847 * lto-elf.c: Define EM_* constants if not already defined.
848
a219f6a5 8492010-03-03 Eric Botcazou <ebotcazou@adacore.com>
850
851 * lto-elf.c (is_compatible_architecture): New static function.
852 (DEFINE_VALIDATE_EHDR): Use it to validate the architecture.
853
2bd888dc 8542010-02-11 Richard Guenther <rguenther@suse.de>
855
856 PR driver/43021
857 * lto-elf.c (lto_elf_file_open): Handle file@offset case more
858 appropriately.
859
27721832 8602010-01-11 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
861
862 * lto.c (O_BINARY): Define.
863 (lto_read_section_data): Open file in binary mode.
864 * lto-elf.c (O_BINARY): Define.
865 (lto_elf_file_open): Open file in binary mode.
866
3bfd70ae 8672010-01-08 Richard Guenther <rguenther@suse.de>
868
869 PR lto/42528
870 * lto-lang.c (lto_handle_option): Handle -f[un]signed-char.
871 (lto_init): Do not init char_type_node in a standard way
872 but according to flag_signed_char.
873
50ca7c37 8742010-01-03 H.J. Lu <hongjiu.lu@intel.com>
875
876 PR lto/41564
877 * lto.c (DUMPBASE_SUFFIX): New.
878 (lto_execute_ltrans): Append a sequence number to -dumpbase
879 for LTRANS.
880
d5e86d20 8812010-01-02 H.J. Lu <hongjiu.lu@intel.com>
882
883 PR lto/42580
884 * lto-elf.c (lto_elf_file_open): Stop if the command line
885 option file is missing.
886
08a7e80f 8872009-12-15 Richard Guenther <rguenther@suse.de>
888
889 * lto.c (lto_fixup_field_decl): Fixup DECL_FIELD_OFFSET.
890 (lto_post_options): Do not disable debuginfo.
891
4af4d09c 8922009-12-14 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
893
894 * Make-lang.in ($(LTO_EXE)): Use $(LINKER).
895
50b2dbd9 8962009-12-11 Richard Guenther <rguenther@suse.de>
897
898 PR lto/42037
899 * lto.c (lto_resolution_read): Properly grow the vector.
900
97e90c2e 9012009-12-11 Richard Guenther <rguenther@suse.de>
902
903 PR lto/41915
904 * lto-lang.c (lto_init_options): Initialize flag_complex_method
905 to the C99 default. Do not set flag_unit_at_a_time.
906
f018d957 9072009-11-28 Jakub Jelinek <jakub@redhat.com>
908
909 * lto-lang.c (handle_nonnull_attribute): Remove unused attr_arg_num
910 variable.
911
81897669 9122009-11-19 Rafael Avila de Espindola <espindola@google.com>
913
914 PR bootstrap/42096
915 * lto-elf.c (lto_elf_file_open): Use lto_parse_hex.
916 * lto.c (lto_parse_hex): New.
917 (lto_resolution_read): Use lto_parse_hex.
918 * lto.h (lto_parse_hex): New.
919
b7fedf62 9202009-11-17 Rafael Avila de Espindola <espindola@google.com>
921
922 * lto-elf.c (lto_file_init): Add offset argument.
923 (lto_elf_file_open): Record the offset.
924 * lto.c (lto_resolution_read): Change file_name into a lto_file
925 argument. Check offsets.
926 (lto_file_read): Update call to lto_resolution_read.
927 * lto.h (lto_file_struct): Add the offset field.
928
6575099f 9292009-11-16 Rafael Avila de Espindola <espindola@google.com>
930
931 * lto-elf.c (lto_elf_file_open): Use strtoll to parse the offset.
932
6d1cc52c 9332009-11-14 Jan Hubicka <jh@suse.cz>
934
935 * lto.c (read_cgraph_and_symbols): Set also ipa_transforms_to_apply.
936
d405c5a4 9372009-11-12 Rafael Avila de Espindola <espindola@google.com>
938
939 * lang.opt (fresolution): Renamed from resolution.
940 * lto-lang.c (lto_handle_option): Handle new option name.
941 * lto.c (lto_resolution_read): Add more checks. Discard rest of line.
942
06b9e52b 9432009-11-04 Richard Guenther <rguenther@suse.de>
944 Rafael Avila de Espindola <espindola@google.com>
945
946 * lto-elf.c (lto_elf_build_section_table): Add the base offset.
947 (lto_elf_file_open): Handle offsets in arguments name@offest.
948
f5a023c5 9492009-10-30 Richard Guenther <rguenther@suse.de>
950
951 PR lto/41858
952 * lto.c (lto_file_read): Do not set file_data->fd.
953 (lto_read_section_data): Use a single-entry file-descriptor cache.
954 Do not check the result of xmalloc.
955 (free_section_data): Do not use file_data->fd.
956 (lto_read_all_file_options): Likewise.
957
21ce3cc7 9582009-10-22 Richard Guenther <rguenther@suse.de>
959
960 * lto.c (lto_fixup_jump_functions): Remove.
961 (lto_fixup_decls): Do not fixup jump functions.
962 (read_cgraph_and_symbols): Schedule cgraph merging after
963 summary reading. Schedule type and decl fixup before
964 summary reading.
965
5575303a 9662009-10-22 Richard Guenther <rguenther@suse.de>
967
968 * lto.c (lto_fixup_data_t): Remove free_list member.
969 (lto_fixup_tree): Do not insert into free_list.
970 (free_decl): Remove.
971 (lto_fixup_decls): Remove free-list handling.
972
8867b500 9732009-10-22 Jan Hubicka <jh@suse.cz>
974
975 * lto.c (lto_fixup_jump_functions): New function.
976 (lto_fixup_decls): Use it.
977
b787522e 9782009-10-16 Richard Guenther <rguenther@suse.de>
979
980 PR lto/41715
981 * lto.c (lto_fixup_tree): Revert last change.
982
bc0ed27c 9832009-10-14 Richard Guenther <rguenther@suse.de>
984
985 * lto.c (lto_fixup_tree): In case the prevailing decl is not
986 compatible with the one we replace wrap it around a
987 VIEW_CONVERT_EXPR.
988
c515f146 9892009-10-09 Richard Guenther <rguenther@suse.de>
990
991 PR lto/41635
992 PR lto/41636
993 * lto.c (read_cgraph_and_symbols): Do not assert we can open
994 a file.
995 * lto-elf.c (init_shdr##BITS): Fix i18n problems.
996 (init_ehdr##BITS): Likewise.
997
48cf7037 9982009-10-08 Joseph Myers <joseph@codesourcery.com>
999
1000 * lto-elf.c (init_shdr##BITS, lto_elf_begin_section_with_type,
1001 init_ehdr##BITS, lto_elf_file_close): Remove trailing "." from
1002 diagnostics.
1003 * lto-lang.c (lto_post_options): Remove trailing "." from
1004 diagnostics.
1005
7366cbe7 10062009-10-08 Richard Guenther <rguenther@suse.de>
1007
1008 * lto.c (read_cgraph_and_symbols): Free the gimple type merging
1009 hash tables.
1010
7c3f71c3 10112009-10-07 Joseph Myers <joseph@codesourcery.com>
1012
1013 * lto.c: Only include <sys/mman.h> if HAVE_MMAP_FILE.
1014
59dd4830 10152009-10-07 Jan Hubicka <jh@suse.cz>
1016
1017 * lto.c (read_cgraph_and_symbols): Mark functions neccesary only at
1018 ltrans stage; explain why this is needed and should not.
1019
fd193bcd 10202009-10-05 Richard Guenther <rguenther@suse.de>
1021
1022 PR lto/41552
1023 PR lto/41487
1024 * lto.c (lto_read_decls): Do not register deferred decls.
1025 (read_cgraph_and_symbols): Delay symbol and cgraph merging
1026 until after reading the IPA summaries.
1027
7bfefa9d 10282009-10-02 Rafael Avila de Espindola <espindola@google.com>
1029
1030 * Make-lang.in (lto/lto-lang.o): Don't depend on lto/common.h.
1031 (lto-lang.c): Don't include lto/common.h.
1032
10332009-10-02 Rafael Avila de Espindola <espindola@google.com>
1034
1035 * Make-lang.in (LTO_OBJS): Remove lto/common.o.
1036 (lto/common.o): Remove.
1037 * common.c: Remove.
1038 * common.h (lto_kind_str): Remove.
1039 (lto_visibility_str): Remove.
1040 (lto_resolution_str): Make it static.
1041
10422009-10-01 Diego Novillo <dnovillo@google.com>
1043
1044 * lto.c (lto_read_decls): Add comment.
1045 Call internal_error instead of gcc_assert.
1046 (lto_resolution_read): Likewise.
1047 (lto_add_all_inlinees): Tidy.
1048 * Make-lang.in: Fix copyright boilerplate.
1049 (lto.pdf): New.
1050 (lto.install-pdf): New.
1051 * lto-tree.h: Fix copyright boilerplate.
1052 * lang-specs.h: Likewise.
1053 Remove ".lto" entry from compilers fragment.
1054 * lto-elf.c: Move inclusion of gelf.h after config.h.
1055 Tidy formatting everywhere.
1056 * lto.h: Fix copyright boilerplate.
1057 Tidy formatting everywhere.
1058 * common.c: Likewise.
1059 * config-lang.in: Likewise.
1060 * common.h: Likewise.
1061 * lto-lang.c: Likewise.
1062
10632009-10-01 Richard Guenther <rguenther@suse.de>
1064
1065 * lto.c (lto_read_section_data): Use plain lseek/read.
1066
10672009-10-01 Richard Guenther <rguenther@suse.de>
1068
1069 * lto.c (LTO_MMAP_IO): Define if we can mmap files and
1070 use sysconf to query the system page size.
1071 (lto_file_read): Implement fallback using stdio.
1072 (free_section_data): Likewise.
1073
10742009-09-29 Diego Novillo <dnovillo@google.com>
1075
1076 * lto-lang.c (lto_init): Really fix call to
1077 build_common_builtin_nodes.
1078
10792009-09-29 Diego Novillo <dnovillo@google.com>
1080
1081 * lto-lang.c (lto_init): Fix call to
1082 build_common_builtin_nodes.
1083
10842009-09-29 Richard Guenther <rguenther@suse.de>
1085
1086 PR lto/40754
1087 * lto-elf.c (init_shdr##BITS): Properly specify alignment
1088 in bytes.
1089 (first_data_block): New static variable.
1090 (lto_elf_append_data): Align the first data block in each
1091 section.
1092
10932009-09-28 Diego Novillo <dnovillo@google.com>
1094
1095 * lto-lang.c: Tidy. Remove stale FIXME lto markers.
1096 * lto.c (strip_extension): New.
1097 (get_filename_for_set): Call it. Do not call make_cwd_temp_file.
1098 (lto_execute_ltrans): Tidy.
1099 Do not pass -fwpa nor -fltrans-* to LTRANS.
1100 * opts.c: Tidy formatting and remove stale FIXME lto markers.
1101 * tree.c (need_assembler_name_p): Call
1102 lang_hooks.decls.may_need_assembler_name_p if set.
1103 * varasm.c (default_binds_local_p_1): Remove check for
1104 flag_ltrans.
1105 * varpool.c (decide_is_variable_needed): Do not test for
1106 in_lto_p.
1107
11082009-09-22 Richard Guenther <rguenther@suse.de>
1109
1110 PR lto/39276
1111 * lto.c (lto_execute_ltrans): Perform ltrans phase manually.
1112 * Make-lang.in: Remove ltrans-driver stuff.
1113 * config-lang.in: Likewise.
1114 * lang.opt (fltrans-driver): Remove.
1115 * lto-lang.c (lto_init_options): Remove code initializing
1116 ltrans_driver.
1117 * ltrans-driver: Remove.
1118
11192009-09-21 Diego Novillo <dnovillo@google.com>
1120
1121 * lto-lang.c (lto_define_builtins): Remove superfluous
1122 calls to targetm.init_builtins and build_common_builtin_nodes.
1123 (lto_init): Add targetm.arm_eabi_unwinder as parameter to
1124 build_common_builtin_nodes.
1125 * lto.c (lto_materialize_function): Do nothing if NODE is a
1126 clone.
1127
11282009-09-03 Diego Novillo <dnovillo@google.com>
1129
1130 * lto-elf.c (validate_file): Replace call to
1131 elf_getshstrndx with call to elf_getshdrstrndx.
1132
11332009-08-19 Richard Guenther <rguenther@suse.de>
1134
1135 * lto-lang.c (lto_init): Merge char_type_node with the
1136 appropriately signed variant.
1137
11382009-08-19 Richard Guenther <rguenther@suse.de>
1139
1140 PR lto/41071
1141 * lto.c (lto_fixup_common): Re-build the pointer-to chain part one.
1142 (lto_fixup_type): Re-build the pointer-to chain part two.
1143
11442009-08-19 Richard Guenther <rguenther@suse.de>
1145
1146 PR lto/41071
1147 * lto.c (lto_fixup_type): Re-build the type variant chain.
1148
11492009-08-19 Richard Guenther <rguenther@suse.de>
1150
1151 PR lto/41071
1152 * lto.c (lto_fixup_constructor): New function.
1153 (lto_fixup_tree): Replace all types. Properly fixup
1154 constructors and constants.
1155
11562009-08-14 Richard Guenther <rguenther@suse.de>
1157
1158 * lto.c (read_cgraph_and_symbols): Exchange TREE_CHAIN use
1159 for DECL_LANG_SPECIFIC.
1160
11612009-08-13 Richard Guenther <rguenther@suse.de>
1162
1163 PR lto/41032
1164 * lto-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Define to NULL.
1165
11662009-07-30 Richard Guenther <rguenther@suse.de>
1167
1168 PR lto/40903
1169 * lto.c (read_cgraph_and_symbols): After fixing up decls choose
1170 the largest decl for output and free TREE_CHAIN for further
1171 use.
1172
11732009-07-24 Diego Novillo <dnovillo@google.com>
1174
1175 * Make-lang.in: Add empty lto.install-plugin target.
1176
11772009-07-13 Diego Novillo <dnovillo@google.com>
1178
1179 * lto.c (lto_fixup_tree): Handle IMPORTED_DECL.
1180
11812009-07-11 Richard Guenther <rguenther@suse.de>
1182
1183 * lto-lang.c (lto_write_globals): Wrapup global decls.
1184
11852009-07-10 Richard Guenther <rguenther@suse.de>
1186
1187 * lto-lang.c (lto_init): Allocate one more location to make
1188 BUILTINS_LOCATION correct.
1189
11902009-07-09 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
1191
1192 * lto.c (free_section_data): Cast computed_offset to caddr_t.
1193
11942009-07-06 Diego Novillo <dnovillo@google.com>
1195
1196 * lto.c (lto_fixup_type): Fixup TYPE_SIZE and
1197 TYPE_SIZE_UNIT.
1198
11992009-07-06 Diego Novillo <dnovillo@google.com>
1200
1201 * lto.c (preload_common_nodes): Remove.
1202 (lto_read_in_decl_state): Call lto_streamer_cache_get.
1203 (lto_read_decls): Call lto_data_in_create and
1204 lto_data_in_delete.
1205 (free_decl): Do not call ggc_free.
1206 (lto_main): Call lto_init_reader.
1207 * lto-lang.c (lto_type_for_size): Handle intTI_type_node.
1208 (lto_init): Initialize main_identifier_node if needed.
1209 Make ptrdiff_type_node be integer_type_node.
1210
12112009-06-19 Diego Novillo <dnovillo@google.com>
1212
1213 * lto.c: Remove code guarded by #ifdef LTO_STREAM_DEBUGGING.
1214 Remove code guarded by #ifdef GLOBAL_STREAMER_TRACE.
1215 Remove code guarded by #ifdef LOCAL_TRACE.
1216
12172009-06-18 Diego Novillo <dnovillo@google.com>
1218
1219 * lto.c: Update license to GPLv3.
1220 * lto-elf.c: Likewise.
1221 * common.c: Likewise.
1222 * lto-lang.c: Likewise.
1223 * lto.h: Remove superfluous include files. Update all
1224 users.
1225
12262009-06-17 Diego Novillo <dnovillo@google.com>
1227
1228 * lto.c (read_cgraph_and_symbols): Call input_cgraph.
1229
12302009-06-02 Diego Novillo <dnovillo@google.com>
1231
1232 * lto.c (lto_1_to_1_map): Ignore nodes that have not been
1233 read in.
1234 (materialize_cgraph): Only materialize nodes that have a
1235 representation on file.
1236
12372009-06-01 Diego Novillo <dnovillo@google.com>
1238
1239 * lto-lang.c (lto_handle_option): Hanlde OPT_Wabi.
1240
12412009-05-31 Diego Novillo <dnovillo@google.com>
1242
1243 * lto-lang.c (lto_type_for_mode): Handle all the modes
1244 handled in c_common_type_for_mode.
1245
12462009-05-21 Diego Novillo <dnovillo@google.com>
1247
1248 * lto-elf.c: Always include <gelf.h>.
1249 * config-lang.in (target_libs): Remove.
1250 (build_by_default): Set to no.
1251
12522009-05-15 Diego Novillo <dnovillo@google.com>
1253
1254 * lto.c (lto_materialize_function): Assert that DECL is
1255 not a builtin.
1256 (materialize_cgraph): Don't try to materialize builtin
1257 functions.
1258 * lto-section-out.c (write_symbol_vec): Do not write
1259 builtin functions.
1260
12612009-05-13 Diego Novillo <dnovillo@google.com>
1262
1263 * lto-lang.c (LANG_HOOKS_GET_ALIAS_SET): Define.
1264
12652009-05-07 Diego Novillo <dnovillo@google.com>
1266
1267 * lto.c (lto_resolution_read): Add type casts for C++ warnings.
1268 (LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE): Define.
1269 (lto_fixup_type): Call it for TYPE_POINTER_TO,
1270 TYPE_REFERENCE_TO, TYPE_CONTEXT and TYPE_CANONICAL.
1271 (lto_fixup_tree): Call gimple_register_type when *TP is a
1272 type.
1273 (lto_main): Call bitmap_obstack_initialize.
1274
12752009-04-22 Diego Novillo <dnovillo@google.com>
1276
1277 * lto.c (free_section_data): Tidy.
1278 (lto_1_to_1_map): Tidy.
1279 (lto_add_all_inlinees): Tidy.
1280 (prefix_name_with_star): New.
1281 (get_filename_for_set): New.
1282 (lto_wpa_write_files): Call cgraph_node_set_needs_ltrans_p
1283 to determine what cgraph node sets to write.
1284 Call get_filename_for_set to compute temporary file
1285 names.
1286 (lto_execute_ltrans): Do not execute LTRANS on files with
1287 names that start with '*'.
1288 Move logic to execute LTRANS together so that LTRANS is
1289 invoked only if there are any files to compile.
1290 (do_whole_program_analysis): Only remove output files
1291 that do not start with '*'.
1292
12932009-04-06 Diego Novillo <dnovillo@google.com>
1294
1295 * lto-lang.c (lto_post_options): Set flag_excess_precision_cmdline.
1296 * lto.c (read_cgraph_and_symbols): Set cgraph_function_flags_ready.
1297 (lto_add_all_inlinees): Tidy.
1298
12992009-03-26 Diego Novillo <dnovillo@google.com>
1300
1301 * lto.c: Include gimple.h.
1302 (lto_read_in_decl_state): Call gimple_register_type for
1303 every type in every stream.
1304 (lto_fixup_common): Call gimple_register_type if T has a
1305 type.
1306 (do_whole_program_analysis): Call print_lto_report.
1307 (lto_main): Call print_lto_report after cgraph_optimize.
1308 * Make-lang.in (lto.o): Add dependency on GIMPLE_H.
1309
13102009-03-24 Diego Novillo <dnovillo@google.com>
1311
1312 * Make-lang.in (lto-lang.o): Add dependency on TARGET_H and EXPR_H.
1313 (lto.o): Add dependency on GIMPLE_H.
1314
13152009-03-10 Simon Baldwin <simonb@google.com>
1316
1317 * lto.c (lto_read_all_file_options): Close any open file descriptor
1318 contained in file_data before freeing.
1319
13202009-02-24 Rafael Avila de Espindola <espindola@google.com>
1321
1322 * lto.c (lto_add_inline_clones): Don't add the master clone. Check
1323 for a decl in the original bitmap, not a node.
1324 (lto_add_all_inlinees): Remove original nodes that are not needed.
1325 (lto_scan_statics_in_cgraph_node): Don't care if the node is the master.
1326
13272009-02-24 Diego Novillo <dnovillo@google.com>
1328
1329 * lto.c (lto_materialize_function): Update
1330 lto_stats.num_function_bodies.
1331 (get_section_data): Initialize *LEN to 0.
1332 (lto_1_to_1_map): Update lto_stats.num_cgraph_partitions.
1333 (lto_wpa_write_files): Update lto_stats.num_cgraph_nodes.
1334 Update lto_stats.num_output_files.
1335 (read_cgraph_and_symbols): Update lto_stats.num_input_files.
1336 (materialize_cgraph): Update lto_stats.num_input_cgraph_nodes.
1337 (lto_main): Initialize lto_stats.
1338 If flag_lto_report is set, call print_lto_report.
1339
13402009-02-19 Diego Novillo <dnovillo@google.com>
1341
1342 Revert
1343
1344 2009-02-19 Rafael Avila de Espindola <espindola@google.com>
1345
1346 * lto.c (lto_add_inline_clones): Don't add the
1347 master clone. Check for a decl in the original
1348 bitmap, not a node.
1349 (lto_add_all_inlinees): Remove original nodes
1350 that are not needed.
1351 (lto_scan_statics_in_cgraph_node): Don't care if
1352 the node is the master.
1353 (lto_promote_cross_file_statics): Use a new
1354 context.seen_node_decls for each set
1355
13562009-02-19 Rafael Avila de Espindola <espindola@google.com>
1357
1358 * lto.c (lto_add_inline_clones): Don't add the master clone. Check
1359 for a decl in the original bitmap, not a node.
1360 (lto_add_all_inlinees): Remove original nodes that are not needed.
1361 (lto_scan_statics_in_cgraph_node): Don't care if the node is the master.
1362 (lto_promote_cross_file_statics): Use a new context.seen_node_decls
1363 for each set
1364
13652009-02-18 Diego Novillo <dnovillo@google.com>
1366
1367 * lto.c (lto_wpa_write_files): Use timers TV_WHOPR_WPA
1368 and TV_WHOPR_WPA_IO.
1369 (lto_execute_ltrans): Use timer TV_WHOPR_WPA_LTRANS_EXEC.
1370 (read_cgraph_and_symbols): Use timer TV_IPA_LTO_DECL_IO.
1371 (materialize_cgraph): Use timer TV_IPA_LTO_GIMPLE_IO.
1372 Use timer TV_WHOPR_WPA or TV_WHOPR_LTRANS or TV_LTO
1373 depending on command line flags.
1374 (do_whole_program_analysis): Use timer TV_WHOPR_WPA.
1375 (lto_main): Remove timer uses.
1376
13772009-02-18 Rafael Avila de Espindola <espindola@google.com>
1378
1379 * lto.c (lto_materialize_function): Don't set DECL_EXTERN to 0.
1380 (lto_wpa_write_files): Update calls to renamed functions.
1381
13822009-02-17 Diego Novillo <dnovillo@google.com>
1383
1384 PR 39203
1385 * lto-lang.c (lto_post_options): Disable -fwhole-program
1386 when running LTRANS.
1387
13882009-02-10 Diego Novillo <dnovillo@google.com>
1389
1390 * lto.c (read_cgraph_and_symbols): Fix comment.
1391
13922009-02-10 Diego Novillo <dnovillo@google.com>
1393
1394 * lto.c (read_cgraph_and_symbols): Read options from all
1395 IL files.
1396
13972009-02-10 Diego Novillo <dnovillo@google.com>
1398
1399 * lto.c (read_cgraph_and_symbols): Factor out of lto_main.
1400 (materialize_cgraph): Likewise.
1401 (do_whole_program_analysis): Likewise.
1402 (lto_main): Call read_cgraph_and_symbols,
1403 materialize_cgraph and do_whole_program_analysis.
1404
14052009-02-10 Simon Baldwin <simonb@google.com>
1406
1407 * lto.c: Include lto-opts.h.
1408 * (lto_main): Clear file options at loop start, read any saved
1409 options from the first file handled, and re-issue options.
1410 * Makefile.in (lto.o): Add dependency on lto-opts.h.
1411
14122009-02-02 Diego Novillo <dnovillo@google.com>
1413
1414 * lto.c (lto_main): Stop LTO_TIMER and use
1415 TV_WHOPR_WPA_LTRANS_EXEC when launching LTRANS.
1416
14172009-01-30 H.J. Lu <hongjiu.lu@intel.com>
1418
1419 PR lto/38995
1420 * lto-elf.c (init_shdr##BITS): Set the sh_addralign field
1421 to POINTER_SIZE.
1422
14232009-01-29 Ramana Radhakrishnan <ramana.r@gmail.com>
1424
1425 * Make-lang.in (LTO_EXE): Link with all
1426 BACKENDLIBS and not only GMPLIBS
1427
14282009-01-28 H.J. Lu <hongjiu.lu@intel.com>
1429
1430 PR bootstrap/38992
1431 * lto-elf.c: Include gelf.h instead of libelf.h.
1432 (lto_elf_file_close): Replace elfx_update_shstrndx with
1433 gelf_getehdr, elf_getscn, gelf_getshdr, gelf_update_shdr and
1434 gelf_update_ehdr.
1435
14362009-01-28 H.J. Lu <hongjiu.lu@intel.com>
1437
1438 PR middle-end/38996
1439 * lto-elf.c (DEFINE_INIT_EHDR): Initialize e_version.
1440
14412009-01-26 Diego Novillo <dnovillo@google.com>
1442
1443 * lto-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Update.
1444
14452009-01-26 Diego Novillo <dnovillo@google.com>
1446
1447 * lto-lang.c (lto_types_compatible_p): Move to gimple.c
1448 and rename into gimple_types_compatible_p.
1449
14502009-01-12 Rafael Avila de Espindola <espindola@google.com>
1451
1452 * lto-lang.c (lang_hooks): Remove the const qualifier.
1453
14542009-01-06 Diego Novillo <dnovillo@google.com>
1455
1456 * ltrans-driver: Mark 'all' target as phony.
1457
14582008-12-31 Diego Novillo <dnovillo@google.com>
1459
1460 * ltrans-driver: Execute a NOP action for target 'all'.
1461
14622008-12-19 Diego Novillo <dnovillo@google.com>
1463
1464 * lto.c (lto_1_to_1_map): Tidy.
1465
14662008-12-19 Diego Novillo <dnovillo@google.com>
1467
1468 * lto-elf.c (lto_elf_file_open): When FILENAME cannot
1469 be opened, show its name.
1470 * ltrans-driver: If $verbose is set, do not use parallelism.
1471
14722008-12-17 Rafael Avila de Espindola <espindola@google.com>
1473
1474 * lto.c (lto_fixup_function): New.
1475 (lto_fixup_tree): Call lto_fixup_function.
1476
14772008-12-14 Doug Kwan <dougkwan@google.com>
1478
1479 * lto.c (lto_1_to_1_map): Create a cgraph node set for any global
1480 variables if there is no function.
1481
14822008-12-10 Simon Baldwin <simonb@google.com>
1483
1484 * ltrans-driver: Always run make in silent mode, to avoid make's
1485 trace on stdout interfering with lto-wrapper output.
1486
14872008-12-10 Doug Kwan <dougkwan@google.com>
1488
1489 * lto.c (lto_add_inline_clones): Do not force master clones of
1490 inlined functions already in SET to be static inline.
1491
14922008-12-04 Doug Kwan <dougkwan@google.com>
1493
1494 * lto.c (globalize_context_t): New type to store states in
1495 globalization of cross-file statics.
1496 (globalize_cross_file_statics): New.
1497 (lto_scan_statics_in_ref_table): Walk tree to look for reachable
1498 static decls that need to be fixed up.
1499 (lto_scan_statics_in_cgraph_node): Change call interface to use
1500 a globalize_context_t CONTEXT for all states used.
1501 (lto_scan_statics_in_remaining_global_vars): New.
1502 (lto_promote_cross_file_statics): Use new call interface of
1503 LTO_SCAN_STATICS_IN_CGRAPH_NODE. Handle remaining externally
1504 visible vars in the last set.
1505
15062008-12-03 Diego Novillo <dnovillo@google.com>
1507
1508 * lto.c (lto_fixup_tree): Do not emit an error when
1509 PREVAILING throw but T doesn't.
1510
15112008-12-02 Doug Kwan <dougkwan@google.com>
1512
1513 * lto.c (lto_scan_statics_in_ref_table): New function factored out
1514 from code in ...
1515 (lto_scan_statics_in_cgraph_node): Handle both file-scope static
1516 variables and functions.
1517 (lto_promote_cross_file_statics): Rename bitmaps to SEEN_DECLS
1518 and GLOBAL_DECLS from SEEN_VARS and GLOBAL_VARS.
1519
15202008-11-29 Diego Novillo <dnovillo@google.com>
1521
1522 * lto.c: Include timevar.h.
1523 (lto_materialize_function): Tidy. Add comments.
1524 (lto_wpa_write_files): Tidy.
1525 (lto_execute_ltrans): Tidy.
1526 (lto_main): Add local variable LTO_TIMER. Initialize it
1527 to one of TV_WHOPR_WPA, TV_WHOPR_LTRANS or TV_LTO.
1528 Start and stop the timer.
1529 Tidy comments.
1530 * Make-lang.in (lto.o): Add dependency on timevar.h.
1531 * ltrans-driver: React to -v and -save-temps.
1532 Use simple heuristic to determine how much parallelism to
1533 use when executing make.
1534
15352008-11-12 Doug Kwan <dougkwan@google.com>
1536
1537 * lto.c (lto_bitmap_obstack): Remove var.
1538 (lto_materialize_function): Do nothing instead of marking function
1539 body in file if flag_wpa is true.
1540 (lto_add_all_inlinees): Use bitmap functions in lto-utils.c.
1541 (lto_scan_statics_in_cgraph_node): New function.
1542 (lto_promote_cross_file_statics): Same.
1543 (lto_wpa_write_files): Call lto_promote_cross_file_statics.
1544 Use bitmap functions in lto-utils.c. Remove unsued label OUT.
1545 * Make-lang.in (lto/lto.o): Add lto-utils.h to dependency list.
1546
15472008-11-09 Diego Novillo <dnovillo@google.com>
1548
1549 * lto/lto.c (lto_fixup_tree): Change error message locus
1550 information to include location of mismatching
1551 declaration.
1552 Use TREE_NO_WARNING to avoid repeated messages.
1553 (lto_main): If lto_fixup_decls emitted any errors, exit.
1554 * lto/lto-lang.c: Don't include libfuncs.h and except.h
1555 (lto_init_options): Don't enable exceptions by default.
1556 (lto_eh_runtime_type): Move to lto-function-in.c
1557 (lto_init_eh): Likewise.
1558 (lto_init): Don't call lto_init_eh.
1559 * lto/Make-lang.in (lto-lang.o): Remove dependency on
1560 libfuncs.h and except.h.
1561
15622008-10-30 Diego Novillo <dnovillo@google.com>
1563
1564 * lto.c (lto_read_decls): Declare debug_main only if
1565 LTO_STREAM_DEBUGGING is enabled.
1566
15672008-10-30 Simon Baldwin <simonb@google.com>
1568
1569 * lto.c (lto_wpa_write_files): Create intermediate files with
1570 make_cwd_temp_file().
1571 (lto_maybe_unlink): New. Delete intermediate WPA files unless
1572 WPA_SAVE_LTRANS is set.
1573 (lto_main): Call lto_maybe_unlink() for intermediate WPA files.
1574 * ltrans-driver: Do not strip directory from output files.
1575
15762008-10-29 Doug Kwan <dougkwan@google.com>
1577
1578 * lto.c (free_decl): Call lto_symtab_clear_resolution when freeing
1579 DECL.
1580 * Make-lang.in (LTO_OBJS): Remove lto/lto-symtab.o
1581 (lto/lto-symtab.o): Remove rule.
1582 * lto-tree.h (struct lang_identifier): Remove LTO specific fields.
1583 (struct lang_decl): Remove RESOLUTION and add DUMMY in struct.
1584 (LANG_IDENTIFIER_CAST, LTO_IDENTIFIER_DECL, LTO_DECL_RESOLUTION):
1585 Remove macros.
1586 lto-symtab.c (File): Move up one level.
1587 lto-lang.c (cgraph.h): Remove include.
1588 (input_overwrite_node, input_node, input_edge, input_cgraph_1,
1589 input_cgraph): Move to lto-cgraph.c in gcc directory above.
1590 (LANG_HOOKS_INPUT_CGRAPH): Remove use of macro.
1591
15922008-10-24 Rafael Espindola <espindola@google.com>
1593
1594 * lto-function-in.c (get_resolution): Return LDPR_PREEMPTED_IR for
1595 non prevailing weak symbols.
1596
15972008-10-24 Rafael Espindola <espindola@google.com>
1598
1599 * lto-lang.c (input_cgraph_1): Iterate over nodes, not cgraph_nodes.
1600
16012008-10-24 Rafael Espindola <espindola@google.com>
1602
1603 * lto-lang.c (input_node): Avoid casts from pointers to ints of
1604 different types.
1605
16062008-10-23 Simon Baldwin <simonb@google.com>
1607
1608 * lto-lang.c (input_node): Save the node reference, rather than the
1609 node pointer, in node->inlined_to.
1610 (input_cgraph_1): Convert node references into node pointers.
1611
16122008-10-22 Diego Novillo <dnovillo@google.com>
1613 Rafael Espindola <espindola@google.com>
1614
1615 * lto.c (lto_resolution_read): Tidy.
1616 * lto-symtab.c (lto_symtab_prevailing_decl): Do not
1617 abort if RET is NULL.
1618
16192008-10-22 Doug Kwan <dougkwan@google.com>
1620
1621 * lto.c (lto_fixup_tree): Check for NOTHROW conflict only if
1622 exceptions flag is given.
1623 * lto-lang.c: (lto_init_options) Set default exceptions flag.
1624 (lto_init_eh): Remove exceptions flag initialization.
1625 (lto_init): Only call lto_init_eh if exceptions flag is set.
1626
16272008-10-21 Diego Novillo <dnovillo@google.com>
1628
1629 * lto.c: Tidy some formatting.
1630 * lto.h: Likewise.
1631
16322008-10-21 Simon Baldwin <simonb@google.com>
1633
1634 * lto-symtab.c: (lto_same_type_p): Types cannot be equal if one of
1635 them is NULL (but not the other).
1636
16372008-10-17 Diego Novillo <dnovillo@google.com>
1638
1639 * ltrans-driver: Divert output from make to a temporary file.
1640 Show it if the call to make failed.
1641
16422008-10-15 Diego Novillo <dnovillo@google.com>
1643
1644 * lto.c (lto_wpa_write_files): Reformat do-while loop.
1645 Do not print TEMP_FILENAME
1646 * ltrans-driver: Call make with -s.
1647
16482008-10-15 Diego Novillo <dnovillo@google.com>
1649
1650 * lto-symtab.c (lto_symtab_merge_decl): Do not force
1651 TREE_STATIC on global symbols.
1652
16532008-10-14 Ollie Wild <aaw@google.com>
1654
1655 * Make-lang.in (LTRANS_DRIVER_INSTALL_NAME): Remove.
1656 (LTRANS_DRIVER_EXE): Add.
1657 (lto.all.cross): Add LTRANS_DRIVER_EXE.
1658 (lto.all.encap): Add LTRANS_DRIVER_EXE.
1659 (lto.install.common): Remove ltrans-driver.
1660 (lto.mostlyclean): Add LTRANS_DRIVER_EXE.
1661 (LTRANS_DRIVER_EXE): New build rule.
1662 * config-lang.in (compilers): Add ltrans-driver.
1663
16642008-10-14 Diego Novillo <dnovillo@google.com>
1665
1666 * Make-lang.in (LTRANS_DRIVER_INSTALL_NAME): Disable transformation
1667 of program name.
1668
16692008-10-13 Ollie Wild <aaw@google.com>
1670
1671 * lang-spec.h (@lto): Replace lto1_options with cc1_options.
1672 * lto.c (lto_execute_ltrans): Add "-fno-wpa -fltrans -xlto" to CFLAGS.
1673 * ltrans-driver (LTRANS_FLAGS): Remove.
1674
16752008-10-08 Doug Kwan <dougkwan@google.com>
1676
1677 * lto.c (lto_fixup_tree): Remove ATTRIBUTE_UNUSED from DATA.
1678 Handle new tree codes RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE
1679 and TREE_BINFO. Also move code handling FUNCTION_DECL and VAR_DECL
1680 from lto_fixup_state to here.
1681 (lto_fixup_state): Take an lto_fixup_data_t object DATA instead of
1682 just a free-list. Fix up types also. Move decl merging code to
1683 lto_fixup_tree.
1684 (lto_fixup_state_aux): Change AUX to point to an lto_fixup_data_t
1685 object.
1686 (lto_fixup_decls): Use another pointer set to avoid multiple
1687 walking of nodes except for DECLs to be replaced. Pass an
1688 lto_fixup_data_t object to tree-walker.
1689
16902008-10-08 Rafael Espindola <espindola@google.com>
1691
1692 * lto-symtab.c (lto_symtab_set_resolution): New.
1693 (lto_symtab_merge_decl): Use lto_symtab_set_resolution and
1694 lto_symtab_get_resolution.
1695 (lto_symtab_prevailing_decl): Return decl for non public decls.
1696 (lto_symtab_get_resolution): New.
1697 * lto.c (lto_fixup_tree, lto_fixup_state): Remove unecessary checks.
1698
16992008-10-06 Rafael Espindola <espindola@google.com>
1700
1701 * lto-lang.c: Include cgraph.h.
1702 (input_overwrite_node, input_node, input_edge, input_cgraph_1,
1703 input_cgraph): Moved from lto-cgraph.c.
1704 (LANG_HOOKS_INPUT_CGRAPH): New.
1705
17062008-10-03 Rafael Espindola <espindola@google.com>
1707
1708 * lto.c (lto_fixup_tree, lto_fixup_state): Fix the FIXME.
1709
17102008-10-03 Rafael Espindola <espindola@google.com>
1711
1712 * lto-symtab.c (lto_symtab_overwrite_decl): Remove. Remove all calls.
1713 (lto_symtab_merge_decl): Update LTO_IDENTIFIER_DECL the reflect the
1714 prevailing definition. Don't mark TREE_NOTHROW differences.
1715 * lto.c (lto_fixup_tree): New.
1716 (lto_fixup_state): New.
1717 (lto_fixup_state_aux): New.
1718 (free_decl): New.
1719 (lto_fixup_decls): New.
1720 (lto_main): Call lto_fixup_decls.
1721
17222008-10-02 Ollie Wild <aaw@google.com>
1723
1724 * lang.opt (fltrans): Moved from common.opt. Remove RejectNegative
1725 and Init.
1726 (fwpa): Moved from common.opt. Remove RejectNegative and Init.
1727 * lto-lang.c (lto_post_options): Add validation and fixups for
1728 -fltrans and -fwpa.
1729
17302008-10-02 Rafael Espindola <espindola@google.com>
1731
1732 * lto-symtab.c (lto_symtab_merge_var, lto_symtab_merge_fn,
1733 lto_symtab_merge_decl): Return void.
1734 (lto_symtab_prevailing_decl): New.
1735
17362008-09-30 Rafael Espindola <espindola@google.com>
1737
1738 * lto-symtab.c (lto_symtab_compatible): Remove the check for already
1739 defined symbols.
1740 (lto_symtab_overwrite_decl): Copy LTO_DECL_RESOLUTION.
1741 (lto_symtab_merge_decl): Store symbol resolution in LTO_DECL_RESOLUTION.
1742 Check for already defined symbols.
1743 * lto-tree.h (lang_decl): Remove dummy and add resolution fields.
1744 (LTO_IDENTIFIER_RESOLUTION): Remove.
1745 (LTO_DECL_RESOLUTION): New.
1746
17472008-09-30 Rafael Espindola <espindola@google.com>
1748
1749 * lto.c (lto_read_decls): Use new input_tree signature.
1750
17512008-09-26 Doug Kwan <dougkwan@google.com>
1752
1753 * lto.c (lto_main): Call lto_fixup_nothrow_decls to fix up function
1754 bodies affected by exception attribute merging of DECLs.
1755 * lto-symtab.c (lto_symtab_merge_decl): Handle exception attribute
1756 merging.
1757
17582008-09-25 Rafael Espindola <espindola@google.com>
1759
1760 * Make-lang.in (PLUGIN_API_H, LTO_TREE_H): New.
1761 (lto/lto-lang.o, lto/lto.o, lto/lto-symtab.o) Use LTO_TREE_H.
1762 * lto-symtab.c (lto_symtab_compatible): New.
1763 (lto_symtab_overwrite_decl): New.
1764 (lto_symtab_merge_decl): Refactor to use the above functions
1765 and the resolution from lang_identifier.
1766 * lto-tree.h: Include plugin-api.h.
1767 (lang_identifier): Add resolution.
1768 (LTO_IDENTIFIER_RESOLUTION): New.
1769
17702008-09-25 Ollie Wild <aaw@google.com>
1771
1772 * lang.opt (fltrans-output-list=): New option.
1773 * lto.c (lto_execute_ltrans): Output file names to ltrans_output_list.
1774
17752008-09-25 Rafael Espindola <espindola@google.com>
1776
1777 * lto.c (lto_resolution_read): Initialize ret;
1778
17792008-09-24 Ollie Wild <aaw@google.com>
1780
1781 * lto.c (sys/mman.h): Move include.
1782 (lto_wpa_write_files): Return a list of written files.
1783 (lto_execute_ltrans): New function.
1784 (lto_main): Call lto_execute_ltrans.
1785 (ltrans-driver): New file.
1786 * lto-lang.c (DEFAULT_LTRANS_DRIVER): New macro.
1787 (DEAULT_LTRANS_DRIVER_LEN): New macro.
1788 (lto_init_options): Initialize ltrans_driver.
1789 (lto_handle_option): Fix incorrect default output value.
1790 * lang.opt (fltrans-driver=): New option.
1791 * Make-lang.in (LTRANS_DRIVER_INSTALL_NAME): New variable.
1792 (lto.install-common): Add lto/ltrans-driver.
1793
17942008-09-24 Rafael Espindola <espindola@google.com>
1795
1796 * Make-lang.in (LTO_OBJS): Add lto/common.o.
1797 (lto/lto.o): Depend on lto/common.h.
1798 (lto/common.o): New.
1799 * lang.opt (resolution): New.
1800 * lto-lang.c (resolution_file_name): New.
1801 (lto_handle_option): Handle OPT_resolution.
1802 * lto-symtab.c (lto_symtab_merge_decl): Add a resolution argument.
1803 (lto_symtab_merge_var,lto_symtab_merge_fn): Add a resolution argument.
1804 pass it to lto_symtab_merge_decl.
1805 * lto.c: Include common.h.
1806 (lto_read_decls): Add resolutions and resolutions_size arguments.
1807 Initialize data_in.globals_resolution and
1808 data_in.globals_resolution_size.
1809 (index_and_symbol_resolution): New.
1810 (lto_resolution_read): New.
1811 (lto_file_read): Add argument resolution_file.
1812 Read resolution.
1813 * lto.h (resolution_file_name): New.
1814
18152008-09-23 Rafael Espindola <espindola@google.com>
1816
1817 * common.c: Update description.
1818 * common.h: Update description.
1819
18202008-09-23 Rafael Espindola <espindola@google.com>
1821
1822 * common.c: Moved from lto-plugin.
1823 * common.h: Moved from lto-plugin.
1824
18252008-09-22 Doug Kwan <dougkwan@google.com>
1826
1827 * lto.c (VEC(bitmap,heap)): Declare.
1828 (lto_materialize_function): Handle WAP mode specially.
1829 (lto_add_inline_clones): New.
1830 (lto_add_all_inlinees): Changle algorithm and to use bitmaps. Also
1831 return a bitmap of inlined decls.
1832 (lto_wpa_write_files): Handle all DECLs brought in by inlining.
1833 (lto_main): Call reset_inline_failed to reset inlining states.
1834 Check call-graph after WPA inlining.
1835 * lto-lang.c (lto_init): Do not clear flag_generate_lto
1836 unconditionally.
1837
18382008-09-19 Doug Kwan <dougkwan@google.com>
1839
1840 lto.c (lto_main): Remove unsued wrapper code.
1841 lang-specs.h (@lto): Use lto1_options instead of cc1_options.
1842
18432008-09-19 Rafael Espindola <espindola@google.com>
1844
1845 * lto-symtab.c: Include lto-tree-in.h.
1846 * lto-tree.h (lto_symtab_merge_var, lto_symtab_merge_fn): Remove.
1847 * lto.h (lto_symtab_merge_var, lto_symtab_merge_fn): Remove
1848 * Make-lang.in (lto/lto-symtab.o): Add lto-tree-in.h.
1849
18502008-09-17 Paolo Bonzini <bonzini@gnu.org>
1851 Rafael Avila de Espindola <espindola@google.com>
1852
1853 * lto-lang.c (COMPOUND_LITERAL_EXPR_DECL_STMT,
1854 COMPOUND_LITERAL_EXPR_DECL): Remove.
1855 (emit_local_var): Remove.
1856 (lto_expand_expr): Remove.
1857 (lto_staticp): Remove.
1858 (LANG_HOOKS_EXPAND_EXPR): Remove.
1859 (LANG_HOOKS_STATICP): Remove.
1860
18612008-09-11 Diego Novillo <dnovillo@google.com>
1862
1863 * lto-lang.c: Include except.h and libfuncs.h.
1864 (lto_init_eh): New.
1865 (lto_init): Call it.
1866 Set flag_generate_lto to 0.
1867 * Make-lang.in (lto-lang.o): Add dependency on except.h
1868 and libfuncs.h.
1869
18702008-09-09 Bill Maddox <maddox@google.com>
1871
1872 * lto-lang.c: Include header file expr.h.
1873 (COMPOUND_LITERAL_EXPR_DECL_STMT,
1874 COMPOUND_LITERAL_EXPR_DECL): Copied from c-common.h.
1875 (emit_local_var): Copied from c-semantics.c.
1876 (lto_expand_expr, lto_staticp): Copied from c_expand_expr
1877 and c_staticp in c-common.c.
1878 (LANG_HOOKS_EXPAND_EXPR,LANG_HOOKS_STATICP): Redefined.
1879
18802008-09-08 Diego Novillo <dnovillo@google.com>
1881
1882 * lto-lang.c (lto_global_bindings_p): Return 1 during
1883 IPA passes.
1884
18852008-09-07 Diego Novillo <dnovillo@google.com>
1886
1887 * lto.c: Tidy formatting.
1888
18892008-08-04 Bill Maddox <maddox@google.com>
1890
1891 * lto-symtab.c (lto_symtab_merge_decl): Add comment.
1892
18932008-09-03 Doug Kwan <dougkwan@google.com>
1894
1895 lto.c (lto_add_all_inlinees): Reset FAILED_REASON of edges to
1896 CIF_OK instead of NULL.
1897
18982008-09-02 Diego Novillo <dnovillo@google.com>
1899 Simon Baldwin <simonb@google.com>
1900
1901 * lto-lang.c (lto_type_for_size): Rewrite. Adapt from
1902 c_common_type_for_size.
1903 (lto_type_for_mode): Remove ATTRIBUTE_UNUSED markers.
1904 (lto_init): Call linemap_add.
1905 (signed_and_unsigned_types): Remove.
1906
19072008-08-29 Diego Novillo <dnovillo@google.com>
1908
1909 * lto-lang.c (handle_noreturn_attribute): New local function.
1910 (handle_const_attribute): New local function.
1911 (handle_malloc_attribute): New local function.
1912 (handle_pure_attribute): New local function.
1913 (handle_novops_attribute): New local function.
1914 (handle_nonnull_attribute): New local function.
1915 (handle_nothrow_attribute): New local function.
1916 (handle_sentinel_attribute): New local function.
1917 (handle_type_generic_attribute): New local function.
1918 (handle_format_attribute): New local function.
1919 (handle_format_arg_attribute): New local function.
1920 (lto_attribute_table): Declare.
1921 (lto_format_attribute_table): Declare.
1922 (lto_init_attributes): New local function.
1923 (lto_define_builtins): Call it.
1924 Call targetm.init_builtins and build_common_builtin_nodes.
1925 (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Define.
1926 (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Define.
1927
19282008-08-28 Diego Novillo <dnovillo@google.com>
1929
1930 * Make-lang.in (lto-lang.o): Replace tree-gimple.h with
1931 $(GIMPLE_H).
1932 (lto-symtab.o): Add dependency on $(GIMPLE_H).
1933 * lto-lang.c: Include gimple.h instead of tree-gimple.h.
1934 * lto-symtab.c: Include gimple.h.
1935 * lto-tree.h (chain_next): Replace GENERIC_NEXT with
1936 TREE_CHAIN.
1937
19382008-08-27 Doug Kwan <dougkwan@google.com>
1939
1940 * lto.c (vec.h, bitmap.h, pointer-set.h, ipa-prop.h, ggc.h,
1941 gt-lto-lto.h): New includes.
1942 (lto_materialize_function): Do not read in function body in WPA mode.
1943 Format a line to fit in 80 columns.
1944 (lto_cgraph_node_sets): New garbage collected variable.
1945 (lto_1_to_1_map, lto_add_all_inlinees, lto_wpa_write_files):
1946 New functions.
1947 (lto_main): Initialize bitmap obstack. Add code to handle WPA mode.
1948 * Make-lang.in (LTO_H): Replace filename lto-section-in.h with
1949 variable LTO_SECTION_IN_H.
1950 (lto/lto.o): Include gt-lto-lto-c.h ggc.h ,VEC_H, BITMAP_H,
1951 pointer-set.h and IPA_PROP_H. Also replace filename lto-section-in.h
1952 with variable LTO_SECTION_IN_H.
1953 * config-lang.in (gtfiles): Add lto/lto.c.
1954 * lto-symtab.c (lto_symtab_merge_decl): Set DECL_CONTEXT of
1955 merged DECL_RESULT correctly.
1956
19572008-08-26 Bill Maddox <maddox@google.com>
1958
1959 * lto-lang.c Include tree-gimple.h.
1960 (lto_mark_addressable): Call mark_addressable rather than
1961 asserting.
1962 (lto_post_options): Suppress debug info generation.
1963 * Make-lang.in: Add dependency of lto-lang.o on tree-gimple.h.
1964
19652008-08-25 Bill Maddox <maddox@google.com>
1966
1967 * lto-symtab.c (lto_symtab_merge_decl): Remove a suspect
1968 assertion and leave an explanatory comment in its place.
1969
19702008-08-21 Doug Kwan <dougkwan@google.com>
1971
1972 * lto.c (preload_common_nodes): Call lto_get_common_nodes to get a list
1973 of common nodes instead of computing locallly.
1974 (lto_read_in_decl_state): New.
1975 (lto_read_decls): Change code for udpate in struct lto_decl_header.
1976 Read global and per-function in-decl states.
1977 * Make-lang.in (LTO_H): Update dependency.
1978 (lto/lto.o): Same.
1979 (lto-symtab.c): Merge (revision 139039)
1980 * lto-symtab.c (lto_symtab_merge_decl): Merge DECL_RESULT.
1981
19822008-08-21 Rafael Espindola <espindola@google.com>
1983
1984 * config-lang.in (target_libs): New.
1985
19862008-08-20 Bill Maddox <maddox@google.com>
1987
1988 * lto.c (current_lto_file): Remove GTY marker from static
1989 variable. Remove include of file gt-lto-lto.h.
1990 * Make-lang.in: Remove dependency of lto/lto.o on
1991 gt-lto-lto.h.
1992 * lto-elf.c (lto_file_close): Removed.
1993 (lto_elf_file_open): Use XCNEW instead of GGC_CNEW to
1994 allocate lto_elf_file object.
1995 (lto_elf_file_close): Free lto_elf_file object after close.
1996 * lto.h (struct lto_file_struct): Remove GTY marker.
1997 * config-lang.in: Remove lto/lto.h and lto/lto.c from
1998 gtfiles.
1999
20002008-08-20 Bill Maddox <maddox@google.com>
2001
2002 * lto.c (lto_read_decls): Provide dummy argument to input_tree
2003 to conform to its new signature.
2004 * lto-symtab.c (lto_symtab_merge_decl): Do not invoke ggc_free
2005 on discarded node here, now called in global_vector_fixup.
2006
20072008-08-09 Bill Maddox <maddox@google.com>
2008
2009 * lto.c (preload_common_nodes): Verify that fileptr_type_node
2010 has not been set to a front-end-specific value.
2011
20122008-08-05 Doug Kwan <dougkwan@google.com>
2013
2014 * Make-lang.in (lto-symtab.o): Add missing dependencies to fix
2015 build breakage.
2016
20172008-07-30 Bill Maddox <maddox@google.com>
2018
2019 * lto.c (lto_materialize_function): Call lto_original_decl_name.
2020 Remove obsolete comments.
2021 (lto_read_decls): Remove initialization of deleted field data_in.global.
2022 Tidy up comments.
2023 (lto_main): Remove redundant initialization of section_hash_table.
2024 * lto-elf.c: Removed obsolete comments.
2025 * lto.h: Tidy up comments.
2026 * lto-symtab.c (lto_least_common_multiple): New function.
2027 (lto_symtab_merge_decl): Merge variable alignments in some cases.
2028 Tidy up comments.
2029
20302008-07-25 Diego Novillo <dnovillo@google.com>
2031 Bill Maddox <maddox@google.com>
2032
2033 * lto.c: Re-order include files.
2034 Include lto-section-out.h.
2035 (preload_common_nodes): Add debugging output.
2036 Add new local INDEX_TABLE.
2037 Call preload_common_node.
2038 * Make-lang.in (lto.o): Add dependency on lto-section-out.h
2039
20402008-07-13 Bill Maddox <maddox@google.com>
2041
2042 * lto.c (lto_read_decls): Cast pointer to const char * to avoid
2043 unwanted scaling during pointer addition.
2044
20452008-07-11 Bill Maddox <maddox@google.com>
2046 Diego Novillo <dnovillo@google.com>
2047
2048 * lto.c (lto_read_decls): Fix C++ compatibility warnings.
2049 Make code const-correct.
2050 (lto_file_read): Fix C++ compatibility warnings.
2051 (lto_read_section_data): Fix C++ compatibility warnings.
2052 (lto_get_section_data): Use CONST_CAST to avoid warning when
2053 const pointer passed to free.
2054 * lto-elf.c (lto_elf_build_section_table): Fix C++
2055 compatibility warnings.
2056 (lto_elf_append_data): Fix C++ compatibility warnings. Use CONST_CAST
2057 to avoid warning assigning const pointer to d_buf field of Elf_Data.
2058 (lto_get_current_out_file): Fix C++ compatibility warnings.
2059
20602008-07-11 Diego Novillo <dnovillo@google.com>
2061
2062 * Make-lang.in (lto-warn): Define.
2063
20642008-07-03 Simon Baldwin <simonb@google.com>
2065
2066 * lto.c (lto_read_decls): Wrapped debug-only data items within #ifdef
2067 LTO_STREAM_DEBUGGING.
2068
20692008-06-27 Ollie Wild <aaw@google.com>
2070
2071 * lto-elf.c (lto-section-out.h): New include.
2072 (struct lto_elf_file): Remove bits member. Add scn, shstrtab_stream,
2073 and data members.
2074 (cached_file_attrs): New static variable.
2075 (lto_elf_get_shdr, lto_elf_free_shdr): Remove elf_file parameter.
2076 Use cached_file_attrs for checking bits.
2077 (lto_elf_build_section_table): Remove elf_file argument from
2078 lto_elf_get_shdr and lto_elf_free_shdr calls.
2079 (DEFINE_INIT_SHDR): New macro.
2080 (init_shdr32, init_shdr64): New functions defined via the
2081 DEFINE_INIT_SHDR macro.
2082 (lto_elf_begin_section_with_type): New function.
2083 (lto_elf_begin_section): New function.
2084 (lto_elf_append_data): New function.
2085 (lto_elf_end_section): New function.
2086 (DEFINE_VALIDATE_EHDR): New macro.
2087 (validate_ehdr32, validate_ehdr64): New functions defined via the
2088 DEFINE_VALIDATE_EHDR macro.
2089 (validate_file): New function.
2090 (DEFINE_INIT_EHDR): New macro.
2091 (init_ehdr32, init_ehdr64): New functions defined via the
2092 DEFINE_INIT_EHDR macro.
2093 (init_ehdr): New function.
2094 (lto_elf_file_open): Add support for writable files. Move some
2095 validation logic to validate_file.
2096 (lto_elf_file_close): Add support for writable files. Write file data
2097 and free data blocks.
2098 (current_out_file): New static variable.
2099 (lto_set_current_out_file): New function.
2100 (lto_get_current_out_file): New function.
2101 * lto.c (lto_main): Add writable argument to lto_elf_file_open calls.
2102 Add temporary initialization for testing ELF serialization.
2103 * lto.h (lto-section-out.h): New include.
2104 (struct lto_file_struct): Slight modification to comment.
2105 (lto_elf_file_open): Add writable parameter.
2106 (lto_elf_begin_section): New function declaration.
2107 (lto_elf_append_data): New function declaration.
2108 (lto_elf_end_section): New function declaration.
2109 (lto_set_current_out_file, lto_get_current_out_file): New function
2110 declarations.
2111 * lto-lang.c (LANG_HOOKS_BEGIN_SECTION): Set as lto_elf_begin_section.
2112 (LANG_HOOKS_APPEND_DATA): Set as lto_elf_append_data.
2113 (LANG_HOOKS_END_SECTION): Set as lto_elf_end_section.
2114 * Make-lang.in (LTO_H): Add lto-section-out.h.
2115
21162008-06-12 Ollie Wild <aaw@google.com>
2117
2118 * lto.h (struct lto_file_vtable_struct): Remove.
2119 (struct lto_file_struct): Remove vtable member.
2120 * lto-elf.c (lto_file_init): Remove vtable argument.
2121 (lto_elf_map_optional_lto_section): Remove.
2122 (lto_elf_unmap_section): Remove.
2123 (lto_elf_file_vtable): Remove.
2124 (lto_elf_file_open): Remove lto_elf_file_vtable argument from
2125 lto_file_init call.
2126 (lto_elf_find_section_data): Remove.
2127
21282008-06-11 Ollie Wild <aaw@google.com>
2129
2130 * lto.c (lto_file_read): Add const qualifier to data variable.
2131
21322008-06-11 Diego Novillo <dnovillo@google.com>
2133
2134 Merge from lto-streamber sub-branch.
2135
2136 2008-06-04 Ollie Wild <aaw@google.com>
2137
2138 * lto.c: Remove inclusion of dwarf2.h and dwarf2out.h.
2139 * Make-lang.in (lto.o): Remove dependency on dwarf2.h.
2140
2141 2008-05-28 Bill Maddox <maddox@google.com>
2142
2143 Replace the DWARF reader in the LTO front-end.
2144
2145 * lto.c: Include lto-tree-in.h, lto-tags.h.
2146 (enum DWARF2_class, DW_cl_constant, struct
2147 DWARF2_form_data, struct lto_context,
2148 lto_fd_init, lto_info_fd_init,
2149 lto_abbrev_fd_init, lto_info_fd_close,
2150 lto_file_init, lto_file_close,
2151 lto_file_corrupt_error, lto_abi_mismatch_error,
2152 LTO_CHECK_INT_VAL, LTO_READ_TYPE,
2153 lto_read_uleb128, lto_read_sleb128,
2154 lto_read_initial_length, lto_abbrev_read_attrs,
2155 lto_abbrev_read, lto_abbrev_read_lookup,
2156 lto_read_section_offset,
2157 lto_read_comp_unit_header, find_cu_for_offset,
2158 lto_get_file_name,
2159 lto_resolve_reference,lto_read_form,
2160 attribute_value_as_int,
2161 make_signed_host_wide_int,
2162 attribute_value_as_constant, lto_cache_hash,
2163 lto_cache_eq, lto_cache_store_DIE,
2164 lto_cache_lookup_DIE, lto_find_integral_type,
2165 lto_find_integral_type_1,
2166 LTO_BEGIN_READ_ATTRS_UNCHECKED,
2167 LTO_BEGIN_READ_ATTRS, LTO_END_READ_ATTRS,
2168 lto_unsupported_attr_error, lto_get_identifier,
2169 lto_read_referenced_type_DIE,
2170 lto_read_compile_unit_DIE,
2171 lto_read_array_type_DIE,
2172 lto_read_structure_union_class_type_DIE,
2173 lto_read_enumerator_DIE,
2174 lto_read_enumeration_type_DIE,
2175 lto_read_only_for_child_DIEs,
2176 lto_read_only_for_child_DIEs,
2177 lto_read_member_DIE, lto_read_abbrev,
2178 lto_read_variable_formal_parameter_constant_DIE,
2179 lto_get_body): Removed.
2180 (preload_common_nodes): New function.
2181 (lto_read_decls): Convert for new global streamer.
2182 (lto_materialze_file_data,
2183 lto_read_subroutine_type_subprogram_die,
2184 lto_read_unspecified_parameters_DIE,
2185 lto_read_typedef_DIE,
2186 lto_read_pointer_reference_type_DIE,
2187 lto_read_subrange_type_DIE,
2188 lto_read_base_type_DIE,
2189 lto_read_const_volatile_restrict_type_DIE,
2190 lto_read_namespace_DIE,
2191 lto_read_unspecified_type_DIE, lto_read_DIE,
2192 lto_read_child_DIEs, lto_collect_child_DIEs):
2193 Removed.
2194 (lto_info_read, lto_set_cu_context): Removed.
2195 (lto_file_read): Convert for new global streamer.
2196 (lto_resolve_type_ref, lto_read_DIE_at_ptr,
2197 lto_resolve_var_ref, lto_resolve_fn_ref,
2198 lto_resolve_field_ref, lto_resolve_typedecl_ref,
2199 lto_resolve_namespacedecl_ref): Removed.
2200 (lto_file_init, lto_file_close): Moved to lto-elf.c.
2201 * lto-tree.h (lto_symtab_merge_var,
2202 lto_symtab_mergee_fun): Declare here.
2203 * lto-elf.c (lto_file_init, lto_file_close): Moved from lto.c.
2204 (lto_elf_file_open): Removed code to read DWARF debug sections.
2205 * lto.h (lto_context, DWARF2_attr, DWARF2_abbrev,
2206 DWARF2_CompUnit, lto_die_ptr,
2207 lto_die_cache_entry, lto_fd, lto_info_fd,
2208 lto_abbrev_fd): Removed.
2209 (lto_file): Removed debug_info and debug_abbrev fields.
2210 (lto_ref): Removed.
2211 (lto_file_init, lto_file_close,
2212 lto_resolve_type_ref, lto_resolve_var_ref,
2213 lto_resolve_fn_ref, lto_resolve_field_ref,
2214 lto_resolve_typedecl_ref,
2215 lto_resolve_namespacedecl_ref,
2216 lto_get_file_name): Removed declarations.
2217 (lto_symtab_merge_var, lto_symtab_merge_fn):
2218 Declarations moved to lto-tree.h.
2219 * lto-symtab.c (lto_compatible_attributes_p):
2220 Lobotomize this, as it barfs on "Hello, world!".
2221 * lto-section-out.c: Include lto-tree-out.h.
2222 (lto_hash_global_slot_node,
2223 lto_eq_global_slot_node, preload_common_nodes,
2224 write_global_stream, write_global_references):
2225 New functions.
2226 (produce_asm_for_decls): Convert for new global streamer.
2227 * lto-section-out.h (lto_hash_global_slot_node,
2228 lto_eq_global_slot_node): Declare.
2229
22302008-06-07 Kenneth Zadeck <zadeck@naturalbridge.com>
2231 Jan Hubicka <jh@suse.cz>
2232
2233 * lto.c (sys/mman.h, tree-pass.h): New includes.
2234 (lto_materialize_constructors_and_inits,
2235 lto_materialize_function): Keeps length of section.
2236 (lto_materialize_cgraph): Removed.
2237 (lto_read_decls): Initialize fd field.
2238 (lto_file_read): Different return type and removed much code to
2239 lto_main.
2240 (page_mask): New variable.
2241 (lto_read_section_data, get_section_data, free_section_data): New
2242 functions.
2243 (lto_main): Now calls pass manager, sets the hooks so that the ipa
2244 passes can get the section data.
2245
22462008-05-27 Kenneth Zadeck <zadeck@naturalbridge.com>
2247
2248 * lto.h (lto_read_decls): Made local.
2249 (lto_input_function_body, lto_input_constructors_and_inits,
2250 lto_input_cgraph): Declarations moved to lto-section-in.h.
2251 * lto-section-in.c: Moved to .. .
2252 * lto-cgraph-in.c: Ditto.
2253 * lto-section-in.h: Ditto.
2254 * lto-function-in.c: Ditto.
2255 * lto-lang.c (lto_handle_option): Added ATTRIBUTE_UNUSED to parms.
2256 (lto_insert_block): Removed.
2257 (LANG_HOOKS_INSERT_BLOCK): Removed.
2258 * Make-lang.in (lto-cgraph-in.o, lto-function-in.o,
2259 lto-section-in.o): Rules moved to lto/Makefile.in.
2260
2261
22622008-05-16 Ollie Wild <aaw@google.com>
2263
2264 * lto-lang.c (tree-inline.h): Include.
2265 (lto_post_options): New function.
2266 (LANG_HOOKS_POST_OPTIONS): Define.
2267 * lto-cgraph-in.c (overwrite_node): Set node->global.insns.
2268 * lto-function-in.c (input_bb): Set TREE_BLOCK (stmt).
2269
22702008-05-13 Diego Novillo <dnovillo@google.com>
2271
2272 * lto-function-in.c (input_ssa_names): Call
2273 make_ssa_name_fn instead of make_ssa_name.
2274
22752008-05-12 Diego Novillo <dnovillo@google.com>
2276
2277 * lto-cgraph-in.c (overwrite_node): Update references to
2278 inline summary fields.
2279 * lto-function-in.c (input_expr_operand): Do not handle
2280 STRUCT_FIELD_TAG.
2281
22822008-05-09 Ollie Wild <aaw@google.com>
2283
2284 * lang.opt: New file.
2285 * lto-lang.c (lto_init_options): New function.
2286 (lto_handle_option): New function.
2287 (lto_init): Move initialization of flag_unit_at_a_time to
2288 lto_init_options.
2289 (LANG_HOOKS_INIT_OPTIONS): Define.
2290 (LANG_HOOKS_HANDLE_OPTION): Define.
2291
22922008-04-29 Ollie Wild <aaw@google.com>
2293
2294 * lto.c (lto_read_namespace_DIE): New function.
2295 (lto_read_DIE): Add lto_read_namespace_DIE callback. Cache
2296 NAMESPACE_DECL DIE's.
2297 (lto_resolve_namespacedecl_ref): New function.
2298 * lto.h (lto_resolve_namespacedecl_ref): New function.
2299 * lto-section-in.c (lto_read_decls): Read namespace declarations.
2300 * lto-section-in.h (struct lto_file_decl_data): Add namespace_decls
2301 and num_namespace_decls.
2302 * lto-function-in.c (input_expr_operand): Add NAMESPACE_DECL case.
2303 * lto-lang.c (lto_init_ts): New function.
2304 (LANG_HOOKS_INIT_TS): Set as lto_init_ts.
2305
23062008-04-16 Ollie Wild <aaw@google.com>
2307
2308 * lto-function-in.c (input_type_ref): Updated function description.
2309
23102008-04-16 Ollie Wild <aaw@google.com>
2311
2312 * lto-function-in.c (input_type_ref_1): New function.
2313 (input_type_ref): Split into two functions.
2314 (input_function): Add support for type contexts.
2315
23162008-04-16 Ollie Wild <aaw@google.com>
2317
2318 * lto.c (lto_materialize_function): Use DECL_ASSEMBLER_NAME to compute
2319 section name
2320
23212008-04-16 Ollie Wild <aaw@google.com>
2322
2323 * lto.c (lto_read_compile_unit_DIE): Add DW_LANG_C_plus_plus to the
2324 list of supported languages.
2325
23262008-03-25 Kenneth Zadeck <zadeck@naturalbridge.com>
2327
2328 Merge with mainline @133491.
2329
23302008-03-05 Kenneth Zadeck <zadeck@naturalbridge.com>
2331 Jan Hubicka <jh@suse.cz>
2332
2333 * lto.c (lto_info_fd_init, lto_info_fd_close): Get rid of
2334 fd->unmaterialized_fndecls.
2335 (lto_get_file_name, lto_materialize_cgraph): New function.
2336 (lto_materialize_constructors_and_inits,
2337 lto_materialize_function): Read info directly from elf file.
2338 (lto_file_read): Made local and initialize dictionary so that
2339 other lto sections can be read without reprocessing the elf file.
2340 (lto_main): Read all functions after all files have been processed
2341 for their types, globals and cgraph.
2342 * Make-lang.in (lto.o, lto-cgraph-in.c, lto-section-in): Changed
2343 dependencies.
2344 * lto-elf.c (lto_elf_file): Removed strtab, symtab fields.
2345 (hash_name, eq_name, lto_elf_build_section_table): New functions.
2346 (lto_elf_read_symtab): Removed function.
2347 (lto_elf_file_open): Removed call to lto_elf_read_symtab.
2348 * lto.h (lto_info_fd_struct): Removed unmaterialized_fndecls.
2349 (lto_file_read): Made local.
2350 (lto_get_file_name, lto_elf_build_section_table,
2351 lto_input_cgraph):
2352 New function.
2353 * lto-section-in.c (lto_read_section_data, lto_get_section_data):
2354 New functions.
2355 (lto_read_decls): Get the file name.
2356 * lto-cgraph-in.c: New file.
2357 * lto-function-in.c (tag_to_expr): Stops at LTO_tree_last_tag.
2358 (input_expr_operand, lto_read_body): Set lto_debug_context.tag_names.
2359 (input_labels): Fixed latent sizeof issue.
2360 (input_function): Build stmt array to set call sites into cgraph
2361 edges.
2362 (lto_read_body): Reset cfun->curr_properties.
2363 * lto_section_in.h (lto_section_slot): New structure.
2364 (section_hash_table.lto_file_decl_data): New field.
2365
2366
23672008-02-09 Kenneth Zadeck <zadeck@naturalbridge.com>
2368
2369 * lto.c (lto_read_variable_formal_parameter_const): Remove code to
2370 reconstruct static initializers.
2371 (lto_get_body, lto_materialize_function): Add lto_section_type as
2372 a parameter.
2373 (lto_materialize_constructors_and_inits,
2374 lto_materialize_file_data): New function.
2375 (lto_materialize_function,
2376 lto_read_subroutine_type_subprogram_DIE): Renamed unmap_fn_body to
2377 unmap_section and map_fn_body to map_section.
2378 (lto_set_cu_context): Process functions and static inits
2379 differently.
2380 * Make-lang.in (LTO_H, lto/lto-function-in.o,
2381 lto/lto-section-in.o): Update dependencies.
2382 * lto/lto-elf.c (lto_elf_map_optional_lto_section): Add
2383 lto_section_type parameter.
2384 (lto_elf_unmap_fn_body): Renamed to lto_elf_unmap_section.
2385 * lto.h (lto_file_vtable_struct): Removed two of the fields and
2386 renamed the other two so that there is only one map function and
2387 one unmap function and each takes a section type parameter.
2388 (lto_read_function_body): Renamed to lto_input_function_body and
2389 added file_data parameter.
2390 (lto_read_var_init): Removed.
2391 (lto_input_constructors_and_inits): New function.
2392 * lto-section-in.c (lto_read_decls): New function.
2393 * lto-function-in.c (data_in): Moved fields field_decls, fn_decls,
2394 var_decls, type_decls, types to lto_file_decl_data.
2395 (input_type_ref, input_expr_operand, lto_read_body): Get
2396 field_decls, fn_decls, var_decls, type_decls, types from different
2397 structure.
2398 (input_globals, input_constructor, lto_read_var_init): Removed.
2399 (input_constructors_or_inits): New function.
2400 (lto_read_function_body, lto_input_constructors_and_inits):
2401 Renamed to lto_input_function_body and takes file_data parameter.
2402 * lto-section-in.h (lto_file_decl_data): New structure.
2403
24042008-01-28 Kenneth Zadeck <zadeck@naturalbridge.com>
2405
2406 * lto-function-in.c (input_globals.c): Changed input type to
2407 lto_function_header.
2408 (input_bb): Removed code to deserialize the stmt number.
2409 (input_function): Renumber all stmts after they are input.
2410 (lto_read_body, lto_read_function_body, lto_read_var_init):
2411 Changed to used new header format and enum section_type.
2412 *lto-lang.c (success): Removed.
2413
24142008-01-28 Nathan Froyd <froydnj@codesourcery.com>
2415
2416 * lto-elf.c (lto_elf_lookup_sym): Remove unused function.
2417 (lto_elf_free_sym): Likewise.
2418
2419 * lto-elf.c (lto_elf_read_var_init): Remove unused function.
2420 (lto_elf_build_init): Likewise.
2421
24222008-01-14 Kenneth Zadeck <zadeck@naturalbridge.com>
2423
2424 * lto-read.c: Renamed to lto-function-in.c.
2425 (input_1_unsigned): Moved to lto-section-in.c and renamed
2426 lto_input_1_unsigned.
2427 (input_uleb128): Moved to lto-section-in.c and renamed
2428 lto_input_uleb128.
2429 (input_widest_uint_uleb128): Moved to lto-section-in.c and renamed
2430 lto_input_widest_uint_uleb128.
2431 (input_sleb128): Moved to lto-section-in.c and renamed
2432 lto_input_sleb128.
2433 (input_integer): Moved to lto-section-in.c and renamed
2434 lto_input_integer.
2435 (debug_in_fun): Moved to lto-section-in.c and renamed
2436 lto_debug_in_fun.
2437 (input_block): Moved to lto-section-in.h and renamed
2438 lto_input_block.
2439 (input_expr_operand): Fixed to allow lists with more than one
2440 element.
2441 * lto-section-in.h: New file.
2442 * lto-section-in.c: New file with changes from above.
2443 * Make-lang.in (lto-read.o): Renamed lto-function-in.c.
2444 (lto-section-in.o): New rule.
2445
24462007-12-29 Nathan Froyd <froydnj@codesourcery.com>
2447
2448 * lto-read.c (input_expr_operand): Mark static and external
2449 VAR_DECLs as needed.
2450
24512007-12-29 Nathan Froyd <froydnj@codesourcery.com>
2452
2453 * lto-read.c (input_integer): Use the correct shift amount.
2454
24552007-12-29 Nathan Froyd <froydnj@codesourcery.com>
2456
2457 * lto-lang.c (lto_pushdecl): Do nothing instead of aborting.
2458 (LANG_HOOKS_NAME): Define.
2459
24602007-12-27 Nathan Froyd <froydnj@codesourcery.com>
2461
2462 * lto.c (lto_find_integral_type): Define as a macro. Rename the
2463 original function to...
2464 (lto_find_integral_type_1): ...this. Consult UNSIGNEDP if we
2465 don't have a base type.
2466 (lto_read_enumeration_type_DIE): Examine the values of the
2467 enumeration to determine whether we can use an unsigned type for
2468 the base type of the enumeration.
2469
24702007-12-24 Nathan Froyd <froydnj@codesourcery.com>
2471
2472 * lto.c (lto_read_structure_union_class_type_DIE): Set TYPE_MODE
2473 and TYPE_ALIGN on UNION_TYPEs as soon as possible.
2474
24752007-12-22 Nathan Froyd <froydnj@codesourcery.com>
2476
2477 * lto-lang.c (lto_types_compatible_p): New function.
2478 (LANG_HOOKS_TYPES_COMPATIBLE_P): Define.
2479
24802007-12-22 Nathan Froyd <froydnj@codesourcery.com>
2481 Kenneth Zadeck <zadeck@naturalbridge.com>
2482
2483 * lto-read.c (input_expr_operand): Fixed uninitialize var warning.
2484 (input_local_vars): Read in DECL_INITIAL and context for local
2485 statics that need to be put in unexpanded_vars_list.
2486
24872007-12-21 Nathan Froyd <froydnj@codesourcery.com>
2488
2489 * lto-read.c (input_real): Use a separate null-terminated buffer
2490 for calling real_from_string.
2491 (input_expr_operand): If we take the address of a FUNCTION_DECL,
2492 tell cgraph that it's needed.
2493
24942007-12-19 Doug Kwan <dougkwan@google.com>
2495
2496 * lto.c (lto_read_base_type_DIE): Handle complex integer types.
2497
24982007-12-18 Nathan Froyd <froydnj@codesourcery.com>
2499
2500 * lto.c (lto_read_DIE): Call lto_read_only_for_child_DIEs instead.
2501 (lto_file_read): Reset the members of 'context' every time we read
2502 a toplevel DIE, with special attention to last_param_type.
2503
25042007-12-18 Nathan Froyd <froydnj@codesourcery.com>
2505
2506 * lto.c (lto_read_subroutine_type_subprogram_DIE): Initialize
2507 'declaration'. Set the assembler name for non-public functions.
2508
25092007-12-17 Kenneth Zadeck <zadeck@naturalbridge.com>
2510
2511 * lto_read.c (data_in.unexpanded_indexes): New array.
2512 (input_local_var): Added code to read in unexpanded_var_list
2513 indexes for variables. Only read in DECL_CHAIN field for
2514 parameters.
2515 (input_local_vars): Added code to rebuild unexpanded_var_list in
2516 order using unexpanded_indexes.
2517 (input_function): Added code to set DECL_CONTEXT for functions.
2518
25192007-12-13 Doug Kwan <dougkwan@google.com>
2520
2521 * lto.c (lto_read_pointer_reference_type_DIE): Handle optional name
2522 in pointer and reference types.
2523
25242007-12-13 Nathan Froyd <froydnj@codesourcery.com>
2525
2526 * lto-read.c (input_expr_operand): Use DECL_RESULT when reading a
2527 RESULT_DECL.
2528
25292007-12-13 Nathan Froyd <froydnj@codesourcery.com>
2530
2531 * lto.c (lto_read_array_type_DIE): Return the cached DIE if we've
2532 already read the DIE.
2533 (lto_get_body): New function, split out from...
2534 (lto_materialize_function): ...here. Call it.
2535 (lto_read_subroutine_type_subprogram_DIE): Call lto_get_body to
2536 determine DECL_EXTERNAL.
2537 * lto-symtab.c (lto_symtab_merge_decl): Merge the DECL_RESULTs of
2538 FUNCTION_DECLs when necessary. Use the type of the actual
2539 function definition if we are unable to easily merge types. Ignore
2540 spurious DECL_MODE mismatches on VAR_DECLs. Merge DECL_MODEs when
2541 necessary.
2542
25432007-12-13 Nathan Froyd <froydnj@codesourcery.com>
2544
2545 * lto-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define.
2546
25472007-12-12 Bill Maddox <maddox@google.com>
2548
2549 Revert
2550 2007-12-07 Bill Maddox <maddox@google.com>
2551
2552 * lto.c (lto_str_fd_init): New function.
2553 (lto_str_fd_close): New function.
2554 (lto_file_init): Call lto_str_fd_init.
2555 (lto_file_close): Call lto_str_fd_close.
2556 (lto_str_read): New function. Read debug string table.
2557 (lto_str_lookup): New function. Get string for debug
2558 string table offset.
2559 (lto_read_form): Recognize DW_FORM_strp.
2560 (lto_file_read): Invoke lto_str_read.
2561
2562 * lto-elf.c (lto_elf_file_open): Read raw section data
2563 for the .debug_str section, if present.
2564
2565 * lto.h (struct lto_str_fd_struct): New struct.
2566 (struct lto_file_struct): Added new field DEBUG_STR
2567 to hold the file descriptor for the debug string table.
2568
25692007-12-07 Bill Maddox <maddox@google.com>
2570
2571 * lto.c (lto_str_fd_init): New function.
2572 (lto_str_fd_close): New function.
2573 (lto_file_init): Call lto_str_fd_init.
2574 (lto_file_close): Call lto_str_fd_close.
2575 (lto_str_read): New function. Read debug string table.
2576 (lto_str_lookup): New function. Get string for debug
2577 string table offset.
2578 (lto_read_form): Recognize DW_FORM_strp.
2579 (lto_file_read): Invoke lto_str_read.
2580
2581 * lto-elf.c (lto_elf_file_open): Read raw section data
2582 for the .debug_str section, if present.
2583
2584 * lto.h (struct lto_str_fd_struct): New struct.
2585 (struct lto_file_struct): Added new field DEBUG_STR
2586 to hold the file descriptor for the debug string table.
2587
25882007-12-07 Nathan Froyd <froydnj@codesourcery.com>
2589
2590 * lto-read.c (input_cfg): Call init_empty_tree_cfg_for_function.
2591 Grow the basic_block_info and label_to_block_map vectors if
2592 necessary. Read in the block chain.
2593
25942007-12-06 Nathan Froyd <froydnj@codesourcery.com>
2595
2596 * lto.c (lto_read_DIE): Set TYPE_ALIAS_SET where necessary.
2597
25982007-12-06 Nathan Froyd <froydnj@codesourcery.com>
2599
2600 * lto.c (lto_read_form): Add DW_cl_address for DW_AT_const_value.
2601
26022007-12-06 Nathan Froyd <froydnj@codesourcery.com>
2603
2604 * lto-read.c (input_expr_operand): Don't check for MTAGs.
2605 (lto_read_body): Don't declare PROP_alias.
2606
26072007-12-06 Nathan Froyd <froydnj@codesourcery.com>
2608
2609 * lto-symtab.c (lto_symtab_merge_decl): Handle FUNCTION_DECLs without
2610 argument type information.
2611
26122007-12-03 Nathan Froyd <froydnj@codesourcery.com>
2613
2614 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Set
2615 TREE_THIS_VOLATILE if the associated type is a volatile type.
2616 (lto_materialize_function): Remove call to init_ssa_operands.
2617 * lto-read.c (input_expr_operand): Add SSA_NAME_VAR as a referenced
2618 variable when reading an SSA_NAME. Do the same when reading a
2619 RESULT_DECL, a RETURN_EXPR, or an MTAG.
2620 (input_cfg): Call init_ssa_operands.
2621 (input_ssa_names): Set the default def of an SSA_NAME if necessary.
2622 Move call to init_tree_ssa...
2623 (lto_read_body): ...here. Use push_cfun and pop_cfun. Call
2624 add_referenced_var on any variables referenced from the body of the
2625 function. Inform the rest of the compiler we are in SSA form and
2626 inform later passes about the current properties.
2627
26282007-11-30 Nathan Froyd <froydnj@codesourcery.com>
2629
2630 * lto.c (lto_materialize_function): Add FIXME.
2631
26322007-11-29 Nathan Froyd <froydnj@codesourcery.com>
2633
2634 * lto-lang.c (enum built_in_attribute): New enum.
2635 (flag_no_builtin, flag_no_nonansi_builtin, flag_isoc94, flag_isoc99,
2636 built_in_attributes): New variables.
2637 (def_builtin_1): New function.
2638 (lto_define_builtins): #define DEF_BUILTIN and include builtins.def.
2639
26402007-11-28 Nathan Froyd <froydnj@codesourcery.com>
2641
2642 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Set
2643 DECL_SOURCE_LOCATION for debugging purposes.
2644 (lto_read_member_DIE): Set DECL_SOURCE_LOCATION. If we have read a
2645 bitfield, use the type specified by the DIE for TREE_TYPE and defer
2646 laying out the decl until later.
2647 (lto_read_subroutine_type_subprogram_DIE): Compare the function's
2648 name with DECL_ASSEMBLER_NAME. Set DECL_SOURCE_LOCATION and
2649 TREE_ADDRESSABLE.
2650 * lto-read.c (input_expr_operand): Set TREE_ADDRESSABLE on the
2651 operand of an ADDR_EXPR.
2652 * lto-lang.c (enum lto_builtin_type): New enum.
2653 (builtin_type): New typedef.
2654 (builtin_types, string_type_node, const_string_type_node,
2655 wint_type_node, intmax_type_node, uintmax_type_node,
2656 signed_size_type_node): New variables.
2657 (def_fn_type, builtin_type_for_size, lto_define_builtins,
2658 lto_build_c_type_nodes): New functions.
2659 (lto_init): Initialize builtin types.
2660 (lto_set_decl_assembler_name): Let the target machine mangle the
2661 name if the decl is TREE_PUBLIC, otherwise uniquify it.
2662
26632007-11-21 Nathan Froyd <froydnj@codesourcery.com>
2664
2665 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Don't
2666 set TREE_ADDRESSABLE. Do set DECL_COMDAT. Set TREE_READONLY if
2667 the type is a constant type. Set the assembler name and inform
2668 the rest of the compiler about the new decl if the decl is not
2669 public.
2670 (lto_read_subroutine_type_subprogram_DIE): Don't check for equivalency
2671 of DECL_ASSEMBLER_NAME when determining if we have a builtin. Don't
2672 try to read in function bodies for functions that already have bodies.
2673 * lto-symtab.c (lto_same_type_p): Check for unbounded array
2674 equivalency.
2675 (lto_symtab_merge_decl): Don't merge decls that aren't TREE_PUBLIC.
2676 Check for whether we matched a builtin function type before calling
2677 lto_same_type_p on the generated type. Permit cases where the
2678 declaration of an array is unbounded, but the definition is bounded.
2679 Don't combine TREE_PUBLIC flags. Copy over DECL_SIZE and
2680 DECL_SIZE_UNIT if necessary.
2681
26822007-11-16 Kenneth Zadeck <zadeck@naturalbridge.com>
2683
2684 * lto-read.c (input_expr_operand): Get types right
2685 for COMPLEX_CST.
2686
26872007-11-16 Kenneth Zadeck <zadeck@naturalbridge.com>
2688
2689 * lto-read.c (make_new_block, input_cfg): Properly set
2690 n_basic_blocks.
2691
26922007-11-16 Nathan Froyd <froydnj@codesourcery.com>
2693
2694 * lto.c (lto_read_array_type_DIE): Handle DIEs with DW_AT_GNU_vector
2695 set properly by building a VECTOR_TYPE instead of an ARRAY_TYPE.
2696
26972007-11-16 Nathan Froyd <froydnj@codesourcery.com>
2698
2699 * lto.c (lto_read_base_type_DIE): Use make_bitfield_integer_type to
2700 construct the integer type for bitfields.
2701
27022007-11-16 Kenneth Zadeck <zadeck@naturalbridge.com>
2703
2704 * lto-read.c (data_in.current_node_has_loc): Removed.
2705 (input_line_info): Returns true if node needs line set.
2706 (set_line_info): Always sets line if called.
2707 (clear_line_info): Removed reference to current_node_needs_loc.
2708 (input_expr_operand): Keeps track locally if current node needs a loc.
2709 (input_local_var): Added code to handle DECL_INITIAL for
2710 static local vars. Only set loc if necessary.
2711
27122007-11-15 Nathan Froyd <froydnj@codesourcery.com>
2713
2714 * lto.c (lto_read_subroutine_type_subprogram_DIE): Fix thinko'd
2715 DECL_CONTEXT.
2716
27172007-11-15 Nathan Froyd <froydnj@codesourcery.com>
2718
2719 * lto.c: Include langhooks.h.
2720 (lto_find_integral_type): Rework logic to handle the case where
2721 got_byte_size is true, but the bitsize requested and that of the
2722 base_type doesn't match.
2723 (lto_read_variable_formal_parameter_constant_DIE): Only check for
2724 asm_name if we are creating a VAR_DECL.
2725 (lto_materialize_function): Set DECL_EXTERNAL if we can't find a
2726 definition.
2727 (lto_read_subroutine_type_subprogram_DIE): Check for a builtin
2728 function reference and use the builtin's decl if so. Set the
2729 DECL_CONTEXT of the RESULT_DECL for the function.
2730 * lto-lang.c (registered_builtin_fndecls): New variable.
2731 (lto_getdecls): Return it.
2732 (lto_builtin_function): Chain the new decl onto
2733 registered_builtin_fndecls.
2734
27352007-11-15 Kenneth Zadeck <zadeck@naturalbridge.com>
2736
2737 * lto-read.c (process_tree_flags, lto_static_init_local):
2738 Renamed to ADD_CLASS_EXPR_FLAG. ADD_CLASS_DECL_FLAG New Macro.
2739 (input_line_info, clear_line_info): Fixed new line number code.
2740 (input_expr_operand): Added type to SWITCH_EXPR.
2741 (lto_read_body): Properly initialized data_in.
2742 Clear line info when leaving.
2743
27442007-11-13 Diego Novillo <dnovillo@google.com>
2745
2746 * lto.c (lto_read_variable_formal_parameter_constant_DIE):
2747 Initialize ARTIFICIAL.
2748 (lto_read_subroutine_type_subprogram_DIE): Initialize
2749 SAVED_SCOPE.
2750 * lto-read.c (set_line_info): Remove ; from calls to
2751 LINEMAP_POSITION_FOR_COLUMN.
2752
27532007-11-13 Kenneth Zadeck <zadeck@naturalbridge.com>
2754
2755 * lto-read.c (input_type_ref): Renamed from get_type_ref.
2756 (input_expr_operand, input_local_var): Renamed get_type_ref to
2757 input_type_ref.
2758 (input_expr_operand): Get the types correct for
2759 vector-cst. Get SSA_NAME_DEF_STMT correct for return_exprs.
2760
27612007-11-13 Doug Kwan <dougkwan@google.com>
2762
2763 * lto-read.c (input_widest_uint_uleb128): New function.
2764 (input_tree_flags, process_tree_flags, input_line_info,
2765 input_expr_operand, input_local_var, input_phi, input_ssa_names):
2766 Change to use lto_flags_type and BITS_PER_LTO_FLAGS_TYPES instead of
2767 unsigned HOST_WIDE_INT and HOST_BITS_PER_WIDE_INT.
2768 (lto_static_init_local): Add code to assert that lto_flags_type is
2769 wide enough.
2770
27712007-11-13 Nathan Froyd <froydnj@codesourcery.com>
2772
2773 * lto.c (lto_read_array_type_DIE): Handle DW_AT_GNU_vector.
2774 (lto_read_subroutine_type_subprogram_DIE): Handle
2775 DW_AT_static_link and DW_AT_specification. Return the
2776 specification if present.
2777 (lto_read_base_type_DIE): Handle DW_ATE_complex_float.
2778
27792007-11-13 Nathan Froyd <froydnj@codesourcery.com>
2780
2781 * lto-lang.c: Include target.h.
2782 (registered_builtin_types): New variable.
2783 (lto_type_for_mode): Increase number of modes handled.
2784 (lto_builtin_function): Fix argument list and return the decl.
2785 (lto_register_builtin_type): New function.
2786 (lto_init): Initialize target builtins and language-independent
2787 nodes.
2788 (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define.
2789
27902007-11-13 Kenneth Zadeck <zadeck@naturalbridge.com>
2791
2792 * lto-read.c (input_expr_operand): Added code to properly handle
2793 index filed. Added new RANGE_EXPR case.
2794
27952007-11-11 Kenneth Zadeck <zadeck@naturalbridge.com>
2796
2797 * lto-read.c (ADD_FUNC_FLAG): Deleted macro.
2798 (data_in): Added current_node_has_loc field.
2799 (input_line_info, set_line_info, clear_line_info): Added a support
2800 for USE_MAPPED_LOCATION and not adding line numbers to nodes that
2801 did not have on on the source side.
2802 (input_expr_operand): Make sure that GIMPLE_MODIFY_STMTS get line
2803 numbers too.
2804
28052007-11-09 Doug Kwan <dougkwan@google.com>
2806
2807 * lto-read.c (input_expr_operand): Change type of operand 2 of
2808 BIT_FIELD_REF expression to be bitsizetype instead of sizetype.
2809
28102007-11-09 Nathan Froyd <froydnj@codesourcery.com>
2811
2812 * lto.c: Include lto-tree.h. Effect small spaces->tabs cleanup.
2813 (lto_read_variable_formal_parameter_constant_DIE): Transfer bits
2814 from a DW_AT_specification or DW_AT_abstract_origin attribute to
2815 the new decl we are creating. Move informing the middle end about
2816 the new decl to...
2817 (lto_main): ...here. Inform the middle end about global variables
2818 after we have read in all the input files.
2819 * lto-symtab.c (lto_symtab_merge_decl): We really do need to merge
2820 variables with internal linkage, so delete the check for internal
2821 linkage. Combine TREE_PUBLIC flags.
2822
28232007-11-08 Nathan Froyd <froydnj@codesourcery.com>
2824
2825 * lto.c (lto_read_subroutine_type_subprogram_DIE): Handle
2826 DW_AT_decl_line.
2827 * lto-symtab.c (lto_symtab_merge_decl): Handle redefinition of a
2828 builtin specially. Move check for attribute compatibility
2829 earlier.
2830
28312007-11-07 Nathan Froyd <froydnj@codesourcery.com>
2832
2833 * Make-lang.in (lto/lto.o): Depend on gt-lto-lto.h.
2834 * config-lang.in (gtfiles): Add lto.h and lto.c.
2835 * lto-elf.c: Include ggc.h.
2836 (lto_elf_file_open): Allocate elf_file from GC memory.
2837 * lto.c: Include tree-ssa-operands.h and gt-lto-lto.h
2838 (lto_info_fd_init): Allocate the die_cache and unmaterialized_fndecls
2839 in GC memory.
2840 (lto_info_fd_close): Free unmaterialized_fndecls from GC memory.
2841 (lto_file_close): Free file from GC memory.
2842 (lto_cache_store_DIE): Allocate the new entry in GC memory.
2843 (lto_read_member_DIE): Fix declaration.
2844 (lto_read_subroutine_type_subprogram_DIE): unmaterialized_fndecls lives
2845 in GC memory.
2846 (current_lto_file): New variable.
2847 (lto_main): Use it.
2848 (DWARF2_attr, DWARF2_abbrev, lto_die_ptr, DWARF2_CompUnit,
2849 lto_die_cache_entry): Move to...
2850 * lto.h: ...here and add GTY markers as appropriate. Delete forward
2851 declarations accordingly.
2852 (struct lto_file_struct): Declare.
2853 (lto_file_vtable): Use it instead of lto_file.
2854
28552007-11-06 Alon Dayan <alond@il.ibm.com>
2856 Kenneth Zadeck <zadeck@naturalbridge.com>
2857
2858 * lto-read.c (process_flags, lto_static_init_local):
2859 read flags of VAR_DECL and FUNCTION_DECL of size>1.
2860 change global array num_flags_for_code to flags_length_for_code.
2861 (set_line_info): Make decls work in USE_MAPPED_LOCATION mode.
2862
28632007-11-05 Nathan Froyd <froydnj@codesourcery.com>
2864
2865 * lto.c (lto_read_structure_union_class_type_DIE): Use proper record
2866 layout functions to compute information about the newly constructed
2867 type.
2868
28692007-11-02 Nathan Froyd <froydnj@codesourcery.com>
2870
2871 * lto-read.c (input_expr_operand): Change the LTO_return_expr1
2872 case to use DECL_RESULT if necessary.
2873
28742007-11-01 Kenneth Zadeck <zadeck@naturalbridge.com>
2875
2876 * lto-read.c (input_tree_list): Removed.
2877 (input_tree_flags): Added parameter to force flags no matter what
2878 tree code.
2879 (input_expr_operand): Added parameter to input_tree_flags.
2880 Added case for IDENTIFIER_NODE and TREE_LIST. Changed ASM to call
2881 input_expr_operand rather than input_tree_lists.
2882 (input_local_var): Use input_expr_operand to read attributes
2883 rather then input_tree_list.
2884 (input_phi, input_ssa_names): Added parameter to input_tree_flags.
2885
28862007-10-31 Nathan Froyd <froydnj@codesourcery.com>
2887
2888 * lto.c (lto_read_typedef_DIE): Fix comment typo.
2889 (lto_resolve_typedecl_ref): Fetch the referred-to type and build a fake
2890 TYPE_DECL for it.
2891 * lto-read.c (lto_read_body): Use correct sizes for calculating
2892 type_decls_offset and types_offset.
2893
28942007-10-30 Nathan Froyd <froydnj@codesourcery.com>
2895
2896 * lto-tree.h (union lang_tree_node): Change GTY description to chain
2897 with GENERIC_NEXT.
2898 * config-lang.in (gtfiles): Add lto-lang.c.
2899 * lto-lang.c: Include gt-lto-lto-lang.h.
2900 * Make-lang.in (lto/lto-lang.o): Add dependency on gt-lto-lto-lang.h
2901 (lto/lto-symtab.o): Depend on LTO_H instead of TREE_H.
2902 (lto/lto-read.o): Likewise.
2903
29042007-10-29 Kenneth Zadeck <zadeck@naturalbridge.com>
2905
2906 * lto-read.c (data_in): Added type_decls and current_col fields.
2907 (string_slot): New type to hold canonized file name.
2908 (hash_string_slot_node, eq_string_slot_node, canon_file_name,
2909 input_line_info, set_line_info, clear_line_info): New functions.
2910 (file_name_hash_table): New hash table.
2911 (input_local_var, input_labels, input_local_vars_index,
2912 input_local_var, input_local_vars, input_ssa_names): Reorganized parameters.
2913 (input_uleb128): Changed type of byte var.
2914 (input_expr_operand): Large number of changes to get line numbers
2915 correct. Added TYPE_DECL case.
2916 (input_globals): Added code to get TYPE_DECLs processed.
2917 (input_local_var): Added code to process line numbers and
2918 TREE_CHAIN and DECL_CONTEXT.
2919 (input_function, input_constructor): Added call to
2920 clear_line_number.
2921 (lto_static_init_local): Added code to get line numbers correct.
2922 (lto_read_body): Added code to get TYPE_DECLS read and to change
2923 parameters to the calls above that had their parms reorganized.
2924
2925
29262007-10-29 Nathan Froyd <froydnj@codesourcery.com>
2927
2928 * lto.h (lto_resolve_typedecl_ref): Declare.
2929 * lto.c (lto_resolve_typedecl_ref): New function.
2930
29312007-10-29 Mark Mitchell <mark@codesourcery.com>
2932 Nathan Froyd <froydnj@codesourcery.com>
2933
2934 * lto.c (lto_read_subroutine_type_subprogram_DIE): Read the child
2935 DIEs even if we find an abstract origin for this DIE.
2936
29372007-10-29 Nathan Froyd <froydnj@codesourcery.com>
2938
2939 * lto.c (lto_read_subroutine_type_subprogram_DIE): Build the
2940 RESULT_DECL slightly earlier. Only remember the decl for later
2941 if we successfully merge declarations.
2942
29432007-10-24 Kenneth Zadeck <zadeck@naturalbridge.com>
2944
2945 * lto-read.c (input_expr_operand): Give label_values the proper
2946 context and provide switch statements with a default type.
2947
29482007-10-23 Nathan Froyd <froydnj@codesourcery.com>
2949
2950 * lto-read.c (lto_read_body): Move call to init_ssa_operands...
2951 * lto.c (lto_materialize_function): ...to here.
2952
29532007-10-22 Nathan Froyd <froydnj@codesourcery.com>
2954
2955 * lto.h (struct lto_info_fd): Add field unmaterialized_fndecls.
2956 * lto.c (lto_info_fd_init): Initialize it.
2957 (lto_info_fd_close): Free it.
2958 (lto_materialize_function): New function.
2959 (lto_read_subroutine_type_subprogram_DIE): Save the result decl on
2960 unmaterialized_fndecls.
2961 (lto_file_read): Read in all the function bodies after we have read
2962 all of the DWARF info.
2963 * lto-read.c (lto_read_body): Call init_ssa_operands if we are
2964 reading a function body.
2965
29662007-10-20 Kenneth Zadeck <zadeck@naturalbridge.com>
2967
2968 * lto-read.c (input_tree_flags): Renamed from input_flags to be
2969 semetric with output_tree_flags. Added call to log flags.
2970 (process_tree_flags): Renamed from process_flags. Fixed a lot of
2971 type issues to make everything consistent with flags being
2972 unsigned HOST_WIDE_INTS.
2973 (input_expr_operand): Added call to
2974 recompute_tree_invariant_for_addr_expr.
2975 (input_local_var): Added debugging for tree_chains. Now calls
2976 input_tree_flags.
2977 (input_phi): Made flags unsigned HOST_WIDE_INT.
2978 (input_ssa_names): Now calls input_tree_flags.
2979 (lto_read_body): Now sets cfun.
2980 (lto_read_function_body): Now sets current_function_pointer.
2981
29822007-10-19 Nathan Froyd <froydnj@codesourcery.com>
2983
2984 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Check
2985 definitively whether SPECIFICATION or ABSTRACT_ORIGIN exist before
2986 inspecting fields within.
2987 (lto_read_DIE_at_ptr): Delete check for null result; let callers
2988 handle this appropriately.
2989
29902007-10-19 Nathan Froyd <froydnj@codesourcery.com>
2991
2992 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Handle
2993 DW_AT_abstract_origin properly. Ensure that we're not dealing with
2994 both DW_AT_abstract_origin and DW_AT_specification.
2995 (lto_read_subroutine_type_subprogram_DIE): Handle
2996 DW_AT_abstract_origin.
2997 (lto_read_DIE): Use lto_read_only_for_child_DIEs for labels.
2998 (lto_read_DIE_at_ptr): Define as static to match declaration.
2999 Lookup the PTR in the cache before reading it from the file.
3000 (lto_resolve_var_ref): Adjust accordingly.
3001 (lto_resolve_fn_ref): Adjust accordingly. Tweak comment.
3002 (lto_resolve_field_ref): Adjust accordingly. Tweak comment.
3003
30042007-10-19 Nathan Froyd <froydnj@codesourcery.com>
3005
3006 * lto.c (lto_read_DIE_at_ptr): New function.
3007 (lto_resolve_var_ref): Use it.
3008 (lto_resolve_fn_ref): Use it.
3009 (lto_resolve_field_ref): Use it.
3010 (lto_read_variable_formal_parameter_constant_DIE): Follow
3011 DW_AT_specification and return the associated decl when appropriate.
3012
30132007-10-18 Nathan Froyd <froydnj@codesourcery.com>
3014
3015 * lto-lang.c (lto_type_for_mode): Move after lto_type_for_size.
3016 Implement for scalar integer modes.
3017 (lto_init): Initialize size_type_node.
3018
30192007-10-18 Kenneth Zadeck <zadeck@naturalbridge.com>
3020
3021 * lto-read.c (input_expr_operand): Remove ssa name asserts.
3022 (input_local_var): Add chaining for params.
3023 (input_ssa_names): Add cfun parameter.
3024 (input_function): Remove unnecessary else.
3025
30262007-10-17 Nathan Froyd <froydnj@codesourcery.com>
3027
3028 * lto.c (lto_read_only_for_child_DIEs): Mark die parameter as unused.
3029 (lto_resolve_var_ref): Use proper types.
3030 (lto_resolve_fn_ref): Likewise.
3031 (lto_resolve_field_ref): Likewise.
3032
30332007-10-17 Nathan Froyd <froydnj@codesourcery.com>
3034
3035 * lto-read.c (input_expr_operand): Remove case.
3036
30372007-10-17 Nathan Froyd <froydnj@codesourcery.com>
3038
3039 * lto.c (lto_read_only_for_child_DIEs): New function.
3040 (lto_read_DIE): Use it for lexical_block and inlined_subroutine DIEs.
3041 * lto-elf.c (lto_elf_map_lto_section): Remove.
3042 (lto_elf_file_vtable): Use lto_elf_map_optional_lto_section instead.
3043 * lto-read.c (input_expr_operand): Assert that we never read a NULL
3044 SSA_NAME. Add missing case for mechanical codes.
3045 (input_cfg): Use basic_block_info_for_function instead of
3046 basic_block_info.
3047
30482007-10-16 Kenneth Zadeck <zadeck@naturalbridge.com>
3049
3050 * lto-read.c (input_sleb128, input_integer): Use proper casts.
3051 (input_list): Renamed input_tree_list and modified to follow same
3052 protocol as lto-function-out.c:output_tree_list.
3053 (input_expr_operand): Make asm operands use input_tree_list.
3054 (input_local_var): Now uses input_tree_list.
3055 (lto_read_body): Change placement for setting context of debug_labels.
3056
3057
30582007-10-16 Kenneth Zadeck <zadeck@naturalbridge.com>
3059
3060 * lto-read.c (input_real): Output debugging in proper order.
3061 (input_integer): Compute bit lengths properly.
3062 (input_list): Clean up declaration.
3063 (input_expr_operand): Change calls to input_real to match fix.
3064 Make reading of LTO_bit_field_ref1 match output.
3065 (input_local_var): Make reading of attributes match what is being
3066 written.
3067 (dump_debug_stream): Also print char in hex.
3068 (debug_out_fun): Fix signed unsigned mismatch.
3069
30702007-10-10 Nathan Froyd <froydnj@codesourcery.com>
3071
3072 * lto.c (lto_read_form): Handle DW_AT_MIPS_linkage_name and
3073 DW_AT_GNU_vector specially, as they are not contiguous with the
3074 specified set of attribute names. Use class_mask to check for
3075 errors at the end of the function
3076 (lto_resolve_var_ref): Read the DIE if it is not cached.
3077 (lto_resolve_fn_ref): Likewise.
3078 (lto_resolve_field_ref): Likewise.
3079
30802007-10-05 Nathan Froyd <froydnj@codesourcery.com>
3081
3082 * lto.c: Include dwarf2out.h.
3083 (lto_cache_store_DIE): Assert that we never change the value.
3084 (LTO_BEGIN_READ_ATTRS): Print an informative error message.
3085 (lto_read_compile_unit_DIE): Handle DW_AT_entry_pc.
3086 (lto_read_array_type_DIE): Don't error on ndims == 0; build a
3087 sensible type instead.
3088 (lto_read_structure_union_class_type_DIE): Store the newly
3089 created type prior to reading the members of the structure to
3090 avoid infinite recursion. Avoid computing types and alignments
3091 for structures whose sizes are unknown.
3092 (lto_read_variable_formal_parameter_const): Handle DW_AT_artificial
3093 and set DECL_ARTIFICIAL accordingly. Ignore DW_AT_abstract_origin,
3094 DW_AT_const_value, and DW_AT_specification.
3095 (lto_read_subroutine_type_subprogram_DIE): Handle DW_AT_declaration.
3096 Return early if we have already constructed the function type.
3097 (lto_read_typedef_DIE): Check to see if the type has been cached
3098 already. Cache the type before reading any children.
3099 (lto_read_const_volatile_restrict_type_DIE): Handle DW_AT_name.
3100 (lto_read_DIE): Unset context->skip_non_parameters around reading
3101 the DIE.
3102 (lto_resolve_fn_ref): Delete trailing whitespace.
3103
31042007-09-11 Kenneth Zadeck <zadeck@naturalbridge.com>
3105
3106 * lto-read.c (input_expr_operand): Added type for STRING_CST.
3107
31082007-09-10 Nathan Froyd <froydnj@codesourcery.com>
3109
3110 * lto-read.c (lto_read): Set the type of the newly created CALL_EXPR.
3111
31122007-09-07 Nathan Froyd <froydnj@codesourcery.com>
3113
3114 * lto-lang.c (signed_and_unsigned_types): New variable.
3115 (lto_type_for_size): Consult signed_and_unsigned_types to find
3116 an approprite type, creating it if necessary.
3117 (lto_set_decl_assembler_name): Add actual method body.
3118
31192007-09-06 Jim Blandy <jimb@codesourcery.com>
3120
3121 * lto.c (lto_read_variable_formal_parameter_constant_DIE): If we
3122 can't find a var init for this variable, leave its DECL_INITIAL.
3123 * lto-elf.c (lto_elf_map_optional_lto_section): Renamed from
3124 lto_elf_map_fn_body.
3125 (lto_map_lto_section): New function.
3126 (lto_elf_file_vtable): Use lto_elf_map_lto_section for function
3127 bodies, and lto_elf_map_optional_lto_section for variable
3128 initializers.
3129 (lto_elf_find_section_data): Quietly return NULL if the section is
3130 missing.
3131 (lto_elf_file_open): Check for a NULL from lto_elf_find_section_data.
3132
3133 * lto-elf.c (lto_elf_find_section_data): Remove dead code.
3134
3135 * lto-read.c (lto_read_body): Doc fix.
3136
31372007-08-29 Kenneth Zadeck <zadeck@naturalbridge.com>
3138
3139 * lto-read.c (fun_in): Renamed to data_in.
3140 (input_expr_operand, input_local_var, input_string_internal,
3141 input_string, input_real, input_list, get_label_decl,
3142 get_type_ref, input_expr_operand, input_globals, input_labels,
3143 input_local_vars_index, input_local_var, input_local_vars,
3144 input_cfg, input_phi, input_ssa_names, input_bb, ): Renamed fun_in to data_in.
3145 (input_constructor): New function.
3146 (lto_read_function_body): Renamed to lto_read_body and generalized
3147 to handle both functions and constructors.
3148 (lto_read_function_body, lto_read_var_init): New function.
3149
3150
31512007-08-28 Kenneth Zadeck <zadeck@naturalbridge.com>
3152
3153 * lto-read.c (input_expr_operand): Assert that there really is a
3154 FUNCTION_DECL.
3155 (input_globals): Removed checks on 0 section.
3156
31572007-08-28 Kenneth Zadeck <zadeck@naturalbridge.com>
3158
3159 * lto-read.c (fun_in): Added local_decls_index and
3160 local_decls_index_d.
3161 (input_expr_operand): Changed inputting of PARM_DECLs and VAR_DECLs.
3162 (input_globals): Enabled code to handle FIELD_DECLs.
3163 (input_local_vars_index, input_local_vars): New function.
3164 (input_local_var): Changed to allow locals to be input randomly.
3165 (lto_read_function_body): Added code to input the
3166 local_decls_index and to free various structures.
3167
31682007-08-17 Jim Blandy <jimb@codesourcery.com>
3169
3170 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Remove
3171 ATTRIBUTE_UNUSED from 'die' formal.
3172
3173 Use enum LTO_tags where appropriate, instead of 'unsigned int'.
3174 * lto-read.c (input_record_start): Fix return type, type of 'tag'.
3175 (input_list): Fix type of 'tag'.
3176 (input_expr_operand): Fix type of 'tag' argument. Update
3177 declaration. Fix type of 'ctag'. Add default case to switch,
3178 since the type of the switched value is now an enum.
3179 (input_local_vars): Fix type of 'tag'.
3180 (input_bb): Fix type of 'tag' argument.
3181 (input_function): Fix type of 'tag' argument.
3182
31832007-08-16 Jim Blandy <jimb@codesourcery.com>
3184
3185 * lto.c (lto_read_member_DIE): Record the tree we create in
3186 fd->die_cache. (Our 'die' argument is no longer unused.)
3187 (lto_resolve_field_ref): New function.
3188 * lto.h (lto_resolve_field_ref): New declaration.
3189
31902007-08-15 Jim Blandy <jimb@codesourcery.com>
3191
3192 * lto-read.c (lto_read_var_init): Mark arguments as unused.
3193
31942007-08-07 Jim Blandy <jimb@codesourcery.com>
3195
3196 * lto.c (lto_read_form): Complete attr_classes table.
3197 (DWARF2_form_data): Doc fix.
3198
31992007-08-05 Mark Mitchell <mark@codesourcery.com>
3200
3201 * lto.h (lto_file_vtable): Remove read_var_init. Add map_var_init
3202 and unmap_var_init.
3203 (lto_read_var_init): Declare.
3204 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Use new
3205 interface for reading variable initializers.
3206 * lto-elf.c (lto_elf_read_var_init): Remove.
3207 (lto_elf_file_vtable): Update initializer.
3208 (lto_elf_read_var_init): Add comment about unused-ness.
3209 * lto-read.c (lto_read_var_init): New.
3210
3211 * lto.c (lto_read_form): Add entry for DW_AT_inline.
3212
32132007-08-02 Kenneth Zadeck <zadeck@naturalbridge.com>
3214
3215 * lto-read.c (lto_read_function_body): Moved declaration of fn
3216 outside of ifdef.
3217
32182007-08-01 Kenneth Zadeck <zadeck@naturalbridge.com>
3219
3220 * lto-read.c (input_uleb128, input_string_internal, input_real,
3221 input_integer, input_record_start, input_list, get_type_ref,
3222 input_flags, input_expr_operand, input_expr_operand,
3223 input_expr_operand, input_local_vars, input_cfg, input_phi,
3224 input_ssa_names, input_bb, input_function): Added semicolons.
3225
3226
32272007-07-31 Kenneth Zadeck <zadeck@naturalbridge.com>
3228
3229 * lto-read.c (input_globals): Remove debugging.
3230 (input_function): Set DECL_ARGUMENTS.
3231
3232
32332007-07-31 Kenneth Zadeck <zadeck@naturalbridge.com>
3234
3235 * lto-read.c (input_expr_operand): Fixed code for COND_EXEC,
3236 RETURN_EXPR, MODIFY_EXPR and processing of flags.
3237 (input_phi): Made work with operands other than SSA_NAMES and
3238 fixed processing of flags.
3239 (input_ssa_names): Initialize SSA_NAME_DEF_STMT to empty stmt.
3240 (input_flags): New function.
3241 * lto-lang.c (lto_init): Changed state of in_lto_p.
3242
3243
32442007-07-24 Mark Mitchell <mark@codesourcery.com>
3245
3246 * lto-tree.h (lto_varargs_cookie): Remove.
3247 * lto.c (lto_context): Add last_parm_type, varargs_p, skip_all,
3248 skip_non_parameters, skip_parameters.
3249 (lto_varargs_cookie): Remove.
3250 (lto_read_variable_formal_parameter_constant_DIE): Keep track of
3251 parameter types.
3252 (lto_read_abbrev): New function.
3253 (lto_read_subroutine_type_subprogram_DIE): Make two passes over
3254 child DIEs.
3255 (lto_read_unspecified_parameters_DIE): Set context->varargs_p.
3256 (lto_read_DIE): Use lto_read_abbrev. Honor skip_* flags.
3257 (lto_file_read): Initialize new context fields.
3258 * lto-lang.c (lto_type_for_mode): Return NULL_TREE.
3259 (lto_unsigned_type): Remove.
3260 (lto_signed_type): Likewise.
3261 (lto_signed_or_unsigned_type): Likewise.
3262 (lto_init): Do not create lto_varargs_cookie.
3263 (LANG_HOOKS_UNSIGNED_TYPE): Do not define.
3264 (LANG_HOOKS_SIGNED_TYPE): Likewise.
3265 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Likewise.
3266
32672007-07-19 Jan Hubicka <jh@suse.cz>
3268
3269 * lto-read.c (lto_read_function_body): Produce empty scope block
3270 to avoid crash.
3271
32722007-07-18 Mark Mitchell <mark@codesourcery.com>
3273
3274 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Do not
3275 process local variables.
3276 (lto_read_subroutine_type_subprogram_DIE): Read child DIEs.
3277
32782007-07-13 Kenneth Zadeck <zadeck@naturalbridge.com>
3279
3280 * lto-read.c (input_list, input_expr_operand): Added struct
3281 function parameter.
3282 (init_cfg, finalize_cfg): Removed function.
3283 (input_expr_operand): Added SSA_NAME and GIMPLE_MODIFY_STMT cases.
3284 (input_labels, input_local_vars): Now takes input_block parameter rather than
3285 synthsyzing it.
3286 (input_cfg, input_phi, input_ssa_names): New functions.
3287 (input_bb): Now passes in input_blocks. Does not construct cfg
3288 and processes the list of phi functions.
3289 (input_function): Now builds both the cfg and ssa_names table.
3290 (lto_read_function_body): Processes new header fields to construct
3291 streams for the ssa_names and cfg and their debugging.
3292 * lto/lto-lang.c (lto_init): Set in_lto_p.
3293
3294
32952007-06-28 Mark Mitchell <mark@codesourcery.com>
3296
3297 * lto.h (lto_file_vtable): Add read_var_init.
3298 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Read
3299 initializers.
3300 (lto_main): Remove bogus asserts.
3301 * lto-elf.c (tm.h): Include it.
3302 (libiberty.y): Likewise.
3303 (lto_elf_file): Add strtab and symtab. Rename
3304 string_table_section_index to sec_strtab.
3305 (lto_elf_file_vtable): Add lto_elf_read_var_init.
3306 (lto_elf_get_shdr): New function.
3307 (lto_elf_free_shdr): Likewise.
3308 (lto_elf_find_section_data): Use them.
3309 (lto_elf_read_symtab): New function.
3310 (lto_elf_lookup_sym): Likewise.
3311 (lto_elf_free_sym): Likewise.
3312 (lto_elf_file_open): Tidy. Call lto_elf_read_symtab.
3313 (lto_elf_built_init): New function.
3314 (lto_elf_read_var_init): Likewise.
3315 * Make-lang.in (lto/lto-elf.o): Depend on $(TM_H).
3316
33172007-06-26 Kenneth Zadeck <zadeck@naturalbridge.com>
3318
3319 * lto-read (make_new_block): Initialize the stmt_list.
3320 (lto_static_init_local): Add debugging for missing codes.
3321
33222007-06-26 Mark Mitchell <mark@codesourcery.com>
3323
3324 * lto.c (lto_read_subroutine_type_subprogram_DIE): Handle
3325 unprototyped functions.
3326
33272007-06-23 Mark Mitchell <mark@codesourcery.com>
3328
3329 * lto.c (lto_read_variable_formal_parameter_constant_DIE):
3330 Handle DW_AT_MIPS_linkage_name.
3331 (lto_read_subroutine_type_subprogram): Likewise. Correct
3332 compilation errors.
3333 (lto_main): Remove incorrect assertions.
3334 * lto-symbtab.c: Build function types out of TREE_LISTs.
3335
3336 * lto-elf.c (<libelf>): Check for HAVE_LIBELF_H.
3337
3338 * Make-lang.in (LTO_OBJS): Depend on attribs.o.
3339
33402007-06-21 Kenneth Zadeck <zadeck@naturalbridge.com>
3341
3342 * lto/lto-tree.h (lang_decl, lang_type, language_function): Added
3343 dummy since ggc does not like empty structs.
3344 * lto/lto-elf.c (libelf.h): Changed to libelf/libelf.h.
3345 * lto/lto-read.c (ADD_CLASS_FLAG, ADD_EXPR_FLAG): Changed
3346 expr->common to expr->base.
3347 (make_new_block): Moved stmt_list to proper place.
3348
3349
33502007-03-14 Robert Kennedy <jimbob@google.com>
3351
3352 Eliminate use of lang_hooks.set_decl_assembler_name from LTO
3353 * lto.c (lto_read_subroutine_type_subprogram_DIE) Get DECL
3354 assembler name from DWARF.
3355 * lto-lang.c (lto_set_decl_assembler_name) New function.
3356
33572006-09-10 Mark Mitchell <mark@codesourcery.com>
3358
3359 * lto.h (lto_file_vtable): New structure.
3360 (lto_file): Add vtable pointer.
3361 (lto_file_init): Add vtable paramter.
3362 (lto_read_function_body): New function.
3363 (lto_symtab_merge_fn): New function.
3364 * lto.c (lto_file_init): Add vtable parameter.
3365 (lto_read_form): Fill in entries for DW_AT_prototyped,
3366 DW_AT_frame_base.
3367 (lto_read_subroutine_type_subprogram_DIE): New function.
3368 (lto_read_DIE): Fill in entries for DW_TAG_subroutine_type and
3369 DW_TAG_subprogram.
3370 * lto-elf.c (lto_elf_vile_vtable): New variable.
3371 (lto_elf_file_open): Pass it to lto_file_init.
3372 (lto_elf_map_fn_body): New function.
3373 (lto_elf_unmap_fn_body): Likewise.
3374 * lto-read.c: New file.
3375 * lto-symtab.c (lto_symtab_merge_fn): New function.
3376 * lto-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Define to
3377 tree_rest_of_compilation.
3378 * Make-lang.in (LTO_OBJS): Add lto-read.o
3379 (lto-read.o): New target.
3380
33812006-09-03 Mark Mitchell <mark@codesourcery.com>
3382
3383 * lto.c (<inttypes.h>): Don't include it.
3384 (lto_context): Don't typedef it.
3385 (lto_resolve_reference): New function.
3386 (lto_read_form): Use it.
3387 (lto_resolve_type_ref): New function.
3388 (lto_resolve_var_ref): Likewise.
3389 (lto_resolve_fn_ref): Likewise.
3390 * lto.h (<inttypes.h>): Include it.
3391 (lto_context): New type.
3392 (lto_ref): New structure.
3393 (lto_resolve_type_ref): Declare.
3394 (lto_resolve_var_ref): Likewise.
3395 (lto_resolve_fn_ref): Likewise.
3396
33972006-08-18 Mark Mitchell <mark@codesourcery.com>
3398
3399 * lang-specs.h: New file.
3400
34012006-08-14 Mark Mitchell <mark@codesourcery.com>
3402
3403 * lto.c (lto_info_fd_init): Allocate the DIE cache.
3404 (lto_info_fd_close): Deallocate it.
3405 (lto_die_cache_entry): New structure.
3406 (lto_cache_hash): New function.
3407 (lto_cache_eq): Likewise.
3408 (lto_cache_store_DIE): Likewise.
3409 (lto_cache_lookup_DIE): Likewise.
3410 (lto_read_referenced_type_DIE): Use the cache.
3411 (lto_read_pointer_type_DIE): Robustify.
3412 (lto_read_DIE): Use the cache.
3413 * lto.h (hashtab.h): Include.
3414 (lto_info_fd): Add DIE cache.
3415 * Make-lang.in (LTO_H): New variable.
3416 (lto/lto-lang.o): Use LTO_H.
3417 (lto/lto-elf.o): Likewise.
3418 (lto/lto-symtab.o): Likewise.
3419
34202006-07-09 Mark Mitchell <mark@codesourcery.com>
3421
3422 * lto.c (lto_abi_mismatch_error): New function.
3423 (lto_abbrev_read): Initialize num_abbrevs.
3424 (lto_read_form): Specify allowed form classes for
3425 DW_AT_declaration. Adjust for change to lto_set_cu_context.
3426 (lto_read_variable_formal_parameter_constant_DIE): Handle
3427 DW_AT_declaration. Call lto_symtab_merge_var.
3428 (lto_read_pointer_type_DIE): New function.
3429 (lto_read_base_type_DIE): Use build_nonstandard_integer_type. Do
3430 not creat TYPE_DECLs for types that already have them.
3431 (lto_read_DIE): Add lto_read_pointer_type_DIE.
3432 (lto_set_cu_context): Make cu_start point to the header, not the
3433 first DIE.
3434 (lto_file_read): Adjust for change to lto_set_cu_context.
3435 * Make-lang.in (LTO_OBJS): Add lto-symtab.o.
3436 (lto/lto-symtab.o): New rule.
3437 * lto-tree.h (lang_identifier): Add decl field.
3438 (LANG_IDENTIFIER_CAST): New macro.
3439 (LTO_IDENTIFIER_DECL): Likewise.
3440 (lto_symtab_merge_var): Declare.
3441 * lto-symtab.c: New file.
3442
34432006-07-02 Daniel Berlin <dberlin@dberlin.org>
3444
3445 * lto.c (lto_context): Add current_cu and info_fd members.
3446 (DWARF2_CompUnit): New structure.
3447 (lto_read_DIE): Take lto_info_fd *.
3448 (lto_read_child_DIEs): Ditto.
3449 (lto_file_corrupt_error): Constify argument.
3450 (lto_set_cu_context): New function
3451 (lto_info_fd_init): Ditto.
3452 (lto_info_fd_close): Ditto.
3453 (lto_file_init): Use lto_info_fd_init.
3454 (lto_file_close): Use lto_info_fd_close.
3455 (lto_read_initial_length): Pass in pointer to header size.
3456 (lto_read_comp_unit_header): Correct cu_length to
3457 real length from beginning of header. Take lto_info_fd * as
3458 argument.
3459 (find_cu_for_offset): New function.
3460 (lto_read_form): Change first argument to lto_info_fd *.
3461 Add FORM_CONTEXT argument.
3462 Handle DW_FORM_ref_addr.
3463 (lto_read_tag_DIE): Change first argument to lto_info_fd *.
3464 (LTO_BEGIN_READ_ATTRS_UNCHECKED): Save old context.
3465 Swap contexts if necessary for form.
3466 (LTO_BEGIN_READ_ATTRS): Cast fd to right type for
3467 lto_file_corrupt_error.
3468 (LTO_END_READ_ATTRS): Swap contexts back if it had changed.
3469 (lto_read_referenced_type_DIE): Change first argument to
3470 lto_info_fd *. Access lto_fd fields through base pointer.
3471 (lto_read_compile_unit_DIE): Change first argument to an
3472 lto_info_fd *.
3473 (lto_read_variable_formal_parameter_constant_DIE): Ditto.
3474 (lto_read_base_type_DIE): Ditto.
3475 (lto_read_child_DIEs): Ditto.
3476 (lto_read_DIE): Ditto. Change type of function pointer.
3477 (lto_info_read): New function.
3478 (lto_set_cu_context): Ditto.
3479 (lto_file_read): Use lto_info_read, walk resulting CU's
3480 (lto_main): Update for lto_info_fd change.
3481 * lto-elf.c (lto_elf_file_open): Cast lto_info_fd to lto_fd where
3482 necessary.
3483 * lto.h (DWARF2_CompUnit): New structure.
3484 (lto_info_fd): Ditto.
3485 (lto_file): Change debug_info to be an lto_info_fd.
3486
34872006-06-25 Mark Mitchell <mark@codesourcery.com>
3488
3489 * lto.c (toplev.h): Include it.
3490 (dwarf2.h): Likewise.
3491 (tree.h): Likewise.
3492 (tm.h): Likewise.
3493 (cgraph.h): Likewise.
3494 (ggc.h): Likewise.
3495 (inttypes.h): Likewise.
3496 (DWARF2_attr): New type.
3497 (DWARF2_abbrev): Likewise.
3498 (DWARF2_class): Likewise.
3499 (DWARF2_form_data): Likewise.
3500 (lto_context): Likewise.
3501 (lto_fd_init): New function.
3502 (lto_abbrev_fd_init): Likewise.
3503 (lto_abbrev_fd_close): Likewise.
3504 (lto_file_init): Use them.
3505 (lto_file_close): New function.
3506 (lto_file_corrupt_error): Likewise.
3507 (LTO_CHECK_INT_VAL): New macro.
3508 (lto_check_size_t_val): New function.
3509 (lto_check_int_val): Likewise.
3510 (LTO_READ_TYPE): New macro.
3511 (lto_read_ubyte): New function.
3512 (lto_read_uhalf): Likewise.
3513 (lto_read_uword): Likewise.
3514 (lto_read_uleb128): Likewise.
3515 (lto_read_initial_length): Likewise.
3516 (lto_abbrev_read_attrs): Likewise.
3517 (lto_abbrev_read): Likewise.
3518 (lto_abbrev_lookup): Likewise.
3519 (lto_read_section_offset): Likewise.
3520 (lto_read_comp_unit_header): Likewise.
3521 (lto_read_form): Likewise.
3522 (LTO_BEGIN_READ_ATTRS_UNCHECKED): New macro.
3523 (LTO_BEGIN_READ_ATTRS): Likewise.
3524 (LTO_END_READ_ATTRS): Likewise.
3525 (lto_unsupported_attr_error): New function.
3526 (lto_get_identifier): Likewise.
3527 (lto_read_referenced_type_DIE): Likewise.
3528 (lto_read_compile_unit_DIE): Likewise.
3529 (lto_read_variable_formal_parameter_constant_DIE): Likewise.
3530 (lto_read_base_type_DIE): Likewise.
3531 (lto_read_DIE): Likewise.
3532 (lto_read_child_DIEs): Likewise.
3533 (lto_file_read): Read DIEs.
3534 (lto_main): Ask middle end to emit entities.
3535 * lto-tree.h (lang_identifier): Inherit from tree_identifier.
3536 * lto-elf.c (lto_elf_file_open): Adjust for interface changes.
3537 (lto_elf_file_close): Likewise.
3538 * lto.h (lto_file): Declare.
3539 (DWARF2_abbrev): Likewise.
3540 (lto_fd): New type.
3541 (lto_abbrev_fd): Likewise.
3542 (lto_file): Use new types.
3543 (lto_file_close): Declare.
3544 * lto-lang.c (lto_init): Always use unit-at-a-time mode.
3545
35462006-06-18 Mark Mitchell <mark@codesourcery.com>
3547
3548 * lto.h: New file.
3549 * lto.c: New file.
3550 * lto-elf.c: New file.
3551 * lto-lang.c (flags.h): Include it.
3552 (lto.h): Likewise.
3553 (lto_init): New function.
3554 (lto_write_globals): Remove.
3555 (LANG_HOOKS_WRITE_GLOBALS): Define to lhd_do_nothing.
3556 (LANG_HOOKS_INIT): Define.
3557 (LANG_HOOKS_PARSE_FILE): Likewise.
3558 * Make-lang.in (LTO_OBJS): Add lto.o and lto-elf.o.
3559 (LTO_EXE): Link with libelf.
3560 (lto/lto-lang.o): Update dependencies.
3561 (lto/lto.o): New target.
3562 (lto/lto-elf.o): Likewise.
3563
35642006-06-12 Mark Mitchell <mark@codesourcery.com>
3565
3566 * config-lang.in: New file.
3567 * Make-lang.in: Likewise.
3568 * lto-tree.h: Likewise.
3569 * lto-lang.c: Likewise.
3570