1 /* Write the GIMPLE representation to a file stream.
3 Copyright 2009, 2010 Free Software Foundation, Inc.
4 Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
5 Re-implemented by Diego Novillo <dnovillo@google.com>
7 This file is part of GCC.
9 GCC is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 3, or (at your option) any later
14 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING3. If not see
21 <http://www.gnu.org/licenses/>. */
25 #include "coretypes.h"
33 #include "basic-block.h"
34 #include "tree-flow.h"
35 #include "tree-pass.h"
39 #include "diagnostic-core.h"
42 #include "lto-symtab.h"
43 #include "lto-streamer.h"
44 #include "data-streamer.h"
45 #include "gimple-streamer.h"
46 #include "tree-streamer.h"
47 #include "streamer-hooks.h"
50 /* Clear the line info stored in DATA_IN. */
53 clear_line_info (struct output_block
*ob
)
55 ob
->current_file
= NULL
;
61 /* Create the output block and return it. SECTION_TYPE is
62 LTO_section_function_body or LTO_static_initializer. */
65 create_output_block (enum lto_section_type section_type
)
67 struct output_block
*ob
= XCNEW (struct output_block
);
69 ob
->section_type
= section_type
;
70 ob
->decl_state
= lto_get_out_decl_state ();
71 ob
->main_stream
= XCNEW (struct lto_output_stream
);
72 ob
->string_stream
= XCNEW (struct lto_output_stream
);
73 ob
->writer_cache
= lto_streamer_cache_create ();
75 if (section_type
== LTO_section_function_body
)
76 ob
->cfg_stream
= XCNEW (struct lto_output_stream
);
80 ob
->string_hash_table
= htab_create (37, hash_string_slot_node
,
81 eq_string_slot_node
, NULL
);
82 gcc_obstack_init (&ob
->obstack
);
88 /* Destroy the output block OB. */
91 destroy_output_block (struct output_block
*ob
)
93 enum lto_section_type section_type
= ob
->section_type
;
95 htab_delete (ob
->string_hash_table
);
97 free (ob
->main_stream
);
98 free (ob
->string_stream
);
99 if (section_type
== LTO_section_function_body
)
100 free (ob
->cfg_stream
);
102 lto_streamer_cache_delete (ob
->writer_cache
);
103 obstack_free (&ob
->obstack
, NULL
);
109 /* Look up NODE in the type table and write the index for it to OB. */
112 output_type_ref (struct output_block
*ob
, tree node
)
114 output_record_start (ob
, LTO_type_ref
);
115 lto_output_type_ref_index (ob
->decl_state
, ob
->main_stream
, node
);
119 /* Return true if tree node T is written to various tables. For these
120 nodes, we sometimes want to write their phyiscal representation
121 (via lto_output_tree), and sometimes we need to emit an index
122 reference into a table (via lto_output_tree_ref). */
125 tree_is_indexable (tree t
)
127 if (TREE_CODE (t
) == PARM_DECL
)
129 else if (TREE_CODE (t
) == VAR_DECL
&& decl_function_context (t
)
133 return (TYPE_P (t
) || DECL_P (t
) || TREE_CODE (t
) == SSA_NAME
);
137 /* Output info about new location into bitpack BP.
138 After outputting bitpack, lto_output_location_data has
139 to be done to output actual data. */
142 lto_output_location_bitpack (struct bitpack_d
*bp
,
143 struct output_block
*ob
,
146 expanded_location xloc
;
148 bp_pack_value (bp
, loc
== UNKNOWN_LOCATION
, 1);
149 if (loc
== UNKNOWN_LOCATION
)
152 xloc
= expand_location (loc
);
154 bp_pack_value (bp
, ob
->current_file
!= xloc
.file
, 1);
155 if (ob
->current_file
!= xloc
.file
)
156 bp_pack_var_len_unsigned (bp
, lto_string_index (ob
,
158 strlen (xloc
.file
) + 1,
160 ob
->current_file
= xloc
.file
;
162 bp_pack_value (bp
, ob
->current_line
!= xloc
.line
, 1);
163 if (ob
->current_line
!= xloc
.line
)
164 bp_pack_var_len_unsigned (bp
, xloc
.line
);
165 ob
->current_line
= xloc
.line
;
167 bp_pack_value (bp
, ob
->current_col
!= xloc
.column
, 1);
168 if (ob
->current_col
!= xloc
.column
)
169 bp_pack_var_len_unsigned (bp
, xloc
.column
);
170 ob
->current_col
= xloc
.column
;
174 /* Emit location LOC to output block OB.
175 When bitpack is handy, it is more space effecient to call
176 lto_output_location_bitpack with existing bitpack. */
179 lto_output_location (struct output_block
*ob
, location_t loc
)
181 struct bitpack_d bp
= bitpack_create (ob
->main_stream
);
182 lto_output_location_bitpack (&bp
, ob
, loc
);
183 lto_output_bitpack (&bp
);
187 /* If EXPR is an indexable tree node, output a reference to it to
188 output block OB. Otherwise, output the physical representation of
192 lto_output_tree_ref (struct output_block
*ob
, tree expr
)
198 output_type_ref (ob
, expr
);
202 code
= TREE_CODE (expr
);
206 output_record_start (ob
, LTO_ssa_name_ref
);
207 output_uleb128 (ob
, SSA_NAME_VERSION (expr
));
211 output_record_start (ob
, LTO_field_decl_ref
);
212 lto_output_field_decl_index (ob
->decl_state
, ob
->main_stream
, expr
);
216 output_record_start (ob
, LTO_function_decl_ref
);
217 lto_output_fn_decl_index (ob
->decl_state
, ob
->main_stream
, expr
);
221 case DEBUG_EXPR_DECL
:
222 gcc_assert (decl_function_context (expr
) == NULL
|| TREE_STATIC (expr
));
223 output_record_start (ob
, LTO_global_decl_ref
);
224 lto_output_var_decl_index (ob
->decl_state
, ob
->main_stream
, expr
);
228 output_record_start (ob
, LTO_const_decl_ref
);
229 lto_output_var_decl_index (ob
->decl_state
, ob
->main_stream
, expr
);
233 gcc_assert (decl_function_context (expr
) == NULL
);
234 output_record_start (ob
, LTO_imported_decl_ref
);
235 lto_output_var_decl_index (ob
->decl_state
, ob
->main_stream
, expr
);
239 output_record_start (ob
, LTO_type_decl_ref
);
240 lto_output_type_decl_index (ob
->decl_state
, ob
->main_stream
, expr
);
244 output_record_start (ob
, LTO_namespace_decl_ref
);
245 lto_output_namespace_decl_index (ob
->decl_state
, ob
->main_stream
, expr
);
249 output_record_start (ob
, LTO_label_decl_ref
);
250 lto_output_var_decl_index (ob
->decl_state
, ob
->main_stream
, expr
);
254 output_record_start (ob
, LTO_result_decl_ref
);
255 lto_output_var_decl_index (ob
->decl_state
, ob
->main_stream
, expr
);
258 case TRANSLATION_UNIT_DECL
:
259 output_record_start (ob
, LTO_translation_unit_decl_ref
);
260 lto_output_var_decl_index (ob
->decl_state
, ob
->main_stream
, expr
);
264 /* No other node is indexable, so it should have been handled by
271 /* Return true if EXPR is a tree node that can be written to disk. */
274 lto_is_streamable (tree expr
)
276 enum tree_code code
= TREE_CODE (expr
);
278 /* Notice that we reject SSA_NAMEs as well. We only emit the SSA
279 name version in lto_output_tree_ref (see output_ssa_names). */
280 return !is_lang_specific (expr
)
284 && code
!= MODIFY_EXPR
286 && code
!= TARGET_EXPR
288 && code
!= WITH_CLEANUP_EXPR
289 && code
!= STATEMENT_LIST
290 && code
!= OMP_CLAUSE
291 && code
!= OPTIMIZATION_NODE
292 && (code
== CASE_LABEL_EXPR
294 || TREE_CODE_CLASS (code
) != tcc_statement
);
298 /* Write a physical representation of tree node EXPR to output block
299 OB. If REF_P is true, the leaves of EXPR are emitted as references
300 via lto_output_tree_ref. IX is the index into the streamer cache
301 where EXPR is stored. */
304 lto_write_tree (struct output_block
*ob
, tree expr
, bool ref_p
)
308 if (!lto_is_streamable (expr
))
309 internal_error ("tree code %qs is not supported in LTO streams",
310 tree_code_name
[TREE_CODE (expr
)]);
312 /* Write the header, containing everything needed to materialize
313 EXPR on the reading side. */
314 lto_output_tree_header (ob
, expr
);
316 /* Pack all the non-pointer fields in EXPR into a bitpack and write
317 the resulting bitpack. */
318 bp
= bitpack_create (ob
->main_stream
);
319 pack_value_fields (&bp
, expr
);
320 lto_output_bitpack (&bp
);
322 /* Write all the pointer fields in EXPR. */
323 lto_output_tree_pointers (ob
, expr
, ref_p
);
325 /* Write any LTO-specific data to OB. */
327 && TREE_CODE (expr
) != FUNCTION_DECL
328 && TREE_CODE (expr
) != TRANSLATION_UNIT_DECL
)
330 /* Handle DECL_INITIAL for symbols. */
331 tree initial
= DECL_INITIAL (expr
);
332 if (TREE_CODE (expr
) == VAR_DECL
333 && (TREE_STATIC (expr
) || DECL_EXTERNAL (expr
))
336 lto_varpool_encoder_t varpool_encoder
;
337 struct varpool_node
*vnode
;
339 varpool_encoder
= ob
->decl_state
->varpool_node_encoder
;
340 vnode
= varpool_get_node (expr
);
342 initial
= error_mark_node
;
343 else if (!lto_varpool_encoder_encode_initializer_p (varpool_encoder
,
348 stream_write_tree (ob
, initial
, ref_p
);
351 /* Mark the end of EXPR. */
356 /* Emit the physical representation of tree node EXPR to output block
357 OB. If REF_P is true, the leaves of EXPR are emitted as references
358 via lto_output_tree_ref. */
361 lto_output_tree (struct output_block
*ob
, tree expr
, bool ref_p
)
366 if (expr
== NULL_TREE
)
368 output_record_start (ob
, LTO_null
);
372 if (ref_p
&& tree_is_indexable (expr
))
374 lto_output_tree_ref (ob
, expr
);
378 /* INTEGER_CST nodes are special because they need their original type
379 to be materialized by the reader (to implement TYPE_CACHED_VALUES). */
380 if (TREE_CODE (expr
) == INTEGER_CST
)
382 lto_output_integer_cst (ob
, expr
, ref_p
);
386 existed_p
= lto_streamer_cache_insert (ob
->writer_cache
, expr
, &ix
);
389 /* If a node has already been streamed out, make sure that
390 we don't write it more than once. Otherwise, the reader
391 will instantiate two different nodes for the same object. */
392 output_record_start (ob
, LTO_tree_pickle_reference
);
393 output_uleb128 (ob
, ix
);
394 lto_output_enum (ob
->main_stream
, LTO_tags
, LTO_NUM_TAGS
,
395 lto_tree_code_to_tag (TREE_CODE (expr
)));
397 else if (lto_stream_as_builtin_p (expr
))
399 /* MD and NORMAL builtins do not need to be written out
400 completely as they are always instantiated by the
401 compiler on startup. The only builtins that need to
402 be written out are BUILT_IN_FRONTEND. For all other
403 builtins, we simply write the class and code. */
404 lto_output_builtin_tree (ob
, expr
);
408 /* This is the first time we see EXPR, write its fields
410 lto_write_tree (ob
, expr
, ref_p
);
415 /* Output to OB a list of try/catch handlers starting with FIRST. */
418 output_eh_try_list (struct output_block
*ob
, eh_catch first
)
422 for (n
= first
; n
; n
= n
->next_catch
)
424 output_record_start (ob
, LTO_eh_catch
);
425 stream_write_tree (ob
, n
->type_list
, true);
426 stream_write_tree (ob
, n
->filter_list
, true);
427 stream_write_tree (ob
, n
->label
, true);
430 output_record_start (ob
, LTO_null
);
434 /* Output EH region R in function FN to OB. CURR_RN is the slot index
435 that is being emitted in FN->EH->REGION_ARRAY. This is used to
436 detect EH region sharing. */
439 output_eh_region (struct output_block
*ob
, eh_region r
)
445 output_record_start (ob
, LTO_null
);
449 if (r
->type
== ERT_CLEANUP
)
450 tag
= LTO_ert_cleanup
;
451 else if (r
->type
== ERT_TRY
)
453 else if (r
->type
== ERT_ALLOWED_EXCEPTIONS
)
454 tag
= LTO_ert_allowed_exceptions
;
455 else if (r
->type
== ERT_MUST_NOT_THROW
)
456 tag
= LTO_ert_must_not_throw
;
460 output_record_start (ob
, tag
);
461 output_sleb128 (ob
, r
->index
);
464 output_sleb128 (ob
, r
->outer
->index
);
469 output_sleb128 (ob
, r
->inner
->index
);
474 output_sleb128 (ob
, r
->next_peer
->index
);
478 if (r
->type
== ERT_TRY
)
480 output_eh_try_list (ob
, r
->u
.eh_try
.first_catch
);
482 else if (r
->type
== ERT_ALLOWED_EXCEPTIONS
)
484 stream_write_tree (ob
, r
->u
.allowed
.type_list
, true);
485 stream_write_tree (ob
, r
->u
.allowed
.label
, true);
486 output_uleb128 (ob
, r
->u
.allowed
.filter
);
488 else if (r
->type
== ERT_MUST_NOT_THROW
)
490 stream_write_tree (ob
, r
->u
.must_not_throw
.failure_decl
, true);
491 lto_output_location (ob
, r
->u
.must_not_throw
.failure_loc
);
495 output_sleb128 (ob
, r
->landing_pads
->index
);
501 /* Output landing pad LP to OB. */
504 output_eh_lp (struct output_block
*ob
, eh_landing_pad lp
)
508 output_record_start (ob
, LTO_null
);
512 output_record_start (ob
, LTO_eh_landing_pad
);
513 output_sleb128 (ob
, lp
->index
);
515 output_sleb128 (ob
, lp
->next_lp
->index
);
520 output_sleb128 (ob
, lp
->region
->index
);
524 stream_write_tree (ob
, lp
->post_landing_pad
, true);
528 /* Output the existing eh_table to OB. */
531 output_eh_regions (struct output_block
*ob
, struct function
*fn
)
533 if (fn
->eh
&& fn
->eh
->region_tree
)
540 output_record_start (ob
, LTO_eh_table
);
542 /* Emit the index of the root of the EH region tree. */
543 output_sleb128 (ob
, fn
->eh
->region_tree
->index
);
545 /* Emit all the EH regions in the region array. */
546 output_sleb128 (ob
, VEC_length (eh_region
, fn
->eh
->region_array
));
547 FOR_EACH_VEC_ELT (eh_region
, fn
->eh
->region_array
, i
, eh
)
548 output_eh_region (ob
, eh
);
550 /* Emit all landing pads. */
551 output_sleb128 (ob
, VEC_length (eh_landing_pad
, fn
->eh
->lp_array
));
552 FOR_EACH_VEC_ELT (eh_landing_pad
, fn
->eh
->lp_array
, i
, lp
)
553 output_eh_lp (ob
, lp
);
555 /* Emit all the runtime type data. */
556 output_sleb128 (ob
, VEC_length (tree
, fn
->eh
->ttype_data
));
557 FOR_EACH_VEC_ELT (tree
, fn
->eh
->ttype_data
, i
, ttype
)
558 stream_write_tree (ob
, ttype
, true);
560 /* Emit the table of action chains. */
561 if (targetm
.arm_eabi_unwinder
)
564 output_sleb128 (ob
, VEC_length (tree
, fn
->eh
->ehspec_data
.arm_eabi
));
565 FOR_EACH_VEC_ELT (tree
, fn
->eh
->ehspec_data
.arm_eabi
, i
, t
)
566 stream_write_tree (ob
, t
, true);
571 output_sleb128 (ob
, VEC_length (uchar
, fn
->eh
->ehspec_data
.other
));
572 FOR_EACH_VEC_ELT (uchar
, fn
->eh
->ehspec_data
.other
, i
, c
)
573 lto_output_1_stream (ob
->main_stream
, c
);
577 /* The LTO_null either terminates the record or indicates that there
578 are no eh_records at all. */
579 output_record_start (ob
, LTO_null
);
583 /* Output all of the active ssa names to the ssa_names stream. */
586 output_ssa_names (struct output_block
*ob
, struct function
*fn
)
590 len
= VEC_length (tree
, SSANAMES (fn
));
591 output_uleb128 (ob
, len
);
593 for (i
= 1; i
< len
; i
++)
595 tree ptr
= VEC_index (tree
, SSANAMES (fn
), i
);
598 || SSA_NAME_IN_FREE_LIST (ptr
)
599 || !is_gimple_reg (ptr
))
602 output_uleb128 (ob
, i
);
603 lto_output_1_stream (ob
->main_stream
, SSA_NAME_IS_DEFAULT_DEF (ptr
));
604 stream_write_tree (ob
, SSA_NAME_VAR (ptr
), true);
611 /* Output the cfg. */
614 output_cfg (struct output_block
*ob
, struct function
*fn
)
616 struct lto_output_stream
*tmp_stream
= ob
->main_stream
;
619 ob
->main_stream
= ob
->cfg_stream
;
621 lto_output_enum (ob
->main_stream
, profile_status_d
, PROFILE_LAST
,
622 profile_status_for_function (fn
));
624 /* Output the number of the highest basic block. */
625 output_uleb128 (ob
, last_basic_block_for_function (fn
));
627 FOR_ALL_BB_FN (bb
, fn
)
632 output_sleb128 (ob
, bb
->index
);
634 /* Output the successors and the edge flags. */
635 output_uleb128 (ob
, EDGE_COUNT (bb
->succs
));
636 FOR_EACH_EDGE (e
, ei
, bb
->succs
)
638 output_uleb128 (ob
, e
->dest
->index
);
639 output_sleb128 (ob
, e
->probability
);
640 output_sleb128 (ob
, e
->count
);
641 output_uleb128 (ob
, e
->flags
);
645 output_sleb128 (ob
, -1);
647 bb
= ENTRY_BLOCK_PTR
;
650 output_sleb128 (ob
, bb
->next_bb
->index
);
654 output_sleb128 (ob
, -1);
656 ob
->main_stream
= tmp_stream
;
660 /* Create the header in the file using OB. If the section type is for
661 a function, set FN to the decl for that function. */
664 produce_asm (struct output_block
*ob
, tree fn
)
666 enum lto_section_type section_type
= ob
->section_type
;
667 struct lto_function_header header
;
669 struct lto_output_stream
*header_stream
;
671 if (section_type
== LTO_section_function_body
)
673 const char *name
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fn
));
674 section_name
= lto_get_section_name (section_type
, name
, NULL
);
677 section_name
= lto_get_section_name (section_type
, NULL
, NULL
);
679 lto_begin_section (section_name
, !flag_wpa
);
682 /* The entire header is stream computed here. */
683 memset (&header
, 0, sizeof (struct lto_function_header
));
685 /* Write the header. */
686 header
.lto_header
.major_version
= LTO_major_version
;
687 header
.lto_header
.minor_version
= LTO_minor_version
;
688 header
.lto_header
.section_type
= section_type
;
690 header
.compressed_size
= 0;
692 if (section_type
== LTO_section_function_body
)
693 header
.cfg_size
= ob
->cfg_stream
->total_size
;
694 header
.main_size
= ob
->main_stream
->total_size
;
695 header
.string_size
= ob
->string_stream
->total_size
;
697 header_stream
= XCNEW (struct lto_output_stream
);
698 lto_output_data_stream (header_stream
, &header
, sizeof header
);
699 lto_write_stream (header_stream
);
700 free (header_stream
);
702 /* Put all of the gimple and the string table out the asm file as a
704 if (section_type
== LTO_section_function_body
)
705 lto_write_stream (ob
->cfg_stream
);
706 lto_write_stream (ob
->main_stream
);
707 lto_write_stream (ob
->string_stream
);
713 /* Output the body of function NODE->DECL. */
716 output_function (struct cgraph_node
*node
)
722 struct output_block
*ob
;
726 function
= node
->decl
;
727 fn
= DECL_STRUCT_FUNCTION (function
);
728 ob
= create_output_block (LTO_section_function_body
);
730 clear_line_info (ob
);
731 ob
->cgraph_node
= node
;
733 gcc_assert (current_function_decl
== NULL_TREE
&& cfun
== NULL
);
735 /* Set current_function_decl and cfun. */
736 current_function_decl
= function
;
739 /* Make string 0 be a NULL string. */
740 lto_output_1_stream (ob
->string_stream
, 0);
742 output_record_start (ob
, LTO_function
);
744 /* Write all the attributes for FN. */
745 bp
= bitpack_create (ob
->main_stream
);
746 bp_pack_value (&bp
, fn
->is_thunk
, 1);
747 bp_pack_value (&bp
, fn
->has_local_explicit_reg_vars
, 1);
748 bp_pack_value (&bp
, fn
->after_tree_profile
, 1);
749 bp_pack_value (&bp
, fn
->returns_pcc_struct
, 1);
750 bp_pack_value (&bp
, fn
->returns_struct
, 1);
751 bp_pack_value (&bp
, fn
->can_throw_non_call_exceptions
, 1);
752 bp_pack_value (&bp
, fn
->always_inline_functions_inlined
, 1);
753 bp_pack_value (&bp
, fn
->after_inlining
, 1);
754 bp_pack_value (&bp
, fn
->stdarg
, 1);
755 bp_pack_value (&bp
, fn
->has_nonlocal_label
, 1);
756 bp_pack_value (&bp
, fn
->calls_alloca
, 1);
757 bp_pack_value (&bp
, fn
->calls_setjmp
, 1);
758 bp_pack_value (&bp
, fn
->va_list_fpr_size
, 8);
759 bp_pack_value (&bp
, fn
->va_list_gpr_size
, 8);
760 lto_output_bitpack (&bp
);
762 /* Output the function start and end loci. */
763 lto_output_location (ob
, fn
->function_start_locus
);
764 lto_output_location (ob
, fn
->function_end_locus
);
766 /* Output current IL state of the function. */
767 output_uleb128 (ob
, fn
->curr_properties
);
769 /* Output the static chain and non-local goto save area. */
770 stream_write_tree (ob
, fn
->static_chain_decl
, true);
771 stream_write_tree (ob
, fn
->nonlocal_goto_save_area
, true);
773 /* Output all the local variables in the function. */
774 output_sleb128 (ob
, VEC_length (tree
, fn
->local_decls
));
775 FOR_EACH_VEC_ELT (tree
, fn
->local_decls
, i
, t
)
776 stream_write_tree (ob
, t
, true);
778 /* Output the head of the arguments list. */
779 stream_write_tree (ob
, DECL_ARGUMENTS (function
), true);
781 /* Output all the SSA names used in the function. */
782 output_ssa_names (ob
, fn
);
784 /* Output any exception handling regions. */
785 output_eh_regions (ob
, fn
);
787 /* Output DECL_INITIAL for the function, which contains the tree of
789 stream_write_tree (ob
, DECL_INITIAL (function
), true);
791 /* We will renumber the statements. The code that does this uses
792 the same ordering that we use for serializing them so we can use
793 the same code on the other end and not have to write out the
794 statement numbers. We do not assign UIDs to PHIs here because
795 virtual PHIs get re-computed on-the-fly which would make numbers
797 set_gimple_stmt_max_uid (cfun
, 0);
800 gimple_stmt_iterator gsi
;
801 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
803 gimple stmt
= gsi_stmt (gsi
);
804 gimple_set_uid (stmt
, inc_gimple_stmt_max_uid (cfun
));
808 /* Output the code for the function. */
809 FOR_ALL_BB_FN (bb
, fn
)
810 output_bb (ob
, bb
, fn
);
812 /* The terminator for this function. */
813 output_record_start (ob
, LTO_null
);
817 /* Create a section to hold the pickled output of this function. */
818 produce_asm (ob
, function
);
820 destroy_output_block (ob
);
822 current_function_decl
= NULL
;
827 /* Used to pass data to trivally_defined_alias callback. */
830 varpool_node_set vset
;
834 /* Return true if alias pair P belongs to the set of cgraph nodes in
835 SET. If P is a an alias for a VAR_DECL, it can always be emitted.
836 However, for FUNCTION_DECL aliases, we should only output the pair
837 if it belongs to a function whose cgraph node is in SET.
838 Otherwise, the LTRANS phase will get into trouble when finalizing
839 aliases because the alias will refer to a function not defined in
840 the file processed by LTRANS. */
843 trivally_defined_alias (tree decl ATTRIBUTE_UNUSED
,
844 tree target
, void *data
)
846 struct sets
*set
= (struct sets
*) data
;
847 struct cgraph_node
*fnode
= NULL
;
848 struct varpool_node
*vnode
= NULL
;
850 fnode
= cgraph_node_for_asm (target
);
852 return cgraph_node_in_set_p (fnode
, set
->set
);
853 vnode
= varpool_node_for_asm (target
);
854 return vnode
&& varpool_node_in_set_p (vnode
, set
->vset
);
857 /* Return true if alias pair P should be output in the current
858 partition contains cgrpah nodes SET and varpool nodes VSET.
859 DEFINED is set of all aliases whose targets are defined in
862 Normal aliases are output when they are defined, while WEAKREF
863 aliases are output when they are used. */
866 output_alias_pair_p (alias_pair
*p
, symbol_alias_set_t
*defined
,
867 cgraph_node_set set
, varpool_node_set vset
)
869 struct cgraph_node
*node
;
870 struct varpool_node
*vnode
;
872 if (lookup_attribute ("weakref", DECL_ATTRIBUTES (p
->decl
)))
874 if (TREE_CODE (p
->decl
) == VAR_DECL
)
876 vnode
= varpool_get_node (p
->decl
);
878 && referenced_from_this_partition_p (&vnode
->ref_list
, set
, vset
));
880 node
= cgraph_get_node (p
->decl
);
882 && (referenced_from_this_partition_p (&node
->ref_list
, set
, vset
)
883 || reachable_from_this_partition_p (node
, set
)));
886 return symbol_alias_set_contains (defined
, p
->decl
);
889 /* Output any unreferenced global symbol defined in SET, alias pairs
893 output_unreferenced_globals (cgraph_node_set set
, varpool_node_set vset
)
895 struct output_block
*ob
;
898 symbol_alias_set_t
*defined
;
904 ob
= create_output_block (LTO_section_static_initializer
);
905 ob
->cgraph_node
= NULL
;
907 clear_line_info (ob
);
909 /* Make string 0 be a NULL string. */
910 lto_output_1_stream (ob
->string_stream
, 0);
912 /* We really need to propagate in both directoins:
913 for normal aliases we propagate from first defined alias to
914 all aliases defined based on it. For weakrefs we propagate in
915 the oposite direction. */
916 defined
= propagate_aliases_backward (trivally_defined_alias
, &setdata
);
918 /* Emit the alias pairs for the nodes in SET. */
919 FOR_EACH_VEC_ELT (alias_pair
, alias_pairs
, i
, p
)
920 if (output_alias_pair_p (p
, defined
, set
, vset
))
922 stream_write_tree (ob
, p
->decl
, true);
923 stream_write_tree (ob
, p
->target
, true);
925 symbol_alias_set_destroy (defined
);
927 output_record_start (ob
, LTO_null
);
929 produce_asm (ob
, NULL
);
930 destroy_output_block (ob
);
934 /* Copy the function body of NODE without deserializing. */
937 copy_function (struct cgraph_node
*node
)
939 tree function
= node
->decl
;
940 struct lto_file_decl_data
*file_data
= node
->local
.lto_file_data
;
941 struct lto_output_stream
*output_stream
= XCNEW (struct lto_output_stream
);
944 const char *name
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (function
));
946 lto_get_section_name (LTO_section_function_body
, name
, NULL
);
948 struct lto_in_decl_state
*in_state
;
949 struct lto_out_decl_state
*out_state
= lto_get_out_decl_state ();
951 lto_begin_section (section_name
, !flag_wpa
);
954 /* We may have renamed the declaration, e.g., a static function. */
955 name
= lto_get_decl_name_mapping (file_data
, name
);
957 data
= lto_get_section_data (file_data
, LTO_section_function_body
,
961 /* Do a bit copy of the function body. */
962 lto_output_data_stream (output_stream
, data
, len
);
963 lto_write_stream (output_stream
);
967 lto_get_function_in_decl_state (node
->local
.lto_file_data
, function
);
968 gcc_assert (in_state
);
970 for (i
= 0; i
< LTO_N_DECL_STREAMS
; i
++)
972 size_t n
= in_state
->streams
[i
].size
;
973 tree
*trees
= in_state
->streams
[i
].trees
;
974 struct lto_tree_ref_encoder
*encoder
= &(out_state
->streams
[i
]);
976 /* The out state must have the same indices and the in state.
977 So just copy the vector. All the encoders in the in state
978 must be empty where we reach here. */
979 gcc_assert (lto_tree_ref_encoder_size (encoder
) == 0);
980 for (j
= 0; j
< n
; j
++)
981 VEC_safe_push (tree
, heap
, encoder
->trees
, trees
[j
]);
982 encoder
->next_index
= n
;
985 lto_free_section_data (file_data
, LTO_section_function_body
, name
,
987 free (output_stream
);
992 /* Main entry point from the pass manager. */
995 lto_output (cgraph_node_set set
, varpool_node_set vset
)
997 struct cgraph_node
*node
;
998 struct lto_out_decl_state
*decl_state
;
999 #ifdef ENABLE_CHECKING
1000 bitmap output
= lto_bitmap_alloc ();
1003 lto_cgraph_encoder_t encoder
= lto_get_out_decl_state ()->cgraph_node_encoder
;
1005 /* Initialize the streamer. */
1006 lto_streamer_init ();
1008 n_nodes
= lto_cgraph_encoder_size (encoder
);
1009 /* Process only the functions with bodies. */
1010 for (i
= 0; i
< n_nodes
; i
++)
1012 node
= lto_cgraph_encoder_deref (encoder
, i
);
1013 if (lto_cgraph_encoder_encode_body_p (encoder
, node
)
1015 && !node
->thunk
.thunk_p
)
1017 #ifdef ENABLE_CHECKING
1018 gcc_assert (!bitmap_bit_p (output
, DECL_UID (node
->decl
)));
1019 bitmap_set_bit (output
, DECL_UID (node
->decl
));
1021 decl_state
= lto_new_out_decl_state ();
1022 lto_push_out_decl_state (decl_state
);
1023 if (gimple_has_body_p (node
->decl
))
1024 output_function (node
);
1026 copy_function (node
);
1027 gcc_assert (lto_get_out_decl_state () == decl_state
);
1028 lto_pop_out_decl_state ();
1029 lto_record_function_out_decl_state (node
->decl
, decl_state
);
1033 /* Emit the callgraph after emitting function bodies. This needs to
1034 be done now to make sure that all the statements in every function
1035 have been renumbered so that edges can be associated with call
1036 statements using the statement UIDs. */
1037 output_cgraph (set
, vset
);
1039 #ifdef ENABLE_CHECKING
1040 lto_bitmap_free (output
);
1044 struct ipa_opt_pass_d pass_ipa_lto_gimple_out
=
1048 "lto_gimple_out", /* name */
1049 gate_lto_out
, /* gate */
1053 0, /* static_pass_number */
1054 TV_IPA_LTO_GIMPLE_OUT
, /* tv_id */
1055 0, /* properties_required */
1056 0, /* properties_provided */
1057 0, /* properties_destroyed */
1058 0, /* todo_flags_start */
1059 0 /* todo_flags_finish */
1061 NULL
, /* generate_summary */
1062 lto_output
, /* write_summary */
1063 NULL
, /* read_summary */
1064 lto_output
, /* write_optimization_summary */
1065 NULL
, /* read_optimization_summary */
1066 NULL
, /* stmt_fixup */
1068 NULL
, /* function_transform */
1069 NULL
/* variable_transform */
1073 /* Write each node in encoded by ENCODER to OB, as well as those reachable
1074 from it and required for correct representation of its semantics.
1075 Each node in ENCODER must be a global declaration or a type. A node
1076 is written only once, even if it appears multiple times in the
1077 vector. Certain transitively-reachable nodes, such as those
1078 representing expressions, may be duplicated, but such nodes
1079 must not appear in ENCODER itself. */
1082 write_global_stream (struct output_block
*ob
,
1083 struct lto_tree_ref_encoder
*encoder
)
1087 const size_t size
= lto_tree_ref_encoder_size (encoder
);
1089 for (index
= 0; index
< size
; index
++)
1091 t
= lto_tree_ref_encoder_get_tree (encoder
, index
);
1092 if (!lto_streamer_cache_lookup (ob
->writer_cache
, t
, NULL
))
1093 stream_write_tree (ob
, t
, false);
1098 /* Write a sequence of indices into the globals vector corresponding
1099 to the trees in ENCODER. These are used by the reader to map the
1100 indices used to refer to global entities within function bodies to
1104 write_global_references (struct output_block
*ob
,
1105 struct lto_output_stream
*ref_stream
,
1106 struct lto_tree_ref_encoder
*encoder
)
1110 const uint32_t size
= lto_tree_ref_encoder_size (encoder
);
1112 /* Write size as 32-bit unsigned. */
1113 lto_output_data_stream (ref_stream
, &size
, sizeof (int32_t));
1115 for (index
= 0; index
< size
; index
++)
1119 t
= lto_tree_ref_encoder_get_tree (encoder
, index
);
1120 lto_streamer_cache_lookup (ob
->writer_cache
, t
, &slot_num
);
1121 gcc_assert (slot_num
!= (unsigned)-1);
1122 lto_output_data_stream (ref_stream
, &slot_num
, sizeof slot_num
);
1127 /* Write all the streams in an lto_out_decl_state STATE using
1128 output block OB and output stream OUT_STREAM. */
1131 lto_output_decl_state_streams (struct output_block
*ob
,
1132 struct lto_out_decl_state
*state
)
1136 for (i
= 0; i
< LTO_N_DECL_STREAMS
; i
++)
1137 write_global_stream (ob
, &state
->streams
[i
]);
1141 /* Write all the references in an lto_out_decl_state STATE using
1142 output block OB and output stream OUT_STREAM. */
1145 lto_output_decl_state_refs (struct output_block
*ob
,
1146 struct lto_output_stream
*out_stream
,
1147 struct lto_out_decl_state
*state
)
1153 /* Write reference to FUNCTION_DECL. If there is not function,
1154 write reference to void_type_node. */
1155 decl
= (state
->fn_decl
) ? state
->fn_decl
: void_type_node
;
1156 lto_streamer_cache_lookup (ob
->writer_cache
, decl
, &ref
);
1157 gcc_assert (ref
!= (unsigned)-1);
1158 lto_output_data_stream (out_stream
, &ref
, sizeof (uint32_t));
1160 for (i
= 0; i
< LTO_N_DECL_STREAMS
; i
++)
1161 write_global_references (ob
, out_stream
, &state
->streams
[i
]);
1165 /* Return the written size of STATE. */
1168 lto_out_decl_state_written_size (struct lto_out_decl_state
*state
)
1173 size
= sizeof (int32_t); /* fn_ref. */
1174 for (i
= 0; i
< LTO_N_DECL_STREAMS
; i
++)
1176 size
+= sizeof (int32_t); /* vector size. */
1177 size
+= (lto_tree_ref_encoder_size (&state
->streams
[i
])
1178 * sizeof (int32_t));
1184 /* Write symbol T into STREAM in CACHE. SEEN specifies symbols we wrote
1188 write_symbol (struct lto_streamer_cache_d
*cache
,
1189 struct lto_output_stream
*stream
,
1190 tree t
, struct pointer_set_t
*seen
, bool alias
)
1193 enum gcc_plugin_symbol_kind kind
;
1194 enum gcc_plugin_symbol_visibility visibility
;
1200 /* None of the following kinds of symbols are needed in the
1202 if (!TREE_PUBLIC (t
)
1203 || is_builtin_fn (t
)
1204 || DECL_ABSTRACT (t
)
1205 || TREE_CODE (t
) == RESULT_DECL
)
1208 gcc_assert (TREE_CODE (t
) == VAR_DECL
1209 || TREE_CODE (t
) == FUNCTION_DECL
);
1211 name
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (t
));
1213 /* This behaves like assemble_name_raw in varasm.c, performing the
1214 same name manipulations that ASM_OUTPUT_LABELREF does. */
1215 name
= IDENTIFIER_POINTER ((*targetm
.asm_out
.mangle_assembler_name
) (name
));
1217 if (pointer_set_contains (seen
, name
))
1219 pointer_set_insert (seen
, name
);
1221 lto_streamer_cache_lookup (cache
, t
, &slot_num
);
1222 gcc_assert (slot_num
!= (unsigned)-1);
1224 if (DECL_EXTERNAL (t
))
1227 kind
= GCCPK_WEAKUNDEF
;
1234 kind
= GCCPK_WEAKDEF
;
1235 else if (DECL_COMMON (t
))
1236 kind
= GCCPK_COMMON
;
1240 /* When something is defined, it should have node attached. */
1241 gcc_assert (alias
|| TREE_CODE (t
) != VAR_DECL
1242 || varpool_get_node (t
)->finalized
);
1243 gcc_assert (alias
|| TREE_CODE (t
) != FUNCTION_DECL
1244 || (cgraph_get_node (t
)
1245 && cgraph_get_node (t
)->analyzed
));
1248 /* Imitate what default_elf_asm_output_external do.
1249 When symbol is external, we need to output it with DEFAULT visibility
1250 when compiling with -fvisibility=default, while with HIDDEN visibility
1251 when symbol has attribute (visibility("hidden")) specified.
1252 targetm.binds_local_p check DECL_VISIBILITY_SPECIFIED and gets this
1255 if (DECL_EXTERNAL (t
)
1256 && !targetm
.binds_local_p (t
))
1257 visibility
= GCCPV_DEFAULT
;
1259 switch (DECL_VISIBILITY(t
))
1261 case VISIBILITY_DEFAULT
:
1262 visibility
= GCCPV_DEFAULT
;
1264 case VISIBILITY_PROTECTED
:
1265 visibility
= GCCPV_PROTECTED
;
1267 case VISIBILITY_HIDDEN
:
1268 visibility
= GCCPV_HIDDEN
;
1270 case VISIBILITY_INTERNAL
:
1271 visibility
= GCCPV_INTERNAL
;
1275 if (kind
== GCCPK_COMMON
1277 && TREE_CODE (DECL_SIZE (t
)) == INTEGER_CST
)
1279 size
= (HOST_BITS_PER_WIDE_INT
>= 64)
1280 ? (uint64_t) int_size_in_bytes (TREE_TYPE (t
))
1281 : (((uint64_t) TREE_INT_CST_HIGH (DECL_SIZE_UNIT (t
))) << 32)
1282 | TREE_INT_CST_LOW (DECL_SIZE_UNIT (t
));
1287 if (DECL_ONE_ONLY (t
))
1288 comdat
= IDENTIFIER_POINTER (DECL_COMDAT_GROUP (t
));
1292 lto_output_data_stream (stream
, name
, strlen (name
) + 1);
1293 lto_output_data_stream (stream
, comdat
, strlen (comdat
) + 1);
1294 c
= (unsigned char) kind
;
1295 lto_output_data_stream (stream
, &c
, 1);
1296 c
= (unsigned char) visibility
;
1297 lto_output_data_stream (stream
, &c
, 1);
1298 lto_output_data_stream (stream
, &size
, 8);
1299 lto_output_data_stream (stream
, &slot_num
, 4);
1303 /* Write an IL symbol table to OB.
1304 SET and VSET are cgraph/varpool node sets we are outputting. */
1307 produce_symtab (struct output_block
*ob
,
1308 cgraph_node_set set
, varpool_node_set vset
)
1310 struct lto_streamer_cache_d
*cache
= ob
->writer_cache
;
1311 char *section_name
= lto_get_section_name (LTO_section_symtab
, NULL
, NULL
);
1312 struct pointer_set_t
*seen
;
1313 struct cgraph_node
*node
;
1314 struct varpool_node
*vnode
;
1315 struct lto_output_stream stream
;
1316 lto_varpool_encoder_t varpool_encoder
= ob
->decl_state
->varpool_node_encoder
;
1317 lto_cgraph_encoder_t encoder
= ob
->decl_state
->cgraph_node_encoder
;
1320 struct sets setdata
;
1321 symbol_alias_set_t
*defined
;
1324 setdata
.vset
= vset
;
1326 lto_begin_section (section_name
, false);
1327 free (section_name
);
1329 seen
= pointer_set_create ();
1330 memset (&stream
, 0, sizeof (stream
));
1332 /* Write all functions.
1333 First write all defined functions and then write all used functions.
1334 This is done so only to handle duplicated symbols in cgraph. */
1335 for (i
= 0; i
< lto_cgraph_encoder_size (encoder
); i
++)
1337 node
= lto_cgraph_encoder_deref (encoder
, i
);
1338 if (DECL_EXTERNAL (node
->decl
))
1340 if (DECL_COMDAT (node
->decl
)
1341 && cgraph_comdat_can_be_unshared_p (node
))
1343 if ((node
->alias
&& !node
->thunk
.alias
) || node
->global
.inlined_to
)
1345 write_symbol (cache
, &stream
, node
->decl
, seen
, false);
1347 for (i
= 0; i
< lto_cgraph_encoder_size (encoder
); i
++)
1349 node
= lto_cgraph_encoder_deref (encoder
, i
);
1350 if (!DECL_EXTERNAL (node
->decl
))
1352 if (DECL_COMDAT (node
->decl
)
1353 && cgraph_comdat_can_be_unshared_p (node
))
1355 if ((node
->alias
&& !node
->thunk
.alias
) || node
->global
.inlined_to
)
1357 write_symbol (cache
, &stream
, node
->decl
, seen
, false);
1360 /* Write all variables. */
1361 for (i
= 0; i
< lto_varpool_encoder_size (varpool_encoder
); i
++)
1363 vnode
= lto_varpool_encoder_deref (varpool_encoder
, i
);
1364 if (DECL_EXTERNAL (vnode
->decl
))
1366 /* COMDAT virtual tables can be unshared. Do not declare them
1367 in the LTO symbol table to prevent linker from forcing them
1369 if (DECL_COMDAT (vnode
->decl
)
1370 && !vnode
->force_output
1372 && DECL_VIRTUAL_P (vnode
->decl
))
1374 if (vnode
->alias
&& !vnode
->alias_of
)
1376 write_symbol (cache
, &stream
, vnode
->decl
, seen
, false);
1378 for (i
= 0; i
< lto_varpool_encoder_size (varpool_encoder
); i
++)
1380 vnode
= lto_varpool_encoder_deref (varpool_encoder
, i
);
1381 if (!DECL_EXTERNAL (vnode
->decl
))
1383 if (DECL_COMDAT (vnode
->decl
)
1384 && !vnode
->force_output
1386 && DECL_VIRTUAL_P (vnode
->decl
))
1388 if (vnode
->alias
&& !vnode
->alias_of
)
1390 write_symbol (cache
, &stream
, vnode
->decl
, seen
, false);
1393 /* Write all aliases. */
1394 defined
= propagate_aliases_backward (trivally_defined_alias
, &setdata
);
1395 FOR_EACH_VEC_ELT (alias_pair
, alias_pairs
, i
, p
)
1396 if (output_alias_pair_p (p
, defined
, set
, vset
))
1397 write_symbol (cache
, &stream
, p
->decl
, seen
, true);
1398 symbol_alias_set_destroy (defined
);
1400 lto_write_stream (&stream
);
1401 pointer_set_destroy (seen
);
1407 /* This pass is run after all of the functions are serialized and all
1408 of the IPA passes have written their serialized forms. This pass
1409 causes the vector of all of the global decls and types used from
1410 this file to be written in to a section that can then be read in to
1411 recover these on other side. */
1414 produce_asm_for_decls (cgraph_node_set set
, varpool_node_set vset
)
1416 struct lto_out_decl_state
*out_state
;
1417 struct lto_out_decl_state
*fn_out_state
;
1418 struct lto_decl_header header
;
1420 struct output_block
*ob
;
1421 struct lto_output_stream
*header_stream
, *decl_state_stream
;
1422 unsigned idx
, num_fns
;
1423 size_t decl_state_size
;
1424 int32_t num_decl_states
;
1426 ob
= create_output_block (LTO_section_decls
);
1429 /* Write out unreferenced globals, alias pairs and labels. We defer
1430 doing this until now so that we can write out only what is
1432 output_unreferenced_globals (set
, vset
);
1434 memset (&header
, 0, sizeof (struct lto_decl_header
));
1436 section_name
= lto_get_section_name (LTO_section_decls
, NULL
, NULL
);
1437 lto_begin_section (section_name
, !flag_wpa
);
1438 free (section_name
);
1440 /* Make string 0 be a NULL string. */
1441 lto_output_1_stream (ob
->string_stream
, 0);
1443 /* Write the global symbols. */
1444 out_state
= lto_get_out_decl_state ();
1445 num_fns
= VEC_length (lto_out_decl_state_ptr
, lto_function_decl_states
);
1446 lto_output_decl_state_streams (ob
, out_state
);
1447 for (idx
= 0; idx
< num_fns
; idx
++)
1450 VEC_index (lto_out_decl_state_ptr
, lto_function_decl_states
, idx
);
1451 lto_output_decl_state_streams (ob
, fn_out_state
);
1454 header
.lto_header
.major_version
= LTO_major_version
;
1455 header
.lto_header
.minor_version
= LTO_minor_version
;
1456 header
.lto_header
.section_type
= LTO_section_decls
;
1458 /* Currently not used. This field would allow us to preallocate
1459 the globals vector, so that it need not be resized as it is extended. */
1460 header
.num_nodes
= -1;
1462 /* Compute the total size of all decl out states. */
1463 decl_state_size
= sizeof (int32_t);
1464 decl_state_size
+= lto_out_decl_state_written_size (out_state
);
1465 for (idx
= 0; idx
< num_fns
; idx
++)
1468 VEC_index (lto_out_decl_state_ptr
, lto_function_decl_states
, idx
);
1469 decl_state_size
+= lto_out_decl_state_written_size (fn_out_state
);
1471 header
.decl_state_size
= decl_state_size
;
1473 header
.main_size
= ob
->main_stream
->total_size
;
1474 header
.string_size
= ob
->string_stream
->total_size
;
1476 header_stream
= XCNEW (struct lto_output_stream
);
1477 lto_output_data_stream (header_stream
, &header
, sizeof header
);
1478 lto_write_stream (header_stream
);
1479 free (header_stream
);
1481 /* Write the main out-decl state, followed by out-decl states of
1483 decl_state_stream
= ((struct lto_output_stream
*)
1484 xcalloc (1, sizeof (struct lto_output_stream
)));
1485 num_decl_states
= num_fns
+ 1;
1486 lto_output_data_stream (decl_state_stream
, &num_decl_states
,
1487 sizeof (num_decl_states
));
1488 lto_output_decl_state_refs (ob
, decl_state_stream
, out_state
);
1489 for (idx
= 0; idx
< num_fns
; idx
++)
1492 VEC_index (lto_out_decl_state_ptr
, lto_function_decl_states
, idx
);
1493 lto_output_decl_state_refs (ob
, decl_state_stream
, fn_out_state
);
1495 lto_write_stream (decl_state_stream
);
1496 free(decl_state_stream
);
1498 lto_write_stream (ob
->main_stream
);
1499 lto_write_stream (ob
->string_stream
);
1503 /* Write the symbol table. It is used by linker to determine dependencies
1504 and thus we can skip it for WPA. */
1506 produce_symtab (ob
, set
, vset
);
1508 /* Write command line opts. */
1509 lto_write_options ();
1511 /* Deallocate memory and clean up. */
1512 for (idx
= 0; idx
< num_fns
; idx
++)
1515 VEC_index (lto_out_decl_state_ptr
, lto_function_decl_states
, idx
);
1516 lto_delete_out_decl_state (fn_out_state
);
1518 lto_cgraph_encoder_delete (ob
->decl_state
->cgraph_node_encoder
);
1519 lto_varpool_encoder_delete (ob
->decl_state
->varpool_node_encoder
);
1520 VEC_free (lto_out_decl_state_ptr
, heap
, lto_function_decl_states
);
1521 lto_function_decl_states
= NULL
;
1522 destroy_output_block (ob
);
1526 struct ipa_opt_pass_d pass_ipa_lto_finish_out
=
1530 "lto_decls_out", /* name */
1531 gate_lto_out
, /* gate */
1535 0, /* static_pass_number */
1536 TV_IPA_LTO_DECL_OUT
, /* tv_id */
1537 0, /* properties_required */
1538 0, /* properties_provided */
1539 0, /* properties_destroyed */
1540 0, /* todo_flags_start */
1541 0 /* todo_flags_finish */
1543 NULL
, /* generate_summary */
1544 produce_asm_for_decls
, /* write_summary */
1545 NULL
, /* read_summary */
1546 produce_asm_for_decls
, /* write_optimization_summary */
1547 NULL
, /* read_optimization_summary */
1548 NULL
, /* stmt_fixup */
1550 NULL
, /* function_transform */
1551 NULL
/* variable_transform */