gold-plugin.cpp: Fixup r227599 corresponding to r227685 and r227731 -- Don't lose...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 2 Feb 2015 05:47:30 +0000 (05:47 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 2 Feb 2015 05:47:30 +0000 (05:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227783 91177308-0d34-0410-b5e6-96231b3b80d8

tools/gold/gold-plugin.cpp

index b57bed7..5d5db5a 100644 (file)
@@ -16,6 +16,7 @@
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/StringSet.h"
 #include "llvm/Analysis/TargetLibraryInfo.h"
+#include "llvm/Analysis/TargetTransformInfo.h"
 #include "llvm/Bitcode/ReaderWriter.h"
 #include "llvm/CodeGen/Analysis.h"
 #include "llvm/CodeGen/CommandFlags.h"
@@ -696,8 +697,11 @@ getModuleForFile(LLVMContext &Context, claimed_file &F, raw_fd_ostream *ApiFile,
   return Obj.takeModule();
 }
 
-static void runLTOPasses(Module &M, const TargetMachine &TM) {
+static void runLTOPasses(Module &M, TargetMachine &TM) {
   PassManager passes;
+  passes.add(new DataLayoutPass());
+  passes.add(createTargetTransformInfoWrapperPass(TM.getTargetIRAnalysis()));
+
   PassManagerBuilder PMB;
   PMB.LibraryInfo = new TargetLibraryInfoImpl(Triple(TM.getTargetTriple()));
   PMB.Inliner = createFunctionInliningPass();