2013-04-11 03:53:26 +08:00
; REQUIRES: object-emission
2013-04-27 09:07:22 +08:00
; XFAIL: hexagon
2013-04-11 03:53:26 +08:00
2014-01-30 09:39:17 +08:00
; RUN: %llc_dwarf -filetype=obj -O0 < %s > %t
2013-01-26 05:44:53 +08:00
; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
2013-01-07 13:51:15 +08:00
; CHECK: DW_TAG_ptr_to_member_type
2013-10-30 06:49:29 +08:00
; CHECK: DW_TAG_ptr_to_member_type
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE:0x[0-9a-f]+]]})
; CHECK: [[TYPE]]: DW_TAG_subroutine_type
2013-01-30 03:35:24 +08:00
; CHECK: DW_TAG_formal_parameter
; CHECK-NEXT: DW_AT_type
2013-04-27 09:07:52 +08:00
; CHECK-NEXT: DW_AT_artificial [DW_FORM_flag
2013-01-07 13:51:15 +08:00
; IR generated from clang -g with the following source:
; struct S {
; };
;
; int S::*x = 0;
; void (S::*y)(int) = 0;
@x = global i64 -1 , align 8
@y = global { i64 , i64 } zeroinitializer , align 8
!llvm.dbg.cu = ! { !0 }
2013-11-23 05:49:45 +08:00
!llvm.module.flags = ! { !16 }
2013-01-07 13:51:15 +08:00
2015-04-30 00:38:44 +08:00
!0 = !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , producer: "clang version 3.3 " , isOptimized: false , emissionKind: 0 , file: !15 , enums: !1 , retainedTypes: !1 , subprograms: !1 , globals: !3 , imports: !1 )
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
!1 = ! { }
!3 = ! { !5 , !10 }
2015-04-30 00:38:44 +08:00
!5 = !DIGlobalVariable ( name: "x" , line: 4 , isLocal: false , isDefinition: true , scope: null , file: !6 , type: !7 , variable: i64 * @x )
!6 = !DIFile ( filename: "simple.cpp" , directory: "/home/blaikie/Development/scratch" )
!7 = !DIDerivedType ( tag: D W _ T A G _ p t r _ t o _ m e m b e r _ type , baseType: !8 , extraData: !9 )
!8 = !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 )
!9 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "S" , line: 1 , size: 8 , align: 8 , file: !15 , elements: !1 )
!10 = !DIGlobalVariable ( name: "y" , line: 5 , isLocal: false , isDefinition: true , scope: null , file: !6 , type: !11 , variable: { i64 , i64 } * @y )
!11 = !DIDerivedType ( tag: D W _ T A G _ p t r _ t o _ m e m b e r _ type , baseType: !12 , extraData: !9 )
!12 = !DISubroutineType ( types: !13 )
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
!13 = ! { null , !14 , !8 }
2015-04-30 00:38:44 +08:00
!14 = !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 )
!15 = !DIFile ( filename: "simple.cpp" , directory: "/home/blaikie/Development/scratch" )
2015-03-04 01:24:31 +08:00
!16 = ! { i32 1 , !"Debug Info Version" , i32 3 }