1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
llvm-mirror/tools/llvm-readobj
Zachary Turner a3ce9cabee [CodeView] Decouple record deserialization from visitor dispatch.
Until now, our use case for the visitor has been to take a stream of bytes
representing a type stream, deserialize the records in sequence, and do
something with them, where "something" is determined by how the user
implements a particular set of callbacks on an abstract class.

For actually writing PDBs, however, we want to do the reverse. We have
some kind of description of the list of records in their in-memory format,
and we want to process each one. Perhaps by serializing them to a byte
stream, or perhaps by converting them from one description format (Yaml)
to another (in-memory representation).

This was difficult in the current model because deserialization and
invoking the callbacks were tightly coupled.

With this patch we change this so that TypeDeserializer is itself an
implementation of the particular set of callbacks. This decouples
deserialization from the iteration over a list of records and invocation
of the callbacks.  TypeDeserializer is initialized with another
implementation of the callback interface, so that upon deserialization it
can pass the deserialized record through to the next set of callbacks. In
a sense this is like an implementation of the Decorator design pattern,
where the Deserializer is a decorator.

This will be useful for writing Pdbs from yaml, where we have a
description of the type records in Yaml format. In this case, the visitor
implementation would have each visitation callback method implemented in
such a way as to extract the proper set of fields from the Yaml, and it
could maintain state that builds up a list of these records. Finally at
the end we can pass this information through to another set of callbacks
which serializes them into a byte stream.

Reviewed By: majnemer, ruiu, rnk
Differential Revision: https://reviews.llvm.org/D23177

llvm-svn: 277871
2016-08-05 21:45:34 +00:00
..
ARMAttributeParser.cpp Move llvm-readobj/StreamWriter to Support. 2016-05-03 00:28:04 +00:00
ARMAttributeParser.h Move llvm-readobj/StreamWriter to Support. 2016-05-03 00:28:04 +00:00
ARMEHABIPrinter.h Move llvm-readobj/StreamWriter to Support. 2016-05-03 00:28:04 +00:00
ARMWinEHPrinter.cpp Thread Expected<...> up from libObject’s getSymbolAddress() for symbols to allow 2016-06-24 18:24:42 +00:00
ARMWinEHPrinter.h Move llvm-readobj/StreamWriter to Support. 2016-05-03 00:28:04 +00:00
CMakeLists.txt [msf] Resubmit "Rename Msf -> MSF". 2016-07-29 20:56:36 +00:00
CodeView.h Silence gcc warning about ternary and enumerations 2016-01-28 23:59:35 +00:00
COFFDumper.cpp [msf] Resubmit "Rename Msf -> MSF". 2016-07-29 20:56:36 +00:00
COFFImportDumper.cpp llvm-readobj: Dump more info for COFF import libraries. 2015-08-28 10:27:50 +00:00
ELFDumper.cpp BPF: Use official ELF e_machine value 2016-07-15 22:27:55 +00:00
Error.cpp Add FIXMEs to all derived classes of std::error_category. 2016-05-24 20:13:46 +00:00
Error.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
llvm-readobj.cpp [CodeView] Decouple record deserialization from visitor dispatch. 2016-08-05 21:45:34 +00:00
llvm-readobj.h [CodeView] Decouple record deserialization from visitor dispatch. 2016-08-05 21:45:34 +00:00
LLVMBuild.txt [msf] Resubmit "Rename Msf -> MSF". 2016-07-29 20:56:36 +00:00
MachODumper.cpp Move llvm-readobj/StreamWriter to Support. 2016-05-03 00:28:04 +00:00
ObjDumper.cpp Move llvm-readobj/StreamWriter to Support. 2016-05-03 00:28:04 +00:00
ObjDumper.h [COFF] Expose the PE debug data directory and dump it 2016-06-02 17:10:43 +00:00
StackMapPrinter.h [StackMaps] Add a lightweight parser for stackmap version 1 sections. 2015-06-26 23:56:53 +00:00
Win64EHDumper.cpp Thread Expected<...> up from libObject’s getSymbolAddress() for symbols to allow 2016-06-24 18:24:42 +00:00
Win64EHDumper.h Move llvm-readobj/StreamWriter to Support. 2016-05-03 00:28:04 +00:00