[cfe-commits] r58374 - /cfe/trunk/Driver/clang.cpp
Daniel Dunbar
daniel at zuster.org
Wed Oct 29 00:56:13 PDT 2008
Author: ddunbar
Date: Wed Oct 29 02:56:11 2008
New Revision: 58374
URL: http://llvm.org/viewvc/llvm-project?rev=58374&view=rev
Log:
Improve llvm-gcc compatibility, -Os implies -O2 (sortof).
Modified:
cfe/trunk/Driver/clang.cpp
Modified: cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/clang.cpp?rev=58374&r1=58373&r2=58374&view=diff
==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Wed Oct 29 02:56:11 2008
@@ -1140,8 +1140,14 @@
llvm::cl::init(0));
static void InitializeCompileOptions(CompileOptions &Opts) {
- Opts.OptimizationLevel = OptLevel;
Opts.OptimizeSize = OptSize;
+ if (OptSize) {
+ // -Os implies -O2
+ // FIXME: Diagnose conflicting options.
+ Opts.OptimizationLevel = 2;
+ } else {
+ Opts.OptimizationLevel = OptLevel;
+ }
// FIXME: There are llvm-gcc options to control these selectively.
Opts.InlineFunctions = (Opts.OptimizationLevel > 1);
More information about the cfe-commits
mailing list