aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/DynamicLibrary.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2017-05-26 18:52:56 +0000
committerDavid Blaikie <dblaikie@gmail.com>2017-05-26 18:52:56 +0000
commit07963bd1d194af32a3065b170084da94ae8ec090 (patch)
treef546d1cd26cb9419ab49ef0a4f22af74d0e07481 /llvm/lib/Support/DynamicLibrary.cpp
parent7730b244480c4a2b12dc3bff9892bb989f8b3e9c (diff)
downloadllvm-07963bd1d194af32a3065b170084da94ae8ec090.zip
llvm-07963bd1d194af32a3065b170084da94ae8ec090.tar.gz
llvm-07963bd1d194af32a3065b170084da94ae8ec090.tar.bz2
DebugInfo: Do not emit empty CUs
Consistent with GCC and addresses a shortcoming with ThinLTO where many imported CUs may end up being empty (because the functions imported from them either ended up not being used (and were then discarded, since they're imported as available_externally) or optimized away entirely). Test cases previously testing empty CUs (either intentionally, or because they didn't need anything more complicated) had a trivial 'int' or similar basic type added to their retained types list. This is a first order approximation - a deeper implementation could do things like: 1) Be more lazy about construction of the CU - for example if two CUs containing a single identical retained type are linked together, with this change one of the two CUs will be produced but empty (since a duplicate type won't be produced). 2) Go further and invert all the CU links the same way the subprogram link is inverted - keep named CU lists of retained types, macros, etc, and have those link back to the CU. Then if they're emitted, the CU is emitted, but never otherwise - this would allow the metadata itself to be dropped earlier too, though it seems unlikely that's an important optimization as there shouldn't be many CUs relative to the number of other entities. llvm-svn: 304020
Diffstat (limited to 'llvm/lib/Support/DynamicLibrary.cpp')
0 files changed, 0 insertions, 0 deletions