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

Devang Patel dpatel at apple.com
Mon Oct 15 12:56:32 PDT 2007


Author: dpatel
Date: Mon Oct 15 14:56:32 2007
New Revision: 43002

URL: http://llvm.org/viewvc/llvm-project?rev=43002&view=rev
Log:
Add removeModuleProvider()

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=43002&r1=43001&r2=43002&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h Mon Oct 15 14:56:32 2007
@@ -97,7 +97,11 @@
   void addModuleProvider(ModuleProvider *P) {
     Modules.push_back(P);
   }
-  
+
+  /// removeModuleProvider - Remove a ModuleProvider from the list of modules.
+  /// Release module from ModuleProvider.
+  Module* removeModuleProvider(ModuleProvider *P, std::string *ErrInfo = 0);
+
   /// FindFunctionNamed - Search all of the active modules to find the one that
   /// defines FnName.  This is very slow operation and shouldn't be used for
   /// general code.

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

==============================================================================
--- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Mon Oct 15 14:56:32 2007
@@ -51,6 +51,21 @@
     delete Modules[i];
 }
 
+/// removeModuleProvider - Remove a ModuleProvider from the list of modules.
+/// Release module from ModuleProvider.
+Module* ExecutionEngine::removeModuleProvider(ModuleProvider *P, 
+                                              std::string *ErrInfo) {
+  for(SmallVector<ModuleProvider *, 1>::iterator I = Modules.begin(), 
+        E = Modules.end(); I != E; ++I) {
+    ModuleProvider *MP = *I;
+    if (MP == P) {
+      Modules.erase(I);
+      return MP->releaseModule(ErrInfo);
+    }
+  }
+  return NULL;
+}
+
 /// FindFunctionNamed - Search all of the active modules to find the one that
 /// defines FnName.  This is very slow operation and shouldn't be used for
 /// general code.





More information about the llvm-commits mailing list