[cfe-commits] r60568 - /cfe/trunk/Driver/clang.cpp

Chris Lattner sabre at nondot.org
Thu Dec 4 16:10:45 PST 2008


Author: lattner
Date: Thu Dec  4 18:10:44 2008
New Revision: 60568

URL: http://llvm.org/viewvc/llvm-project?rev=60568&view=rev
Log:
-std=c99 defaults blocks to off even on darwin, but -fblocks overrides
even it. 

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=60568&r1=60567&r2=60568&view=diff

==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Thu Dec  4 18:10:44 2008
@@ -569,8 +569,16 @@
   
   // Mimicing gcc's behavior, trigraphs are only enabled if -trigraphs or -ansi
   // is specified, or -std is set to a conforming mode.  
-  Options.Trigraphs = LangStd < lang_gnu_START || Trigraphs ? 1 : 0;
-
+  Options.Trigraphs = LangStd < lang_gnu_START;
+  if (Trigraphs.getPosition())
+    Options.Trigraphs = Trigraphs;  // Command line option wins.
+
+  // If in a conformant language mode (e.g. -std=c99) Blocks defaults to off
+  // even if they are normally on for the target.  In GNU modes (e.g.
+  // -std=gnu99) the default for blocks depends on the target settings.
+  if (LangStd < lang_gnu_START)
+    Options.Blocks = 0;
+  
   Options.DollarIdents = 1;  // FIXME: Really a target property.
   if (PascalStrings.getPosition())
     Options.PascalStrings = PascalStrings;





More information about the cfe-commits mailing list