Save some memory at debug stream-in time
authorRichard Biener <rguenther@suse.de>
Tue, 3 Nov 2020 11:28:03 +0000 (12:28 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 3 Nov 2020 13:51:39 +0000 (14:51 +0100)
This allows us to release references to BLOCKs by not keeping
them rooted in the external_die_map but instead remove it from
there as soon as we created the corresponding stub DIE.  For
decls it doesn't help since we still keep the decl_die_table.

2020-11-03  Richard Biener  <rguenther@suse.de>

* dwarf2out.c (maybe_create_die_with_external_ref): Remove
hashtable entry.

gcc/dwarf2out.c

index 534877babfbe5c0df67a266c753866e56797d84a..64ac94a8cbd0f9456c27ba5ce70fa6c6f9d1bd7a 100644 (file)
@@ -5974,6 +5974,7 @@ maybe_create_die_with_external_ref (tree decl)
 
   const char *sym = desc->sym;
   unsigned HOST_WIDE_INT off = desc->off;
+  external_die_map->remove (decl);
 
   in_lto_p = false;
   dw_die_ref die = (TREE_CODE (decl) == BLOCK