diff options
author | Tom Tromey <tromey@redhat.com> | 2011-10-17 09:59:52 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@gcc.gnu.org> | 2011-10-17 11:59:52 +0200 |
commit | 64a1a422dba4b0c09ad38310e32a223f2e16ed9d (patch) | |
tree | e11866266cf98c8e56a5c72d6c5ab06707407dc8 /libcpp/include/line-map.h | |
parent | 847e697a240e6d30335335c62084743978fa2084 (diff) | |
download | gcc-64a1a422dba4b0c09ad38310e32a223f2e16ed9d.zip gcc-64a1a422dba4b0c09ad38310e32a223f2e16ed9d.tar.gz gcc-64a1a422dba4b0c09ad38310e32a223f2e16ed9d.tar.bz2 |
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.
Co-Authored-By: Dodji Seketeli <dodji@redhat.com>
From-SVN: r180085
Diffstat (limited to 'libcpp/include/line-map.h')
-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 04a523c..572e330 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 *); |