]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/lto/ChangeLog
Remove -Y option from linker command line on Linux/Sparc.
[thirdparty/gcc.git] / gcc / lto / ChangeLog
CommitLineData
1d67dde8
RB
12012-05-04 Richard Guenther <rguenther@suse.de>
2
3 * lang.opt (fwpa): Do not mark as Optimization.
4 (fltrans): Likewise.
5
65d630d4
JH
62012-04-30 Jan Hubicka <jh@suse.cz>
7
8 * lto.c (lto_main): Use compile ().
1d67dde8
RB
9 * lto-partition.c (partition_cgraph_node_p): Use
10 symtab_used_from_object_file_p.
65d630d4
JH
11 (partition_varpool_node_p): Likewise.
12
ead84f73
JH
132012-04-20 Jan Hubicka <jh@suse.cz>
14
15 * lto-partition.c (partition_cgraph_node_p): Use force_output.
16
5932a4d4
JH
172012-04-18 Jan Hubicka <jh@suse.cz>
18
19 * lto-partition.c (add_references_to_partition, lto_balanced_map):
20 Update for new ipa-ref API.
21
65c70e6b
JH
222012-04-16 Jan Hubicka <jh@suse.cz>
23
24 * lto.c (read_cgraph_and_symbols): Use FOR_EACH
25 walkers to walk cgraph and varpool.
26 (materialize_cgraph): Likewise.
27 * lto-partition.c (lto_1_to_1_map): Likewise.
28 (lto_balanced_map): Likewise.
29 (lto_promote_cross_file_statics): Likewise.
30
960bfb69
JH
312012-04-14 Jan Hubicka <jh@suse.cz>
32
33 * lto.c: Update field referenced for new cgraph/varpool layout.
34 * lto-partition.c: Likewise.
35
a66dc285
JH
362012-04-11 Jan Hubicka <jh@suse.cz>
37
38 * lto.c: Update copyright; remove params.h, ipa-inline.h
39 and ipa-utils.h inlines; inline lto-partition.h
40 (ltrans_partition_def, ltrans_partition, add_cgraph_node_to_partition,
41 add_varpool_node_to_partition, new_partition, free_ltrans_partitions,
42 add_references_to_partition, add_cgraph_node_to_partition_1,
43 add_cgraph_node_to_partition, add_varpool_node_to_partition,
44 undo_partition, partition_cgraph_node_p, partition_varpool_node_p,
45 lto_1_to_1_map, node_cmp, varpool_node_cmp, lto_balanced_map,
46 promote_var, promote_fn, lto_promote_cross_file_statics): move to...
47 * lto-partition.c: ... here; new file.
48 * lto-partition.h: New file.
49 * Make-lang.in (lto.o): Update dependencies.
50 (lto-partition.o): New.
51
f3b249e5
RG
522012-04-05 Richard Guenther <rguenther@suse.de>
53
54 * lto-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Remove
55 definition.
56
21fa2faf
RG
572012-03-12 Richard Guenther <rguenther@suse.de>
58
59 * lto-lang.c (builtin_type_for_size): Use lto_type_for_size.
60
6bb485a3
RG
612012-03-06 Richard Guenther <rguenther@suse.de>
62
63 PR lto/52097
64 * lto.c (uniquify_nodes): Merge TYPE_FIELDS of variant types.
65
95510497
RG
662012-02-28 Richard Guenther <rguenther@suse.de>
67
68 PR lto/52400
69 * lto.c (lto_register_function_decl_in_symtab): Do not register
70 a reverse renamed decl mapping.
71
09228fef
JJ
722012-01-06 Jakub Jelinek <jakub@redhat.com>
73
74 PR lto/51774
75 * lto-lang.c (handle_returns_twice_attribute): New function.
76 (lto_attribute_table): Add returns_twice attribute.
77
b03eda0d
RG
782011-12-21 Richard Guenther <rguenther@suse.de>
79
80 * lto.c (GIMPLE_REGISTER_TYPE): New define.
81 (LTO_FIXUP_TREE): Use it.
82 (uniquify_nodes): Mark new non-prevailing types and avoid
83 calling gimple_register_type on others.
84 (lto_read_decls): Add comment.
85
4ad9a9de
EB
862011-12-13 Eric Botcazou <ebotcazou@adacore.com>
87
88 * lto.h (lto_parse_hex): Delete.
89 * lto.c (lto_read_decls): Use 'int' for offsets.
90 (lto_parse_hex): Make static and return proper 64-bit host type.
91 (lto_resolution_read): Use proper 64-bit host type.
92
ea973bad
RG
932011-12-13 Richard Guenther <rguenther@suse.de>
94
95 PR lto/48354
96 * lto.c (lto_ft_decl_non_common): When we merged DECL_ORIGINAL_TYPE
97 with the type of the TYPE_DECL clear DECL_ORIGINAL_TYPE.
98
c8218030
UB
992011-12-01 Uros Bizjak <ubizjak@gmail.com>
100
101 * lto-lang.c (lto_attribute_table): Handle *tm regparm.
102 (ignore_attribute): New.
103
57ac2606
AH
1042011-11-21 Aldy Hernandez <aldyh@redhat.com>
105
106 * lto-lang.c (lto_attribute_table): Handle transaction_pure.
107 (handle_transaction_pure_attribute): New.
108
52a35ef7
RG
1092011-11-03 Richard Guenther <rguenther@suse.de>
110
111 PR lto/44965
112 * lto-lang.c (lto_post_options): Do not read file options.
113 * lto.c (lto_read_all_file_options): Remove.
114 (lto_init): Call lto_set_in_hooks here.
115
51973b1e
JH
1162011-10-09 Jan Hubicka <jh@suse.cz>
117
118 * lto.c (node_cmp, varpool_node_cmp): New functions.
119 (lto_balanced_map): Honnor -fno-toplevel-reorder of vars&functions.
120 (cmp_partitions): Rename to ...
121 (cmp_partitions_size): ... this one.
122 (cmp_partitions_order): New function.
123 (lto_wpa_write_files): Sort partitions by order when
124 -fno-toplevel-reorder is used.
125
5958009b
AK
1262011-10-09 Andi Kleen <ak@linux.intel.com>
127
128 * lto.c (lto_section_read): Call fatal_error on IO or mmap errors.
129
e79983f4
MM
1302011-10-11 Michael Meissner <meissner@linux.vnet.ibm.com>
131
132 * lto-lang.c (def_builtin_1): Delete old interface with two
133 parallel arrays to hold standard builtin declarations, and replace
134 it with a function based interface that can support creating
135 builtins on the fly in the future. Change all uses, and poison
136 the old names. Make sure 0 is not a legitimate builtin index.
137
c17d253c
AK
1382011-10-02 Andi Kleen <ak@linux.intel.com>
139
140 * lto-object.c (lto_obj_add_section_data): Add list.
141 (lto_obj_add_section): Fill in list.
142 (ltoobj_build_section_table): Pass through list.
143 * lto.c (file_data_list): Declare.
144 (create_subid_section_table): Pass arguments directly.
145 Fill in list of file_datas.
146 (lwstate): Delete.
147 (lto_create_files_from_ids): Pass in direct arguments.
148 Don't maintain list.
149 (lto_file_read): Use explicit section and file data lists.
150 (lto_read_all_file_options): Pass in section_list.
151 * lto.h (lto_obj_build_section_table): Add list.
152 (lto_section_slot): Add next.
153 (lto_section_list): Declare.
154
ed0d2da0
JH
1552011-10-02 Jan Hubicka <jh@suse.cz>
156
157 PR lto/47247
158 * common.c (lto_resolution_str): Add new resolution.
159 * common.h (lto_resolution_str): Likewise.
160
ad7715f3
L
1612011-09-30 H.J. Lu <hongjiu.lu@intel.com>
162 Andi Kleen <ak@linux.intel.com>
163
164 PR lto/50568
165 * lto.c (lto_splay_tree_delete_id): New.
166 (lto_splay_tree_compare_ids): Likewise.
167 (lto_splay_tree_lookup): Likewise.
168 (lto_splay_tree_id_equal_p): Likewise.
169 (lto_splay_tree_insert): Likewise.
170 (lto_splay_tree_new): Likewise.
171 (lto_resolution_read): Change id to unsigned HOST_WIDE_INT.
172 Use lto_splay_tree_id_equal_p and lto_splay_tree_lookup.
173 (create_subid_section_table): Use lto_splay_tree_lookup and
174 lto_splay_tree_insert.
175 (lto_file_read): Use lto_splay_tree_new.
176
dde8b360
AK
1772011-09-26 Andi Kleen <ak@linux.intel.com>
178
179 * lto.c (lto_resolution_read): Remove id dumping.
180 (lto_section_with_id): Turn id HOST_WIDE_ID.
181 (create_subid_section_table): Dito.
182
892a371f
DS
1832011-08-28 Dodji Seketeli <dodji@redhat.com>
184
185 * lto-lang.c (lto_init): Likewise. Also, avoid calling
186 linemap_add twice.
187
f82d1a94
MJ
1882011-08-11 Martin Jambor <mjambor@suse.cz>
189
190 * lto.c (uniquify_nodes): Use main variant's BINFO too.
191
f0efc7aa
DN
1922011-08-08 Diego Novillo <dnovillo@google.com>
193
194 * Make-lang.in (lto/lto.o): Add TREE_STREAMER_H.
195 * lto.c: Include tree-streamer.h.
196
1a072294
RG
1972011-07-06 Richard Guenther <rguenther@suse.de>
198
199 * lto-lang.c (lto_init):
200 Merge calls to build_common_tree_nodes and build_common_tree_nodes_2.
201
7496868d
JH
2022011-06-11 Jan Hubicka <jh@suse.cz>
203
10f13f22 204 PR lto/48246
7496868d
JH
205 * lto.c (lto_1_to_1_map): Don't create empty partitions.
206 (lto_balanced_map): Likewise.
207
39e2db00
JH
2082011-06-11 Jan Hubicka <jh@suse.cz>
209
210 * lto.c (add_cgraph_node_to_partition_1): Break out from ...
211 (add_cgraph_node_to_partition) ... here; walk aliases.
212 (lto_1_to_1_map): Remove same body alias code.
213 (promote_fn): Likewise.
214 (lto_promote_cross_file_statics): Update comment.
215
216
28628ea6
DN
2172011-06-07 Diego Novillo <dnovillo@google.com>
218
219 * lto.c (uniquify_nodes): Move code to register decls to
220 the loop that computes canonical types.
221
009db074
RG
2222011-06-07 Richard Guenther <rguenther@suse.de>
223
224 * lto-lang.c (lto_init): Do not set
225 size_type_node or call set_sizetype.
226
47c79d56
DN
2272011-06-04 Diego Novillo <dnovillo@google.com>
228
229 * lto.c (lto_init): New.
230 (lto_main): Call it.
231
d5828cc7
DN
2322011-06-03 Diego Novillo <dnovillo@google.com>
233
234 * lto.c (get_resolution): Move from lto-streamer-in.c.
235 (lto_register_var_decl_in_symtab): Likewise.
236 (lto_register_function_decl_in_symtab): Likewise.
237 (uniquify_nodes): Call lto_register_var_decl and
238 lto_register_function_decl_in_symtab after reading a new
239 VAR_DECL or FUNCTION_DECL.
240
6807da97
RG
2412011-06-01 Richard Guenther <rguenther@suse.de>
242
243 * lto-lang.c (lto_register_canonical_types): New function.
244 (lto_init): Register common nodes with the canonical type machinery.
245 Do not play tricks with char_type_node.
246
d74be317
RG
2472011-05-26 Richard Guenther <rguenther@suse.de>
248
249 * lto.c (uniquify_nodes): Fix bug in one of the previous changes.
250
d9f8303f
NF
2512011-05-25 Nathan Froyd <froydnj@codesourcery.com>
252
253 * lto.c (lto_ft_typed): New function.
254 (lto_ft_common): Call it.
255 (lto_ft_constructor): Likewise.
256 (lto_ft_expr): Likewise.
257 (lto_fixup_prevailing_decls): Check for TS_COMMON before accessing
258 TREE_CHAIN.
259
fb291a1e
RG
2602011-05-20 Richard Guenther <rguenther@suse.de>
261
262 * lto.c (lto_ft_common): Remove pointer-to chain teardown.
263 (lto_ft_type): Move main-variant and pointer-to chain building ...
264 (uniquify_nodes): ... here. Compute TYPE_CANONICAL also here,
265 in a separate final loop.
266
31b3ca64
RG
2672011-05-19 Richard Guenther <rguenther@suse.de>
268
269 * lto.c (uniquify_nodes): First register all types before
270 fixing up the tree SCC.
271
35d828c5
JH
2722011-05-11 Jan Hubicka <jh@suse.cz>
273
274 PR lto/48952
275 * lto.c (do_whole_program_analysis): Do not register cgraph hooks.
276
51545682
NF
2772011-05-11 Nathan Froyd <froydnj@codesourcery.com>
278
279 * lto.c (lto_ft_type): Use TYPE_MINVAL and TYPE_MAXVAL. Adjust
280 location of binfo field.
281 (lto_fixup_prevailing_decls): Likewise.
282
8242dd04
NF
2832011-05-10 Nathan Froyd <froydnj@codesourcery.com>
284
285 * lto-lang.c (def_fn_type): Don't call build_function_type, call
286 build_function_type_array or build_varargs_function_type_array
287 instead.
288
c99c0026
EB
2892011-05-07 Eric Botcazou <ebotcazou@adacore.com>
290
291 * lto-lang.c (global_bindings_p): Return bool.
292
c47d0034
JH
2932011-05-07 Jan Hubicka <jh@suse.cz>
294
a9bcb3f0
EB
295 * lto.c (lto_materialize_function): Use
296 cgraph_function_with_gimple_body_p.
297 (add_cgraph_node_to_partition): Do not re-add items to partition;
298 handle thunks.
c47d0034
JH
299 (add_varpool_node_to_partition): Do not re-add items to partition.
300
bb3398ca
JH
3012011-05-03 Jan Hubicka <jh@suse.cz>
302
303 * lto.c (free_ltrans_partitions): Fix accidental commit.
304
1cb1a99f
JH
3052011-05-03 Jan Hubicka <jh@suse.cz>
306
307 * lto.c (ltrans_partition_def): Remove GTY annotations.
308 (ltrans_partitions): Move to heap.
309 (new_partition): Update.
310 (free_ltrans_partitions): New function.
311 (lto_wpa_write_files): Use it.
312
af8bca3c
MJ
3132011-04-29 Martin Jambor <mjambor@suse.cz>
314
315 * lto.c: Include ipa-utils.h.
316 (lto_balanced_map): Update call to ipa_reverse_postorder.
317 * Make-lang.in (lto/lto.o): Add IPA_UTILS_H to dependencies.
318
b823cdfe
MM
3192011-04-29 Michael Matz <matz@suse.de>
320
321 * lto.c (toplevel): Include tree-flow.h.
322 (lto_read_in_decl_state): Don't merge types here.
323 (tree_with_vars): New static hash table.
324 (remember_with_vars): New static functions.
325 (LTO_FIXUP_TYPE): New macro.
326 (lto_ft_common, lto_ft_decl_minimal, lto_ft_decl_common,
327 lto_ft_decl_with_vis, lto_ft_decl_non_common, lto_ft_function,
328 lto_ft_field_decl, lto_ft_type, lto_ft_binfo, lto_ft_constructor,
329 lto_ft_expr, lto_fixup_types, uniquify_nodes): New static functions.
330 (lto_read_decls): Uniquify while reading in trees.
331 (lto_fixup_data_t, LTO_FIXUP_SUBTREE,
332 LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE, no_fixup_p, lto_fixup_common,
333 lto_fixup_decl_minimal, lto_fixup_decl_common, lto_fixup_decl_with_vis,
334 lto_fixup_decl_non_common, lto_fixup_function, lto_fixup_field_decl,
335 lto_fixup_type, lto_fixup_binfo, lto_fixup_constructor,
336 lto_fixup_tree): Remove.
337 (lto_fixup_state): Remove data argument. Use
338 lto_symtab_prevailing_decl.
339 (LTO_SET_PREVAIL, LTO_NO_PREVAIL): New macros.
340 (lto_fixup_prevailing_decls): New function.
341 (lto_fixup_state_aux): Argument aux is unused.
342 (lto_fixup_decls): Don't allocate pointer sets, don't use
343 lto_fixup_tree, use lto_fixup_prevailing_decls.
344 (read_cgraph_and_symbols): Allocate and remove tree_with_vars.
345 * Make-lang.in (lto/lto.o): Depend on $(TREE_FLOW_H).
346
b9843260
EB
3472011-04-16 Eric Botcazou <ebotcazou@adacore.com>
348
349 * lto.c (lto_balanced_map): Fix typos in head comment.
350 (lto_promote_cross_file_statics): Fix long lines and remove redundant
351 test.
352
e7f23018
JH
3532011-04-16 Jan Hubicka <jh@suse.cz>
354
355 * lto.c (lto_balanced_map): Update.
356
10a5dd5d
JH
3572011-04-14 Jan Hubicka <jh@suse.cz>
358
359 * lto.c: Include ipa-inline.h
b9843260
EB
360 (add_cgraph_node_to_partition, undo_partition): Use inline_summary
361 accessor.
10a5dd5d
JH
362 (ipa_node_duplication_hook): Fix declaration.
363 * Make-lang.in (lto.o): Update dependencies.
364
81f653d6
NF
3652011-04-12 Nathan Froyd <froydnj@codesourcery.com>
366
367 * lto-tree.h (union lang_tree_node): Check for TS_COMMON before
368 calling TREE_CHAIN.
369 * lto.c (lto_fixup_common): Likewise.
370
dcf0c47e
NF
3712011-04-08 Nathan Froyd <froydnj@codesourcery.com>
372
373 * lto-lang.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES.
374 (handle_type_generic_attribute): Likewise.
375
e89964e3
MM
3762011-04-03 Michael Matz <matz@suse.de>
377
378 * lto.c (lto_materialize_function): Don't read and then discard
379 sections in WPA mode.
380 (lto_read_in_decl_state): Adjust call to lto_streamer_cache_get.
381
382 * lto-lang.c (registered_builtin_fndecls): Remove.
383 (lto_getdecls): Return NULL_TREE.
384 (lto_builtin_function): Don't remember in registered_builtin_fndecls.
385
d2b3fe18
RG
3862011-03-31 Richard Guenther <rguenther@suse.de>
387
388 PR lto/48246
389 * lto.c (lto_wpa_write_files): Disable assert for non-empty
390 partitions when checking is not enabled.
391
ba78087b
KT
3922011-03-25 Kai Tietz <ktietz@redhat.com>
393
394 * lto.c (lto_resolution_read): Use filename_cmp instead
395 of strcmp.
396 (lto_read_section_data): Likewise.
397
0edf1bb2
JL
3982011-03-25 Jeff Law <law@redhat.com>
399
400 * lto/lto-lang.c (def_fn_type): Add missing va_end.
401
62d784f7
KT
4022011-03-21 Kai Tietz <ktietz@redhat.com>
403
404 PR target/12171
405 * lto-lang.c (lto_attribute_table): Adjust table.
406
62dd9571
JJ
4072011-02-18 Jakub Jelinek <jakub@redhat.com>
408
409 PR bootstrap/47807
410 * Make-lang.in (lto/lto-lang.o): Depend on $(LTO_STREAMER_H) instead
411 of lto-streamer.h.
412
237d6259
RG
4132011-02-18 Richard Guenther <rguenther@suse.de>
414
415 PR lto/47798
416 * lto-tree.h (lto_global_var_decls): Do not declare here.
417 * lto-lang.c: Include lto-streamer.h.
418 * Make-lang.in (lto-lang.o): Adjust dependencies.
419
8ead2223
KT
4202011-02-10 Kai Tietz <kai.tietz@onevision.com>
421
422 PR lto/47241
423 * lto.c (lto_read_section_data): Free
424 fd_name in failure case.
425 For mingw targets don't hash file-descriptor.
426 (read_cgraph_and_symbols): Close current_lto_file
427 in failure case.
428
6e701822
JH
4292011-01-11 Jan Hubicka <jh@suse.cz>
430
431 PR lto/45721
432 PR lto/45375
b9843260
EB
433 * lto.c (partition_cgraph_node_p, partition_varpool_node_p): Weakrefs
434 are not partitioned.
6e701822 435
f4da8dce
NF
4362010-12-22 Nathan Froyd <froydnj@codesourcery.com>
437
438 * lto-lang.c (handle_nonnull_attribute, handle_sentinel_attribute):
439 Use prototype_p.
440
6b7fb143
RG
4412010-12-06 Richard Guenther <rguenther@suse.de>
442
443 PR lto/46796
444 * lto-lang.c (lto_init): Give names to basic types.
445
c59ffc41
JM
4462010-11-30 Joseph Myers <joseph@codesourcery.com>
447
448 * lto-object.c: Don't include toplev.h.
449 * Make-lang.in (lto/lto-object.o): Don't depend on toplev.h.
450
7c475d11
JM
4512010-11-30 Joseph Myers <joseph@codesourcery.com>
452
453 * Make-lang.in (lto/lto-object.o): Depend on toplev.h instead of
454 $(TOPLEV_H).
455
71f3e391
JM
4562010-11-29 Joseph Myers <joseph@codesourcery.com>
457
458 * lto-endian.h: Delete.
459 * lto-object.c: Don't include "libiberty.h".
460 (O_BINARY): Don't define.
461 * lto.c: Don't include "libiberty.h" or <sys/mman.h>.
462 (O_BINARY): Don't define.
463
9f1718b0
RG
4642010-11-23 Richard Guenther <rguenther@suse.de>
465
466 * lto.c (read_cgraph_and_symbols): Remove newline from diagnostic.
467
39c4e298
RG
4682010-11-23 Richard Guenther <rguenther@suse.de>
469
470 PR lto/46605
471 * lto.c (read_cgraph_and_symbols): Bail out after errors.
472
b37421c6
JM
4732010-11-17 Joseph Myers <joseph@codesourcery.com>
474
475 * lto.c (lto_main): Take no arguments.
476 * lto.h (lto_main): Update prototype.
477
d82f74d3
ILT
4782010-11-16 Ian Lance Taylor <iant@google.com>
479
480 * lto-object.c (lto_obj_file_open): Call
481 simple_object_attributes_merge rather than
482 simple_object_attributes_compare.
483
a4d8c676
JM
4842010-11-12 Joseph Myers <joseph@codesourcery.com>
485
486 * Make-lang.in (lto/lto.o): Use $(OPTS_H).
487 * lto-lang.c (lto_handle_option): Take location_t parameter.
488
d8a07487
JM
4892010-11-10 Joseph Myers <joseph@codesourcery.com>
490
491 * lto.c (lto_resolution_read): Start diagnostics with lowercase
492 letters and remove trailing '.'.
493 (lto_file_finalize): Start diagnostic with a lowercase letter.
494
6b3456d1
ILT
4952010-11-02 Ian Lance Taylor <iant@google.com>
496
497 * lto-object.c: New file.
498 * lto-elf.c: Remove file.
499 * lto-macho.c: Remove file.
500 * lto-macho.h: Remove file.
501 * lto-coff.c: Remove file.
502 * lto-coff.h: Remove file.
503 * Make-lang.in (LTO_OBJS): Change lto/$(LTO_BINARY_READER).o to
504 lto/lto-object.o.
505 ($(LTO_EXE)): Remove $(LTO_USE_LIBELF)
506 (lto/lto-objfile.o): New target.
507 (lto/lto-elf.o, lto/lto-coff.o, lto/lto-macho.o): Remove targets.
508 (lto/lto.o): Remove $(LIBIBERTY_H).
509
030cd86c
JH
5102010-10-22 Jan Hubicka <jh@suse.cz>
511
512 * lto.c (add_cgraph_node_to_partition,
513 add_varpool_node_to_partition): Add debug info.
514 (lto_1_to_1_map, lto_balanced_map): Do not re-add already
515 partitioned nodes.
516 (do_whole_program_analysis): Set function flags before dumping.
517
4490cae6
RG
5182010-10-22 Richard Guenther <rguenther@suse.de>
519
520 * lto.c (lto_fixup_type): Fixup TYPE_CANONICAL again, via
521 the new gimple_register_canonical_type.
522
703cdce3
L
5232010-10-20 H.J. Lu <hongjiu.lu@intel.com>
524
525 PR bootstrap/45954
526 * config-lang.in (boot_language): Set to $enable_lto.
527
1915c739
JJ
5282010-10-18 Jakub Jelinek <jakub@redhat.com>
529
530 PR lto/45638
531 * Make-lang.in (check-lto): New dummy target.
532
82971de5
EB
5332010-10-14 Eric Botcazou <ebotcazou@adacore.com>
534
535 * lto-elf.c (SHN_XINDEX): Define if not already defined.
536
a75bfaa6
JM
5372010-10-08 Joseph Myers <joseph@codesourcery.com>
538
539 * lto-lang.c (lto_init_options): Change to
540 lto_init_options_struct. Update parameters.
541 (LANG_HOOKS_INIT_OPTIONS): Don't define.
542 (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
543
937f7f69
JH
5442010-10-06 Jan Hubicka <jh@suse.cz>
545
546 * lto.c (lto_balanced_map): Fix accounting of program size.
547
2169830c
JH
5482010-10-06 Jan Hubicka <jh@suse.cz>
549
550 * lto.c (lto_balanced_map): Do not produce empty partitions.
551
6e9bd0f8
AK
5522010-10-06 Andi Kleen <ak@linux.intel.com>
553
554 * lto.c (lto_process_name): Add.
555 (lto_main): Call lto_process_name.
556
06ed016f
JH
5572010-10-06 Jan Hubicka <jh@suse.cz>
558
559 * lto.c (partition_cgraph_node_p, partition_varpool_node_p): Handle
560 COMDATs required by the linker.
561
ae718d66
ILT
5622010-10-05 Ian Lance Taylor <iant@google.com>
563
564 * lto.c (lto_section_with_id): Make s a const pointer.
565
852e4bd2
JH
5662010-10-05 Jan Hubicka <jh@suse.cz>
567
568 * lto.c: Include params.h.
569 (add_cgraph_node_to_partition, add_varpool_node_to_partition): Do
570 refcounting in aux field.
571 (undo_partition, partition_cgraph_node_p, partition_varpool_node_p):
572 New functions.
573 (lto_1_to_1_map): Simplify.
574 (lto_balanced_map): New function.
575 (do_whole_program_analysis): Chose proper partitioning alg.
576 * Make-lang.in (lto.o): Add dependency on params.h
577
a90163e9
AK
5782010-10-04 Andi Kleen <ak@linux.intel.com>
579
580 * Make-lang.in (lto1): Add + to build rule.
581
f1e92a43
AK
5822010-10-03 Andi Kleen <ak@linux.intel.com>
583
584 * lto.c (lto_file_finalize): Replace gcc_assert for missing section
585 with fatal_error.
586
0d6e14fd
JH
5872010-09-28 Jan Hubicka <jh@suse.cz>
588
589 * lto-lang.c (handle_leaf_attribute): New function.
590 (lto_attribute_tables): Add leaf.
591
fb462383
JZ
5922010-09-25 Jie Zhang <jie@codesourcery.com>
593
594 * lto.c (lto_read_all_file_options): Start a new line after
595 printing out file names.
596
051f8cc6
JH
5972010-09-24 Jan Hubicka <jh@suse.cz>
598
599 * lto.c (lto_promote_cross_file_statics): Use const_value_known_p.
600
64e0f5ff
JH
6012010-09-20 Jan Hubicka <jh@suse.cz>
602
603 PR tree-optimize/45605
604 * lto.c (lto_promote_cross_file_statics): Use const_value_known_p.
605
a929ec3d
GP
6062010-09-18 Gerald Pfeifer <gerald@pfeifer.com>
607
608 * lto-elf.c (lto_obj_file_open): Also provide filename when
609 elf_begin fails.
610
4c588abf
JH
6112010-09-17 Jan Hubicka <jh@suse.cz>
612
613 * lto.c (lto_promote_cross_file_statics): Use const_value_known.
614
c3224d6f
RG
6152010-09-17 Richard Guenther <rguenther@suse.de>
616
617 * lang.opt (flag_wpa): Also enable for the driver.
618
52b3b3c7
JH
6192010-09-16 Jan Hubicka <jh@suse.cz>
620
621 * lto.c (lto_materialize_function): Do not tamper with STATIC and
622 EXTERNAL flags.
623
969c37b7
LB
6242010-09-15 Laurynas Biveinis <laurynas.biveinis@gmail.com>
625
626 * lto-tree.h (struct lang_type): Add variable_size GTY option.
627
098a4f50
JH
6282010-09-08 Jan Hubicka <jh@suse.cz>
629
630 * lto.c (real_file_count, real_file_decl_data): New static vars.
631 (read_cgraph_and_symbols): Use it.
632
0f443ad0
RG
6332010-09-08 Richard Guenther <rguenther@suse.de>
634
635 * lto.c (read_cgraph_and_symbols): Collect again after each
636 file.
637
ee187353
JH
6382010-09-07 Jan Hubicka <jh@suse.cz>
639
640 * lto.c (promote_var, promote_fn): Set DECL_VISIBILITY_SPECIFIED.
641
b3ec52d0
RG
6422010-09-03 Richard Guenther <rguenther@suse.de>
643
644 * lto-elf.c (validate_file): Always error if validation fails.
645
f1395d4a
JH
6462010-08-20 Jan Hubicka <jh@suse.cz>
647
648 * lto.c (lto_1_to_1_map): Be prepared for node to have no file data.
649 (lto_wpa_write_files): Update comments.
650
2429bce3
L
6512010-08-20 H.J. Lu <hongjiu.lu@intel.com>
652
653 PR bootstrap/45357
654 * lto.c (lto_materialize_function): Replace has_analyzed_clone
655 with has_analyzed_clone_p.
656
e0f967db
JH
6572010-08-20 Jan Hubicka <jh@suse.cz>
658
659 * lto.c (has_analyzed_clone_p): New function
660 (lto_materialize_function): Use callgraph to determine if
661 body is needed.
662 (materialize_cgraph): Remove DECL_IS_BUILTIN check.
663
ac47786e
NF
6642010-08-20 Nathan Froyd <froydnj@codesourcery.com>
665
666 * lto.c: Use FOR_EACH_VEC_ELT.
667
d720b869
AK
6682010-07-27 Andi Kleen <ak@linux.intel.com>
669
670 * Make-lang.in (lto.o): Add dependency to splay-tree.h
671
5f20c657
JM
6722010-07-27 Joseph Myers <joseph@codesourcery.com>
673
674 * lto-lang.c (lto_handle_option): Update prototype and return
675 value type. Remove duplicate assignment to result.
676
7a9bf9a4
JM
6772010-07-27 Joseph Myers <joseph@codesourcery.com>
678
679 * lto-lang.c (lto_option_lang_mask, lto_complain_wrong_lang_p):
680 New.
681 (lto_init_options): Update prototype.
682 (LANG_HOOKS_OPTION_LANG_MASK, LANG_HOOKS_COMPLAIN_WRONG_LANG_P):
683 Define.
684
73ce4d1e
AK
6852010-07-10 Andi Kleen <ak@linux.intel.com>
686
687 PR lto/44992
688 * lto.c: Include splay-tree.h
689 (lto_resolution_read): Change to walk file_ids tree and parse
690 extra file_id in resolution file.
691 (lto_section_with_id): Add.
692 (create_subid_section_table): Add.
693 (lwstate): Add.
694 (lto_create_files_from_ids): Add.
695 (lto_file_read): Change to handle sub file ids and create list
696 of file_datas. Add output argument for count.
697 (get_section_data): Pass file_data to lto_get_section_name.
698 (lto_flatten_file): Add.
699 (read_cgraph_and_symbols): Handle linked lists of file_datas.
700
2994ee14
AK
7012010-07-10 Andi Kleen <ak@linux.intel.com>
702
703 * lto-coff.c (hash_name, eq_name): Move.
704 (lto_obj_build_section_table): Call lto_obj_create_section_hash_table.
705 * lto-elf.c: (hash_name, eq_name): Move.
706 (lto_obj_build_section_table): Call lto_obj_create_section_hash_table.
707 * lto-macho.c: (hash_name, eq_name): Move.
708 (lto_obj_build_section_table): Call lto_obj_create_section_hash_table.
709 * lto.c: (hash_name, eq_name): Move from lto-*.c
710 (lto_obj_create_section_hash_table): Add.
711 (free_with_string): Add.
712
718f9c0f
MLI
7132010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
714
715 * lto-coff.c: Include diagnostic-core.h in every file that
716 includes toplev.h.
717 * lto-elf.c: Likewise.
718 * lto-lang.c: Likewise.
719 * lto-macho.c: Likewise.
720
1b137837
JJ
7212010-07-07 Jakub Jelinek <jakub@redhat.com>
722
723 * lto-elf.c (ELFOSABI_NONE, ELFOSABI_LINUX): Define if not defined.
724 (validate_file): Allow merging of ELFOSABI_NONE with ELFOSABI_LINUX
725 objects.
726
92eb4438
JH
7272010-07-05 Jan Hubicka <jh@suse.cz>
728
729 * lto.c (add_cgraph_node_to_partition): Forward declare; walk also
730 nodes from same comdat group as well as all comdat functions referenced
731 here.
b9843260
EB
732 (add_varpool_node_to_partition, add_references_to_partition): New
733 function.
734 (lto_1_1_map): Skip COMDAT fnctions/variables; use
735 add_varpool_node_to_partition; clear aux flags when done.
736 (lto_promote_cross_file_statics): Do not promote stuff that gets
737 duplicated to each ltrans.
92eb4438 738
a05541a9
JH
7392010-07-04 Jan Hubicka <jh@suse.cz>
740
741 * lto.c (read_cgraph_and_symbols): Dump cgraph before merging.
742
4a2ac96f
RG
7432010-06-13 Richard Guenther <rguenther@suse.de>
744
745 * lto.c (lto_fixup_type): Do not register or fixup TYPE_CANONICAL.
746
1d536046
KT
7472010-06-09 Kai Tietz <kai.tietz@onevision.com>
748
749 * lto.c (lto_resolution_read): Pre-initialize local variable r.
750 * lto-coff.c (coff_write_object_file): Add braces to if.
751
a9429e29
LB
7522010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
753
754 * lto.c (lto_read_in_decl_state): Use typed GC allocation.
755 (lto_file_read): Likewise.
756 (new_partition): Likewise.
757 (read_cgraph_and_symbols): Likewise.
758
5498f011
JM
7592010-06-07 Joseph Myers <joseph@codesourcery.com>
760
761 * lto-lang.c (flag_no_builtin, flag_no_nonansi_builtin): Remove.
762 (lto_handle_option): Don't set flag_signed_char here.
763
d4c0c9f6
RG
7642010-06-04 Richard Guenther <rguenther@suse.de>
765
766 PR lto/41584
767 * lto.c (lto_1_to_1_map): Use the proper file_data for
768 varpool nodes.
769
0a5fa5a1
JH
7702010-05-30 Jan Hubicka <jh@suse.cz>
771
772 * lto.c (promote_var, promote_fn, lto_wpa_write_files): Dump
773 partitioning decisions.
774
9eec9488
JH
7752010-05-29 Jan Hubicka <jh@suse.cz>
776
777 * lto.c (bitmap vector): Remove.
778 (lto_cgraph_node_sets, lto_varpool_node_sets): Remove.
779 (ltrans_partition_def): New structure.
780 (ltrans_partition): New type and VECtor.
781 (new_partition): New function.
782 (add_cgraph_node_to_partition): New function.
783 (lto_1_to_1_map): Reorganize for partitions.
784 (lto_add_inline_clones): Remove.
785 (lto_add_all_inlinees): Remove.
786 (lto_promote_cross_file_statics): Use partitions.
787 (cmp_partitions): New function.
788 (lto_wpa_write_files): Do not call lto_add_all_inlinees;
789 use partitions; output files sorted by size.
790
3e097227
SB
7912010-05-29 Steven Bosscher <steven@gcc.gnu.org>
792
793 * Make-lang.in: Replace vec.h dependency with VEC_H.
794
7ca92787
JM
7952010-05-28 Joseph Myers <joseph@codesourcery.com>
796
797 * lto-coff.c (coff_errmsg): Remove.
798 (lto_coff_begin_section_with_type, lto_obj_append_data): Use %m in
799 errors instead of coff_errmsg (-1).
800 * lto-macho.c (mach_o_errmsg): Remove.
801 (lto_obj_begin_section, lto_obj_append_data): Use %m in errors
802 instead of mach_o_errmsg (-1).
803 * lto.c (read_cgraph_and_symbols): Use %m in errors instead of
804 xstrerror (errno).
805
b5611987
RG
8062010-05-28 Richard Guenther <rguenther@suse.de>
807
808 * lto.c (prefix_name_with_star): Removed.
809 (strip_extension): Likewise.
810 (get_filename_for_set): Likewise.
811 (lto_write_ltrans_list): Fold into ...
812 (lto_wpa_write_files): ... this. Name LTRANS units
813 by suffixing the ltrans output list filename.
814 (do_whole_program_analysis): Adjust.
815
1da2ed5f
JM
8162010-05-27 Joseph Myers <joseph@codesourcery.com>
817
818 * lto.c: Include diagnostic-core.h instead of diagnostic.h.
819 (read_cgraph_and_symbols, lto_main): Use seen_error.
820 * Make-lang.in (lto/lto.o): Update dependencies.
821
7951d88a
EB
8222010-05-27 Eric Botcazou <ebotcazou@adacore.com>
823
824 PR lto/44230
825 * lto.h (lto_eh_personality): New prototype.
826 * lto.c: Include debug.h.
827 (first_personality_decl): New static variable.
828 (lto_materialize_function): Set it to DECL_FUNCTION_PERSONALITY of the
829 first function for which it is non-null.
830 (lto_eh_personality_decl): New static variable.
831 (lto_eh_personality): New function.
832 * lto-lang.c (LANG_HOOKS_EH_PERSONALITY): Redefine to above function.
833 * Make-lang.in (lto/lto.o): Add dependency on debug.h.
834
e12da9c2
SB
8352010-05-26 Steven Bosscher <steven@gcc.gnu.org>
836
837 * lto-lang.c: Do not include expr.h.
838
468194f4
RG
8392010-05-24 Richard Guenther <rguenther@suse.de>
840
841 * lto-elf.c (lto_obj_build_section_table): Work around
842 FreeBSD libelf issue.
843
bd9eb5da
RG
8442010-05-22 Richard Guenther <rguenther@suse.de>
845
846 * lto.c (read_cgraph_and_symbols): Do not collect.
847
66576e1b
JH
8482010-05-20 Jan Hubicka <jh@suse.cz>
849
850 * lto.c (promote_var, promote_fn): New functions.
851 (lto_promote_cross_file_statics): Compute correctly boundary including
852 static initializers of readonly vars.
853
36576655
JH
8542010-05-18 Jan Hubicka <jh@suse.cz>
855
66576e1b 856 * lto.c (lto_1_to_1_map): Partition non-inline clones.
36576655
JH
857 (lto_promote_cross_file_statics): Deal with non-inline clones.
858
28632d63
JH
8592010-05-18 Jan Hubicka <jh@suse.cz>
860
861 * lto.c (lto_materialize_function): Announce function when
862 reading body; allocate_struct_function only when reading body;
863 do not finalize local statics; ggc_collect after reading;
864 do not mark reachable node.
865 (materialize_cgraph): Do not announce function.
866
33e42d56
JH
8672010-05-11 Jan Hubicka <jh@suse.cz>
868
869 * lto.c (materialize_cgraph): Revert my previous patch.
870
f6430ea5
KT
8712010-05-11 Kai Tietz <kai.tietz@onevision.com>
872
873 * lto-coff.c (IMAGE_FILE_MACHINE_ADM64): Rename to
874 IMAGE_FILE_MACHINE_AMD64.
875 * lto-coff.c (IMAGE_FILE_MACHINE_ADM64): Likewise.
876
0a0b07b7
JH
8772010-05-11 Jan Hubicka <jh@suse.cz>
878
879 * lto.c (lto_fixup_decls): Remove global var decls freeing here.
880 (materialize_cgraph): Add it here.
881
9a809897
JH
8822010-05-11 Jan Hubicka <jh@suse.cz>
883
884 * lto.c (lto_fixup_decls): Free no longer needed lto_global_var_decls
885 vector.
886
8872010-05-11 Jan Hubicka <jh@suse.cz>
888
889 * lto.c (lto_1_to_1_map): Remove some no longer needed checks.
890 (lto_promote_cross_file_statics): Never promote DECL_EXTERNAL;
891 use reachable_from_other_partition_p and
892 referenced_from_other_partition_p test.
893
94f64249
KT
8942010-05-11 Kai Tietz <kai.tietz@onevision.com>
895
896 * lto-coff.c (validate_file): Add x64-coff support.
897 * lto-coff.h (IMAGE_FILE_MACHINE_ADM64): New.
898 (COFF_KNOWN_MACHINES): Add IMAGE_FILE_MACHINE_ADM64.
899 * lto-lang.c (lto_build_c_type_nodes): Add check for
900 'long long unsigned int' for x64-windows.
901 (lto_init): Likewise.
902
903
c082f9f3
SB
9042010-05-07 Steven Bosscher <steven@gcc.gnu.org>
905
906 * lto.h (struct lto_file_struct): Document offset member.
907 * lto-endian.h: New file.
908 * lto-macho.h: New file.
909 * lto-macho.c: New file.
910 * Make-lang.in: Add rule for lto-macho.o.
911
5cd0e96b
RG
9122010-05-07 Richard Guenther <rguenther@suse.de>
913
914 PR lto/43857
915 PR lto/43371
916 * lang.opt (fresolution): Change to ...
917 (fresolution=): ... this.
918 * lto-lang.c (lto_handle_option): Adjust.
919
48cf395b
RB
9202010-05-07 Richard Guenther <rguenther@suse.de>
921
922 * lto.c (DUMPBASE_SUFFIX): Remove.
923 (lto_execute_ltrans): Move functionality to lto-wrapper.c.
924 Rename to ...
925 (lto_write_ltrans_list): ... only output the list of ltrans files.
926 (lto_maybe_unlink): Remove.
927 (do_whole_program_analysis): Do not execute LTRANS phase
928 from here.
929
afa83c15
L
9302010-05-06 H.J. Lu <hongjiu.lu@intel.com>
931
932 * lto-lang.c (lto_handle_option): Add argument kind.
933
369451ec
JH
9342010-05-05 Jan Hubicka <jh@suse.cz>
935
48cf395b
RB
936 * lto.c (lto_promote_cross_file_statics): Compute boundary based on
937 refs.
369451ec 938
2f41ecf5
JH
9392010-05-05 Jan Hubicka <jh@suse.cz>
940
941 * lto.c (lto_1_to_1_map): Partition only needed nodes.
942
ace72c88
JH
9432010-04-30 Jan Hubicka <jh@suse.cz>
944
b9843260
EB
945 * lto.c (get_filename_for_set): Look for cgraph node and if none found,
946 use default name.
ace72c88
JH
947 (lto_wpa_write_files): Write any non-empty partition.
948
05575e07
JH
9492010-04-30 Jan Hubicka <jh@suse.cz>
950
951 * lto.c: Do not attempt to make constant pool references global.
952
49ba8180
JH
9532010-04-28 Jan Hubicka <jh@suse.cz>
954
955 * lto/lto.c (lto_read_in_decl_state): Use GGC.
956 (lto_wpa_write_files): Announce what we are writting.
957 (all_file_decl_data): New.
958 (read_cgraph_and_symbols): Use GGC; correct timevars.
959 (do_whole_program_analysis): Collect.
960 * lto/Make-lang.in (lto.o): Fix dependency.
961 * Makefile.in (GTFILES): Add lto-streamer.h.
962 * varpool.c (varpool_analyze_pending_decls): Use TV_VARPOOL.
963 (varpool_assemble_pending_decls): Use VAROUT.
964 * lto-streamer.h (lto_tree_ref_table): Annotate.
965 (lto_in_decl_state): Annotate.
966 (lto_file_decl_data): Annotate.
967
2942c502
JH
9682010-04-28 Jan Hubicka <jh@suse.cz>
969
970 * lto.c (lto_varpool_node_sets): New.
971 (lto_1_to_1_map): Partition varpool too.
972 (globalize_context_t, globalize_cross_file_statics,
973 lto_scan_statics_in_ref_table, lto_scan_statics_in_cgraph_node,
974 lto_scan_statics_in_remaining_global_vars): Remove.
975 (lto_promote_cross_file_statics): Rewrite.
976 (get_filename_for_set): Take vset argument.
977 (lto_wpa_write_files): Pass around vsets.
978
3bec79c5
DK
9792010-04-27 Dave Korn <dave.korn.cygwin@gmail.com>
980
981 PR lto/42776
982 * Make-lang.in (LTO_OBJS): Use LTO_BINARY_READER instead of
983 hardcoding 'lto-elf.o'.
984 ($(LTO_EXE)): Use LTO_USE_LIBELF instead of hardcoding '-lelf'.
985
986 * lto-coff.h: New file.
987 * lto-coff.c: Likewise.
988
21aac880
RG
9892010-04-26 Richard Guenther <rguenther@suse.de>
990
991 * lto.c (lto_fixup_type): Deal with non-type TYPE_CONTEXT.
992
2cee0101
DK
9932010-04-26 Dave Korn <dave.korn.cygwin@gmail.com>
994
995 * lto.h (lto_elf_file_open): Rename prototype from this ...
996 (lto_obj_file_open): ... to this.
997 (lto_elf_file_close): Likewise ...
998 (lto_obj_file_close): ... and likewise.
999 (lto_elf_build_section_table): Likewise ...
1000 (lto_obj_build_section_table): ... and likewise.
1001 (lto_elf_begin_section): Likewise ...
1002 (lto_obj_begin_section): ... and likewise.
1003 (lto_elf_append_data): Likewise ...
1004 (lto_obj_append_data): ... and likewise.
1005 (lto_elf_end_section): Likewise ...
1006 (lto_obj_end_section): ... and likewise.
1007 * lto.c (lto_file_read): Update references to the above.
1008 (lto_wpa_write_files): Likewise.
1009 (lto_read_all_file_options): Likewise.
1010 (read_cgraph_and_symbols): Likewise.
1011 * lto-lang.c (LANG_HOOKS_BEGIN_SECTION): Likewise.
1012 (LANG_HOOKS_APPEND_DATA): Likewise.
1013 (LANG_HOOKS_END_SECTION): Likewise.
1014 * lto-elf.c (lto_elf_file_open): Rename from this ...
1015 (lto_obj_file_open): ... to this, updating any references.
1016 (lto_elf_file_close): Likewise ...
1017 (lto_obj_file_close): ... and likewise.
1018 (lto_elf_build_section_table): Likewise ...
1019 (lto_obj_build_section_table): ... and likewise.
1020 (lto_elf_begin_section): Likewise ...
1021 (lto_obj_begin_section): ... and likewise.
1022 (lto_elf_append_data): Likewise ...
1023 (lto_obj_append_data): ... and likewise.
1024 (lto_elf_end_section): Likewise ...
1025 (lto_obj_end_section): ... and likewise.
1026
bc58d7e1
JH
10272010-04-21 Jan Hubicka <jh@suse.cz>
1028
1029 * lto.c (lto_fixup_tree): Do not call wpa fixup.
1030 (materialize_cgraph): Likewise.
1031
e792884f
JH
10322010-04-21 Jan Hubicka <jh@suse.cz>
1033
1034 * lto.c (lto_wpa_write_files): Update.
1035 (read_cgraph_and_symbols): Be more verbose.
1036 (materialize_cgraph): Likewise.
1037 (do_whole_program_analysis): Likewise.
1038
c9945504
JH
10392010-04-21 Jan Hubicka <jh@suse.cz>
1040
1041 * lto.c (globalize_cross_file_statics): When function has address taken,
1042 it needs to be public.
1043
a837268b
JH
10442010-04-20 Jan Hubicka <jh@suse.cz>
1045
1046 * lto.c (lto_add_inline_clones): Do not track inlined_decls.
1047 (lto_add_all_inlinees): Likewise.
1048 (lto_wpa_write_files): Likewise.
1049
3b9e5d95
EB
10502010-04-18 Eric Botcazou <ebotcazou@adacore.com>
1051
1052 * lto-lang.c (lto_init): Remove second argument in call to
1053 build_common_tree_nodes.
1054
8ccb78f2
RO
10552010-04-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1056
1057 * lto-elf.c [!HAVE_ELF_GETSHDRSTRNDX] (elf_getshdrstrndx): New
1058 function.
1059
2f9b99e6
EB
10602010-03-09 Eric Botcazou <ebotcazou@adacore.com>
1061
1062 PR bootstrap/43276
1063 * lto-elf.c: Define EM_* constants if not already defined.
1064
bef7d288
EB
10652010-03-03 Eric Botcazou <ebotcazou@adacore.com>
1066
1067 * lto-elf.c (is_compatible_architecture): New static function.
1068 (DEFINE_VALIDATE_EHDR): Use it to validate the architecture.
1069
f68df07c
RG
10702010-02-11 Richard Guenther <rguenther@suse.de>
1071
1072 PR driver/43021
1073 * lto-elf.c (lto_elf_file_open): Handle file@offset case more
1074 appropriately.
1075
3cdea2b4
AH
10762010-01-11 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
1077
1078 * lto.c (O_BINARY): Define.
1079 (lto_read_section_data): Open file in binary mode.
1080 * lto-elf.c (O_BINARY): Define.
1081 (lto_elf_file_open): Open file in binary mode.
1082
c59449fa
RG
10832010-01-08 Richard Guenther <rguenther@suse.de>
1084
1085 PR lto/42528
1086 * lto-lang.c (lto_handle_option): Handle -f[un]signed-char.
1087 (lto_init): Do not init char_type_node in a standard way
1088 but according to flag_signed_char.
1089
d7fb0a6d
L
10902010-01-03 H.J. Lu <hongjiu.lu@intel.com>
1091
1092 PR lto/41564
1093 * lto.c (DUMPBASE_SUFFIX): New.
1094 (lto_execute_ltrans): Append a sequence number to -dumpbase
1095 for LTRANS.
1096
78ce4053
L
10972010-01-02 H.J. Lu <hongjiu.lu@intel.com>
1098
1099 PR lto/42580
1100 * lto-elf.c (lto_elf_file_open): Stop if the command line
1101 option file is missing.
1102
2a71eb48
RG
11032009-12-15 Richard Guenther <rguenther@suse.de>
1104
1105 * lto.c (lto_fixup_field_decl): Fixup DECL_FIELD_OFFSET.
1106 (lto_post_options): Do not disable debuginfo.
1107
a818bca1
DG
11082009-12-14 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
1109
1110 * Make-lang.in ($(LTO_EXE)): Use $(LINKER).
1111
e7d00517
RG
11122009-12-11 Richard Guenther <rguenther@suse.de>
1113
1114 PR lto/42037
1115 * lto.c (lto_resolution_read): Properly grow the vector.
1116
1ab53893
RG
11172009-12-11 Richard Guenther <rguenther@suse.de>
1118
1119 PR lto/41915
1120 * lto-lang.c (lto_init_options): Initialize flag_complex_method
1121 to the C99 default. Do not set flag_unit_at_a_time.
1122
0f900dfa
JJ
11232009-11-28 Jakub Jelinek <jakub@redhat.com>
1124
1125 * lto-lang.c (handle_nonnull_attribute): Remove unused attr_arg_num
1126 variable.
1127
92fa7608
RAE
11282009-11-19 Rafael Avila de Espindola <espindola@google.com>
1129
1130 PR bootstrap/42096
1131 * lto-elf.c (lto_elf_file_open): Use lto_parse_hex.
1132 * lto.c (lto_parse_hex): New.
1133 (lto_resolution_read): Use lto_parse_hex.
1134 * lto.h (lto_parse_hex): New.
1135
9870fe4f
RAE
11362009-11-17 Rafael Avila de Espindola <espindola@google.com>
1137
1138 * lto-elf.c (lto_file_init): Add offset argument.
1139 (lto_elf_file_open): Record the offset.
1140 * lto.c (lto_resolution_read): Change file_name into a lto_file
1141 argument. Check offsets.
1142 (lto_file_read): Update call to lto_resolution_read.
1143 * lto.h (lto_file_struct): Add the offset field.
1144
1b70729f
RAE
11452009-11-16 Rafael Avila de Espindola <espindola@google.com>
1146
1147 * lto-elf.c (lto_elf_file_open): Use strtoll to parse the offset.
1148
0e3776db
JH
11492009-11-14 Jan Hubicka <jh@suse.cz>
1150
1151 * lto.c (read_cgraph_and_symbols): Set also ipa_transforms_to_apply.
1152
06bd7f56
RAE
11532009-11-12 Rafael Avila de Espindola <espindola@google.com>
1154
1155 * lang.opt (fresolution): Renamed from resolution.
1156 * lto-lang.c (lto_handle_option): Handle new option name.
1157 * lto.c (lto_resolution_read): Add more checks. Discard rest of line.
1158
7e9dc421
RG
11592009-11-04 Richard Guenther <rguenther@suse.de>
1160 Rafael Avila de Espindola <espindola@google.com>
1161
1162 * lto-elf.c (lto_elf_build_section_table): Add the base offset.
1163 (lto_elf_file_open): Handle offsets in arguments name@offest.
1164
b207f900
RG
11652009-10-30 Richard Guenther <rguenther@suse.de>
1166
1167 PR lto/41858
1168 * lto.c (lto_file_read): Do not set file_data->fd.
1169 (lto_read_section_data): Use a single-entry file-descriptor cache.
1170 Do not check the result of xmalloc.
1171 (free_section_data): Do not use file_data->fd.
1172 (lto_read_all_file_options): Likewise.
1173
2c928155
RG
11742009-10-22 Richard Guenther <rguenther@suse.de>
1175
1176 * lto.c (lto_fixup_jump_functions): Remove.
1177 (lto_fixup_decls): Do not fixup jump functions.
1178 (read_cgraph_and_symbols): Schedule cgraph merging after
1179 summary reading. Schedule type and decl fixup before
1180 summary reading.
1181
f9c91f8a
RB
11822009-10-22 Richard Guenther <rguenther@suse.de>
1183
1184 * lto.c (lto_fixup_data_t): Remove free_list member.
1185 (lto_fixup_tree): Do not insert into free_list.
1186 (free_decl): Remove.
1187 (lto_fixup_decls): Remove free-list handling.
1188
fb3f88cc
JH
11892009-10-22 Jan Hubicka <jh@suse.cz>
1190
1191 * lto.c (lto_fixup_jump_functions): New function.
1192 (lto_fixup_decls): Use it.
1193
35f1e9f4
RG
11942009-10-16 Richard Guenther <rguenther@suse.de>
1195
1196 PR lto/41715
1197 * lto.c (lto_fixup_tree): Revert last change.
1198
200c8750
RG
11992009-10-14 Richard Guenther <rguenther@suse.de>
1200
1201 * lto.c (lto_fixup_tree): In case the prevailing decl is not
1202 compatible with the one we replace wrap it around a
1203 VIEW_CONVERT_EXPR.
1204
b1b07c92
RG
12052009-10-09 Richard Guenther <rguenther@suse.de>
1206
1207 PR lto/41635
1208 PR lto/41636
1209 * lto.c (read_cgraph_and_symbols): Do not assert we can open
1210 a file.
1211 * lto-elf.c (init_shdr##BITS): Fix i18n problems.
1212 (init_ehdr##BITS): Likewise.
1213
3c2e7d45
JM
12142009-10-08 Joseph Myers <joseph@codesourcery.com>
1215
1216 * lto-elf.c (init_shdr##BITS, lto_elf_begin_section_with_type,
1217 init_ehdr##BITS, lto_elf_file_close): Remove trailing "." from
1218 diagnostics.
1219 * lto-lang.c (lto_post_options): Remove trailing "." from
1220 diagnostics.
1221
0d0bfe17
RG
12222009-10-08 Richard Guenther <rguenther@suse.de>
1223
1224 * lto.c (read_cgraph_and_symbols): Free the gimple type merging
1225 hash tables.
1226
4bedf19a
JM
12272009-10-07 Joseph Myers <joseph@codesourcery.com>
1228
1229 * lto.c: Only include <sys/mman.h> if HAVE_MMAP_FILE.
1230
b20996ff
JH
12312009-10-07 Jan Hubicka <jh@suse.cz>
1232
1233 * lto.c (read_cgraph_and_symbols): Mark functions neccesary only at
1234 ltrans stage; explain why this is needed and should not.
1235
1a735925
RG
12362009-10-05 Richard Guenther <rguenther@suse.de>
1237
1238 PR lto/41552
1239 PR lto/41487
1240 * lto.c (lto_read_decls): Do not register deferred decls.
1241 (read_cgraph_and_symbols): Delay symbol and cgraph merging
1242 until after reading the IPA summaries.
1243
d7f09764
DN
12442009-10-02 Rafael Avila de Espindola <espindola@google.com>
1245
1246 * Make-lang.in (lto/lto-lang.o): Don't depend on lto/common.h.
1247 (lto-lang.c): Don't include lto/common.h.
1248
12492009-10-02 Rafael Avila de Espindola <espindola@google.com>
1250
1251 * Make-lang.in (LTO_OBJS): Remove lto/common.o.
1252 (lto/common.o): Remove.
1253 * common.c: Remove.
1254 * common.h (lto_kind_str): Remove.
1255 (lto_visibility_str): Remove.
1256 (lto_resolution_str): Make it static.
1257
12582009-10-01 Diego Novillo <dnovillo@google.com>
1259
1260 * lto.c (lto_read_decls): Add comment.
1261 Call internal_error instead of gcc_assert.
1262 (lto_resolution_read): Likewise.
1263 (lto_add_all_inlinees): Tidy.
1264 * Make-lang.in: Fix copyright boilerplate.
1265 (lto.pdf): New.
1266 (lto.install-pdf): New.
1267 * lto-tree.h: Fix copyright boilerplate.
1268 * lang-specs.h: Likewise.
1269 Remove ".lto" entry from compilers fragment.
1270 * lto-elf.c: Move inclusion of gelf.h after config.h.
1271 Tidy formatting everywhere.
1272 * lto.h: Fix copyright boilerplate.
1273 Tidy formatting everywhere.
1274 * common.c: Likewise.
1275 * config-lang.in: Likewise.
1276 * common.h: Likewise.
1277 * lto-lang.c: Likewise.
1278
12792009-10-01 Richard Guenther <rguenther@suse.de>
1280
1281 * lto.c (lto_read_section_data): Use plain lseek/read.
1282
12832009-10-01 Richard Guenther <rguenther@suse.de>
1284
1285 * lto.c (LTO_MMAP_IO): Define if we can mmap files and
1286 use sysconf to query the system page size.
1287 (lto_file_read): Implement fallback using stdio.
1288 (free_section_data): Likewise.
1289
12902009-09-29 Diego Novillo <dnovillo@google.com>
1291
1292 * lto-lang.c (lto_init): Really fix call to
1293 build_common_builtin_nodes.
1294
12952009-09-29 Diego Novillo <dnovillo@google.com>
1296
1297 * lto-lang.c (lto_init): Fix call to
1298 build_common_builtin_nodes.
1299
13002009-09-29 Richard Guenther <rguenther@suse.de>
1301
1302 PR lto/40754
1303 * lto-elf.c (init_shdr##BITS): Properly specify alignment
1304 in bytes.
1305 (first_data_block): New static variable.
1306 (lto_elf_append_data): Align the first data block in each
1307 section.
1308
13092009-09-28 Diego Novillo <dnovillo@google.com>
1310
1311 * lto-lang.c: Tidy. Remove stale FIXME lto markers.
1312 * lto.c (strip_extension): New.
1313 (get_filename_for_set): Call it. Do not call make_cwd_temp_file.
1314 (lto_execute_ltrans): Tidy.
1315 Do not pass -fwpa nor -fltrans-* to LTRANS.
1316 * opts.c: Tidy formatting and remove stale FIXME lto markers.
1317 * tree.c (need_assembler_name_p): Call
1318 lang_hooks.decls.may_need_assembler_name_p if set.
1319 * varasm.c (default_binds_local_p_1): Remove check for
1320 flag_ltrans.
1321 * varpool.c (decide_is_variable_needed): Do not test for
1322 in_lto_p.
1323
13242009-09-22 Richard Guenther <rguenther@suse.de>
1325
1326 PR lto/39276
1327 * lto.c (lto_execute_ltrans): Perform ltrans phase manually.
1328 * Make-lang.in: Remove ltrans-driver stuff.
1329 * config-lang.in: Likewise.
1330 * lang.opt (fltrans-driver): Remove.
1331 * lto-lang.c (lto_init_options): Remove code initializing
1332 ltrans_driver.
1333 * ltrans-driver: Remove.
1334
13352009-09-21 Diego Novillo <dnovillo@google.com>
1336
1337 * lto-lang.c (lto_define_builtins): Remove superfluous
1338 calls to targetm.init_builtins and build_common_builtin_nodes.
1339 (lto_init): Add targetm.arm_eabi_unwinder as parameter to
1340 build_common_builtin_nodes.
1341 * lto.c (lto_materialize_function): Do nothing if NODE is a
1342 clone.
1343
13442009-09-03 Diego Novillo <dnovillo@google.com>
1345
1346 * lto-elf.c (validate_file): Replace call to
1347 elf_getshstrndx with call to elf_getshdrstrndx.
1348
13492009-08-19 Richard Guenther <rguenther@suse.de>
1350
1351 * lto-lang.c (lto_init): Merge char_type_node with the
1352 appropriately signed variant.
1353
13542009-08-19 Richard Guenther <rguenther@suse.de>
1355
1356 PR lto/41071
1357 * lto.c (lto_fixup_common): Re-build the pointer-to chain part one.
1358 (lto_fixup_type): Re-build the pointer-to chain part two.
1359
13602009-08-19 Richard Guenther <rguenther@suse.de>
1361
1362 PR lto/41071
1363 * lto.c (lto_fixup_type): Re-build the type variant chain.
1364
13652009-08-19 Richard Guenther <rguenther@suse.de>
1366
1367 PR lto/41071
1368 * lto.c (lto_fixup_constructor): New function.
1369 (lto_fixup_tree): Replace all types. Properly fixup
1370 constructors and constants.
1371
13722009-08-14 Richard Guenther <rguenther@suse.de>
1373
1374 * lto.c (read_cgraph_and_symbols): Exchange TREE_CHAIN use
1375 for DECL_LANG_SPECIFIC.
1376
13772009-08-13 Richard Guenther <rguenther@suse.de>
1378
1379 PR lto/41032
1380 * lto-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Define to NULL.
1381
13822009-07-30 Richard Guenther <rguenther@suse.de>
1383
1384 PR lto/40903
1385 * lto.c (read_cgraph_and_symbols): After fixing up decls choose
1386 the largest decl for output and free TREE_CHAIN for further
1387 use.
1388
13892009-07-24 Diego Novillo <dnovillo@google.com>
1390
1391 * Make-lang.in: Add empty lto.install-plugin target.
1392
13932009-07-13 Diego Novillo <dnovillo@google.com>
1394
1395 * lto.c (lto_fixup_tree): Handle IMPORTED_DECL.
1396
13972009-07-11 Richard Guenther <rguenther@suse.de>
1398
1399 * lto-lang.c (lto_write_globals): Wrapup global decls.
1400
14012009-07-10 Richard Guenther <rguenther@suse.de>
1402
1403 * lto-lang.c (lto_init): Allocate one more location to make
1404 BUILTINS_LOCATION correct.
1405
14062009-07-09 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
1407
1408 * lto.c (free_section_data): Cast computed_offset to caddr_t.
1409
14102009-07-06 Diego Novillo <dnovillo@google.com>
1411
1412 * lto.c (lto_fixup_type): Fixup TYPE_SIZE and
1413 TYPE_SIZE_UNIT.
1414
14152009-07-06 Diego Novillo <dnovillo@google.com>
1416
1417 * lto.c (preload_common_nodes): Remove.
1418 (lto_read_in_decl_state): Call lto_streamer_cache_get.
1419 (lto_read_decls): Call lto_data_in_create and
1420 lto_data_in_delete.
1421 (free_decl): Do not call ggc_free.
1422 (lto_main): Call lto_init_reader.
1423 * lto-lang.c (lto_type_for_size): Handle intTI_type_node.
1424 (lto_init): Initialize main_identifier_node if needed.
1425 Make ptrdiff_type_node be integer_type_node.
1426
14272009-06-19 Diego Novillo <dnovillo@google.com>
1428
1429 * lto.c: Remove code guarded by #ifdef LTO_STREAM_DEBUGGING.
1430 Remove code guarded by #ifdef GLOBAL_STREAMER_TRACE.
1431 Remove code guarded by #ifdef LOCAL_TRACE.
1432
14332009-06-18 Diego Novillo <dnovillo@google.com>
1434
1435 * lto.c: Update license to GPLv3.
1436 * lto-elf.c: Likewise.
1437 * common.c: Likewise.
1438 * lto-lang.c: Likewise.
1439 * lto.h: Remove superfluous include files. Update all
1440 users.
1441
14422009-06-17 Diego Novillo <dnovillo@google.com>
1443
1444 * lto.c (read_cgraph_and_symbols): Call input_cgraph.
1445
14462009-06-02 Diego Novillo <dnovillo@google.com>
1447
1448 * lto.c (lto_1_to_1_map): Ignore nodes that have not been
1449 read in.
1450 (materialize_cgraph): Only materialize nodes that have a
1451 representation on file.
1452
14532009-06-01 Diego Novillo <dnovillo@google.com>
1454
1455 * lto-lang.c (lto_handle_option): Hanlde OPT_Wabi.
1456
14572009-05-31 Diego Novillo <dnovillo@google.com>
1458
1459 * lto-lang.c (lto_type_for_mode): Handle all the modes
1460 handled in c_common_type_for_mode.
1461
14622009-05-21 Diego Novillo <dnovillo@google.com>
1463
1464 * lto-elf.c: Always include <gelf.h>.
1465 * config-lang.in (target_libs): Remove.
1466 (build_by_default): Set to no.
1467
14682009-05-15 Diego Novillo <dnovillo@google.com>
1469
1470 * lto.c (lto_materialize_function): Assert that DECL is
1471 not a builtin.
1472 (materialize_cgraph): Don't try to materialize builtin
1473 functions.
1474 * lto-section-out.c (write_symbol_vec): Do not write
1475 builtin functions.
1476
14772009-05-13 Diego Novillo <dnovillo@google.com>
1478
1479 * lto-lang.c (LANG_HOOKS_GET_ALIAS_SET): Define.
1480
14812009-05-07 Diego Novillo <dnovillo@google.com>
1482
1483 * lto.c (lto_resolution_read): Add type casts for C++ warnings.
1484 (LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE): Define.
1485 (lto_fixup_type): Call it for TYPE_POINTER_TO,
1486 TYPE_REFERENCE_TO, TYPE_CONTEXT and TYPE_CANONICAL.
1487 (lto_fixup_tree): Call gimple_register_type when *TP is a
1488 type.
1489 (lto_main): Call bitmap_obstack_initialize.
1490
14912009-04-22 Diego Novillo <dnovillo@google.com>
1492
1493 * lto.c (free_section_data): Tidy.
1494 (lto_1_to_1_map): Tidy.
1495 (lto_add_all_inlinees): Tidy.
1496 (prefix_name_with_star): New.
1497 (get_filename_for_set): New.
1498 (lto_wpa_write_files): Call cgraph_node_set_needs_ltrans_p
1499 to determine what cgraph node sets to write.
1500 Call get_filename_for_set to compute temporary file
1501 names.
1502 (lto_execute_ltrans): Do not execute LTRANS on files with
1503 names that start with '*'.
1504 Move logic to execute LTRANS together so that LTRANS is
1505 invoked only if there are any files to compile.
1506 (do_whole_program_analysis): Only remove output files
1507 that do not start with '*'.
1508
15092009-04-06 Diego Novillo <dnovillo@google.com>
1510
1511 * lto-lang.c (lto_post_options): Set flag_excess_precision_cmdline.
1512 * lto.c (read_cgraph_and_symbols): Set cgraph_function_flags_ready.
1513 (lto_add_all_inlinees): Tidy.
1514
15152009-03-26 Diego Novillo <dnovillo@google.com>
1516
1517 * lto.c: Include gimple.h.
1518 (lto_read_in_decl_state): Call gimple_register_type for
1519 every type in every stream.
1520 (lto_fixup_common): Call gimple_register_type if T has a
1521 type.
1522 (do_whole_program_analysis): Call print_lto_report.
1523 (lto_main): Call print_lto_report after cgraph_optimize.
1524 * Make-lang.in (lto.o): Add dependency on GIMPLE_H.
1525
15262009-03-24 Diego Novillo <dnovillo@google.com>
1527
1528 * Make-lang.in (lto-lang.o): Add dependency on TARGET_H and EXPR_H.
1529 (lto.o): Add dependency on GIMPLE_H.
1530
15312009-03-10 Simon Baldwin <simonb@google.com>
1532
1533 * lto.c (lto_read_all_file_options): Close any open file descriptor
1534 contained in file_data before freeing.
1535
15362009-02-24 Rafael Avila de Espindola <espindola@google.com>
1537
1538 * lto.c (lto_add_inline_clones): Don't add the master clone. Check
1539 for a decl in the original bitmap, not a node.
1540 (lto_add_all_inlinees): Remove original nodes that are not needed.
1541 (lto_scan_statics_in_cgraph_node): Don't care if the node is the master.
1542
15432009-02-24 Diego Novillo <dnovillo@google.com>
1544
1545 * lto.c (lto_materialize_function): Update
1546 lto_stats.num_function_bodies.
1547 (get_section_data): Initialize *LEN to 0.
1548 (lto_1_to_1_map): Update lto_stats.num_cgraph_partitions.
1549 (lto_wpa_write_files): Update lto_stats.num_cgraph_nodes.
1550 Update lto_stats.num_output_files.
1551 (read_cgraph_and_symbols): Update lto_stats.num_input_files.
1552 (materialize_cgraph): Update lto_stats.num_input_cgraph_nodes.
1553 (lto_main): Initialize lto_stats.
1554 If flag_lto_report is set, call print_lto_report.
1555
15562009-02-19 Diego Novillo <dnovillo@google.com>
1557
1558 Revert
1559
1560 2009-02-19 Rafael Avila de Espindola <espindola@google.com>
1561
1562 * lto.c (lto_add_inline_clones): Don't add the
1563 master clone. Check for a decl in the original
1564 bitmap, not a node.
1565 (lto_add_all_inlinees): Remove original nodes
1566 that are not needed.
1567 (lto_scan_statics_in_cgraph_node): Don't care if
1568 the node is the master.
1569 (lto_promote_cross_file_statics): Use a new
1570 context.seen_node_decls for each set
1571
15722009-02-19 Rafael Avila de Espindola <espindola@google.com>
1573
1574 * lto.c (lto_add_inline_clones): Don't add the master clone. Check
1575 for a decl in the original bitmap, not a node.
1576 (lto_add_all_inlinees): Remove original nodes that are not needed.
1577 (lto_scan_statics_in_cgraph_node): Don't care if the node is the master.
1578 (lto_promote_cross_file_statics): Use a new context.seen_node_decls
1579 for each set
1580
15812009-02-18 Diego Novillo <dnovillo@google.com>
1582
1583 * lto.c (lto_wpa_write_files): Use timers TV_WHOPR_WPA
1584 and TV_WHOPR_WPA_IO.
1585 (lto_execute_ltrans): Use timer TV_WHOPR_WPA_LTRANS_EXEC.
1586 (read_cgraph_and_symbols): Use timer TV_IPA_LTO_DECL_IO.
1587 (materialize_cgraph): Use timer TV_IPA_LTO_GIMPLE_IO.
1588 Use timer TV_WHOPR_WPA or TV_WHOPR_LTRANS or TV_LTO
1589 depending on command line flags.
1590 (do_whole_program_analysis): Use timer TV_WHOPR_WPA.
1591 (lto_main): Remove timer uses.
1592
15932009-02-18 Rafael Avila de Espindola <espindola@google.com>
1594
1595 * lto.c (lto_materialize_function): Don't set DECL_EXTERN to 0.
1596 (lto_wpa_write_files): Update calls to renamed functions.
1597
15982009-02-17 Diego Novillo <dnovillo@google.com>
1599
1600 PR 39203
1601 * lto-lang.c (lto_post_options): Disable -fwhole-program
1602 when running LTRANS.
1603
16042009-02-10 Diego Novillo <dnovillo@google.com>
1605
1606 * lto.c (read_cgraph_and_symbols): Fix comment.
1607
16082009-02-10 Diego Novillo <dnovillo@google.com>
1609
1610 * lto.c (read_cgraph_and_symbols): Read options from all
1611 IL files.
1612
16132009-02-10 Diego Novillo <dnovillo@google.com>
1614
1615 * lto.c (read_cgraph_and_symbols): Factor out of lto_main.
1616 (materialize_cgraph): Likewise.
1617 (do_whole_program_analysis): Likewise.
1618 (lto_main): Call read_cgraph_and_symbols,
1619 materialize_cgraph and do_whole_program_analysis.
1620
16212009-02-10 Simon Baldwin <simonb@google.com>
1622
1623 * lto.c: Include lto-opts.h.
1624 * (lto_main): Clear file options at loop start, read any saved
1625 options from the first file handled, and re-issue options.
1626 * Makefile.in (lto.o): Add dependency on lto-opts.h.
1627
16282009-02-02 Diego Novillo <dnovillo@google.com>
1629
1630 * lto.c (lto_main): Stop LTO_TIMER and use
1631 TV_WHOPR_WPA_LTRANS_EXEC when launching LTRANS.
1632
16332009-01-30 H.J. Lu <hongjiu.lu@intel.com>
1634
1635 PR lto/38995
1636 * lto-elf.c (init_shdr##BITS): Set the sh_addralign field
1637 to POINTER_SIZE.
1638
16392009-01-29 Ramana Radhakrishnan <ramana.r@gmail.com>
1640
1641 * Make-lang.in (LTO_EXE): Link with all
1642 BACKENDLIBS and not only GMPLIBS
1643
16442009-01-28 H.J. Lu <hongjiu.lu@intel.com>
1645
1646 PR bootstrap/38992
1647 * lto-elf.c: Include gelf.h instead of libelf.h.
1648 (lto_elf_file_close): Replace elfx_update_shstrndx with
1649 gelf_getehdr, elf_getscn, gelf_getshdr, gelf_update_shdr and
1650 gelf_update_ehdr.
1651
16522009-01-28 H.J. Lu <hongjiu.lu@intel.com>
1653
1654 PR middle-end/38996
1655 * lto-elf.c (DEFINE_INIT_EHDR): Initialize e_version.
1656
16572009-01-26 Diego Novillo <dnovillo@google.com>
1658
1659 * lto-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Update.
1660
16612009-01-26 Diego Novillo <dnovillo@google.com>
1662
1663 * lto-lang.c (lto_types_compatible_p): Move to gimple.c
1664 and rename into gimple_types_compatible_p.
1665
16662009-01-12 Rafael Avila de Espindola <espindola@google.com>
1667
1668 * lto-lang.c (lang_hooks): Remove the const qualifier.
1669
16702009-01-06 Diego Novillo <dnovillo@google.com>
1671
1672 * ltrans-driver: Mark 'all' target as phony.
1673
16742008-12-31 Diego Novillo <dnovillo@google.com>
1675
1676 * ltrans-driver: Execute a NOP action for target 'all'.
1677
16782008-12-19 Diego Novillo <dnovillo@google.com>
1679
1680 * lto.c (lto_1_to_1_map): Tidy.
1681
16822008-12-19 Diego Novillo <dnovillo@google.com>
1683
1684 * lto-elf.c (lto_elf_file_open): When FILENAME cannot
1685 be opened, show its name.
1686 * ltrans-driver: If $verbose is set, do not use parallelism.
1687
16882008-12-17 Rafael Avila de Espindola <espindola@google.com>
1689
1690 * lto.c (lto_fixup_function): New.
1691 (lto_fixup_tree): Call lto_fixup_function.
1692
16932008-12-14 Doug Kwan <dougkwan@google.com>
1694
1695 * lto.c (lto_1_to_1_map): Create a cgraph node set for any global
1696 variables if there is no function.
1697
16982008-12-10 Simon Baldwin <simonb@google.com>
1699
1700 * ltrans-driver: Always run make in silent mode, to avoid make's
1701 trace on stdout interfering with lto-wrapper output.
1702
17032008-12-10 Doug Kwan <dougkwan@google.com>
1704
1705 * lto.c (lto_add_inline_clones): Do not force master clones of
1706 inlined functions already in SET to be static inline.
1707
17082008-12-04 Doug Kwan <dougkwan@google.com>
1709
1710 * lto.c (globalize_context_t): New type to store states in
1711 globalization of cross-file statics.
1712 (globalize_cross_file_statics): New.
1713 (lto_scan_statics_in_ref_table): Walk tree to look for reachable
1714 static decls that need to be fixed up.
1715 (lto_scan_statics_in_cgraph_node): Change call interface to use
1716 a globalize_context_t CONTEXT for all states used.
1717 (lto_scan_statics_in_remaining_global_vars): New.
1718 (lto_promote_cross_file_statics): Use new call interface of
1719 LTO_SCAN_STATICS_IN_CGRAPH_NODE. Handle remaining externally
1720 visible vars in the last set.
1721
17222008-12-03 Diego Novillo <dnovillo@google.com>
1723
1724 * lto.c (lto_fixup_tree): Do not emit an error when
1725 PREVAILING throw but T doesn't.
1726
17272008-12-02 Doug Kwan <dougkwan@google.com>
1728
1729 * lto.c (lto_scan_statics_in_ref_table): New function factored out
1730 from code in ...
1731 (lto_scan_statics_in_cgraph_node): Handle both file-scope static
1732 variables and functions.
1733 (lto_promote_cross_file_statics): Rename bitmaps to SEEN_DECLS
1734 and GLOBAL_DECLS from SEEN_VARS and GLOBAL_VARS.
1735
17362008-11-29 Diego Novillo <dnovillo@google.com>
1737
1738 * lto.c: Include timevar.h.
1739 (lto_materialize_function): Tidy. Add comments.
1740 (lto_wpa_write_files): Tidy.
1741 (lto_execute_ltrans): Tidy.
1742 (lto_main): Add local variable LTO_TIMER. Initialize it
1743 to one of TV_WHOPR_WPA, TV_WHOPR_LTRANS or TV_LTO.
1744 Start and stop the timer.
1745 Tidy comments.
1746 * Make-lang.in (lto.o): Add dependency on timevar.h.
1747 * ltrans-driver: React to -v and -save-temps.
1748 Use simple heuristic to determine how much parallelism to
1749 use when executing make.
1750
17512008-11-12 Doug Kwan <dougkwan@google.com>
1752
1753 * lto.c (lto_bitmap_obstack): Remove var.
1754 (lto_materialize_function): Do nothing instead of marking function
1755 body in file if flag_wpa is true.
1756 (lto_add_all_inlinees): Use bitmap functions in lto-utils.c.
1757 (lto_scan_statics_in_cgraph_node): New function.
1758 (lto_promote_cross_file_statics): Same.
1759 (lto_wpa_write_files): Call lto_promote_cross_file_statics.
1760 Use bitmap functions in lto-utils.c. Remove unsued label OUT.
1761 * Make-lang.in (lto/lto.o): Add lto-utils.h to dependency list.
1762
17632008-11-09 Diego Novillo <dnovillo@google.com>
1764
1765 * lto/lto.c (lto_fixup_tree): Change error message locus
1766 information to include location of mismatching
1767 declaration.
1768 Use TREE_NO_WARNING to avoid repeated messages.
1769 (lto_main): If lto_fixup_decls emitted any errors, exit.
1770 * lto/lto-lang.c: Don't include libfuncs.h and except.h
1771 (lto_init_options): Don't enable exceptions by default.
1772 (lto_eh_runtime_type): Move to lto-function-in.c
1773 (lto_init_eh): Likewise.
1774 (lto_init): Don't call lto_init_eh.
1775 * lto/Make-lang.in (lto-lang.o): Remove dependency on
1776 libfuncs.h and except.h.
1777
17782008-10-30 Diego Novillo <dnovillo@google.com>
1779
1780 * lto.c (lto_read_decls): Declare debug_main only if
1781 LTO_STREAM_DEBUGGING is enabled.
1782
17832008-10-30 Simon Baldwin <simonb@google.com>
1784
1785 * lto.c (lto_wpa_write_files): Create intermediate files with
1786 make_cwd_temp_file().
1787 (lto_maybe_unlink): New. Delete intermediate WPA files unless
1788 WPA_SAVE_LTRANS is set.
1789 (lto_main): Call lto_maybe_unlink() for intermediate WPA files.
1790 * ltrans-driver: Do not strip directory from output files.
1791
17922008-10-29 Doug Kwan <dougkwan@google.com>
1793
1794 * lto.c (free_decl): Call lto_symtab_clear_resolution when freeing
1795 DECL.
1796 * Make-lang.in (LTO_OBJS): Remove lto/lto-symtab.o
1797 (lto/lto-symtab.o): Remove rule.
1798 * lto-tree.h (struct lang_identifier): Remove LTO specific fields.
1799 (struct lang_decl): Remove RESOLUTION and add DUMMY in struct.
1800 (LANG_IDENTIFIER_CAST, LTO_IDENTIFIER_DECL, LTO_DECL_RESOLUTION):
1801 Remove macros.
1802 lto-symtab.c (File): Move up one level.
1803 lto-lang.c (cgraph.h): Remove include.
1804 (input_overwrite_node, input_node, input_edge, input_cgraph_1,
1805 input_cgraph): Move to lto-cgraph.c in gcc directory above.
1806 (LANG_HOOKS_INPUT_CGRAPH): Remove use of macro.
1807
18082008-10-24 Rafael Espindola <espindola@google.com>
1809
1810 * lto-function-in.c (get_resolution): Return LDPR_PREEMPTED_IR for
1811 non prevailing weak symbols.
1812
18132008-10-24 Rafael Espindola <espindola@google.com>
1814
1815 * lto-lang.c (input_cgraph_1): Iterate over nodes, not cgraph_nodes.
1816
18172008-10-24 Rafael Espindola <espindola@google.com>
1818
1819 * lto-lang.c (input_node): Avoid casts from pointers to ints of
1820 different types.
1821
18222008-10-23 Simon Baldwin <simonb@google.com>
1823
1824 * lto-lang.c (input_node): Save the node reference, rather than the
1825 node pointer, in node->inlined_to.
1826 (input_cgraph_1): Convert node references into node pointers.
1827
18282008-10-22 Diego Novillo <dnovillo@google.com>
1829 Rafael Espindola <espindola@google.com>
1830
1831 * lto.c (lto_resolution_read): Tidy.
1832 * lto-symtab.c (lto_symtab_prevailing_decl): Do not
1833 abort if RET is NULL.
1834
18352008-10-22 Doug Kwan <dougkwan@google.com>
1836
1837 * lto.c (lto_fixup_tree): Check for NOTHROW conflict only if
1838 exceptions flag is given.
1839 * lto-lang.c: (lto_init_options) Set default exceptions flag.
1840 (lto_init_eh): Remove exceptions flag initialization.
1841 (lto_init): Only call lto_init_eh if exceptions flag is set.
1842
18432008-10-21 Diego Novillo <dnovillo@google.com>
1844
1845 * lto.c: Tidy some formatting.
1846 * lto.h: Likewise.
1847
18482008-10-21 Simon Baldwin <simonb@google.com>
1849
1850 * lto-symtab.c: (lto_same_type_p): Types cannot be equal if one of
1851 them is NULL (but not the other).
1852
18532008-10-17 Diego Novillo <dnovillo@google.com>
1854
1855 * ltrans-driver: Divert output from make to a temporary file.
1856 Show it if the call to make failed.
1857
18582008-10-15 Diego Novillo <dnovillo@google.com>
1859
1860 * lto.c (lto_wpa_write_files): Reformat do-while loop.
1861 Do not print TEMP_FILENAME
1862 * ltrans-driver: Call make with -s.
1863
18642008-10-15 Diego Novillo <dnovillo@google.com>
1865
1866 * lto-symtab.c (lto_symtab_merge_decl): Do not force
1867 TREE_STATIC on global symbols.
1868
18692008-10-14 Ollie Wild <aaw@google.com>
1870
1871 * Make-lang.in (LTRANS_DRIVER_INSTALL_NAME): Remove.
1872 (LTRANS_DRIVER_EXE): Add.
1873 (lto.all.cross): Add LTRANS_DRIVER_EXE.
1874 (lto.all.encap): Add LTRANS_DRIVER_EXE.
1875 (lto.install.common): Remove ltrans-driver.
1876 (lto.mostlyclean): Add LTRANS_DRIVER_EXE.
1877 (LTRANS_DRIVER_EXE): New build rule.
1878 * config-lang.in (compilers): Add ltrans-driver.
1879
18802008-10-14 Diego Novillo <dnovillo@google.com>
1881
1882 * Make-lang.in (LTRANS_DRIVER_INSTALL_NAME): Disable transformation
1883 of program name.
1884
18852008-10-13 Ollie Wild <aaw@google.com>
1886
1887 * lang-spec.h (@lto): Replace lto1_options with cc1_options.
1888 * lto.c (lto_execute_ltrans): Add "-fno-wpa -fltrans -xlto" to CFLAGS.
1889 * ltrans-driver (LTRANS_FLAGS): Remove.
1890
18912008-10-08 Doug Kwan <dougkwan@google.com>
1892
1893 * lto.c (lto_fixup_tree): Remove ATTRIBUTE_UNUSED from DATA.
1894 Handle new tree codes RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE
1895 and TREE_BINFO. Also move code handling FUNCTION_DECL and VAR_DECL
1896 from lto_fixup_state to here.
1897 (lto_fixup_state): Take an lto_fixup_data_t object DATA instead of
1898 just a free-list. Fix up types also. Move decl merging code to
1899 lto_fixup_tree.
1900 (lto_fixup_state_aux): Change AUX to point to an lto_fixup_data_t
1901 object.
1902 (lto_fixup_decls): Use another pointer set to avoid multiple
1903 walking of nodes except for DECLs to be replaced. Pass an
1904 lto_fixup_data_t object to tree-walker.
1905
19062008-10-08 Rafael Espindola <espindola@google.com>
1907
1908 * lto-symtab.c (lto_symtab_set_resolution): New.
1909 (lto_symtab_merge_decl): Use lto_symtab_set_resolution and
1910 lto_symtab_get_resolution.
1911 (lto_symtab_prevailing_decl): Return decl for non public decls.
1912 (lto_symtab_get_resolution): New.
1913 * lto.c (lto_fixup_tree, lto_fixup_state): Remove unecessary checks.
1914
19152008-10-06 Rafael Espindola <espindola@google.com>
1916
1917 * lto-lang.c: Include cgraph.h.
1918 (input_overwrite_node, input_node, input_edge, input_cgraph_1,
1919 input_cgraph): Moved from lto-cgraph.c.
1920 (LANG_HOOKS_INPUT_CGRAPH): New.
1921
19222008-10-03 Rafael Espindola <espindola@google.com>
1923
1924 * lto.c (lto_fixup_tree, lto_fixup_state): Fix the FIXME.
1925
19262008-10-03 Rafael Espindola <espindola@google.com>
1927
1928 * lto-symtab.c (lto_symtab_overwrite_decl): Remove. Remove all calls.
1929 (lto_symtab_merge_decl): Update LTO_IDENTIFIER_DECL the reflect the
1930 prevailing definition. Don't mark TREE_NOTHROW differences.
1931 * lto.c (lto_fixup_tree): New.
1932 (lto_fixup_state): New.
1933 (lto_fixup_state_aux): New.
1934 (free_decl): New.
1935 (lto_fixup_decls): New.
1936 (lto_main): Call lto_fixup_decls.
1937
19382008-10-02 Ollie Wild <aaw@google.com>
1939
1940 * lang.opt (fltrans): Moved from common.opt. Remove RejectNegative
1941 and Init.
1942 (fwpa): Moved from common.opt. Remove RejectNegative and Init.
1943 * lto-lang.c (lto_post_options): Add validation and fixups for
1944 -fltrans and -fwpa.
1945
19462008-10-02 Rafael Espindola <espindola@google.com>
1947
1948 * lto-symtab.c (lto_symtab_merge_var, lto_symtab_merge_fn,
1949 lto_symtab_merge_decl): Return void.
1950 (lto_symtab_prevailing_decl): New.
1951
19522008-09-30 Rafael Espindola <espindola@google.com>
1953
1954 * lto-symtab.c (lto_symtab_compatible): Remove the check for already
1955 defined symbols.
1956 (lto_symtab_overwrite_decl): Copy LTO_DECL_RESOLUTION.
1957 (lto_symtab_merge_decl): Store symbol resolution in LTO_DECL_RESOLUTION.
1958 Check for already defined symbols.
1959 * lto-tree.h (lang_decl): Remove dummy and add resolution fields.
1960 (LTO_IDENTIFIER_RESOLUTION): Remove.
1961 (LTO_DECL_RESOLUTION): New.
1962
19632008-09-30 Rafael Espindola <espindola@google.com>
1964
1965 * lto.c (lto_read_decls): Use new input_tree signature.
1966
19672008-09-26 Doug Kwan <dougkwan@google.com>
1968
1969 * lto.c (lto_main): Call lto_fixup_nothrow_decls to fix up function
1970 bodies affected by exception attribute merging of DECLs.
1971 * lto-symtab.c (lto_symtab_merge_decl): Handle exception attribute
1972 merging.
1973
19742008-09-25 Rafael Espindola <espindola@google.com>
1975
1976 * Make-lang.in (PLUGIN_API_H, LTO_TREE_H): New.
1977 (lto/lto-lang.o, lto/lto.o, lto/lto-symtab.o) Use LTO_TREE_H.
1978 * lto-symtab.c (lto_symtab_compatible): New.
1979 (lto_symtab_overwrite_decl): New.
1980 (lto_symtab_merge_decl): Refactor to use the above functions
1981 and the resolution from lang_identifier.
1982 * lto-tree.h: Include plugin-api.h.
1983 (lang_identifier): Add resolution.
1984 (LTO_IDENTIFIER_RESOLUTION): New.
1985
19862008-09-25 Ollie Wild <aaw@google.com>
1987
1988 * lang.opt (fltrans-output-list=): New option.
1989 * lto.c (lto_execute_ltrans): Output file names to ltrans_output_list.
1990
19912008-09-25 Rafael Espindola <espindola@google.com>
1992
1993 * lto.c (lto_resolution_read): Initialize ret;
1994
19952008-09-24 Ollie Wild <aaw@google.com>
1996
1997 * lto.c (sys/mman.h): Move include.
1998 (lto_wpa_write_files): Return a list of written files.
1999 (lto_execute_ltrans): New function.
2000 (lto_main): Call lto_execute_ltrans.
2001 (ltrans-driver): New file.
2002 * lto-lang.c (DEFAULT_LTRANS_DRIVER): New macro.
2003 (DEAULT_LTRANS_DRIVER_LEN): New macro.
2004 (lto_init_options): Initialize ltrans_driver.
2005 (lto_handle_option): Fix incorrect default output value.
2006 * lang.opt (fltrans-driver=): New option.
2007 * Make-lang.in (LTRANS_DRIVER_INSTALL_NAME): New variable.
2008 (lto.install-common): Add lto/ltrans-driver.
2009
20102008-09-24 Rafael Espindola <espindola@google.com>
2011
2012 * Make-lang.in (LTO_OBJS): Add lto/common.o.
2013 (lto/lto.o): Depend on lto/common.h.
2014 (lto/common.o): New.
2015 * lang.opt (resolution): New.
2016 * lto-lang.c (resolution_file_name): New.
2017 (lto_handle_option): Handle OPT_resolution.
2018 * lto-symtab.c (lto_symtab_merge_decl): Add a resolution argument.
2019 (lto_symtab_merge_var,lto_symtab_merge_fn): Add a resolution argument.
2020 pass it to lto_symtab_merge_decl.
2021 * lto.c: Include common.h.
2022 (lto_read_decls): Add resolutions and resolutions_size arguments.
2023 Initialize data_in.globals_resolution and
2024 data_in.globals_resolution_size.
2025 (index_and_symbol_resolution): New.
2026 (lto_resolution_read): New.
2027 (lto_file_read): Add argument resolution_file.
2028 Read resolution.
2029 * lto.h (resolution_file_name): New.
2030
20312008-09-23 Rafael Espindola <espindola@google.com>
2032
2033 * common.c: Update description.
2034 * common.h: Update description.
2035
20362008-09-23 Rafael Espindola <espindola@google.com>
2037
2038 * common.c: Moved from lto-plugin.
2039 * common.h: Moved from lto-plugin.
2040
20412008-09-22 Doug Kwan <dougkwan@google.com>
2042
2043 * lto.c (VEC(bitmap,heap)): Declare.
2044 (lto_materialize_function): Handle WAP mode specially.
2045 (lto_add_inline_clones): New.
2046 (lto_add_all_inlinees): Changle algorithm and to use bitmaps. Also
2047 return a bitmap of inlined decls.
2048 (lto_wpa_write_files): Handle all DECLs brought in by inlining.
2049 (lto_main): Call reset_inline_failed to reset inlining states.
2050 Check call-graph after WPA inlining.
2051 * lto-lang.c (lto_init): Do not clear flag_generate_lto
2052 unconditionally.
2053
20542008-09-19 Doug Kwan <dougkwan@google.com>
2055
2056 lto.c (lto_main): Remove unsued wrapper code.
2057 lang-specs.h (@lto): Use lto1_options instead of cc1_options.
2058
20592008-09-19 Rafael Espindola <espindola@google.com>
2060
2061 * lto-symtab.c: Include lto-tree-in.h.
2062 * lto-tree.h (lto_symtab_merge_var, lto_symtab_merge_fn): Remove.
2063 * lto.h (lto_symtab_merge_var, lto_symtab_merge_fn): Remove
2064 * Make-lang.in (lto/lto-symtab.o): Add lto-tree-in.h.
2065
20662008-09-17 Paolo Bonzini <bonzini@gnu.org>
2067 Rafael Avila de Espindola <espindola@google.com>
2068
2069 * lto-lang.c (COMPOUND_LITERAL_EXPR_DECL_STMT,
2070 COMPOUND_LITERAL_EXPR_DECL): Remove.
2071 (emit_local_var): Remove.
2072 (lto_expand_expr): Remove.
2073 (lto_staticp): Remove.
2074 (LANG_HOOKS_EXPAND_EXPR): Remove.
2075 (LANG_HOOKS_STATICP): Remove.
2076
20772008-09-11 Diego Novillo <dnovillo@google.com>
2078
2079 * lto-lang.c: Include except.h and libfuncs.h.
2080 (lto_init_eh): New.
2081 (lto_init): Call it.
2082 Set flag_generate_lto to 0.
2083 * Make-lang.in (lto-lang.o): Add dependency on except.h
2084 and libfuncs.h.
2085
20862008-09-09 Bill Maddox <maddox@google.com>
2087
2088 * lto-lang.c: Include header file expr.h.
2089 (COMPOUND_LITERAL_EXPR_DECL_STMT,
2090 COMPOUND_LITERAL_EXPR_DECL): Copied from c-common.h.
2091 (emit_local_var): Copied from c-semantics.c.
2092 (lto_expand_expr, lto_staticp): Copied from c_expand_expr
2093 and c_staticp in c-common.c.
2094 (LANG_HOOKS_EXPAND_EXPR,LANG_HOOKS_STATICP): Redefined.
2095
20962008-09-08 Diego Novillo <dnovillo@google.com>
2097
2098 * lto-lang.c (lto_global_bindings_p): Return 1 during
2099 IPA passes.
2100
21012008-09-07 Diego Novillo <dnovillo@google.com>
2102
2103 * lto.c: Tidy formatting.
2104
21052008-08-04 Bill Maddox <maddox@google.com>
2106
2107 * lto-symtab.c (lto_symtab_merge_decl): Add comment.
2108
21092008-09-03 Doug Kwan <dougkwan@google.com>
2110
2111 lto.c (lto_add_all_inlinees): Reset FAILED_REASON of edges to
2112 CIF_OK instead of NULL.
2113
21142008-09-02 Diego Novillo <dnovillo@google.com>
2115 Simon Baldwin <simonb@google.com>
2116
2117 * lto-lang.c (lto_type_for_size): Rewrite. Adapt from
2118 c_common_type_for_size.
2119 (lto_type_for_mode): Remove ATTRIBUTE_UNUSED markers.
2120 (lto_init): Call linemap_add.
2121 (signed_and_unsigned_types): Remove.
2122
21232008-08-29 Diego Novillo <dnovillo@google.com>
2124
2125 * lto-lang.c (handle_noreturn_attribute): New local function.
2126 (handle_const_attribute): New local function.
2127 (handle_malloc_attribute): New local function.
2128 (handle_pure_attribute): New local function.
2129 (handle_novops_attribute): New local function.
2130 (handle_nonnull_attribute): New local function.
2131 (handle_nothrow_attribute): New local function.
2132 (handle_sentinel_attribute): New local function.
2133 (handle_type_generic_attribute): New local function.
2134 (handle_format_attribute): New local function.
2135 (handle_format_arg_attribute): New local function.
2136 (lto_attribute_table): Declare.
2137 (lto_format_attribute_table): Declare.
2138 (lto_init_attributes): New local function.
2139 (lto_define_builtins): Call it.
2140 Call targetm.init_builtins and build_common_builtin_nodes.
2141 (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Define.
2142 (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Define.
2143
21442008-08-28 Diego Novillo <dnovillo@google.com>
2145
2146 * Make-lang.in (lto-lang.o): Replace tree-gimple.h with
2147 $(GIMPLE_H).
2148 (lto-symtab.o): Add dependency on $(GIMPLE_H).
2149 * lto-lang.c: Include gimple.h instead of tree-gimple.h.
2150 * lto-symtab.c: Include gimple.h.
2151 * lto-tree.h (chain_next): Replace GENERIC_NEXT with
2152 TREE_CHAIN.
2153
21542008-08-27 Doug Kwan <dougkwan@google.com>
2155
2156 * lto.c (vec.h, bitmap.h, pointer-set.h, ipa-prop.h, ggc.h,
2157 gt-lto-lto.h): New includes.
2158 (lto_materialize_function): Do not read in function body in WPA mode.
2159 Format a line to fit in 80 columns.
2160 (lto_cgraph_node_sets): New garbage collected variable.
2161 (lto_1_to_1_map, lto_add_all_inlinees, lto_wpa_write_files):
2162 New functions.
2163 (lto_main): Initialize bitmap obstack. Add code to handle WPA mode.
2164 * Make-lang.in (LTO_H): Replace filename lto-section-in.h with
2165 variable LTO_SECTION_IN_H.
2166 (lto/lto.o): Include gt-lto-lto-c.h ggc.h ,VEC_H, BITMAP_H,
2167 pointer-set.h and IPA_PROP_H. Also replace filename lto-section-in.h
2168 with variable LTO_SECTION_IN_H.
2169 * config-lang.in (gtfiles): Add lto/lto.c.
2170 * lto-symtab.c (lto_symtab_merge_decl): Set DECL_CONTEXT of
2171 merged DECL_RESULT correctly.
2172
21732008-08-26 Bill Maddox <maddox@google.com>
2174
2175 * lto-lang.c Include tree-gimple.h.
2176 (lto_mark_addressable): Call mark_addressable rather than
2177 asserting.
2178 (lto_post_options): Suppress debug info generation.
2179 * Make-lang.in: Add dependency of lto-lang.o on tree-gimple.h.
2180
21812008-08-25 Bill Maddox <maddox@google.com>
2182
2183 * lto-symtab.c (lto_symtab_merge_decl): Remove a suspect
2184 assertion and leave an explanatory comment in its place.
2185
21862008-08-21 Doug Kwan <dougkwan@google.com>
2187
2188 * lto.c (preload_common_nodes): Call lto_get_common_nodes to get a list
2189 of common nodes instead of computing locallly.
2190 (lto_read_in_decl_state): New.
2191 (lto_read_decls): Change code for udpate in struct lto_decl_header.
2192 Read global and per-function in-decl states.
2193 * Make-lang.in (LTO_H): Update dependency.
2194 (lto/lto.o): Same.
2195 (lto-symtab.c): Merge (revision 139039)
2196 * lto-symtab.c (lto_symtab_merge_decl): Merge DECL_RESULT.
2197
21982008-08-21 Rafael Espindola <espindola@google.com>
2199
2200 * config-lang.in (target_libs): New.
2201
22022008-08-20 Bill Maddox <maddox@google.com>
2203
2204 * lto.c (current_lto_file): Remove GTY marker from static
2205 variable. Remove include of file gt-lto-lto.h.
2206 * Make-lang.in: Remove dependency of lto/lto.o on
2207 gt-lto-lto.h.
2208 * lto-elf.c (lto_file_close): Removed.
2209 (lto_elf_file_open): Use XCNEW instead of GGC_CNEW to
2210 allocate lto_elf_file object.
2211 (lto_elf_file_close): Free lto_elf_file object after close.
2212 * lto.h (struct lto_file_struct): Remove GTY marker.
2213 * config-lang.in: Remove lto/lto.h and lto/lto.c from
2214 gtfiles.
2215
22162008-08-20 Bill Maddox <maddox@google.com>
2217
2218 * lto.c (lto_read_decls): Provide dummy argument to input_tree
2219 to conform to its new signature.
2220 * lto-symtab.c (lto_symtab_merge_decl): Do not invoke ggc_free
2221 on discarded node here, now called in global_vector_fixup.
2222
22232008-08-09 Bill Maddox <maddox@google.com>
2224
2225 * lto.c (preload_common_nodes): Verify that fileptr_type_node
2226 has not been set to a front-end-specific value.
2227
22282008-08-05 Doug Kwan <dougkwan@google.com>
2229
2230 * Make-lang.in (lto-symtab.o): Add missing dependencies to fix
2231 build breakage.
2232
22332008-07-30 Bill Maddox <maddox@google.com>
2234
2235 * lto.c (lto_materialize_function): Call lto_original_decl_name.
2236 Remove obsolete comments.
2237 (lto_read_decls): Remove initialization of deleted field data_in.global.
2238 Tidy up comments.
2239 (lto_main): Remove redundant initialization of section_hash_table.
2240 * lto-elf.c: Removed obsolete comments.
2241 * lto.h: Tidy up comments.
2242 * lto-symtab.c (lto_least_common_multiple): New function.
2243 (lto_symtab_merge_decl): Merge variable alignments in some cases.
2244 Tidy up comments.
2245
22462008-07-25 Diego Novillo <dnovillo@google.com>
2247 Bill Maddox <maddox@google.com>
2248
2249 * lto.c: Re-order include files.
2250 Include lto-section-out.h.
2251 (preload_common_nodes): Add debugging output.
2252 Add new local INDEX_TABLE.
2253 Call preload_common_node.
2254 * Make-lang.in (lto.o): Add dependency on lto-section-out.h
2255
22562008-07-13 Bill Maddox <maddox@google.com>
2257
2258 * lto.c (lto_read_decls): Cast pointer to const char * to avoid
2259 unwanted scaling during pointer addition.
2260
22612008-07-11 Bill Maddox <maddox@google.com>
2262 Diego Novillo <dnovillo@google.com>
2263
2264 * lto.c (lto_read_decls): Fix C++ compatibility warnings.
2265 Make code const-correct.
2266 (lto_file_read): Fix C++ compatibility warnings.
2267 (lto_read_section_data): Fix C++ compatibility warnings.
2268 (lto_get_section_data): Use CONST_CAST to avoid warning when
2269 const pointer passed to free.
2270 * lto-elf.c (lto_elf_build_section_table): Fix C++
2271 compatibility warnings.
2272 (lto_elf_append_data): Fix C++ compatibility warnings. Use CONST_CAST
2273 to avoid warning assigning const pointer to d_buf field of Elf_Data.
2274 (lto_get_current_out_file): Fix C++ compatibility warnings.
2275
22762008-07-11 Diego Novillo <dnovillo@google.com>
2277
2278 * Make-lang.in (lto-warn): Define.
2279
22802008-07-03 Simon Baldwin <simonb@google.com>
2281
2282 * lto.c (lto_read_decls): Wrapped debug-only data items within #ifdef
2283 LTO_STREAM_DEBUGGING.
2284
22852008-06-27 Ollie Wild <aaw@google.com>
2286
2287 * lto-elf.c (lto-section-out.h): New include.
2288 (struct lto_elf_file): Remove bits member. Add scn, shstrtab_stream,
2289 and data members.
2290 (cached_file_attrs): New static variable.
2291 (lto_elf_get_shdr, lto_elf_free_shdr): Remove elf_file parameter.
2292 Use cached_file_attrs for checking bits.
2293 (lto_elf_build_section_table): Remove elf_file argument from
2294 lto_elf_get_shdr and lto_elf_free_shdr calls.
2295 (DEFINE_INIT_SHDR): New macro.
2296 (init_shdr32, init_shdr64): New functions defined via the
2297 DEFINE_INIT_SHDR macro.
2298 (lto_elf_begin_section_with_type): New function.
2299 (lto_elf_begin_section): New function.
2300 (lto_elf_append_data): New function.
2301 (lto_elf_end_section): New function.
2302 (DEFINE_VALIDATE_EHDR): New macro.
2303 (validate_ehdr32, validate_ehdr64): New functions defined via the
2304 DEFINE_VALIDATE_EHDR macro.
2305 (validate_file): New function.
2306 (DEFINE_INIT_EHDR): New macro.
2307 (init_ehdr32, init_ehdr64): New functions defined via the
2308 DEFINE_INIT_EHDR macro.
2309 (init_ehdr): New function.
2310 (lto_elf_file_open): Add support for writable files. Move some
2311 validation logic to validate_file.
2312 (lto_elf_file_close): Add support for writable files. Write file data
2313 and free data blocks.
2314 (current_out_file): New static variable.
2315 (lto_set_current_out_file): New function.
2316 (lto_get_current_out_file): New function.
2317 * lto.c (lto_main): Add writable argument to lto_elf_file_open calls.
2318 Add temporary initialization for testing ELF serialization.
2319 * lto.h (lto-section-out.h): New include.
2320 (struct lto_file_struct): Slight modification to comment.
2321 (lto_elf_file_open): Add writable parameter.
2322 (lto_elf_begin_section): New function declaration.
2323 (lto_elf_append_data): New function declaration.
2324 (lto_elf_end_section): New function declaration.
2325 (lto_set_current_out_file, lto_get_current_out_file): New function
2326 declarations.
2327 * lto-lang.c (LANG_HOOKS_BEGIN_SECTION): Set as lto_elf_begin_section.
2328 (LANG_HOOKS_APPEND_DATA): Set as lto_elf_append_data.
2329 (LANG_HOOKS_END_SECTION): Set as lto_elf_end_section.
2330 * Make-lang.in (LTO_H): Add lto-section-out.h.
2331
23322008-06-12 Ollie Wild <aaw@google.com>
2333
2334 * lto.h (struct lto_file_vtable_struct): Remove.
2335 (struct lto_file_struct): Remove vtable member.
2336 * lto-elf.c (lto_file_init): Remove vtable argument.
2337 (lto_elf_map_optional_lto_section): Remove.
2338 (lto_elf_unmap_section): Remove.
2339 (lto_elf_file_vtable): Remove.
2340 (lto_elf_file_open): Remove lto_elf_file_vtable argument from
2341 lto_file_init call.
2342 (lto_elf_find_section_data): Remove.
2343
23442008-06-11 Ollie Wild <aaw@google.com>
2345
2346 * lto.c (lto_file_read): Add const qualifier to data variable.
2347
23482008-06-11 Diego Novillo <dnovillo@google.com>
2349
2350 Merge from lto-streamber sub-branch.
2351
2352 2008-06-04 Ollie Wild <aaw@google.com>
2353
2354 * lto.c: Remove inclusion of dwarf2.h and dwarf2out.h.
2355 * Make-lang.in (lto.o): Remove dependency on dwarf2.h.
2356
2357 2008-05-28 Bill Maddox <maddox@google.com>
2358
2359 Replace the DWARF reader in the LTO front-end.
2360
2361 * lto.c: Include lto-tree-in.h, lto-tags.h.
2362 (enum DWARF2_class, DW_cl_constant, struct
2363 DWARF2_form_data, struct lto_context,
2364 lto_fd_init, lto_info_fd_init,
2365 lto_abbrev_fd_init, lto_info_fd_close,
2366 lto_file_init, lto_file_close,
2367 lto_file_corrupt_error, lto_abi_mismatch_error,
2368 LTO_CHECK_INT_VAL, LTO_READ_TYPE,
2369 lto_read_uleb128, lto_read_sleb128,
2370 lto_read_initial_length, lto_abbrev_read_attrs,
2371 lto_abbrev_read, lto_abbrev_read_lookup,
2372 lto_read_section_offset,
2373 lto_read_comp_unit_header, find_cu_for_offset,
2374 lto_get_file_name,
2375 lto_resolve_reference,lto_read_form,
2376 attribute_value_as_int,
2377 make_signed_host_wide_int,
2378 attribute_value_as_constant, lto_cache_hash,
2379 lto_cache_eq, lto_cache_store_DIE,
2380 lto_cache_lookup_DIE, lto_find_integral_type,
2381 lto_find_integral_type_1,
2382 LTO_BEGIN_READ_ATTRS_UNCHECKED,
2383 LTO_BEGIN_READ_ATTRS, LTO_END_READ_ATTRS,
2384 lto_unsupported_attr_error, lto_get_identifier,
2385 lto_read_referenced_type_DIE,
2386 lto_read_compile_unit_DIE,
2387 lto_read_array_type_DIE,
2388 lto_read_structure_union_class_type_DIE,
2389 lto_read_enumerator_DIE,
2390 lto_read_enumeration_type_DIE,
2391 lto_read_only_for_child_DIEs,
2392 lto_read_only_for_child_DIEs,
2393 lto_read_member_DIE, lto_read_abbrev,
2394 lto_read_variable_formal_parameter_constant_DIE,
2395 lto_get_body): Removed.
2396 (preload_common_nodes): New function.
2397 (lto_read_decls): Convert for new global streamer.
2398 (lto_materialze_file_data,
2399 lto_read_subroutine_type_subprogram_die,
2400 lto_read_unspecified_parameters_DIE,
2401 lto_read_typedef_DIE,
2402 lto_read_pointer_reference_type_DIE,
2403 lto_read_subrange_type_DIE,
2404 lto_read_base_type_DIE,
2405 lto_read_const_volatile_restrict_type_DIE,
2406 lto_read_namespace_DIE,
2407 lto_read_unspecified_type_DIE, lto_read_DIE,
2408 lto_read_child_DIEs, lto_collect_child_DIEs):
2409 Removed.
2410 (lto_info_read, lto_set_cu_context): Removed.
2411 (lto_file_read): Convert for new global streamer.
2412 (lto_resolve_type_ref, lto_read_DIE_at_ptr,
2413 lto_resolve_var_ref, lto_resolve_fn_ref,
2414 lto_resolve_field_ref, lto_resolve_typedecl_ref,
2415 lto_resolve_namespacedecl_ref): Removed.
2416 (lto_file_init, lto_file_close): Moved to lto-elf.c.
2417 * lto-tree.h (lto_symtab_merge_var,
2418 lto_symtab_mergee_fun): Declare here.
2419 * lto-elf.c (lto_file_init, lto_file_close): Moved from lto.c.
2420 (lto_elf_file_open): Removed code to read DWARF debug sections.
2421 * lto.h (lto_context, DWARF2_attr, DWARF2_abbrev,
2422 DWARF2_CompUnit, lto_die_ptr,
2423 lto_die_cache_entry, lto_fd, lto_info_fd,
2424 lto_abbrev_fd): Removed.
2425 (lto_file): Removed debug_info and debug_abbrev fields.
2426 (lto_ref): Removed.
2427 (lto_file_init, lto_file_close,
2428 lto_resolve_type_ref, lto_resolve_var_ref,
2429 lto_resolve_fn_ref, lto_resolve_field_ref,
2430 lto_resolve_typedecl_ref,
2431 lto_resolve_namespacedecl_ref,
2432 lto_get_file_name): Removed declarations.
2433 (lto_symtab_merge_var, lto_symtab_merge_fn):
2434 Declarations moved to lto-tree.h.
2435 * lto-symtab.c (lto_compatible_attributes_p):
2436 Lobotomize this, as it barfs on "Hello, world!".
2437 * lto-section-out.c: Include lto-tree-out.h.
2438 (lto_hash_global_slot_node,
2439 lto_eq_global_slot_node, preload_common_nodes,
2440 write_global_stream, write_global_references):
2441 New functions.
2442 (produce_asm_for_decls): Convert for new global streamer.
2443 * lto-section-out.h (lto_hash_global_slot_node,
2444 lto_eq_global_slot_node): Declare.
2445
24462008-06-07 Kenneth Zadeck <zadeck@naturalbridge.com>
2447 Jan Hubicka <jh@suse.cz>
2448
2449 * lto.c (sys/mman.h, tree-pass.h): New includes.
2450 (lto_materialize_constructors_and_inits,
2451 lto_materialize_function): Keeps length of section.
2452 (lto_materialize_cgraph): Removed.
2453 (lto_read_decls): Initialize fd field.
2454 (lto_file_read): Different return type and removed much code to
2455 lto_main.
2456 (page_mask): New variable.
2457 (lto_read_section_data, get_section_data, free_section_data): New
2458 functions.
2459 (lto_main): Now calls pass manager, sets the hooks so that the ipa
2460 passes can get the section data.
2461
24622008-05-27 Kenneth Zadeck <zadeck@naturalbridge.com>
2463
2464 * lto.h (lto_read_decls): Made local.
2465 (lto_input_function_body, lto_input_constructors_and_inits,
2466 lto_input_cgraph): Declarations moved to lto-section-in.h.
2467 * lto-section-in.c: Moved to .. .
2468 * lto-cgraph-in.c: Ditto.
2469 * lto-section-in.h: Ditto.
2470 * lto-function-in.c: Ditto.
2471 * lto-lang.c (lto_handle_option): Added ATTRIBUTE_UNUSED to parms.
2472 (lto_insert_block): Removed.
2473 (LANG_HOOKS_INSERT_BLOCK): Removed.
2474 * Make-lang.in (lto-cgraph-in.o, lto-function-in.o,
2475 lto-section-in.o): Rules moved to lto/Makefile.in.
2476
2477
24782008-05-16 Ollie Wild <aaw@google.com>
2479
2480 * lto-lang.c (tree-inline.h): Include.
2481 (lto_post_options): New function.
2482 (LANG_HOOKS_POST_OPTIONS): Define.
2483 * lto-cgraph-in.c (overwrite_node): Set node->global.insns.
2484 * lto-function-in.c (input_bb): Set TREE_BLOCK (stmt).
2485
24862008-05-13 Diego Novillo <dnovillo@google.com>
2487
2488 * lto-function-in.c (input_ssa_names): Call
2489 make_ssa_name_fn instead of make_ssa_name.
2490
24912008-05-12 Diego Novillo <dnovillo@google.com>
2492
2493 * lto-cgraph-in.c (overwrite_node): Update references to
2494 inline summary fields.
2495 * lto-function-in.c (input_expr_operand): Do not handle
2496 STRUCT_FIELD_TAG.
2497
24982008-05-09 Ollie Wild <aaw@google.com>
2499
2500 * lang.opt: New file.
2501 * lto-lang.c (lto_init_options): New function.
2502 (lto_handle_option): New function.
2503 (lto_init): Move initialization of flag_unit_at_a_time to
2504 lto_init_options.
2505 (LANG_HOOKS_INIT_OPTIONS): Define.
2506 (LANG_HOOKS_HANDLE_OPTION): Define.
2507
25082008-04-29 Ollie Wild <aaw@google.com>
2509
2510 * lto.c (lto_read_namespace_DIE): New function.
2511 (lto_read_DIE): Add lto_read_namespace_DIE callback. Cache
2512 NAMESPACE_DECL DIE's.
2513 (lto_resolve_namespacedecl_ref): New function.
2514 * lto.h (lto_resolve_namespacedecl_ref): New function.
2515 * lto-section-in.c (lto_read_decls): Read namespace declarations.
2516 * lto-section-in.h (struct lto_file_decl_data): Add namespace_decls
2517 and num_namespace_decls.
2518 * lto-function-in.c (input_expr_operand): Add NAMESPACE_DECL case.
2519 * lto-lang.c (lto_init_ts): New function.
2520 (LANG_HOOKS_INIT_TS): Set as lto_init_ts.
2521
25222008-04-16 Ollie Wild <aaw@google.com>
2523
2524 * lto-function-in.c (input_type_ref): Updated function description.
2525
25262008-04-16 Ollie Wild <aaw@google.com>
2527
2528 * lto-function-in.c (input_type_ref_1): New function.
2529 (input_type_ref): Split into two functions.
2530 (input_function): Add support for type contexts.
2531
25322008-04-16 Ollie Wild <aaw@google.com>
2533
2534 * lto.c (lto_materialize_function): Use DECL_ASSEMBLER_NAME to compute
2535 section name
2536
25372008-04-16 Ollie Wild <aaw@google.com>
2538
2539 * lto.c (lto_read_compile_unit_DIE): Add DW_LANG_C_plus_plus to the
2540 list of supported languages.
2541
25422008-03-25 Kenneth Zadeck <zadeck@naturalbridge.com>
2543
2544 Merge with mainline @133491.
2545
25462008-03-05 Kenneth Zadeck <zadeck@naturalbridge.com>
2547 Jan Hubicka <jh@suse.cz>
2548
2549 * lto.c (lto_info_fd_init, lto_info_fd_close): Get rid of
2550 fd->unmaterialized_fndecls.
2551 (lto_get_file_name, lto_materialize_cgraph): New function.
2552 (lto_materialize_constructors_and_inits,
2553 lto_materialize_function): Read info directly from elf file.
2554 (lto_file_read): Made local and initialize dictionary so that
2555 other lto sections can be read without reprocessing the elf file.
2556 (lto_main): Read all functions after all files have been processed
2557 for their types, globals and cgraph.
2558 * Make-lang.in (lto.o, lto-cgraph-in.c, lto-section-in): Changed
2559 dependencies.
2560 * lto-elf.c (lto_elf_file): Removed strtab, symtab fields.
2561 (hash_name, eq_name, lto_elf_build_section_table): New functions.
2562 (lto_elf_read_symtab): Removed function.
2563 (lto_elf_file_open): Removed call to lto_elf_read_symtab.
2564 * lto.h (lto_info_fd_struct): Removed unmaterialized_fndecls.
2565 (lto_file_read): Made local.
2566 (lto_get_file_name, lto_elf_build_section_table,
2567 lto_input_cgraph):
2568 New function.
2569 * lto-section-in.c (lto_read_section_data, lto_get_section_data):
2570 New functions.
2571 (lto_read_decls): Get the file name.
2572 * lto-cgraph-in.c: New file.
2573 * lto-function-in.c (tag_to_expr): Stops at LTO_tree_last_tag.
2574 (input_expr_operand, lto_read_body): Set lto_debug_context.tag_names.
2575 (input_labels): Fixed latent sizeof issue.
2576 (input_function): Build stmt array to set call sites into cgraph
2577 edges.
2578 (lto_read_body): Reset cfun->curr_properties.
2579 * lto_section_in.h (lto_section_slot): New structure.
2580 (section_hash_table.lto_file_decl_data): New field.
2581
2582
25832008-02-09 Kenneth Zadeck <zadeck@naturalbridge.com>
2584
2585 * lto.c (lto_read_variable_formal_parameter_const): Remove code to
2586 reconstruct static initializers.
2587 (lto_get_body, lto_materialize_function): Add lto_section_type as
2588 a parameter.
2589 (lto_materialize_constructors_and_inits,
2590 lto_materialize_file_data): New function.
2591 (lto_materialize_function,
2592 lto_read_subroutine_type_subprogram_DIE): Renamed unmap_fn_body to
2593 unmap_section and map_fn_body to map_section.
2594 (lto_set_cu_context): Process functions and static inits
2595 differently.
2596 * Make-lang.in (LTO_H, lto/lto-function-in.o,
2597 lto/lto-section-in.o): Update dependencies.
2598 * lto/lto-elf.c (lto_elf_map_optional_lto_section): Add
2599 lto_section_type parameter.
2600 (lto_elf_unmap_fn_body): Renamed to lto_elf_unmap_section.
2601 * lto.h (lto_file_vtable_struct): Removed two of the fields and
2602 renamed the other two so that there is only one map function and
2603 one unmap function and each takes a section type parameter.
2604 (lto_read_function_body): Renamed to lto_input_function_body and
2605 added file_data parameter.
2606 (lto_read_var_init): Removed.
2607 (lto_input_constructors_and_inits): New function.
2608 * lto-section-in.c (lto_read_decls): New function.
2609 * lto-function-in.c (data_in): Moved fields field_decls, fn_decls,
2610 var_decls, type_decls, types to lto_file_decl_data.
2611 (input_type_ref, input_expr_operand, lto_read_body): Get
2612 field_decls, fn_decls, var_decls, type_decls, types from different
2613 structure.
2614 (input_globals, input_constructor, lto_read_var_init): Removed.
2615 (input_constructors_or_inits): New function.
2616 (lto_read_function_body, lto_input_constructors_and_inits):
2617 Renamed to lto_input_function_body and takes file_data parameter.
2618 * lto-section-in.h (lto_file_decl_data): New structure.
2619
26202008-01-28 Kenneth Zadeck <zadeck@naturalbridge.com>
2621
2622 * lto-function-in.c (input_globals.c): Changed input type to
2623 lto_function_header.
2624 (input_bb): Removed code to deserialize the stmt number.
2625 (input_function): Renumber all stmts after they are input.
2626 (lto_read_body, lto_read_function_body, lto_read_var_init):
2627 Changed to used new header format and enum section_type.
2628 *lto-lang.c (success): Removed.
2629
26302008-01-28 Nathan Froyd <froydnj@codesourcery.com>
2631
2632 * lto-elf.c (lto_elf_lookup_sym): Remove unused function.
2633 (lto_elf_free_sym): Likewise.
2634
2635 * lto-elf.c (lto_elf_read_var_init): Remove unused function.
2636 (lto_elf_build_init): Likewise.
2637
26382008-01-14 Kenneth Zadeck <zadeck@naturalbridge.com>
2639
2640 * lto-read.c: Renamed to lto-function-in.c.
2641 (input_1_unsigned): Moved to lto-section-in.c and renamed
2642 lto_input_1_unsigned.
2643 (input_uleb128): Moved to lto-section-in.c and renamed
2644 lto_input_uleb128.
2645 (input_widest_uint_uleb128): Moved to lto-section-in.c and renamed
2646 lto_input_widest_uint_uleb128.
2647 (input_sleb128): Moved to lto-section-in.c and renamed
2648 lto_input_sleb128.
2649 (input_integer): Moved to lto-section-in.c and renamed
2650 lto_input_integer.
2651 (debug_in_fun): Moved to lto-section-in.c and renamed
2652 lto_debug_in_fun.
2653 (input_block): Moved to lto-section-in.h and renamed
2654 lto_input_block.
2655 (input_expr_operand): Fixed to allow lists with more than one
2656 element.
2657 * lto-section-in.h: New file.
2658 * lto-section-in.c: New file with changes from above.
2659 * Make-lang.in (lto-read.o): Renamed lto-function-in.c.
2660 (lto-section-in.o): New rule.
2661
26622007-12-29 Nathan Froyd <froydnj@codesourcery.com>
2663
2664 * lto-read.c (input_expr_operand): Mark static and external
2665 VAR_DECLs as needed.
2666
26672007-12-29 Nathan Froyd <froydnj@codesourcery.com>
2668
2669 * lto-read.c (input_integer): Use the correct shift amount.
2670
26712007-12-29 Nathan Froyd <froydnj@codesourcery.com>
2672
2673 * lto-lang.c (lto_pushdecl): Do nothing instead of aborting.
2674 (LANG_HOOKS_NAME): Define.
2675
26762007-12-27 Nathan Froyd <froydnj@codesourcery.com>
2677
2678 * lto.c (lto_find_integral_type): Define as a macro. Rename the
2679 original function to...
2680 (lto_find_integral_type_1): ...this. Consult UNSIGNEDP if we
2681 don't have a base type.
2682 (lto_read_enumeration_type_DIE): Examine the values of the
2683 enumeration to determine whether we can use an unsigned type for
2684 the base type of the enumeration.
2685
26862007-12-24 Nathan Froyd <froydnj@codesourcery.com>
2687
2688 * lto.c (lto_read_structure_union_class_type_DIE): Set TYPE_MODE
2689 and TYPE_ALIGN on UNION_TYPEs as soon as possible.
2690
26912007-12-22 Nathan Froyd <froydnj@codesourcery.com>
2692
2693 * lto-lang.c (lto_types_compatible_p): New function.
2694 (LANG_HOOKS_TYPES_COMPATIBLE_P): Define.
2695
26962007-12-22 Nathan Froyd <froydnj@codesourcery.com>
2697 Kenneth Zadeck <zadeck@naturalbridge.com>
2698
2699 * lto-read.c (input_expr_operand): Fixed uninitialize var warning.
2700 (input_local_vars): Read in DECL_INITIAL and context for local
2701 statics that need to be put in unexpanded_vars_list.
2702
27032007-12-21 Nathan Froyd <froydnj@codesourcery.com>
2704
2705 * lto-read.c (input_real): Use a separate null-terminated buffer
2706 for calling real_from_string.
2707 (input_expr_operand): If we take the address of a FUNCTION_DECL,
2708 tell cgraph that it's needed.
2709
27102007-12-19 Doug Kwan <dougkwan@google.com>
2711
2712 * lto.c (lto_read_base_type_DIE): Handle complex integer types.
2713
27142007-12-18 Nathan Froyd <froydnj@codesourcery.com>
2715
2716 * lto.c (lto_read_DIE): Call lto_read_only_for_child_DIEs instead.
2717 (lto_file_read): Reset the members of 'context' every time we read
2718 a toplevel DIE, with special attention to last_param_type.
2719
27202007-12-18 Nathan Froyd <froydnj@codesourcery.com>
2721
2722 * lto.c (lto_read_subroutine_type_subprogram_DIE): Initialize
2723 'declaration'. Set the assembler name for non-public functions.
2724
27252007-12-17 Kenneth Zadeck <zadeck@naturalbridge.com>
2726
2727 * lto_read.c (data_in.unexpanded_indexes): New array.
2728 (input_local_var): Added code to read in unexpanded_var_list
2729 indexes for variables. Only read in DECL_CHAIN field for
2730 parameters.
2731 (input_local_vars): Added code to rebuild unexpanded_var_list in
2732 order using unexpanded_indexes.
2733 (input_function): Added code to set DECL_CONTEXT for functions.
2734
27352007-12-13 Doug Kwan <dougkwan@google.com>
2736
2737 * lto.c (lto_read_pointer_reference_type_DIE): Handle optional name
2738 in pointer and reference types.
2739
27402007-12-13 Nathan Froyd <froydnj@codesourcery.com>
2741
2742 * lto-read.c (input_expr_operand): Use DECL_RESULT when reading a
2743 RESULT_DECL.
2744
27452007-12-13 Nathan Froyd <froydnj@codesourcery.com>
2746
2747 * lto.c (lto_read_array_type_DIE): Return the cached DIE if we've
2748 already read the DIE.
2749 (lto_get_body): New function, split out from...
2750 (lto_materialize_function): ...here. Call it.
2751 (lto_read_subroutine_type_subprogram_DIE): Call lto_get_body to
2752 determine DECL_EXTERNAL.
2753 * lto-symtab.c (lto_symtab_merge_decl): Merge the DECL_RESULTs of
2754 FUNCTION_DECLs when necessary. Use the type of the actual
2755 function definition if we are unable to easily merge types. Ignore
2756 spurious DECL_MODE mismatches on VAR_DECLs. Merge DECL_MODEs when
2757 necessary.
2758
27592007-12-13 Nathan Froyd <froydnj@codesourcery.com>
2760
2761 * lto-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define.
2762
27632007-12-12 Bill Maddox <maddox@google.com>
2764
2765 Revert
2766 2007-12-07 Bill Maddox <maddox@google.com>
2767
2768 * lto.c (lto_str_fd_init): New function.
2769 (lto_str_fd_close): New function.
2770 (lto_file_init): Call lto_str_fd_init.
2771 (lto_file_close): Call lto_str_fd_close.
2772 (lto_str_read): New function. Read debug string table.
2773 (lto_str_lookup): New function. Get string for debug
2774 string table offset.
2775 (lto_read_form): Recognize DW_FORM_strp.
2776 (lto_file_read): Invoke lto_str_read.
2777
2778 * lto-elf.c (lto_elf_file_open): Read raw section data
2779 for the .debug_str section, if present.
2780
2781 * lto.h (struct lto_str_fd_struct): New struct.
2782 (struct lto_file_struct): Added new field DEBUG_STR
2783 to hold the file descriptor for the debug string table.
2784
27852007-12-07 Bill Maddox <maddox@google.com>
2786
2787 * lto.c (lto_str_fd_init): New function.
2788 (lto_str_fd_close): New function.
2789 (lto_file_init): Call lto_str_fd_init.
2790 (lto_file_close): Call lto_str_fd_close.
2791 (lto_str_read): New function. Read debug string table.
2792 (lto_str_lookup): New function. Get string for debug
2793 string table offset.
2794 (lto_read_form): Recognize DW_FORM_strp.
2795 (lto_file_read): Invoke lto_str_read.
2796
2797 * lto-elf.c (lto_elf_file_open): Read raw section data
2798 for the .debug_str section, if present.
2799
2800 * lto.h (struct lto_str_fd_struct): New struct.
2801 (struct lto_file_struct): Added new field DEBUG_STR
2802 to hold the file descriptor for the debug string table.
2803
28042007-12-07 Nathan Froyd <froydnj@codesourcery.com>
2805
2806 * lto-read.c (input_cfg): Call init_empty_tree_cfg_for_function.
2807 Grow the basic_block_info and label_to_block_map vectors if
2808 necessary. Read in the block chain.
2809
28102007-12-06 Nathan Froyd <froydnj@codesourcery.com>
2811
2812 * lto.c (lto_read_DIE): Set TYPE_ALIAS_SET where necessary.
2813
28142007-12-06 Nathan Froyd <froydnj@codesourcery.com>
2815
2816 * lto.c (lto_read_form): Add DW_cl_address for DW_AT_const_value.
2817
28182007-12-06 Nathan Froyd <froydnj@codesourcery.com>
2819
2820 * lto-read.c (input_expr_operand): Don't check for MTAGs.
2821 (lto_read_body): Don't declare PROP_alias.
2822
28232007-12-06 Nathan Froyd <froydnj@codesourcery.com>
2824
2825 * lto-symtab.c (lto_symtab_merge_decl): Handle FUNCTION_DECLs without
2826 argument type information.
2827
28282007-12-03 Nathan Froyd <froydnj@codesourcery.com>
2829
2830 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Set
2831 TREE_THIS_VOLATILE if the associated type is a volatile type.
2832 (lto_materialize_function): Remove call to init_ssa_operands.
2833 * lto-read.c (input_expr_operand): Add SSA_NAME_VAR as a referenced
2834 variable when reading an SSA_NAME. Do the same when reading a
2835 RESULT_DECL, a RETURN_EXPR, or an MTAG.
2836 (input_cfg): Call init_ssa_operands.
2837 (input_ssa_names): Set the default def of an SSA_NAME if necessary.
2838 Move call to init_tree_ssa...
2839 (lto_read_body): ...here. Use push_cfun and pop_cfun. Call
2840 add_referenced_var on any variables referenced from the body of the
2841 function. Inform the rest of the compiler we are in SSA form and
2842 inform later passes about the current properties.
2843
28442007-11-30 Nathan Froyd <froydnj@codesourcery.com>
2845
2846 * lto.c (lto_materialize_function): Add FIXME.
2847
28482007-11-29 Nathan Froyd <froydnj@codesourcery.com>
2849
2850 * lto-lang.c (enum built_in_attribute): New enum.
2851 (flag_no_builtin, flag_no_nonansi_builtin, flag_isoc94, flag_isoc99,
2852 built_in_attributes): New variables.
2853 (def_builtin_1): New function.
2854 (lto_define_builtins): #define DEF_BUILTIN and include builtins.def.
2855
28562007-11-28 Nathan Froyd <froydnj@codesourcery.com>
2857
2858 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Set
2859 DECL_SOURCE_LOCATION for debugging purposes.
2860 (lto_read_member_DIE): Set DECL_SOURCE_LOCATION. If we have read a
2861 bitfield, use the type specified by the DIE for TREE_TYPE and defer
2862 laying out the decl until later.
2863 (lto_read_subroutine_type_subprogram_DIE): Compare the function's
2864 name with DECL_ASSEMBLER_NAME. Set DECL_SOURCE_LOCATION and
2865 TREE_ADDRESSABLE.
2866 * lto-read.c (input_expr_operand): Set TREE_ADDRESSABLE on the
2867 operand of an ADDR_EXPR.
2868 * lto-lang.c (enum lto_builtin_type): New enum.
2869 (builtin_type): New typedef.
2870 (builtin_types, string_type_node, const_string_type_node,
2871 wint_type_node, intmax_type_node, uintmax_type_node,
2872 signed_size_type_node): New variables.
2873 (def_fn_type, builtin_type_for_size, lto_define_builtins,
2874 lto_build_c_type_nodes): New functions.
2875 (lto_init): Initialize builtin types.
2876 (lto_set_decl_assembler_name): Let the target machine mangle the
2877 name if the decl is TREE_PUBLIC, otherwise uniquify it.
2878
28792007-11-21 Nathan Froyd <froydnj@codesourcery.com>
2880
2881 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Don't
2882 set TREE_ADDRESSABLE. Do set DECL_COMDAT. Set TREE_READONLY if
2883 the type is a constant type. Set the assembler name and inform
2884 the rest of the compiler about the new decl if the decl is not
2885 public.
2886 (lto_read_subroutine_type_subprogram_DIE): Don't check for equivalency
2887 of DECL_ASSEMBLER_NAME when determining if we have a builtin. Don't
2888 try to read in function bodies for functions that already have bodies.
2889 * lto-symtab.c (lto_same_type_p): Check for unbounded array
2890 equivalency.
2891 (lto_symtab_merge_decl): Don't merge decls that aren't TREE_PUBLIC.
2892 Check for whether we matched a builtin function type before calling
2893 lto_same_type_p on the generated type. Permit cases where the
2894 declaration of an array is unbounded, but the definition is bounded.
2895 Don't combine TREE_PUBLIC flags. Copy over DECL_SIZE and
2896 DECL_SIZE_UNIT if necessary.
2897
28982007-11-16 Kenneth Zadeck <zadeck@naturalbridge.com>
2899
2900 * lto-read.c (input_expr_operand): Get types right
2901 for COMPLEX_CST.
2902
29032007-11-16 Kenneth Zadeck <zadeck@naturalbridge.com>
2904
2905 * lto-read.c (make_new_block, input_cfg): Properly set
2906 n_basic_blocks.
2907
29082007-11-16 Nathan Froyd <froydnj@codesourcery.com>
2909
2910 * lto.c (lto_read_array_type_DIE): Handle DIEs with DW_AT_GNU_vector
2911 set properly by building a VECTOR_TYPE instead of an ARRAY_TYPE.
2912
29132007-11-16 Nathan Froyd <froydnj@codesourcery.com>
2914
2915 * lto.c (lto_read_base_type_DIE): Use make_bitfield_integer_type to
2916 construct the integer type for bitfields.
2917
29182007-11-16 Kenneth Zadeck <zadeck@naturalbridge.com>
2919
2920 * lto-read.c (data_in.current_node_has_loc): Removed.
2921 (input_line_info): Returns true if node needs line set.
2922 (set_line_info): Always sets line if called.
2923 (clear_line_info): Removed reference to current_node_needs_loc.
2924 (input_expr_operand): Keeps track locally if current node needs a loc.
2925 (input_local_var): Added code to handle DECL_INITIAL for
2926 static local vars. Only set loc if necessary.
2927
29282007-11-15 Nathan Froyd <froydnj@codesourcery.com>
2929
2930 * lto.c (lto_read_subroutine_type_subprogram_DIE): Fix thinko'd
2931 DECL_CONTEXT.
2932
29332007-11-15 Nathan Froyd <froydnj@codesourcery.com>
2934
2935 * lto.c: Include langhooks.h.
2936 (lto_find_integral_type): Rework logic to handle the case where
2937 got_byte_size is true, but the bitsize requested and that of the
2938 base_type doesn't match.
2939 (lto_read_variable_formal_parameter_constant_DIE): Only check for
2940 asm_name if we are creating a VAR_DECL.
2941 (lto_materialize_function): Set DECL_EXTERNAL if we can't find a
2942 definition.
2943 (lto_read_subroutine_type_subprogram_DIE): Check for a builtin
2944 function reference and use the builtin's decl if so. Set the
2945 DECL_CONTEXT of the RESULT_DECL for the function.
2946 * lto-lang.c (registered_builtin_fndecls): New variable.
2947 (lto_getdecls): Return it.
2948 (lto_builtin_function): Chain the new decl onto
2949 registered_builtin_fndecls.
2950
29512007-11-15 Kenneth Zadeck <zadeck@naturalbridge.com>
2952
2953 * lto-read.c (process_tree_flags, lto_static_init_local):
2954 Renamed to ADD_CLASS_EXPR_FLAG. ADD_CLASS_DECL_FLAG New Macro.
2955 (input_line_info, clear_line_info): Fixed new line number code.
2956 (input_expr_operand): Added type to SWITCH_EXPR.
2957 (lto_read_body): Properly initialized data_in.
2958 Clear line info when leaving.
2959
29602007-11-13 Diego Novillo <dnovillo@google.com>
2961
2962 * lto.c (lto_read_variable_formal_parameter_constant_DIE):
2963 Initialize ARTIFICIAL.
2964 (lto_read_subroutine_type_subprogram_DIE): Initialize
2965 SAVED_SCOPE.
2966 * lto-read.c (set_line_info): Remove ; from calls to
2967 LINEMAP_POSITION_FOR_COLUMN.
2968
29692007-11-13 Kenneth Zadeck <zadeck@naturalbridge.com>
2970
2971 * lto-read.c (input_type_ref): Renamed from get_type_ref.
2972 (input_expr_operand, input_local_var): Renamed get_type_ref to
2973 input_type_ref.
2974 (input_expr_operand): Get the types correct for
2975 vector-cst. Get SSA_NAME_DEF_STMT correct for return_exprs.
2976
29772007-11-13 Doug Kwan <dougkwan@google.com>
2978
2979 * lto-read.c (input_widest_uint_uleb128): New function.
2980 (input_tree_flags, process_tree_flags, input_line_info,
2981 input_expr_operand, input_local_var, input_phi, input_ssa_names):
2982 Change to use lto_flags_type and BITS_PER_LTO_FLAGS_TYPES instead of
2983 unsigned HOST_WIDE_INT and HOST_BITS_PER_WIDE_INT.
2984 (lto_static_init_local): Add code to assert that lto_flags_type is
2985 wide enough.
2986
29872007-11-13 Nathan Froyd <froydnj@codesourcery.com>
2988
2989 * lto.c (lto_read_array_type_DIE): Handle DW_AT_GNU_vector.
2990 (lto_read_subroutine_type_subprogram_DIE): Handle
2991 DW_AT_static_link and DW_AT_specification. Return the
2992 specification if present.
2993 (lto_read_base_type_DIE): Handle DW_ATE_complex_float.
2994
29952007-11-13 Nathan Froyd <froydnj@codesourcery.com>
2996
2997 * lto-lang.c: Include target.h.
2998 (registered_builtin_types): New variable.
2999 (lto_type_for_mode): Increase number of modes handled.
3000 (lto_builtin_function): Fix argument list and return the decl.
3001 (lto_register_builtin_type): New function.
3002 (lto_init): Initialize target builtins and language-independent
3003 nodes.
3004 (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define.
3005
30062007-11-13 Kenneth Zadeck <zadeck@naturalbridge.com>
3007
3008 * lto-read.c (input_expr_operand): Added code to properly handle
3009 index filed. Added new RANGE_EXPR case.
3010
30112007-11-11 Kenneth Zadeck <zadeck@naturalbridge.com>
3012
3013 * lto-read.c (ADD_FUNC_FLAG): Deleted macro.
3014 (data_in): Added current_node_has_loc field.
3015 (input_line_info, set_line_info, clear_line_info): Added a support
3016 for USE_MAPPED_LOCATION and not adding line numbers to nodes that
3017 did not have on on the source side.
3018 (input_expr_operand): Make sure that GIMPLE_MODIFY_STMTS get line
3019 numbers too.
3020
30212007-11-09 Doug Kwan <dougkwan@google.com>
3022
3023 * lto-read.c (input_expr_operand): Change type of operand 2 of
3024 BIT_FIELD_REF expression to be bitsizetype instead of sizetype.
3025
30262007-11-09 Nathan Froyd <froydnj@codesourcery.com>
3027
3028 * lto.c: Include lto-tree.h. Effect small spaces->tabs cleanup.
3029 (lto_read_variable_formal_parameter_constant_DIE): Transfer bits
3030 from a DW_AT_specification or DW_AT_abstract_origin attribute to
3031 the new decl we are creating. Move informing the middle end about
3032 the new decl to...
3033 (lto_main): ...here. Inform the middle end about global variables
3034 after we have read in all the input files.
3035 * lto-symtab.c (lto_symtab_merge_decl): We really do need to merge
3036 variables with internal linkage, so delete the check for internal
3037 linkage. Combine TREE_PUBLIC flags.
3038
30392007-11-08 Nathan Froyd <froydnj@codesourcery.com>
3040
3041 * lto.c (lto_read_subroutine_type_subprogram_DIE): Handle
3042 DW_AT_decl_line.
3043 * lto-symtab.c (lto_symtab_merge_decl): Handle redefinition of a
3044 builtin specially. Move check for attribute compatibility
3045 earlier.
3046
30472007-11-07 Nathan Froyd <froydnj@codesourcery.com>
3048
3049 * Make-lang.in (lto/lto.o): Depend on gt-lto-lto.h.
3050 * config-lang.in (gtfiles): Add lto.h and lto.c.
3051 * lto-elf.c: Include ggc.h.
3052 (lto_elf_file_open): Allocate elf_file from GC memory.
3053 * lto.c: Include tree-ssa-operands.h and gt-lto-lto.h
3054 (lto_info_fd_init): Allocate the die_cache and unmaterialized_fndecls
3055 in GC memory.
3056 (lto_info_fd_close): Free unmaterialized_fndecls from GC memory.
3057 (lto_file_close): Free file from GC memory.
3058 (lto_cache_store_DIE): Allocate the new entry in GC memory.
3059 (lto_read_member_DIE): Fix declaration.
3060 (lto_read_subroutine_type_subprogram_DIE): unmaterialized_fndecls lives
3061 in GC memory.
3062 (current_lto_file): New variable.
3063 (lto_main): Use it.
3064 (DWARF2_attr, DWARF2_abbrev, lto_die_ptr, DWARF2_CompUnit,
3065 lto_die_cache_entry): Move to...
3066 * lto.h: ...here and add GTY markers as appropriate. Delete forward
3067 declarations accordingly.
3068 (struct lto_file_struct): Declare.
3069 (lto_file_vtable): Use it instead of lto_file.
3070
30712007-11-06 Alon Dayan <alond@il.ibm.com>
3072 Kenneth Zadeck <zadeck@naturalbridge.com>
3073
3074 * lto-read.c (process_flags, lto_static_init_local):
3075 read flags of VAR_DECL and FUNCTION_DECL of size>1.
3076 change global array num_flags_for_code to flags_length_for_code.
3077 (set_line_info): Make decls work in USE_MAPPED_LOCATION mode.
3078
30792007-11-05 Nathan Froyd <froydnj@codesourcery.com>
3080
3081 * lto.c (lto_read_structure_union_class_type_DIE): Use proper record
3082 layout functions to compute information about the newly constructed
3083 type.
3084
30852007-11-02 Nathan Froyd <froydnj@codesourcery.com>
3086
3087 * lto-read.c (input_expr_operand): Change the LTO_return_expr1
3088 case to use DECL_RESULT if necessary.
3089
30902007-11-01 Kenneth Zadeck <zadeck@naturalbridge.com>
3091
3092 * lto-read.c (input_tree_list): Removed.
3093 (input_tree_flags): Added parameter to force flags no matter what
3094 tree code.
3095 (input_expr_operand): Added parameter to input_tree_flags.
3096 Added case for IDENTIFIER_NODE and TREE_LIST. Changed ASM to call
3097 input_expr_operand rather than input_tree_lists.
3098 (input_local_var): Use input_expr_operand to read attributes
3099 rather then input_tree_list.
3100 (input_phi, input_ssa_names): Added parameter to input_tree_flags.
3101
31022007-10-31 Nathan Froyd <froydnj@codesourcery.com>
3103
3104 * lto.c (lto_read_typedef_DIE): Fix comment typo.
3105 (lto_resolve_typedecl_ref): Fetch the referred-to type and build a fake
3106 TYPE_DECL for it.
3107 * lto-read.c (lto_read_body): Use correct sizes for calculating
3108 type_decls_offset and types_offset.
3109
31102007-10-30 Nathan Froyd <froydnj@codesourcery.com>
3111
3112 * lto-tree.h (union lang_tree_node): Change GTY description to chain
3113 with GENERIC_NEXT.
3114 * config-lang.in (gtfiles): Add lto-lang.c.
3115 * lto-lang.c: Include gt-lto-lto-lang.h.
3116 * Make-lang.in (lto/lto-lang.o): Add dependency on gt-lto-lto-lang.h
3117 (lto/lto-symtab.o): Depend on LTO_H instead of TREE_H.
3118 (lto/lto-read.o): Likewise.
3119
31202007-10-29 Kenneth Zadeck <zadeck@naturalbridge.com>
3121
3122 * lto-read.c (data_in): Added type_decls and current_col fields.
3123 (string_slot): New type to hold canonized file name.
3124 (hash_string_slot_node, eq_string_slot_node, canon_file_name,
3125 input_line_info, set_line_info, clear_line_info): New functions.
3126 (file_name_hash_table): New hash table.
3127 (input_local_var, input_labels, input_local_vars_index,
3128 input_local_var, input_local_vars, input_ssa_names): Reorganized parameters.
3129 (input_uleb128): Changed type of byte var.
3130 (input_expr_operand): Large number of changes to get line numbers
3131 correct. Added TYPE_DECL case.
3132 (input_globals): Added code to get TYPE_DECLs processed.
3133 (input_local_var): Added code to process line numbers and
3134 TREE_CHAIN and DECL_CONTEXT.
3135 (input_function, input_constructor): Added call to
3136 clear_line_number.
3137 (lto_static_init_local): Added code to get line numbers correct.
3138 (lto_read_body): Added code to get TYPE_DECLS read and to change
3139 parameters to the calls above that had their parms reorganized.
3140
3141
31422007-10-29 Nathan Froyd <froydnj@codesourcery.com>
3143
3144 * lto.h (lto_resolve_typedecl_ref): Declare.
3145 * lto.c (lto_resolve_typedecl_ref): New function.
3146
31472007-10-29 Mark Mitchell <mark@codesourcery.com>
3148 Nathan Froyd <froydnj@codesourcery.com>
3149
3150 * lto.c (lto_read_subroutine_type_subprogram_DIE): Read the child
3151 DIEs even if we find an abstract origin for this DIE.
3152
31532007-10-29 Nathan Froyd <froydnj@codesourcery.com>
3154
3155 * lto.c (lto_read_subroutine_type_subprogram_DIE): Build the
3156 RESULT_DECL slightly earlier. Only remember the decl for later
3157 if we successfully merge declarations.
3158
31592007-10-24 Kenneth Zadeck <zadeck@naturalbridge.com>
3160
3161 * lto-read.c (input_expr_operand): Give label_values the proper
3162 context and provide switch statements with a default type.
3163
31642007-10-23 Nathan Froyd <froydnj@codesourcery.com>
3165
3166 * lto-read.c (lto_read_body): Move call to init_ssa_operands...
3167 * lto.c (lto_materialize_function): ...to here.
3168
31692007-10-22 Nathan Froyd <froydnj@codesourcery.com>
3170
3171 * lto.h (struct lto_info_fd): Add field unmaterialized_fndecls.
3172 * lto.c (lto_info_fd_init): Initialize it.
3173 (lto_info_fd_close): Free it.
3174 (lto_materialize_function): New function.
3175 (lto_read_subroutine_type_subprogram_DIE): Save the result decl on
3176 unmaterialized_fndecls.
3177 (lto_file_read): Read in all the function bodies after we have read
3178 all of the DWARF info.
3179 * lto-read.c (lto_read_body): Call init_ssa_operands if we are
3180 reading a function body.
3181
31822007-10-20 Kenneth Zadeck <zadeck@naturalbridge.com>
3183
3184 * lto-read.c (input_tree_flags): Renamed from input_flags to be
3185 semetric with output_tree_flags. Added call to log flags.
3186 (process_tree_flags): Renamed from process_flags. Fixed a lot of
3187 type issues to make everything consistent with flags being
3188 unsigned HOST_WIDE_INTS.
3189 (input_expr_operand): Added call to
3190 recompute_tree_invariant_for_addr_expr.
3191 (input_local_var): Added debugging for tree_chains. Now calls
3192 input_tree_flags.
3193 (input_phi): Made flags unsigned HOST_WIDE_INT.
3194 (input_ssa_names): Now calls input_tree_flags.
3195 (lto_read_body): Now sets cfun.
3196 (lto_read_function_body): Now sets current_function_pointer.
3197
31982007-10-19 Nathan Froyd <froydnj@codesourcery.com>
3199
3200 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Check
3201 definitively whether SPECIFICATION or ABSTRACT_ORIGIN exist before
3202 inspecting fields within.
3203 (lto_read_DIE_at_ptr): Delete check for null result; let callers
3204 handle this appropriately.
3205
32062007-10-19 Nathan Froyd <froydnj@codesourcery.com>
3207
3208 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Handle
3209 DW_AT_abstract_origin properly. Ensure that we're not dealing with
3210 both DW_AT_abstract_origin and DW_AT_specification.
3211 (lto_read_subroutine_type_subprogram_DIE): Handle
3212 DW_AT_abstract_origin.
3213 (lto_read_DIE): Use lto_read_only_for_child_DIEs for labels.
3214 (lto_read_DIE_at_ptr): Define as static to match declaration.
3215 Lookup the PTR in the cache before reading it from the file.
3216 (lto_resolve_var_ref): Adjust accordingly.
3217 (lto_resolve_fn_ref): Adjust accordingly. Tweak comment.
3218 (lto_resolve_field_ref): Adjust accordingly. Tweak comment.
3219
32202007-10-19 Nathan Froyd <froydnj@codesourcery.com>
3221
3222 * lto.c (lto_read_DIE_at_ptr): New function.
3223 (lto_resolve_var_ref): Use it.
3224 (lto_resolve_fn_ref): Use it.
3225 (lto_resolve_field_ref): Use it.
3226 (lto_read_variable_formal_parameter_constant_DIE): Follow
3227 DW_AT_specification and return the associated decl when appropriate.
3228
32292007-10-18 Nathan Froyd <froydnj@codesourcery.com>
3230
3231 * lto-lang.c (lto_type_for_mode): Move after lto_type_for_size.
3232 Implement for scalar integer modes.
3233 (lto_init): Initialize size_type_node.
3234
32352007-10-18 Kenneth Zadeck <zadeck@naturalbridge.com>
3236
3237 * lto-read.c (input_expr_operand): Remove ssa name asserts.
3238 (input_local_var): Add chaining for params.
3239 (input_ssa_names): Add cfun parameter.
3240 (input_function): Remove unnecessary else.
3241
32422007-10-17 Nathan Froyd <froydnj@codesourcery.com>
3243
3244 * lto.c (lto_read_only_for_child_DIEs): Mark die parameter as unused.
3245 (lto_resolve_var_ref): Use proper types.
3246 (lto_resolve_fn_ref): Likewise.
3247 (lto_resolve_field_ref): Likewise.
3248
32492007-10-17 Nathan Froyd <froydnj@codesourcery.com>
3250
3251 * lto-read.c (input_expr_operand): Remove case.
3252
32532007-10-17 Nathan Froyd <froydnj@codesourcery.com>
3254
3255 * lto.c (lto_read_only_for_child_DIEs): New function.
3256 (lto_read_DIE): Use it for lexical_block and inlined_subroutine DIEs.
3257 * lto-elf.c (lto_elf_map_lto_section): Remove.
3258 (lto_elf_file_vtable): Use lto_elf_map_optional_lto_section instead.
3259 * lto-read.c (input_expr_operand): Assert that we never read a NULL
3260 SSA_NAME. Add missing case for mechanical codes.
3261 (input_cfg): Use basic_block_info_for_function instead of
3262 basic_block_info.
3263
32642007-10-16 Kenneth Zadeck <zadeck@naturalbridge.com>
3265
3266 * lto-read.c (input_sleb128, input_integer): Use proper casts.
3267 (input_list): Renamed input_tree_list and modified to follow same
3268 protocol as lto-function-out.c:output_tree_list.
3269 (input_expr_operand): Make asm operands use input_tree_list.
3270 (input_local_var): Now uses input_tree_list.
3271 (lto_read_body): Change placement for setting context of debug_labels.
3272
3273
32742007-10-16 Kenneth Zadeck <zadeck@naturalbridge.com>
3275
3276 * lto-read.c (input_real): Output debugging in proper order.
3277 (input_integer): Compute bit lengths properly.
3278 (input_list): Clean up declaration.
3279 (input_expr_operand): Change calls to input_real to match fix.
3280 Make reading of LTO_bit_field_ref1 match output.
3281 (input_local_var): Make reading of attributes match what is being
3282 written.
3283 (dump_debug_stream): Also print char in hex.
3284 (debug_out_fun): Fix signed unsigned mismatch.
3285
32862007-10-10 Nathan Froyd <froydnj@codesourcery.com>
3287
3288 * lto.c (lto_read_form): Handle DW_AT_MIPS_linkage_name and
3289 DW_AT_GNU_vector specially, as they are not contiguous with the
3290 specified set of attribute names. Use class_mask to check for
3291 errors at the end of the function
3292 (lto_resolve_var_ref): Read the DIE if it is not cached.
3293 (lto_resolve_fn_ref): Likewise.
3294 (lto_resolve_field_ref): Likewise.
3295
32962007-10-05 Nathan Froyd <froydnj@codesourcery.com>
3297
3298 * lto.c: Include dwarf2out.h.
3299 (lto_cache_store_DIE): Assert that we never change the value.
3300 (LTO_BEGIN_READ_ATTRS): Print an informative error message.
3301 (lto_read_compile_unit_DIE): Handle DW_AT_entry_pc.
3302 (lto_read_array_type_DIE): Don't error on ndims == 0; build a
3303 sensible type instead.
3304 (lto_read_structure_union_class_type_DIE): Store the newly
3305 created type prior to reading the members of the structure to
3306 avoid infinite recursion. Avoid computing types and alignments
3307 for structures whose sizes are unknown.
3308 (lto_read_variable_formal_parameter_const): Handle DW_AT_artificial
3309 and set DECL_ARTIFICIAL accordingly. Ignore DW_AT_abstract_origin,
3310 DW_AT_const_value, and DW_AT_specification.
3311 (lto_read_subroutine_type_subprogram_DIE): Handle DW_AT_declaration.
3312 Return early if we have already constructed the function type.
3313 (lto_read_typedef_DIE): Check to see if the type has been cached
3314 already. Cache the type before reading any children.
3315 (lto_read_const_volatile_restrict_type_DIE): Handle DW_AT_name.
3316 (lto_read_DIE): Unset context->skip_non_parameters around reading
3317 the DIE.
3318 (lto_resolve_fn_ref): Delete trailing whitespace.
3319
33202007-09-11 Kenneth Zadeck <zadeck@naturalbridge.com>
3321
3322 * lto-read.c (input_expr_operand): Added type for STRING_CST.
3323
33242007-09-10 Nathan Froyd <froydnj@codesourcery.com>
3325
3326 * lto-read.c (lto_read): Set the type of the newly created CALL_EXPR.
3327
33282007-09-07 Nathan Froyd <froydnj@codesourcery.com>
3329
3330 * lto-lang.c (signed_and_unsigned_types): New variable.
3331 (lto_type_for_size): Consult signed_and_unsigned_types to find
3332 an approprite type, creating it if necessary.
3333 (lto_set_decl_assembler_name): Add actual method body.
3334
33352007-09-06 Jim Blandy <jimb@codesourcery.com>
3336
3337 * lto.c (lto_read_variable_formal_parameter_constant_DIE): If we
3338 can't find a var init for this variable, leave its DECL_INITIAL.
3339 * lto-elf.c (lto_elf_map_optional_lto_section): Renamed from
3340 lto_elf_map_fn_body.
3341 (lto_map_lto_section): New function.
3342 (lto_elf_file_vtable): Use lto_elf_map_lto_section for function
3343 bodies, and lto_elf_map_optional_lto_section for variable
3344 initializers.
3345 (lto_elf_find_section_data): Quietly return NULL if the section is
3346 missing.
3347 (lto_elf_file_open): Check for a NULL from lto_elf_find_section_data.
3348
3349 * lto-elf.c (lto_elf_find_section_data): Remove dead code.
3350
3351 * lto-read.c (lto_read_body): Doc fix.
3352
33532007-08-29 Kenneth Zadeck <zadeck@naturalbridge.com>
3354
3355 * lto-read.c (fun_in): Renamed to data_in.
3356 (input_expr_operand, input_local_var, input_string_internal,
3357 input_string, input_real, input_list, get_label_decl,
3358 get_type_ref, input_expr_operand, input_globals, input_labels,
3359 input_local_vars_index, input_local_var, input_local_vars,
3360 input_cfg, input_phi, input_ssa_names, input_bb, ): Renamed fun_in to data_in.
3361 (input_constructor): New function.
3362 (lto_read_function_body): Renamed to lto_read_body and generalized
3363 to handle both functions and constructors.
3364 (lto_read_function_body, lto_read_var_init): New function.
3365
3366
33672007-08-28 Kenneth Zadeck <zadeck@naturalbridge.com>
3368
3369 * lto-read.c (input_expr_operand): Assert that there really is a
3370 FUNCTION_DECL.
3371 (input_globals): Removed checks on 0 section.
3372
33732007-08-28 Kenneth Zadeck <zadeck@naturalbridge.com>
3374
3375 * lto-read.c (fun_in): Added local_decls_index and
3376 local_decls_index_d.
3377 (input_expr_operand): Changed inputting of PARM_DECLs and VAR_DECLs.
3378 (input_globals): Enabled code to handle FIELD_DECLs.
3379 (input_local_vars_index, input_local_vars): New function.
3380 (input_local_var): Changed to allow locals to be input randomly.
3381 (lto_read_function_body): Added code to input the
3382 local_decls_index and to free various structures.
3383
33842007-08-17 Jim Blandy <jimb@codesourcery.com>
3385
3386 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Remove
3387 ATTRIBUTE_UNUSED from 'die' formal.
3388
3389 Use enum LTO_tags where appropriate, instead of 'unsigned int'.
3390 * lto-read.c (input_record_start): Fix return type, type of 'tag'.
3391 (input_list): Fix type of 'tag'.
3392 (input_expr_operand): Fix type of 'tag' argument. Update
3393 declaration. Fix type of 'ctag'. Add default case to switch,
3394 since the type of the switched value is now an enum.
3395 (input_local_vars): Fix type of 'tag'.
3396 (input_bb): Fix type of 'tag' argument.
3397 (input_function): Fix type of 'tag' argument.
3398
33992007-08-16 Jim Blandy <jimb@codesourcery.com>
3400
3401 * lto.c (lto_read_member_DIE): Record the tree we create in
3402 fd->die_cache. (Our 'die' argument is no longer unused.)
3403 (lto_resolve_field_ref): New function.
3404 * lto.h (lto_resolve_field_ref): New declaration.
3405
34062007-08-15 Jim Blandy <jimb@codesourcery.com>
3407
3408 * lto-read.c (lto_read_var_init): Mark arguments as unused.
3409
34102007-08-07 Jim Blandy <jimb@codesourcery.com>
3411
3412 * lto.c (lto_read_form): Complete attr_classes table.
3413 (DWARF2_form_data): Doc fix.
3414
34152007-08-05 Mark Mitchell <mark@codesourcery.com>
3416
3417 * lto.h (lto_file_vtable): Remove read_var_init. Add map_var_init
3418 and unmap_var_init.
3419 (lto_read_var_init): Declare.
3420 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Use new
3421 interface for reading variable initializers.
3422 * lto-elf.c (lto_elf_read_var_init): Remove.
3423 (lto_elf_file_vtable): Update initializer.
3424 (lto_elf_read_var_init): Add comment about unused-ness.
3425 * lto-read.c (lto_read_var_init): New.
3426
3427 * lto.c (lto_read_form): Add entry for DW_AT_inline.
3428
34292007-08-02 Kenneth Zadeck <zadeck@naturalbridge.com>
3430
3431 * lto-read.c (lto_read_function_body): Moved declaration of fn
3432 outside of ifdef.
3433
34342007-08-01 Kenneth Zadeck <zadeck@naturalbridge.com>
3435
3436 * lto-read.c (input_uleb128, input_string_internal, input_real,
3437 input_integer, input_record_start, input_list, get_type_ref,
3438 input_flags, input_expr_operand, input_expr_operand,
3439 input_expr_operand, input_local_vars, input_cfg, input_phi,
3440 input_ssa_names, input_bb, input_function): Added semicolons.
3441
3442
34432007-07-31 Kenneth Zadeck <zadeck@naturalbridge.com>
3444
3445 * lto-read.c (input_globals): Remove debugging.
3446 (input_function): Set DECL_ARGUMENTS.
3447
3448
34492007-07-31 Kenneth Zadeck <zadeck@naturalbridge.com>
3450
3451 * lto-read.c (input_expr_operand): Fixed code for COND_EXEC,
3452 RETURN_EXPR, MODIFY_EXPR and processing of flags.
3453 (input_phi): Made work with operands other than SSA_NAMES and
3454 fixed processing of flags.
3455 (input_ssa_names): Initialize SSA_NAME_DEF_STMT to empty stmt.
3456 (input_flags): New function.
3457 * lto-lang.c (lto_init): Changed state of in_lto_p.
3458
3459
34602007-07-24 Mark Mitchell <mark@codesourcery.com>
3461
3462 * lto-tree.h (lto_varargs_cookie): Remove.
3463 * lto.c (lto_context): Add last_parm_type, varargs_p, skip_all,
3464 skip_non_parameters, skip_parameters.
3465 (lto_varargs_cookie): Remove.
3466 (lto_read_variable_formal_parameter_constant_DIE): Keep track of
3467 parameter types.
3468 (lto_read_abbrev): New function.
3469 (lto_read_subroutine_type_subprogram_DIE): Make two passes over
3470 child DIEs.
3471 (lto_read_unspecified_parameters_DIE): Set context->varargs_p.
3472 (lto_read_DIE): Use lto_read_abbrev. Honor skip_* flags.
3473 (lto_file_read): Initialize new context fields.
3474 * lto-lang.c (lto_type_for_mode): Return NULL_TREE.
3475 (lto_unsigned_type): Remove.
3476 (lto_signed_type): Likewise.
3477 (lto_signed_or_unsigned_type): Likewise.
3478 (lto_init): Do not create lto_varargs_cookie.
3479 (LANG_HOOKS_UNSIGNED_TYPE): Do not define.
3480 (LANG_HOOKS_SIGNED_TYPE): Likewise.
3481 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Likewise.
3482
34832007-07-19 Jan Hubicka <jh@suse.cz>
3484
3485 * lto-read.c (lto_read_function_body): Produce empty scope block
3486 to avoid crash.
3487
34882007-07-18 Mark Mitchell <mark@codesourcery.com>
3489
3490 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Do not
3491 process local variables.
3492 (lto_read_subroutine_type_subprogram_DIE): Read child DIEs.
3493
34942007-07-13 Kenneth Zadeck <zadeck@naturalbridge.com>
3495
3496 * lto-read.c (input_list, input_expr_operand): Added struct
3497 function parameter.
3498 (init_cfg, finalize_cfg): Removed function.
3499 (input_expr_operand): Added SSA_NAME and GIMPLE_MODIFY_STMT cases.
3500 (input_labels, input_local_vars): Now takes input_block parameter rather than
3501 synthsyzing it.
3502 (input_cfg, input_phi, input_ssa_names): New functions.
3503 (input_bb): Now passes in input_blocks. Does not construct cfg
3504 and processes the list of phi functions.
3505 (input_function): Now builds both the cfg and ssa_names table.
3506 (lto_read_function_body): Processes new header fields to construct
3507 streams for the ssa_names and cfg and their debugging.
3508 * lto/lto-lang.c (lto_init): Set in_lto_p.
3509
3510
35112007-06-28 Mark Mitchell <mark@codesourcery.com>
3512
3513 * lto.h (lto_file_vtable): Add read_var_init.
3514 * lto.c (lto_read_variable_formal_parameter_constant_DIE): Read
3515 initializers.
3516 (lto_main): Remove bogus asserts.
3517 * lto-elf.c (tm.h): Include it.
3518 (libiberty.y): Likewise.
3519 (lto_elf_file): Add strtab and symtab. Rename
3520 string_table_section_index to sec_strtab.
3521 (lto_elf_file_vtable): Add lto_elf_read_var_init.
3522 (lto_elf_get_shdr): New function.
3523 (lto_elf_free_shdr): Likewise.
3524 (lto_elf_find_section_data): Use them.
3525 (lto_elf_read_symtab): New function.
3526 (lto_elf_lookup_sym): Likewise.
3527 (lto_elf_free_sym): Likewise.
3528 (lto_elf_file_open): Tidy. Call lto_elf_read_symtab.
3529 (lto_elf_built_init): New function.
3530 (lto_elf_read_var_init): Likewise.
3531 * Make-lang.in (lto/lto-elf.o): Depend on $(TM_H).
3532
35332007-06-26 Kenneth Zadeck <zadeck@naturalbridge.com>
3534
3535 * lto-read (make_new_block): Initialize the stmt_list.
3536 (lto_static_init_local): Add debugging for missing codes.
3537
35382007-06-26 Mark Mitchell <mark@codesourcery.com>
3539
3540 * lto.c (lto_read_subroutine_type_subprogram_DIE): Handle
3541 unprototyped functions.
3542
35432007-06-23 Mark Mitchell <mark@codesourcery.com>
3544
3545 * lto.c (lto_read_variable_formal_parameter_constant_DIE):
3546 Handle DW_AT_MIPS_linkage_name.
3547 (lto_read_subroutine_type_subprogram): Likewise. Correct
3548 compilation errors.
3549 (lto_main): Remove incorrect assertions.
3550 * lto-symbtab.c: Build function types out of TREE_LISTs.
3551
3552 * lto-elf.c (<libelf>): Check for HAVE_LIBELF_H.
3553
3554 * Make-lang.in (LTO_OBJS): Depend on attribs.o.
3555
35562007-06-21 Kenneth Zadeck <zadeck@naturalbridge.com>
3557
3558 * lto/lto-tree.h (lang_decl, lang_type, language_function): Added
3559 dummy since ggc does not like empty structs.
3560 * lto/lto-elf.c (libelf.h): Changed to libelf/libelf.h.
3561 * lto/lto-read.c (ADD_CLASS_FLAG, ADD_EXPR_FLAG): Changed
3562 expr->common to expr->base.
3563 (make_new_block): Moved stmt_list to proper place.
3564
3565
35662007-03-14 Robert Kennedy <jimbob@google.com>
3567
3568 Eliminate use of lang_hooks.set_decl_assembler_name from LTO
3569 * lto.c (lto_read_subroutine_type_subprogram_DIE) Get DECL
3570 assembler name from DWARF.
3571 * lto-lang.c (lto_set_decl_assembler_name) New function.
3572
35732006-09-10 Mark Mitchell <mark@codesourcery.com>
3574
3575 * lto.h (lto_file_vtable): New structure.
3576 (lto_file): Add vtable pointer.
3577 (lto_file_init): Add vtable paramter.
3578 (lto_read_function_body): New function.
3579 (lto_symtab_merge_fn): New function.
3580 * lto.c (lto_file_init): Add vtable parameter.
3581 (lto_read_form): Fill in entries for DW_AT_prototyped,
3582 DW_AT_frame_base.
3583 (lto_read_subroutine_type_subprogram_DIE): New function.
3584 (lto_read_DIE): Fill in entries for DW_TAG_subroutine_type and
3585 DW_TAG_subprogram.
3586 * lto-elf.c (lto_elf_vile_vtable): New variable.
3587 (lto_elf_file_open): Pass it to lto_file_init.
3588 (lto_elf_map_fn_body): New function.
3589 (lto_elf_unmap_fn_body): Likewise.
3590 * lto-read.c: New file.
3591 * lto-symtab.c (lto_symtab_merge_fn): New function.
3592 * lto-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Define to
3593 tree_rest_of_compilation.
3594 * Make-lang.in (LTO_OBJS): Add lto-read.o
3595 (lto-read.o): New target.
3596
35972006-09-03 Mark Mitchell <mark@codesourcery.com>
3598
3599 * lto.c (<inttypes.h>): Don't include it.
3600 (lto_context): Don't typedef it.
3601 (lto_resolve_reference): New function.
3602 (lto_read_form): Use it.
3603 (lto_resolve_type_ref): New function.
3604 (lto_resolve_var_ref): Likewise.
3605 (lto_resolve_fn_ref): Likewise.
3606 * lto.h (<inttypes.h>): Include it.
3607 (lto_context): New type.
3608 (lto_ref): New structure.
3609 (lto_resolve_type_ref): Declare.
3610 (lto_resolve_var_ref): Likewise.
3611 (lto_resolve_fn_ref): Likewise.
3612
36132006-08-18 Mark Mitchell <mark@codesourcery.com>
3614
3615 * lang-specs.h: New file.
3616
36172006-08-14 Mark Mitchell <mark@codesourcery.com>
3618
3619 * lto.c (lto_info_fd_init): Allocate the DIE cache.
3620 (lto_info_fd_close): Deallocate it.
3621 (lto_die_cache_entry): New structure.
3622 (lto_cache_hash): New function.
3623 (lto_cache_eq): Likewise.
3624 (lto_cache_store_DIE): Likewise.
3625 (lto_cache_lookup_DIE): Likewise.
3626 (lto_read_referenced_type_DIE): Use the cache.
3627 (lto_read_pointer_type_DIE): Robustify.
3628 (lto_read_DIE): Use the cache.
3629 * lto.h (hashtab.h): Include.
3630 (lto_info_fd): Add DIE cache.
3631 * Make-lang.in (LTO_H): New variable.
3632 (lto/lto-lang.o): Use LTO_H.
3633 (lto/lto-elf.o): Likewise.
3634 (lto/lto-symtab.o): Likewise.
3635
36362006-07-09 Mark Mitchell <mark@codesourcery.com>
3637
3638 * lto.c (lto_abi_mismatch_error): New function.
3639 (lto_abbrev_read): Initialize num_abbrevs.
3640 (lto_read_form): Specify allowed form classes for
3641 DW_AT_declaration. Adjust for change to lto_set_cu_context.
3642 (lto_read_variable_formal_parameter_constant_DIE): Handle
3643 DW_AT_declaration. Call lto_symtab_merge_var.
3644 (lto_read_pointer_type_DIE): New function.
3645 (lto_read_base_type_DIE): Use build_nonstandard_integer_type. Do
3646 not creat TYPE_DECLs for types that already have them.
3647 (lto_read_DIE): Add lto_read_pointer_type_DIE.
3648 (lto_set_cu_context): Make cu_start point to the header, not the
3649 first DIE.
3650 (lto_file_read): Adjust for change to lto_set_cu_context.
3651 * Make-lang.in (LTO_OBJS): Add lto-symtab.o.
3652 (lto/lto-symtab.o): New rule.
3653 * lto-tree.h (lang_identifier): Add decl field.
3654 (LANG_IDENTIFIER_CAST): New macro.
3655 (LTO_IDENTIFIER_DECL): Likewise.
3656 (lto_symtab_merge_var): Declare.
3657 * lto-symtab.c: New file.
3658
36592006-07-02 Daniel Berlin <dberlin@dberlin.org>
3660
3661 * lto.c (lto_context): Add current_cu and info_fd members.
3662 (DWARF2_CompUnit): New structure.
3663 (lto_read_DIE): Take lto_info_fd *.
3664 (lto_read_child_DIEs): Ditto.
3665 (lto_file_corrupt_error): Constify argument.
3666 (lto_set_cu_context): New function
3667 (lto_info_fd_init): Ditto.
3668 (lto_info_fd_close): Ditto.
3669 (lto_file_init): Use lto_info_fd_init.
3670 (lto_file_close): Use lto_info_fd_close.
3671 (lto_read_initial_length): Pass in pointer to header size.
3672 (lto_read_comp_unit_header): Correct cu_length to
3673 real length from beginning of header. Take lto_info_fd * as
3674 argument.
3675 (find_cu_for_offset): New function.
3676 (lto_read_form): Change first argument to lto_info_fd *.
3677 Add FORM_CONTEXT argument.
3678 Handle DW_FORM_ref_addr.
3679 (lto_read_tag_DIE): Change first argument to lto_info_fd *.
3680 (LTO_BEGIN_READ_ATTRS_UNCHECKED): Save old context.
3681 Swap contexts if necessary for form.
3682 (LTO_BEGIN_READ_ATTRS): Cast fd to right type for
3683 lto_file_corrupt_error.
3684 (LTO_END_READ_ATTRS): Swap contexts back if it had changed.
3685 (lto_read_referenced_type_DIE): Change first argument to
3686 lto_info_fd *. Access lto_fd fields through base pointer.
3687 (lto_read_compile_unit_DIE): Change first argument to an
3688 lto_info_fd *.
3689 (lto_read_variable_formal_parameter_constant_DIE): Ditto.
3690 (lto_read_base_type_DIE): Ditto.
3691 (lto_read_child_DIEs): Ditto.
3692 (lto_read_DIE): Ditto. Change type of function pointer.
3693 (lto_info_read): New function.
3694 (lto_set_cu_context): Ditto.
3695 (lto_file_read): Use lto_info_read, walk resulting CU's
3696 (lto_main): Update for lto_info_fd change.
3697 * lto-elf.c (lto_elf_file_open): Cast lto_info_fd to lto_fd where
3698 necessary.
3699 * lto.h (DWARF2_CompUnit): New structure.
3700 (lto_info_fd): Ditto.
3701 (lto_file): Change debug_info to be an lto_info_fd.
3702
37032006-06-25 Mark Mitchell <mark@codesourcery.com>
3704
3705 * lto.c (toplev.h): Include it.
3706 (dwarf2.h): Likewise.
3707 (tree.h): Likewise.
3708 (tm.h): Likewise.
3709 (cgraph.h): Likewise.
3710 (ggc.h): Likewise.
3711 (inttypes.h): Likewise.
3712 (DWARF2_attr): New type.
3713 (DWARF2_abbrev): Likewise.
3714 (DWARF2_class): Likewise.
3715 (DWARF2_form_data): Likewise.
3716 (lto_context): Likewise.
3717 (lto_fd_init): New function.
3718 (lto_abbrev_fd_init): Likewise.
3719 (lto_abbrev_fd_close): Likewise.
3720 (lto_file_init): Use them.
3721 (lto_file_close): New function.
3722 (lto_file_corrupt_error): Likewise.
3723 (LTO_CHECK_INT_VAL): New macro.
3724 (lto_check_size_t_val): New function.
3725 (lto_check_int_val): Likewise.
3726 (LTO_READ_TYPE): New macro.
3727 (lto_read_ubyte): New function.
3728 (lto_read_uhalf): Likewise.
3729 (lto_read_uword): Likewise.
3730 (lto_read_uleb128): Likewise.
3731 (lto_read_initial_length): Likewise.
3732 (lto_abbrev_read_attrs): Likewise.
3733 (lto_abbrev_read): Likewise.
3734 (lto_abbrev_lookup): Likewise.
3735 (lto_read_section_offset): Likewise.
3736 (lto_read_comp_unit_header): Likewise.
3737 (lto_read_form): Likewise.
3738 (LTO_BEGIN_READ_ATTRS_UNCHECKED): New macro.
3739 (LTO_BEGIN_READ_ATTRS): Likewise.
3740 (LTO_END_READ_ATTRS): Likewise.
3741 (lto_unsupported_attr_error): New function.
3742 (lto_get_identifier): Likewise.
3743 (lto_read_referenced_type_DIE): Likewise.
3744 (lto_read_compile_unit_DIE): Likewise.
3745 (lto_read_variable_formal_parameter_constant_DIE): Likewise.
3746 (lto_read_base_type_DIE): Likewise.
3747 (lto_read_DIE): Likewise.
3748 (lto_read_child_DIEs): Likewise.
3749 (lto_file_read): Read DIEs.
3750 (lto_main): Ask middle end to emit entities.
3751 * lto-tree.h (lang_identifier): Inherit from tree_identifier.
3752 * lto-elf.c (lto_elf_file_open): Adjust for interface changes.
3753 (lto_elf_file_close): Likewise.
3754 * lto.h (lto_file): Declare.
3755 (DWARF2_abbrev): Likewise.
3756 (lto_fd): New type.
3757 (lto_abbrev_fd): Likewise.
3758 (lto_file): Use new types.
3759 (lto_file_close): Declare.
3760 * lto-lang.c (lto_init): Always use unit-at-a-time mode.
3761
37622006-06-18 Mark Mitchell <mark@codesourcery.com>
3763
3764 * lto.h: New file.
3765 * lto.c: New file.
3766 * lto-elf.c: New file.
3767 * lto-lang.c (flags.h): Include it.
3768 (lto.h): Likewise.
3769 (lto_init): New function.
3770 (lto_write_globals): Remove.
3771 (LANG_HOOKS_WRITE_GLOBALS): Define to lhd_do_nothing.
3772 (LANG_HOOKS_INIT): Define.
3773 (LANG_HOOKS_PARSE_FILE): Likewise.
3774 * Make-lang.in (LTO_OBJS): Add lto.o and lto-elf.o.
3775 (LTO_EXE): Link with libelf.
3776 (lto/lto-lang.o): Update dependencies.
3777 (lto/lto.o): New target.
3778 (lto/lto-elf.o): Likewise.
3779
37802006-06-12 Mark Mitchell <mark@codesourcery.com>
3781
3782 * config-lang.in: New file.
3783 * Make-lang.in: Likewise.
3784 * lto-tree.h: Likewise.
3785 * lto-lang.c: Likewise.
3786