diff options
author | Zachary Turner <zturner@google.com> | 2017-02-28 00:04:07 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-02-28 00:04:07 +0000 |
commit | 695ed56ba5d3bd3b86c6a4ed6d79b89eb8fbd2f4 (patch) | |
tree | caf35bd7345bb071545ef39b636b40ffafc41504 /llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp | |
parent | 59cd89332010b22e82c3110d558ff37948c4df1e (diff) | |
download | bcm5719-llvm-695ed56ba5d3bd3b86c6a4ed6d79b89eb8fbd2f4.tar.gz bcm5719-llvm-695ed56ba5d3bd3b86c6a4ed6d79b89eb8fbd2f4.zip |
[PDB] Make streams carry their own endianness.
Before the endianness was specified on each call to read
or write of the StreamReader / StreamWriter, but in practice
it's extremely rare for streams to have data encoded in
multiple different endiannesses, so we should optimize for the
99% use case.
This makes the code cleaner and more general, but otherwise
has NFC.
llvm-svn: 296415
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp b/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp index 91cbf4bca07..1fa9bc443ec 100644 --- a/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp @@ -31,7 +31,7 @@ Error NamedStreamMap::load(BinaryStreamReader &Stream) { FinalizedInfo.reset(); uint32_t StringBufferSize; - if (auto EC = Stream.readInteger(StringBufferSize, llvm::support::little)) + if (auto EC = Stream.readInteger(StringBufferSize)) return joinErrors(std::move(EC), make_error<RawError>(raw_error_code::corrupt_file, "Expected string buffer size")); @@ -70,8 +70,7 @@ Error NamedStreamMap::commit(BinaryStreamWriter &Writer) const { assert(FinalizedInfo.hasValue()); // The first field is the number of bytes of string data. - if (auto EC = Writer.writeInteger(FinalizedInfo->StringDataBytes, - llvm::support::little)) + if (auto EC = Writer.writeInteger(FinalizedInfo->StringDataBytes)) return EC; // Now all of the string data itself. |