forked from OSchip/llvm-project
6900de1dfb
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 |
||
---|---|---|
.. | ||
anonymous-struct.ll | ||
array-odr-violation.ll | ||
asan-module-ctor.ll | ||
asan-module-without-functions.ll | ||
asm.ll | ||
big-type.ll | ||
bitfields.ll | ||
comdat.ll | ||
cpp-mangling.ll | ||
defer-complete-type.ll | ||
dlang.ll | ||
enum.ll | ||
fp-stack.ll | ||
fpo-argsize.ll | ||
fpo-csrs.ll | ||
fpo-funclet.ll | ||
fpo-realign-alloca.ll | ||
fpo-shrink-wrap.ll | ||
fpo-stack-protect.ll | ||
global-dllimport.ll | ||
globals-discarded.ll | ||
globals.ll | ||
inheritance.ll | ||
inlining-files.ll | ||
inlining-header.ll | ||
inlining-levels.ll | ||
inlining-padding.ll | ||
inlining-same-name.ll | ||
inlining.ll | ||
int8-char-type.ll | ||
lines-bb-start.ll | ||
lines-difile.ll | ||
lit.local.cfg | ||
local-constant.ll | ||
local-variable-gap.ll | ||
local-variables.ll | ||
long-name.ll | ||
long-type-name.ll | ||
multifile.ll | ||
multifunction.ll | ||
nested-types.ll | ||
no-cus.ll | ||
parameter-order.ll | ||
pieces.ll | ||
pr28747.ll | ||
purge-typedef-udts.ll | ||
register-variables.ll | ||
retained-types.ll | ||
scopes.ll | ||
simple.ll | ||
static-methods.ll | ||
synthetic.ll | ||
tail-call-without-lexical-scopes.ll | ||
typedef.ll | ||
types-array-advanced.ll | ||
types-array-unsized.ll | ||
types-array.ll | ||
types-basic.ll | ||
types-calling-conv.ll | ||
types-data-members.ll | ||
types-nested-class.ll | ||
types-non-virtual-methods.ll | ||
types-ptr-to-member.ll | ||
types-recursive-struct.ll | ||
udts.ll | ||
vftables.ll | ||
virtual-method-kinds.ll | ||
virtual-methods.ll | ||
vtable-optzn-array.ll |