2014-01-18 02:12:00 +00:00
; REQUIRES: object-emission
;
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();
; }
;
; CHECK: _ZN1A6setFooEv
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
define i32 @_Z3barv ( ) #0 {
entry:
%tmp = alloca %class.A , align 8
%0 = bitcast %class.A * %tmp to i8 * , !dbg !38
call void @llvm.memset.p0i8.i64 ( i8 * %0 , i8 0 , i64 8 , i32 8 , i1 false ) , !dbg !38
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
declare void @llvm.memset.p0i8.i64 ( i8 * nocapture , i8 , i64 , i32 , i1 ) #1
; Function Attrs: inlinehint nounwind
define linkonce_odr void @_ZN1AC1Ev ( %class.A * %this ) unnamed_addr #2 align 2 {
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
define linkonce_odr void @_ZN1AC2Ev ( %class.A * %this ) unnamed_addr #2 align 2 {
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 }
2015-04-29 16:38:44 +00:00
!0 = !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: 0 , file: !1 , enums: !2 , retainedTypes: !3 , subprograms: !26 , globals: !2 , imports: !2 )
!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 }
2015-04-29 16:38:44 +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: !"_ZTS1A" , identifier: "_ZTS1A" )
!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 )
!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: !"_ZTS1A" , type: !15 , containingType: !"_ZTS1A" )
!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 }
2015-04-29 16:38:44 +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: !"_ZTS1A" )
!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: !"_ZTS1A" , type: !20 , containingType: !"_ZTS1A" )
!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: "" )
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
!26 = ! { !27 , !31 , !34 }
2015-04-29 16:38:44 +00:00
!27 = !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 , scopeLine: 2 , file: !24 , scope: !28 , type: !29 , function: i32 ( ) * @_Z3barv , variables: !2 )
!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 }
2015-04-29 16:38:44 +00:00
!31 = !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 , scopeLine: 2 , file: !5 , scope: !"_ZTS1A" , type: !15 , function: void ( %class.A * ) * @_ZN1AC1Ev , 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: !"_ZTS1A" , type: !15 )
!34 = !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 , scopeLine: 2 , file: !5 , scope: !"_ZTS1A" , type: !15 , function: void ( %class.A * ) * @_ZN1AC2Ev , 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 )
!39 = !DILocalVariable ( tag: D W _ T A G _ a r g _ v a r i a b l e , 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 )
!40 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , align: 64 , baseType: !"_ZTS1A" )
!41 = !DILocation ( line: 0 , scope: !31 )
!42 = !DILocation ( line: 2 , scope: !43 )
!43 = !DILexicalBlockFile ( discriminator: 0 , file: !5 , scope: !31 )
!44 = !DILocalVariable ( tag: D W _ T A G _ a r g _ v a r i a b l e , 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 )
!45 = !DILocation ( line: 0 , scope: !34 )
!46 = !DILocation ( line: 2 , scope: !34 )