Don't assume little endian in StreamReader / StreamWriter.
In an effort to generalize this so it can be used by more than
just PDB code, we shouldn't assume little endian.
llvm-svn: 295525
diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
index 57ca2ba..fb8e34e 100644
--- a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
@@ -132,8 +132,8 @@
auto DirStream =
WritableMappedBlockStream::createDirectoryStream(Layout, Buffer);
StreamWriter DW(*DirStream);
- if (auto EC =
- DW.writeInteger(static_cast<uint32_t>(Layout.StreamSizes.size())))
+ if (auto EC = DW.writeInteger<uint32_t>(Layout.StreamSizes.size(),
+ llvm::support::little))
return EC;
if (auto EC = DW.writeArray(Layout.StreamSizes))