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/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 8d82318..55008e3 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -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
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 025f5dd..0a592b2 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -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);