This is an archive of the discontinued LLVM Phabricator instance.

Make TypeRecordBuilder usable for symbols
AcceptedPublic

Authored by zturner on Oct 18 2016, 2:27 PM.

Details

Reviewers
rnk
Summary

TypeRecordBuilder is overly specific to type records, even though 99% of it is re-usable for symbol records as well. Raise out the type specific stuff so that it can be used for writing symbols.

Diff Detail

Event Timeline

zturner updated this revision to Diff 75074.Oct 18 2016, 2:27 PM
zturner retitled this revision from to Make TypeRecordBuilder usable for symbols.
zturner updated this object.
zturner added a reviewer: rnk.
zturner added a subscriber: llvm-commits.
rnk edited edge metadata.Oct 19 2016, 10:27 AM

Do you think we'll ever want to merge the reading and writing code like the way we do it in yaml, or something else? This writing code is very redundant with the deserialize methods. I was holding out hope that we'd sort that out eventually.

In D25752#574352, @rnk wrote:

Do you think we'll ever want to merge the reading and writing code like the way we do it in yaml, or something else? This writing code is very redundant with the deserialize methods. I was holding out hope that we'd sort that out eventually.

I expect it will be hard to merge reading and writing code. The Yaml stuff does offer a nice pattern though, so maybe there's a way to do it elegantly. I guess I'm in the same boat as you. Still holding out hope? :)

rnk accepted this revision.Oct 19 2016, 11:10 AM
rnk edited edge metadata.

lgtm

include/llvm/DebugInfo/CodeView/CodeViewRecordBuilder.h
73

Let's make this a bool member, and have TypeRecordBuilder do the Kind check in its constructor.

This revision is now accepted and ready to land.Oct 19 2016, 11:10 AM
lib/DebugInfo/CodeView/ListRecordBuilder.cpp