1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

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
This commit is contained in:
Rafael Espindola 2015-06-23 14:42:34 +00:00
parent b7e4340827
commit ad6fe648f2

View File

@ -147,8 +147,6 @@ std::unique_ptr<MemoryBuffer> MCJIT::emitObject(Module *M) {
legacy::PassManager PM; legacy::PassManager PM;
M->setDataLayout(*TM->getDataLayout());
// The RuntimeDyld will take ownership of this shortly // The RuntimeDyld will take ownership of this shortly
SmallVector<char, 4096> ObjBufferSV; SmallVector<char, 4096> ObjBufferSV;
raw_svector_ostream ObjStream(ObjBufferSV); raw_svector_ostream ObjStream(ObjBufferSV);
@ -195,6 +193,8 @@ void MCJIT::generateCodeForModule(Module *M) {
if (ObjCache) if (ObjCache)
ObjectToLoad = ObjCache->getObject(M); ObjectToLoad = ObjCache->getObject(M);
M->setDataLayout(*TM->getDataLayout());
// If the cache did not contain a suitable object, compile the object // If the cache did not contain a suitable object, compile the object
if (!ObjectToLoad) { if (!ObjectToLoad) {
ObjectToLoad = emitObject(M); ObjectToLoad = emitObject(M);