2013-09-07 02:46:00 +08:00
; REQUIRES: object-emission
2014-01-30 09:39:17 +08:00
; RUN: %llc_dwarf -filetype=obj -O0 < %s > %t
2017-09-12 07:05:20 +08:00
; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s
2013-09-07 02:46:00 +08:00
; CHECK: [[TYPE:.*]]: DW_TAG_structure_type
2013-10-11 02:13:17 +08:00
; Make sure we correctly handle containing type of a struct being a type identifier.
2013-09-07 02:46:00 +08:00
; CHECK-NEXT: DW_AT_containing_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE]]})
2013-10-11 02:13:17 +08:00
; CHECK-NEXT: DW_AT_name [DW_FORM_strp] {{.*}}= "C")
2013-10-11 02:40:01 +08:00
; Make sure we correctly handle context of a subprogram being a type identifier.
2013-09-07 08:04:05 +08:00
; CHECK: [[SP:.*]]: DW_TAG_subprogram
2013-10-11 02:40:01 +08:00
; CHECK: DW_AT_name [DW_FORM_strp] {{.*}}= "foo")
2013-10-11 02:13:17 +08:00
; Make sure we correctly handle containing type of a subprogram being a type identifier.
2013-09-07 08:04:05 +08:00
; CHECK: DW_AT_containing_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE]]})
2013-10-11 02:40:01 +08:00
; CHECK: DW_TAG_formal_parameter
; CHECK: NULL
; CHECK: NULL
2013-10-09 06:56:31 +08:00
; CHECK: [[TYPE2:.*]]: DW_TAG_structure_type
2013-10-12 02:50:00 +08:00
; CHECK: DW_AT_name [DW_FORM_strp] {{.*}}= "bar")
2013-10-09 07:49:38 +08:00
; CHECK: DW_TAG_structure_type
; CHECK: DW_AT_name [DW_FORM_strp] {{.*}}= "D")
; CHECK: DW_TAG_member
; CHECK: DW_AT_name [DW_FORM_strp] {{.*}}= "a")
2013-10-11 02:13:17 +08:00
; Make sure we correctly handle context of a struct being a type identifier.
2013-10-09 08:17:04 +08:00
; CHECK: DW_TAG_structure_type
; CHECK-NEXT: DW_AT_name [DW_FORM_strp] {{.*}}= "Nested")
2013-10-10 02:10:55 +08:00
; CHECK: DW_TAG_structure_type
; CHECK-NEXT: DW_AT_name [DW_FORM_strp] {{.*}}= "Nested2")
; CHECK-NEXT: DW_AT_declaration [DW_FORM_flag] (0x01)
2013-10-10 03:46:28 +08:00
; CHECK: DW_TAG_structure_type
; CHECK-NEXT: DW_AT_name [DW_FORM_strp] {{.*}}= "virt<bar>")
2013-10-11 02:13:17 +08:00
; Make sure we correctly handle type of a template_type being a type identifier.
2013-10-10 03:46:28 +08:00
; CHECK: DW_TAG_template_type_parameter
2017-10-10 22:15:25 +08:00
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE2]]}
2013-10-10 03:46:28 +08:00
; CHECK-NEXT: DW_AT_name [DW_FORM_strp] {{.*}}= "T")
2013-10-11 02:13:17 +08:00
; Make sure we correctly handle derived-from of a typedef being a type identifier.
2013-10-09 07:49:38 +08:00
; CHECK: DW_TAG_typedef
2017-10-10 22:15:25 +08:00
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE2]]}
2013-10-09 07:49:38 +08:00
; CHECK: DW_AT_name [DW_FORM_strp] {{.*}}= "baz2")
2013-10-11 02:13:17 +08:00
; Make sure we correctly handle derived-from of a pointer type being a type identifier.
2013-10-09 04:06:43 +08:00
; CHECK: DW_TAG_pointer_type
2017-10-10 22:15:25 +08:00
; CHECK: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE]]}
2013-10-09 06:56:31 +08:00
; CHECK: DW_TAG_typedef
2017-10-10 22:15:25 +08:00
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE2]]}
2013-10-09 07:49:38 +08:00
; CHECK: DW_AT_name [DW_FORM_strp] {{.*}}= "baz")
2013-10-11 02:13:17 +08:00
; Make sure we correctly handle derived-from of an array type being a type identifier.
2013-10-09 07:28:51 +08:00
; CHECK: DW_TAG_array_type
2017-10-10 22:15:25 +08:00
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE2]]}
2013-09-07 02:46:00 +08:00
; IR generated from clang -g with the following source:
; struct C {
; virtual void foo();
; };
; void C::foo() {
; }
2013-10-09 06:56:31 +08:00
;
; struct bar { };
; typedef bar baz;
2013-10-09 07:49:38 +08:00
; struct D {
; typedef bar baz2;
; static int a;
2013-10-09 08:17:04 +08:00
; struct Nested { };
2013-10-10 02:10:55 +08:00
; struct Nested2 { };
2013-10-10 03:46:28 +08:00
; template <typename T>
; struct virt {
; T* values;
; };
2013-10-09 07:49:38 +08:00
; };
2013-10-09 06:56:31 +08:00
; void test() {
; baz B;
2013-10-09 07:28:51 +08:00
; bar A[3];
2013-10-09 07:49:38 +08:00
; D::baz2 B2;
2013-10-09 08:17:04 +08:00
; D::Nested e;
2013-10-10 02:10:55 +08:00
; D::Nested2 *p;
2013-10-10 03:46:28 +08:00
; D::virt<bar> t;
2013-10-09 06:56:31 +08:00
; }
2013-09-07 02:46:00 +08:00
%struct.C = type { i32 ( . . . ) * * }
2013-10-09 06:56:31 +08:00
%struct.bar = type { i8 }
2013-10-09 08:17:04 +08:00
%"struct.D::Nested" = type { i8 }
2013-10-10 02:10:55 +08:00
%"struct.D::Nested2" = type { i8 }
2013-10-10 03:46:28 +08:00
%"struct.D::virt" = type { %struct.bar * }
2013-09-07 02:46:00 +08:00
@_ZTV1C = unnamed_addr constant [ 3 x i8 * ] [ i8 * null , i8 * bitcast ( { i8 * , i8 * } * @_ZTI1C to i8 * ) , i8 * bitcast ( void ( %struct.C * ) * @_ZN1C3fooEv to i8 * ) ]
@_ZTVN10__cxxabiv117__class_type_infoE = external global i8 *
@_ZTS1C = constant [ 3 x i8 ] c "1C\00"
2015-03-14 02:20:45 +08:00
@_ZTI1C = unnamed_addr constant { i8 * , i8 * } { i8 * bitcast ( i8 * * getelementptr inbounds ( i8 * , i8 * * @_ZTVN10__cxxabiv117__class_type_infoE , i64 2 ) to i8 * ) , i8 * getelementptr inbounds ( [ 3 x i8 ] , [ 3 x i8 ] * @_ZTS1C , i32 0 , i32 0 ) }
2013-09-07 02:46:00 +08:00
; Function Attrs: nounwind ssp uwtable
2015-11-06 06:03:56 +08:00
define void @_ZN1C3fooEv ( %struct.C * %this ) unnamed_addr #0 align 2 !dbg !31 {
2013-09-07 02:46:00 +08:00
entry:
%this.addr = alloca %struct.C * , align 8
store %struct.C * %this , %struct.C * * %this.addr , align 8
2015-04-30 00:38:44 +08:00
call void @llvm.dbg.declare ( metadata %struct.C * * %this.addr , metadata !36 , metadata !DIExpression ( ) ) , !dbg !38
2015-02-28 05:17:42 +08:00
%this1 = load %struct.C * , %struct.C * * %this.addr
2013-10-10 03:46:28 +08:00
ret void , !dbg !39
2013-09-07 02:46:00 +08: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-02 02:55:02 +08:00
declare void @llvm.dbg.declare ( metadata , metadata , metadata ) #1
2013-09-07 02:46:00 +08:00
2013-10-09 06:56:31 +08:00
; Function Attrs: nounwind ssp uwtable
2015-11-06 06:03:56 +08:00
define void @_Z4testv ( ) #0 !dbg !32 {
2013-10-09 06:56:31 +08:00
entry:
%B = alloca %struct.bar , align 1
2013-10-09 07:28:51 +08:00
%A = alloca [ 3 x %struct.bar ] , align 1
2013-10-09 07:49:38 +08:00
%B2 = alloca %struct.bar , align 1
2013-10-09 08:17:04 +08:00
%e = alloca %"struct.D::Nested" , align 1
2013-10-10 02:10:55 +08:00
%p = alloca %"struct.D::Nested2" * , align 8
2013-10-10 03:46:28 +08:00
%t = alloca %"struct.D::virt" , align 8
2015-04-30 00:38:44 +08:00
call void @llvm.dbg.declare ( metadata %struct.bar * %B , metadata !40 , metadata !DIExpression ( ) ) , !dbg !42
call void @llvm.dbg.declare ( metadata [ 3 x %struct.bar ] * %A , metadata !43 , metadata !DIExpression ( ) ) , !dbg !47
call void @llvm.dbg.declare ( metadata %struct.bar * %B2 , metadata !48 , metadata !DIExpression ( ) ) , !dbg !50
call void @llvm.dbg.declare ( metadata %"struct.D::Nested" * %e , metadata !51 , metadata !DIExpression ( ) ) , !dbg !52
call void @llvm.dbg.declare ( metadata %"struct.D::Nested2" * * %p , metadata !53 , metadata !DIExpression ( ) ) , !dbg !55
call void @llvm.dbg.declare ( metadata %"struct.D::virt" * %t , metadata !56 , metadata !DIExpression ( ) ) , !dbg !57
2013-10-10 03:46:28 +08:00
ret void , !dbg !58
2013-10-09 06:56:31 +08:00
}
2013-09-07 02:46:00 +08:00
attributes #0 = { nounwind ssp uwtable "less-precise-fpmad" = "false" "no-frame-pointer-elim" = "true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math" = "false" "no-nans-fp-math" = "false" "stack-protector-buffer-size" = "8" "unsafe-fp-math" = "false" "use-soft-float" = "false" }
attributes #1 = { nounwind readnone }
!llvm.dbg.cu = ! { !0 }
2013-11-23 05:49:45 +08:00
!llvm.module.flags = ! { !35 , !59 }
2013-09-07 02:46:00 +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: !3 , globals: !2 , imports: !2 )
2015-04-30 00:38:44 +08:00
!1 = !DIFile ( filename: "tmp.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 = ! { }
!3 = ! { !4 , !18 , !19 , !22 , !23 , !24 }
2016-04-24 05:08:00 +08:00
!4 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "C" , line: 1 , file: !1 , elements: !5 , vtableHolder: !4 , identifier: "_ZTS1C" )
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
!5 = ! { !6 , !13 }
2016-01-15 08:46:17 +08:00
!6 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "_vptr$C" , flags: D I F l a g A r t i f i c i a l , file: !1 , scope: !7 , baseType: !8 )
2015-04-30 00:38:44 +08:00
!7 = !DIFile ( filename: "tmp.cpp" , directory: "." )
!8 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , baseType: !9 )
!9 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , name: "__vtbl_ptr_type" , size: 64 , baseType: !10 )
!10 = !DISubroutineType ( types: !11 )
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
!11 = ! { !12 }
2015-04-30 00:38:44 +08:00
!12 = !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-24 05:08:00 +08:00
!13 = !DISubprogram ( name: "foo" , linkageName: "_ZN1C3fooEv" , line: 2 , isLocal: false , isDefinition: false , virtuality: D W _ V I R T U A L I T Y _ v i r t u a l , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false , scopeLine: 2 , file: !1 , scope: !4 , type: !14 , containingType: !4 )
2015-04-30 00:38:44 +08:00
!14 = !DISubroutineType ( types: !15 )
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
!15 = ! { null , !16 }
2016-04-24 05:08:00 +08:00
!16 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , 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: !4 )
2015-04-30 00:38:44 +08:00
!18 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "bar" , line: 7 , size: 8 , align: 8 , file: !1 , elements: !2 , identifier: "_ZTS3bar" )
!19 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "D" , line: 9 , size: 8 , align: 8 , file: !1 , elements: !20 , identifier: "_ZTS1D" )
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
!20 = ! { !21 }
2016-04-24 05:08:00 +08:00
!21 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "a" , line: 11 , flags: D I F l a g S t a t i c M e m b e r , file: !1 , scope: !19 , baseType: !12 )
!22 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "Nested" , line: 12 , size: 8 , align: 8 , file: !1 , scope: !19 , elements: !2 , identifier: "_ZTSN1D6NestedE" )
!23 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "Nested2" , line: 13 , flags: D I F l a g F w d D e c l , file: !1 , scope: !19 , identifier: "_ZTSN1D7Nested2E" )
!24 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "virt<bar>" , line: 15 , file: !1 , scope: !19 , elements: !25 , templateParams: !28 , identifier: "_ZTSN1D4virtI3barEE" )
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 = ! { !26 }
2016-04-24 05:08:00 +08:00
!26 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "values" , line: 16 , size: 64 , align: 64 , file: !1 , scope: !24 , baseType: !27 )
!27 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , align: 64 , baseType: !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
!28 = ! { !29 }
2016-04-24 05:08:00 +08:00
!29 = !DITemplateTypeParameter ( name: "T" , type: !18 )
2016-04-15 23:57:41 +08:00
!31 = distinct !DISubprogram ( name: "foo" , linkageName: "_ZN1C3fooEv" , line: 4 , 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: 4 , file: !1 , scope: null , type: !14 , declaration: !13 , variables: !2 )
!32 = distinct !DISubprogram ( name: "test" , linkageName: "_Z4testv" , line: 20 , 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: 20 , file: !1 , scope: !7 , type: !33 , variables: !2 )
2015-04-30 00:38:44 +08:00
!33 = !DISubroutineType ( types: !34 )
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
!34 = ! { null }
!35 = ! { i32 2 , !"Dwarf Version" , i32 2 }
2015-08-01 02:58:39 +08:00
!36 = !DILocalVariable ( name: "this" , 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: !31 , type: !37 )
2016-04-24 05:08:00 +08:00
!37 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , align: 64 , baseType: !4 )
2015-04-30 00:38:44 +08:00
!38 = !DILocation ( line: 0 , scope: !31 )
!39 = !DILocation ( line: 5 , scope: !31 )
2015-08-01 02:58:39 +08:00
!40 = !DILocalVariable ( name: "B" , line: 21 , scope: !32 , file: !7 , type: !41 )
2016-04-24 05:08:00 +08:00
!41 = !DIDerivedType ( tag: D W _ T A G _ t y p e d e f , name: "baz" , line: 8 , file: !1 , baseType: !18 )
2015-04-30 00:38:44 +08:00
!42 = !DILocation ( line: 21 , scope: !32 )
2015-08-01 02:58:39 +08:00
!43 = !DILocalVariable ( name: "A" , line: 22 , scope: !32 , file: !7 , type: !44 )
2016-04-24 05:08:00 +08:00
!44 = !DICompositeType ( tag: D W _ T A G _ a r r a y _ type , size: 24 , align: 8 , baseType: !18 , elements: !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 = ! { !46 }
2015-04-30 00:38:44 +08:00
!46 = !DISubrange ( count: 3 )
!47 = !DILocation ( line: 22 , scope: !32 )
2015-08-01 02:58:39 +08:00
!48 = !DILocalVariable ( name: "B2" , line: 23 , scope: !32 , file: !7 , type: !49 )
2016-04-24 05:08:00 +08:00
!49 = !DIDerivedType ( tag: D W _ T A G _ t y p e d e f , name: "baz2" , line: 10 , file: !1 , scope: !19 , baseType: !18 )
2015-04-30 00:38:44 +08:00
!50 = !DILocation ( line: 23 , scope: !32 )
2015-08-01 02:58:39 +08:00
!51 = !DILocalVariable ( name: "e" , line: 24 , scope: !32 , file: !7 , type: !22 )
2015-04-30 00:38:44 +08:00
!52 = !DILocation ( line: 24 , scope: !32 )
2015-08-01 02:58:39 +08:00
!53 = !DILocalVariable ( name: "p" , line: 25 , scope: !32 , file: !7 , type: !54 )
2016-04-24 05:08:00 +08:00
!54 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , baseType: !23 )
2015-04-30 00:38:44 +08:00
!55 = !DILocation ( line: 25 , scope: !32 )
2015-08-01 02:58:39 +08:00
!56 = !DILocalVariable ( name: "t" , line: 26 , scope: !32 , file: !7 , type: !24 )
2015-04-30 00:38:44 +08:00
!57 = !DILocation ( line: 26 , scope: !32 )
!58 = !DILocation ( line: 27 , scope: !32 )
2015-03-04 01:24:31 +08:00
!59 = ! { i32 1 , !"Debug Info Version" , i32 3 }