2017-09-12 07:05:20 +08:00
; RUN: llc -mtriple=x86_64-linux < %s -filetype=obj | llvm-dwarfdump -v -debug-info - | FileCheck %s
2011-11-12 09:57:54 +08:00
; test that we add DW_AT_inline even when we only have concrete out of line
; instances.
; first check that we have a TAG_subprogram at a given offset and it has
; AT_inline.
2014-03-07 09:19:31 +08:00
; CHECK: DW_TAG_class_type
; CHECK: DW_TAG_subprogram
2014-10-06 11:36:31 +08:00
; CHECK: DW_TAG_subprogram
2015-03-11 06:44:45 +08:00
; CHECK: DW_AT_linkage_name {{.*}} "_ZN12nsAutoRefCntaSEi"
2014-05-20 05:54:31 +08:00
2014-05-22 02:04:33 +08:00
; CHECK: DW_TAG_class_type
2014-10-06 11:36:31 +08:00
; CHECK: DW_TAG_subprogram
2015-03-11 06:44:45 +08:00
; CHECK: DW_AT_linkage_name {{.*}} "_ZN17nsAutoRefCnt7ReleaseEv"
2014-10-06 11:36:31 +08:00
; CHECK: DW_TAG_subprogram
; CHECK: DW_AT_name {{.*}} "~nsAutoRefCnt"
2014-05-22 02:04:33 +08:00
2014-10-06 11:36:31 +08:00
; CHECK: DW_TAG_subprogram
2015-10-07 08:04:16 +08:00
; CHECK-NEXT: DW_AT_decl_line {{.*}}18
2014-05-28 02:37:48 +08:00
; CHECK-NEXT: DW_AT_{{.*}}linkage_name {{.*}}D2
2014-10-06 11:36:31 +08:00
; CHECK-NEXT: DW_AT_specification {{.*}} "~nsAutoRefCnt"
2014-05-28 02:37:55 +08:00
; CHECK-NEXT: DW_AT_inline
2014-05-28 02:37:48 +08:00
; CHECK-NOT: DW_AT
; CHECK: DW_TAG
2014-10-06 11:36:31 +08:00
; CHECK: DW_TAG_subprogram
2015-10-07 08:04:16 +08:00
; CHECK-NEXT: DW_AT_decl_line {{.*}}18
2014-05-28 02:37:48 +08:00
; CHECK-NEXT: DW_AT_{{.*}}linkage_name {{.*}}D1
2014-10-06 11:36:31 +08:00
; CHECK-NEXT: DW_AT_specification {{.*}} "~nsAutoRefCnt"
2014-05-28 02:37:55 +08:00
; CHECK-NEXT: DW_AT_inline
2014-05-28 02:37:48 +08:00
; CHECK-NOT: DW_AT
; CHECK: [[D1_THIS_ABS:.*]]: DW_TAG_formal_parameter
2014-10-06 11:36:31 +08:00
; CHECK: DW_TAG_subprogram
; CHECK: DW_AT_specification {{.*}} "_ZN17nsAutoRefCnt7ReleaseEv"
2014-05-20 05:54:31 +08:00
; CHECK: DW_TAG_formal_parameter
; CHECK-NOT: NULL
; CHECK-NOT: DW_TAG
; CHECK: DW_TAG_inlined_subroutine
2014-10-06 11:36:31 +08:00
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN12nsAutoRefCntaSEi"
2014-05-20 05:54:31 +08:00
; CHECK-NOT: NULL
; CHECK-NOT: DW_TAG
; CHECK: DW_TAG_inlined_subroutine
2014-10-06 11:36:31 +08:00
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD1Ev"
2014-05-20 05:54:31 +08:00
; CHECK-NOT: NULL
; CHECK-NOT: DW_TAG
; CHECK: DW_TAG_inlined_subroutine
2014-10-06 11:36:31 +08:00
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD2Ev"
2011-11-12 09:57:54 +08:00
; and then that a TAG_subprogram refers to it with AT_abstract_origin.
2014-03-07 09:19:31 +08:00
; CHECK: DW_TAG_subprogram
2014-05-28 02:37:55 +08:00
; CHECK-NOT: DW_TAG
2014-10-06 11:36:31 +08:00
; CHECK: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD1Ev"
2014-05-20 05:54:31 +08:00
; CHECK: DW_TAG_formal_parameter
2014-05-28 02:37:55 +08:00
; CHECK-NOT: DW_TAG
2014-10-10 23:51:02 +08:00
; CHECK: DW_AT_abstract_origin {{.*}} {[[D1_THIS_ABS]]} "this"
2014-05-20 05:54:31 +08:00
; CHECK: DW_TAG_inlined_subroutine
2014-10-06 11:36:31 +08:00
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD2Ev"
2014-05-20 05:54:31 +08:00
2016-12-22 08:45:21 +08:00
source_filename = "test/DebugInfo/X86/concrete_out_of_line.ll"
2011-11-12 09:57:54 +08:00
2016-12-22 08:45:21 +08:00
define i32 @_ZN17nsAutoRefCnt7ReleaseEv ( ) !dbg !19 {
2011-11-12 09:57:54 +08:00
entry:
2016-12-22 08:45:21 +08:00
store i32 1 , i32 * null , align 4 , !dbg !32
tail call void @_Z8moz_freePv ( i8 * null ) #0 , !dbg !40
2011-11-12 09:57:54 +08:00
ret i32 0
}
2016-12-22 08:45:21 +08:00
define void @_ZN17nsAutoRefCntD1Ev ( ) !dbg !46 {
2011-11-12 09:57:54 +08:00
entry:
2016-12-22 08:45:21 +08:00
tail call void @_Z8moz_freePv ( i8 * null ) #0 , !dbg !49
2011-11-12 09:57:54 +08:00
ret void
}
declare void @_Z8moz_freePv ( i8 * )
2016-12-22 08:45:21 +08:00
attributes #0 = { nounwind }
2011-11-12 09:57:54 +08:00
!llvm.dbg.cu = ! { !0 }
2016-12-22 08:45:21 +08:00
!llvm.module.flags = ! { !18 }
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , file: !1 , producer: "clang version 3.1 ()" , isOptimized: true , runtimeVersion: 0 , emissionKind: F u l l D e b u g , enums: !2 , retainedTypes: !2 , globals: !3 , imports: !2 )
!1 = !DIFile ( filename: "nsAutoRefCnt.ii" , directory: "/Users/espindola/mozilla-central/obj-x86_64-apple-darwin11.2.0/netwerk/base/src" )
!2 = ! { }
!3 = ! { !4 }
2017-08-31 02:06:51 +08:00
!4 = !DIGlobalVariableExpression ( var: !5 , expr: !DIExpression ( ) )
2016-12-22 08:45:21 +08:00
!5 = !DIGlobalVariable ( name: "mRefCnt" , scope: null , file: !1 , line: 9 , type: !6 , isLocal: false , isDefinition: true )
!6 = !DICompositeType ( tag: D W _ T A G _ c l a s s _ type , name: "nsAutoRefCnt" , file: !1 , line: 2 , size: 32 , align: 32 , elements: !7 )
!7 = ! { !8 , !10 , !15 }
!8 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "mValue" , scope: !6 , file: !1 , line: 7 , baseType: !9 , size: 32 , align: 32 )
!9 = !DIBasicType ( name: "int" , size: 32 , align: 32 , encoding: D W _ A T E _ s i g n e d )
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
!10 = !DISubprogram ( name: "nsAutoRefCnt" , scope: !6 , file: !1 , line: 3 , type: !11 , isLocal: false , isDefinition: false , scopeLine: 3 , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , retainedNodes: !2 )
2016-12-22 08:45:21 +08:00
!11 = !DISubroutineType ( types: !12 )
!12 = ! { null , !13 }
!13 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , baseType: !14 , size: 64 , align: 64 , flags: D I F l a g A r t i f i c i a l )
!14 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "nsAutoRefCnt" , file: !1 , line: 2 , flags: D I F l a g F w d D e c l )
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
!15 = !DISubprogram ( name: "operator=" , linkageName: "_ZN12nsAutoRefCntaSEi" , scope: !6 , file: !1 , line: 4 , type: !16 , isLocal: false , isDefinition: false , scopeLine: 4 , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , retainedNodes: !2 )
2015-04-30 00:38:44 +08:00
!16 = !DISubroutineType ( types: !17 )
2016-12-22 08:45:21 +08:00
!17 = ! { !9 , !13 , !9 }
!18 = ! { i32 1 , !"Debug Info Version" , i32 3 }
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
!19 = distinct !DISubprogram ( name: "Release" , linkageName: "_ZN17nsAutoRefCnt7ReleaseEv" , scope: null , file: !1 , line: 14 , type: !20 , isLocal: false , isDefinition: true , scopeLine: 14 , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , unit: !0 , declaration: !24 , retainedNodes: !30 )
2016-12-22 08:45:21 +08:00
!20 = !DISubroutineType ( types: !21 )
!21 = ! { !9 , !22 }
!22 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , baseType: !23 , size: 64 , align: 64 , flags: D I F l a g A r t i f i c i a l )
!23 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "nsAutoRefCnt" , file: !1 , line: 10 , flags: D I F l a g F w d D e c l )
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
!24 = !DISubprogram ( name: "Release" , linkageName: "_ZN17nsAutoRefCnt7ReleaseEv" , scope: !25 , file: !1 , line: 11 , type: !20 , isLocal: false , isDefinition: false , scopeLine: 11 , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , retainedNodes: !2 )
2016-12-22 08:45:21 +08:00
!25 = !DICompositeType ( tag: D W _ T A G _ c l a s s _ type , name: "nsAutoRefCnt" , file: !1 , line: 10 , size: 8 , align: 8 , elements: !26 )
!26 = ! { !24 , !27 }
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
!27 = !DISubprogram ( name: "~nsAutoRefCnt" , scope: !25 , file: !1 , line: 12 , type: !28 , isLocal: false , isDefinition: false , scopeLine: 12 , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , retainedNodes: !2 )
2016-12-22 08:45:21 +08:00
!28 = !DISubroutineType ( types: !29 )
!29 = ! { null , !22 }
!30 = ! { !31 }
!31 = !DILocalVariable ( name: "this" , arg: 1 , scope: !19 , file: !1 , line: 14 , type: !22 , flags: D I F l a g A r t i f i c i a l )
!32 = !DILocation ( line: 5 , column: 5 , scope: !33 , inlinedAt: !38 )
!33 = distinct !DILexicalBlock ( scope: !34 , file: !1 , line: 4 , column: 29 )
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
!34 = distinct !DISubprogram ( name: "operator=" , linkageName: "_ZN12nsAutoRefCntaSEi" , scope: null , file: !1 , line: 4 , type: !16 , isLocal: false , isDefinition: true , scopeLine: 4 , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , unit: !0 , declaration: !15 , retainedNodes: !35 )
2016-12-22 08:45:21 +08:00
!35 = ! { !36 , !37 }
!36 = !DILocalVariable ( name: "this" , arg: 1 , scope: !34 , file: !1 , line: 4 , type: !13 , flags: D I F l a g A r t i f i c i a l )
!37 = !DILocalVariable ( name: "aValue" , arg: 2 , scope: !34 , file: !1 , line: 4 , type: !9 )
!38 = !DILocation ( line: 15 , scope: !39 )
!39 = distinct !DILexicalBlock ( scope: !19 , file: !1 , line: 14 , column: 34 )
!40 = !DILocation ( line: 19 , column: 3 , scope: !41 , inlinedAt: !45 )
!41 = distinct !DILexicalBlock ( scope: !42 , file: !1 , line: 18 , column: 41 )
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
!42 = distinct !DISubprogram ( name: "~nsAutoRefCnt" , linkageName: "_ZN17nsAutoRefCntD2Ev" , scope: null , file: !1 , line: 18 , type: !28 , isLocal: false , isDefinition: true , scopeLine: 18 , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , unit: !0 , declaration: !27 , retainedNodes: !43 )
2016-12-22 08:45:21 +08:00
!43 = ! { !44 }
!44 = !DILocalVariable ( name: "this" , arg: 1 , scope: !42 , file: !1 , line: 18 , type: !22 , flags: D I F l a g A r t i f i c i a l )
!45 = !DILocation ( line: 18 , column: 41 , scope: !46 , inlinedAt: !38 )
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
!46 = distinct !DISubprogram ( name: "~nsAutoRefCnt" , linkageName: "_ZN17nsAutoRefCntD1Ev" , scope: null , file: !1 , line: 18 , type: !28 , isLocal: false , isDefinition: true , scopeLine: 18 , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , unit: !0 , declaration: !27 , retainedNodes: !47 )
2016-12-22 08:45:21 +08:00
!47 = ! { !48 }
!48 = !DILocalVariable ( name: "this" , arg: 1 , scope: !46 , file: !1 , line: 18 , type: !22 , flags: D I F l a g A r t i f i c i a l )
!49 = !DILocation ( line: 19 , column: 3 , scope: !41 , inlinedAt: !50 )
!50 = !DILocation ( line: 18 , column: 41 , scope: !46 )