[llvm-commits] [llvm] r157705 - /llvm/trunk/tools/lto/LTOCodeGenerator.cpp
David Blaikie
dblaikie at gmail.com
Wed May 30 11:42:51 PDT 2012
Author: dblaikie
Date: Wed May 30 13:42:51 2012
New Revision: 157705
URL: http://llvm.org/viewvc/llvm-project?rev=157705&view=rev
Log:
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)
Modified:
llvm/trunk/tools/lto/LTOCodeGenerator.cpp
Modified: llvm/trunk/tools/lto/LTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOCodeGenerator.cpp?rev=157705&r1=157704&r2=157705&view=diff
==============================================================================
--- llvm/trunk/tools/lto/LTOCodeGenerator.cpp (original)
+++ llvm/trunk/tools/lto/LTOCodeGenerator.cpp Wed May 30 13:42:51 2012
@@ -240,7 +240,8 @@
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 @@
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;
}
More information about the llvm-commits
mailing list