llvm.org GIT mirror llvm / 952e639
[PDB] Remove use of std error codes. I already created a BinaryStreamError class for this purpose, so update the code to use that on the remaining occurrences of errc values. This should also address the issue which led to r296583. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296640 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 2 years ago
1 changed file(s) with 6 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
1212 #include "llvm/DebugInfo/MSF/BinaryStreamReader.h"
1313 #include "llvm/DebugInfo/MSF/BinaryStreamRef.h"
1414 #include "llvm/DebugInfo/MSF/BinaryStreamWriter.h"
15 #include "llvm/Support/Errc.h"
1615 #include "gtest/gtest.h"
1716
1817 #include
5554
5655 Error readBytes(uint32_t Offset, uint32_t Size,
5756 ArrayRef &Buffer) override {
58 if (Offset + Size > Data.size())
59 return errorCodeToError(make_error_code(llvm::errc::function_not_supported));
57 if (auto EC = checkOffset(Offset, Size))
58 return EC;
6059 uint32_t S = startIndex(Offset);
6160 auto Ref = Data.drop_front(S);
6261 if (Ref.size() >= Size) {
7473
7574 Error readLongestContiguousChunk(uint32_t Offset,
7675 ArrayRef &Buffer) override {
77 if (Offset >= Data.size())
78 return errorCodeToError(make_error_code(llvm::errc::function_not_supported));
76 if (auto EC = checkOffset(Offset, 1))
77 return EC;
7978 uint32_t S = startIndex(Offset);
8079 Buffer = Data.drop_front(S);
8180 return Error::success();
8483 uint32_t getLength() override { return Data.size(); }
8584
8685 Error writeBytes(uint32_t Offset, ArrayRef SrcData) override {
87 if (Offset + SrcData.size() > Data.size())
88 return errorCodeToError(make_error_code(llvm::errc::function_not_supported));
86 if (auto EC = checkOffset(Offset, SrcData.size()))
87 return EC;
8988 if (SrcData.empty())
9089 return Error::success();
9190