From ce9c317b806aabd7d460a52e1c46f04f7e2c9bb6 Mon Sep 17 00:00:00 2001 From: TDYa127 Date: Tue, 15 May 2012 06:09:27 -0700 Subject: Fix X86 compilation. This commit is to work-around an LLVM bug. LLVM's DisableUnitAtATime will break X86 compilation (logan), and I saw this in the llvm PassManagerBuilder: // FIXME: We shouldn't bother with this anymore. MPM.add(createStripDeadPrototypesPass()); We follow the workaround above in the LLVM tree. It does magic. Change-Id: I699757f3385a91202d34141d7f154cd0e80bae03 --- src/compiler_llvm/compilation_unit.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/compiler_llvm/compilation_unit.cc') diff --git a/src/compiler_llvm/compilation_unit.cc b/src/compiler_llvm/compilation_unit.cc index 30c6aa1e14..9e2c33a2bf 100644 --- a/src/compiler_llvm/compilation_unit.cc +++ b/src/compiler_llvm/compilation_unit.cc @@ -430,8 +430,9 @@ bool CompilationUnit::MaterializeToFile(llvm::raw_ostream& out_stream) { pm_builder.OptLevel = 3; pm_builder.DisableSimplifyLibCalls = 1; pm_builder.DisableUnitAtATime = 1; - pm_builder.populateModulePassManager(pm); pm_builder.populateFunctionPassManager(fpm); + pm_builder.populateModulePassManager(pm); + pm.add(llvm::createStripDeadPrototypesPass()); // Add passes to emit ELF image { -- cgit v1.2.3-59-g8ed1b