2015-09-16 05:34:32 +00:00
; REQUIRES: default_triple, object-emission
2014-01-18 02:12:00 +00:00
;
2014-01-30 01:39:17 +00:00
; RUN: llvm-link %s %p/type-unique-simple2-b.ll -S -o - | %llc_dwarf -filetype=obj -O0 | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2014-01-18 02:12:00 +00:00
;
; Tests for a merge error where attributes are inserted twice into the same DIE.
;
; $ cat ab.h
; typedef int foo_t;
; class A {
; public:
; virtual void setFoo();
; virtual const foo_t getFoo();
; };
;
; $ cat a.cpp
; #include "ab.h"
; foo_t bar() {
; return A().getFoo();
; }
;
2015-08-11 21:36:45 +00:00
; CHECK: DW_AT_name {{.*}} "setFoo"
; CHECK-NOT: DW_TAG
2014-09-04 19:39:20 +00:00
; CHECK: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public)
2014-01-18 02:12:00 +00:00
; CHECK-NOT: DW_AT_accessibility
; CHECK: DW_TAG
; ModuleID = 'a.cpp'
%class.A = type { i32 ( . . . ) * * }
@_ZTV1A = external unnamed_addr constant [ 4 x i8 * ]
; Function Attrs: nounwind
2015-11-05 22:03:56 +00:00
define i32 @_Z3barv ( ) #0 !dbg !27 {
2014-01-18 02:12:00 +00:00
entry:
%tmp = alloca %class.A , align 8
%0 = bitcast %class.A * %tmp to i8 * , !dbg !38
2015-11-19 05:56:52 +00:00
call void @llvm.memset.p0i8.i64 ( i8 * %0 , i8 0 , i64 8 , i32 8 , i1 false ) , !dbg !38
2014-01-18 02:12:00 +00:00
call void @_ZN1AC1Ev ( %class.A * %tmp ) #1 , !dbg !38
%call = call i32 @_ZN1A6getFooEv ( %class.A * %tmp ) , !dbg !38
ret i32 %call , !dbg !38
}
; Function Attrs: nounwind
2015-11-19 05:56:52 +00:00
declare void @llvm.memset.p0i8.i64 ( i8 * nocapture , i8 , i64 , i32 , i1 ) #1
2014-01-18 02:12:00 +00:00
; Function Attrs: inlinehint nounwind
2015-11-05 22:03:56 +00:00
define linkonce_odr void @_ZN1AC1Ev ( %class.A * %this ) unnamed_addr #2 align 2 !dbg !31 {
2014-01-18 02:12:00 +00:00
entry:
%this.addr = alloca %class.A * , align 8
store %class.A * %this , %class.A * * %this.addr , align 8
2015-04-29 16:38:44 +00:00
call void @llvm.dbg.declare ( metadata %class.A * * %this.addr , metadata !39 , metadata !DIExpression ( ) ) , !dbg !41
2015-02-27 21:17:42 +00:00
%this1 = load %class.A * , %class.A * * %this.addr
2014-01-18 02:12:00 +00:00
call void @_ZN1AC2Ev ( %class.A * %this1 ) #1 , !dbg !42
ret void , !dbg !42
}
declare i32 @_ZN1A6getFooEv ( %class.A * )
; 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218787 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-01 18:55:02 +00:00
declare void @llvm.dbg.declare ( metadata , metadata , metadata ) #4
2014-01-18 02:12:00 +00:00
; Function Attrs: inlinehint nounwind
2015-11-05 22:03:56 +00:00
define linkonce_odr void @_ZN1AC2Ev ( %class.A * %this ) unnamed_addr #2 align 2 !dbg !34 {
2014-01-18 02:12:00 +00:00
entry:
%this.addr = alloca %class.A * , align 8
store %class.A * %this , %class.A * * %this.addr , align 8
2015-04-29 16:38:44 +00:00
call void @llvm.dbg.declare ( metadata %class.A * * %this.addr , metadata !44 , metadata !DIExpression ( ) ) , !dbg !45
2015-02-27 21:17:42 +00:00
%this1 = load %class.A * , %class.A * * %this.addr
2014-01-18 02:12:00 +00:00
%0 = bitcast %class.A * %this1 to i8 * * * , !dbg !46
2015-03-13 18:20:45 +00:00
store i8 * * getelementptr inbounds ( [ 4 x i8 * ] , [ 4 x i8 * ] * @_ZTV1A , i64 0 , i64 2 ) , i8 * * * %0 , !dbg !46
2014-01-18 02:12:00 +00:00
ret void , !dbg !46
}
attributes #0 = { nounwind }
attributes #1 = { nounwind }
attributes #2 = { inlinehint nounwind }
attributes #4 = { nounwind readnone }
!llvm.dbg.cu = ! { !0 }
!llvm.module.flags = ! { !35 , !36 }
!llvm.ident = ! { !37 }
2016-04-15 15:57:41 +00:00
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , producer: "clang version 3.5 " , isOptimized: false , emissionKind: F u l l D e b u g , file: !1 , enums: !2 , retainedTypes: !3 , globals: !2 , imports: !2 )
2015-04-29 16:38:44 +00:00
!1 = !DIFile ( filename: "<unknown>" , 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!2 = ! { }
!3 = ! { !4 }
2016-04-23 21:08:00 +00:00
!4 = !DICompositeType ( tag: D W _ T A G _ c l a s s _ type , name: "A" , line: 2 , size: 64 , align: 64 , file: !5 , elements: !6 , vtableHolder: !4 , identifier: "_ZTS1A" )
2015-04-29 16:38:44 +00:00
!5 = !DIFile ( filename: "./ab.h" , 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!6 = ! { !7 , !14 , !19 }
2015-04-29 16:38:44 +00:00
!7 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "_vptr$A" , size: 64 , flags: D I F l a g A r t i f i c i a l , file: !5 , scope: !8 , baseType: !9 )
!8 = !DIFile ( filename: "./ab.h" , directory: "" )
!9 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , baseType: !10 )
!10 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , name: "__vtbl_ptr_type" , size: 64 , baseType: !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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!12 = ! { !13 }
2015-04-29 16:38:44 +00:00
!13 = !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-23 21:08:00 +00:00
!14 = !DISubprogram ( name: "setFoo" , linkageName: "_ZN1A6setFooEv" , line: 4 , 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 u b l i c | D I F l a g P r o t o t y p e d , isOptimized: false , scopeLine: 4 , file: !5 , scope: !4 , type: !15 , containingType: !4 )
2015-04-29 16:38:44 +00:00
!15 = !DISubroutineType ( types: !16 )
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!16 = ! { null , !17 }
2016-04-23 21:08:00 +00:00
!17 = !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: !4 )
!19 = !DISubprogram ( name: "getFoo" , linkageName: "_ZN1A6getFooEv" , line: 5 , 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 u b l i c | D I F l a g P r o t o t y p e d , isOptimized: false , scopeLine: 5 , file: !5 , scope: !4 , type: !20 , containingType: !4 )
2015-04-29 16:38:44 +00:00
!20 = !DISubroutineType ( types: !21 )
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!21 = ! { !22 , !17 }
2015-04-29 16:38:44 +00:00
!22 = !DIDerivedType ( tag: D W _ T A G _ c o n s t _ type , baseType: !23 )
!23 = !DIDerivedType ( tag: D W _ T A G _ t y p e d e f , name: "foo_t" , line: 1 , file: !24 , baseType: !13 )
!24 = !DIFile ( filename: "a.cpp" , directory: "" )
2016-04-15 15:57:41 +00:00
!27 = distinct !DISubprogram ( name: "bar" , linkageName: "_Z3barv" , line: 2 , 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: 2 , file: !24 , scope: !28 , type: !29 , variables: !2 )
2015-04-29 16:38:44 +00:00
!28 = !DIFile ( filename: "a.cpp" , directory: "" )
!29 = !DISubroutineType ( types: !30 )
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!30 = ! { !23 }
2016-04-23 21:08:00 +00:00
!31 = distinct !DISubprogram ( name: "A" , linkageName: "_ZN1AC1Ev" , line: 2 , isLocal: false , isDefinition: true , 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 , unit: !0 , scopeLine: 2 , file: !5 , scope: !4 , type: !15 , declaration: !32 , variables: !2 )
!32 = !DISubprogram ( name: "A" , 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 , scope: !4 , type: !15 )
!34 = distinct !DISubprogram ( name: "A" , linkageName: "_ZN1AC2Ev" , line: 2 , isLocal: false , isDefinition: true , 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 , unit: !0 , scopeLine: 2 , file: !5 , scope: !4 , type: !15 , declaration: !32 , variables: !2 )
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!35 = ! { i32 2 , !"Dwarf Version" , i32 2 }
2015-03-03 17:24:31 +00:00
!36 = ! { i32 1 , !"Debug Info Version" , i32 3 }
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!37 = ! { !"clang version 3.5 " }
2015-04-29 16:38:44 +00:00
!38 = !DILocation ( line: 3 , scope: !27 )
2015-07-31 18:58:39 +00:00
!39 = !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: !40 )
2016-04-23 21:08:00 +00:00
!40 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , align: 64 , baseType: !4 )
2015-04-29 16:38:44 +00:00
!41 = !DILocation ( line: 0 , scope: !31 )
!42 = !DILocation ( line: 2 , scope: !43 )
!43 = !DILexicalBlockFile ( discriminator: 0 , file: !5 , scope: !31 )
2015-07-31 18:58:39 +00:00
!44 = !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: !34 , type: !40 )
2015-04-29 16:38:44 +00:00
!45 = !DILocation ( line: 0 , scope: !34 )
!46 = !DILocation ( line: 2 , scope: !34 )