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
52 lines
2.6 KiB
LLVM
52 lines
2.6 KiB
LLVM
; REQUIRES: object-emission
|
|
|
|
; RUN: %llc_dwarf -O0 -filetype=obj %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
|
|
|
|
; Ensure that pointer constants are emitted as unsigned data. Alternatively,
|
|
; these could be signless data (dataN).
|
|
|
|
; Built with Clang from:
|
|
; template <void *V, void (*F)(), int i>
|
|
; void func() {}
|
|
; template void func<nullptr, nullptr, 42>();
|
|
|
|
; CHECK: DW_TAG_subprogram
|
|
; CHECK: DW_TAG_template_value_parameter
|
|
; CHECK: DW_AT_name {{.*}} "V"
|
|
; CHECK: DW_AT_const_value [DW_FORM_udata] (0)
|
|
; CHECK: DW_TAG_template_value_parameter
|
|
; CHECK: DW_AT_name {{.*}} "F"
|
|
; CHECK: DW_AT_const_value [DW_FORM_udata] (0)
|
|
|
|
; Function Attrs: nounwind uwtable
|
|
define weak_odr void @_Z4funcILPv0ELPFvvE0ELi42EEvv() #0 {
|
|
entry:
|
|
ret void, !dbg !18
|
|
}
|
|
|
|
attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
|
|
|
!llvm.dbg.cu = !{!0}
|
|
!llvm.module.flags = !{!15, !16}
|
|
!llvm.ident = !{!17}
|
|
|
|
!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
|
|
!1 = !MDFile(filename: "constant-pointers.cpp", directory: "/tmp/dbginfo")
|
|
!2 = !{}
|
|
!3 = !{!4}
|
|
!4 = !MDSubprogram(name: "func<nullptr, nullptr, 42>", linkageName: "_Z4funcILPv0ELPFvvE0ELi42EEvv", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: void ()* @_Z4funcILPv0ELPFvvE0ELi42EEvv, templateParams: !8, variables: !2)
|
|
!5 = !MDFile(filename: "constant-pointers.cpp", directory: "/tmp/dbginfo")
|
|
!6 = !MDSubroutineType(types: !7)
|
|
!7 = !{null}
|
|
!8 = !{!9, !11, !13}
|
|
!9 = !MDTemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "V", type: !10, value: i8 0)
|
|
!10 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: null)
|
|
!11 = !MDTemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "F", type: !12, value: i8 0)
|
|
!12 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !6)
|
|
!13 = !MDTemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "i", type: !14, value: i32 42)
|
|
!14 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
|
!15 = !{i32 2, !"Dwarf Version", i32 4}
|
|
!16 = !{i32 2, !"Debug Info Version", i32 3}
|
|
!17 = !{!"clang version 3.5.0 "}
|
|
!18 = !MDLocation(line: 3, scope: !4)
|