From: Martin Liska Date: Wed, 10 Jun 2015 07:57:34 +0000 (+0200) Subject: Fix BITMAP identifier clash. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=643e0a30873598350e984f7391a2cbabb9f24706;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a73afaa6b28..3d97a8d08c3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,23 @@ +2015-06-10 Martin Liska + + 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 PR target/52144 diff --git a/gcc/alloc-pool.c b/gcc/alloc-pool.c index bdf184abe5f..7e25915ca6b 100644 --- a/gcc/alloc-pool.c +++ b/gcc/alloc-pool.c @@ -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); } diff --git a/gcc/alloc-pool.h b/gcc/alloc-pool.h index af3addefbb5..1785df5c2ce 100644 --- a/gcc/alloc-pool.h +++ b/gcc/alloc-pool.h @@ -232,7 +232,7 @@ pool_allocator::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. */ diff --git a/gcc/bitmap.c b/gcc/bitmap.c index d600aceb9ca..733c76727cd 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -30,7 +30,8 @@ mem_alloc_description 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 diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c index 6021c2a5a75..60d427f8f11 100644 --- a/gcc/ggc-common.c +++ b/gcc/ggc-common.c @@ -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); diff --git a/gcc/hash-map.h b/gcc/hash-map.h index f28f74fb03c..2f1bca4d950 100644 --- a/gcc/hash-map.h +++ b/gcc/hash-map.h @@ -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 diff --git a/gcc/hash-set.h b/gcc/hash-set.h index af91e315c2c..3ec0b1591d1 100644 --- a/gcc/hash-set.h +++ b/gcc/hash-set.h @@ -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. */ diff --git a/gcc/hash-table.c b/gcc/hash-table.c index 012b241906d..a42b884189d 100644 --- a/gcc/hash-table.c +++ b/gcc/hash-table.c @@ -103,7 +103,7 @@ mem_alloc_description 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); diff --git a/gcc/hash-table.h b/gcc/hash-table.h index 512f162163e..1b9322d2c54 100644 --- a/gcc/hash-table.h +++ b/gcc/hash-table.h @@ -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 (); - 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; } diff --git a/gcc/mem-stats-traits.h b/gcc/mem-stats-traits.h index f7843f2165f..5d270474fc4 100644 --- a/gcc/mem-stats-traits.h +++ b/gcc/mem-stats-traits.h @@ -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 }; diff --git a/gcc/vec.c b/gcc/vec.c index e0307dd461c..b6c31785cc4 100644 --- a/gcc/vec.c +++ b/gcc/vec.c @@ -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); }