Set the datalayout in the gold plugin.
authorRafael Espindola <rafael.espindola@gmail.com>
Sat, 21 Feb 2015 00:13:15 +0000 (00:13 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sat, 21 Feb 2015 00:13:15 +0000 (00:13 +0000)
This fixes the gold tests after r230054.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230098 91177308-0d34-0410-b5e6-96231b3b80d8

tools/gold/gold-plugin.cpp

index 2b85479d1dad6302f27394a5242ea8ae5dc70af9..e654a1581f7d50ee13df549f52dd38aaccd7a522 100644 (file)
@@ -693,6 +693,9 @@ getModuleForFile(LLVMContext &Context, claimed_file &F,
 }
 
 static void runLTOPasses(Module &M, TargetMachine &TM) {
+  if (const DataLayout *DL = TM.getDataLayout())
+    M.setDataLayout(DL);
+
   legacy::PassManager passes;
   passes.add(new DataLayoutPass());
   passes.add(createTargetTransformInfoWrapperPass(TM.getTargetIRAnalysis()));