Commit Graph

8 Commits

Author SHA1 Message Date
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Trevor Saunders 76b6ddbfe2 destroy values as well as keys when removing them from hash maps
gcc/ChangeLog:

2015-11-24  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* hash-map-traits.h (simple_hashmap_traits ::remove): call
	destructors on values that are being removed.
	* mem-stats.h (hash_map): Pass type of values to
	simple_hashmap_traits.
	* tree-sra.c (sra_deinitialize): Remove work around for hash
	maps not destructing values.
	* genmatch.c (sinfo_hashmap_traits): Adjust.
	* tree-ssa-uncprop.c (val_ssa_equiv_hash_traits): Likewise.

From-SVN: r230801
2015-11-24 11:46:10 +00:00
Richard Sandiford fb5c464a86 hash-map-traits.h (simple_hashmap_traits::key_type): New typedef.
gcc/
	* hash-map-traits.h (simple_hashmap_traits::key_type): New typedef.
	(unbounded_int_hashmap_traits::key_type): Likewise.
	* hash-map.h (hash_map): Get the key type from the traits.
	* hash-traits.h (default_hash_traits): By default, inherit from the
	template parameter.
	* alias.c (alias_set_traits): Delete.
	(alias_set_entry_d::children): Use alias_set_hash as the first
	template parameter.
	(record_alias_subset): Update accordingly.
	* except.c (tree_hash_traits): Delete.
	(type_to_runtime_map): Use tree_hash as the first template parameter.
	(init_eh): Update accordingly.
	* genmatch.c (capture_id_map_hasher): Delete.
	(cid_map_t): Use nofree_string_hash as first template parameter.
	* ipa-icf.h (symbol_compare_hashmap_traits): Delete.
	* ipa-icf.c (sem_item_optimizer::subdivide_classes_by_sensitive_refs):
	Use symbol_compare_hash as the first template parameter in
	subdivide_hash_map.
	* mem-stats.h (mem_usage_pair::mem_alloc_hashmap_traits): Delete.
	(mem_usage_pair::mem_map_t): Use mem_location_hash as the first
	template parameter.
	* passes.c (pass_registry_hasher): Delete.
	(name_to_pass_map): Use nofree_string_hash as the first template
	parameter.
	(register_pass_name): Update accordingly.
	* sanopt.c (sanopt_tree_map_traits): Delete.
	(sanopt_tree_triplet_map_traits): Delete.
	(sanopt_ctx::asan_check_map): Use tree_operand_hash as the first
	template parameter.
	(sanopt_ctx::vptr_check_map): Use sanopt_tree_triplet_hash as
	the first template parameter.
	* sese.c (rename_map_hasher): Delete.
	(rename_map_type): Use tree_ssa_name_hash as the first template
	parameter.
	* symbol-summary.h (function_summary::summary_hashmap_traits): Delete.
	(function_summary::m_map): Use map_hash as the first template
	parameter.
	(function_summary::release): Update accordingly.
	* tree-if-conv.c (phi_args_hash_traits): Delete.
	(predicate_scalar_phi): Use tree_operand_hash as the first template
	parameter to phi_arg_map.
	* tree-inline.h (dependence_hasher): Delete.
	(copy_body_data::dependence_map): Use dependence_hash as the first
	template parameter.
	* tree-inline.c (remap_dependence_clique): Update accordingly.
	* tree-ssa-strlen.c (stridxlist_hash_traits): Delete.
	(decl_to_stridxlist_htab): Use tree_decl_hash as the first template
	parameter.
	(addr_stridxptr): Update accordingly.
	* value-prof.c (profile_id_traits): Delete.
	(cgraph_node_map): Use profile_id_hash as the first template
	parameter.
	(init_node_map): Update accordingly.
	* config/alpha/alpha.c (string_traits): Delete.
	(machine_function::links): Use nofree_string_hash as the first
	template parameter.
	(alpha_use_linkage, alpha_write_linkage): Update accordingly.
	* config/m32c/m32c.c (pragma_traits): Delete.
	(pragma_htab): Use nofree_string_hash as the first template parameter.
	(m32c_note_pragma_address): Update accordingly.
	* config/mep/mep.c (pragma_traits): Delete.
	(pragma_htab): Use nofree_string_hash as the first template parameter.
	(mep_note_pragma_flag): Update accordingly.
	* config/mips/mips.c (mips16_flip_traits): Delete.
	(mflip_mips16_htab): Use nofree_string_hash as the first template
	parameter.
	(mflip_mips16_use_mips16_p): Update accordingly.
	(local_alias_traits): Delete.
	(mips16_local_aliases): Use nofree_string_hash as the first template
	parameter.
	(mips16_local_alias): Update accordingly.

