diff options
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp b/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp index ceeca10c5c5..1fa9bc443ec 100644 --- a/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp @@ -21,23 +21,22 @@ #include <cstdint> using namespace llvm; -using namespace llvm::msf; using namespace llvm::pdb; NamedStreamMap::NamedStreamMap() = default; -Error NamedStreamMap::load(StreamReader &Stream) { +Error NamedStreamMap::load(BinaryStreamReader &Stream) { Mapping.clear(); FinalizedHashTable.clear(); 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")); - msf::ReadableStreamRef StringsBuffer; + BinaryStreamRef StringsBuffer; if (auto EC = Stream.readStreamRef(StringsBuffer, StringBufferSize)) return EC; @@ -51,11 +50,11 @@ Error NamedStreamMap::load(StreamReader &Stream) { std::tie(NameOffset, NameIndex) = Entry; // Compute the offset of the start of the string relative to the stream. - msf::StreamReader NameReader(StringsBuffer); + BinaryStreamReader NameReader(StringsBuffer); NameReader.setOffset(NameOffset); // Pump out our c-string from the stream. StringRef Str; - if (auto EC = NameReader.readZeroString(Str)) + if (auto EC = NameReader.readCString(Str)) return joinErrors(std::move(EC), make_error<RawError>(raw_error_code::corrupt_file, "Expected name map name")); @@ -67,17 +66,16 @@ Error NamedStreamMap::load(StreamReader &Stream) { return Error::success(); } -Error NamedStreamMap::commit(msf::StreamWriter &Writer) const { +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. for (const auto &Item : Mapping) { - if (auto EC = Writer.writeZeroString(Item.getKey())) + if (auto EC = Writer.writeCString(Item.getKey())) return EC; } |