[llvm] 4914b18 - [ORC] Fix / add comments for LazyObjectLinkingLayer. NFC.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 15 19:28:37 PST 2024


Author: Lang Hames
Date: 2024-12-16T14:28:29+11:00
New Revision: 4914b188998deb50402405567d5a98186bf0a155

URL: https://github.com/llvm/llvm-project/commit/4914b188998deb50402405567d5a98186bf0a155
DIFF: https://github.com/llvm/llvm-project/commit/4914b188998deb50402405567d5a98186bf0a155.diff

LOG: [ORC] Fix / add comments for LazyObjectLinkingLayer. NFC.

Also remove some redundant namespace qualification.

Added: 
    

Modified: 
    llvm/include/llvm/ExecutionEngine/Orc/LazyObjectLinkingLayer.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ExecutionEngine/Orc/LazyObjectLinkingLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/LazyObjectLinkingLayer.h
index 96223d71e4f6ae..8a0350b59d395f 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/LazyObjectLinkingLayer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/LazyObjectLinkingLayer.h
@@ -1,4 +1,4 @@
-//===- RedirectionManager.h - Redirection manager interface -----*- C++ -*-===//
+//===- LazyObjectLinkingLayer.h - Link objects on first fn call -*- C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// Redirection manager interface that redirects a call to symbol to another.
+// Link object files lazily on first call.
 //
 //===----------------------------------------------------------------------===//
 #ifndef LLVM_EXECUTIONENGINE_ORC_LAZYOBJECTLINKINGLAYER_H
@@ -21,14 +21,27 @@ class ObjectLinkingLayer;
 class LazyReexportsManager;
 class RedirectableSymbolManager;
 
+/// LazyObjectLinkingLayer is an adapter for ObjectLinkingLayer that builds
+/// lazy reexports for all function symbols in objects that are/ added to defer
+/// linking until the first call to a function defined in the object.
+///
+/// Linking is performed by emitting the object file via the base
+/// ObjectLinkingLayer.
+///
+/// No partitioning is performed: The first call to any function in the object
+/// will trigger linking of the whole object.
+///
+/// References to data symbols are not lazy and will trigger immediate linking
+/// (same os ObjectlinkingLayer).
 class LazyObjectLinkingLayer : public ObjectLayer {
 public:
   LazyObjectLinkingLayer(ObjectLinkingLayer &BaseLayer,
                          LazyReexportsManager &LRMgr);
 
+  /// Add an object file to the JITDylib targeted by the given tracker.
   llvm::Error add(llvm::orc::ResourceTrackerSP RT,
-                  std::unique_ptr<llvm::MemoryBuffer> O,
-                  llvm::orc::MaterializationUnit::Interface I) override;
+                  std::unique_ptr<MemoryBuffer> O,
+                  MaterializationUnit::Interface I) override;
 
   void emit(std::unique_ptr<MaterializationResponsibility> R,
             std::unique_ptr<MemoryBuffer> O) override;


        


More information about the llvm-commits mailing list