2013-06-19 23:55:13 +02:00
; REQUIRES: object-emission
;
2018-10-29 21:10:42 +01:00
; RUN: llc -mtriple=x86_64-unknown-linux-gnu -O0 -filetype=obj %s -o - | llvm-dwarfdump -v -debug-info - | FileCheck %s
2013-06-19 23:55:13 +02:00
; Test case derived from compiling the following source with clang -g:
;
; namespace pr14763 {
; struct foo {
; foo(const foo&);
; };
;
; foo func(foo f) {
; return f; // reference 'f' for now because otherwise we hit another bug
; }
2013-06-20 02:25:24 +02:00
;
; void sink(void*);
;
; void func2(bool b, foo g) {
; if (b)
; sink(&g); // reference 'f' for now because otherwise we hit another bug
; }
2013-06-19 23:55:13 +02:00
; }
; CHECK: debug_info contents
[dwarfdump] Pretty print location expressions and location lists
Summary:
Based on Fred's patch here: https://reviews.llvm.org/D6771
I can't seem to commandeer the old review, so I'm creating a new one.
With that change the locations exrpessions are pretty printed inline in the
DIE tree. The output looks like this for debug_loc entries:
DW_AT_location [DW_FORM_data4] (0x00000000
0x0000000000000001 - 0x000000000000000b: DW_OP_consts +3
0x000000000000000b - 0x0000000000000012: DW_OP_consts +7
0x0000000000000012 - 0x000000000000001b: DW_OP_reg0 RAX, DW_OP_piece 0x4
0x000000000000001b - 0x0000000000000024: DW_OP_breg5 RDI+0)
And like this for debug_loc.dwo entries:
DW_AT_location [DW_FORM_sec_offset] (0x00000000
Addr idx 2 (w/ length 190): DW_OP_consts +0, DW_OP_stack_value
Addr idx 3 (w/ length 23): DW_OP_reg0 RAX, DW_OP_piece 0x4)
Simple locations without ranges are printed inline:
DW_AT_location [DW_FORM_block1] (DW_OP_reg4 RSI, DW_OP_piece 0x4, DW_OP_bit_piece 0x20 0x0)
The debug_loc(.dwo) dumping in changed accordingly to factor the code.
Reviewers: dblaikie, aprantl, friss
Subscribers: mgorny, javed.absar, hiraditya, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D37123
llvm-svn: 312042
2017-08-29 23:41:21 +02:00
; The parameter is accessed indirectly (with a zero offset) from the second
; register parameter. RDI is consumed by 'sret'.
; CHECK: DW_TAG_subprogram
; CHECK: DW_AT_name{{.*}} = "func"
; CHECK: DW_TAG_formal_parameter
2018-10-06 00:00:13 +02:00
; CHECK: DW_AT_location {{.*}}
; CHECK-NEXT: DW_OP_breg4 RSI+0, DW_OP_deref
2014-06-14 00:18:23 +02:00
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name{{.*}} = "f"
[dwarfdump] Pretty print location expressions and location lists
Summary:
Based on Fred's patch here: https://reviews.llvm.org/D6771
I can't seem to commandeer the old review, so I'm creating a new one.
With that change the locations exrpessions are pretty printed inline in the
DIE tree. The output looks like this for debug_loc entries:
DW_AT_location [DW_FORM_data4] (0x00000000
0x0000000000000001 - 0x000000000000000b: DW_OP_consts +3
0x000000000000000b - 0x0000000000000012: DW_OP_consts +7
0x0000000000000012 - 0x000000000000001b: DW_OP_reg0 RAX, DW_OP_piece 0x4
0x000000000000001b - 0x0000000000000024: DW_OP_breg5 RDI+0)
And like this for debug_loc.dwo entries:
DW_AT_location [DW_FORM_sec_offset] (0x00000000
Addr idx 2 (w/ length 190): DW_OP_consts +0, DW_OP_stack_value
Addr idx 3 (w/ length 23): DW_OP_reg0 RAX, DW_OP_piece 0x4)
Simple locations without ranges are printed inline:
DW_AT_location [DW_FORM_block1] (DW_OP_reg4 RSI, DW_OP_piece 0x4, DW_OP_bit_piece 0x20 0x0)
The debug_loc(.dwo) dumping in changed accordingly to factor the code.
Reviewers: dblaikie, aprantl, friss
Subscribers: mgorny, javed.absar, hiraditya, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D37123
llvm-svn: 312042
2017-08-29 23:41:21 +02:00
; CHECK: DW_TAG_subprogram
; CHECK: DW_AT_name{{.*}} = "func2"
; CHECK: DW_TAG_formal_parameter
; CHECK: DW_AT_location{{.*}}(DW_OP_fbreg +23)
; CHECK: DW_TAG_formal_parameter
; CHECK: DW_AT_location{{.*}}(
; CHECK-NEXT: {{.*}}: DW_OP_breg4 RSI+0, DW_OP_deref
; CHECK-NEXT: {{.*}}: DW_OP_breg7 RSP+8, DW_OP_deref, DW_OP_deref)
2014-06-14 00:18:23 +02:00
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name{{.*}} = "g"
2013-06-19 23:55:13 +02:00
%"struct.pr14763::foo" = type { i8 }
; Function Attrs: uwtable
2015-11-05 23:03:56 +01:00
define void @_ZN7pr147634funcENS_3fooE ( %"struct.pr14763::foo" * noalias sret %agg.result , %"struct.pr14763::foo" * %f ) #0 !dbg !4 {
2013-06-19 23:55:13 +02:00
entry:
2015-04-29 18:38:44 +02:00
call void @llvm.dbg.declare ( metadata %"struct.pr14763::foo" * %f , metadata !22 , metadata !DIExpression ( D W _ O P _ d e r e f ) ) , !dbg !24
2013-06-20 02:25:24 +02:00
call void @_ZN7pr147633fooC1ERKS0_ ( %"struct.pr14763::foo" * %agg.result , %"struct.pr14763::foo" * %f ) , !dbg !25
ret void , !dbg !25
2013-06-19 23:55:13 +02:00
}
; Function Attrs: nounwind readnone
Move the complex address expression out of DIVariable and into an extra
argument of the llvm.dbg.declare/llvm.dbg.value intrinsics.
Previously, DIVariable was a variable-length field that has an optional
reference to a Metadata array consisting of a variable number of
complex address expressions. In the case of OpPiece expressions this is
wasting a lot of storage in IR, because when an aggregate type is, e.g.,
SROA'd into all of its n individual members, the IR will contain n copies
of the DIVariable, all alike, only differing in the complex address
reference at the end.
By making the complex address into an extra argument of the
dbg.value/dbg.declare intrinsics, all of the pieces can reference the
same variable and the complex address expressions can be uniqued across
the CU, too.
Down the road, this will allow us to move other flags, such as
"indirection" out of the DIVariable, too.
The new intrinsics look like this:
declare void @llvm.dbg.declare(metadata %storage, metadata %var, metadata %expr)
declare void @llvm.dbg.value(metadata %storage, i64 %offset, metadata %var, metadata %expr)
This patch adds a new LLVM-local tag to DIExpressions, so we can detect
and pretty-print DIExpression metadata nodes.
What this patch doesn't do:
This patch does not touch the "Indirect" field in DIVariable; but moving
that into the expression would be a natural next step.
http://reviews.llvm.org/D4919
rdar://problem/17994491
Thanks to dblaikie and dexonsmith for reviewing this patch!
Note: I accidentally committed a bogus older version of this patch previously.
llvm-svn: 218787
2014-10-01 20:55:02 +02:00
declare void @llvm.dbg.declare ( metadata , metadata , metadata ) #1
2013-06-19 23:55:13 +02:00
declare void @_ZN7pr147633fooC1ERKS0_ ( %"struct.pr14763::foo" * , %"struct.pr14763::foo" * ) #2
2013-06-20 02:25:24 +02:00
; Function Attrs: uwtable
2015-11-05 23:03:56 +01:00
define void @_ZN7pr147635func2EbNS_3fooE ( i1 zeroext %b , %"struct.pr14763::foo" * %g ) #0 !dbg !17 {
2013-06-20 02:25:24 +02:00
entry:
%b.addr = alloca i8 , align 1
%frombool = zext i1 %b to i8
store i8 %frombool , i8 * %b.addr , align 1
2015-04-29 18:38:44 +02:00
call void @llvm.dbg.declare ( metadata i8 * %b.addr , metadata !26 , metadata !DIExpression ( ) ) , !dbg !27
call void @llvm.dbg.declare ( metadata %"struct.pr14763::foo" * %g , metadata !28 , metadata !DIExpression ( D W _ O P _ d e r e f ) ) , !dbg !27
2015-02-27 22:17:42 +01:00
%0 = load i8 , i8 * %b.addr , align 1 , !dbg !29
2013-06-20 02:25:24 +02:00
%tobool = trunc i8 %0 to i1 , !dbg !29
br i1 %tobool , label %if.then , label %if.end , !dbg !29
if.then: ; preds = %entry
%1 = bitcast %"struct.pr14763::foo" * %g to i8 * , !dbg !31
call void @_ZN7pr147634sinkEPv ( i8 * %1 ) , !dbg !31
br label %if.end , !dbg !31
if.end: ; preds = %if.then, %entry
ret void , !dbg !32
}
2017-06-17 00:40:04 +02:00
declare void @_ZN7pr147634sinkEPv ( i8 * )
2013-06-20 02:25:24 +02:00
2017-06-17 00:40:04 +02:00
attributes #0 = { uwtable }
2013-06-19 23:55:13 +02:00
attributes #1 = { nounwind readnone }
!llvm.dbg.cu = ! { !0 }
2013-11-22 22:49:45 +01:00
!llvm.module.flags = ! { !21 , !33 }
2013-06-19 23:55:13 +02:00
2016-04-15 17:57:41 +02:00
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , producer: "clang version 3.4 " , isOptimized: false , emissionKind: F u l l D e b u g , file: !1 , enums: !2 , retainedTypes: !2 , globals: !2 , imports: !2 )
2015-04-29 18:38:44 +02:00
!1 = !DIFile ( filename: "pass.cpp" , directory: "/tmp" )
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-15 20:07:53 +01:00
!2 = ! { }
[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 04:40:45 +02:00
!4 = distinct !DISubprogram ( name: "func" , linkageName: "_ZN7pr147634funcENS_3fooE" , line: 6 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false , unit: !0 , scopeLine: 6 , file: !1 , scope: !5 , type: !6 , retainedNodes: !2 )
2017-04-29 00:25:46 +02:00
!5 = !DINamespace ( name: "pr14763" , scope: null )
2015-04-29 18:38:44 +02:00
!6 = !DISubroutineType ( types: !7 )
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-15 20:07:53 +01:00
!7 = ! { !8 , !8 }
2015-04-29 18:38:44 +02:00
!8 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "foo" , line: 2 , size: 8 , align: 8 , file: !1 , scope: !5 , elements: !9 )
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-15 20:07:53 +01:00
!9 = ! { !10 }
2015-04-29 18:38:44 +02:00
!10 = !DISubprogram ( name: "foo" , line: 3 , isLocal: false , isDefinition: false , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false , scopeLine: 3 , file: !1 , scope: !8 , type: !11 )
!11 = !DISubroutineType ( types: !12 )
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-15 20:07:53 +01:00
!12 = ! { null , !13 , !14 }
2015-04-29 18:38:44 +02:00
!13 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , align: 64 , flags: D I F l a g A r t i f i c i a l | D I F l a g O b j e c t P o i n t e r , baseType: !8 )
!14 = !DIDerivedType ( tag: D W _ T A G _ r e f e r e n c e _ type , baseType: !15 )
!15 = !DIDerivedType ( tag: D W _ T A G _ c o n s t _ type , baseType: !8 )
[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 04:40:45 +02:00
!17 = distinct !DISubprogram ( name: "func2" , linkageName: "_ZN7pr147635func2EbNS_3fooE" , line: 12 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false , unit: !0 , scopeLine: 12 , file: !1 , scope: !5 , type: !18 , retainedNodes: !2 )
2015-04-29 18:38:44 +02:00
!18 = !DISubroutineType ( types: !19 )
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-15 20:07:53 +01:00
!19 = ! { null , !20 , !8 }
2015-04-29 18:38:44 +02:00
!20 = !DIBasicType ( tag: D W _ T A G _ b a s e _ type , name: "bool" , size: 8 , align: 8 , encoding: D W _ A T E _ b o o l e a n )
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-15 20:07:53 +01:00
!21 = ! { i32 2 , !"Dwarf Version" , i32 3 }
2015-07-31 20:58:39 +02:00
!22 = !DILocalVariable ( name: "f" , line: 6 , arg: 1 , scope: !4 , file: !23 , type: !8 )
2015-04-29 18:38:44 +02:00
!23 = !DIFile ( filename: "pass.cpp" , directory: "/tmp" )
!24 = !DILocation ( line: 6 , scope: !4 )
!25 = !DILocation ( line: 7 , scope: !4 )
2015-07-31 20:58:39 +02:00
!26 = !DILocalVariable ( name: "b" , line: 12 , arg: 1 , scope: !17 , file: !23 , type: !20 )
2015-04-29 18:38:44 +02:00
!27 = !DILocation ( line: 12 , scope: !17 )
2015-07-31 20:58:39 +02:00
!28 = !DILocalVariable ( name: "g" , line: 12 , arg: 2 , scope: !17 , file: !23 , type: !8 )
2015-04-29 18:38:44 +02:00
!29 = !DILocation ( line: 13 , scope: !30 )
!30 = distinct !DILexicalBlock ( line: 13 , column: 0 , file: !1 , scope: !17 )
!31 = !DILocation ( line: 14 , scope: !30 )
!32 = !DILocation ( line: 15 , scope: !17 )
2015-03-03 18:24:31 +01:00
!33 = ! { i32 1 , !"Debug Info Version" , i32 3 }