From 181fe17b6f0f434d39b32b90b12844f7a9b55a3b Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Sat, 18 Feb 2017 01:35:33 +0000 Subject: 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 --- llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp') diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp index 57ca2ba488a..fb8e34e7e82 100644 --- a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp @@ -132,8 +132,8 @@ Error PDBFileBuilder::commit(StringRef Filename) { auto DirStream = WritableMappedBlockStream::createDirectoryStream(Layout, Buffer); StreamWriter DW(*DirStream); - if (auto EC = - DW.writeInteger(static_cast(Layout.StreamSizes.size()))) + if (auto EC = DW.writeInteger(Layout.StreamSizes.size(), + llvm::support::little)) return EC; if (auto EC = DW.writeArray(Layout.StreamSizes)) -- cgit v1.2.3