[clang] [clang-repl] Resolve mapper symbols via lookupAndApply (PR #223383)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 14 05:27:37 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Lang Hames (lhames)
<details>
<summary>Changes</summary>
IncrementalExecutor's createSharedMemoryManager resolved the SharedMemoryMapper instance and wrapper addresses with EPC.getBootstrapSymbols. For consistency, switch to lookupAndApply/recordAddr on the bootstrap JITDylib instead.
---
Full diff: https://github.com/llvm/llvm-project/pull/223383.diff
1 Files Affected:
- (modified) clang/lib/Interpreter/IncrementalExecutor.cpp (+18-11)
``````````diff
diff --git a/clang/lib/Interpreter/IncrementalExecutor.cpp b/clang/lib/Interpreter/IncrementalExecutor.cpp
index f6a4991964e6ab..6966e898bb5832 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;
``````````
</details>
https://github.com/llvm/llvm-project/pull/223383
More information about the cfe-commits
mailing list