From 85d8509267270717181653dce3661d002b155657 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sat, 21 Feb 2015 00:13:15 +0000 Subject: [PATCH] Set the datalayout in the gold plugin. This fixes the gold tests after r230054. llvm-svn: 230098 --- llvm/tools/gold/gold-plugin.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index 2b85479..e654a15 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -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())); -- 2.7.4