aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-06-23 14:42:34 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-06-23 14:42:34 +0000
commit6763f5a43e95bcedb344e3007bcf394a7a0afaff (patch)
tree5f826c6f6dc3c297b3084d2ab6cd6989d1f76e31 /llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
parentd88d79c79ded947d3f27a94ef096aa4a24c9a4f2 (diff)
downloadllvm-6763f5a43e95bcedb344e3007bcf394a7a0afaff.zip
llvm-6763f5a43e95bcedb344e3007bcf394a7a0afaff.tar.gz
llvm-6763f5a43e95bcedb344e3007bcf394a7a0afaff.tar.bz2
Be sure to set the DataLayout before checking the cache.
This makes sure the same mangling is used. Should fix the OS X bots. llvm-svn: 240411
Diffstat (limited to 'llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index 225188b..a7d6705 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
@@ -147,8 +147,6 @@ std::unique_ptr<MemoryBuffer> MCJIT::emitObject(Module *M) {
legacy::PassManager PM;
- M->setDataLayout(*TM->getDataLayout());
-
// The RuntimeDyld will take ownership of this shortly
SmallVector<char, 4096> ObjBufferSV;
raw_svector_ostream ObjStream(ObjBufferSV);
@@ -195,6 +193,8 @@ void MCJIT::generateCodeForModule(Module *M) {
if (ObjCache)
ObjectToLoad = ObjCache->getObject(M);
+ M->setDataLayout(*TM->getDataLayout());
+
// If the cache did not contain a suitable object, compile the object
if (!ObjectToLoad) {
ObjectToLoad = emitObject(M);