[cfe-commits] r91562 - in /cfe/trunk: include/clang/Driver/CC1Options.td lib/Driver/Tools.cpp lib/Frontend/CompilerInvocation.cpp

Daniel Dunbar daniel at zuster.org
Wed Dec 16 12:10:19 PST 2009


Author: ddunbar
Date: Wed Dec 16 14:10:18 2009
New Revision: 91562

URL: http://llvm.org/viewvc/llvm-project?rev=91562&view=rev
Log:
Fix -fdollars-in-identifiers Clang translation.

Modified:
    cfe/trunk/include/clang/Driver/CC1Options.td
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=91562&r1=91561&r2=91562&view=diff

==============================================================================
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Wed Dec 16 14:10:18 2009
@@ -308,6 +308,8 @@
   HelpText<"Don't assume that C++'s new operator is sane">;
 def fdollars_in_identifiers : Flag<"-fdollars-in-identifiers">,
   HelpText<"Allow '$' in identifiers">;
+def fno_dollars_in_identifiers : Flag<"-fno-dollars-in-identifiers">,
+  HelpText<"Disallow '$' in identifiers">;
 def femit_all_decls : Flag<"-femit-all-decls">,
   HelpText<"Emit all declarations, even if unused">;
 def fblocks : Flag<"-fblocks">,

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

==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Dec 16 14:10:18 2009
@@ -1043,9 +1043,9 @@
   if (Arg *A = Args.getLastArg(options::OPT_fdollars_in_identifiers,
                                options::OPT_fno_dollars_in_identifiers)) {
     if (A->getOption().matches(options::OPT_fdollars_in_identifiers))
-      CmdArgs.push_back("-fdollars-in-identifiers=1");
+      CmdArgs.push_back("-fdollars-in-identifiers");
     else
-      CmdArgs.push_back("-fdollars-in-identifiers=0");
+      CmdArgs.push_back("-fno-dollars-in-identifiers");
   }
 
   // -funit-at-a-time is default, and we don't support -fno-unit-at-a-time for

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=91562&r1=91561&r2=91562&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Wed Dec 16 14:10:18 2009
@@ -440,7 +440,7 @@
   if (Opts.DollarIdents)
     Res.push_back("-fdollars-in-identifiers");
   if (Opts.Microsoft)
-    Res.push_back("-fms-extensions=1");
+    Res.push_back("-fms-extensions");
   if (Opts.ObjCNonFragileABI)
     Res.push_back("-fobjc-nonfragile-abi");
   // NoInline is implicit.
@@ -1126,10 +1126,9 @@
   if (Args.hasArg(OPT_trigraphs))
     Opts.Trigraphs = 1;
 
-  Opts.DollarIdents = !Opts.AsmPreprocessor;
-  if (Args.hasArg(OPT_fdollars_in_identifiers))
-    Opts.DollarIdents = 1;
-
+  Opts.DollarIdents = Args.hasFlag(OPT_fdollars_in_identifiers,
+                                   OPT_fno_dollars_in_identifiers,
+                                   !Opts.AsmPreprocessor);
   Opts.PascalStrings = Args.hasArg(OPT_fpascal_strings);
   Opts.Microsoft = Args.hasArg(OPT_fms_extensions);
   Opts.WritableStrings = Args.hasArg(OPT_fwritable_strings);





More information about the cfe-commits mailing list