]> granicus.if.org Git - clang/commitdiff
Fix -fdollars-in-identifiers Clang translation.
authorDaniel Dunbar <daniel@zuster.org>
Wed, 16 Dec 2009 20:10:18 +0000 (20:10 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 16 Dec 2009 20:10:18 +0000 (20:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91562 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/CC1Options.td
lib/Driver/Tools.cpp
lib/Frontend/CompilerInvocation.cpp

index e830e473df8f07b29584ff1bacdd50b664122ca8..688c7846ee9e007ef9d66fb3f1b0747c3d59b343 100644 (file)
@@ -308,6 +308,8 @@ def fno_assume_sane_operator_new : Flag<"-fno-assume-sane-operator-new">,
   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">,
index 8d823181279091361c50e1b14470839d5b95d49d..55008e3bbb340bb08d232952c768397ec51086af 100644 (file)
@@ -1043,9 +1043,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   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
index 025f5ddf94d0db8b51ed3530072cfd62803f887e..0a592b2e5af6740656456df674781747bd07da0a 100644 (file)
@@ -440,7 +440,7 @@ static void LangOptsToArgs(const LangOptions &Opts,
   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 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args,
   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);