mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-25 03:30:37 +00:00
Finish off PR23080 by renaming the debug info IR constructs from `MD*` to `DI*`. The last of the `DIDescriptor` classes were deleted in r235356, and the last of the related typedefs removed in r235413, so this has all baked for about a week. Note: If you have out-of-tree code (like a frontend), I recommend that you get everything compiling and tests passing with the *previous* commit before updating to this one. It'll be easier to keep track of what code is using the `DIDescriptor` hierarchy and what you've already updated, and I think you're extremely unlikely to insert bugs. YMMV of course. Back to *this* commit: I did this using the rename-md-di-nodes.sh upgrade script I've attached to PR23080 (both code and testcases) and filtered through clang-format-diff.py. I edited the tests for test/Assembler/invalid-generic-debug-node-*.ll by hand since the columns were off-by-three. It should work on your out-of-tree testcases (and code, if you've followed the advice in the previous paragraph). Some of the tests are in badly named files now (e.g., test/Assembler/invalid-mdcompositetype-missing-tag.ll should be 'dicompositetype'); I'll come back and move the files in a follow-up commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236120 91177308-0d34-0410-b5e6-96231b3b80d8
53 lines
2.7 KiB
LLVM
53 lines
2.7 KiB
LLVM
; RUN: llc -mtriple=x86_64-apple-darwin < %s | FileCheck %s
|
|
; RUN: llc -mtriple=x86_64-apple-darwin -regalloc=basic < %s | FileCheck %s
|
|
; Test to check separate label for inlined function argument.
|
|
|
|
define i32 @foo(i32 %y) nounwind optsize ssp {
|
|
entry:
|
|
tail call void @llvm.dbg.value(metadata i32 %y, i64 0, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1)
|
|
%0 = tail call i32 (...) @zoo(i32 %y) nounwind, !dbg !9 ; <i32> [#uses=1]
|
|
ret i32 %0, !dbg !9
|
|
}
|
|
|
|
declare i32 @zoo(...)
|
|
|
|
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
|
|
|
|
define i32 @bar(i32 %x) nounwind optsize ssp {
|
|
entry:
|
|
tail call void @llvm.dbg.value(metadata i32 %x, i64 0, metadata !7, metadata !DIExpression()), !dbg !DILocation(scope: !8)
|
|
tail call void @llvm.dbg.value(metadata i32 1, i64 0, metadata !0, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !1)
|
|
%0 = tail call i32 (...) @zoo(i32 1) nounwind, !dbg !12 ; <i32> [#uses=1]
|
|
%1 = add nsw i32 %0, %x, !dbg !13 ; <i32> [#uses=1]
|
|
ret i32 %1, !dbg !13
|
|
}
|
|
|
|
!llvm.dbg.cu = !{!3}
|
|
!llvm.module.flags = !{!20}
|
|
|
|
!0 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "y", line: 2, arg: 0, scope: !1, file: !2, type: !6)
|
|
!1 = !DISubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 2, file: !18, scope: !2, type: !4, function: i32 (i32)* @foo, variables: !15)
|
|
!2 = !DIFile(filename: "f.c", directory: "/tmp")
|
|
!3 = !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 1, file: !18, enums: !19, retainedTypes: !19, subprograms: !17, imports: null)
|
|
!4 = !DISubroutineType(types: !5)
|
|
!5 = !{!6, !6}
|
|
!6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
|
!7 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 6, arg: 0, scope: !8, file: !2, type: !6)
|
|
!8 = !DISubprogram(name: "bar", linkageName: "bar", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 6, file: !18, scope: !2, type: !4, function: i32 (i32)* @bar, variables: !16)
|
|
!9 = !DILocation(line: 3, scope: !10)
|
|
!10 = distinct !DILexicalBlock(line: 2, column: 0, file: !18, scope: !1)
|
|
!11 = !{i32 1}
|
|
!12 = !DILocation(line: 3, scope: !10, inlinedAt: !13)
|
|
!13 = !DILocation(line: 7, scope: !14)
|
|
!14 = distinct !DILexicalBlock(line: 6, column: 0, file: !18, scope: !8)
|
|
!15 = !{!0}
|
|
!16 = !{!7}
|
|
!17 = !{!1, !8}
|
|
!18 = !DIFile(filename: "f.c", directory: "/tmp")
|
|
!19 = !{}
|
|
|
|
;CHECK: DEBUG_VALUE: bar:x <- E
|
|
;CHECK: Ltmp
|
|
;CHECK: DEBUG_VALUE: foo:y <- 1{{$}}
|
|
!20 = !{i32 1, !"Debug Info Version", i32 3}
|