mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-07 12:07:17 +00:00
1ef70ff39b
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
45 lines
1.9 KiB
LLVM
45 lines
1.9 KiB
LLVM
; REQUIRES: object-emission
|
|
|
|
; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
|
|
|
|
; Check that two compile units are generated
|
|
|
|
; CHECK: Compile Unit:
|
|
; CHECK: Compile Unit:
|
|
|
|
define i32 @foo() nounwind readnone ssp {
|
|
return:
|
|
ret i32 42, !dbg !0
|
|
}
|
|
|
|
define i32 @bar() nounwind readnone ssp {
|
|
return:
|
|
ret i32 21, !dbg !8
|
|
}
|
|
|
|
!llvm.dbg.cu = !{!4, !12}
|
|
!llvm.module.flags = !{!21}
|
|
!16 = !{!2}
|
|
!17 = !{!10}
|
|
|
|
!0 = !{i32 3, i32 0, !1, null}
|
|
!1 = !{!"0xb\002\000\000", !18, !2} ; [ DW_TAG_lexical_block ]
|
|
!2 = !{!"0x2e\00foo\00foo\00foo\002\000\001\000\006\000\000\000", !18, !3, !5, null, i32 ()* @foo, null, null, null} ; [ DW_TAG_subprogram ]
|
|
!3 = !{!"0x29", !18} ; [ DW_TAG_file_type ]
|
|
!4 = !{!"0x11\001\004.2.1 (Based on Apple Inc. build 5658) (LLVM build)\000\00\000\00\000", !18, !19, !19, !16, null, null} ; [ DW_TAG_compile_unit ]
|
|
!5 = !{!"0x15\00\000\000\000\000\000\000", !18, !3, null, !6, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
|
|
!6 = !{!7}
|
|
!7 = !{!"0x24\00int\000\0032\0032\000\000\005", !18, !3} ; [ DW_TAG_base_type ]
|
|
!8 = !{i32 3, i32 0, !9, null}
|
|
!9 = !{!"0xb\002\000\000", !20, !10} ; [ DW_TAG_lexical_block ]
|
|
!10 = !{!"0x2e\00bar\00bar\00bar\002\000\001\000\006\000\000\000", !20, !11, !13, null, i32 ()* @bar, null, null, null} ; [ DW_TAG_subprogram ]
|
|
!11 = !{!"0x29", !20} ; [ DW_TAG_file_type ]
|
|
!12 = !{!"0x11\001\004.2.1 (Based on Apple Inc. build 5658) (LLVM build)\000\00\000\00\000", !20, !19, !19, !17, null, null} ; [ DW_TAG_compile_unit ]
|
|
!13 = !{!"0x15\00\000\000\000\000\000\000", !20, !11, null, !14, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
|
|
!14 = !{!15}
|
|
!15 = !{!"0x24\00int\000\0032\0032\000\000\005", !20, !11} ; [ DW_TAG_base_type ]
|
|
!18 = !{!"a.c", !"/tmp/"}
|
|
!19 = !{i32 0}
|
|
!20 = !{!"b.c", !"/tmp/"}
|
|
!21 = !{i32 1, !"Debug Info Version", i32 2}
|