1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/test/DebugInfo/PDB/pdb-resolve-forward-refs.test
Zachary Turner 8926b7b1e5 [PDB] Add the ability to map forward references to full decls.
Some records point to an LF_CLASS, LF_UNION, LF_STRUCTURE, or LF_ENUM
which is a forward reference and doesn't contain complete debug
information. In these cases, we'd like to be able to quickly locate the
full record. The TPI stream stores an array of pre-computed record hash
values, one for each type record. If we pre-process this on startup, we
can build a mapping from hash value -> {list of possible matching type
indices}. Since hashes of full records are only based on the name and or
unique name and not the full record contents, we can then use forward
ref record to compute the hash of what *would* be the full record by
just hashing the name, use this to get the list of possible matches, and
iterate those looking for a match on name or unique name.

llvm-pdbutil is updated to resolve forward references for the purposes
of testing (plus it's just useful).

Differential Revision: https://reviews.llvm.org/D52283

llvm-svn: 342656
2018-09-20 15:50:13 +00:00

99 lines
6.3 KiB
Plaintext

; RUN: llvm-pdbutil dump -types %p/Inputs/every-class.pdb \
; RUN: | FileCheck %s
; CHECK: Types (TPI Stream)
; CHECK: ============================================================
; CHECK: Showing 157 records
; CHECK: 0x1008 | LF_STRUCTURE [size = 124] `main::__l2::<unnamed-type-Anonymous>`
; CHECK: unique name: `.?AU<unnamed-type-Anonymous>@?1??main@@YAHHPEAPEAD@Z@`aa6523bc`
; CHECK: vtable: <no type>, base list: <no type>, field list: 0x1007
; CHECK: options: has unique name | scoped, sizeof 1
; CHECK: 0x1009 | LF_STRUCTURE [size = 88] `main::__l2::Scoped`
; CHECK: unique name: `.?AUScoped@?1??main@@YAHHPEAPEAD@Z@`aa6523bc`
; CHECK: vtable: <no type>, base list: <no type>, field list: 0x1007
; CHECK: options: has unique name | scoped, sizeof 1
; CHECK: 0x1054 | LF_STRUCTURE [size = 48] `Nested::F`
; CHECK: unique name: `.?AUF@Nested@@`
; CHECK: vtable: <no type>, base list: <no type>, field list: <no type>
; CHECK: options: forward ref (-> 0x1057) | has unique name | is nested, sizeof 0
; CHECK: 0x1056 | LF_STRUCTURE [size = 44] `Nested`
; CHECK: unique name: `.?AUNested@@`
; CHECK: vtable: <no type>, base list: <no type>, field list: 0x1055
; CHECK: options: contains nested class | has unique name, sizeof 1
; CHECK: 0x1057 | LF_STRUCTURE [size = 48] `Nested::F`
; CHECK: unique name: `.?AUF@Nested@@`
; CHECK: vtable: <no type>, base list: <no type>, field list: 0x1007
; CHECK: options: has unique name | is nested, sizeof 1
; CHECK: 0x1058 | LF_STRUCTURE [size = 52] `Constructor`
; CHECK: unique name: `.?AUConstructor@@`
; CHECK: vtable: <no type>, base list: <no type>, field list: <no type>
; CHECK: options: forward ref (-> 0x105C) | has unique name, sizeof 0
; CHECK: 0x105C | LF_STRUCTURE [size = 52] `Constructor`
; CHECK: unique name: `.?AUConstructor@@`
; CHECK: vtable: <no type>, base list: <no type>, field list: 0x105B
; CHECK: options: has ctor / dtor | has unique name, sizeof 1
; CHECK: 0x105D | LF_CLASS [size = 40] `Class`
; CHECK: unique name: `.?AVClass@@`
; CHECK: vtable: <no type>, base list: <no type>, field list: 0x1007
; CHECK: options: has unique name, sizeof 1
; CHECK: 0x105E | LF_UNION [size = 32] `Union`
; CHECK: unique name: `.?ATUnion@@`
; CHECK: field list: 0x1007
; CHECK: options: has unique name | sealed, sizeof 1
; CHECK: 0x105F | LF_STRUCTURE [size = 48] `Operator`
; CHECK: unique name: `.?AUOperator@@`
; CHECK: vtable: <no type>, base list: <no type>, field list: <no type>
; CHECK: options: forward ref (-> 0x1064) | has unique name, sizeof 0
; CHECK: 0x1064 | LF_STRUCTURE [size = 48] `Operator`
; CHECK: unique name: `.?AUOperator@@`
; CHECK: vtable: <no type>, base list: <no type>, field list: 0x1063
; CHECK: options: has unique name | overloaded operator, sizeof 1
; CHECK: 0x1066 | LF_ENUM [size = 36] `Enum`
; CHECK: unique name: `.?AW4Enum@@`
; CHECK: field list: 0x1065, underlying type: 0x0074 (int)
; CHECK: options: has unique name
; CHECK: 0x1067 | LF_STRUCTURE [size = 40] `Cast`
; CHECK: unique name: `.?AUCast@@`
; CHECK: vtable: <no type>, base list: <no type>, field list: <no type>
; CHECK: options: forward ref (-> 0x106B) | has unique name, sizeof 0
; CHECK: 0x106B | LF_STRUCTURE [size = 40] `Cast`
; CHECK: unique name: `.?AUCast@@`
; CHECK: vtable: <no type>, base list: <no type>, field list: 0x106A
; CHECK: options: conversion operator | has unique name | overloaded operator, sizeof 1
; CHECK: 0x106C | LF_STRUCTURE [size = 44] `Nothing`
; CHECK: unique name: `.?AUNothing@@`
; CHECK: vtable: <no type>, base list: <no type>, field list: 0x1007
; CHECK: options: has unique name, sizeof 1
; CHECK: 0x106D | LF_STRUCTURE [size = 52] `Assignment`
; CHECK: unique name: `.?AUAssignment@@`
; CHECK: vtable: <no type>, base list: <no type>, field list: <no type>
; CHECK: options: forward ref (-> 0x1073) | has unique name, sizeof 0
; CHECK: 0x1073 | LF_STRUCTURE [size = 52] `Assignment`
; CHECK: unique name: `.?AUAssignment@@`
; CHECK: vtable: <no type>, base list: <no type>, field list: 0x1072
; CHECK: options: has unique name | overloaded operator | overloaded operator=, sizeof 1
; CHECK: 0x1074 | LF_STRUCTURE [size = 44] `Nothing`
; CHECK: unique name: `.?AUNothing@@`
; CHECK: vtable: <no type>, base list: <no type>, field list: <no type>
; CHECK: options: forward ref (<- 0x106C) | has unique name, sizeof 0
; CHECK: 0x1081 | LF_UNION [size = 32] `Union`
; CHECK: unique name: `.?ATUnion@@`
; CHECK: field list: <no type>
; CHECK: options: forward ref (<- 0x105E) | has unique name, sizeof 0
; CHECK: 0x1084 | LF_STRUCTURE [size = 124] `main::__l2::<unnamed-type-Anonymous>`
; CHECK: unique name: `.?AU<unnamed-type-Anonymous>@?1??main@@YAHHPEAPEAD@Z@`aa6523bc`
; CHECK: vtable: <no type>, base list: <no type>, field list: <no type>
; CHECK: options: forward ref (<- 0x1008) | has unique name | scoped, sizeof 0
; CHECK: 0x108E | LF_STRUCTURE [size = 44] `Nested`
; CHECK: unique name: `.?AUNested@@`
; CHECK: vtable: <no type>, base list: <no type>, field list: <no type>
; CHECK: options: forward ref (<- 0x1056) | has unique name, sizeof 0
; CHECK: 0x1095 | LF_STRUCTURE [size = 88] `main::__l2::Scoped`
; CHECK: unique name: `.?AUScoped@?1??main@@YAHHPEAPEAD@Z@`aa6523bc`
; CHECK: vtable: <no type>, base list: <no type>, field list: <no type>
; CHECK: options: forward ref (<- 0x1009) | has unique name | scoped, sizeof 0
; CHECK: 0x1098 | LF_CLASS [size = 40] `Class`
; CHECK: unique name: `.?AVClass@@`
; CHECK: vtable: <no type>, base list: <no type>, field list: <no type>
; CHECK: options: forward ref (<- 0x105D) | has unique name, sizeof 0