OSDN Git Service

2009-10-08 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Oct 2009 15:32:30 +0000 (15:32 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Oct 2009 15:32:30 +0000 (15:32 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152562 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/gimple.c
gcc/gimple.h
gcc/lto/ChangeLog
gcc/lto/lto.c

index 7d066da..11eb0f8 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-08  Richard Guenther  <rguenther@suse.de>
+
+       * gimple.c (free_gimple_type_tables): New function.
+       * gimple.h (free_gimple_type_tables): Declare.
+
 2009-10-07  Mark Heffernan  <meheff@google.com>
 
        * ipa-prop.c (ipa_print_node_params) Only print
index 481daf0..8835319 100644 (file)
@@ -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.  */
index e21d53f..3998bdf 100644 (file)
@@ -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);
index e88baf4..36241e8 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-08  Richard Guenther  <rguenther@suse.de>
+
+       * lto.c (read_cgraph_and_symbols): Free the gimple type merging
+       hash tables.
+
 2009-10-07  Joseph Myers  <joseph@codesourcery.com>
 
        * lto.c: Only include <sys/mman.h> if HAVE_MMAP_FILE.
index 504fe48..cc40091 100644 (file)
@@ -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)