xref: /freebsd/contrib/llvm-project/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h (revision a259b98fa211ed87bfee58c575de4e2de94ee0fa)
1 //===----- RegisterEHFrames.h -- Register EH frame sections -----*- 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 // Support for dynamically registering and deregistering eh-frame sections
10 // in-process via libunwind.
11 //
12 // FIXME: The functionality in this file should be moved to the ORC runtime.
13 //
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_REGISTEREHFRAMES_H
17 #define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_REGISTEREHFRAMES_H
18 
19 #include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
20 #include "llvm/Support/Compiler.h"
21 #include "llvm/Support/Error.h"
22 
23 namespace llvm {
24 namespace orc {
25 
26 /// Register frames in the given eh-frame section with libunwind.
27 LLVM_ABI Error registerEHFrameSection(const void *EHFrameSectionAddr,
28                                       size_t EHFrameSectionSize);
29 
30 /// Unregister frames in the given eh-frame section with libunwind.
31 LLVM_ABI Error deregisterEHFrameSection(const void *EHFrameSectionAddr,
32                                         size_t EHFrameSectionSize);
33 
34 } // end namespace orc
35 } // end namespace llvm
36 
37 extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult
38 llvm_orc_registerEHFrameSectionAllocAction(const char *ArgData, size_t ArgSize);
39 
40 extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult
41 llvm_orc_deregisterEHFrameSectionAllocAction(const char *ArgData,
42                                              size_t ArgSize);
43 
44 #endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_REGISTEREHFRAMES_H
45