diff options
author | dodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-17 09:59:52 +0000 |
---|---|---|
committer | dodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-17 09:59:52 +0000 |
commit | e77b8253aa187580c9e185461ed28c207e693126 (patch) | |
tree | e11866266cf98c8e56a5c72d6c5ab06707407dc8 /libcpp/include | |
parent | 62db153a9b1799e87fcc12393c34a4c9a1fa0ef5 (diff) | |
download | gcc-e77b8253aa187580c9e185461ed28c207e693126.tar.gz |
Add line map statistics to -fmem-report output
This patch adds statistics about line maps' memory consumption and
macro expansion to the output of -fmem-report. It has been useful in
trying to reduce the memory consumption of the macro maps support.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180085 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/include')
-rw-r--r-- | libcpp/include/line-map.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h index 04a523c2bfc..572e330a1bd 100644 --- a/libcpp/include/line-map.h +++ b/libcpp/include/line-map.h @@ -675,6 +675,27 @@ expanded_location linemap_expand_location_full (struct line_maps *, source_location loc, enum location_resolution_kind lrk); +/* Statistics about maps allocation and usage as returned by + linemap_get_statistics. */ +struct linemap_stats +{ + size_t num_ordinary_maps_allocated; + size_t num_ordinary_maps_used; + size_t ordinary_maps_allocated_size; + size_t ordinary_maps_used_size; + size_t num_expanded_macros; + size_t num_macro_tokens; + size_t num_macro_maps_used; + size_t macro_maps_allocated_size; + size_t macro_maps_used_size; + size_t macro_maps_locations_size; + size_t duplicated_macro_maps_locations_size; +}; + +/* Compute and return statistics about the memory consumption of some + parts of the line table SET. */ +void linemap_get_statistics (struct line_maps *, struct linemap_stats *); + /* Dump debugging information about source location LOC into the file stream STREAM. SET is the line map set LOC comes from. */ void linemap_dump_location (struct line_maps *, source_location, FILE *); |