Add stats on adhoc table to dump_line_table_statistics
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 6 Nov 2015 18:40:56 +0000 (18:40 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Fri, 6 Nov 2015 18:40:56 +0000 (18:40 +0000)
gcc/ChangeLog:
* input.c (dump_line_table_statistics): Dump stats on adhoc table.

libcpp/ChangeLog:
* include/line-map.h (struct linemap_stats): Add fields
"adhoc_table_size" and "adhoc_table_entries_used".
* line-map.c (linemap_get_statistics): Populate above fields.

From-SVN: r229873

gcc/ChangeLog
gcc/input.c
libcpp/ChangeLog
libcpp/include/line-map.h
libcpp/line-map.c

index 64388a4d2f96d14883139288e34487b9227508fe..77bc7395ccea9ef7d9995f0fcd0059f367fe8d4d 100644 (file)
@@ -1,3 +1,7 @@
+2015-11-06  David Malcolm  <dmalcolm@redhat.com>
+
+       * input.c (dump_line_table_statistics): Dump stats on adhoc table.
+
 2015-11-07  Jan Hubicka  <hubicka@ucw.cz>
 
        * tree-core.h (size_type_kind): Remove OEP_CONSTANT_ADDRESS_OF and
index e7302a425897369e8d405467ffd9191b6ca9a62b..ff80dd9708a09cc877f924b237ed67ed31842218 100644 (file)
@@ -866,6 +866,12 @@ dump_line_table_statistics (void)
   fprintf (stderr, "Total used maps size:                %5ld%c\n",
            SCALE (total_used_map_size),
            STAT_LABEL (total_used_map_size));
+  fprintf (stderr, "Ad-hoc table size:                   %5ld%c\n",
+          SCALE (s.adhoc_table_size),
+          STAT_LABEL (s.adhoc_table_size));
+  fprintf (stderr, "Ad-hoc table entries used:           %5ld\n",
+          s.adhoc_table_entries_used);
+
   fprintf (stderr, "\n");
 }
 
index f2ce57abebd881c24c4bf81f53d12517b18f4021..8abf6ddfaa4f6675d0ac5c9f3f2c8252284a5598 100644 (file)
@@ -1,3 +1,9 @@
+2015-11-06  David Malcolm  <dmalcolm@redhat.com>
+
+       * include/line-map.h (struct linemap_stats): Add fields
+       "adhoc_table_size" and "adhoc_table_entries_used".
+       * line-map.c (linemap_get_statistics): Populate above fields.
+
 2015-11-04  Mikhail Maltsev  <maltsevm@gmail.com>
 
        * config.in: Regenerate.
index e5867edf4e837e9fe013a177b5a0d707364c827d..c8618a970e1e5f507f39a9f88da073b897c5196c 100644 (file)
@@ -1143,6 +1143,8 @@ struct linemap_stats
   long macro_maps_used_size;
   long macro_maps_locations_size;
   long duplicated_macro_maps_locations_size;
+  long adhoc_table_size;
+  long adhoc_table_entries_used;
 };
 
 /* Return the highest location emitted for a given file for which
index 3d82e9bfca94e9b8ca3deac99d5e41588074d452..84403de9c77035e95c463b340bea687a4c4f8c05 100644 (file)
@@ -1712,6 +1712,9 @@ linemap_get_statistics (struct line_maps *set,
   s->macro_maps_used_size = macro_maps_used_size;
   s->duplicated_macro_maps_locations_size =
     duplicated_macro_maps_locations_size;
+  s->adhoc_table_size = (set->location_adhoc_data_map.allocated
+                        * sizeof (struct location_adhoc_data));
+  s->adhoc_table_entries_used = set->location_adhoc_data_map.curr_loc;
 }