diff options
author | Jan Hubicka <jh@suse.cz> | 2020-06-01 19:13:58 +0200 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2020-06-01 19:13:58 +0200 |
commit | 1746d5f3e67703a5b6a3a4fd8ca625672c321313 (patch) | |
tree | 2b7c8d15f9a4f9f337a6c2590329372375808e84 /gcc/lto-streamer-out.c | |
parent | 258059d91bd0e27cc335312f4558e1b339a2e77d (diff) | |
download | gcc-1746d5f3e67703a5b6a3a4fd8ca625672c321313.zip gcc-1746d5f3e67703a5b6a3a4fd8ca625672c321313.tar.gz gcc-1746d5f3e67703a5b6a3a4fd8ca625672c321313.tar.bz2 |
Cleanup global decl stream reference streaming, part 2
gcc/ChangeLog:
2020-06-01 Jan Hubicka <hubicka@ucw.cz>
* lto-streamer.h (enum LTO_tags): Remove LTO_field_decl_ref,
LTO_function_decl_ref, LTO_label_decl_ref, LTO_namespace_decl_ref,
LTO_result_decl_ref, LTO_type_decl_ref, LTO_type_ref,
LTO_const_decl_ref, LTO_imported_decl_ref,
LTO_translation_unit_decl_ref, LTO_global_decl_ref and
LTO_namelist_decl_ref; add LTO_global_stream_ref.
* lto-streamer-in.c (lto_input_tree_ref): Simplify.
(lto_input_scc): Update.
(lto_input_tree_1): Update.
* lto-streamer-out.c (lto_indexable_tree_ref): Simlify.
* lto-streamer.c (lto_tag_name): Update.
Diffstat (limited to 'gcc/lto-streamer-out.c')
-rw-r--r-- | gcc/lto-streamer-out.c | 76 |
1 files changed, 5 insertions, 71 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index a44ed00..dfc4603 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -252,84 +252,18 @@ static void lto_indexable_tree_ref (struct output_block *ob, tree expr, enum LTO_tags *tag, unsigned *index) { - enum tree_code code; - enum lto_decl_stream_e_t encoder; - gcc_checking_assert (tree_is_indexable (expr)); - if (TYPE_P (expr)) + if (TREE_CODE (expr) == SSA_NAME) { - *tag = LTO_type_ref; - encoder = LTO_DECL_STREAM; + *tag = LTO_ssa_name_ref; + *index = SSA_NAME_VERSION (expr); } else { - code = TREE_CODE (expr); - switch (code) - { - case SSA_NAME: - *tag = LTO_ssa_name_ref; - *index = SSA_NAME_VERSION (expr); - return; - break; - - case FIELD_DECL: - *tag = LTO_field_decl_ref; - encoder = LTO_DECL_STREAM; - break; - - case FUNCTION_DECL: - *tag = LTO_function_decl_ref; - encoder = LTO_DECL_STREAM; - break; - - case VAR_DECL: - case DEBUG_EXPR_DECL: - gcc_checking_assert (decl_function_context (expr) == NULL - || TREE_STATIC (expr)); - /* FALLTHRU */ - case PARM_DECL: - *tag = LTO_global_decl_ref; - encoder = LTO_DECL_STREAM; - break; - - case CONST_DECL: - *tag = LTO_const_decl_ref; - encoder = LTO_DECL_STREAM; - break; - - case TYPE_DECL: - *tag = LTO_type_decl_ref; - encoder = LTO_DECL_STREAM; - break; - - case NAMESPACE_DECL: - *tag = LTO_namespace_decl_ref; - encoder = LTO_DECL_STREAM; - break; - - case LABEL_DECL: - *tag = LTO_label_decl_ref; - encoder = LTO_DECL_STREAM; - break; - - case RESULT_DECL: - *tag = LTO_result_decl_ref; - encoder = LTO_DECL_STREAM; - break; - - case TRANSLATION_UNIT_DECL: - *tag = LTO_translation_unit_decl_ref; - encoder = LTO_DECL_STREAM; - break; - - default: - /* No other node is indexable, so it should have been handled by - lto_output_tree. */ - gcc_unreachable (); - } + *tag = LTO_global_stream_ref; + *index = lto_get_index (&ob->decl_state->streams[LTO_DECL_STREAM], expr); } - *index = lto_get_index (&ob->decl_state->streams[encoder], expr); } |