[RuntimeDyld] Add a notifyObjectLoaded method to RuntimeDyld::MemoryManager.
[oota-llvm.git] / include / llvm / ExecutionEngine / RuntimeDyld.h
index fe736bb00cce3a9672caed59f0d0348faeefc6bf..100e97b8b3d9f6ee4c7b49b2f01f987cb02d3be8 100644 (file)
@@ -155,6 +155,20 @@ public:
     /// Returns true if an error occurred, false otherwise.
     virtual bool finalizeMemory(std::string *ErrMsg = nullptr) = 0;
 
+    /// This method is called after an object has been loaded into memory but
+    /// before relocations are applied to the loaded sections.
+    ///
+    /// Memory managers which are preparing code for execution in an external
+    /// address space can use this call to remap the section addresses for the
+    /// newly loaded object.
+    ///
+    /// For clients that do not need access to an ExecutionEngine instance this
+    /// method should be preferred to its cousin
+    /// MCJITMemoryManager::notifyObjectLoaded as this method is compatible with
+    /// ORC JIT stacks.
+    virtual void notifyObjectLoaded(RuntimeDyld &RTDyld,
+                                    const object::ObjectFile &Obj) {}
+
   private:
     virtual void anchor();
     bool FinalizationLocked;