[pdb] Pass CVRecord's through the visitor as non-const references.
authorZachary Turner <zturner@google.com>
Fri, 9 Sep 2016 18:03:39 +0000 (18:03 +0000)
committerZachary Turner <zturner@google.com>
Fri, 9 Sep 2016 18:03:39 +0000 (18:03 +0000)
commit9ba31a5efe21d13030a889113d4e062b9ddf2eef
treefbd28f9d9e15e455d1cdcd25ecb62538edd43715
parent00ef27112e267b5fb912b30010f11719fbbe74cc
[pdb] Pass CVRecord's through the visitor as non-const references.

This simplifies a lot of code, and will actually be necessary for
an upcoming patch to serialize TPI record hash values.

The idea before was that visitors should be examining records, not
modifying them.  But this is no longer true with a visitor that
constructs a CVRecord from Yaml.  To handle this until now, we
were doing some fixups on CVRecord objects at a higher level, but
the code is really awkward, and it makes sense to just have the
visitor write the bytes into the CVRecord.  In doing so I uncovered
a few bugs related to `Data` and `RawData` and fixed those.

Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D24362

llvm-svn: 281067
15 files changed:
llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
llvm/include/llvm/DebugInfo/CodeView/TypeDumper.h
llvm/include/llvm/DebugInfo/CodeView/TypeSerializationVisitor.h
llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h
llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h
llvm/include/llvm/DebugInfo/PDB/Raw/TpiStreamBuilder.h
llvm/lib/DebugInfo/CodeView/CVTypeVisitor.cpp
llvm/lib/DebugInfo/CodeView/TypeDumper.cpp
llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp
llvm/lib/DebugInfo/CodeView/TypeTableBuilder.cpp
llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp
llvm/tools/llvm-pdbdump/CodeViewYaml.cpp
llvm/tools/llvm-pdbdump/CodeViewYaml.h
llvm/tools/llvm-pdbdump/PdbYaml.cpp