summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix/Memory.inc
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-06-11 04:34:41 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-06-11 04:34:41 +0000
commit181adb5f57efdd3418b420e4c28379ab6da5f73f (patch)
tree71498fbcd8105dcc1d340200633db2599ccdea5f /llvm/lib/Support/Unix/Memory.inc
parentfaa29bd5297298a7efb671e96609666c2e753d70 (diff)
downloadbcm5719-llvm-181adb5f57efdd3418b420e4c28379ab6da5f73f.tar.gz
bcm5719-llvm-181adb5f57efdd3418b420e4c28379ab6da5f73f.zip
Uses generic_category instead of system_category.
Some c++ libraries (libstdc++ at least) don't seem to map to the generic category in in the system_category's default_error_condition. llvm-svn: 210635
Diffstat (limited to 'llvm/lib/Support/Unix/Memory.inc')
-rw-r--r--llvm/lib/Support/Unix/Memory.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Support/Unix/Memory.inc b/llvm/lib/Support/Unix/Memory.inc
index 7e02244c725..5d19f59bc76 100644
--- a/llvm/lib/Support/Unix/Memory.inc
+++ b/llvm/lib/Support/Unix/Memory.inc
@@ -95,7 +95,7 @@ Memory::allocateMappedMemory(size_t NumBytes,
#ifdef NEED_DEV_ZERO_FOR_MMAP
static int zero_fd = open("/dev/zero", O_RDWR);
if (zero_fd == -1) {
- EC = error_code(errno, system_category());
+ EC = error_code(errno, generic_category());
return MemoryBlock();
}
fd = zero_fd;
@@ -123,7 +123,7 @@ Memory::allocateMappedMemory(size_t NumBytes,
if (NearBlock) //Try again without a near hint
return allocateMappedMemory(NumBytes, nullptr, PFlags, EC);
- EC = error_code(errno, system_category());
+ EC = error_code(errno, generic_category());
return MemoryBlock();
}
@@ -143,7 +143,7 @@ Memory::releaseMappedMemory(MemoryBlock &M) {
return error_code();
if (0 != ::munmap(M.Address, M.Size))
- return error_code(errno, system_category());
+ return error_code(errno, generic_category());
M.Address = nullptr;
M.Size = 0;
@@ -163,7 +163,7 @@ Memory::protectMappedMemory(const MemoryBlock &M, unsigned Flags) {
int Result = ::mprotect(M.Address, M.Size, Protect);
if (Result != 0)
- return error_code(errno, system_category());
+ return error_code(errno, generic_category());
if (Flags & MF_EXEC)
Memory::InvalidateInstructionCache(M.Address, M.Size);
OpenPOWER on IntegriCloud