mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-04 18:06:49 +00:00
e56023a059
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
71 lines
4.0 KiB
LLVM
71 lines
4.0 KiB
LLVM
; RUN: %llc_dwarf -O0 < %s | grep AT_decl_file | grep 2
|
|
; Here _ZN1S3fooEv is defined in header file identified as AT_decl_file no. 2 in debug info.
|
|
%struct.S = type <{ i8 }>
|
|
|
|
define i32 @_Z3barv() nounwind ssp {
|
|
entry:
|
|
%retval = alloca i32 ; <i32*> [#uses=2]
|
|
%0 = alloca i32 ; <i32*> [#uses=2]
|
|
%s1 = alloca %struct.S ; <%struct.S*> [#uses=1]
|
|
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
|
|
call void @llvm.dbg.declare(metadata %struct.S* %s1, metadata !0, metadata !DIExpression()), !dbg !16
|
|
%1 = call i32 @_ZN1S3fooEv(%struct.S* %s1) nounwind, !dbg !17 ; <i32> [#uses=1]
|
|
store i32 %1, i32* %0, align 4, !dbg !17
|
|
%2 = load i32, i32* %0, align 4, !dbg !17 ; <i32> [#uses=1]
|
|
store i32 %2, i32* %retval, align 4, !dbg !17
|
|
br label %return, !dbg !17
|
|
|
|
return: ; preds = %entry
|
|
%retval1 = load i32, i32* %retval, !dbg !17 ; <i32> [#uses=1]
|
|
ret i32 %retval1, !dbg !16
|
|
}
|
|
|
|
define linkonce_odr i32 @_ZN1S3fooEv(%struct.S* %this) nounwind ssp align 2 {
|
|
entry:
|
|
%this_addr = alloca %struct.S* ; <%struct.S**> [#uses=1]
|
|
%retval = alloca i32 ; <i32*> [#uses=1]
|
|
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
|
|
call void @llvm.dbg.declare(metadata %struct.S** %this_addr, metadata !18, metadata !DIExpression()), !dbg !21
|
|
store %struct.S* %this, %struct.S** %this_addr
|
|
br label %return, !dbg !21
|
|
|
|
return: ; preds = %entry
|
|
%retval1 = load i32, i32* %retval, !dbg !21 ; <i32> [#uses=1]
|
|
ret i32 %retval1, !dbg !22
|
|
}
|
|
|
|
declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
|
|
|
|
!llvm.dbg.cu = !{!5}
|
|
!llvm.module.flags = !{!28}
|
|
|
|
!0 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "s1", line: 3, scope: !1, file: !4, type: !9)
|
|
!1 = distinct !DILexicalBlock(line: 3, column: 0, file: !25, scope: !2)
|
|
!2 = distinct !DILexicalBlock(line: 3, column: 0, file: !25, scope: !3)
|
|
!3 = !DISubprogram(name: "bar", linkageName: "_Z3barv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 3, file: !25, scope: !4, type: !6, function: i32 ()* @_Z3barv)
|
|
!4 = !DIFile(filename: "one.cc", directory: "/tmp/")
|
|
!5 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !25, enums: !27, retainedTypes: !27, subprograms: !24, imports: null)
|
|
!6 = !DISubroutineType(types: !7)
|
|
!7 = !{!8}
|
|
!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
|
!9 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", line: 2, size: 8, align: 8, file: !26, scope: !4, elements: !11)
|
|
!10 = !DIFile(filename: "one.h", directory: "/tmp/")
|
|
!11 = !{!12}
|
|
!12 = !DISubprogram(name: "foo", linkageName: "_ZN1S3fooEv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 3, file: !26, scope: !9, type: !13, function: i32 (%struct.S*)* @_ZN1S3fooEv)
|
|
!13 = !DISubroutineType(types: !14)
|
|
!14 = !{!8, !15}
|
|
!15 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !25, scope: !4, baseType: !9)
|
|
!16 = !DILocation(line: 3, scope: !1)
|
|
!17 = !DILocation(line: 3, scope: !3)
|
|
!18 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 3, arg: 0, scope: !12, file: !10, type: !19)
|
|
!19 = !DIDerivedType(tag: DW_TAG_const_type, size: 64, align: 64, flags: DIFlagArtificial, file: !25, scope: !4, baseType: !20)
|
|
!20 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !25, scope: !4, baseType: !9)
|
|
!21 = !DILocation(line: 3, scope: !12)
|
|
!22 = !DILocation(line: 3, scope: !23)
|
|
!23 = distinct !DILexicalBlock(line: 3, column: 0, file: !26, scope: !12)
|
|
!24 = !{!3, !12}
|
|
!25 = !DIFile(filename: "one.cc", directory: "/tmp/")
|
|
!26 = !DIFile(filename: "one.h", directory: "/tmp/")
|
|
!27 = !{}
|
|
!28 = !{i32 1, !"Debug Info Version", i32 3}
|