[llvm] r230098 - Set the datalayout in the gold plugin.

Rafael Espindola rafael.espindola at gmail.com
Fri Feb 20 16:13:15 PST 2015


Author: rafael
Date: Fri Feb 20 18:13:15 2015
New Revision: 230098

URL: http://llvm.org/viewvc/llvm-project?rev=230098&view=rev
Log:
Set the datalayout in the gold plugin.

This fixes the gold tests after r230054.

Modified:
    llvm/trunk/tools/gold/gold-plugin.cpp

Modified: llvm/trunk/tools/gold/gold-plugin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=230098&r1=230097&r2=230098&view=diff
==============================================================================
--- llvm/trunk/tools/gold/gold-plugin.cpp (original)
+++ llvm/trunk/tools/gold/gold-plugin.cpp Fri Feb 20 18:13:15 2015
@@ -693,6 +693,9 @@ getModuleForFile(LLVMContext &Context, c
 }
 
 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()));





More information about the llvm-commits mailing list