1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/tools/llvm-pdbutil
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
..
Analyze.cpp
Analyze.h
BytesOutputStyle.cpp [llvm-pdbutil] Add support for dumping detailed module stats. 2017-08-21 14:53:25 +00:00
BytesOutputStyle.h [llvm-pdbutil] Add support for dumping detailed module stats. 2017-08-21 14:53:25 +00:00
CMakeLists.txt [llvm-pdbutil] Support dumping CodeView from object files. 2017-09-01 20:06:56 +00:00
Diff.cpp [llvm-pdbutil] Add support for dumping detailed module stats. 2017-08-21 14:53:25 +00:00
Diff.h
DiffPrinter.cpp Resubmit "Add pdb-diff test." 2017-07-10 19:16:49 +00:00
DiffPrinter.h Resubmit "Add pdb-diff test." 2017-07-10 19:16:49 +00:00
DumpOutputStyle.cpp [PDB] Handle an empty globals hash table with no buckets 2017-10-27 00:45:51 +00:00
DumpOutputStyle.h [llvm-pdbutil] Support dumping CodeView from object files. 2017-09-01 20:06:56 +00:00
FormatUtil.cpp [llvm-pdbutil] Print detailed S_UDT stats. 2017-08-31 20:43:22 +00:00
FormatUtil.h [llvm-pdbutil] Print detailed S_UDT stats. 2017-08-31 20:43:22 +00:00
InputFile.cpp [llvm-pdbutil] Remove unused variables. 2017-09-02 00:09:43 +00:00
InputFile.h [llvm-pdbutil] Support dumping CodeView from object files. 2017-09-01 20:06:56 +00:00
LinePrinter.cpp [pdbutil] Add a command to dump the FPM. 2017-08-02 22:25:52 +00:00
LinePrinter.h [llvm-pdbutil] Support dumping CodeView from object files. 2017-09-01 20:06:56 +00:00
llvm-pdbutil.cpp [CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder. 2017-11-28 18:33:17 +00:00
llvm-pdbutil.h [llvm-pdbutil] Support dumping CodeView from object files. 2017-09-01 20:06:56 +00:00
LLVMBuild.txt
MinimalSymbolDumper.cpp [codeview] Fix handling of S_HEAPALLOCSITE 2017-10-24 17:02:40 +00:00
MinimalSymbolDumper.h Fix a few minor issues when dumping symbols. 2017-08-17 20:04:31 +00:00
MinimalTypeDumper.cpp [llvm-pdbutil] Print detailed S_UDT stats. 2017-08-31 20:43:22 +00:00
MinimalTypeDumper.h [PDB] Finish and simplify TPI hashing 2017-07-18 00:33:45 +00:00
OutputStyle.h
PdbYaml.cpp [CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder. 2017-11-28 18:33:17 +00:00
PdbYaml.h [codeview] Fix YAML for LF_TYPESERVER2 by hoisting PDB_UniqueId 2017-07-17 23:59:44 +00:00
PrettyBuiltinDumper.cpp
PrettyBuiltinDumper.h
PrettyClassDefinitionDumper.cpp
PrettyClassDefinitionDumper.h
PrettyClassLayoutGraphicalDumper.cpp
PrettyClassLayoutGraphicalDumper.h
PrettyCompilandDumper.cpp
PrettyCompilandDumper.h
PrettyEnumDumper.cpp Enable llvm-pdbutil to list enumerations using native PDB reader 2017-08-04 22:37:58 +00:00
PrettyEnumDumper.h
PrettyExternalSymbolDumper.cpp
PrettyExternalSymbolDumper.h
PrettyFunctionDumper.cpp
PrettyFunctionDumper.h
PrettyTypedefDumper.cpp
PrettyTypedefDumper.h
PrettyTypeDumper.cpp
PrettyTypeDumper.h
PrettyVariableDumper.cpp
PrettyVariableDumper.h
StreamUtil.cpp [llvm-pdbutil] Add support for dumping detailed module stats. 2017-08-21 14:53:25 +00:00
StreamUtil.h [llvm-pdbutil] Add support for dumping detailed module stats. 2017-08-21 14:53:25 +00:00
YAMLOutputStyle.cpp
YAMLOutputStyle.h