[cfe-commits] r142797 - in /cfe/trunk: lib/Frontend/CompilerInvocation.cpp test/Lexer/ms-extensions.c

Douglas Gregor dgregor at apple.com
Mon Oct 24 08:27:23 PDT 2011


Author: dgregor
Date: Mon Oct 24 10:27:23 2011
New Revision: 142797

URL: http://llvm.org/viewvc/llvm-project?rev=142797&view=rev
Log:
Make -fms-compatibility imply -fms-extensions. Fixes PR11204.

Modified:
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp
    cfe/trunk/test/Lexer/ms-extensions.c

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=142797&r1=142796&r2=142797&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Mon Oct 24 10:27:23 2011
@@ -627,6 +627,8 @@
     Res.push_back("-fgnu-keywords");
   if (Opts.MicrosoftExt)
     Res.push_back("-fms-extensions");
+  if (Opts.MicrosoftMode)
+    Res.push_back("-fms-compatibility");
   if (Opts.MSCVersion != 0)
     Res.push_back("-fmsc-version=" + llvm::utostr(Opts.MSCVersion));
   if (Opts.Borland)
@@ -1697,7 +1699,8 @@
                                    OPT_fno_dollars_in_identifiers,
                                    Opts.DollarIdents);
   Opts.PascalStrings = Args.hasArg(OPT_fpascal_strings);
-  Opts.MicrosoftExt = Args.hasArg(OPT_fms_extensions);
+  Opts.MicrosoftExt
+    = Args.hasArg(OPT_fms_extensions) || Args.hasArg(OPT_fms_compatibility);
   Opts.MicrosoftMode = Args.hasArg(OPT_fms_compatibility);
   Opts.MSCVersion = Args.getLastArgIntValue(OPT_fmsc_version, 0, Diags);
   Opts.Borland = Args.hasArg(OPT_fborland_extensions);

Modified: cfe/trunk/test/Lexer/ms-extensions.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/ms-extensions.c?rev=142797&r1=142796&r2=142797&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/ms-extensions.c (original)
+++ cfe/trunk/test/Lexer/ms-extensions.c Mon Oct 24 10:27:23 2011
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fms-compatibility %s
 
 __int8 x1  = 3i8;
 __int16 x2 = 4i16;





More information about the cfe-commits mailing list