[llvm-commits] [llvm-gcc-4.2] r84274 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Evan Cheng
evan.cheng at apple.com
Fri Oct 16 14:07:30 PDT 2009
Author: evancheng
Date: Fri Oct 16 16:07:29 2009
New Revision: 84274
URL: http://llvm.org/viewvc/llvm-project?rev=84274&view=rev
Log:
Match llvm CodeGenOpt change.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=84274&r1=84273&r2=84274&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Fri Oct 16 16:07:29 2009
@@ -655,13 +655,14 @@
FunctionPassManager *PM = PerFunctionPasses;
HasPerFunctionPasses = true;
- CodeGenOpt::Level OptLevel = CodeGenOpt::Default;
-
- switch (optimize) {
- default: break;
- case 0: OptLevel = CodeGenOpt::None; break;
- case 3: OptLevel = CodeGenOpt::Aggressive; break;
- }
+ CodeGenOpt::Level OptLevel = CodeGenOpt::Default; // -O2, -Os, and -Oz
+ if (optimize == 0)
+ OptLevel = CodeGenOpt::None;
+ else if (optimize == 1)
+ OptLevel = CodeGenOpt::Less;
+ else if (optimize == 3)
+ // -O3 and above.
+ OptLevel = CodeGenOpt::Aggressive;
// Normal mode, emit a .s file by running the code generator.
// Note, this also adds codegenerator level optimization passes.
More information about the llvm-commits
mailing list