21 std::optional<ExecutorAddr> RegistrationFunctionsDylib) {
29 if (!RegistrationFunctionsDylib) {
30 if (
auto D = EPC.loadDylib(
nullptr))
31 RegistrationFunctionsDylib = *
D;
36 std::string RegisterWrapperName, DeregisterWrapperName;
37 if (EPC.getTargetTriple().isOSBinFormatMachO()) {
38 RegisterWrapperName +=
'_';
39 DeregisterWrapperName +=
'_';
41 RegisterWrapperName +=
"llvm_orc_registerEHFrameSectionWrapper";
42 DeregisterWrapperName +=
"llvm_orc_deregisterEHFrameSectionWrapper";
45 RegistrationSymbols.
add(EPC.intern(RegisterWrapperName));
46 RegistrationSymbols.
add(EPC.intern(DeregisterWrapperName));
49 EPC.lookupSymbols({{*RegistrationFunctionsDylib, RegistrationSymbols}});
53 assert(
Result->size() == 1 &&
"Unexpected number of dylibs in result");
55 "Unexpected number of addresses in result");
57 auto RegisterEHFrameWrapperFnAddr = (*Result)[0][0];
58 auto DeregisterEHFrameWrapperFnAddr = (*Result)[0][1];
60 return std::make_unique<EPCEHFrameRegistrar>(
67 RegisterEHFrameWrapperFnAddr, EHFrameSection);
73 DeregisterEHFrameWrapperFnAddr, EHFrameSection);
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
return ToRemove size() > 0
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
Error deregisterEHFrames(ExecutorAddrRange EHFrameSection) override
static Expected< std::unique_ptr< EPCEHFrameRegistrar > > Create(ExecutionSession &ES, std::optional< ExecutorAddr > RegistrationFunctionsDylib=std::nullopt)
Create from a ExecutorProcessControl instance alone.
Error registerEHFrames(ExecutorAddrRange EHFrameSection) override
An ExecutionSession represents a running JIT program.
ExecutorProcessControl & getExecutorProcessControl()
Get the ExecutorProcessControl object associated with this ExecutionSession.
Error callSPSWrapper(ExecutorAddr WrapperFnAddr, WrapperCallArgTs &&...WrapperCallArgs)
Run a wrapper function using SPS to serialize the arguments and deserialize the results.
Represents an address in the executor process.
A set of symbols to look up, each associated with a SymbolLookupFlags value.
SymbolLookupSet & add(SymbolStringPtr Name, SymbolLookupFlags Flags=SymbolLookupFlags::RequiredSymbol)
Add an element to the set.
This is an optimization pass for GlobalISel generic memory operations.
Represents an address range in the exceutor process.