summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/PDB/BinaryStreamTest.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2017-03-01 05:11:41 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2017-03-01 05:11:41 +0000
commit1a1d9594231929abfdc61be02476719967f0bcf8 (patch)
tree8be78f003ebd5052d69992d99fb9c3da038410a7 /llvm/unittests/DebugInfo/PDB/BinaryStreamTest.cpp
parent4913a7921e806955e6655df77835d32b012b9056 (diff)
downloadbcm5719-llvm-1a1d9594231929abfdc61be02476719967f0bcf8.tar.gz
bcm5719-llvm-1a1d9594231929abfdc61be02476719967f0bcf8.zip
(Rewroking r296581) PDB/BinaryStreamTest.cpp: Appease mingw to avoid std::errc::no_buffer_space.
Unfortunately, mingw's libstdc++ doesn't provide winsock2 errors. That said, we should avoid raising OS-oriented error code in our code. For now, I suggest to define custom error from std::error_category. See also; https://reviews.llvm.org/D20592 llvm-svn: 296583
Diffstat (limited to 'llvm/unittests/DebugInfo/PDB/BinaryStreamTest.cpp')
-rw-r--r--llvm/unittests/DebugInfo/PDB/BinaryStreamTest.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/unittests/DebugInfo/PDB/BinaryStreamTest.cpp b/llvm/unittests/DebugInfo/PDB/BinaryStreamTest.cpp
index 5c22a4afa92..b7308868e05 100644
--- a/llvm/unittests/DebugInfo/PDB/BinaryStreamTest.cpp
+++ b/llvm/unittests/DebugInfo/PDB/BinaryStreamTest.cpp
@@ -13,6 +13,7 @@
#include "llvm/DebugInfo/MSF/BinaryStreamReader.h"
#include "llvm/DebugInfo/MSF/BinaryStreamRef.h"
#include "llvm/DebugInfo/MSF/BinaryStreamWriter.h"
+#include "llvm/Support/Errc.h"
#include "gtest/gtest.h"
#include <unordered_map>
@@ -56,7 +57,7 @@ public:
Error readBytes(uint32_t Offset, uint32_t Size,
ArrayRef<uint8_t> &Buffer) override {
if (Offset + Size > Data.size())
- return errorCodeToError(make_error_code(std::errc::no_buffer_space));
+ return errorCodeToError(make_error_code(llvm::errc::function_not_supported));
uint32_t S = startIndex(Offset);
auto Ref = Data.drop_front(S);
if (Ref.size() >= Size) {
@@ -75,7 +76,7 @@ public:
Error readLongestContiguousChunk(uint32_t Offset,
ArrayRef<uint8_t> &Buffer) override {
if (Offset >= Data.size())
- return errorCodeToError(make_error_code(std::errc::no_buffer_space));
+ return errorCodeToError(make_error_code(llvm::errc::function_not_supported));
uint32_t S = startIndex(Offset);
Buffer = Data.drop_front(S);
return Error::success();
@@ -85,7 +86,7 @@ public:
Error writeBytes(uint32_t Offset, ArrayRef<uint8_t> SrcData) override {
if (Offset + SrcData.size() > Data.size())
- return errorCodeToError(make_error_code(std::errc::no_buffer_space));
+ return errorCodeToError(make_error_code(llvm::errc::function_not_supported));
if (SrcData.empty())
return Error::success();
OpenPOWER on IntegriCloud