diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2017-02-25 17:04:23 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2017-02-25 17:04:23 +0000 |
commit | 05a75e40da0f83639111687799eaab2c07c00ef0 (patch) | |
tree | 8ade745eed4316647c5098f24acd74af027ff364 /llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp | |
parent | 09ecd3117e151c645d2870409b5a78b2aeac326d (diff) | |
download | bcm5719-llvm-05a75e40da0f83639111687799eaab2c07c00ef0.tar.gz bcm5719-llvm-05a75e40da0f83639111687799eaab2c07c00ef0.zip |
Revert r296215, "[PDB] General improvements to Stream library." and followings.
r296215, "[PDB] General improvements to Stream library."
r296217, "Disable BinaryStreamTest.StreamReaderObject temporarily."
r296220, "Re-enable BinaryStreamTest.StreamReaderObject."
r296244, "[PDB] Disable some tests that are breaking bots."
r296249, "Add static_cast to silence -Wc++11-narrowing."
std::errc::no_buffer_space should be used for OS-oriented errors for socket transmission.
(Seek discussions around llvm/xray.)
I could substitute s/no_buffer_space/others/g, but I revert whole them ATM.
Could we define and use LLVM errors there?
llvm-svn: 296258
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp b/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp index 1fa9bc443ec..ceeca10c5c5 100644 --- a/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp @@ -21,22 +21,23 @@ #include <cstdint> using namespace llvm; +using namespace llvm::msf; using namespace llvm::pdb; NamedStreamMap::NamedStreamMap() = default; -Error NamedStreamMap::load(BinaryStreamReader &Stream) { +Error NamedStreamMap::load(StreamReader &Stream) { Mapping.clear(); FinalizedHashTable.clear(); FinalizedInfo.reset(); uint32_t StringBufferSize; - if (auto EC = Stream.readInteger(StringBufferSize)) + if (auto EC = Stream.readInteger(StringBufferSize, llvm::support::little)) return joinErrors(std::move(EC), make_error<RawError>(raw_error_code::corrupt_file, "Expected string buffer size")); - BinaryStreamRef StringsBuffer; + msf::ReadableStreamRef StringsBuffer; if (auto EC = Stream.readStreamRef(StringsBuffer, StringBufferSize)) return EC; @@ -50,11 +51,11 @@ Error NamedStreamMap::load(BinaryStreamReader &Stream) { std::tie(NameOffset, NameIndex) = Entry; // Compute the offset of the start of the string relative to the stream. - BinaryStreamReader NameReader(StringsBuffer); + msf::StreamReader NameReader(StringsBuffer); NameReader.setOffset(NameOffset); // Pump out our c-string from the stream. StringRef Str; - if (auto EC = NameReader.readCString(Str)) + if (auto EC = NameReader.readZeroString(Str)) return joinErrors(std::move(EC), make_error<RawError>(raw_error_code::corrupt_file, "Expected name map name")); @@ -66,16 +67,17 @@ Error NamedStreamMap::load(BinaryStreamReader &Stream) { return Error::success(); } -Error NamedStreamMap::commit(BinaryStreamWriter &Writer) const { +Error NamedStreamMap::commit(msf::StreamWriter &Writer) const { assert(FinalizedInfo.hasValue()); // The first field is the number of bytes of string data. - if (auto EC = Writer.writeInteger(FinalizedInfo->StringDataBytes)) + if (auto EC = Writer.writeInteger(FinalizedInfo->StringDataBytes, + llvm::support::little)) return EC; // Now all of the string data itself. for (const auto &Item : Mapping) { - if (auto EC = Writer.writeCString(Item.getKey())) + if (auto EC = Writer.writeZeroString(Item.getKey())) return EC; } |