[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
diff --git a/llvm/lib/DebugInfo/PDB/Native/ModStream.cpp b/llvm/lib/DebugInfo/PDB/Native/ModStream.cpp
index 9f035cf..df9ec81 100644
--- a/llvm/lib/DebugInfo/PDB/Native/ModStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/ModStream.cpp
@@ -31,7 +31,7 @@
ModStream::~ModStream() = default;
Error ModStream::reload() {
- StreamReader Reader(*Stream);
+ BinaryStreamReader Reader(*Stream);
uint32_t SymbolSize = Mod.getSymbolDebugInfoByteSize();
uint32_t C11Size = Mod.getLineInfoByteSize();
@@ -41,9 +41,9 @@
return make_error<RawError>(raw_error_code::corrupt_file,
"Module has both C11 and C13 line info");
- ReadableStreamRef S;
+ BinaryStreamRef S;
- if (auto EC = Reader.readInteger(Signature, llvm::support::little))
+ if (auto EC = Reader.readInteger(Signature))
return EC;
if (auto EC = Reader.readArray(SymbolsSubstream, SymbolSize - 4))
return EC;
@@ -53,12 +53,12 @@
if (auto EC = Reader.readStreamRef(C13LinesSubstream, C13Size))
return EC;
- StreamReader LineReader(C13LinesSubstream);
+ BinaryStreamReader LineReader(C13LinesSubstream);
if (auto EC = LineReader.readArray(LineInfo, LineReader.bytesRemaining()))
return EC;
uint32_t GlobalRefsSize;
- if (auto EC = Reader.readInteger(GlobalRefsSize, llvm::support::little))
+ if (auto EC = Reader.readInteger(GlobalRefsSize))
return EC;
if (auto EC = Reader.readStreamRef(GlobalRefsSubstream, GlobalRefsSize))
return EC;