1 //===-- EPCEHFrameRegistrar.h - EPC based eh-frame registration -*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // ExecutorProcessControl based eh-frame registration.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_EXECUTIONENGINE_ORC_EPCEHFRAMEREGISTRAR_H
14 #define LLVM_EXECUTIONENGINE_ORC_EPCEHFRAMEREGISTRAR_H
16 #include "llvm/ExecutionEngine/JITLink/EHFrameSupport.h"
17 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
22 class ExecutionSession;
24 /// Register/Deregisters EH frames in a remote process via a
25 /// ExecutorProcessControl instance.
26 class EPCEHFrameRegistrar : public jitlink::EHFrameRegistrar {
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.
31 static Expected<std::unique_ptr<EPCEHFrameRegistrar>>
32 Create(ExecutionSession &ES);
34 /// Create a EPCEHFrameRegistrar with the given ExecutorProcessControl
35 /// object and registration/deregistration function addresses.
36 EPCEHFrameRegistrar(ExecutionSession &ES,
37 ExecutorAddr RegisterEHFrameWrapperFnAddr,
38 ExecutorAddr DeregisterEHFRameWrapperFnAddr)
39 : ES(ES), RegisterEHFrameWrapperFnAddr(RegisterEHFrameWrapperFnAddr),
40 DeregisterEHFrameWrapperFnAddr(DeregisterEHFRameWrapperFnAddr) {}
42 Error registerEHFrames(ExecutorAddrRange EHFrameSection) override;
43 Error deregisterEHFrames(ExecutorAddrRange EHFrameSection) override;
47 ExecutorAddr RegisterEHFrameWrapperFnAddr;
48 ExecutorAddr DeregisterEHFrameWrapperFnAddr;
51 } // end namespace orc
52 } // end namespace llvm
54 #endif // LLVM_EXECUTIONENGINE_ORC_EPCEHFRAMEREGISTRAR_H