[cfe-commits] r69520 - in /cfe/trunk: test/Preprocessor/assembler-with-cpp.c tools/clang-cc/clang-cc.cpp
Chris Lattner
sabre at nondot.org
Sun Apr 19 00:00:02 PDT 2009
Author: lattner
Date: Sun Apr 19 02:00:02 2009
New Revision: 69520
URL: http://llvm.org/viewvc/llvm-project?rev=69520&view=rev
Log:
fix rdar://6804322 by wiring up -fdollars-in-identifiers
with assembler-with-cpp mode.
Modified:
cfe/trunk/test/Preprocessor/assembler-with-cpp.c
cfe/trunk/tools/clang-cc/clang-cc.cpp
Modified: cfe/trunk/test/Preprocessor/assembler-with-cpp.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/assembler-with-cpp.c?rev=69520&r1=69519&r2=69520&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/assembler-with-cpp.c (original)
+++ cfe/trunk/test/Preprocessor/assembler-with-cpp.c Sun Apr 19 02:00:02 2009
@@ -1,4 +1,4 @@
-// RUN: clang-cc -x assembler-with-cpp -E %s > %t &&
+// RUN: clang-cc -x assembler-with-cpp -fdollars-in-identifiers=0 -E %s > %t &&
#ifndef __ASSEMBLER__
#error "__ASSEMBLER__ not defined"
@@ -42,6 +42,15 @@
5: M5()
+// rdar://6804322
+// RUN: grep -F "6: blarg $foo" %t &&
+#define FOO(name) name ## $foo
+6: FOO(blarg)
+
+// RUN: clang-cc -x assembler-with-cpp -fdollars-in-identifiers=1 -E %s > %t &&
+// RUN: grep -F "7: blarg$foo" %t &&
+#define FOO(name) name ## $foo
+7: FOO(blarg)
// RUN: true
Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=69520&r1=69519&r2=69520&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Sun Apr 19 02:00:02 2009
@@ -618,22 +618,22 @@
// value).
static llvm::cl::opt<bool>
Exceptions("fexceptions",
- llvm::cl::desc("Enable support for exception handling."));
+ llvm::cl::desc("Enable support for exception handling"));
static llvm::cl::opt<bool>
GNURuntime("fgnu-runtime",
llvm::cl::desc("Generate output compatible with the standard GNU "
- "Objective-C runtime."));
+ "Objective-C runtime"));
static llvm::cl::opt<bool>
NeXTRuntime("fnext-runtime",
llvm::cl::desc("Generate output compatible with the NeXT "
- "runtime."));
+ "runtime"));
static llvm::cl::opt<bool>
-Trigraphs("trigraphs", llvm::cl::desc("Process trigraph sequences."));
+Trigraphs("trigraphs", llvm::cl::desc("Process trigraph sequences"));
static llvm::cl::list<std::string>
TargetFeatures("mattr", llvm::cl::CommaSeparated,
@@ -643,6 +643,9 @@
TemplateDepth("ftemplate-depth", llvm::cl::init(99),
llvm::cl::desc("Maximum depth of recursive template "
"instantiation"));
+static llvm::cl::opt<bool>
+DollarsInIdents("fdollars-in-identifiers",
+ llvm::cl::desc("Allow '$' in identifiers"));
static llvm::cl::opt<bool>
@@ -679,8 +682,6 @@
static llvm::cl::opt<bool>
StaticDefine("static-define", llvm::cl::desc("Should __STATIC__ be defined"));
-// FIXME: add:
-// -fdollars-in-identifiers
static void InitializeLanguageStandard(LangOptions &Options, LangKind LK,
TargetInfo *Target) {
// Allow the target to set the default the langauge options as it sees fit.
@@ -785,7 +786,10 @@
// Never accept '$' in identifiers when preprocessing assembler.
if (LK != langkind_asm_cpp)
- Options.DollarIdents = 1; // FIXME: Really a target property.
+ Options.DollarIdents = true; // FIXME: target property?
+ else
+ Options.DollarIdents = DollarsInIdents;
+
if (PascalStrings.getPosition())
Options.PascalStrings = PascalStrings;
Options.Microsoft = MSExtensions;
More information about the cfe-commits
mailing list