aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-10-29 03:42:18 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-10-29 03:42:18 +0000
commit8e8f3b7f61548391b675831f350b4ede040dfdce (patch)
tree00faf41c41d67b0f04a9b405077e2e7fa6fcd16b
parent0b4f69f07ce9665a82821af19df7480db904424f (diff)
Choose CompileOptions (optimization passes) to match llvm-gcc more
closely. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58361 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Driver/clang.cpp6
-rw-r--r--include/clang/Driver/CompileOptions.h4
2 files changed, 7 insertions, 3 deletions
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 3cf654f458..696e8842c9 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -1142,7 +1142,11 @@ OptLevel("O", llvm::cl::Prefix,
static void InitializeCompileOptions(CompileOptions &Opts) {
Opts.OptimizationLevel = OptLevel;
Opts.OptimizeSize = OptSize;
- // FIXME: Wire other options.
+
+ // FIXME: There are llvm-gcc options to control these selectively.
+ Opts.InlineFunctions = (Opts.OptimizationLevel > 1);
+ Opts.UnrollLoops = (Opts.OptimizationLevel > 1 && !OptSize);
+ Opts.SimplifyLibCalls = 1;
}
//===----------------------------------------------------------------------===//
diff --git a/include/clang/Driver/CompileOptions.h b/include/clang/Driver/CompileOptions.h
index 560944566a..50865536dc 100644
--- a/include/clang/Driver/CompileOptions.h
+++ b/include/clang/Driver/CompileOptions.h
@@ -34,8 +34,8 @@ public:
CompileOptions() {
OptimizationLevel = 0;
OptimizeSize = 0;
- UnitAtATime = InlineFunctions = SimplifyLibCalls = 1;
- UnrollLoops = 1;
+ UnitAtATime = 1;
+ InlineFunctions = SimplifyLibCalls = UnrollLoops = 0;
VerifyModule = 1;
}
};