This patch does a lot. The following classes are all deleted
- TypeTableBuilder
- ListRecordBuilder
- MemoryTypeTableBuilder
- FieldListRecordBuilder
- TypeRecordBuilder
- TypeSerializationVisitor
In their place, they are replaced with two new classes:
- TypeSerializer
- 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.
- A single codepath for both reading and writing. Now TypeDeserializer and TypeSerializer both use the same mappings to define their record layout.
- 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).
- 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.
Out of curiosity, why move this include? And, while no the subject, why not use cstdint?