[PATCH] D26040: [CodeView] Add CodeViewRecordIO for reading and writing, and use it for reading type records.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 15:00:12 PDT 2016


zturner updated this revision to Diff 76254.
zturner added a comment.

Fixed suggestions from ruiu.

I looked into using virtual function indirection as a means of hiding the branches, and it's not entirely straightforward since there's some template functions to handle many types at once.  I could make it work, but I'm not sure it's a win.

Another idea is to raise this whole thing up into `CodeView/MSF` and make it more generic by using traits classes instead of Mapping functors.  That would allow a single `Map` method that uses template specializations to find mapping classes, and allow the mapping classes to provide `read()` and `write()` methods that separate the logic.  I gave it a try but it was a little hairy and gets into some design issues, but it seems like a reasonable avenue for improvement in a followup patch.


https://reviews.llvm.org/D26040

Files:
  include/llvm/DebugInfo/CodeView/CodeViewRecordIO.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/MSF/StreamWriter.h
  lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
  lib/DebugInfo/CodeView/CMakeLists.txt
  lib/DebugInfo/CodeView/CVTypeVisitor.cpp
  lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
  lib/DebugInfo/CodeView/TypeDumper.cpp
  lib/DebugInfo/CodeView/TypeRecord.cpp
  lib/DebugInfo/CodeView/TypeRecordMapping.cpp
  lib/DebugInfo/CodeView/TypeStreamMerger.cpp
  lib/DebugInfo/CodeView/TypeTableBuilder.cpp
  lib/DebugInfo/MSF/StreamWriter.cpp
  test/DebugInfo/PDB/pdbdump-yaml-types.test
  tools/llvm-pdbdump/YamlTypeDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26040.76254.patch
Type: text/x-patch
Size: 134131 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161028/7e1d0cde/attachment-0001.bin>


More information about the llvm-commits mailing list