From 71d5a2540a98c81f5bcaeb48805e0e2881f530ef Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 16 Apr 2017 16:01:22 +0000 Subject: Vendor import of llvm trunk r300422: https://llvm.org/svn/llvm-project/llvm/trunk@300422 --- lib/DebugInfo/CodeView/CodeViewRecordIO.cpp | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'lib/DebugInfo/CodeView/CodeViewRecordIO.cpp') diff --git a/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp b/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp index 9bd85cf9dc68..282e3103adc9 100644 --- a/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp +++ b/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp @@ -10,8 +10,8 @@ #include "llvm/DebugInfo/CodeView/CodeViewRecordIO.h" #include "llvm/DebugInfo/CodeView/CodeView.h" #include "llvm/DebugInfo/CodeView/RecordSerialization.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" -#include "llvm/DebugInfo/MSF/StreamWriter.h" +#include "llvm/Support/BinaryStreamReader.h" +#include "llvm/Support/BinaryStreamWriter.h" using namespace llvm; using namespace llvm::codeview; @@ -145,10 +145,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->writeZeroString(S)) + if (auto EC = Writer->writeCString(S)) return EC; } else { - if (auto EC = Reader->readZeroString(Value)) + if (auto EC = Reader->readCString(Value)) return EC; } return Error::success(); @@ -176,7 +176,7 @@ Error CodeViewRecordIO::mapStringZVectorZ(std::vector &Value) { if (auto EC = mapStringZ(V)) return EC; } - if (auto EC = Writer->writeInteger(uint8_t(0))) + if (auto EC = Writer->writeInteger(0)) return EC; } else { StringRef S; @@ -194,22 +194,22 @@ 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(static_cast(LF_CHAR))) + if (auto EC = Writer->writeInteger(LF_CHAR)) return EC; - if (auto EC = Writer->writeInteger(static_cast(Value))) + if (auto EC = Writer->writeInteger(Value)) return EC; } else if (Value >= std::numeric_limits::min()) { - if (auto EC = Writer->writeInteger(static_cast(LF_SHORT))) + if (auto EC = Writer->writeInteger(LF_SHORT)) return EC; - if (auto EC = Writer->writeInteger(static_cast(Value))) + if (auto EC = Writer->writeInteger(Value)) return EC; } else if (Value >= std::numeric_limits::min()) { - if (auto EC = Writer->writeInteger(static_cast(LF_LONG))) + if (auto EC = Writer->writeInteger(LF_LONG)) return EC; - if (auto EC = Writer->writeInteger(static_cast(Value))) + if (auto EC = Writer->writeInteger(Value)) return EC; } else { - if (auto EC = Writer->writeInteger(static_cast(LF_QUADWORD))) + if (auto EC = Writer->writeInteger(LF_QUADWORD)) return EC; if (auto EC = Writer->writeInteger(Value)) return EC; @@ -219,20 +219,20 @@ Error CodeViewRecordIO::writeEncodedSignedInteger(const int64_t &Value) { Error CodeViewRecordIO::writeEncodedUnsignedInteger(const uint64_t &Value) { if (Value < LF_NUMERIC) { - if (auto EC = Writer->writeInteger(static_cast(Value))) + if (auto EC = Writer->writeInteger(Value)) return EC; } else if (Value <= std::numeric_limits::max()) { - if (auto EC = Writer->writeInteger(static_cast(LF_USHORT))) + if (auto EC = Writer->writeInteger(LF_USHORT)) return EC; - if (auto EC = Writer->writeInteger(static_cast(Value))) + if (auto EC = Writer->writeInteger(Value)) return EC; } else if (Value <= std::numeric_limits::max()) { - if (auto EC = Writer->writeInteger(static_cast(LF_ULONG))) + if (auto EC = Writer->writeInteger(LF_ULONG)) return EC; - if (auto EC = Writer->writeInteger(static_cast(Value))) + if (auto EC = Writer->writeInteger(Value)) return EC; } else { - if (auto EC = Writer->writeInteger(static_cast(LF_UQUADWORD))) + if (auto EC = Writer->writeInteger(LF_UQUADWORD)) return EC; if (auto EC = Writer->writeInteger(Value)) return EC; -- cgit v1.2.3