summaryrefslogtreecommitdiff
path: root/src/compiler_llvm/compilation_unit.cc
diff options
context:
space:
mode:
author TDYa127 <tdy@google.com> 2012-05-15 06:09:27 -0700
committer Shih-wei Liao <sliao@google.com> 2012-05-15 08:52:33 -0700
commitce9c317b806aabd7d460a52e1c46f04f7e2c9bb6 (patch)
tree3a8cedf75c0261b553e5285c23427d8528216e56 /src/compiler_llvm/compilation_unit.cc
parentc3f8fa57268740f95a3c25e605bcab638b18d7b9 (diff)
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
Diffstat (limited to 'src/compiler_llvm/compilation_unit.cc')
-rw-r--r--src/compiler_llvm/compilation_unit.cc3
1 files changed, 2 insertions, 1 deletions
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
{