llvm-project/llvm/lib/DebugInfo/CodeView
Zachary Turner 0c60f269fc [CodeView] Provide a common interface for type collections.
Right now we have multiple notions of things that represent collections of
types. Most commonly used are TypeDatabase, which is supposed to keep
mappings from TypeIndex to type name when reading a type stream, which
happens when reading PDBs. And also TypeTableBuilder, which is used to
build up a collection of types dynamically which we will later serialize
(i.e. when writing PDBs).

But often you just want to do some operation on a collection of types, and
you may want to do the same operation on any kind of collection. For
example, you might want to merge two TypeTableBuilders or you might want
to merge two type streams that you loaded from various files.

This dichotomy between reading and writing is responsible for a lot of the
existing code duplication and overlapping responsibilities in the existing
CodeView library classes. For example, after building up a
TypeTableBuilder with a bunch of type records, if we want to dump it we
have to re-invent a bunch of extra glue because our dumper takes a
TypeDatabase or a CVTypeArray, which are both incompatible with
TypeTableBuilder.

This patch introduces an abstract base class called TypeCollection which
is shared between the various type collection like things. Wherever we
previously stored a TypeDatabase& in some common class, we now store a
TypeCollection&.

The advantage of this is that all the details of how the collection are
implemented, such as lazy deserialization of partial type streams, is
completely transparent and you can just treat any collection of types the
same regardless of where it came from.

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

llvm-svn: 303388
2017-05-18 23:03:06 +00:00
..
CMakeLists.txt [CodeView] Provide a common interface for type collections. 2017-05-18 23:03:06 +00:00
CVSymbolVisitor.cpp Remove unused functions. Remove static qualifier from functions in header files. NFC. 2017-04-11 14:55:32 +00:00
CVTypeVisitor.cpp [CodeView] Provide a common interface for type collections. 2017-05-18 23:03:06 +00:00
CodeViewError.cpp [pdb] Add the ability to resolve TypeServer PDBs. 2017-02-16 23:35:45 +00:00
CodeViewRecordIO.cpp [Support] Move Stream library from MSF -> Support. 2017-03-02 20:52:51 +00:00
EnumTables.cpp Rename some PDB classes. 2017-04-27 16:11:19 +00:00
Formatters.cpp Properly parse the TypeServer2 record. 2017-02-03 21:22:27 +00:00
LLVMBuild.txt [msf] Resubmit "Rename Msf -> MSF". 2016-07-29 20:56:36 +00:00
LazyRandomTypeCollection.cpp [CodeView] Provide a common interface for type collections. 2017-05-18 23:03:06 +00:00
Line.cpp
ModuleDebugFileChecksumFragment.cpp [CodeView] Use actual strings for dealing with checksums and lines. 2017-05-03 17:11:40 +00:00
ModuleDebugFragment.cpp [CodeView] Write CodeView line information. 2017-05-01 23:27:42 +00:00
ModuleDebugFragmentRecord.cpp [PDB/CodeView] Read/write codeview inlinee line information. 2017-05-02 16:56:09 +00:00
ModuleDebugFragmentVisitor.cpp [PDB/CodeView] Read/write codeview inlinee line information. 2017-05-02 16:56:09 +00:00
ModuleDebugInlineeLinesFragment.cpp Remove unused private field. 2017-05-03 19:42:06 +00:00
ModuleDebugLineFragment.cpp [CodeView] Remove constructor initialization of a removed field. 2017-05-03 18:02:46 +00:00
RecordSerialization.cpp [Support] Move Stream library from MSF -> Support. 2017-03-02 20:52:51 +00:00
StringTable.cpp [CodeView] Use actual strings for dealing with checksums and lines. 2017-05-03 17:11:40 +00:00
SymbolDumper.cpp [CodeView] Provide a common interface for type collections. 2017-05-18 23:03:06 +00:00
SymbolRecordMapping.cpp Resubmit "[CodeView] Hook CodeViewRecordIO for reading/writing symbols." 2016-12-16 22:48:14 +00:00
SymbolSerializer.cpp [llvm-pdbdump] Add support for dumping symbols from Yaml -> PDB. 2017-03-13 14:57:45 +00:00
TypeDatabase.cpp [CodeView] Provide a common interface for type collections. 2017-05-18 23:03:06 +00:00
TypeDatabaseVisitor.cpp [CodeView] Add a random access type visitor. 2017-05-12 19:18:12 +00:00
TypeDumpVisitor.cpp [CodeView] Provide a common interface for type collections. 2017-05-18 23:03:06 +00:00
TypeIndex.cpp [CodeView] Provide a common interface for type collections. 2017-05-18 23:03:06 +00:00
TypeRecordMapping.cpp [codeview] Add support for label type records 2017-04-03 21:25:20 +00:00
TypeSerializer.cpp [Support] Move Stream library from MSF -> Support. 2017-03-02 20:52:51 +00:00
TypeStreamMerger.cpp [CodeView] Provide a common interface for type collections. 2017-05-18 23:03:06 +00:00
TypeTableCollection.cpp [CodeView] Provide a common interface for type collections. 2017-05-18 23:03:06 +00:00