mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Add removeModuleProvider()
llvm-svn: 43002
This commit is contained in:
parent
2dc6099def
commit
b4a9a2e418
@ -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.
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user