[llvm] r240411 - Be sure to set the DataLayout before checking the cache.

Rafael Espindola rafael.espindola at gmail.com
Tue Jun 23 07:42:34 PDT 2015


Author: rafael
Date: Tue Jun 23 09:42:34 2015
New Revision: 240411

URL: http://llvm.org/viewvc/llvm-project?rev=240411&view=rev
Log:
Be sure to set the DataLayout before checking the cache.

This makes sure the same mangling is used.

Should fix the OS X bots.

Modified:
    llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp

Modified: llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp?rev=240411&r1=240410&r2=240411&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp Tue Jun 23 09:42:34 2015
@@ -147,8 +147,6 @@ std::unique_ptr<MemoryBuffer> MCJIT::emi
 
   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
   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);





More information about the llvm-commits mailing list