mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-22 12:33:33 +02:00
8572946bd5
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
33 lines
1.2 KiB
LLVM
33 lines
1.2 KiB
LLVM
; REQUIRES: object-emission
|
|
|
|
; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump - | FileCheck %s
|
|
; RUN: %llc_dwarf -split-dwarf-file=foo.dwo < %s -filetype=obj | llvm-dwarfdump - | FileCheck --check-prefix=FISSION %s
|
|
|
|
; darwin has a workaround for a linker bug so it always emits one line table entry
|
|
; XFAIL: darwin
|
|
|
|
; Expect no line table entry since there are no functions and file references in this compile unit
|
|
; CHECK: .debug_line contents:
|
|
; CHECK: Line table prologue:
|
|
; CHECK: total_length: 0x00000019
|
|
; CHECK-NOT: file_names[
|
|
|
|
; CHECK: .debug_pubnames contents:
|
|
; CHECK-NOT: {{^}}0x
|
|
|
|
; CHECK: contents:
|
|
|
|
; Don't emit DW_AT_addr_base when there are no addresses.
|
|
; FISSION-NOT: DW_AT_GNU_addr_base [DW_FORM_sec_offset]
|
|
|
|
!llvm.dbg.cu = !{!0}
|
|
!llvm.module.flags = !{!5}
|
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 143523)", isOptimized: true, emissionKind: FullDebug, file: !4, enums: !2, retainedTypes: !6, globals: !2)
|
|
!2 = !{}
|
|
!3 = !DIFile(filename: "empty.c", directory: "/home/nlewycky")
|
|
!4 = !DIFile(filename: "empty.c", directory: "/home/nlewycky")
|
|
!5 = !{i32 1, !"Debug Info Version", i32 3}
|
|
!6 = !{!7}
|
|
!7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|