aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2022-06-24 05:57:42 -0700
committerNathan Sidwell <nathan@acm.org>2022-07-05 08:08:50 -0700
commit069f46c71e9432eda3d48a366e5c2a750cf8d612 (patch)
tree3c3b3c58a1773b04d170446a6e991122d0701351 /gcc/ada/gcc-interface
parent07dd0f7ba27d1fe9f0ce5b049ac5735dc5d361ad (diff)
downloadgcc-069f46c71e9432eda3d48a366e5c2a750cf8d612.zip
gcc-069f46c71e9432eda3d48a366e5c2a750cf8d612.tar.gz
gcc-069f46c71e9432eda3d48a366e5c2a750cf8d612.tar.bz2
c++: Prune ordinary locations
Like macro locations, we only need to emit ordinary location information for locations emitted into the CMI. This adds a hash table noting which ordinary lines are needed. These are then sorted and (sufficiently) adjacent lines are coalesced to a single map. There is a tradeoff here, allowing greater separation reduces the number of line maps, but increases the number of locations. It appears allowing 2 or 3 intervening lines is the sweet spot, and this patch chooses 2. Compiling a hello-world #includeing <iostream> in it's GMF gives a reduction in number of locations of 5 fold, but an increase in number of maps about 4 fold. Examining one of the xtreme-header tests we halve the number of locations and increase the number of maps by 9 fold. Module interfaces that emit no entities (or macros, if a header-unit), will now have no location tables. gcc/cp/ * module.cc (struct ord_loc_info, ord_loc_traits): New. (ord_loc_tabke, ord_loc_remap): New globals. (struct location_map_info): Delete. (struct module_state_config): Rename ordinary_loc_align to loc_range_bits. (module_for_ordinary_loc): Adjust. (module_state::note_location): Note ordinary locations, return bool. (module_state::write_location): Adjust ordinary location streaming. (module_state::read_location): Likewise. (module_state::write_init_maps): Allocate ord_loc_table. (module_state::write_prepare_maps): Reimplement ordinary map preparation. (module_state::read_prepare_maps): Adjust. (module_state::write_ordinary_maps): Reimplement. (module_state::write_macro_maps): Adjust. (module_state::read_ordinary_maps): Reimplement. (module_state::write_macros): Adjust. (module_state::write_config): Adjust. (module_state::read_config): Adjust. (module_state::write_begin): Adjust. (module_state::read_initial): Adjust. gcc/testsuite/ * g++.dg/modules/loc-prune-1.C: Adjust. * g++.dg/modules/loc-prune-4.C: New. * g++.dg/modules/pr98718_a.C: Adjust. * g++.dg/modules/pr98718_b.C: Adjust. * g++.dg/modules/pr99072.H: Adjust.
Diffstat (limited to 'gcc/ada/gcc-interface')
0 files changed, 0 insertions, 0 deletions