for variables in nested scopes (including inlined functions) if there is a
single location which covers the entire scope and the scope is contained in a
single block.
With this change there are still scenarios where we can, but do not, emit a
single location for a variable. Still, this change significantly reduces the
size of .debug_loc for a clang-3.4 build and reduces the size of the .debug_info
section slightly too.
Compiler vs section size *----------------------------------------------* | | trunk | patched | change | | | (bytes) | (bytes) | (%) | |-------------|-----------|-----------|--------| | .debug_loc | 152128993 | 104924892 | -31.03 | | .debug_info | 346249712 | 345249350 | -00.29 | | file size | 621497992 | 573304448 | -07.75 | *----------------------------------------------*
As @jmorse mentioned here [0], it would be nice to not have to linearly scan,
but I don't think that can be avoided right now.
Does this do the right thing if the scope is "interrupted" by another scope within MBB?