llvm.org GIT mirror llvm / 73d0e21
Add removeModuleProvider() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43002 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 12 years ago
2 changed file(s) with 20 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
9696 void addModuleProvider(ModuleProvider *P) {
9797 Modules.push_back(P);
9898 }
99
99
100 /// removeModuleProvider - Remove a ModuleProvider from the list of modules.
101 /// Release module from ModuleProvider.
102 Module* removeModuleProvider(ModuleProvider *P, std::string *ErrInfo = 0);
103
100104 /// FindFunctionNamed - Search all of the active modules to find the one that
101105 /// defines FnName. This is very slow operation and shouldn't be used for
102106 /// general code.
4848 clearAllGlobalMappings();
4949 for (unsigned i = 0, e = Modules.size(); i != e; ++i)
5050 delete Modules[i];
51 }
52
53 /// removeModuleProvider - Remove a ModuleProvider from the list of modules.
54 /// Release module from ModuleProvider.
55 Module* ExecutionEngine::removeModuleProvider(ModuleProvider *P,
56 std::string *ErrInfo) {
57 for(SmallVector::iterator I = Modules.begin(),
58 E = Modules.end(); I != E; ++I) {
59 ModuleProvider *MP = *I;
60 if (MP == P) {
61 Modules.erase(I);
62 return MP->releaseModule(ErrInfo);
63 }
64 }
65 return NULL;
5166 }
5267
5368 /// FindFunctionNamed - Search all of the active modules to find the one that