LLVM 20.0.0git
EPCEHFrameRegistrar.cpp
Go to the documentation of this file.
1//===------ EPCEHFrameRegistrar.cpp - EPC-based eh-frame registration -----===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
10
13
14using namespace llvm::orc::shared;
15
16namespace llvm {
17namespace orc {
18
21
22 // Lookup addresseses of the registration/deregistration functions in the
23 // bootstrap map.
24 ExecutorAddr RegisterEHFrameSectionWrapper;
25 ExecutorAddr DeregisterEHFrameSectionWrapper;
27 {{RegisterEHFrameSectionWrapper,
28 rt::RegisterEHFrameSectionWrapperName},
29 {DeregisterEHFrameSectionWrapper,
30 rt::DeregisterEHFrameSectionWrapperName}}))
31 return std::move(Err);
32
33 return std::make_unique<EPCEHFrameRegistrar>(
34 ES, RegisterEHFrameSectionWrapper, DeregisterEHFrameSectionWrapper);
35}
36
37Error EPCEHFrameRegistrar::registerEHFrames(ExecutorAddrRange EHFrameSection) {
38 return ES.callSPSWrapper<void(SPSExecutorAddrRange)>(
39 RegisterEHFrameSectionWrapper, EHFrameSection);
40}
41
42Error EPCEHFrameRegistrar::deregisterEHFrames(
43 ExecutorAddrRange EHFrameSection) {
44 return ES.callSPSWrapper<void(SPSExecutorAddrRange)>(
45 DeregisterEHFrameSectionWrapper, EHFrameSection);
46}
47
48} // end namespace orc
49} // end namespace llvm
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
Tagged union holding either a T or a Error.
Definition: Error.h:481
static Expected< std::unique_ptr< EPCEHFrameRegistrar > > Create(ExecutionSession &ES)
Create from a ExecutorProcessControl instance alone.
An ExecutionSession represents a running JIT program.
Definition: Core.h:1339
ExecutorProcessControl & getExecutorProcessControl()
Get the ExecutorProcessControl object associated with this ExecutionSession.
Definition: Core.h:1379
Represents an address in the executor process.
Error getBootstrapSymbols(ArrayRef< std::pair< ExecutorAddr &, StringRef > > Pairs) const
For each (ExecutorAddr&, StringRef) pair, looks up the string in the bootstrap symbols map and writes...
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Represents an address range in the exceutor process.