Re-apply r196639: Add support for archives and object file caching under MCJIT.
[oota-llvm.git] / include / llvm / ExecutionEngine / ExecutionEngine.h
index ee43cbcf0ef917b1660b89e36cdaa937d9d3f055..199cf8deb8bbcaff47a8ed6740b122721d0a30e5 100644 (file)
@@ -48,6 +48,11 @@ class RTDyldMemoryManager;
 class Triple;
 class Type;
 
+namespace object {
+  class Archive;
+  class ObjectFile;
+}
+
 /// \brief Helper class for helping synchronize access to the global address map
 /// table.
 class ExecutionEngineState {
@@ -204,6 +209,33 @@ public:
     Modules.push_back(M);
   }
 
+  /// addObjectFile - Add an ObjectFile to the execution engine.
+  ///
+  /// This method is only supported by MCJIT.  MCJIT will immediately load the
+  /// object into memory and adds its symbols to the list used to resolve
+  /// external symbols while preparing other objects for execution.
+  ///
+  /// Objects added using this function will not be made executable until
+  /// needed by another object.
+  ///
+  /// MCJIT will take ownership of the ObjectFile.
+  virtual void addObjectFile(object::ObjectFile *O) {
+    llvm_unreachable(
+      "ExecutionEngine subclass doesn't implement addObjectFile.");
+  }
+
+  /// addArchive - Add an Archive to the execution engine.
+  ///
+  /// This method is only supported by MCJIT.  MCJIT will use the archive to
+  /// resolve external symbols in objects it is loading.  If a symbol is found
+  /// in the Archive the contained object file will be extracted (in memory)
+  /// and loaded for possible execution.
+  ///
+  /// MCJIT will take ownership of the Archive.
+  virtual void addArchive(object::Archive *A) {
+    llvm_unreachable("ExecutionEngine subclass doesn't implement addArchive.");
+  }
+
   //===--------------------------------------------------------------------===//
 
   const DataLayout *getDataLayout() const { return TD; }