[lld] r296215 - [PDB] General improvements to Stream library.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 24 16:44:31 PST 2017
Author: zturner
Date: Fri Feb 24 18:44:30 2017
New Revision: 296215
URL: http://llvm.org/viewvc/llvm-project?rev=296215&view=rev
Log:
[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.
Modified:
lld/trunk/COFF/PDB.cpp
Modified: lld/trunk/COFF/PDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/PDB.cpp?rev=296215&r1=296214&r2=296215&view=diff
==============================================================================
--- lld/trunk/COFF/PDB.cpp (original)
+++ lld/trunk/COFF/PDB.cpp Fri Feb 24 18:44:30 2017
@@ -93,9 +93,9 @@ static std::vector<uint8_t> mergeDebugT(
if (Data.empty())
continue;
- msf::ByteStream Stream(Data);
+ BinaryByteStream Stream(Data, llvm::support::little);
codeview::CVTypeArray Types;
- msf::StreamReader Reader(Stream);
+ BinaryStreamReader Reader(Stream);
// Follow type servers. If the same type server is encountered more than
// once for this instance of `PDBTypeServerHandler` (for example if many
// object files reference the same TypeServer), the types from the
@@ -137,9 +137,9 @@ static void dumpDebugS(ScopedPrinter &W,
if (Data.empty())
return;
- msf::ByteStream Stream(Data);
+ BinaryByteStream Stream(Data, llvm::support::little);
CVSymbolArray Symbols;
- msf::StreamReader Reader(Stream);
+ BinaryStreamReader Reader(Stream);
if (auto EC = Reader.readArray(Symbols, Reader.getLength()))
fatal(EC, "StreamReader.readArray<CVSymbolArray> failed");
@@ -161,9 +161,9 @@ static void dumpCodeView(SymbolTable *Sy
static void addTypeInfo(pdb::TpiStreamBuilder &TpiBuilder,
ArrayRef<uint8_t> Data) {
- msf::ByteStream Stream(Data);
+ BinaryByteStream Stream(Data, llvm::support::little);
codeview::CVTypeArray Records;
- msf::StreamReader Reader(Stream);
+ BinaryStreamReader Reader(Stream);
if (auto EC = Reader.readArray(Records, Reader.getLength()))
fatal(EC, "Reader.readArray failed");
for (const codeview::CVType &Rec : Records)
More information about the llvm-commits
mailing list