Fix BITMAP identifier clash.

PR bootstrap/66471
	* mem-stats-traits.h (enum mem_alloc_origin): Add _ORIGIN suffix for
	all enum values in mem_alloc_origin.
	* alloc-pool.c (dump_alloc_pool_statistics): Use newly changed enum
	name.
	* alloc-pool.h (pool_allocator::pool_allocator): Likewise.
	* bitmap.c (bitmap_register): Likewise.
	(dump_bitmap_statistics): Likewise.
	* ggc-common.c (dump_ggc_loc_statistics): Likewise.
	(ggc_record_overhead): Likewise.
	* hash-map.h: Likewise.
	* hash-set.h: Likewise.
	* hash-table.c (void dump_hash_table_loc_statistics): Likewise.
	* hash-table.h: Likewise.
	* vec.c (vec_prefix::register_overhead): Likewise.
	(vec_prefix::release_overhead): Likewise.
	(dump_vec_loc_statistics): Likewise.

From-SVN: r224315
This commit is contained in:
Martin Liska 2015-06-10 09:57:34 +02:00 committed by Martin Liska
parent d5524d521e
commit 643e0a3087
11 changed files with 44 additions and 21 deletions

View File

@ -1,3 +1,23 @@
2015-06-10 Martin Liska <mliska@suse.cz>
PR bootstrap/66471
* mem-stats-traits.h (enum mem_alloc_origin): Add _ORIGIN suffix for
all enum values in mem_alloc_origin.
* alloc-pool.c (dump_alloc_pool_statistics): Use newly changed enum
name.
* alloc-pool.h (pool_allocator::pool_allocator): Likewise.
* bitmap.c (bitmap_register): Likewise.
(dump_bitmap_statistics): Likewise.
* ggc-common.c (dump_ggc_loc_statistics): Likewise.
(ggc_record_overhead): Likewise.
* hash-map.h: Likewise.
* hash-set.h: Likewise.
* hash-table.c (void dump_hash_table_loc_statistics): Likewise.
* hash-table.h: Likewise.
* vec.c (vec_prefix::register_overhead): Likewise.
(vec_prefix::release_overhead): Likewise.
(dump_vec_loc_statistics): Likewise.
2015-06-09 Christian Bruel <christian.bruel@st.com>
PR target/52144

View File

@ -33,5 +33,5 @@ dump_alloc_pool_statistics (void)
if (! GATHER_STATISTICS)
return;
pool_allocator_usage.dump (ALLOC_POOL);
pool_allocator_usage.dump (ALLOC_POOL_ORIGIN);
}

View File

@ -232,7 +232,7 @@ pool_allocator<T>::pool_allocator (const char *name, size_t num,
m_elts_free (0), m_blocks_allocated (0), m_block_list (NULL),
m_block_size (0), m_ignore_type_size (ignore_type_size),
m_extra_size (extra_size), m_initialized (false),
m_location (ALLOC_POOL, false PASS_MEM_STAT) {}
m_location (ALLOC_POOL_ORIGIN, false PASS_MEM_STAT) {}
/* Initialize a pool allocator. */

View File

@ -30,7 +30,8 @@ mem_alloc_description<bitmap_usage> bitmap_mem_desc;
void
bitmap_register (bitmap b MEM_STAT_DECL)
{
bitmap_mem_desc.register_descriptor (b, BITMAP, false FINAL_PASS_MEM_STAT);
bitmap_mem_desc.register_descriptor (b, BITMAP_ORIGIN, false
FINAL_PASS_MEM_STAT);
}
/* Account the overhead. */
@ -2076,7 +2077,7 @@ dump_bitmap_statistics (void)
if (! GATHER_STATISTICS)
return;
bitmap_mem_desc.dump (BITMAP);
bitmap_mem_desc.dump (BITMAP_ORIGIN);
}
DEBUG_FUNCTION void

View File

