[llvm] a42a1c8 - [ORC] Fix reinterpret_cast warning. (#207874)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 6 18:24:07 PDT 2026
Author: Lang Hames
Date: 2026-07-07T11:24:02+10:00
New Revision: a42a1c84c1305d785ca58d271d5f2f87f1daeeb0
URL: https://github.com/llvm/llvm-project/commit/a42a1c84c1305d785ca58d271d5f2f87f1daeeb0
DIFF: https://github.com/llvm/llvm-project/commit/a42a1c84c1305d785ca58d271d5f2f87f1daeeb0.diff
LOG: [ORC] Fix reinterpret_cast warning. (#207874)
https://github.com/llvm/llvm-project/pull/206725#issuecomment-4896222897
reported warnings on windows builds due to reinterpret_cast:
warning C4312: 'reinterpret_cast': conversion from 'unsigned int' to
'void *' of greater size
This commit fixes the issue by using ExecutorAddr::toPtr for conversion
instead of reinterpret_cast.
Added:
Modified:
llvm/unittests/ExecutionEngine/Orc/InProcessEPCTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/ExecutionEngine/Orc/InProcessEPCTest.cpp b/llvm/unittests/ExecutionEngine/Orc/InProcessEPCTest.cpp
index 3e2fdf4be1427..5fe91c6ff6346 100644
--- a/llvm/unittests/ExecutionEngine/Orc/InProcessEPCTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/InProcessEPCTest.cpp
@@ -615,7 +615,7 @@ TEST(InProcessEPCTest, JITDispatchUnknownHandler) {
});
auto SentCallId =
- IPCA.callJITDispatch(reinterpret_cast<void *>(0xdeadbeef),
+ IPCA.callJITDispatch(ExecutorAddr(0xdeadbeef).toPtr<void *>(),
shared::WrapperFunctionBuffer::copyFrom("x", 1));
ASSERT_TRUE(SentCallId);
@@ -640,7 +640,7 @@ TEST(InProcessEPCTest, JITDispatchAfterDisconnectIsDropped) {
cantFail(Fix.EPCPtr->disconnect());
auto SentCallId =
- IPCA.callJITDispatch(reinterpret_cast<void *>(0xdeadbeef),
+ IPCA.callJITDispatch(ExecutorAddr(0xdeadbeef).toPtr<void *>(),
shared::WrapperFunctionBuffer::copyFrom("x", 1));
EXPECT_FALSE(SentCallId)
More information about the llvm-commits
mailing list