llvm-mirror/lib
Zachary Turner 4202759d3b [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
..
Analysis [SCEV][NFC] More efficient caching in CompareValueComplexity 2017-11-28 08:26:43 +00:00
AsmParser [IR] redefine 'UnsafeAlgebra' / 'reassoc' fast-math-flags and add 'trans' fast-math-flag 2017-11-06 16:27:15 +00:00
BinaryFormat Simplify. 2017-10-19 01:32:18 +00:00
Bitcode [WebAssembly] Explicily disable comdat support for wasm output 2017-11-14 00:49:16 +00:00
CodeGen [CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder. 2017-11-28 18:33:17 +00:00
DebugInfo [CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder. 2017-11-28 18:33:17 +00:00
Demangle [ItaniumDemangle] Fix a exponential string copying bug 2017-05-28 23:24:52 +00:00
ExecutionEngine Fix 'not all control paths return a value' warning on MSVC builds 2017-11-09 14:56:17 +00:00
Fuzzer [libFuzzer] Delete llvm/lib/Fuzzer 2017-10-16 20:48:19 +00:00
FuzzMutate [FuzzMutate] Fix windows build after rL318407. 2017-11-16 16:17:32 +00:00
IR Move getVariableSize from Verifier.cpp into DIVariable::getSize() (NFC) 2017-11-28 00:57:51 +00:00
IRReader Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
LineEditor
Linker Linker: Create a function declaration when moving a non-prevailing alias of function type. 2017-08-10 01:07:44 +00:00
LTO Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
MC [WebAssembly] Support bitcasted function addresses with varargs. 2017-11-28 17:15:03 +00:00
Object Object: Improve COFF irsymtab comdat representation. 2017-11-21 22:06:20 +00:00
ObjectYAML [CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder. 2017-11-28 18:33:17 +00:00
Option Reverting r315590; it did not include changes for llvm-tblgen, which is causing link errors for several people. 2017-10-15 14:32:27 +00:00
Passes Add a new pass to speculate around PHI nodes with constant (integer) operands when profitable. 2017-11-28 11:32:31 +00:00
ProfileData [Coverage] Use the wrapped segment when a line has entry segments 2017-11-09 02:33:43 +00:00
Support AMDGPU: Add num spilled s/vgprs to metadata 2017-11-28 17:51:08 +00:00
TableGen [globalisel][regbank] Warn about MIR ambiguities when register bank/class names clash. 2017-11-01 22:13:05 +00:00
Target [X86][X87] Tag FP_TO_INT_IN_MEM pseudos with hasNoSchedulingInfo 2017-11-28 18:10:29 +00:00
Testing Force #define GTEST_LANG_CXX11. 2017-10-27 21:12:28 +00:00
ToolDrivers [COFF] Improve the check for functions that should get an extra underscore 2017-10-23 09:08:13 +00:00
Transforms Use getStoreSize() in various places instead of 'BitSize >> 3'. 2017-11-28 14:44:32 +00:00
WindowsManifest Fix bug 34608 by moving private header out of public header. 2017-09-14 23:01:13 +00:00
XRay [XRay] Use optimistic logging model for FDR mode 2017-11-21 07:16:57 +00:00
CMakeLists.txt Moving libFuzzer from LLVM to compiler-rt. 2017-08-21 23:25:12 +00:00
LLVMBuild.txt Re-apply "Introduce FuzzMutate library" 2017-08-21 22:57:06 +00:00