@ -977,7 +977,7 @@ dump_ggc_loc_statistics (bool final)
ggc_force_collect = true;
ggc_collect ();
ggc_mem_desc.dump (GGC, final ? ggc_usage::compare_final : NULL);
ggc_mem_desc.dump (GGC_ORIGIN, final ? ggc_usage::compare_final : NULL);
ggc_force_collect = false;
}
@ -986,7 +986,7 @@ dump_ggc_loc_statistics (bool final)
void
ggc_record_overhead (size_t allocated, size_t overhead, void *ptr MEM_STAT_DECL)
{
ggc_usage *usage = ggc_mem_desc.register_descriptor (ptr, GGC, false
ggc_usage *usage = ggc_mem_desc.register_descriptor (ptr, GGC_ORIGIN, false
FINAL_PASS_MEM_STAT);
ggc_mem_desc.register_object_overhead (usage, allocated + overhead, ptr);

View File

@ -107,7 +107,7 @@ class GTY((user)) hash_map
public:
explicit hash_map (size_t n = 13, bool ggc = false,
bool gather_mem_stats = true CXX_MEM_STAT_INFO)
: m_table (n, ggc, gather_mem_stats, HASH_MAP PASS_MEM_STAT) {}
: m_table (n, ggc, gather_mem_stats, HASH_MAP_ORIGIN PASS_MEM_STAT) {}
/* Create a hash_map in ggc memory. */
static hash_map *create_ggc (size_t size, bool gather_mem_stats = true

View File

@ -179,7 +179,7 @@ class hash_set
public:
explicit hash_set (size_t n = 13, bool ggc = false CXX_MEM_STAT_INFO)
: m_table (n, ggc, true, HASH_SET PASS_MEM_STAT) {}
: m_table (n, ggc, true, HASH_SET_ORIGIN PASS_MEM_STAT) {}
/* Create a hash_set in gc memory with space for at least n elements. */

View File

@ -103,7 +103,7 @@ mem_alloc_description<mem_usage> hash_table_usage;
/* Support function for statistics. */
void dump_hash_table_loc_statistics (void)
{
for (unsigned i = HASH_TABLE; i <= HASH_SET; i++)
for (unsigned i = HASH_TABLE_ORIGIN; i <= HASH_SET_ORIGIN; i++)
{
mem_alloc_origin origin = (mem_alloc_origin) i;
hash_table_usage.dump (origin);

View File

@ -590,7 +590,7 @@ class hash_table
public:
explicit hash_table (size_t, bool ggc = false, bool gather_mem_stats = true,
mem_alloc_origin origin = HASH_TABLE
mem_alloc_origin origin = HASH_TABLE_ORIGIN
CXX_MEM_STAT_INFO);
~hash_table ();
@ -600,7 +600,7 @@ public:
create_ggc (size_t n CXX_MEM_STAT_INFO)
{
hash_table *table = ggc_alloc<hash_table> ();
new (table) hash_table (n, true, true, HASH_TABLE PASS_MEM_STAT);
new (table) hash_table (n, true, true, HASH_TABLE_ORIGIN PASS_MEM_STAT);
return table;
}

View File

@ -4,13 +4,13 @@
/* Memory allocation origin. */
enum mem_alloc_origin
{
HASH_TABLE,
HASH_MAP,
HASH_SET,
VEC,
BITMAP,
GGC,
ALLOC_POOL,
HASH_TABLE_ORIGIN,
HASH_MAP_ORIGIN,
HASH_SET_ORIGIN,
VEC_ORIGIN,
BITMAP_ORIGIN,
GGC_ORIGIN,
ALLOC_POOL_ORIGIN,
MEM_ALLOC_ORIGIN_LENGTH
};

View File

@ -136,7 +136,8 @@ void
vec_prefix::register_overhead (void *ptr, size_t size, size_t elements
MEM_STAT_DECL)
{
vec_mem_desc.register_descriptor (ptr, VEC, false FINAL_PASS_MEM_STAT);
vec_mem_desc.register_descriptor (ptr, VEC_ORIGIN, false
FINAL_PASS_MEM_STAT);
vec_usage *usage = vec_mem_desc.register_instance_overhead (size, ptr);
usage->m_items += elements;
if (usage->m_items_peak < usage->m_items)
@ -150,7 +151,8 @@ vec_prefix::release_overhead (void *ptr, size_t size, bool in_dtor
MEM_STAT_DECL)
{
if (!vec_mem_desc.contains_descriptor_for_instance (ptr))
vec_mem_desc.register_descriptor (ptr, VEC, false FINAL_PASS_MEM_STAT);
vec_mem_desc.register_descriptor (ptr, VEC_ORIGIN,
false FINAL_PASS_MEM_STAT);
vec_mem_desc.release_instance_overhead (ptr, size, in_dtor);
}
@ -185,5 +187,5 @@ vec_prefix::calculate_allocation_1 (unsigned alloc, unsigned desired)
void
dump_vec_loc_statistics (void)
{
vec_mem_desc.dump (VEC);
vec_mem_desc.dump (VEC_ORIGIN);
}