summaryrefslogtreecommitdiff
path: root/tools/lto
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-05-30 18:42:51 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-05-30 18:42:51 +0000
commit4f56a30e0d604a3081c1e696467e57784267bc20 (patch)
treedb83641269bd288b6279d0bc581e8be6808ca44b /tools/lto
parent127563b216eadf756e03f0adf2c3900bf244b504 (diff)
downloadllvm-4f56a30e0d604a3081c1e696467e57784267bc20.tar.gz
llvm-4f56a30e0d604a3081c1e696467e57784267bc20.tar.bz2
llvm-4f56a30e0d604a3081c1e696467e57784267bc20.tar.xz
Reinstate -O3 for LTO.
This broke in r144788 when the CodeGenOpt option was moved from everywhere else (specifically, from addPassesToEmitFile) to createTargetMachine. Since LTOCodeGenerator wasn't passing the 4th argument, when the 4th parameter became the 3rd, it silently continued to compile (int->bool conversion) but meant something completely different. This change preserves the existing (accidental) and previous (default) semantics of the addPassesToEmitFile and restores the previous/intended CodeGenOpt argument by passing it appropriately to createTargetMachine. (discovered by pending changes to -Wconversion to catch constant->bool conversions) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto')
-rw-r--r--tools/lto/LTOCodeGenerator.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp
index 6382a3f219..08139470be 100644
--- a/tools/lto/LTOCodeGenerator.cpp
+++ b/tools/lto/LTOCodeGenerator.cpp
@@ -240,7 +240,8 @@ bool LTOCodeGenerator::determineTarget(std::string& errMsg) {
std::string FeatureStr = Features.getString();
TargetOptions Options;
_target = march->createTargetMachine(Triple, _mCpu, FeatureStr, Options,
- RelocModel);
+ RelocModel, CodeModel::Default,
+ CodeGenOpt::Aggressive);
}
return false;
}
@@ -372,8 +373,7 @@ bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,
formatted_raw_ostream Out(out);
if (_target->addPassesToEmitFile(*codeGenPasses, Out,
- TargetMachine::CGFT_ObjectFile,
- CodeGenOpt::Aggressive)) {
+ TargetMachine::CGFT_ObjectFile)) {
errMsg = "target file type not supported";
return true;
}