LLVM 24.0.0git
LazyObjectLinkingLayer.h
Go to the documentation of this file.
1//===- LazyObjectLinkingLayer.h - Link objects on first fn call -*- 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// Link object files lazily on first call.
10//
11//===----------------------------------------------------------------------===//
12#ifndef LLVM_EXECUTIONENGINE_ORC_LAZYOBJECTLINKINGLAYER_H
13#define LLVM_EXECUTIONENGINE_ORC_LAZYOBJECTLINKINGLAYER_H
14
18
19namespace llvm::orc {
20
23
24/// LazyObjectLinkingLayer is an adapter for ObjectLinkingLayer that builds
25/// lazy reexports for all function symbols in objects that are/ added to defer
26/// linking until the first call to a function defined in the object.
27///
28/// Linking is performed by emitting the object file via the base
29/// ObjectLinkingLayer.
30///
31/// No partitioning is performed: The first call to any function in the object
32/// will trigger linking of the whole object.
33///
34/// References to data symbols are not lazy and will trigger immediate linking
35/// (same os ObjectlinkingLayer).
37public:
40
41 /// Add an object file to the JITDylib targeted by the given tracker.
43 std::unique_ptr<MemoryBuffer> O,
45
46 void emit(std::unique_ptr<MaterializationResponsibility> R,
47 std::unique_ptr<MemoryBuffer> O) override;
48
49private:
50 class RenamerPlugin;
51
52 ObjectLinkingLayer &BaseLayer;
54};
55
56} // namespace llvm::orc
57
58#endif // LLVM_EXECUTIONENGINE_ORC_LAZYOBJECTLINKINGLAYER_H
#define LLVM_ABI
Definition Compiler.h:211
#define I(x, y, z)
Definition MD5.cpp:57
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
void emit(std::unique_ptr< MaterializationResponsibility > R, std::unique_ptr< MemoryBuffer > O) override
Emit should materialize the given IR.
LazyObjectLinkingLayer(ObjectLinkingLayer &BaseLayer, LazyReexportsManager &LRMgr)
llvm::Error add(llvm::orc::ResourceTrackerSP RT, std::unique_ptr< MemoryBuffer > O, MaterializationUnit::Interface I) override
Add an object file to the JITDylib targeted by the given tracker.
ObjectLayer(ExecutionSession &ES)
Definition Layer.cpp:168
An ObjectLayer implementation built on JITLink.
IntrusiveRefCntPtr< ResourceTracker > ResourceTrackerSP
Definition Core.h:59