diff options
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 7 | ||||
-rw-r--r-- | libcpp/include/line-map.h | 3 | ||||
-rw-r--r-- | libcpp/line-map.c | 15 |
3 files changed, 17 insertions, 8 deletions
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 |