llvm-project/llvm/test/DebugInfo/COFF
Zachary Turner 6900de1dfb [CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder.
The motivation behind this patch is that future directions require us to
be able to compute the hash value of records independently of actually
using them for de-duplication.

The current structure of TypeSerializer / TypeTableBuilder being a
single entry point that takes an unserialized type record, and then
hashes and de-duplicates it is not flexible enough to allow this.

At the same time, the existing TypeSerializer is already extremely
complex for this very reason -- it tries to be too many things. In
addition to serializing, hashing, and de-duplicating, ti also supports
splitting up field list records and adding continuations. All of this
functionality crammed into this one class makes it very complicated to
work with and hard to maintain.

To solve all of these problems, I've re-written everything from scratch
and split the functionality into separate pieces that can easily be
reused. The end result is that one class TypeSerializer is turned into 3
new classes SimpleTypeSerializer, ContinuationRecordBuilder, and
TypeTableBuilder, each of which in isolation is simple and
straightforward.

A quick summary of these new classes and their responsibilities are:

- SimpleTypeSerializer : Turns a non-FieldList leaf type into a series of
  bytes. Does not do any hashing. Every time you call it, it will
  re-serialize and return bytes again. The same instance can be re-used
  over and over to avoid re-allocations, and in exchange for this
  optimization the bytes returned by the serializer only live until the
  caller attempts to serialize a new record.

- ContinuationRecordBuilder : Turns a FieldList-like record into a series
  of fragments. Does not do any hashing. Like SimpleTypeSerializer,
  returns references to privately owned bytes, so the storage is
  invalidated as soon as the caller tries to re-use the instance. Works
  equally well for LF_FIELDLIST as it does for LF_METHODLIST, solving a
  long-standing theoretical limitation of the previous implementation.

- TypeTableBuilder : Accepts sequences of bytes that the user has already
  serialized, and inserts them by de-duplicating with a hash table. For
  the sake of convenience and efficiency, this class internally stores a
  SimpleTypeSerializer so that it can accept unserialized records. The
  same is not true of ContinuationRecordBuilder. The user is required to
  create their own instance of ContinuationRecordBuilder.

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

llvm-svn: 319198
2017-11-28 18:33:17 +00:00
..
anonymous-struct.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
array-odr-violation.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
asan-module-ctor.ll [codeview] Implement FPO data assembler directives 2017-10-11 21:24:33 +00:00
asan-module-without-functions.ll
asm.ll [codeview] Change readobj symbol dumping format 2017-07-11 23:41:41 +00:00
big-type.ll [CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder. 2017-11-28 18:33:17 +00:00
bitfields.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
comdat.ll Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
cpp-mangling.ll [codeview] Change readobj symbol dumping format 2017-07-11 23:41:41 +00:00
defer-complete-type.ll
dlang.ll Followup to r308890: don't assert the llvm llvm version number. 2017-07-24 19:44:43 +00:00
enum.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
fp-stack.ll CodeView: Provide a .def file with the register ids 2017-10-03 18:27:22 +00:00
fpo-argsize.ll [codeview] Implement FPO data assembler directives 2017-10-11 21:24:33 +00:00
fpo-csrs.ll [CodeGen] Print register names in lowercase in both MIR and debug output 2017-11-28 17:15:09 +00:00
fpo-funclet.ll [codeview] Don't emit FPO data in funclet prologues 2017-10-12 18:20:35 +00:00
fpo-realign-alloca.ll [codeview] Implement FPO data assembler directives 2017-10-11 21:24:33 +00:00
fpo-shrink-wrap.ll [codeview] Implement FPO data assembler directives 2017-10-11 21:24:33 +00:00
fpo-stack-protect.ll [codeview] Implement FPO data assembler directives 2017-10-11 21:24:33 +00:00
global-dllimport.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
globals-discarded.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
globals.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
inheritance.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
inlining-files.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
inlining-header.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
inlining-levels.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
inlining-padding.ll
inlining-same-name.ll [codeview] Change readobj symbol dumping format 2017-07-11 23:41:41 +00:00
inlining.ll Re-land "Fix Bug 30978 by emitting cv file checksums." 2017-09-19 18:14:45 +00:00
int8-char-type.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
lines-bb-start.ll [codeview] Ignore DBG_VALUEs when choosing a BB start source loc 2017-07-31 21:03:08 +00:00
lines-difile.ll [codeview] Merge file checksum entries for DIFiles with the same absolute path 2017-10-31 21:52:15 +00:00
lit.local.cfg
local-constant.ll Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
local-variable-gap.ll [CodeGen] Print register names in lowercase in both MIR and debug output 2017-11-28 17:15:09 +00:00
local-variables.ll CodeView symbol dumper: use symbolic names for registers 2017-10-02 17:44:47 +00:00
long-name.ll [codeview] Change readobj symbol dumping format 2017-07-11 23:41:41 +00:00
long-type-name.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
multifile.ll Re-land "Fix Bug 30978 by emitting cv file checksums." 2017-09-19 18:14:45 +00:00
multifunction.ll [codeview] Implement FPO data assembler directives 2017-10-11 21:24:33 +00:00
nested-types.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
no-cus.ll [codeview] Fix assertion failure introduced in r295354 refactoring 2017-05-12 17:02:40 +00:00
parameter-order.ll
pieces.ll [CodeGen] Print register names in lowercase in both MIR and debug output 2017-11-28 17:15:09 +00:00
pr28747.ll Emit S_COMPILE3 record once per TU rather than once per function 2016-11-02 21:30:35 +00:00
purge-typedef-udts.ll [CodeView] Don't output S_UDT symbols for forward decls. 2017-08-28 18:49:04 +00:00
register-variables.ll [CodeGen] Print register names in lowercase in both MIR and debug output 2017-11-28 17:15:09 +00:00
retained-types.ll
scopes.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
simple.ll [codeview] Implement FPO data assembler directives 2017-10-11 21:24:33 +00:00
static-methods.ll [codeview] Use a type index of zero for static method "this" types 2017-09-15 00:59:07 +00:00
synthetic.ll DebugInfo: elide type index entries for synthetic types 2017-05-03 21:39:01 +00:00
tail-call-without-lexical-scopes.ll
typedef.ll [codeview] Change readobj symbol dumping format 2017-07-11 23:41:41 +00:00
types-array-advanced.ll [codeview] VLAs and unsized arrays should use a size of zero 2017-09-13 21:54:20 +00:00
types-array-unsized.ll [codeview] VLAs and unsized arrays should use a size of zero 2017-09-13 21:54:20 +00:00
types-array.ll CodeView symbol dumper: use symbolic names for registers 2017-10-02 17:44:47 +00:00
types-basic.ll [codeview] Change readobj symbol dumping format 2017-07-11 23:41:41 +00:00
types-calling-conv.ll Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
types-data-members.ll MC/COFF: Do not emit forward associative section referenceds. 2017-02-17 17:32:54 +00:00
types-nested-class.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
types-non-virtual-methods.ll
types-ptr-to-member.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
types-recursive-struct.ll
udts.ll [CodeView] Don't output S_UDTs for nested typedefs. 2017-09-05 22:06:39 +00:00
vftables.ll [codeview] Emit vtable shape information 2016-08-31 15:59:30 +00:00
virtual-method-kinds.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
virtual-methods.ll Resubmit "Write the TPI stream from a PDB to Yaml." 2016-08-18 16:49:29 +00:00
vtable-optzn-array.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00