Update for r243115 which changed the DataLayout API on TargetMachine but
[oota-llvm.git] / tools / gold / gold-plugin.cpp
index 68c9d1a6f6e4d7335332abd6931c0bc38d844098..18cd621317e2f821e6b27b73bb84c790e84cef2d 100644 (file)
@@ -716,8 +716,7 @@ getModuleForFile(LLVMContext &Context, claimed_file &F,
 }
 
 static void runLTOPasses(Module &M, TargetMachine &TM) {
-  if (const DataLayout *DL = TM.getDataLayout())
-    M.setDataLayout(*DL);
+  M.setDataLayout(TM.createDataLayout());
 
   legacy::PassManager passes;
   passes.add(createTargetTransformInfoWrapperPass(TM.getTargetIRAnalysis()));