Add a new class useful for providing fully materialized modules to ExecutionEngine's
authorChris Lattner <sabre@nondot.org>
Tue, 30 Dec 2003 02:44:04 +0000 (02:44 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 30 Dec 2003 02:44:04 +0000 (02:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10645 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ModuleProvider.h

index de9616fe2ed2c9fba17c66a86a64fc1fd70ddbe1..07b7ae3bab9685af6c09d8c36b0f4209ed9a521d 100644 (file)
@@ -54,6 +54,18 @@ public:
   }
 };
 
+
+/// ExistingModuleProvider - Allow conversion from a fully materialized Module
+/// into a ModuleProvider, allowing code that expects a ModuleProvider to work
+/// if we just have a Module.  Note that the ModuleProvider takes ownership of
+/// the Module specified.
+struct ExistingModuleProvider : public ModuleProvider {
+  ExistingModuleProvider(Module *M) {
+    TheModule = M;
+  }
+  void materializeFunction(Function *F) {}
+};
+
 } // End llvm namespace
 
 #endif