Go to the documentation of this file.
19 Expected<std::unique_ptr<EPCEHFrameRegistrar>>
27 auto ProcessHandle = EPC.
loadDylib(
nullptr);
29 return ProcessHandle.takeError();
31 std::string RegisterWrapperName, DeregisterWrapperName;
32 if (EPC.getTargetTriple().isOSBinFormatMachO()) {
33 RegisterWrapperName +=
'_';
34 DeregisterWrapperName +=
'_';
36 RegisterWrapperName +=
"llvm_orc_registerEHFrameSectionWrapper";
37 DeregisterWrapperName +=
"llvm_orc_deregisterEHFrameSectionWrapper";
40 RegistrationSymbols.
add(EPC.intern(RegisterWrapperName));
41 RegistrationSymbols.
add(EPC.intern(DeregisterWrapperName));
43 auto Result = EPC.lookupSymbols({{*ProcessHandle, RegistrationSymbols}});
45 return Result.takeError();
47 assert(Result->size() == 1 &&
"Unexpected number of dylibs in result");
49 "Unexpected number of addresses in result");
51 auto RegisterEHFrameWrapperFnAddr = (*Result)[0][0];
52 auto DeregisterEHFrameWrapperFnAddr = (*Result)[0][1];
54 return std::make_unique<EPCEHFrameRegistrar>(
61 RegisterEHFrameWrapperFnAddr, EHFrameSection);
67 DeregisterEHFrameWrapperFnAddr, EHFrameSection);
Represents an address in the executor process.
This is an optimization pass for GlobalISel generic memory operations.
A set of symbols to look up, each associated with a SymbolLookupFlags value.
Error deregisterEHFrames(ExecutorAddrRange EHFrameSection) override
SymbolLookupSet & add(SymbolStringPtr Name, SymbolLookupFlags Flags=SymbolLookupFlags::RequiredSymbol)
Add an element to the set.
Represents an address range in the exceutor process.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ExecutorProcessControl & getExecutorProcessControl()
Get the ExecutorProcessControl object associated with this ExecutionSession.
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
Error registerEHFrames(ExecutorAddrRange EHFrameSection) override
Lightweight error class with error context and mandatory checking.
An ExecutionSession represents a running JIT program.
virtual Expected< tpctypes::DylibHandle > loadDylib(const char *DylibPath)=0
Load the dynamic library at the given path and return a handle to it.
static Expected< std::unique_ptr< EPCEHFrameRegistrar > > Create(ExecutionSession &ES)
Create from a ExecutorProcessControl instance alone.