aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-10-15 19:56:32 +0000
committerDevang Patel <dpatel@apple.com>2007-10-15 19:56:32 +0000
commit73d0e211a39650fc7562e0f15ed21440dde2243a (patch)
tree1b3ca5c35a9eb78a6e290df4a0f30a1a052110ca /lib
parentf656b985ecf7d87672ce4b792205a209d9d35d76 (diff)
downloadexternal_llvm-73d0e211a39650fc7562e0f15ed21440dde2243a.zip
external_llvm-73d0e211a39650fc7562e0f15ed21440dde2243a.tar.gz
external_llvm-73d0e211a39650fc7562e0f15ed21440dde2243a.tar.bz2
Add removeModuleProvider()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43002 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index 96604f1..512c452 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -51,6 +51,21 @@ ExecutionEngine::~ExecutionEngine() {
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.