2014-06-04 09:30:59 +08:00
; REQUIRES: object-emission
; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2014-06-05 01:05:23 +08:00
; The formal parameter 'b' for Function 'x' when inlined within 'a' is lost on
; mips and powerpc64 (and on x86_64 at at least -O2). Presumably this is a
; SelectionDAG issue (do mips/powerpc64 use FastISel?).
2015-08-08 07:01:16 +08:00
; XFAIL: mips, powerpc64, s390x, sparc
2014-06-05 01:05:23 +08:00
2014-06-04 09:30:59 +08:00
; Build from the following source with clang -O2.
; The important details are that 'x's abstract definition is first built during
; the definition of 'b', where the parameter to 'x' is constant and so 'x's 's'
; variable is optimized away. No abstract definition DIE for 's' is constructed.
; Then, during 'a' emission, the abstract DbgVariable for 's' is created, but
; the abstract DIE isn't (since the abstract definition for 'b' is already
; built). This results in 's' inlined in 'a' being emitted with its name, line,
; file there, rather than referencing an abstract definition.
; extern int t;
;
; void f(int);
;
; inline void x(bool b) {
; if (b) {
; int s = t;
; f(s);
; }
; f(0);
; }
;
; void b() {
; x(false);
; }
;
; void a(bool u) {
; x(u);
; }
2015-08-12 05:36:45 +08:00
; CHECK: [[X_DECL:.*]]: DW_TAG_subprogram
2014-06-04 09:30:59 +08:00
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}} "x"
; CHECK-NOT: {{DW_TAG|NULL}}
2014-10-10 23:51:02 +08:00
; CHECK: DW_TAG_formal_parameter
2014-06-04 09:30:59 +08:00
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}} "b"
2014-06-05 07:50:52 +08:00
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_TAG_lexical_block
; CHECK-NOT: {{DW_TAG|NULL}}
2014-10-10 23:51:02 +08:00
; CHECK: DW_TAG_variable
2014-06-05 07:50:52 +08:00
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}} "s"
2014-06-04 09:30:59 +08:00
; CHECK: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}} "b"
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_TAG_inlined_subroutine
; CHECK-NOT: DW_TAG
2015-08-12 05:36:45 +08:00
; CHECK: DW_AT_abstract_origin {{.*}} {[[X_DECL]]}
2014-06-04 09:30:59 +08:00
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_TAG_formal_parameter
; CHECK-NOT: DW_TAG
2014-10-10 23:51:02 +08:00
; CHECK: DW_AT_abstract_origin {{.*}} "b"
2014-06-04 09:30:59 +08:00
; Notice 'x's local variable 's' is missing. Not necessarily a bug here,
; since it's been optimized entirely away and it should be described in
; abstract subprogram.
; CHECK-NOT: DW_TAG
; CHECK: NULL
; CHECK-NOT: DW_TAG
; CHECK: NULL
; CHECK: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}} "a"
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_TAG_formal_parameter
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_TAG_inlined_subroutine
; CHECK-NOT: DW_TAG
2015-08-12 05:36:45 +08:00
; CHECK: DW_AT_abstract_origin {{.*}} {[[X_DECL]]}
2014-06-04 09:30:59 +08:00
; CHECK-NOT: {{DW_TAG|NULL}}
2014-06-05 07:50:52 +08:00
; FIXME: This formal parameter goes missing at least at -O2 (& on
; mips/powerpc), maybe before that. Perhaps SelectionDAG is to blame (and
; fastisel succeeds).
2014-06-04 09:30:59 +08:00
; CHECK: DW_TAG_formal_parameter
; CHECK-NOT: DW_TAG
2014-10-10 23:51:02 +08:00
; CHECK: DW_AT_abstract_origin {{.*}} "b"
2014-06-04 09:30:59 +08:00
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_TAG_lexical_block
; CHECK-NOT: {{DW_TAG|NULL}}
2014-09-01 05:26:22 +08:00
; CHECK: DW_TAG_variable
2014-06-04 09:30:59 +08:00
; CHECK-NOT: DW_TAG
2014-10-10 23:51:02 +08:00
; CHECK: DW_AT_abstract_origin {{.*}} "s"
2014-06-04 09:30:59 +08:00
@t = external global i32
; Function Attrs: uwtable
2015-11-06 06:03:56 +08:00
define void @_Z1bv ( ) #0 !dbg !4 {
2014-06-04 09:30:59 +08:00
entry:
2017-07-29 04:21:02 +08:00
tail call void @llvm.dbg.value ( metadata i1 false , metadata !25 , metadata !DIExpression ( ) ) , !dbg !27
2014-06-04 09:30:59 +08:00
tail call void @_Z1fi ( i32 0 ) , !dbg !28
ret void , !dbg !29
}
; Function Attrs: uwtable
2015-11-06 06:03:56 +08:00
define void @_Z1ab ( i1 zeroext %u ) #0 !dbg !8 {
2014-06-04 09:30:59 +08:00
entry:
2017-07-29 04:21:02 +08:00
tail call void @llvm.dbg.value ( metadata i1 %u , metadata !13 , metadata !DIExpression ( ) ) , !dbg !30
tail call void @llvm.dbg.value ( metadata i1 %u , metadata !31 , metadata !DIExpression ( ) ) , !dbg !33
2014-06-04 09:30:59 +08:00
br i1 %u , label %if.then.i , label %_Z1xb.exit , !dbg !34
if.then.i: ; preds = %entry
2015-02-28 05:17:42 +08:00
%0 = load i32 , i32 * @t , align 4 , !dbg !35 , !tbaa !36
2017-07-29 04:21:02 +08:00
tail call void @llvm.dbg.value ( metadata i32 %0 , metadata !40 , metadata !DIExpression ( ) ) , !dbg !35
2014-06-04 09:30:59 +08:00
tail call void @_Z1fi ( i32 %0 ) , !dbg !41
br label %_Z1xb.exit , !dbg !42
_Z1xb.exit: ; preds = %entry, %if.then.i
tail call void @_Z1fi ( i32 0 ) , !dbg !43
ret void , !dbg !44
}
declare void @_Z1fi ( i32 ) #1
; Function Attrs: nounwind readnone
2017-07-29 04:21:02 +08:00
declare void @llvm.dbg.value ( metadata , metadata , metadata ) #2
2014-06-04 09:30:59 +08:00
attributes #0 = { uwtable "less-precise-fpmad" = "false" "no-frame-pointer-elim" = "false" "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 = { "less-precise-fpmad" = "false" "no-frame-pointer-elim" = "false" "no-infs-fp-math" = "false" "no-nans-fp-math" = "false" "stack-protector-buffer-size" = "8" "unsafe-fp-math" = "false" "use-soft-float" = "false" }
attributes #2 = { nounwind readnone }
!llvm.dbg.cu = ! { !0 }
!llvm.module.flags = ! { !21 , !22 }
!llvm.ident = ! { !23 }
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.5.0 " , isOptimized: true , emissionKind: F u l l D e b u g , file: !1 , enums: !2 , retainedTypes: !2 , globals: !2 , imports: !2 )
2015-04-30 00:38:44 +08:00
!1 = !DIFile ( filename: "missing-abstract-variables.cc" , directory: "/tmp/dbginfo" )
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 = ! { }
2016-04-15 23:57:41 +08:00
!4 = distinct !DISubprogram ( name: "b" , linkageName: "_Z1bv" , line: 13 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , unit: !0 , scopeLine: 13 , file: !1 , scope: !5 , type: !6 , variables: !2 )
2015-04-30 00:38:44 +08:00
!5 = !DIFile ( filename: "missing-abstract-variables.cc" , directory: "/tmp/dbginfo" )
!6 = !DISubroutineType ( types: !7 )
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
!7 = ! { null }
2016-04-15 23:57:41 +08:00
!8 = distinct !DISubprogram ( name: "a" , linkageName: "_Z1ab" , line: 17 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , unit: !0 , scopeLine: 17 , file: !1 , scope: !5 , type: !9 , variables: !12 )
2015-04-30 00:38:44 +08:00
!9 = !DISubroutineType ( types: !10 )
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 = ! { null , !11 }
2015-04-30 00:38:44 +08:00
!11 = !DIBasicType ( tag: D W _ T A G _ b a s e _ type , name: "bool" , size: 8 , align: 8 , encoding: D W _ A T E _ b o o l e a n )
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
!12 = ! { !13 }
2015-08-01 02:58:39 +08:00
!13 = !DILocalVariable ( name: "u" , line: 17 , arg: 1 , scope: !8 , file: !5 , type: !11 )
2016-04-15 23:57:41 +08:00
!14 = distinct !DISubprogram ( name: "x" , linkageName: "_Z1xb" , line: 5 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , unit: !0 , scopeLine: 5 , file: !1 , scope: !5 , type: !9 , variables: !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 = ! { !16 , !17 }
2015-08-01 02:58:39 +08:00
!16 = !DILocalVariable ( name: "b" , line: 5 , arg: 1 , scope: !14 , file: !5 , type: !11 )
!17 = !DILocalVariable ( name: "s" , line: 7 , scope: !18 , file: !5 , type: !20 )
2015-04-30 00:38:44 +08:00
!18 = distinct !DILexicalBlock ( line: 6 , column: 0 , file: !1 , scope: !19 )
!19 = distinct !DILexicalBlock ( line: 6 , column: 0 , file: !1 , scope: !14 )
!20 = !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 )
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
!21 = ! { i32 2 , !"Dwarf Version" , i32 4 }
2015-03-04 01:24:31 +08:00
!22 = ! { i32 2 , !"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.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!23 = ! { !"clang version 3.5.0 " }
!24 = ! { i1 false }
2015-08-01 02:58:39 +08:00
!25 = !DILocalVariable ( name: "b" , line: 5 , arg: 1 , scope: !14 , file: !5 , type: !11 )
2015-04-30 00:38:44 +08:00
!26 = !DILocation ( line: 14 , scope: !4 )
!27 = !DILocation ( line: 5 , scope: !14 , inlinedAt: !26 )
!28 = !DILocation ( line: 10 , scope: !14 , inlinedAt: !26 )
!29 = !DILocation ( line: 15 , scope: !4 )
!30 = !DILocation ( line: 17 , scope: !8 )
2015-08-01 02:58:39 +08:00
!31 = !DILocalVariable ( name: "b" , line: 5 , arg: 1 , scope: !14 , file: !5 , type: !11 )
2015-04-30 00:38:44 +08:00
!32 = !DILocation ( line: 18 , scope: !8 )
!33 = !DILocation ( line: 5 , scope: !14 , inlinedAt: !32 )
!34 = !DILocation ( line: 6 , scope: !19 , inlinedAt: !32 )
!35 = !DILocation ( line: 7 , scope: !18 , inlinedAt: !32 )
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
!36 = ! { !37 , !37 , i64 0 }
!37 = ! { !"int" , !38 , i64 0 }
!38 = ! { !"omnipotent char" , !39 , i64 0 }
!39 = ! { !"Simple C/C++ TBAA" }
2015-08-01 02:58:39 +08:00
!40 = !DILocalVariable ( name: "s" , line: 7 , scope: !18 , file: !5 , type: !20 )
2015-04-30 00:38:44 +08:00
!41 = !DILocation ( line: 8 , scope: !18 , inlinedAt: !32 )
!42 = !DILocation ( line: 9 , scope: !18 , inlinedAt: !32 )
!43 = !DILocation ( line: 10 , scope: !14 , inlinedAt: !32 )
!44 = !DILocation ( line: 19 , scope: !8 )