1- // ===- RedirectionManager .h - Redirection manager interface ---- -*- C++ -*-===//
1+ // ===- LazyObjectLinkingLayer .h - Link objects on first fn call -*- C++ -*-===//
22//
33// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44// See https://llvm.org/LICENSE.txt for license information.
55// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66//
77// ===----------------------------------------------------------------------===//
88//
9- // Redirection manager interface that redirects a call to symbol to another .
9+ // Link object files lazily on first call.
1010//
1111// ===----------------------------------------------------------------------===//
1212#ifndef LLVM_EXECUTIONENGINE_ORC_LAZYOBJECTLINKINGLAYER_H
@@ -21,14 +21,27 @@ class ObjectLinkingLayer;
2121class LazyReexportsManager ;
2222class RedirectableSymbolManager ;
2323
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).
2436class LazyObjectLinkingLayer : public ObjectLayer {
2537public:
2638 LazyObjectLinkingLayer (ObjectLinkingLayer &BaseLayer,
2739 LazyReexportsManager &LRMgr);
2840
41+ // / Add an object file to the JITDylib targeted by the given tracker.
2942 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 ;
3245
3346 void emit (std::unique_ptr<MaterializationResponsibility> R,
3447 std::unique_ptr<MemoryBuffer> O) override ;
0 commit comments