LLVM  13.0.0git
EHFrameSupport.h
Go to the documentation of this file.
1 //===--------- EHFrameSupport.h - JITLink eh-frame utils --------*- 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 // EHFrame registration support for JITLink.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_EXECUTIONENGINE_JITLINK_EHFRAMESUPPORT_H
14 #define LLVM_EXECUTIONENGINE_JITLINK_EHFRAMESUPPORT_H
15 
16 #include "llvm/ADT/Triple.h"
19 #include "llvm/Support/Error.h"
20 
21 namespace llvm {
22 namespace jitlink {
23 
24 /// Supports registration/deregistration of EH-frames in a target process.
26 public:
27  virtual ~EHFrameRegistrar();
28  virtual Error registerEHFrames(JITTargetAddress EHFrameSectionAddr,
29  size_t EHFrameSectionSize) = 0;
30  virtual Error deregisterEHFrames(JITTargetAddress EHFrameSectionAddr,
31  size_t EHFrameSectionSize) = 0;
32 };
33 
34 /// Registers / Deregisters EH-frames in the current process.
36 public:
37  Error registerEHFrames(JITTargetAddress EHFrameSectionAddr,
38  size_t EHFrameSectionSize) override;
39 
40  Error deregisterEHFrames(JITTargetAddress EHFrameSectionAddr,
41  size_t EHFrameSectionSize) override;
42 };
43 
45  std::function<void(JITTargetAddress EHFrameSectionAddr,
46  size_t EHFrameSectionSize)>;
47 
48 /// Creates a pass that records the address and size of the EH frame section.
49 /// If no eh-frame section is found then the address and size will both be given
50 /// as zero.
51 ///
52 /// Authors of JITLinkContexts can use this function to register a post-fixup
53 /// pass that records the range of the eh-frame section. This range can
54 /// be used after finalization to register and deregister the frame.
57  StoreFrameRangeFunction StoreFrameRange);
58 
59 } // end namespace jitlink
60 } // end namespace llvm
61 
62 #endif // LLVM_EXECUTIONENGINE_JITLINK_EHFRAMESUPPORT_H
llvm
Definition: AllocatorList.h:23
JITSymbol.h
Error.h
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
function
print Print MemDeps of function
Definition: MemDepPrinter.cpp:83
Triple.h
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::JITTargetAddress
uint64_t JITTargetAddress
Represents an address in the target process's address space.
Definition: JITSymbol.h:42