aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/CC1Options.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-30 08:41:13 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-30 08:41:13 +0000
commit1c5944c77383b1f3cbf33ea9c656880c0bd42eff (patch)
tree876acde4666aa709c9f76cb6fc8e921d80a2e7b0 /lib/Driver/CC1Options.cpp
parent78d5590d896cb95eea972754ad40735927ae585f (diff)
clang -cc1: Initialize LangOptions::{Optimize,NoInline}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90123 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/CC1Options.cpp')
-rw-r--r--lib/Driver/CC1Options.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Driver/CC1Options.cpp b/lib/Driver/CC1Options.cpp
index 88cbd5491d..667335e0b4 100644
--- a/lib/Driver/CC1Options.cpp
+++ b/lib/Driver/CC1Options.cpp
@@ -579,8 +579,18 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.PICLevel = getLastArgIntValue(Args, OPT_pic_level, 0, Diags);
Opts.Static = Args.hasArg(OPT_static_define);
Opts.OptimizeSize = 0;
- Opts.Optimize = 0; // FIXME!
- Opts.NoInline = 0; // FIXME!
+
+ // FIXME: Eliminate this dependency.
+ unsigned Opt =
+ Args.hasArg(OPT_Os) ? 2 : getLastArgIntValue(Args, OPT_O, 0, Diags);
+ Opts.Optimize = Opt != 0;
+
+ // This is the __NO_INLINE__ define, which just depends on things like the
+ // optimization level and -fno-inline, not actually whether the backend has
+ // inlining enabled.
+ //
+ // FIXME: This is affected by other options (-fno-inline).
+ Opts.NoInline = !Opt;
unsigned SSP = getLastArgIntValue(Args, OPT_stack_protector, 0, Diags);
switch (SSP) {