diff options
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/toplev.c | 1 | ||||
-rw-r--r-- | libcpp/ChangeLog | 7 | ||||
-rw-r--r-- | libcpp/include/line-map.h | 3 | ||||
-rw-r--r-- | libcpp/line-map.c | 15 |
5 files changed, 22 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9f1ddc7b562..f44656fac3c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-10-25 David Malcolm <dmalcolm@redhat.com> + + * toplev.c (toplev::main): Remove call to + location_adhoc_data_fini. + 2016-10-25 Eric Botcazou <ebotcazou@adacore.com> * tree.h (wi::fits_to_tree_p): Accept only 0 and 1 for boolean types. diff --git a/gcc/toplev.c b/gcc/toplev.c index 1df80d04442..59b84eb4d4b 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2169,7 +2169,6 @@ toplev::main (int argc, char **argv) diagnostic_finish (global_dc); finalize_plugins (); - location_adhoc_data_fini (line_table); after_memory_report = true; diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 87dae8496e2..5ff0aad08f8 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,10 @@ +2016-10-25 David Malcolm <dmalcolm@redhat.com> + + * include/line-map.h (line_maps::~line_maps): New dtor. + (location_adhoc_data_fini): Delete decl. + * line-map.c (line_maps::~line_maps): New dtor. + (location_adhoc_data_fini): Delete. + 2016-10-21 Andris Pavenis <andris.pavenis@iki.fi> PR preprocessor/71681 diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h index 8be98b5f597..b61c3cc0d2c 100644 --- a/libcpp/include/line-map.h +++ b/libcpp/include/line-map.h @@ -699,6 +699,8 @@ struct GTY(()) location_adhoc_data_map { /* A set of chronological line_map structures. */ struct GTY(()) line_maps { + + ~line_maps (); maps_info_ordinary info_ordinary; @@ -977,7 +979,6 @@ LINEMAPS_LAST_ALLOCATED_MACRO_MAP (const line_maps *set) return (line_map_macro *)LINEMAPS_LAST_ALLOCATED_MAP (set, true); } -extern void location_adhoc_data_fini (struct line_maps *); extern source_location get_combined_adhoc_loc (struct line_maps *, source_location, source_range, diff --git a/libcpp/line-map.c b/libcpp/line-map.c index c5c42f0966b..c98ee45965a 100644 --- a/libcpp/line-map.c +++ b/libcpp/line-map.c @@ -57,6 +57,14 @@ static source_location linemap_macro_loc_to_exp_point (struct line_maps *, extern unsigned num_expanded_macros_counter; extern unsigned num_macro_tokens_counter; +/* Destructor for class line_maps. + Ensure non-GC-managed memory is released. */ + +line_maps::~line_maps () +{ + htab_delete (location_adhoc_data_map.htab); +} + /* Hash function for location_adhoc_data hashtable. */ static hashval_t @@ -333,13 +341,6 @@ get_pure_location (line_maps *set, source_location loc) return loc & ~((1 << ordmap->m_range_bits) - 1); } -/* Finalize the location_adhoc_data structure. */ -void -location_adhoc_data_fini (struct line_maps *set) -{ - htab_delete (set->location_adhoc_data_map.htab); -} - /* Initialize a line map set. */ void |