aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
diff options
context:
space:
mode:
authorMichael Kuperstein <michael.m.kuperstein@intel.com>2015-07-16 12:20:31 +0000
committerMichael Kuperstein <michael.m.kuperstein@intel.com>2015-07-16 12:20:31 +0000
commit8c3b4f2e78fb9e7c16a464062192f2796ab3650c (patch)
tree10c276b29a9963c43153870a716c198d637377c1 /llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
parent7d54fab8f0f40edf0846ca8058a27f814c6b27ff (diff)
downloadllvm-8c3b4f2e78fb9e7c16a464062192f2796ab3650c.zip
llvm-8c3b4f2e78fb9e7c16a464062192f2796ab3650c.tar.gz
llvm-8c3b4f2e78fb9e7c16a464062192f2796ab3650c.tar.bz2
Revert "Make ExecutionEngine owning a DataLayout"
Reverting to fix buildbot breakage. This reverts commit r242387. llvm-svn: 242394
Diffstat (limited to 'llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index 5f46415..a7d6705 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
@@ -65,13 +65,12 @@ MCJIT::createJIT(std::unique_ptr<Module> M,
std::move(Resolver));
}
-MCJIT::MCJIT(std::unique_ptr<Module> M, std::unique_ptr<TargetMachine> TM,
+MCJIT::MCJIT(std::unique_ptr<Module> M, std::unique_ptr<TargetMachine> tm,
std::shared_ptr<MCJITMemoryManager> MemMgr,
std::shared_ptr<RuntimeDyld::SymbolResolver> Resolver)
- : ExecutionEngine(*TM->getDataLayout(), std::move(M)), TM(std::move(TM)),
- Ctx(nullptr), MemMgr(std::move(MemMgr)),
- Resolver(*this, std::move(Resolver)), Dyld(*this->MemMgr, this->Resolver),
- ObjCache(nullptr) {
+ : ExecutionEngine(std::move(M)), TM(std::move(tm)), Ctx(nullptr),
+ MemMgr(std::move(MemMgr)), Resolver(*this, std::move(Resolver)),
+ Dyld(*this->MemMgr, this->Resolver), ObjCache(nullptr) {
// FIXME: We are managing our modules, so we do not want the base class
// ExecutionEngine to manage them as well. To avoid double destruction
// of the first (and only) module added in ExecutionEngine constructor
@@ -86,6 +85,7 @@ MCJIT::MCJIT(std::unique_ptr<Module> M, std::unique_ptr<TargetMachine> TM,
Modules.clear();
OwnedModules.addModule(std::move(First));
+ setDataLayout(TM->getDataLayout());
RegisterJITEventListener(JITEventListener::createGDBRegistrationListener());
}
@@ -193,11 +193,7 @@ void MCJIT::generateCodeForModule(Module *M) {
if (ObjCache)
ObjectToLoad = ObjCache->getObject(M);
- if (M->getDataLayout().isDefault()) {
- M->setDataLayout(getDataLayout());
- } else {
- assert(M->getDataLayout() == getDataLayout() && "DataLayout Mismatch");
- }
+ M->setDataLayout(*TM->getDataLayout());
// If the cache did not contain a suitable object, compile the object
if (!ObjectToLoad) {
@@ -269,7 +265,7 @@ void MCJIT::finalizeModule(Module *M) {
RuntimeDyld::SymbolInfo MCJIT::findExistingSymbol(const std::string &Name) {
SmallString<128> FullName;
- Mangler::getNameWithPrefix(FullName, Name, getDataLayout());
+ Mangler::getNameWithPrefix(FullName, Name, *TM->getDataLayout());
return Dyld.getSymbol(FullName);
}