summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-02-25 00:44:30 +0000
committerZachary Turner <zturner@google.com>2017-02-25 00:44:30 +0000
commitaf299ea5d456aa2fc19d7fdb041a0452d209fd4c (patch)
tree2d863cba130306041941aeec5b44baa2e9c00ec1 /llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
parent42de38076517bc68a2b97c55dcbac7ea8d80b11b (diff)
downloadbcm5719-llvm-af299ea5d456aa2fc19d7fdb041a0452d209fd4c.tar.gz
bcm5719-llvm-af299ea5d456aa2fc19d7fdb041a0452d209fd4c.zip
[PDB] General improvements to Stream library.
This adds various new functionality and cleanup surrounding the use of the Stream library. Major changes include: * Renaming of all classes for more consistency / meaningfulness * Addition of some new methods for reading multiple values at once. * Full suite of unit tests for reader / writer functionality. * Full set of doxygen comments for all classes. * Streams now store their own endianness. * Fixed some bugs in a few of the classes that were discovered by the unit tests. llvm-svn: 296215
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
index fde61ddc650..298382fdc7d 100644
--- a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
@@ -12,6 +12,8 @@
#include "llvm/ADT/BitVector.h"
#include "llvm/DebugInfo/MSF/BinaryStream.h"
+#include "llvm/DebugInfo/MSF/BinaryStream.h"
+#include "llvm/DebugInfo/MSF/BinaryStreamWriter.h"
#include "llvm/DebugInfo/MSF/BinaryStreamWriter.h"
#include "llvm/DebugInfo/MSF/MSFBuilder.h"
#include "llvm/DebugInfo/PDB/GenericError.h"
@@ -118,8 +120,9 @@ Error PDBFileBuilder::commit(StringRef Filename) {
if (OutFileOrError.getError())
return llvm::make_error<pdb::GenericError>(generic_error_code::invalid_path,
Filename);
- FileBufferByteStream Buffer(std::move(*OutFileOrError));
- StreamWriter Writer(Buffer);
+ FileBufferByteStream Buffer(std::move(*OutFileOrError),
+ llvm::support::little);
+ BinaryStreamWriter Writer(Buffer);
if (auto EC = Writer.writeObject(*Layout.SB))
return EC;
@@ -131,9 +134,8 @@ Error PDBFileBuilder::commit(StringRef Filename) {
auto DirStream =
WritableMappedBlockStream::createDirectoryStream(Layout, Buffer);
- StreamWriter DW(*DirStream);
- if (auto EC = DW.writeInteger<uint32_t>(Layout.StreamSizes.size(),
- llvm::support::little))
+ BinaryStreamWriter DW(*DirStream);
+ if (auto EC = DW.writeInteger<uint32_t>(Layout.StreamSizes.size()))
return EC;
if (auto EC = DW.writeArray(Layout.StreamSizes))
@@ -150,7 +152,7 @@ Error PDBFileBuilder::commit(StringRef Filename) {
auto NS = WritableMappedBlockStream::createIndexedStream(Layout, Buffer,
StringTableStreamNo);
- StreamWriter NSWriter(*NS);
+ BinaryStreamWriter NSWriter(*NS);
if (auto EC = Strings.commit(NSWriter))
return EC;
OpenPOWER on IntegriCloud