From 32d76803130708a3580616e18dbf32406ff8c53a Mon Sep 17 00:00:00 2001 From: rguenth Date: Tue, 18 Jun 2013 14:39:57 +0000 Subject: 2013-06-18 Richard Biener * Makefile.in (LTO_STREAMER_H): Add pointer-set.h dependency. * lto-streamer.h: Include pointer-set.h. (struct lto_decl_slot): Remove. (struct lto_tree_ref_encoder): Make tree_hash_table a pointer-map. Remove next_index entry. (lto_hash_decl_slot_node, lto_eq_decl_slot_node, lto_hash_type_slot_node, lto_eq_type_slot_node): Remove. (lto_init_tree_ref_encoder): Adjust. (lto_destroy_tree_ref_encoder): Likewise. * lto-section-out.c (lto_hash_decl_slot_node, lto_eq_decl_slot_node, lto_hash_type_slot_node, lto_eq_type_slot_node): Remove. (lto_output_decl_index): Adjust. (lto_new_out_decl_state): Likewise. (lto_record_function_out_decl_state): Likewise. * lto-streamer-out.c (copy_function): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200171 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/lto-streamer.h | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'gcc/lto-streamer.h') diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h index 58a7f580dff..a3e2918f6f3 100644 --- a/gcc/lto-streamer.h +++ b/gcc/lto-streamer.h @@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see #include "alloc-pool.h" #include "gcov-io.h" #include "diagnostic.h" +#include "pointer-set.h" /* Define when debugging the LTO streamer. This causes the writer to output the numeric value for the memory address of the tree node @@ -474,21 +475,12 @@ struct GTY(()) lto_tree_ref_table }; -/* Mapping between trees and slots in an array. */ -struct lto_decl_slot -{ - tree t; - int slot_num; -}; - - /* The lto_tree_ref_encoder struct is used to encode trees into indices. */ struct lto_tree_ref_encoder { - htab_t tree_hash_table; /* Maps pointers to indices. */ - unsigned int next_index; /* Next available index. */ - vec trees; /* Maps indices to pointers. */ + pointer_map_t *tree_hash_table; /* Maps pointers to indices. */ + vec trees; /* Maps indices to pointers. */ }; @@ -788,10 +780,6 @@ extern void lto_value_range_error (const char *, HOST_WIDE_INT) ATTRIBUTE_NORETURN; /* In lto-section-out.c */ -extern hashval_t lto_hash_decl_slot_node (const void *); -extern int lto_eq_decl_slot_node (const void *, const void *); -extern hashval_t lto_hash_type_slot_node (const void *); -extern int lto_eq_type_slot_node (const void *, const void *); extern void lto_begin_section (const char *, bool); extern void lto_end_section (void); extern void lto_write_stream (struct lto_output_stream *); @@ -1007,11 +995,9 @@ lto_tag_check_range (enum LTO_tags actual, enum LTO_tags tag1, /* Initialize an lto_out_decl_buffer ENCODER. */ static inline void -lto_init_tree_ref_encoder (struct lto_tree_ref_encoder *encoder, - htab_hash hash_fn, htab_eq eq_fn) +lto_init_tree_ref_encoder (struct lto_tree_ref_encoder *encoder) { - encoder->tree_hash_table = htab_create (37, hash_fn, eq_fn, free); - encoder->next_index = 0; + encoder->tree_hash_table = pointer_map_create (); encoder->trees.create (0); } @@ -1023,7 +1009,7 @@ lto_destroy_tree_ref_encoder (struct lto_tree_ref_encoder *encoder) { /* Hash table may be delete already. */ if (encoder->tree_hash_table) - htab_delete (encoder->tree_hash_table); + pointer_map_destroy (encoder->tree_hash_table); encoder->trees.release (); } -- cgit v1.2.1