From: Rafael Espindola Date: Tue, 23 Jun 2015 14:42:34 +0000 (+0000) Subject: Be sure to set the DataLayout before checking the cache. X-Git-Tag: llvmorg-3.7.0-rc1~1739 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6763f5a43e95bcedb344e3007bcf394a7a0afaff;p=platform%2Fupstream%2Fllvm.git 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 --- 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 MCJIT::emitObject(Module *M) { legacy::PassManager PM; - M->setDataLayout(*TM->getDataLayout()); - // The RuntimeDyld will take ownership of this shortly SmallVector 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);