[cfe-commits] r83064 - /cfe/trunk/tools/clang-cc/clang-cc.cpp

Douglas Gregor dgregor at apple.com
Tue Sep 29 07:42:44 PDT 2009


Author: dgregor
Date: Tue Sep 29 09:42:43 2009
New Revision: 83064

URL: http://llvm.org/viewvc/llvm-project?rev=83064&view=rev
Log:
Set GNUMode only for the "gnu" language standard options, from Ken Dyck!

Modified:
    cfe/trunk/tools/clang-cc/clang-cc.cpp

Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=83064&r1=83063&r2=83064&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Tue Sep 29 09:42:43 2009
@@ -518,8 +518,7 @@
 enum LangStds {
   lang_unspecified,
   lang_c89, lang_c94, lang_c99,
-  lang_gnu_START,
-  lang_gnu89 = lang_gnu_START, lang_gnu99,
+  lang_gnu89, lang_gnu99,
   lang_cxx98, lang_gnucxx98,
   lang_cxx0x, lang_gnucxx0x
 };
@@ -752,7 +751,22 @@
   }
 
   // GNUMode - Set if we're in gnu99, gnu89, gnucxx98, etc.
-  Options.GNUMode = LangStd >= lang_gnu_START;
+  switch (LangStd) {
+  default: assert(0 && "Unknown language standard!");
+  case lang_gnucxx0x:
+  case lang_gnucxx98:
+  case lang_gnu99:
+  case lang_gnu89:
+    Options.GNUMode = 1;
+    break;
+  case lang_cxx0x:
+  case lang_cxx98:
+  case lang_c99:
+  case lang_c94:
+  case lang_c89:
+    Options.GNUMode = 0;
+    break;
+  }
 
   if (Options.CPlusPlus) {
     Options.C99 = 0;





More information about the cfe-commits mailing list