From: Daniel Dunbar Date: Wed, 16 Dec 2009 20:10:18 +0000 (+0000) Subject: Fix -fdollars-in-identifiers Clang translation. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8663b180085e9bc7a0a87c80cc3f722efef99e79;p=clang Fix -fdollars-in-identifiers Clang translation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91562 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index e830e473df..688c7846ee 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -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">, diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 8d82318127..55008e3bbb 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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 diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 025f5ddf94..0a592b2e5a 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -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);