[ExecutionEngine] Use std::function rather than a function pointer for the
[oota-llvm.git] / include / llvm / ExecutionEngine / RuntimeDyld.h
index 1d75346fee3fa5329f6189e0d0932c50c974d250..a808d923116713e0554a70f4fe66bf06199de825 100644 (file)
@@ -15,6 +15,7 @@
 #define LLVM_EXECUTIONENGINE_RUNTIMEDYLD_H
 
 #include "JITSymbolFlags.h"
+#include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Memory.h"
 #include "llvm/DebugInfo/DIContext.h"
@@ -78,8 +79,8 @@ public:
     LoadedObjectInfoHelper(RuntimeDyldImpl &RTDyld, unsigned BeginIdx,
                            unsigned EndIdx)
         : LoadedObjectInfo(RTDyld, BeginIdx, EndIdx) {}
-    llvm::LoadedObjectInfo *clone() const override {
-      return new Derived(static_cast<const Derived &>(*this));
+    std::unique_ptr<llvm::LoadedObjectInfo> clone() const override {
+      return llvm::make_unique<Derived>(static_cast<const Derived &>(*this));
     }
   };
 
@@ -152,6 +153,10 @@ public:
 
     /// This method returns the address of the specified function or variable.
     /// It is used to resolve symbols during module linking.
+    ///
+    /// If the returned symbol's address is equal to ~0ULL then RuntimeDyld will
+    /// skip all relocations for that symbol, and the client will be responsible
+    /// for handling them manually.
     virtual SymbolInfo findSymbol(const std::string &Name) = 0;
 
     /// This method returns the address of the specified symbol if it exists