2013-09-06 02:48:31 +08:00
; REQUIRES: object-emission
2014-01-30 09:39:17 +08:00
; RUN: %llc_dwarf -filetype=obj -O0 < %s > %t
2013-09-06 02:48:31 +08:00
; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
; CHECK: DW_TAG_ptr_to_member_type
2013-10-30 06:49:29 +08:00
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE:0x[0-9a-f]+]]})
; CHECK: [[TYPE]]: DW_TAG_base_type
2013-09-06 02:48:31 +08:00
; IR generated from clang -g with the following source:
; struct Foo {
; int e;
; };
; int Foo:*x = 0;
2016-12-22 08:45:21 +08:00
source_filename = "test/DebugInfo/Generic/tu-member-pointer.ll"
2013-09-06 02:48:31 +08:00
2016-12-22 08:45:21 +08:00
@x = global i64 -1 , align 8 , !dbg !0
!llvm.dbg.cu = ! { !6 }
2013-11-23 05:49:45 +08:00
!llvm.module.flags = ! { !10 , !11 }
2013-09-06 02:48:31 +08:00
2016-12-22 08:45:21 +08:00
!0 = !DIGlobalVariableExpression ( var: !1 )
!1 = !DIGlobalVariable ( name: "x" , scope: null , file: !2 , line: 4 , type: !3 , isLocal: false , isDefinition: true )
!2 = !DIFile ( filename: "foo.cpp" , directory: "." )
!3 = !DIDerivedType ( tag: D W _ T A G _ p t r _ t o _ m e m b e r _ type , baseType: !4 , extraData: !5 )
!4 = !DIBasicType ( name: "int" , size: 32 , align: 32 , encoding: D W _ A T E _ s i g n e d )
!5 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "Foo" , file: !2 , line: 1 , flags: D I F l a g F w d D e c l , identifier: "_ZTS3Foo" )
!6 = distinct !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , file: !2 , producer: "clang version 3.4" , isOptimized: false , runtimeVersion: 0 , emissionKind: F u l l D e b u g , enums: !7 , retainedTypes: !8 , globals: !9 , imports: !7 )
!7 = ! { }
!8 = ! { !5 }
!9 = ! { !0 }
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 = ! { i32 2 , !"Dwarf Version" , i32 2 }
2015-03-04 01:24:31 +08:00
!11 = ! { i32 1 , !"Debug Info Version" , i32 3 }
2016-12-22 08:45:21 +08:00