flag_exceptions = 1;
init_eh ();
- /* Initialize dwarf2 tables. Since dwarf2out_do_frame() returns
- true only when exceptions are enabled, this initialization is
- never done during lang_dependent_init. */
-#if defined DWARF2_DEBUGGING_INFO || defined DWARF2_UNWIND_INFO
- if (dwarf2out_do_frame ())
- dwarf2out_frame_init ();
-#endif
-
eh_initialized_p = true;
}
else
bp_unpack_value (bp, 1);
TREE_ASM_WRITTEN (expr) = (unsigned) bp_unpack_value (bp, 1);
- TREE_NO_WARNING (expr) = (unsigned) bp_unpack_value (bp, 1);
+ if (TYPE_P (expr))
+ TYPE_ARTIFICIAL (expr) = (unsigned) bp_unpack_value (bp, 1);
+ else
+ TREE_NO_WARNING (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_USED (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_NOTHROW (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_STATIC (expr) = (unsigned) bp_unpack_value (bp, 1);
if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
unpack_ts_block_value_fields (bp, expr);
- if (CODE_CONTAINS_STRUCT (code, TS_SSA_NAME))
- {
- /* We only stream the version number of SSA names. */
- gcc_unreachable ();
- }
-
- if (CODE_CONTAINS_STRUCT (code, TS_STATEMENT_LIST))
- {
- /* This is only used by GENERIC. */
- gcc_unreachable ();
- }
-
- if (CODE_CONTAINS_STRUCT (code, TS_OMP_CLAUSE))
- {
- /* This is only used by High GIMPLE. */
- gcc_unreachable ();
- }
-
if (CODE_CONTAINS_STRUCT (code, TS_TRANSLATION_UNIT_DECL))
unpack_ts_translation_unit_decl_value_fields (bp, expr);
+
+ if (streamer_hooks.unpack_value_fields)
+ streamer_hooks.unpack_value_fields (bp, expr);
}
}
else
{
- /* All other nodes can be materialized with a raw make_node call. */
- result = make_node (code);
+ /* For all other nodes, see if the streamer knows how to allocate
+ it. */
+ if (streamer_hooks.alloc_tree)
+ result = streamer_hooks.alloc_tree (code, ib, data_in);
+
+ /* If the hook did not handle it, materialize the tree with a raw
+ make_node call. */
+ if (result == NULL_TREE)
+ result = make_node (code);
}
#ifdef LTO_STREAMER_DEBUG
{
DECL_SIZE (expr) = lto_input_tree (ib, data_in);
DECL_SIZE_UNIT (expr) = lto_input_tree (ib, data_in);
-
- if (TREE_CODE (expr) != FUNCTION_DECL
- && TREE_CODE (expr) != TRANSLATION_UNIT_DECL)
- DECL_INITIAL (expr) = lto_input_tree (ib, data_in);
-
DECL_ATTRIBUTES (expr) = lto_input_tree (ib, data_in);
+
/* Do not stream DECL_ABSTRACT_ORIGIN. We cannot handle debug information
for early inlining so drop it on the floor instead of ICEing in
dwarf2out.c. */
if (CODE_CONTAINS_STRUCT (code, TS_EXP))
lto_input_ts_exp_tree_pointers (ib, data_in, expr);
- if (CODE_CONTAINS_STRUCT (code, TS_SSA_NAME))
- {
- /* We only stream the version number of SSA names. */
- gcc_unreachable ();
- }
-
if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
lto_input_ts_block_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_BINFO))
lto_input_ts_binfo_tree_pointers (ib, data_in, expr);
- if (CODE_CONTAINS_STRUCT (code, TS_STATEMENT_LIST))
- {
- /* This should only appear in GENERIC. */
- gcc_unreachable ();
- }
-
if (CODE_CONTAINS_STRUCT (code, TS_CONSTRUCTOR))
lto_input_ts_constructor_tree_pointers (ib, data_in, expr);
- if (CODE_CONTAINS_STRUCT (code, TS_OMP_CLAUSE))
- {
- /* This should only appear in High GIMPLE. */
- gcc_unreachable ();
- }
-
- if (CODE_CONTAINS_STRUCT (code, TS_OPTIMIZATION))
- {
- sorry ("optimization options not supported yet");
- }
-
if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION))
lto_input_ts_target_option (ib, expr);
/* Read all the pointer fields in RESULT. */
lto_input_tree_pointers (ib, data_in, result);
+ /* Call back into the streaming module to read anything else it
+ may need. */
+ if (streamer_hooks.read_tree)
+ streamer_hooks.read_tree (ib, data_in, result);
+
/* We should never try to instantiate an MD or NORMAL builtin here. */
if (TREE_CODE (result) == FUNCTION_DECL)
gcc_assert (!lto_stream_as_builtin_p (result));
}
+/* LTO streamer hook for reading GIMPLE trees. IB and DATA_IN are as in
+ lto_read_tree. EXPR is the tree was materialized by lto_read_tree and
+ needs GIMPLE specific data to be filled in. */
+
+void
+lto_streamer_read_tree (struct lto_input_block *ib, struct data_in *data_in,
+ tree expr)
+{
+ if (DECL_P (expr)
+ && TREE_CODE (expr) != FUNCTION_DECL
+ && TREE_CODE (expr) != TRANSLATION_UNIT_DECL)
+ DECL_INITIAL (expr) = lto_input_tree (ib, data_in);
+}
+
+
/* Read and INTEGER_CST node from input block IB using the per-file
context in DATA_IN. */
/* Initialization for the LTO reader. */
void
-lto_init_reader (void)
+lto_reader_init (void)
{
lto_streamer_init ();
-
- memset (<o_stats, 0, sizeof (lto_stats));
- bitmap_obstack_initialize (NULL);
-
file_name_hash_table = htab_create (37, hash_string_slot_node,
eq_string_slot_node, free);
-
- gimple_register_cfg_hooks ();
}