1
- // ===- RedirectionManager .h - Redirection manager interface ---- -*- C++ -*-===//
1
+ // ===- LazyObjectLinkingLayer .h - Link objects on first fn call -*- C++ -*-===//
2
2
//
3
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
4
// See https://llvm.org/LICENSE.txt for license information.
5
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
6
//
7
7
// ===----------------------------------------------------------------------===//
8
8
//
9
- // Redirection manager interface that redirects a call to symbol to another .
9
+ // Link object files lazily on first call.
10
10
//
11
11
// ===----------------------------------------------------------------------===//
12
12
#ifndef LLVM_EXECUTIONENGINE_ORC_LAZYOBJECTLINKINGLAYER_H
@@ -21,14 +21,27 @@ class ObjectLinkingLayer;
21
21
class LazyReexportsManager ;
22
22
class RedirectableSymbolManager ;
23
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).
24
36
class LazyObjectLinkingLayer : public ObjectLayer {
25
37
public:
26
38
LazyObjectLinkingLayer (ObjectLinkingLayer &BaseLayer,
27
39
LazyReexportsManager &LRMgr);
28
40
41
+ // / Add an object file to the JITDylib targeted by the given tracker.
29
42
llvm::Error add (llvm::orc::ResourceTrackerSP RT,
30
- std::unique_ptr<llvm:: MemoryBuffer> O,
31
- llvm::orc:: MaterializationUnit::Interface I) override ;
43
+ std::unique_ptr<MemoryBuffer> O,
44
+ MaterializationUnit::Interface I) override ;
32
45
33
46
void emit (std::unique_ptr<MaterializationResponsibility> R,
34
47
std::unique_ptr<MemoryBuffer> O) override ;
0 commit comments