summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo/X86/debug-loc-offset.ll
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/test/DebugInfo/X86/debug-loc-offset.ll
parent7730b244480c4a2b12dc3bff9892bb989f8b3e9c (diff)
downloadbcm5719-llvm-07963bd1d194af32a3065b170084da94ae8ec090.tar.gz
bcm5719-llvm-07963bd1d194af32a3065b170084da94ae8ec090.zip
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/test/DebugInfo/X86/debug-loc-offset.ll')
-rw-r--r--llvm/test/DebugInfo/X86/debug-loc-offset.ll8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/test/DebugInfo/X86/debug-loc-offset.ll b/llvm/test/DebugInfo/X86/debug-loc-offset.ll
index 8e3e1e97c31..8f2210e2c01 100644
--- a/llvm/test/DebugInfo/X86/debug-loc-offset.ll
+++ b/llvm/test/DebugInfo/X86/debug-loc-offset.ll
@@ -35,10 +35,6 @@
; CHECK: DW_AT_low_pc
; CHECK: DW_AT_high_pc
-; CHECK: DW_TAG_compile_unit
-; CHECK: DW_AT_low_pc
-; CHECK: DW_AT_high_pc
-
; CHECK: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_linkage_name [DW_FORM_strp]{{.*}}"_Z3baz1A"
@@ -53,6 +49,10 @@
; CHECK: DW_AT_location [DW_FORM_exprloc]
; CHECK-NOT: DW_AT_location
+; CHECK: DW_TAG_compile_unit
+; CHECK: DW_AT_low_pc
+; CHECK: DW_AT_high_pc
+
; CHECK: .debug_loc contents:
; CHECK: 0x00000000: Beginning address offset: 0x0000000000000000
; CHECK: Ending address offset: 0x0000000000000017
OpenPOWER on IntegriCloud