1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

[Orc] Remove the OwnedModules list from OrcMCJITReplacement and use

ExecutionEngine's Modules list instead.

This makes the owned modules visibile to ExecutionEngine. In particular,
it is required for ExecutionEngine::runStaticConstructorsAndDestructors to
work.

Regression tests for Orc (which test this issue) will be committed shortly.

llvm-svn: 227779
This commit is contained in:
Lang Hames 2015-02-02 04:34:02 +00:00
parent dcc8377028
commit 3fda2932c0

View File

@ -134,9 +134,9 @@ public:
if (!M->getDataLayout())
M->setDataLayout(getDataLayout());
OwnedModules.push_back(std::move(M));
Modules.push_back(std::move(M));
std::vector<Module *> Ms;
Ms.push_back(&*OwnedModules.back());
Ms.push_back(&*Modules.back());
LazyEmitLayer.addModuleSet(std::move(Ms),
llvm::make_unique<ForwardingRTDyldMM>(*this));
}
@ -302,10 +302,6 @@ private:
CompileLayerT CompileLayer;
LazyEmitLayerT LazyEmitLayer;
// MCJIT keeps modules alive - we need to do the same for backwards
// compatibility.
std::vector<std::unique_ptr<Module>> OwnedModules;
// We need to store ObjLayerT::ObjSetHandles for each of the object sets
// that have been emitted but not yet finalized so that we can forward the
// mapSectionAddress calls appropriately.