diff options
| author | Devang Patel <dpatel@apple.com> | 2007-10-15 19:56:32 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2007-10-15 19:56:32 +0000 |
| commit | 324fe8904f975b5e162f40a66c25796e54a17dae (patch) | |
| tree | 7b098d7eeeeb43d1b3ba66c05b7bbf94b8aad314 | |
| parent | e862243e1cd55c801df54c898f9057c23263b0fb (diff) | |
| download | bcm5719-llvm-324fe8904f975b5e162f40a66c25796e54a17dae.tar.gz bcm5719-llvm-324fe8904f975b5e162f40a66c25796e54a17dae.zip | |
Add removeModuleProvider()
llvm-svn: 43002
| -rw-r--r-- | llvm/include/llvm/ExecutionEngine/ExecutionEngine.h | 6 | ||||
| -rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 15 |
2 files changed, 20 insertions, 1 deletions
diff --git a/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h b/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h index 7100a5ff043..2a2fb7cb8c4 100644 --- a/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h +++ b/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h @@ -97,7 +97,11 @@ public: 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. diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index 96604f10bcc..512c4520e07 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/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. |

