[llvm] 46b1a7c - [ORC] Fix compilation on mingw
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 14 02:05:27 PDT 2022
Author: Martin Storsjö
Date: 2022-07-14T12:05:08+03:00
New Revision: 46b1a7c5f9e6841016078d32728bb0d205336df5
URL: https://github.com/llvm/llvm-project/commit/46b1a7c5f9e6841016078d32728bb0d205336df5
DIFF: https://github.com/llvm/llvm-project/commit/46b1a7c5f9e6841016078d32728bb0d205336df5.diff
LOG: [ORC] Fix compilation on mingw
Explicitly call the -W suffixed API functions when passing wchar based
strings.
Added:
Modified:
llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp
llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp b/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp
index 2960ce2e85510..7fbf9ef51b3d4 100644
--- a/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp
@@ -208,8 +208,8 @@ void SharedMemoryMapper::reserve(size_t NumBytes,
std::wstring WideSharedMemoryName(SharedMemoryName.begin(),
SharedMemoryName.end());
- HANDLE SharedMemoryFile = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE,
- WideSharedMemoryName.c_str());
+ HANDLE SharedMemoryFile = OpenFileMappingW(FILE_MAP_ALL_ACCESS, FALSE,
+ WideSharedMemoryName.c_str());
if (!SharedMemoryFile)
return OnReserved(errorCodeToError(mapWindowsError(GetLastError())));
diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
index a1dae2ad72be2..490b757ad4893 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
@@ -91,7 +91,7 @@ ExecutorSharedMemoryMapperService::reserve(uint64_t Size) {
std::wstring WideSharedMemoryName(SharedMemoryName.begin(),
SharedMemoryName.end());
- HANDLE SharedMemoryFile = CreateFileMapping(
+ HANDLE SharedMemoryFile = CreateFileMappingW(
INVALID_HANDLE_VALUE, NULL, PAGE_EXECUTE_READWRITE, Size >> 32,
Size & 0xffffffff, WideSharedMemoryName.c_str());
if (!SharedMemoryFile)
More information about the llvm-commits
mailing list