LLVM  14.0.0git
EPCEHFrameRegistrar.h
Go to the documentation of this file.
1 //===-- EPCEHFrameRegistrar.h - EPC based eh-frame registration -*- C++ -*-===//
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 //
9 // ExecutorProcessControl based eh-frame registration.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_EXECUTIONENGINE_ORC_EPCEHFRAMEREGISTRAR_H
14 #define LLVM_EXECUTIONENGINE_ORC_EPCEHFRAMEREGISTRAR_H
15 
18 
19 namespace llvm {
20 namespace orc {
21 
22 class ExecutionSession;
23 
24 /// Register/Deregisters EH frames in a remote process via a
25 /// ExecutorProcessControl instance.
27 public:
28  /// Create from a ExecutorProcessControl instance alone. This will use
29  /// the EPC's lookupSymbols method to find the registration/deregistration
30  /// funciton addresses by name.
33 
34  /// Create a EPCEHFrameRegistrar with the given ExecutorProcessControl
35  /// object and registration/deregistration function addresses.
37  ExecutorAddr RegisterEHFrameWrapperFnAddr,
38  ExecutorAddr DeregisterEHFRameWrapperFnAddr)
39  : ES(ES), RegisterEHFrameWrapperFnAddr(RegisterEHFrameWrapperFnAddr),
40  DeregisterEHFrameWrapperFnAddr(DeregisterEHFRameWrapperFnAddr) {}
41 
42  Error registerEHFrames(JITTargetAddress EHFrameSectionAddr,
43  size_t EHFrameSectionSize) override;
44  Error deregisterEHFrames(JITTargetAddress EHFrameSectionAddr,
45  size_t EHFrameSectionSize) override;
46 
47 private:
48  ExecutionSession &ES;
49  ExecutorAddr RegisterEHFrameWrapperFnAddr;
50  ExecutorAddr DeregisterEHFrameWrapperFnAddr;
51 };
52 
53 } // end namespace orc
54 } // end namespace llvm
55 
56 #endif // LLVM_EXECUTIONENGINE_ORC_EPCEHFRAMEREGISTRAR_H
llvm::orc::ExecutorAddr
Represents an address in the executor process.
Definition: ExecutorAddress.h:37
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
llvm::orc::EPCEHFrameRegistrar
Register/Deregisters EH frames in a remote process via a ExecutorProcessControl instance.
Definition: EPCEHFrameRegistrar.h:26
EHFrameSupport.h
llvm::orc::EPCEHFrameRegistrar::deregisterEHFrames
Error deregisterEHFrames(JITTargetAddress EHFrameSectionAddr, size_t EHFrameSectionSize) override
Definition: EPCEHFrameRegistrar.cpp:66
llvm::orc::EPCEHFrameRegistrar::EPCEHFrameRegistrar
EPCEHFrameRegistrar(ExecutionSession &ES, ExecutorAddr RegisterEHFrameWrapperFnAddr, ExecutorAddr DeregisterEHFRameWrapperFnAddr)
Create a EPCEHFrameRegistrar with the given ExecutorProcessControl object and registration/deregistra...
Definition: EPCEHFrameRegistrar.h:36
ExecutorAddress.h
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::orc::ExecutionSession
An ExecutionSession represents a running JIT program.
Definition: Core.h:1271
llvm::JITTargetAddress
uint64_t JITTargetAddress
Represents an address in the target process's address space.
Definition: JITSymbol.h:42
llvm::orc::EPCEHFrameRegistrar::Create
static Expected< std::unique_ptr< EPCEHFrameRegistrar > > Create(ExecutionSession &ES)
Create from a ExecutorProcessControl instance alone.
Definition: EPCEHFrameRegistrar.cpp:20
llvm::orc::EPCEHFrameRegistrar::registerEHFrames
Error registerEHFrames(JITTargetAddress EHFrameSectionAddr, size_t EHFrameSectionSize) override
Definition: EPCEHFrameRegistrar.cpp:59