aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-10-08 15:32:30 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-10-08 15:32:30 +0000
commit0d0bfe1795ba93c2af0fca2ca68a025c5cd4c82b (patch)
tree3e20298dac5f4c3479c3718ecbb1a22f63f8e5b3 /gcc/gimple.c
parent90e1a3493092a41db18dc3ba5ced7814ca37af15 (diff)
downloadgcc-0d0bfe1795ba93c2af0fca2ca68a025c5cd4c82b.zip
gcc-0d0bfe1795ba93c2af0fca2ca68a025c5cd4c82b.tar.gz
gcc-0d0bfe1795ba93c2af0fca2ca68a025c5cd4c82b.tar.bz2
gimple.c (free_gimple_type_tables): New function.
2009-10-08 Richard Guenther <rguenther@suse.de> * gimple.c (free_gimple_type_tables): New function. * gimple.h (free_gimple_type_tables): Declare. lto/ * lto.c (read_cgraph_and_symbols): Free the gimple type merging hash tables. From-SVN: r152562
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r--gcc/gimple.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 481daf0..8835319 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -3899,8 +3899,8 @@ print_gimple_types_stats (void)
else
fprintf (stderr, "GIMPLE type table is empty\n");
if (gtc_visited)
- fprintf (stderr, "GIMPLE type comparison table: size %ld, %ld elements, "
- "%ld searches, %ld collisions (ratio: %f)\n",
+ fprintf (stderr, "GIMPLE type comparison table: size %ld, %ld "
+ "elements, %ld searches, %ld collisions (ratio: %f)\n",
(long) htab_size (gtc_visited),
(long) htab_elements (gtc_visited),
(long) gtc_visited->searches,
@@ -3910,6 +3910,32 @@ print_gimple_types_stats (void)
fprintf (stderr, "GIMPLE type comparison table is empty\n");
}
+/* Free the gimple type hashtables used for LTO type merging. */
+
+void
+free_gimple_type_tables (void)
+{
+ /* Last chance to print stats for the tables. */
+ if (flag_lto_report)
+ print_gimple_types_stats ();
+
+ if (gimple_types)
+ {
+ htab_delete (gimple_types);
+ gimple_types = NULL;
+ }
+ if (type_hash_cache)
+ {
+ pointer_map_destroy (type_hash_cache);
+ type_hash_cache = NULL;
+ }
+ if (gtc_visited)
+ {
+ htab_delete (gtc_visited);
+ gtc_visited = NULL;
+ }
+}
+
/* Return a type the same as TYPE except unsigned or
signed according to UNSIGNEDP. */