From af299ea5d456aa2fc19d7fdb041a0452d209fd4c Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Sat, 25 Feb 2017 00:44:30 +0000 Subject: [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 --- llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp') diff --git a/llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp index 8fad775ecdc..9df97c9753e 100644 --- a/llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp @@ -52,7 +52,7 @@ uint32_t StringTableBuilder::finalize() { return Size; } -Error StringTableBuilder::commit(msf::StreamWriter &Writer) const { +Error StringTableBuilder::commit(BinaryStreamWriter &Writer) const { // Write a header StringTableHeader H; H.Signature = StringTableSignature; @@ -67,14 +67,14 @@ Error StringTableBuilder::commit(msf::StreamWriter &Writer) const { StringRef S = Pair.first; uint32_t Offset = Pair.second; Writer.setOffset(StringStart + Offset); - if (auto EC = Writer.writeZeroString(S)) + if (auto EC = Writer.writeCString(S)) return EC; } Writer.setOffset(StringStart + StringSize); // Write a hash table. uint32_t BucketCount = computeBucketCount(Strings.size()); - if (auto EC = Writer.writeInteger(BucketCount, llvm::support::little)) + if (auto EC = Writer.writeInteger(BucketCount)) return EC; std::vector Buckets(BucketCount); @@ -96,8 +96,7 @@ Error StringTableBuilder::commit(msf::StreamWriter &Writer) const { if (auto EC = Writer.writeArray(ArrayRef(Buckets))) return EC; - if (auto EC = Writer.writeInteger(static_cast(Strings.size()), - llvm::support::little)) + if (auto EC = Writer.writeInteger(static_cast(Strings.size()))) return EC; return Error::success(); } -- cgit v1.2.3