MCJIT knows where to find things, do not rely on the module (which one?)
This commit is contained in:
parent
9c383fcef3
commit
46673943f8
@ -423,17 +423,14 @@ void* IncrementalExecutor::getAddressOfGlobal(llvm::Module* m,
|
||||
// Return a symbol's address, and whether it was jitted.
|
||||
void* address
|
||||
= llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(symbolName);
|
||||
if (address) {
|
||||
if (fromJIT) *fromJIT = false;
|
||||
} else {
|
||||
if (fromJIT) *fromJIT = true;
|
||||
llvm::GlobalVariable* gvar = m->getGlobalVariable(symbolName, true);
|
||||
if (!gvar)
|
||||
return 0;
|
||||
|
||||
remapSymbols();
|
||||
address = m_engine->getPointerToGlobal(gvar);
|
||||
}
|
||||
// It's not from the JIT if it's in a dylib.
|
||||
if (fromJIT)
|
||||
*fromJIT = !address;
|
||||
|
||||
if (!address)
|
||||
return (void*)m_engine->getGlobalValueAddress(symbolName);
|
||||
|
||||
return address;
|
||||
}
|
||||
|
||||
|
@ -254,11 +254,7 @@ namespace cling {
|
||||
// utils::TypeName::GetFullyQualifiedName which is expensive
|
||||
// (memory-wise). See ROOT-6909.
|
||||
std::string code;
|
||||
const llvm::GlobalValue* GV = 0;
|
||||
if (const Transaction* T = m_Interpreter->getLastTransaction())
|
||||
if (const llvm::Module* M = T->getModule())
|
||||
GV = M->getNamedValue(funcname);
|
||||
if (!GV) {
|
||||
if (!m_Interpreter->getAddressOfGlobal(funcname)) {
|
||||
code = "extern \"C\" void ";
|
||||
clang::QualType RDQT(RD->getTypeForDecl(), 0);
|
||||
std::string typeName
|
||||
|
Loading…
x
Reference in New Issue
Block a user