Make DataLayout Non-Optional in the Module
[oota-llvm.git] / lib / ExecutionEngine / MCJIT / MCJIT.cpp
index e500d3daa1d808702ec78168f9cfe1fc6b26a173..527941b59a8d0581b5a9c5442cdcd12cc02b4418 100644 (file)
@@ -137,8 +137,7 @@ std::unique_ptr<MemoryBuffer> MCJIT::emitObject(Module *M) {
 
   legacy::PassManager PM;
 
-  M->setDataLayout(TM->getDataLayout());
-  PM.add(new DataLayoutPass());
+  M->setDataLayout(*TM->getDataLayout());
 
   // The RuntimeDyld will take ownership of this shortly
   SmallVector<char, 4096> ObjBufferSV;