mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 21:32:10 +00:00
b056aa798d
Move the specialized metadata nodes for the new debug info hierarchy into place, finishing off PR22464. I've done bootstraps (and all that) and I'm confident this commit is NFC as far as DWARF output is concerned. Let me know if I'm wrong :). The code changes are fairly mechanical: - Bumped the "Debug Info Version". - `DIBuilder` now creates the appropriate subclass of `MDNode`. - Subclasses of DIDescriptor now expect to hold their "MD" counterparts (e.g., `DIBasicType` expects `MDBasicType`). - Deleted a ton of dead code in `AsmWriter.cpp` and `DebugInfo.cpp` for printing comments. - Big update to LangRef to describe the nodes in the new hierarchy. Feel free to make it better. Testcase changes are enormous. There's an accompanying clang commit on its way. If you have out-of-tree debug info testcases, I just broke your build. - `upgrade-specialized-nodes.sh` is attached to PR22564. I used it to update all the IR testcases. - Unfortunately I failed to find way to script the updates to CHECK lines, so I updated all of these by hand. This was fairly painful, since the old CHECKs are difficult to reason about. That's one of the benefits of the new hierarchy. This work isn't quite finished, BTW. The `DIDescriptor` subclasses are almost empty wrappers, but not quite: they still have loose casting checks (see the `RETURN_FROM_RAW()` macro). Once they're completely gutted, I'll rename the "MD" classes to "DI" and kill the wrappers. I also expect to make a few schema changes now that it's easier to reason about everything. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231082 91177308-0d34-0410-b5e6-96231b3b80d8
80 lines
3.7 KiB
LLVM
80 lines
3.7 KiB
LLVM
; REQUIRES: object-emission
|
|
|
|
; RUN: %llc_dwarf -filetype=obj < %s > %t
|
|
; RUN: llvm-dwarfdump %t | FileCheck %s
|
|
|
|
; IR generated from clang -O -g with the following source
|
|
;
|
|
; void f1(int x, int y);
|
|
; void f3(int line);
|
|
; void f2() {
|
|
; f1(1, 2);
|
|
; }
|
|
; void f1(int x, int y) {
|
|
; f3(y);
|
|
; }
|
|
|
|
; CHECK: DW_AT_name{{.*}}"f1"
|
|
; CHECK: DW_TAG_formal_parameter
|
|
; CHECK-NOT: DW_TAG
|
|
; CHECK: DW_AT_name{{.*}}"x"
|
|
; CHECK: DW_TAG_formal_parameter
|
|
; CHECK-NOT: DW_TAG
|
|
; CHECK: DW_AT_name{{.*}}"y"
|
|
|
|
; Function Attrs: uwtable
|
|
define void @_Z2f2v() #0 {
|
|
tail call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !16, metadata !MDExpression()), !dbg !18
|
|
tail call void @llvm.dbg.value(metadata i32 2, i64 0, metadata !20, metadata !MDExpression()), !dbg !18
|
|
tail call void @_Z2f3i(i32 2), !dbg !21
|
|
ret void, !dbg !22
|
|
}
|
|
|
|
; Function Attrs: uwtable
|
|
define void @_Z2f1ii(i32 %x, i32 %y) #0 {
|
|
tail call void @llvm.dbg.value(metadata i32 %x, i64 0, metadata !13, metadata !MDExpression()), !dbg !23
|
|
tail call void @llvm.dbg.value(metadata i32 %y, i64 0, metadata !14, metadata !MDExpression()), !dbg !23
|
|
tail call void @_Z2f3i(i32 %y), !dbg !24
|
|
ret void, !dbg !25
|
|
}
|
|
|
|
declare void @_Z2f3i(i32) #1
|
|
|
|
; Function Attrs: nounwind readnone
|
|
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2
|
|
|
|
attributes #0 = { uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "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" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
|
attributes #2 = { nounwind readnone }
|
|
|
|
!llvm.dbg.cu = !{!0}
|
|
!llvm.module.flags = !{!26}
|
|
|
|
!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
|
|
!1 = !MDFile(filename: "exp.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
|
|
!2 = !{}
|
|
!3 = !{!4, !8}
|
|
!4 = !MDSubprogram(name: "f2", linkageName: "_Z2f2v", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, function: void ()* @_Z2f2v, variables: !2)
|
|
!5 = !MDFile(filename: "exp.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
|
|
!6 = !MDSubroutineType(types: !7)
|
|
!7 = !{null}
|
|
!8 = !MDSubprogram(name: "f1", linkageName: "_Z2f1ii", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 6, file: !1, scope: !5, type: !9, function: void (i32, i32)* @_Z2f1ii, variables: !12)
|
|
!9 = !MDSubroutineType(types: !10)
|
|
!10 = !{null, !11, !11}
|
|
!11 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
|
!12 = !{!13, !14}
|
|
!13 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 6, arg: 1, scope: !8, file: !5, type: !11)
|
|
!14 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "y", line: 6, arg: 2, scope: !8, file: !5, type: !11)
|
|
!15 = !{i32 undef}
|
|
!16 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 6, arg: 1, scope: !8, file: !5, type: !11, inlinedAt: !17)
|
|
!17 = !MDLocation(line: 4, scope: !4)
|
|
!18 = !MDLocation(line: 6, scope: !8, inlinedAt: !17)
|
|
!19 = !{i32 2}
|
|
!20 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "y", line: 6, arg: 2, scope: !8, file: !5, type: !11, inlinedAt: !17)
|
|
!21 = !MDLocation(line: 7, scope: !8, inlinedAt: !17)
|
|
!22 = !MDLocation(line: 5, scope: !4)
|
|
!23 = !MDLocation(line: 6, scope: !8)
|
|
!24 = !MDLocation(line: 7, scope: !8)
|
|
!25 = !MDLocation(line: 8, scope: !8)
|
|
!26 = !{i32 1, !"Debug Info Version", i32 3}
|