[llvm-commits] [llvm] r43206 - in /llvm/trunk: include/llvm/ExecutionEngine/ExecutionEngine.h lib/ExecutionEngine/ExecutionEngine.cpp

Chris Lattner sabre at nondot.org
Sun Oct 21 15:57:12 PDT 2007


Author: lattner
Date: Sun Oct 21 17:57:11 2007
New Revision: 43206

URL: http://llvm.org/viewvc/llvm-project?rev=43206&view=rev
Log:
Add a convenience method for creating EE's.

Modified:
    llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h
    llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp

Modified: llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h?rev=43206&r1=43205&r2=43206&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h Sun Oct 21 17:57:11 2007
@@ -108,11 +108,17 @@
   Function *FindFunctionNamed(const char *FnName);
   
   /// create - This is the factory method for creating an execution engine which
-  /// is appropriate for the current machine.
+  /// is appropriate for the current machine.  This takes ownership of the
+  /// module provider.
   static ExecutionEngine *create(ModuleProvider *MP,
                                  bool ForceInterpreter = false,
                                  std::string *ErrorStr = 0);
 
+  /// create - This is the factory method for creating an execution engine which
+  /// is appropriate for the current machine.  This takes ownership of the
+  /// module.
+  static ExecutionEngine *create(Module *M);
+  
   /// runFunction - Execute the specified function with the specified arguments,
   /// and return the result.
   ///

Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=43206&r1=43205&r2=43206&view=diff

==============================================================================
--- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Sun Oct 21 17:57:11 2007
@@ -328,6 +328,10 @@
   return EE;
 }
 
+ExecutionEngine *ExecutionEngine::create(Module *M) {
+  return create(new ExistingModuleProvider(M));
+}
+
 /// getPointerToGlobal - This returns the address of the specified global
 /// value.  This may involve code generation if it's a function.
 ///





More information about the llvm-commits mailing list