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 | 1bab2d53996ca082150f34d8dafc1968fb5ecba9 (patch) | |
tree | c1e2d538aa623bb0de93b37a36327a0d6ef2c1de /lib/Support/Windows/Memory.inc | |
parent | bfe17408a9bcad9cbb29ff0dafb8a7674a7c09a6 (diff) | |
download | llvm-1bab2d53996ca082150f34d8dafc1968fb5ecba9.tar.gz llvm-1bab2d53996ca082150f34d8dafc1968fb5ecba9.tar.bz2 llvm-1bab2d53996ca082150f34d8dafc1968fb5ecba9.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209952 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Windows/Memory.inc')
-rw-r--r-- | lib/Support/Windows/Memory.inc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Support/Windows/Memory.inc b/lib/Support/Windows/Memory.inc index ebe78782b9..a5f1c14b69 100644 --- a/lib/Support/Windows/Memory.inc +++ b/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; |