mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
94512f24de
Eliminate DITypeIdentifierMap and make DITypeRef a thin wrapper around DIType*. It is no longer legal to refer to a DICompositeType by its 'identifier:', and DIBuilder no longer retains all types with an 'identifier:' automatically. Aside from the bitcode upgrade, this is mainly removing logic to resolve an MDString-based reference to an actualy DIType. The commits leading up to this have made the implicit type map in DICompileUnit's 'retainedTypes:' field superfluous. This does not remove DITypeRef, DIScopeRef, DINodeRef, and DITypeRefArray, or stop using them in DI-related metadata. Although as of this commit they aren't serving a useful purpose, there are patchces under review to reuse them for CodeView support. The tests in LLVM were updated with deref-typerefs.sh, which is attached to the thread "[RFC] Lazy-loading of debug info metadata": http://lists.llvm.org/pipermail/llvm-dev/2016-April/098318.html llvm-svn: 267296
31 lines
1.3 KiB
LLVM
31 lines
1.3 KiB
LLVM
; REQUIRES: object-emission
|
|
|
|
; RUN: %llc_dwarf -filetype=obj -O0 < %s > %t
|
|
; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
|
|
; CHECK: DW_TAG_ptr_to_member_type
|
|
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE:0x[0-9a-f]+]]})
|
|
; CHECK: [[TYPE]]: DW_TAG_base_type
|
|
; IR generated from clang -g with the following source:
|
|
; struct Foo {
|
|
; int e;
|
|
; };
|
|
; int Foo:*x = 0;
|
|
|
|
@x = global i64 -1, align 8
|
|
|
|
!llvm.dbg.cu = !{!0}
|
|
!llvm.module.flags = !{!10, !11}
|
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !5, imports: !2)
|
|
!1 = !DIFile(filename: "foo.cpp", directory: ".")
|
|
!2 = !{}
|
|
!3 = !{!4}
|
|
!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", line: 1, flags: DIFlagFwdDecl, file: !1, identifier: "_ZTS3Foo")
|
|
!5 = !{!6}
|
|
!6 = !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !7, type: !8, variable: i64* @x)
|
|
!7 = !DIFile(filename: "foo.cpp", directory: ".")
|
|
!8 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !9, extraData: !4)
|
|
!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
|
!10 = !{i32 2, !"Dwarf Version", i32 2}
|
|
!11 = !{i32 1, !"Debug Info Version", i32 3}
|