[llvm] r227783 - gold-plugin.cpp: Fixup r227599 corresponding to r227685 and r227731 -- Don't lose DataLayoutPass.
NAKAMURA Takumi
geek4civic at gmail.com
Sun Feb 1 21:47:30 PST 2015
Author: chapuni
Date: Sun Feb 1 23:47:30 2015
New Revision: 227783
URL: http://llvm.org/viewvc/llvm-project?rev=227783&view=rev
Log:
gold-plugin.cpp: Fixup r227599 corresponding to r227685 and r227731 -- Don't lose DataLayoutPass.
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=227783&r1=227782&r2=227783&view=diff
==============================================================================
--- llvm/trunk/tools/gold/gold-plugin.cpp (original)
+++ llvm/trunk/tools/gold/gold-plugin.cpp Sun Feb 1 23:47:30 2015
@@ -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, c
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();
More information about the llvm-commits
mailing list