From: Richard Guenther Date: Thu, 8 Oct 2009 15:32:30 +0000 (+0000) Subject: gimple.c (free_gimple_type_tables): New function. X-Git-Tag: releases/gcc-4.5.0~3034 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0d0bfe1795ba93c2af0fca2ca68a025c5cd4c82b;p=thirdparty%2Fgcc.git gimple.c (free_gimple_type_tables): New function. 2009-10-08 Richard Guenther * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7d066da25413..11eb0f80ba10 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-10-08 Richard Guenther + + * gimple.c (free_gimple_type_tables): New function. + * gimple.h (free_gimple_type_tables): Declare. + 2009-10-07 Mark Heffernan * ipa-prop.c (ipa_print_node_params) Only print diff --git a/gcc/gimple.c b/gcc/gimple.c index 481daf0ed991..88353196f9c5 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. */ diff --git a/gcc/gimple.h b/gcc/gimple.h index e21d53fcb3ca..3998bdfe03e8 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -919,6 +919,7 @@ extern void gimple_force_type_merge (tree, tree); extern int gimple_types_compatible_p (tree, tree); extern tree gimple_register_type (tree); extern void print_gimple_types_stats (void); +extern void free_gimple_type_tables (void); extern tree gimple_unsigned_type (tree); extern tree gimple_signed_type (tree); extern alias_set_type gimple_get_alias_set (tree); diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index e88baf4dd6c7..36241e86006f 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,8 @@ +2009-10-08 Richard Guenther + + * lto.c (read_cgraph_and_symbols): Free the gimple type merging + hash tables. + 2009-10-07 Joseph Myers * lto.c: Only include if HAVE_MMAP_FILE. diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 504fe48e7533..cc4009172725 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -1844,6 +1844,9 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) /* Fixup all decls and types. */ lto_fixup_decls (all_file_decl_data); + /* Free the type hash tables. */ + free_gimple_type_tables (); + /* FIXME lto. This loop needs to be changed to use the pass manager to call the ipa passes directly. */ if (!errorcount)