summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-06-11 03:49:13 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-06-11 03:49:13 +0000
commit6a9aae77d4bc6eb644c106fc79be6f59c53c5ba1 (patch)
treec5df5de86cde147bbb19c087819d6115c113e75d /llvm
parent1f7701c19c472ec01a62b2522263ef8118bbc6d5 (diff)
downloadbcm5719-llvm-6a9aae77d4bc6eb644c106fc79be6f59c53c5ba1.tar.gz
bcm5719-llvm-6a9aae77d4bc6eb644c106fc79be6f59c53c5ba1.zip
There is no posix_category in std, use generic_category.
llvm-svn: 210630
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Support/system_error.h5
-rw-r--r--llvm/lib/Support/MemoryBuffer.cpp6
-rw-r--r--llvm/lib/Support/system_error.cpp9
3 files changed, 3 insertions, 17 deletions
diff --git a/llvm/include/llvm/Support/system_error.h b/llvm/include/llvm/Support/system_error.h
index 724e3cef92f..396338c0ab3 100644
--- a/llvm/include/llvm/Support/system_error.h
+++ b/llvm/include/llvm/Support/system_error.h
@@ -650,11 +650,6 @@ public:
const error_category& generic_category();
const error_category& system_category();
-/// Get the error_category used for errno values from POSIX functions. This is
-/// the same as the system_category on POSIX systems, but is the same as the
-/// generic_category on Windows.
-const error_category& posix_category();
-
class error_condition
{
int _val_;
diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp
index 88d862269fd..b7298090db4 100644
--- a/llvm/lib/Support/MemoryBuffer.cpp
+++ b/llvm/lib/Support/MemoryBuffer.cpp
@@ -222,7 +222,7 @@ static error_code getMemoryBufferForStream(int FD,
ReadBytes = read(FD, Buffer.end(), ChunkSize);
if (ReadBytes == -1) {
if (errno == EINTR) continue;
- return error_code(errno, posix_category());
+ return error_code(errno, generic_category());
}
Buffer.set_size(Buffer.size() + ReadBytes);
} while (ReadBytes != 0);
@@ -370,7 +370,7 @@ static error_code getOpenFileImpl(int FD, const char *Filename,
size_t BytesLeft = MapSize;
#ifndef HAVE_PREAD
if (lseek(FD, Offset, SEEK_SET) == -1)
- return error_code(errno, posix_category());
+ return error_code(errno, generic_category());
#endif
while (BytesLeft) {
@@ -383,7 +383,7 @@ static error_code getOpenFileImpl(int FD, const char *Filename,
if (errno == EINTR)
continue;
// Error while reading.
- return error_code(errno, posix_category());
+ return error_code(errno, generic_category());
}
if (NumRead == 0) {
memset(BufPtr, 0, BytesLeft); // zero-initialize rest of the buffer.
diff --git a/llvm/lib/Support/system_error.cpp b/llvm/lib/Support/system_error.cpp
index 0ca183e40a4..46b501eea0e 100644
--- a/llvm/lib/Support/system_error.cpp
+++ b/llvm/lib/Support/system_error.cpp
@@ -96,15 +96,6 @@ system_category() {
return s;
}
-const error_category&
-posix_category() {
-#ifdef LLVM_ON_WIN32
- return generic_category();
-#else
- return system_category();
-#endif
-}
-
// error_condition
std::string
OpenPOWER on IntegriCloud