[llvm] r210729 - Used mapWindowsError. I missed these in the initial transition.

Rafael Espindola rafael.espindola at gmail.com
Wed Jun 11 18:25:34 PDT 2014


Author: rafael
Date: Wed Jun 11 20:25:33 2014
New Revision: 210729

URL: http://llvm.org/viewvc/llvm-project?rev=210729&view=rev
Log:
Used mapWindowsError. I missed these in the initial transition.

Modified:
    llvm/trunk/lib/Support/Windows/Memory.inc

Modified: llvm/trunk/lib/Support/Windows/Memory.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Memory.inc?rev=210729&r1=210728&r2=210729&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Memory.inc (original)
+++ llvm/trunk/lib/Support/Windows/Memory.inc Wed Jun 11 20:25:33 2014
@@ -15,6 +15,7 @@
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/Process.h"
+#include "llvm/Support/WindowsError.h"
 
 // The Windows.h header must be the last one included.
 #include "WindowsSupport.h"
@@ -99,7 +100,7 @@ MemoryBlock Memory::allocateMappedMemory
       // Try again without the NearBlock hint
       return allocateMappedMemory(NumBytes, NULL, Flags, EC);
     }
-    EC = error_code(::GetLastError(), system_category());
+    EC = mapWindowsError(::GetLastError());
     return MemoryBlock();
   }
 
@@ -118,7 +119,7 @@ error_code Memory::releaseMappedMemory(M
     return error_code();
 
   if (!VirtualFree(M.Address, 0, MEM_RELEASE))
-    return error_code(::GetLastError(), system_category());
+    return mapWindowsError(::GetLastError());
 
   M.Address = 0;
   M.Size = 0;
@@ -135,7 +136,7 @@ error_code Memory::protectMappedMemory(c
 
   DWORD OldFlags;
   if (!VirtualProtect(M.Address, M.Size, Protect, &OldFlags))
-    return error_code(::GetLastError(), system_category());
+    return mapWindowsError(::GetLastError());
 
   if (Flags & MF_EXEC)
     Memory::InvalidateInstructionCache(M.Address, M.Size);





More information about the llvm-commits mailing list