Skip to content

Commit aa061dd

Browse files
committed
[ORC] Fix the LLJITWithRemoteDebugging example.
This was broken by the switch from JITTargetAddress to ExecutorAddr in 21a0625.
1 parent ebe9944 commit aa061dd

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/RemoteJITUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ JITLinkExecutor::loadDylib(StringRef RemotePath) {
141141

142142
Expected<int> JITLinkExecutor::runAsMain(JITEvaluatedSymbol MainSym,
143143
ArrayRef<std::string> Args) {
144-
return EPC->runAsMain(MainSym.getAddress(), Args);
144+
return EPC->runAsMain(ExecutorAddr(MainSym.getAddress()), Args);
145145
}
146146

147147
Error JITLinkExecutor::disconnect() { return EPC->disconnect(); }

llvm/include/llvm/ExecutionEngine/Orc/OrcRPCExecutorProcessControl.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,15 +340,16 @@ class OrcRPCExecutorProcessControlBase : public ExecutorProcessControl {
340340
Expected<int32_t> runAsMain(ExecutorAddr MainFnAddr,
341341
ArrayRef<std::string> Args) override {
342342
DEBUG_WITH_TYPE("orc", {
343-
dbgs() << "Running as main: " << formatv("{0:x16}", MainFnAddr)
343+
dbgs() << "Running as main: " << formatv("{0:x16}", MainFnAddr.getValue())
344344
<< ", args = [";
345345
for (unsigned I = 0; I != Args.size(); ++I)
346346
dbgs() << (I ? "," : "") << " \"" << Args[I] << "\"";
347347
dbgs() << "]\n";
348348
});
349-
auto Result = EP.template callB<orcrpctpc::RunMain>(MainFnAddr, Args);
349+
auto Result =
350+
EP.template callB<orcrpctpc::RunMain>(MainFnAddr.getValue(), Args);
350351
DEBUG_WITH_TYPE("orc", {
351-
dbgs() << " call to " << formatv("{0:x16}", MainFnAddr);
352+
dbgs() << " call to " << formatv("{0:x16}", MainFnAddr.getValue());
352353
if (Result)
353354
dbgs() << " returned result " << *Result << "\n";
354355
else
@@ -362,11 +363,11 @@ class OrcRPCExecutorProcessControlBase : public ExecutorProcessControl {
362363
ArrayRef<char> ArgBuffer) override {
363364
DEBUG_WITH_TYPE("orc", {
364365
dbgs() << "Running as wrapper function "
365-
<< formatv("{0:x16}", WrapperFnAddr) << " with "
366+
<< formatv("{0:x16}", WrapperFnAddr.getValue()) << " with "
366367
<< formatv("{0:x16}", ArgBuffer.size()) << " argument buffer\n";
367368
});
368369
auto Result = EP.template callB<orcrpctpc::RunWrapper>(
369-
WrapperFnAddr,
370+
WrapperFnAddr.getValue(),
370371
ArrayRef<uint8_t>(reinterpret_cast<const uint8_t *>(ArgBuffer.data()),
371372
ArgBuffer.size()));
372373

@@ -412,7 +413,7 @@ class OrcRPCExecutorProcessControlBase : public ExecutorProcessControl {
412413
private:
413414
Error runWrapperInJIT(
414415
std::function<Error(Expected<shared::WrapperFunctionResult>)> SendResult,
415-
ExecutorAddr FunctionTag, std::vector<uint8_t> ArgBuffer) {
416+
JITTargetAddress FunctionTag, std::vector<uint8_t> ArgBuffer) {
416417

417418
getExecutionSession().runJITDispatchHandler(
418419
[this, SendResult = std::move(SendResult)](

0 commit comments

Comments
 (0)