2016-03-01 03:49:46 +08:00
; RUN: llc -mtriple=x86_64-apple-macosx10.9.0 -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=all - | FileCheck %s
2013-07-10 09:53:37 +08:00
; ModuleID = 'aggregate-indirect-arg.cpp'
; extracted from debuginfo-tests/aggregate-indirect-arg.cpp
2015-12-18 02:25:51 +08:00
; v should be a pointer.
2016-03-01 03:49:46 +08:00
; CHECK: .debug_info contents:
2015-12-18 02:25:51 +08:00
; CHECK: DW_TAG_subprogram
; CHECK: DW_AT_specification {{.*}} "_ZN1A3fooE4SVal"
; CHECK-NOT: DW_TAG_subprogram
; CHECK: DW_TAG_formal_parameter
; CHECK: DW_AT_name {{.*}} "this"
; CHECK-NOT: DW_TAG_subprogram
; CHECK: DW_TAG_formal_parameter
2016-03-01 03:49:46 +08:00
; CHECK-NEXT: DW_AT_location [DW_FORM_data4] (0x00000000)
2015-12-18 02:25:51 +08:00
; CHECK-NEXT: DW_AT_name {{.*}} "v"
2016-03-01 03:49:46 +08:00
; CHECK: .debug_loc contents:
; rsi+0
; CHECK: Location description: 74 00
2013-07-10 09:53:37 +08:00
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.9.0"
%class.SVal = type { i8 * , i32 }
%class.A = type { i8 }
declare void @_Z3barR4SVal ( %class.SVal * %v )
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-02 02:55:02 +08:00
declare void @llvm.dbg.declare ( metadata , metadata , metadata ) #1
Clean up the processing of dbg.value in various places
Summary:
First up is instcombine, where in the dbg.declare -> dbg.value conversion,
the llvm.dbg.value needs to be called on the actual loaded value, rather
than the address (since the whole point of this transformation is to be
able to get rid of the alloca). Further, now that that's cleaned up, we
can remove a hack in the backend, that would add an implicit OP_deref if
the argument to dbg.value was an alloca. This stems from before the
existence of DIExpression and is no longer necessary since the deref can
be expressed explicitly.
Now, in order to make sure that the tests pass with this change, we need to
correct the printing of DEBUG_VALUE comments to take into account the
expression, which wasn't taken into account before.
Unfortunately, for both these changes, there were a number of incorrect
test cases (mostly the wrong number of DW_OP_derefs, but also a couple
where the test itself was broken more badly). aprantl and I have gone
through and adjusted these test case in order to make them pass with
these fixes and in some cases to make sure they're actually testing
what they are meant to test.
Reviewers: aprantl
Subscribers: dsanders
Differential Revision: http://reviews.llvm.org/D14186
llvm-svn: 256077
2015-12-19 10:02:44 +08:00
declare void @llvm.dbg.value ( metadata , i64 , metadata , metadata ) #1
2013-07-10 09:53:37 +08:00
declare i32 @main ( )
; Function Attrs: nounwind ssp uwtable
2015-11-06 06:03:56 +08:00
define linkonce_odr void @_ZN1A3fooE4SVal ( %class.A * %this , %class.SVal * %v ) nounwind ssp uwtable align 2 !dbg !35 {
2013-07-10 09:53:37 +08:00
entry:
%this.addr = alloca %class.A * , align 8
store %class.A * %this , %class.A * * %this.addr , align 8
2015-04-30 00:38:44 +08:00
call void @llvm.dbg.declare ( metadata %class.A * * %this.addr , metadata !59 , metadata !DIExpression ( ) ) , !dbg !61
Clean up the processing of dbg.value in various places
Summary:
First up is instcombine, where in the dbg.declare -> dbg.value conversion,
the llvm.dbg.value needs to be called on the actual loaded value, rather
than the address (since the whole point of this transformation is to be
able to get rid of the alloca). Further, now that that's cleaned up, we
can remove a hack in the backend, that would add an implicit OP_deref if
the argument to dbg.value was an alloca. This stems from before the
existence of DIExpression and is no longer necessary since the deref can
be expressed explicitly.
Now, in order to make sure that the tests pass with this change, we need to
correct the printing of DEBUG_VALUE comments to take into account the
expression, which wasn't taken into account before.
Unfortunately, for both these changes, there were a number of incorrect
test cases (mostly the wrong number of DW_OP_derefs, but also a couple
where the test itself was broken more badly). aprantl and I have gone
through and adjusted these test case in order to make them pass with
these fixes and in some cases to make sure they're actually testing
what they are meant to test.
Reviewers: aprantl
Subscribers: dsanders
Differential Revision: http://reviews.llvm.org/D14186
llvm-svn: 256077
2015-12-19 10:02:44 +08:00
call void @llvm.dbg.value ( metadata %class.SVal * %v , i64 0 , metadata !62 , metadata !DIExpression ( D W _ O P _ d e r e f ) ) , !dbg !61
2015-02-28 05:17:42 +08:00
%this1 = load %class.A * , %class.A * * %this.addr
2013-07-10 09:53:37 +08:00
call void @_Z3barR4SVal ( %class.SVal * %v ) , !dbg !61
ret void , !dbg !61
}
declare void @_ZN4SValD1Ev ( %class.SVal * %this )
declare void @_ZN4SValD2Ev ( %class.SVal * %this )
!llvm.dbg.cu = ! { !0 }
2013-11-23 05:49:45 +08:00
!llvm.module.flags = ! { !47 , !68 }
2013-07-10 09:53:37 +08:00
2016-04-15 23:57:41 +08: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-30 00:38:44 +08:00
!1 = !DIFile ( filename: "aggregate-indirect-arg.cpp" , directory: "" )
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-16 03:07:53 +08:00
!2 = ! { }
2016-04-15 23:57:41 +08:00
!4 = distinct !DISubprogram ( name: "bar" , linkageName: "_Z3barR4SVal" , line: 19 , 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: 19 , file: !1 , scope: !5 , type: !6 , variables: !2 )
2015-04-30 00:38:44 +08:00
!5 = !DIFile ( filename: "aggregate-indirect-arg.cpp" , directory: "" )
!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-16 03:07:53 +08:00
!7 = ! { null , !8 }
2015-04-30 00:38:44 +08:00
!8 = !DIDerivedType ( tag: D W _ T A G _ r e f e r e n c e _ type , baseType: !9 )
!9 = !DICompositeType ( tag: D W _ T A G _ c l a s s _ type , name: "SVal" , line: 12 , size: 128 , align: 64 , file: !1 , elements: !10 )
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-16 03:07:53 +08:00
!10 = ! { !11 , !14 , !16 , !21 , !23 }
2015-04-30 00:38:44 +08:00
!11 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "Data" , line: 15 , size: 64 , align: 64 , file: !1 , scope: !9 , baseType: !12 )
!12 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , align: 64 , baseType: !13 )
!13 = !DIDerivedType ( tag: D W _ T A G _ c o n s t _ type , baseType: null )
!14 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "Kind" , line: 16 , size: 32 , align: 32 , offset: 64 , file: !1 , scope: !9 , baseType: !15 )
!15 = !DIBasicType ( tag: D W _ T A G _ b a s e _ type , name: "unsigned int" , size: 32 , align: 32 , encoding: D W _ A T E _ u n s i g n e d )
!16 = !DISubprogram ( name: "~SVal" , line: 14 , 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: 14 , file: !1 , scope: !9 , type: !17 )
!17 = !DISubroutineType ( types: !18 )
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-16 03:07:53 +08:00
!18 = ! { null , !19 }
2015-04-30 00:38:44 +08:00
!19 = !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: !9 )
!21 = !DISubprogram ( name: "SVal" , line: 12 , isLocal: false , isDefinition: false , virtualIndex: 6 , flags: D I F l a g A r t i f i c i a l | D I F l a g P r o t o t y p e d , isOptimized: false , scopeLine: 12 , file: !1 , scope: !9 , type: !17 )
!23 = !DISubprogram ( name: "SVal" , line: 12 , isLocal: false , isDefinition: false , virtualIndex: 6 , flags: D I F l a g A r t i f i c i a l | D I F l a g P r o t o t y p e d , isOptimized: false , scopeLine: 12 , file: !1 , scope: !9 , type: !24 )
!24 = !DISubroutineType ( types: !25 )
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-16 03:07:53 +08:00
!25 = ! { null , !19 , !26 }
2015-04-30 00:38:44 +08:00
!26 = !DIDerivedType ( tag: D W _ T A G _ r e f e r e n c e _ type , baseType: !27 )
!27 = !DIDerivedType ( tag: D W _ T A G _ c o n s t _ type , baseType: !9 )
2016-04-15 23:57:41 +08:00
!29 = distinct !DISubprogram ( name: "main" , line: 25 , 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: 25 , file: !1 , scope: !5 , type: !30 , variables: !2 )
2015-04-30 00:38:44 +08:00
!30 = !DISubroutineType ( types: !31 )
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-16 03:07:53 +08:00
!31 = ! { !32 }
2015-04-30 00:38:44 +08:00
!32 = !DIBasicType ( tag: D W _ T A G _ b a s e _ type , name: "int" , size: 32 , align: 32 , encoding: D W _ A T E _ s i g n e d )
2016-04-15 23:57:41 +08:00
!33 = distinct !DISubprogram ( name: "~SVal" , linkageName: "_ZN4SValD1Ev" , line: 14 , 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: 14 , file: !1 , scope: null , type: !17 , declaration: !16 , variables: !2 )
!34 = distinct !DISubprogram ( name: "~SVal" , linkageName: "_ZN4SValD2Ev" , line: 14 , 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: 14 , file: !1 , scope: null , type: !17 , declaration: !16 , variables: !2 )
!35 = distinct !DISubprogram ( name: "foo" , linkageName: "_ZN1A3fooE4SVal" , line: 22 , 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: 22 , file: !1 , scope: null , type: !36 , declaration: !41 , variables: !2 )
2015-04-30 00:38:44 +08:00
!36 = !DISubroutineType ( types: !37 )
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-16 03:07:53 +08:00
!37 = ! { null , !38 , !9 }
2015-04-30 00:38:44 +08:00
!38 = !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: !39 )
!39 = !DICompositeType ( tag: D W _ T A G _ c l a s s _ type , name: "A" , line: 20 , size: 8 , align: 8 , file: !1 , elements: !40 )
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-16 03:07:53 +08:00
!40 = ! { !41 , !43 }
2015-04-30 00:38:44 +08:00
!41 = !DISubprogram ( name: "foo" , linkageName: "_ZN1A3fooE4SVal" , line: 22 , 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: 22 , file: !1 , scope: !39 , type: !36 )
!43 = !DISubprogram ( name: "A" , line: 20 , isLocal: false , isDefinition: false , virtualIndex: 6 , flags: D I F l a g A r t i f i c i a l | D I F l a g P r o t o t y p e d , isOptimized: false , scopeLine: 20 , file: !1 , scope: !39 , type: !44 )
!44 = !DISubroutineType ( types: !45 )
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-16 03:07:53 +08:00
!45 = ! { null , !38 }
!47 = ! { i32 2 , !"Dwarf Version" , i32 3 }
2015-08-01 02:58:39 +08:00
!48 = !DILocalVariable ( name: "v" , line: 19 , arg: 1 , scope: !4 , file: !5 , type: !8 )
2015-04-30 00:38:44 +08:00
!49 = !DILocation ( line: 19 , scope: !4 )
2015-08-01 02:58:39 +08:00
!50 = !DILocalVariable ( name: "v" , line: 26 , scope: !29 , file: !5 , type: !9 )
2015-04-30 00:38:44 +08:00
!51 = !DILocation ( line: 26 , scope: !29 )
!52 = !DILocation ( line: 27 , scope: !29 )
!53 = !DILocation ( line: 28 , scope: !29 )
2015-08-01 02:58:39 +08:00
!54 = !DILocalVariable ( name: "a" , line: 29 , scope: !29 , file: !5 , type: !39 )
2015-04-30 00:38:44 +08:00
!55 = !DILocation ( line: 29 , scope: !29 )
!56 = !DILocation ( line: 30 , scope: !29 )
!57 = !DILocation ( line: 31 , scope: !29 )
!58 = !DILocation ( line: 32 , scope: !29 )
2015-08-01 02:58:39 +08:00
!59 = !DILocalVariable ( name: "this" , line: 22 , arg: 1 , 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 , scope: !35 , file: !5 , type: !60 )
2015-04-30 00:38:44 +08:00
!60 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , align: 64 , baseType: !39 )
!61 = !DILocation ( line: 22 , scope: !35 )
2015-08-01 02:58:39 +08:00
!62 = !DILocalVariable ( name: "v" , line: 22 , arg: 2 , scope: !35 , file: !5 , type: !9 )
!63 = !DILocalVariable ( name: "this" , line: 14 , arg: 1 , 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 , scope: !33 , file: !5 , type: !64 )
2015-04-30 00:38:44 +08:00
!64 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , align: 64 , baseType: !9 )
!65 = !DILocation ( line: 14 , scope: !33 )
2015-08-01 02:58:39 +08:00
!66 = !DILocalVariable ( name: "this" , line: 14 , arg: 1 , 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 , scope: !34 , file: !5 , type: !64 )
2015-04-30 00:38:44 +08:00
!67 = !DILocation ( line: 14 , scope: !34 )
2015-03-04 01:24:31 +08:00
!68 = ! { i32 1 , !"Debug Info Version" , i32 3 }