gold-plugin.cpp: Fixup r227599 corresponding to r227685 and r227731 -- Don't lose DataLayoutPass.

llvm-svn: 227783
This commit is contained in:
NAKAMURA Takumi 2015-02-02 05:47:30 +00:00
parent 82d9e7ec1c
commit b0a52838fa
1 changed files with 5 additions and 1 deletions

View 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();