[MCJIT] Call materializeAll on modules before compiling them in MCJIT.
This only affects modules with lazy GVMaterializers attached (usually modules read off disk using the lazy bitcode reader). For such modules, materializing before compiling prevents crashes due to missing function bodies / initializers. llvm-svn: 334535
This commit is contained in:
parent
864289990a
commit
e7989ef47f
@ -142,8 +142,14 @@ void MCJIT::setObjectCache(ObjectCache* NewCache) {
|
||||
}
|
||||
|
||||
std::unique_ptr<MemoryBuffer> MCJIT::emitObject(Module *M) {
|
||||
assert(M && "Can not emit a null module");
|
||||
|
||||
MutexGuard locked(lock);
|
||||
|
||||
// Materialize all globals in the module if they have not been
|
||||
// materialized already.
|
||||
cantFail(M->materializeAll());
|
||||
|
||||
// This must be a module which has already been added but not loaded to this
|
||||
// MCJIT instance, since these conditions are tested by our caller,
|
||||
// generateCodeForModule.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user