From 05a75e40da0f83639111687799eaab2c07c00ef0 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sat, 25 Feb 2017 17:04:23 +0000 Subject: 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 --- llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp | 48 ++++++++++++++---------- 1 file changed, 28 insertions(+), 20 deletions(-) (limited to 'llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp') diff --git a/llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp b/llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp index a204d43ba13..fd60059b5c6 100644 --- a/llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp +++ b/llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp @@ -87,13 +87,14 @@ Error CodeViewRecordIO::mapByteVectorTail(std::vector &Bytes) { Error CodeViewRecordIO::mapInteger(TypeIndex &TypeInd) { if (isWriting()) { - if (auto EC = Writer->writeInteger(TypeInd.getIndex())) + if (auto EC = + Writer->writeInteger(TypeInd.getIndex(), llvm::support::little)) return EC; return Error::success(); } uint32_t I; - if (auto EC = Reader->readInteger(I)) + if (auto EC = Reader->readInteger(I, llvm::support::little)) return EC; TypeInd.setIndex(I); return Error::success(); @@ -145,10 +146,10 @@ Error CodeViewRecordIO::mapStringZ(StringRef &Value) { if (isWriting()) { // Truncate if we attempt to write too much. StringRef S = Value.take_front(maxFieldLength() - 1); - if (auto EC = Writer->writeCString(S)) + if (auto EC = Writer->writeZeroString(S)) return EC; } else { - if (auto EC = Reader->readCString(Value)) + if (auto EC = Reader->readZeroString(Value)) return EC; } return Error::success(); @@ -176,7 +177,7 @@ Error CodeViewRecordIO::mapStringZVectorZ(std::vector &Value) { if (auto EC = mapStringZ(V)) return EC; } - if (auto EC = Writer->writeInteger(0)) + if (auto EC = Writer->writeInteger(0, llvm::support::little)) return EC; } else { StringRef S; @@ -194,24 +195,28 @@ Error CodeViewRecordIO::mapStringZVectorZ(std::vector &Value) { Error CodeViewRecordIO::writeEncodedSignedInteger(const int64_t &Value) { assert(Value < 0 && "Encoded integer is not signed!"); if (Value >= std::numeric_limits::min()) { - if (auto EC = Writer->writeInteger(LF_CHAR)) + if (auto EC = + Writer->writeInteger(LF_CHAR, llvm::support::little)) return EC; - if (auto EC = Writer->writeInteger(Value)) + if (auto EC = Writer->writeInteger(Value, llvm::support::little)) return EC; } else if (Value >= std::numeric_limits::min()) { - if (auto EC = Writer->writeInteger(LF_SHORT)) + if (auto EC = + Writer->writeInteger(LF_SHORT, llvm::support::little)) return EC; - if (auto EC = Writer->writeInteger(Value)) + if (auto EC = Writer->writeInteger(Value, llvm::support::little)) return EC; } else if (Value >= std::numeric_limits::min()) { - if (auto EC = Writer->writeInteger(LF_LONG)) + if (auto EC = + Writer->writeInteger(LF_LONG, llvm::support::little)) return EC; - if (auto EC = Writer->writeInteger(Value)) + if (auto EC = Writer->writeInteger(Value, llvm::support::little)) return EC; } else { - if (auto EC = Writer->writeInteger(LF_QUADWORD)) + if (auto EC = + Writer->writeInteger(LF_QUADWORD, llvm::support::little)) return EC; - if (auto EC = Writer->writeInteger(Value)) + if (auto EC = Writer->writeInteger(Value, llvm::support::little)) return EC; } return Error::success(); @@ -219,22 +224,25 @@ Error CodeViewRecordIO::writeEncodedSignedInteger(const int64_t &Value) { Error CodeViewRecordIO::writeEncodedUnsignedInteger(const uint64_t &Value) { if (Value < LF_NUMERIC) { - if (auto EC = Writer->writeInteger(Value)) + if (auto EC = Writer->writeInteger(Value, llvm::support::little)) return EC; } else if (Value <= std::numeric_limits::max()) { - if (auto EC = Writer->writeInteger(LF_USHORT)) + if (auto EC = + Writer->writeInteger(LF_USHORT, llvm::support::little)) return EC; - if (auto EC = Writer->writeInteger(Value)) + if (auto EC = Writer->writeInteger(Value, llvm::support::little)) return EC; } else if (Value <= std::numeric_limits::max()) { - if (auto EC = Writer->writeInteger(LF_ULONG)) + if (auto EC = + Writer->writeInteger(LF_ULONG, llvm::support::little)) return EC; - if (auto EC = Writer->writeInteger(Value)) + if (auto EC = Writer->writeInteger(Value, llvm::support::little)) return EC; } else { - if (auto EC = Writer->writeInteger(LF_UQUADWORD)) + if (auto EC = + Writer->writeInteger(LF_UQUADWORD, llvm::support::little)) return EC; - if (auto EC = Writer->writeInteger(Value)) + if (auto EC = Writer->writeInteger(Value, llvm::support::little)) return EC; } -- cgit v1.2.3