[cfe-commits] r90123 - /cfe/trunk/lib/Driver/CC1Options.cpp

Daniel Dunbar daniel at zuster.org
Mon Nov 30 00:41:15 PST 2009


Author: ddunbar
Date: Mon Nov 30 02:41:13 2009
New Revision: 90123

URL: http://llvm.org/viewvc/llvm-project?rev=90123&view=rev
Log:
clang -cc1: Initialize LangOptions::{Optimize,NoInline}

Modified:
    cfe/trunk/lib/Driver/CC1Options.cpp

Modified: cfe/trunk/lib/Driver/CC1Options.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/CC1Options.cpp?rev=90123&r1=90122&r2=90123&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/CC1Options.cpp (original)
+++ cfe/trunk/lib/Driver/CC1Options.cpp Mon Nov 30 02:41:13 2009
@@ -579,8 +579,18 @@
   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) {





More information about the cfe-commits mailing list