[llvm] 1005623 - [ORC] Switch from initializer lists to named arguments to work around MSVC.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 15:58:56 PDT 2020


Author: Lang Hames
Date: 2020-07-16T15:58:31-07:00
New Revision: 10056238ac07a95b8cc5766bb4173b4a01203bc6

URL: https://github.com/llvm/llvm-project/commit/10056238ac07a95b8cc5766bb4173b4a01203bc6
DIFF: https://github.com/llvm/llvm-project/commit/10056238ac07a95b8cc5766bb4173b4a01203bc6.diff

LOG: [ORC] Switch from initializer lists to named arguments to work around MSVC.

MSVC doesn't like some of the initializer list uses in 0e940d55f8a.
Switch to named arguments to work around this.

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/Orc/TPCIndirectionUtils.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/Orc/TPCIndirectionUtils.cpp b/llvm/lib/ExecutionEngine/Orc/TPCIndirectionUtils.cpp
index 1689776c68e1..150040cd11e5 100644
--- a/llvm/lib/ExecutionEngine/Orc/TPCIndirectionUtils.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TPCIndirectionUtils.cpp
@@ -126,9 +126,10 @@ Error TPCTrampolinePool::grow() {
       static_cast<sys::Memory::ProtectionFlags>(sys::Memory::MF_READ |
                                                 sys::Memory::MF_EXEC);
   auto PageSize = TPC.getPageSize();
-  auto Alloc = TPC.getMemMgr().allocate(
-      {{TrampolinePagePermissions,
-        {PageSize, static_cast<size_t>(PageSize), 0}}});
+  jitlink::JITLinkMemoryManager::SegmentsRequestMap Request;
+  Request[TrampolinePagePermissions] = {PageSize, static_cast<size_t>(PageSize),
+                                        0};
+  auto Alloc = TPC.getMemMgr().allocate(Request);
 
   if (!Alloc)
     return Alloc.takeError();
@@ -310,9 +311,10 @@ TPCIndirectionUtils::writeResolverBlock(JITTargetAddress ReentryFnAddr,
                                                 sys::Memory::MF_EXEC);
   auto ResolverSize = ABI->getResolverCodeSize();
 
-  auto Alloc = TPC.getMemMgr().allocate(
-      {{ResolverBlockPermissions,
-        {TPC.getPageSize(), static_cast<size_t>(ResolverSize), 0}}});
+  jitlink::JITLinkMemoryManager::SegmentsRequestMap Request;
+  Request[ResolverBlockPermissions] = {TPC.getPageSize(),
+                                       static_cast<size_t>(ResolverSize), 0};
+  auto Alloc = TPC.getMemMgr().allocate(Request);
   if (!Alloc)
     return Alloc.takeError();
 
@@ -379,10 +381,11 @@ TPCIndirectionUtils::getIndirectStubs(unsigned NumStubs) {
         static_cast<sys::Memory::ProtectionFlags>(sys::Memory::MF_READ |
                                                   sys::Memory::MF_WRITE);
 
-    auto Alloc = TPC.getMemMgr().allocate(
-        {{StubPagePermissions, {PageSize, static_cast<size_t>(StubBytes), 0}},
-         {PointerPagePermissions, {PageSize, 0, PointerBytes}}});
-
+    jitlink::JITLinkMemoryManager::SegmentsRequestMap Request;
+    Request[StubPagePermissions] = {PageSize, static_cast<size_t>(StubBytes),
+                                    0};
+    Request[PointerPagePermissions] = {PageSize, 0, PointerBytes};
+    auto Alloc = TPC.getMemMgr().allocate(Request);
     if (!Alloc)
       return Alloc.takeError();
 


        


More information about the llvm-commits mailing list