mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-27 00:15:58 +00:00

Currently each Function points to a DISubprogram and DISubprogram has a scope field. For member functions the scope is a DICompositeType. DIScopes point to the DICompileUnit to facilitate type uniquing. Distinct DISubprograms (with isDefinition: true) are not part of the type hierarchy and cannot be uniqued. This change removes the subprograms list from DICompileUnit and instead adds a pointer to the owning compile unit to distinct DISubprograms. This would make it easy for ThinLTO to strip unneeded DISubprograms and their transitively referenced debug info. Motivation ---------- Materializing DISubprograms is currently the most expensive operation when doing a ThinLTO build of clang. We want the DISubprogram to be stored in a separate Bitcode block (or the same block as the function body) so we can avoid having to expensively deserialize all DISubprograms together with the global metadata. If a function has been inlined into another subprogram we need to store a reference the block containing the inlined subprogram. Attached to https://llvm.org/bugs/show_bug.cgi?id=27284 is a python script that updates LLVM IR testcases to the new format. http://reviews.llvm.org/D19034 <rdar://problem/25256815> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266446 91177308-0d34-0410-b5e6-96231b3b80d8
45 lines
1.9 KiB
LLVM
45 lines
1.9 KiB
LLVM
; RUN: %llc_dwarf -filetype=obj -mattr=+vfp2 -float-abi=hard < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
|
|
; RUN: %llc_dwarf -filetype=obj -mattr=-vfp2 -float-abi=soft < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
|
|
; REQUIRES: object-emission
|
|
|
|
; Generated by clang -O1 -g from the following C source:
|
|
; float foo(float p) {
|
|
; return p;
|
|
; }
|
|
|
|
; When using the soft-float calling convention, we have to look through a
|
|
; bitcast to find the register which contains the argument.
|
|
|
|
; CHECK: 0x{{[0-9a-f]*}}: DW_TAG_formal_parameter
|
|
; CHECK-NEXT: DW_AT_location
|
|
|
|
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
|
|
target triple = "armv7--none-eabi"
|
|
|
|
define float @foo(float %p) !dbg !4 {
|
|
entry:
|
|
tail call void @llvm.dbg.value(metadata float %p, i64 0, metadata !9, metadata !15), !dbg !16
|
|
ret float %p, !dbg !18
|
|
}
|
|
|
|
declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
|
|
|
|
!llvm.dbg.cu = !{!0}
|
|
!llvm.module.flags = !{!10, !11}
|
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
|
|
!1 = !DIFile(filename: "test.c", directory: "")
|
|
!2 = !{}
|
|
!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !8)
|
|
!5 = !DISubroutineType(types: !6)
|
|
!6 = !{!7, !7}
|
|
!7 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float)
|
|
!8 = !{!9}
|
|
!9 = !DILocalVariable(name: "p", arg: 1, scope: !4, file: !1, line: 1, type: !7)
|
|
!10 = !{i32 2, !"Dwarf Version", i32 4}
|
|
!11 = !{i32 2, !"Debug Info Version", i32 3}
|
|
!15 = !DIExpression()
|
|
!16 = !DILocation(line: 1, column: 17, scope: !4)
|
|
!17 = !DILocation(line: 2, column: 12, scope: !4)
|
|
!18 = !DILocation(line: 2, column: 3, scope: !4)
|