mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-29 23:12:55 +01:00
8d1b74869c
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. llvm-svn: 231082
41 lines
1.8 KiB
LLVM
41 lines
1.8 KiB
LLVM
; RUN: llc -mtriple=aarch64-non-linux-gnu -dwarf-version=4 < %s -filetype=obj \
|
|
; RUN: | llvm-dwarfdump - | FileCheck -check-prefix=CHECK -check-prefix=CHECK-4 %s
|
|
; RUN: llc -mtriple=aarch64-non-linux-gnu -dwarf-version=3 < %s -filetype=obj \
|
|
; RUN: | llvm-dwarfdump - | FileCheck -check-prefix=CHECK -check-prefix=CHECK-3 %s
|
|
|
|
; We're mostly checking that relocations are applied correctly
|
|
; here. Currently R_AARCH64_ABS32 is used for references to debug data
|
|
; and R_AARCH64_ABS64 is used for program addresses.
|
|
|
|
; A couple of ABS32s, both at 0 and elsewhere, interpreted correctly:
|
|
|
|
; CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000000] = "clang version 3.3 ")
|
|
; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000013] = "tmp.c")
|
|
|
|
; A couple of ABS64s similarly:
|
|
|
|
; CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
|
|
; CHECK-4: DW_AT_high_pc [DW_FORM_data4] (0x00000008)
|
|
; CHECK-3: DW_AT_high_pc [DW_FORM_addr] (0x0000000000000008)
|
|
|
|
define i32 @main() nounwind {
|
|
ret i32 0, !dbg !8
|
|
}
|
|
|
|
attributes #0 = { nounwind }
|
|
|
|
!llvm.dbg.cu = !{!0}
|
|
!llvm.module.flags = !{!10}
|
|
|
|
!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 0, file: !9, enums: !1, retainedTypes: !1, subprograms: !2, globals: !1, imports: !1)
|
|
!1 = !{}
|
|
!2 = !{!3}
|
|
!3 = !MDSubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !9, scope: !4, type: !5, function: i32 ()* @main, variables: !1)
|
|
!4 = !MDFile(filename: "tmp.c", directory: "/home/tim/llvm/build")
|
|
!5 = !MDSubroutineType(types: !6)
|
|
!6 = !{!7}
|
|
!7 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
|
!8 = !MDLocation(line: 2, scope: !3)
|
|
!9 = !MDFile(filename: "tmp.c", directory: "/home/tim/llvm/build")
|
|
!10 = !{i32 1, !"Debug Info Version", i32 3}
|