LLVM 20.0.0git
JITLinkReentryTrampolines.h
Go to the documentation of this file.
1//===- JITLinkReentryTrampolines.h -- JITLink-based trampolines -*- 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// Emit reentry trampolines via JITLink.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_EXECUTIONENGINE_ORC_JITLINKREENTRYTRAMPOLINES_H
14#define LLVM_EXECUTIONENGINE_ORC_JITLINKREENTRYTRAMPOLINES_H
15
20#include "llvm/Support/Error.h"
21
22namespace llvm::jitlink {
23class Block;
24class LinkGraph;
25class Section;
26class Symbol;
27} // namespace llvm::jitlink
28
29namespace llvm::orc {
30
31class ObjectLinkingLayer;
32class RedirectableSymbolManager;
33
34/// Produces trampolines on request using JITLink.
36public:
39 jitlink::Symbol &ReentrySym)>;
41 Expected<std::vector<ExecutorSymbolDef>> EntryAddrs)>;
42
43 /// Create trampolines using the default reentry trampoline function for
44 /// the session triple.
46 Create(ObjectLinkingLayer &ObjLinkingLayer);
47
49 EmitTrampolineFn EmitTrampoline);
52
53 void emit(ResourceTrackerSP RT, size_t NumTrampolines,
54 OnTrampolinesReadyFn OnTrampolinesReady);
55
56private:
58
59 ObjectLinkingLayer &ObjLinkingLayer;
60 TrampolineAddrScraperPlugin *TrampolineAddrScraper = nullptr;
61 EmitTrampolineFn EmitTrampoline;
62 std::atomic<size_t> ReentryGraphIdx{0};
63};
64
66createJITLinkLazyReexportsManager(ObjectLinkingLayer &ObjLinkingLayer,
67 RedirectableSymbolManager &RSMgr,
68 JITDylib &PlatformJD);
69
70} // namespace llvm::orc
71
72#endif // LLVM_EXECUTIONENGINE_ORC_JITLINKREENTRYTRAMPOLINES_H
This file provides a collection of function (or more generally, callable) type erasure utilities supp...
#define G(x, y, z)
Definition: MD5.cpp:56
Tagged union holding either a T or a Error.
Definition: Error.h:481
Produces trampolines on request using JITLink.
void emit(ResourceTrackerSP RT, size_t NumTrampolines, OnTrampolinesReadyFn OnTrampolinesReady)
static Expected< std::unique_ptr< JITLinkReentryTrampolines > > Create(ObjectLinkingLayer &ObjLinkingLayer)
Create trampolines using the default reentry trampoline function for the session triple.
JITLinkReentryTrampolines(JITLinkReentryTrampolines &&)=delete
JITLinkReentryTrampolines & operator=(JITLinkReentryTrampolines &&)=delete
An ObjectLayer implementation built on JITLink.
Expected< std::unique_ptr< LazyReexportsManager > > createJITLinkLazyReexportsManager(ObjectLinkingLayer &ObjLinkingLayer, RedirectableSymbolManager &RSMgr, JITDylib &PlatformJD)
NodeAddr< BlockNode * > Block
Definition: RDFGraph.h:392