[PATCH] D26253: [CodeView] Hook CodeViewRecordIO up to the type serialization path.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 2 11:41:55 PDT 2016


zturner created this revision.
zturner added reviewers: amccarth, inglorion, rnk, ruiu.
zturner added a subscriber: llvm-commits.
Herald added subscribers: modocache, mgorny.

This patch does a lot.  The following classes are all **deleted**

1. TypeTableBuilder
2. ListRecordBuilder
3. MemoryTypeTableBuilder
4. FieldListRecordBuilder
5. TypeRecordBuilder
6. TypeSerializationVisitor

In their place, they are replaced with two new classes:

1. TypeSerializer
2. TypeTableBuilder

#2 has the same name as a previous class, but it is completely re-written.
#1 is a replacement for the previous `TypeSerializationVisitor`.

The two new classes make use of the previously introduced `CodeViewRecordIO` to accomplish everything that used to be accomplished by the 6 deleted classes.  The advantages of this new approach have been discussed previously, but I will repeat them here for posterity and for anyone reading this unfamiliar with previous discussions.

1. A single codepath for both reading and writing.  Now `TypeDeserializer` and `TypeSerializer` both use the same mappings to define their record layout.
2. Better handling of field list record splitting and size fields.  Previously the injection of the Record length was separated from the splitting logic, even though each one needs to know certain details about the other.  This led to some hackish code where certain classes would make assumptions about what happened in the others.  In some cases there were latent bugs (such as it being possible to write a record that was 2 bytes too large due to not taking into consideration the record length when splitting).
3. Being able to use the same machinery for symbol record.  This patch will bring full support for serializing and deserializing type records.  We have additional code still in LLVM that **deserializes** symbol records.  To support serialization, we would need to go re-implement a parallel codepath.  With this, we will be able to achieve serialization and deserialization without adding this parallel codepath.


https://reviews.llvm.org/D26253

Files:
  include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
  include/llvm/DebugInfo/CodeView/FieldListRecordBuilder.h
  include/llvm/DebugInfo/CodeView/ListRecordBuilder.h
  include/llvm/DebugInfo/CodeView/MemoryTypeTableBuilder.h
  include/llvm/DebugInfo/CodeView/MethodListRecordBuilder.h
  include/llvm/DebugInfo/CodeView/RecordSerialization.h
  include/llvm/DebugInfo/CodeView/TypeDeserializer.h
  include/llvm/DebugInfo/CodeView/TypeIndex.h
  include/llvm/DebugInfo/CodeView/TypeRecord.h
  include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
  include/llvm/DebugInfo/CodeView/TypeSerializationVisitor.h
  include/llvm/DebugInfo/CodeView/TypeSerializer.h
  include/llvm/DebugInfo/CodeView/TypeTableBuilder.h
  include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h
  include/llvm/DebugInfo/MSF/StreamWriter.h
  lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
  lib/CodeGen/AsmPrinter/CodeViewDebug.h
  lib/DebugInfo/CodeView/CMakeLists.txt
  lib/DebugInfo/CodeView/CVTypeVisitor.cpp
  lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
  lib/DebugInfo/CodeView/FieldListRecordBuilder.cpp
  lib/DebugInfo/CodeView/ListRecordBuilder.cpp
  lib/DebugInfo/CodeView/MemoryTypeTableBuilder.cpp
  lib/DebugInfo/CodeView/MethodListRecordBuilder.cpp
  lib/DebugInfo/CodeView/TypeDumper.cpp
  lib/DebugInfo/CodeView/TypeRecordBuilder.cpp
  lib/DebugInfo/CodeView/TypeRecordMapping.cpp
  lib/DebugInfo/CodeView/TypeStreamMerger.cpp
  lib/DebugInfo/CodeView/TypeTableBuilder.cpp
  tools/llvm-pdbdump/PdbYaml.cpp
  tools/llvm-pdbdump/YamlSerializationContext.h
  tools/llvm-pdbdump/YamlTypeDumper.cpp
  tools/llvm-pdbdump/YamlTypeDumper.h
  tools/llvm-readobj/COFFDumper.cpp
  tools/llvm-readobj/ObjDumper.h
  tools/llvm-readobj/llvm-readobj.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26253.76753.patch
Type: text/x-patch
Size: 110248 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161102/3360385d/attachment-0001.bin>


More information about the llvm-commits mailing list