[llvm] b0bc773 - [ORC] Add more explicit casts to fix a narrowing conversion errors.

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


Author: Lang Hames
Date: 2020-07-16T15:37:18-07:00
New Revision: b0bc77380d8ca6c4b5037d0437b5d3a15b0c3f6f

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

LOG: [ORC] Add more explicit casts to fix a narrowing conversion errors.

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 e7e1ff95e33a..1689776c68e1 100644
--- a/llvm/lib/ExecutionEngine/Orc/TPCIndirectionUtils.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TPCIndirectionUtils.cpp
@@ -127,7 +127,8 @@ Error TPCTrampolinePool::grow() {
                                                 sys::Memory::MF_EXEC);
   auto PageSize = TPC.getPageSize();
   auto Alloc = TPC.getMemMgr().allocate(
-      {{TrampolinePagePermissions, {PageSize, PageSize, 0}}});
+      {{TrampolinePagePermissions,
+        {PageSize, static_cast<size_t>(PageSize), 0}}});
 
   if (!Alloc)
     return Alloc.takeError();
@@ -310,7 +311,8 @@ TPCIndirectionUtils::writeResolverBlock(JITTargetAddress ReentryFnAddr,
   auto ResolverSize = ABI->getResolverCodeSize();
 
   auto Alloc = TPC.getMemMgr().allocate(
-      {{ResolverBlockPermissions, {TPC.getPageSize(), ResolverSize, 0}}});
+      {{ResolverBlockPermissions,
+        {TPC.getPageSize(), static_cast<size_t>(ResolverSize), 0}}});
   if (!Alloc)
     return Alloc.takeError();
 


        


More information about the llvm-commits mailing list