[clang] [clang-repl] Resolve mapper symbols via lookupAndApply (PR #223383)
Lang Hames via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 14 05:27:02 PDT 2026
https://github.com/lhames created https://github.com/llvm/llvm-project/pull/223383
IncrementalExecutor's createSharedMemoryManager resolved the SharedMemoryMapper instance and wrapper addresses with EPC.getBootstrapSymbols. For consistency, switch to lookupAndApply/recordAddr on the bootstrap JITDylib instead.
>From 2a9b099c8ba6b6ebbd414031833851787f8c30cf Mon Sep 17 00:00:00 2001
From: Lang Hames <lhames at gmail.com>
Date: Mon, 14 Sep 2026 22:01:47 +1000
Subject: [PATCH] [clang-repl] Resolve mapper symbols via lookupAndApply
IncrementalExecutor's createSharedMemoryManager resolved the
SharedMemoryMapper instance and wrapper addresses with
EPC.getBootstrapSymbols. For consistency, switch to
lookupAndApply/recordAddr on the bootstrap JITDylib instead.
---
clang/lib/Interpreter/IncrementalExecutor.cpp | 29 ++++++++++++-------
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/clang/lib/Interpreter/IncrementalExecutor.cpp b/clang/lib/Interpreter/IncrementalExecutor.cpp
index f6a4991964e6a..6966e898bb583 100644
--- a/clang/lib/Interpreter/IncrementalExecutor.cpp
+++ b/clang/lib/Interpreter/IncrementalExecutor.cpp
@@ -34,6 +34,7 @@
#include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
#include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
#include "llvm/ExecutionEngine/Orc/LLJIT.h"
+#include "llvm/ExecutionEngine/Orc/LookupAndApply.h"
#include "llvm/ExecutionEngine/Orc/MapperJITLinkMemoryManager.h"
#include "llvm/ExecutionEngine/Orc/Shared/SPSCI/SharedMemoryMapperSPSCI.h"
#include "llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h"
@@ -115,17 +116,23 @@ Expected<std::unique_ptr<llvm::jitlink::JITLinkMemoryManager>>
createSharedMemoryManager(llvm::orc::ExecutorProcessControl &EPC,
unsigned SlabAllocateSize) {
llvm::orc::SharedMemoryMapper::SymbolAddrs SAs;
- if (auto Err = EPC.getBootstrapSymbols(
- {{SAs.Instance,
- llvm::orc::rt::sps_ci::SharedMemoryMapperInstanceName},
- {SAs.Reserve,
- llvm::orc::rt::sps_ci::SharedMemoryMapperReserve::Name},
- {SAs.Initialize,
- llvm::orc::rt::sps_ci::SharedMemoryMapperInitialize::Name},
- {SAs.Deinitialize,
- llvm::orc::rt::sps_ci::SharedMemoryMapperDeinitialize::Name},
- {SAs.Release,
- llvm::orc::rt::sps_ci::SharedMemoryMapperRelease::Name}}))
+ if (auto Err = llvm::orc::lookupAndApply(
+ EPC.getExecutionSession().getBootstrapJITDylib(),
+ {llvm::orc::recordAddr(
+ llvm::orc::rt::sps_ci::SharedMemoryMapperInstanceName,
+ &SAs.Instance),
+ llvm::orc::recordAddr(
+ llvm::orc::rt::sps_ci::SharedMemoryMapperReserve::Name,
+ &SAs.Reserve),
+ llvm::orc::recordAddr(
+ llvm::orc::rt::sps_ci::SharedMemoryMapperInitialize::Name,
+ &SAs.Initialize),
+ llvm::orc::recordAddr(
+ llvm::orc::rt::sps_ci::SharedMemoryMapperDeinitialize::Name,
+ &SAs.Deinitialize),
+ llvm::orc::recordAddr(
+ llvm::orc::rt::sps_ci::SharedMemoryMapperRelease::Name,
+ &SAs.Release)}))
return std::move(Err);
size_t SlabSize;
More information about the cfe-commits
mailing list