Also unload modules that are queued for JITting.

This commit is contained in:
Axel Naumann 2015-06-08 14:44:39 +02:00 committed by sftnight
parent e21b7319f3
commit 44ee56b7a1
2 changed files with 8 additions and 3 deletions

View File

@ -153,7 +153,12 @@ namespace cling {
}
///\brief Unload a set of JIT symbols.
void unloadFromJIT(Transaction::ExeUnloadHandle H) {
void unloadFromJIT(llvm::Module* M,
Transaction::ExeUnloadHandle H) {
auto iMod = std::find(m_ModulesToJIT.begin(), m_ModulesToJIT.end(), M);
if (iMod != m_ModulesToJIT.end())
m_ModulesToJIT.erase(iMod);
else
m_JIT->removeModules((size_t)H.m_Opaque);
}

View File

@ -60,7 +60,7 @@ namespace cling {
delete (*m_NestedTransactions)[i];
}
if (getExecutor())
getExecutor()->unloadFromJIT(getExeUnloadHandle());
getExecutor()->unloadFromJIT(m_Module.get(), getExeUnloadHandle());
}
NamedDecl* Transaction::containsNamedDecl(llvm::StringRef name) const {