]> granicus.if.org Git - clang/commitdiff
fix -fdollars-in-identifiers to have a default that is overriden
authorChris Lattner <sabre@nondot.org>
Sun, 19 Apr 2009 07:06:52 +0000 (07:06 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 19 Apr 2009 07:06:52 +0000 (07:06 +0000)
by the command line option if present.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69521 91177308-0d34-0410-b5e6-96231b3b80d8

tools/clang-cc/clang-cc.cpp

index 07c1518e6def930014e4f9e3805da08bb19da4c7..4e5ff5d2595794380d8a92d686c65a9e94fdad47 100644 (file)
@@ -784,10 +784,11 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK,
   if (!Options.ObjC1 && !Options.GNUMode)
     Options.Blocks = 0;
   
-  // Never accept '$' in identifiers when preprocessing assembler.
-  if (LK != langkind_asm_cpp)
-    Options.DollarIdents = true;  // FIXME: target property?
-  else
+  // Default to not accepting '$' in identifiers when preprocessing assembler,
+  // but do accept when preprocessing C.  FIXME: these defaults are right for
+  // darwin, are they right everywhere?
+  Options.DollarIdents = LK != langkind_asm_cpp;
+  if (DollarsInIdents.getPosition())  // Explicit setting overrides default.
     Options.DollarIdents = DollarsInIdents;
   
   if (PascalStrings.getPosition())