From-SVN: r224977
2015-06-25 17:17:20 +00:00
Richard Sandiford 203f2c4386 hash-map-traits.h (default_hashmap_traits): Delete.
gcc/
	* hash-map-traits.h (default_hashmap_traits): Delete.

From-SVN: r224976
2015-06-25 17:17:10 +00:00
Richard Sandiford 0ef08bc588 hash-map-traits.h (unbounded_hashmap_traits): New class.
gcc/
	* hash-map-traits.h (unbounded_hashmap_traits): New class.
	(unbounded_int_hashmap_traits): Likewise.
	* cfgexpand.c (part_traits): Use unbounded_int_hashmap_traits.

From-SVN: r224975
2015-06-25 17:16:59 +00:00
Richard Sandiford 4ef7b52a93 hash-map-traits.h: Include hash-traits.h.
gcc/
	* hash-map-traits.h: Include hash-traits.h.
	(simple_hashmap_traits): New class.
	* mem-stats.h (hash_map): Change the default traits to
	simple_hashmap_traits<default_hash_traits<Key> >.

From-SVN: r224966
2015-06-25 17:15:35 +00:00
Martin Liska 2d44c7dea7 New memory allocation statistics infrastructure.
* Makefile.in: Add additional dependencies related to memory report
	enhancement.
	* alloc-pool.c (allocate_pool_descriptor): Use new ctor.
	* bitmap.c (struct bitmap_descriptor_d): Remove.
	(struct loc): Likewise.
	(struct bitmap_desc_hasher): Likewise.
	(bitmap_desc_hasher::hash): Likewise.
	(bitmap_desc_hasher::equal): Likewise.
	(get_bitmap_descriptor): Likewise.
	(bitmap_register): User new memory descriptor API.
	(register_overhead): Likewise.
	(bitmap_find_bit): Register nsearches and search_iter statistics.
	(struct bitmap_output_info): Remove.
	(print_statistics): Likewise.
	(dump_bitmap_statistics): Use new memory descriptor.
	* bitmap.h (struct bitmap_usage): New class.
	* genmatch.c: Extend header file inclusion.
	* genpreds.c: Likewise.
	* ggc-common.c (struct ggc_usage): New class.
	(struct ggc_loc_desc_hasher): Remove.
	(ggc_loc_desc_hasher::hash): Likewise.
	(ggc_loc_desc_hasher::equal): Likewise.
	(struct ggc_ptr_hash_entry): Likewise.
	(struct ptr_hash_hasher): Likewise.
	(ptr_hash_hasher::hash): Likewise.
	(ptr_hash_hasher::equal): Likewise.
	(make_loc_descriptor): Likewise.
	(ggc_prune_ptr): Likewise.
	(dump_ggc_loc_statistics): Use new memory descriptor.
	(ggc_record_overhead): Likewise.
	(ggc_free_overhead): Likewise.
	(final_cmp_statistic): Remove.
	(cmp_statistic): Likewise.
	(ggc_add_statistics): Liekwise.
	(ggc_prune_overhead_list): Likewise.
	* hash-map-traits.h: New file.
	* hash-map.h (struct default_hashmap_traits): Move the traits to a
	separate header file.
	* hash-set.h: Pass memory statistics info to ctor.
	* hash-table.c (void dump_hash_table_loc_statistics): New function.
	* hash-table.h (hash_table::hash_table): Add new ctor arguments.
	(hash_table::~hash_table): Register memory release operation.
	(hash_table::alloc_entries): Handle memory allocation operation.
	(hash_table::expand): Likewise.
	* inchash.c (iterative_hash_hashval_t): Move implementation to header
	file.
	(iterative_hash_host_wide_int): Likewise.
	* inchash.h (class hash): Likewise.
	* mem-stats-traits.h: New file.
	* mem-stats.h: New file.
	(mem_location): Add new class.
	(mem_usage): Likewise.
	(mem_alloc_description): Likewise.
	* sese.c: Add new header file inclusision.
	* toplev.c (dump_memory_report): Add report for hash_table, hash_map
	and hash_set.
	* tree-sra.c: Add new header file inclusision.
	* vec.c (struct vec_descriptor): Remove.
	(hash_descriptor): Likewise.
	(struct vec_usage): Likewise.
	(struct ptr_hash_entry): Likewise.
	(hash_ptr): Likewise.
	(eq_ptr): Likewise.
	(vec_prefix::register_overhead): Use new memory descriptor API.
	(vec_prefix::release_overhead): Likewise.
	(add_statistics): Remove.
	(dump_vec_loc_statistics): Use new memory descriptor API.
	* vec.h (struct vec_prefix): Likewise.
	(va_heap::reserve): Likewise.
	(va_heap::release): Likewise.
	* emit-rtl.c (gen_raw_REG): Fix passing MEM_STAT.

From-SVN: r223748
2015-05-27 12:47:22 +00:00