diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-05-31 01:37:45 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-05-31 01:37:45 +0000 |
commit | 03bddfee473f0655025a4e31bc80b5654afb2dbd (patch) | |
tree | 118957c57f1aab51e07391bb8c05e926c1db8930 /llvm/lib/Support/Windows/Memory.inc | |
parent | ec1aacaf5c9b5a9ff7ca7ab7a99b4c6bbdfb6fca (diff) | |
download | bcm5719-llvm-03bddfee473f0655025a4e31bc80b5654afb2dbd.tar.gz bcm5719-llvm-03bddfee473f0655025a4e31bc80b5654afb2dbd.zip |
Use error_code() instead of error_code::succes()
There is no std::error_code::success, so this removes much of the noise
in transitioning to std::error_code.
llvm-svn: 209952
Diffstat (limited to 'llvm/lib/Support/Windows/Memory.inc')
-rw-r--r-- | llvm/lib/Support/Windows/Memory.inc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Support/Windows/Memory.inc b/llvm/lib/Support/Windows/Memory.inc index ebe78782b90..a5f1c14b69a 100644 --- a/llvm/lib/Support/Windows/Memory.inc +++ b/llvm/lib/Support/Windows/Memory.inc @@ -70,7 +70,7 @@ MemoryBlock Memory::allocateMappedMemory(size_t NumBytes, const MemoryBlock *const NearBlock, unsigned Flags, error_code &EC) { - EC = error_code::success(); + EC = error_code(); if (NumBytes == 0) return MemoryBlock(); @@ -115,7 +115,7 @@ MemoryBlock Memory::allocateMappedMemory(size_t NumBytes, error_code Memory::releaseMappedMemory(MemoryBlock &M) { if (M.Address == 0 || M.Size == 0) - return error_code::success(); + return error_code(); if (!VirtualFree(M.Address, 0, MEM_RELEASE)) return error_code(::GetLastError(), system_category()); @@ -123,13 +123,13 @@ error_code Memory::releaseMappedMemory(MemoryBlock &M) { M.Address = 0; M.Size = 0; - return error_code::success(); + return error_code(); } error_code Memory::protectMappedMemory(const MemoryBlock &M, unsigned Flags) { if (M.Address == 0 || M.Size == 0) - return error_code::success(); + return error_code(); DWORD Protect = getWindowsProtectionFlags(Flags); @@ -140,7 +140,7 @@ error_code Memory::protectMappedMemory(const MemoryBlock &M, if (Flags & MF_EXEC) Memory::InvalidateInstructionCache(M.Address, M.Size); - return error_code::success(); + return error_code(); } /// InvalidateInstructionCache - Before the JIT can run a block of code @@ -159,7 +159,7 @@ MemoryBlock Memory::AllocateRWX(size_t NumBytes, error_code EC; MB = allocateMappedMemory(NumBytes, NearBlock, MF_READ|MF_WRITE|MF_EXEC, EC); - if (EC != error_code::success() && ErrMsg) { + if (EC != error_code() && ErrMsg) { MakeErrMsg(ErrMsg, EC.message()); } return MB; @@ -167,7 +167,7 @@ MemoryBlock Memory::AllocateRWX(size_t NumBytes, bool Memory::ReleaseRWX(MemoryBlock &M, std::string *ErrMsg) { error_code EC = releaseMappedMemory(M); - if (EC == error_code::success()) + if (EC == error_code()) return false; MakeErrMsg(ErrMsg, EC.message()); return true; |